WebKit/0000755000175000017500000000000011527024270010337 5ustar leeleeWebKit/mac/0000755000175000017500000000000011527024256011103 5ustar leeleeWebKit/mac/DOM/0000755000175000017500000000000011527024242011515 5ustar leeleeWebKit/mac/DOM/WebDOMOperationsInternal.h0000644000175000017500000000324511165255266016522 0ustar leelee/* * Copyright (C) 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @interface DOMDocument (WebDOMDocumentOperationsInternal) - (DOMRange *)_documentRange; @end WebKit/mac/DOM/WebDOMOperationsPrivate.h0000644000175000017500000000341111202354425016340 0ustar leelee/* * Copyright (C) 2005, 2008, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @interface DOMDocument (WebDOMDocumentOperationsPrivate) - (NSArray *)_focusableNodes; @end @interface DOMNode (WebDOMNodeOperationsPendingPublic) - (NSString *)markupString; @end WebKit/mac/DOM/WebDOMOperations.mm0000644000175000017500000001133311227447501015176 0ustar leelee/* * Copyright (C) 2005, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebDOMOperationsPrivate.h" #import "DOMDocumentInternal.h" #import "DOMNodeInternal.h" #import "DOMRangeInternal.h" #import "WebArchiveInternal.h" #import "WebDataSourcePrivate.h" #import "WebFrameInternal.h" #import "WebFramePrivate.h" #import "WebKitNSStringExtras.h" #import #import #import #import #import #import #import using namespace WebCore; @implementation DOMNode (WebDOMNodeOperations) - (WebArchive *)webArchive { return [[[WebArchive alloc] _initWithCoreLegacyWebArchive:LegacyWebArchive::create(core(self))] autorelease]; } - (NSString *)markupString { return createFullMarkup(core(self)); } @end /* This doesn't appear to be used by anyone. We should consider removing this. */ @implementation DOMNode (WebDOMNodeOperationsInternal) - (NSArray *)_subresourceURLs { ListHashSet urls; core(self)->getSubresourceURLs(urls); if (!urls.size()) return nil; NSMutableArray *array = [NSMutableArray arrayWithCapacity:urls.size()]; ListHashSet::iterator end = urls.end(); for (ListHashSet::iterator it = urls.begin(); it != end; ++it) [array addObject:(NSURL *)*it]; return array; } @end @implementation DOMDocument (WebDOMDocumentOperations) - (WebFrame *)webFrame { Document* document = core(self); Frame* frame = document->frame(); if (!frame) return nil; return kit(frame); } - (NSURL *)URLWithAttributeString:(NSString *)string { // FIXME: Is deprecatedParseURL appropriate here? return core(self)->completeURL(deprecatedParseURL(string)); } @end @implementation DOMDocument (WebDOMDocumentOperationsInternal) /* This doesn't appear to be used by anyone. We should consider removing this. */ - (DOMRange *)_createRangeWithNode:(DOMNode *)node { DOMRange *range = [self createRange]; [range selectNode:node]; return range; } - (DOMRange *)_documentRange { return [self _createRangeWithNode:[self documentElement]]; } @end @implementation DOMDocument (WebDOMDocumentOperationsPrivate) - (NSArray *)_focusableNodes { Vector > nodes; core(self)->getFocusableNodes(nodes); NSMutableArray *array = [NSMutableArray arrayWithCapacity:nodes.size()]; for (unsigned i = 0; i < nodes.size(); ++i) [array addObject:kit(nodes[i].get())]; return array; } @end @implementation DOMRange (WebDOMRangeOperations) - (WebArchive *)webArchive { return [[[WebArchive alloc] _initWithCoreLegacyWebArchive:LegacyWebArchive::create(core(self))] autorelease]; } - (NSString *)markupString { return createFullMarkup(core(self)); } @end @implementation DOMHTMLFrameElement (WebDOMHTMLFrameElementOperations) - (WebFrame *)contentFrame { return [[self contentDocument] webFrame]; } @end @implementation DOMHTMLIFrameElement (WebDOMHTMLIFrameElementOperations) - (WebFrame *)contentFrame { return [[self contentDocument] webFrame]; } @end @implementation DOMHTMLObjectElement (WebDOMHTMLObjectElementOperations) - (WebFrame *)contentFrame { return [[self contentDocument] webFrame]; } @end WebKit/mac/DOM/WebDOMOperations.h0000644000175000017500000000663010360512352015012 0ustar leelee/* * Copyright (C) 2004, 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import #import @class WebArchive; @class WebFrame; @interface DOMNode (WebDOMNodeOperations) /*! @method webArchive @result A WebArchive representing the node and the children of the node. */ - (WebArchive *)webArchive; @end @interface DOMDocument (WebDOMDocumentOperations) /*! @method webFrame @abstract Returns the frame of the DOM document. */ - (WebFrame *)webFrame; /*! @method URLWithAttributeString: @abstract Constructs a URL given an attribute string. @discussion This method constructs a URL given an attribute string just as WebKit does. An attribute string is the value of an attribute of an element such as the href attribute on the DOMHTMLAnchorElement class. This method is only applicable to attributes that refer to URLs. */ - (NSURL *)URLWithAttributeString:(NSString *)string; @end @interface DOMRange (WebDOMRangeOperations) /*! @method webArchive @result A WebArchive representing the range. */ - (WebArchive *)webArchive; /*! @method markupString @result A markup string representing the range. */ - (NSString *)markupString; @end @interface DOMHTMLFrameElement (WebDOMHTMLFrameElementOperations) /*! @method contentFrame @abstract Returns the content frame of the element. */ - (WebFrame *)contentFrame; @end @interface DOMHTMLIFrameElement (WebDOMHTMLIFrameElementOperations) /*! @method contentFrame @abstract Returns the content frame of the element. */ - (WebFrame *)contentFrame; @end @interface DOMHTMLObjectElement (WebDOMHTMLObjectElementOperations) /*! @method contentFrame @abstract Returns the content frame of the element. @discussion Returns non-nil only if the object represents a child frame such as if the data of the object is HTML content. */ - (WebFrame *)contentFrame; @end WebKit/mac/icu/0000755000175000017500000000000011527024242011656 5ustar leeleeWebKit/mac/icu/unicode/0000755000175000017500000000000011527024242013304 5ustar leeleeWebKit/mac/icu/unicode/umachine.h0000644000175000017500000002636110360512352015254 0ustar leelee/* ****************************************************************************** * * Copyright (C) 1999-2004, International Business Machines * Corporation and others. All Rights Reserved. * ****************************************************************************** * file name: umachine.h * encoding: US-ASCII * tab size: 8 (not used) * indentation:4 * * created on: 1999sep13 * created by: Markus W. Scherer * * This file defines basic types and constants for utf.h to be * platform-independent. umachine.h and utf.h are included into * utypes.h to provide all the general definitions for ICU. * All of these definitions used to be in utypes.h before * the UTF-handling macros made this unmaintainable. */ #ifndef __UMACHINE_H__ #define __UMACHINE_H__ /** * \file * \brief Basic types and constants for UTF * *

Basic types and constants for UTF

* This file defines basic types and constants for utf.h to be * platform-independent. umachine.h and utf.h are included into * utypes.h to provide all the general definitions for ICU. * All of these definitions used to be in utypes.h before * the UTF-handling macros made this unmaintainable. * */ /*==========================================================================*/ /* Include platform-dependent definitions */ /* which are contained in the platform-specific file platform.h */ /*==========================================================================*/ #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) # include "unicode/pwin32.h" #else # include "unicode/platform.h" #endif /* * ANSI C headers: * stddef.h defines wchar_t */ #include /*==========================================================================*/ /* XP_CPLUSPLUS is a cross-platform symbol which should be defined when */ /* using C++. It should not be defined when compiling under C. */ /*==========================================================================*/ #ifdef __cplusplus # ifndef XP_CPLUSPLUS # define XP_CPLUSPLUS # endif #else # undef XP_CPLUSPLUS #endif /*==========================================================================*/ /* For C wrappers, we use the symbol U_STABLE. */ /* This works properly if the includer is C or C++. */ /* Functions are declared U_STABLE return-type U_EXPORT2 function-name()... */ /*==========================================================================*/ /** * \def U_CFUNC * This is used in a declaration of a library private ICU C function. * @stable ICU 2.4 */ /** * \def U_CDECL_BEGIN * This is used to begin a declaration of a library private ICU C API. * @stable ICU 2.4 */ /** * \def U_CDECL_END * This is used to end a declaration of a library private ICU C API * @stable ICU 2.4 */ #ifdef XP_CPLUSPLUS # define U_CFUNC extern "C" # define U_CDECL_BEGIN extern "C" { # define U_CDECL_END } #else # define U_CFUNC extern # define U_CDECL_BEGIN # define U_CDECL_END #endif /** * \def U_NAMESPACE_BEGIN * This is used to begin a declaration of a public ICU C++ API. * If the compiler doesn't support namespaces, this does nothing. * @stable ICU 2.4 */ /** * \def U_NAMESPACE_END * This is used to end a declaration of a public ICU C++ API * If the compiler doesn't support namespaces, this does nothing. * @stable ICU 2.4 */ /** * \def U_NAMESPACE_USE * This is used to specify that the rest of the code uses the * public ICU C++ API namespace. * If the compiler doesn't support namespaces, this does nothing. * @stable ICU 2.4 */ /** * \def U_NAMESPACE_QUALIFIER * This is used to qualify that a function or class is part of * the public ICU C++ API namespace. * If the compiler doesn't support namespaces, this does nothing. * @stable ICU 2.4 */ /* Define namespace symbols if the compiler supports it. */ #if U_HAVE_NAMESPACE # define U_NAMESPACE_BEGIN namespace U_ICU_NAMESPACE { # define U_NAMESPACE_END } # define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE; # define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE:: #else # define U_NAMESPACE_BEGIN # define U_NAMESPACE_END # define U_NAMESPACE_USE # define U_NAMESPACE_QUALIFIER #endif /** This is used to declare a function as a public ICU C API @stable ICU 2.0*/ #define U_CAPI U_CFUNC U_EXPORT #define U_STABLE U_CAPI #define U_DRAFT U_CAPI #define U_DEPRECATED U_CAPI #define U_OBSOLETE U_CAPI #define U_INTERNAL U_CAPI /*==========================================================================*/ /* limits for int32_t etc., like in POSIX inttypes.h */ /*==========================================================================*/ #ifndef INT8_MIN /** The smallest value an 8 bit signed integer can hold @stable ICU 2.0 */ # define INT8_MIN ((int8_t)(-128)) #endif #ifndef INT16_MIN /** The smallest value a 16 bit signed integer can hold @stable ICU 2.0 */ # define INT16_MIN ((int16_t)(-32767-1)) #endif #ifndef INT32_MIN /** The smallest value a 32 bit signed integer can hold @stable ICU 2.0 */ # define INT32_MIN ((int32_t)(-2147483647-1)) #endif #ifndef INT8_MAX /** The largest value an 8 bit signed integer can hold @stable ICU 2.0 */ # define INT8_MAX ((int8_t)(127)) #endif #ifndef INT16_MAX /** The largest value a 16 bit signed integer can hold @stable ICU 2.0 */ # define INT16_MAX ((int16_t)(32767)) #endif #ifndef INT32_MAX /** The largest value a 32 bit signed integer can hold @stable ICU 2.0 */ # define INT32_MAX ((int32_t)(2147483647)) #endif #ifndef UINT8_MAX /** The largest value an 8 bit unsigned integer can hold @stable ICU 2.0 */ # define UINT8_MAX ((uint8_t)(255U)) #endif #ifndef UINT16_MAX /** The largest value a 16 bit unsigned integer can hold @stable ICU 2.0 */ # define UINT16_MAX ((uint16_t)(65535U)) #endif #ifndef UINT32_MAX /** The largest value a 32 bit unsigned integer can hold @stable ICU 2.0 */ # define UINT32_MAX ((uint32_t)(4294967295U)) #endif #if defined(U_INT64_T_UNAVAILABLE) # error int64_t is required for decimal format and rule-based number format. #else # ifndef INT64_C /** * Provides a platform independent way to specify a signed 64-bit integer constant. * note: may be wrong for some 64 bit platforms - ensure your compiler provides INT64_C * @draft ICU 2.8 */ # define INT64_C(c) c ## LL # endif # ifndef UINT64_C /** * Provides a platform independent way to specify an unsigned 64-bit integer constant. * note: may be wrong for some 64 bit platforms - ensure your compiler provides UINT64_C * @draft ICU 2.8 */ # define UINT64_C(c) c ## ULL # endif # ifndef U_INT64_MIN /** The smallest value a 64 bit signed integer can hold @stable ICU 2.8 */ # define U_INT64_MIN ((int64_t)(INT64_C(-9223372036854775807)-1)) # endif # ifndef U_INT64_MAX /** The largest value a 64 bit signed integer can hold @stable ICU 2.8 */ # define U_INT64_MAX ((int64_t)(INT64_C(9223372036854775807))) # endif # ifndef U_UINT64_MAX /** The largest value a 64 bit unsigned integer can hold @stable ICU 2.8 */ # define U_UINT64_MAX ((uint64_t)(UINT64_C(18446744073709551615))) # endif #endif /*==========================================================================*/ /* Boolean data type */ /*==========================================================================*/ /** The ICU boolean type @stable ICU 2.0 */ typedef int8_t UBool; #ifndef TRUE /** The TRUE value of a UBool @stable ICU 2.0 */ # define TRUE 1 #endif #ifndef FALSE /** The FALSE value of a UBool @stable ICU 2.0 */ # define FALSE 0 #endif /*==========================================================================*/ /* Unicode data types */ /*==========================================================================*/ /* wchar_t-related definitions -------------------------------------------- */ /** * \def U_HAVE_WCHAR_H * Indicates whether is available (1) or not (0). Set to 1 by default. * * @stable ICU 2.0 */ #ifndef U_HAVE_WCHAR_H # define U_HAVE_WCHAR_H 1 #endif /** * \def U_SIZEOF_WCHAR_T * U_SIZEOF_WCHAR_T==sizeof(wchar_t) (0 means it is not defined or autoconf could not set it) * * @stable ICU 2.0 */ #if U_SIZEOF_WCHAR_T==0 # undef U_SIZEOF_WCHAR_T # define U_SIZEOF_WCHAR_T 4 #endif /* * \def U_WCHAR_IS_UTF16 * Defined if wchar_t uses UTF-16. * * @stable ICU 2.0 */ /* * \def U_WCHAR_IS_UTF32 * Defined if wchar_t uses UTF-32. * * @stable ICU 2.0 */ #if !defined(U_WCHAR_IS_UTF16) && !defined(U_WCHAR_IS_UTF32) # ifdef __STDC_ISO_10646__ # if (U_SIZEOF_WCHAR_T==2) # define U_WCHAR_IS_UTF16 # elif (U_SIZEOF_WCHAR_T==4) # define U_WCHAR_IS_UTF32 # endif # elif defined __UCS2__ # if (__OS390__ || __OS400__) && (U_SIZEOF_WCHAR_T==2) # define U_WCHAR_IS_UTF16 # endif # elif defined __UCS4__ # if (U_SIZEOF_WCHAR_T==4) # define U_WCHAR_IS_UTF32 # endif # elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) # define U_WCHAR_IS_UTF16 # endif #endif /* UChar and UChar32 definitions -------------------------------------------- */ /** Number of bytes in a UChar. @stable ICU 2.0 */ #define U_SIZEOF_UCHAR 2 /** * \var UChar * Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned. * If wchar_t is not 16 bits wide, then define UChar to be uint16_t. * This makes the definition of UChar platform-dependent * but allows direct string type compatibility with platforms with * 16-bit wchar_t types. * * @stable ICU 2.0 */ /* Define UChar to be compatible with wchar_t if possible. */ #if U_SIZEOF_WCHAR_T==2 typedef wchar_t UChar; #else typedef uint16_t UChar; #endif /** * Define UChar32 as a type for single Unicode code points. * UChar32 is a signed 32-bit integer (same as int32_t). * * The Unicode code point range is 0..0x10ffff. * All other values (negative or >=0x110000) are illegal as Unicode code points. * They may be used as sentinel values to indicate "done", "error" * or similar non-code point conditions. * * Before ICU 2.4 (Jitterbug 2146), UChar32 was defined * to be wchar_t if that is 32 bits wide (wchar_t may be signed or unsigned) * or else to be uint32_t. * That is, the definition of UChar32 was platform-dependent. * * @see U_SENTINEL * @stable ICU 2.4 */ typedef int32_t UChar32; /*==========================================================================*/ /* U_INLINE and U_ALIGN_CODE Set default values if these are not already */ /* defined. Definitions normally are in */ /* platform.h or the corresponding file for */ /* the OS in use. */ /*==========================================================================*/ /** * \def U_ALIGN_CODE * This is used to align code fragments to a specific byte boundary. * This is useful for getting consistent performance test results. * @internal */ #ifndef U_ALIGN_CODE # define U_ALIGN_CODE(n) #endif #ifndef U_INLINE # define U_INLINE #endif #include "unicode/urename.h" #endif WebKit/mac/icu/unicode/utypes.h0000644000175000017500000007471110360512352015016 0ustar leelee/* ********************************************************************** * Copyright (C) 1996-2004, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * * FILE NAME : UTYPES.H (formerly ptypes.h) * * Date Name Description * 12/11/96 helena Creation. * 02/27/97 aliu Added typedefs for UClassID, int8, int16, int32, * uint8, uint16, and uint32. * 04/01/97 aliu Added XP_CPLUSPLUS and modified to work under C as * well as C++. * Modified to use memcpy() for uprv_arrayCopy() fns. * 04/14/97 aliu Added TPlatformUtilities. * 05/07/97 aliu Added import/export specifiers (replacing the old * broken EXT_CLASS). Added version number for our * code. Cleaned up header. * 6/20/97 helena Java class name change. * 08/11/98 stephen UErrorCode changed from typedef to enum * 08/12/98 erm Changed T_ANALYTIC_PACKAGE_VERSION to 3 * 08/14/98 stephen Added uprv_arrayCopy() for int8_t, int16_t, int32_t * 12/09/98 jfitz Added BUFFER_OVERFLOW_ERROR (bug 1100066) * 04/20/99 stephen Cleaned up & reworked for autoconf. * Renamed to utypes.h. * 05/05/99 stephen Changed to use * 12/07/99 helena Moved copyright notice string from ucnv_bld.h here. ******************************************************************************* */ #ifndef UTYPES_H #define UTYPES_H #include "unicode/umachine.h" #include "unicode/utf.h" #include "unicode/uversion.h" #include "unicode/uconfig.h" #ifdef U_HIDE_DRAFT_API #include "unicode/udraft.h" #endif #ifdef U_HIDE_DEPRECATED_API #include "unicode/udeprctd.h" #endif #ifdef U_HIDE_DEPRECATED_API #include "unicode/uobslete.h" #endif /*! * \file * \brief Basic definitions for ICU, for both C and C++ APIs * * This file defines basic types, constants, and enumerations directly or * indirectly by including other header files, especially utf.h for the * basic character and string definitions and umachine.h for consistent * integer and other types. */ /*===========================================================================*/ /* char Character set family */ /*===========================================================================*/ /** * U_CHARSET_FAMILY is equal to this value when the platform is an ASCII based platform. * @stable ICU 2.0 */ #define U_ASCII_FAMILY 0 /** * U_CHARSET_FAMILY is equal to this value when the platform is an EBCDIC based platform. * @stable ICU 2.0 */ #define U_EBCDIC_FAMILY 1 /** * \def U_CHARSET_FAMILY * *

These definitions allow to specify the encoding of text * in the char data type as defined by the platform and the compiler. * It is enough to determine the code point values of "invariant characters", * which are the ones shared by all encodings that are in use * on a given platform.

* *

Those "invariant characters" should be all the uppercase and lowercase * latin letters, the digits, the space, and "basic punctuation". * Also, '\\n', '\\r', '\\t' should be available.

* *

The list of "invariant characters" is:
* \code * A-Z a-z 0-9 SPACE " % & ' ( ) * + , - . / : ; < = > ? _ * \endcode *
* (52 letters + 10 numbers + 20 punc/sym/space = 82 total)

* *

This matches the IBM Syntactic Character Set (CS 640).

* *

In other words, all the graphic characters in 7-bit ASCII should * be safely accessible except the following:

* * \code * '\' * '[' * ']' * '{' * '}' * '^' * '~' * '!' * '#' * '|' * '$' * '@' * '`' * \endcode * @stable ICU 2.0 */ #ifndef U_CHARSET_FAMILY # define U_CHARSET_FAMILY 0 #endif /*===========================================================================*/ /* ICUDATA naming scheme */ /*===========================================================================*/ /** * \def U_ICUDATA_TYPE_LETTER * * This is a platform-dependent string containing one letter: * - b for big-endian, ASCII-family platforms * - l for little-endian, ASCII-family platforms * - e for big-endian, EBCDIC-family platforms * This letter is part of the common data file name. * @stable ICU 2.0 */ /** * \def U_ICUDATA_TYPE_LITLETTER * The non-string form of U_ICUDATA_TYPE_LETTER * @stable ICU 2.0 */ #if U_CHARSET_FAMILY # if U_IS_BIG_ENDIAN /* EBCDIC - should always be BE */ # define U_ICUDATA_TYPE_LETTER "e" # define U_ICUDATA_TYPE_LITLETTER e # else # error "Don't know what to do with little endian EBCDIC!" # define U_ICUDATA_TYPE_LETTER "x" # define U_ICUDATA_TYPE_LITLETTER x # endif #else # if U_IS_BIG_ENDIAN /* Big-endian ASCII */ # define U_ICUDATA_TYPE_LETTER "b" # define U_ICUDATA_TYPE_LITLETTER b # else /* Little-endian ASCII */ # define U_ICUDATA_TYPE_LETTER "l" # define U_ICUDATA_TYPE_LITLETTER l # endif #endif /** * A single string literal containing the icudata stub name. i.e. 'icudt18e' for * ICU 1.8.x on EBCDIC, etc.. * @stable ICU 2.0 */ #define U_ICUDATA_NAME "icudt" U_ICU_VERSION_SHORT U_ICUDATA_TYPE_LETTER /** * U_ICU_ENTRY_POINT is the name of the DLL entry point to the ICU data library. * Defined as a literal, not a string. * Tricky Preprocessor use - ## operator replaces macro paramters with the literal string * from the corresponding macro invocation, _before_ other macro substitutions. * Need a nested #defines to get the actual version numbers rather than * the literal text U_ICU_VERSION_MAJOR_NUM into the name. * The net result will be something of the form * #define U_ICU_ENTRY_POINT icudt19_dat * @stable ICU 2.4 */ #define U_ICUDATA_ENTRY_POINT U_DEF2_ICUDATA_ENTRY_POINT(U_ICU_VERSION_MAJOR_NUM, U_ICU_VERSION_MINOR_NUM) /** * @internal */ #define U_DEF2_ICUDATA_ENTRY_POINT(major, minor) U_DEF_ICUDATA_ENTRY_POINT(major, minor) /** * @internal */ #define U_DEF_ICUDATA_ENTRY_POINT(major, minor) icudt##major##minor##_dat /** * \def U_CALLCONV * Similar to U_CDECL_BEGIN/U_CDECL_END, this qualifier is necessary * in callback function typedefs to make sure that the calling convention * is compatible. * * This is only used for non-ICU-API functions. * When a function is a public ICU API, * you must use the U_CAPI and U_EXPORT2 qualifiers. * @stable ICU 2.0 */ #if defined(OS390) && (__COMPILER_VER__ < 0x41020000) && defined(XP_CPLUSPLUS) # define U_CALLCONV __cdecl #else # define U_CALLCONV U_EXPORT2 #endif /** * \def NULL * Define NULL if necessary, to 0 for C++ and to ((void *)0) for C. * @stable ICU 2.0 */ #ifndef NULL #ifdef XP_CPLUSPLUS #define NULL 0 #else #define NULL ((void *)0) #endif #endif /*===========================================================================*/ /* Calendar/TimeZone data types */ /*===========================================================================*/ /** * Date and Time data type. * This is a primitive data type that holds the date and time * as the number of milliseconds since 1970-jan-01, 00:00 UTC. * UTC leap seconds are ignored. * @stable ICU 2.0 */ typedef double UDate; /** The number of milliseconds per second @stable ICU 2.0 */ #define U_MILLIS_PER_SECOND (1000) /** The number of milliseconds per minute @stable ICU 2.0 */ #define U_MILLIS_PER_MINUTE (60000) /** The number of milliseconds per hour @stable ICU 2.0 */ #define U_MILLIS_PER_HOUR (3600000) /** The number of milliseconds per day @stable ICU 2.0 */ #define U_MILLIS_PER_DAY (86400000) /*===========================================================================*/ /* UClassID-based RTTI */ /*===========================================================================*/ /** * UClassID is used to identify classes without using RTTI, since RTTI * is not yet supported by all C++ compilers. Each class hierarchy which needs * to implement polymorphic clone() or operator==() defines two methods, * described in detail below. UClassID values can be compared using * operator==(). Nothing else should be done with them. * * \par * getDynamicClassID() is declared in the base class of the hierarchy as * a pure virtual. Each concrete subclass implements it in the same way: * * \code * class Base { * public: * virtual UClassID getDynamicClassID() const = 0; * } * * class Derived { * public: * virtual UClassID getDynamicClassID() const * { return Derived::getStaticClassID(); } * } * \endcode * * Each concrete class implements getStaticClassID() as well, which allows * clients to test for a specific type. * * \code * class Derived { * public: * static UClassID U_EXPORT2 getStaticClassID(); * private: * static char fgClassID; * } * * // In Derived.cpp: * UClassID Derived::getStaticClassID() * { return (UClassID)&Derived::fgClassID; } * char Derived::fgClassID = 0; // Value is irrelevant * \endcode * @stable ICU 2.0 */ typedef void* UClassID; /*===========================================================================*/ /* Shared library/DLL import-export API control */ /*===========================================================================*/ /* * Control of symbol import/export. * ICU is separated into three libraries. */ /* * \def U_COMBINED_IMPLEMENTATION * Set to export library symbols from inside the ICU library * when all of ICU is in a single library. * This can be set as a compiler option while building ICU, and it * needs to be the first one tested to override U_COMMON_API, U_I18N_API, etc. * @stable ICU 2.0 */ /** * \def U_DATA_API * Set to export library symbols from inside the stubdata library, * and to import them from outside. * @draft ICU 3.0 */ /** * \def U_COMMON_API * Set to export library symbols from inside the common library, * and to import them from outside. * @stable ICU 2.0 */ /** * \def U_I18N_API * Set to export library symbols from inside the i18n library, * and to import them from outside. * @stable ICU 2.0 */ /** * \def U_LAYOUT_API * Set to export library symbols from inside the layout engine library, * and to import them from outside. * @stable ICU 2.0 */ /** * \def U_LAYOUTEX_API * Set to export library symbols from inside the layout extensions library, * and to import them from outside. * @stable ICU 2.6 */ /** * \def U_IO_API * Set to export library symbols from inside the ustdio library, * and to import them from outside. * @stable ICU 2.0 */ #if defined(U_COMBINED_IMPLEMENTATION) #define U_DATA_API U_EXPORT #define U_COMMON_API U_EXPORT #define U_I18N_API U_EXPORT #define U_LAYOUT_API U_EXPORT #define U_LAYOUTEX_API U_EXPORT #define U_IO_API U_EXPORT #elif defined(U_STATIC_IMPLEMENTATION) #define U_DATA_API #define U_COMMON_API #define U_I18N_API #define U_LAYOUT_API #define U_LAYOUTEX_API #define U_IO_API #elif defined(U_COMMON_IMPLEMENTATION) #define U_DATA_API U_IMPORT #define U_COMMON_API U_EXPORT #define U_I18N_API U_IMPORT #define U_LAYOUT_API U_IMPORT #define U_LAYOUTEX_API U_IMPORT #define U_IO_API U_IMPORT #elif defined(U_I18N_IMPLEMENTATION) #define U_DATA_API U_IMPORT #define U_COMMON_API U_IMPORT #define U_I18N_API U_EXPORT #define U_LAYOUT_API U_IMPORT #define U_LAYOUTEX_API U_IMPORT #define U_IO_API U_IMPORT #elif defined(U_LAYOUT_IMPLEMENTATION) #define U_DATA_API U_IMPORT #define U_COMMON_API U_IMPORT #define U_I18N_API U_IMPORT #define U_LAYOUT_API U_EXPORT #define U_LAYOUTEX_API U_IMPORT #define U_IO_API U_IMPORT #elif defined(U_LAYOUTEX_IMPLEMENTATION) #define U_DATA_API U_IMPORT #define U_COMMON_API U_IMPORT #define U_I18N_API U_IMPORT #define U_LAYOUT_API U_IMPORT #define U_LAYOUTEX_API U_EXPORT #define U_IO_API U_IMPORT #elif defined(U_IO_IMPLEMENTATION) #define U_DATA_API U_IMPORT #define U_COMMON_API U_IMPORT #define U_I18N_API U_IMPORT #define U_LAYOUT_API U_IMPORT #define U_LAYOUTEX_API U_IMPORT #define U_IO_API U_EXPORT #else #define U_DATA_API U_IMPORT #define U_COMMON_API U_IMPORT #define U_I18N_API U_IMPORT #define U_LAYOUT_API U_IMPORT #define U_LAYOUTEX_API U_IMPORT #define U_IO_API U_IMPORT #endif /** * \def U_STANDARD_CPP_NAMESPACE * Control of C++ Namespace * @stable ICU 2.0 */ #ifdef __cplusplus #define U_STANDARD_CPP_NAMESPACE :: #else #define U_STANDARD_CPP_NAMESPACE #endif /*===========================================================================*/ /* Global delete operator */ /*===========================================================================*/ /* * The ICU4C library must not use the global new and delete operators. * These operators here are defined to enable testing for this. * See Jitterbug 2581 for details of why this is necessary. * * Verification that ICU4C's memory usage is correct, i.e., * that global new/delete are not used: * * a) Check for imports of global new/delete (see uobject.cpp for details) * b) Verify that new is never imported. * c) Verify that delete is only imported from object code for interface/mixin classes. * d) Add global delete and delete[] only for the ICU4C library itself * and define them in a way that crashes or otherwise easily shows a problem. * * The following implements d). * The operator implementations crash; this is intentional and used for library debugging. * * Note: This is currently only done on Windows because * some Linux/Unix compilers have problems with defining global new/delete. * On Windows, WIN32 is defined, and it is _MSC_Ver>=1200 for MSVC 6.0 and higher. */ #if defined(XP_CPLUSPLUS) && defined(WIN32) && (_MSC_Ver>=1200) && (defined(U_COMMON_IMPLEMENTATION) || defined(U_I18N_IMPLEMENTATION) || defined(U_LAYOUT_IMPLEMENTATION) || defined(U_USTDIO_IMPLEMENTATION)) /** * Global operator new, defined only inside ICU4C, must not be used. * Crashes intentionally. * @internal */ inline void * operator new(size_t /*size*/) { char *q=NULL; *q=5; /* break it */ return q; } /** * Global operator new[], defined only inside ICU4C, must not be used. * Crashes intentionally. * @internal */ inline void * operator new[](size_t /*size*/) { char *q=NULL; *q=5; /* break it */ return q; } /** * Global operator delete, defined only inside ICU4C, must not be used. * Crashes intentionally. * @internal */ inline void operator delete(void * /*p*/) { char *q=NULL; *q=5; /* break it */ } /** * Global operator delete[], defined only inside ICU4C, must not be used. * Crashes intentionally. * @internal */ inline void operator delete[](void * /*p*/) { char *q=NULL; *q=5; /* break it */ } #endif /*===========================================================================*/ /* UErrorCode */ /*===========================================================================*/ /** * Error code to replace exception handling, so that the code is compatible with all C++ compilers, * and to use the same mechanism for C and C++. * * \par * ICU functions that take a reference (C++) or a pointer (C) to a UErrorCode * first test if(U_FAILURE(errorCode)) { return immediately; } * so that in a chain of such functions the first one that sets an error code * causes the following ones to not perform any operations. * * \par * Error codes should be tested using U_FAILURE() and U_SUCCESS(). * @stable ICU 2.0 */ typedef enum UErrorCode { /* The ordering of U_ERROR_INFO_START Vs U_USING_FALLBACK_WARNING looks weird * and is that way because VC++ debugger displays first encountered constant, * which is not the what the code is used for */ U_USING_FALLBACK_WARNING = -128, /**< A resource bundle lookup returned a fallback result (not an error) */ U_ERROR_WARNING_START = -128, /**< Start of information results (semantically successful) */ U_USING_DEFAULT_WARNING = -127, /**< A resource bundle lookup returned a result from the root locale (not an error) */ U_SAFECLONE_ALLOCATED_WARNING = -126, /**< A SafeClone operation required allocating memory (informational only) */ U_STATE_OLD_WARNING = -125, /**< ICU has to use compatibility layer to construct the service. Expect performance/memory usage degradation. Consider upgrading */ U_STRING_NOT_TERMINATED_WARNING = -124,/**< An output string could not be NUL-terminated because output length==destCapacity. */ U_SORT_KEY_TOO_SHORT_WARNING = -123, /**< Number of levels requested in getBound is higher than the number of levels in the sort key */ U_AMBIGUOUS_ALIAS_WARNING = -122, /**< This converter alias can go to different converter implementations */ U_DIFFERENT_UCA_VERSION = -121, /**< ucol_open encountered a mismatch between UCA version and collator image version, so the collator was constructed from rules. No impact to further function */ U_ERROR_WARNING_LIMIT, /**< This must always be the last warning value to indicate the limit for UErrorCode warnings (last warning code +1) */ U_ZERO_ERROR = 0, /**< No error, no warning. */ U_ILLEGAL_ARGUMENT_ERROR = 1, /**< Start of codes indicating failure */ U_MISSING_RESOURCE_ERROR = 2, /**< The requested resource cannot be found */ U_INVALID_FORMAT_ERROR = 3, /**< Data format is not what is expected */ U_FILE_ACCESS_ERROR = 4, /**< The requested file cannot be found */ U_INTERNAL_PROGRAM_ERROR = 5, /**< Indicates a bug in the library code */ U_MESSAGE_PARSE_ERROR = 6, /**< Unable to parse a message (message format) */ U_MEMORY_ALLOCATION_ERROR = 7, /**< Memory allocation error */ U_INDEX_OUTOFBOUNDS_ERROR = 8, /**< Trying to access the index that is out of bounds */ U_PARSE_ERROR = 9, /**< Equivalent to Java ParseException */ U_INVALID_CHAR_FOUND = 10, /**< Character conversion: Unmappable input sequence. In other APIs: Invalid character. */ U_TRUNCATED_CHAR_FOUND = 11, /**< Character conversion: Incomplete input sequence. */ U_ILLEGAL_CHAR_FOUND = 12, /**< Character conversion: Illegal input sequence/combination of input units.. */ U_INVALID_TABLE_FORMAT = 13, /**< Conversion table file found, but corrupted */ U_INVALID_TABLE_FILE = 14, /**< Conversion table file not found */ U_BUFFER_OVERFLOW_ERROR = 15, /**< A result would not fit in the supplied buffer */ U_UNSUPPORTED_ERROR = 16, /**< Requested operation not supported in current context */ U_RESOURCE_TYPE_MISMATCH = 17, /**< an operation is requested over a resource that does not support it */ U_ILLEGAL_ESCAPE_SEQUENCE = 18, /**< ISO-2022 illlegal escape sequence */ U_UNSUPPORTED_ESCAPE_SEQUENCE = 19, /**< ISO-2022 unsupported escape sequence */ U_NO_SPACE_AVAILABLE = 20, /**< No space available for in-buffer expansion for Arabic shaping */ U_CE_NOT_FOUND_ERROR = 21, /**< Currently used only while setting variable top, but can be used generally */ U_PRIMARY_TOO_LONG_ERROR = 22, /**< User tried to set variable top to a primary that is longer than two bytes */ U_STATE_TOO_OLD_ERROR = 23, /**< ICU cannot construct a service from this state, as it is no longer supported */ U_TOO_MANY_ALIASES_ERROR = 24, /**< There are too many aliases in the path to the requested resource. It is very possible that a circular alias definition has occured */ U_ENUM_OUT_OF_SYNC_ERROR = 25, /**< UEnumeration out of sync with underlying collection */ U_INVARIANT_CONVERSION_ERROR = 26, /**< Unable to convert a UChar* string to char* with the invariant converter. */ U_INVALID_STATE_ERROR = 27, /**< Requested operation can not be completed with ICU in its current state */ U_COLLATOR_VERSION_MISMATCH = 28, /**< Collator version is not compatible with the base version */ U_USELESS_COLLATOR_ERROR = 29, /**< Collator is options only and no base is specified */ U_STANDARD_ERROR_LIMIT, /**< This must always be the last value to indicate the limit for standard errors */ /* * the error code range 0x10000 0x10100 are reserved for Transliterator */ U_BAD_VARIABLE_DEFINITION=0x10000,/**< Missing '$' or duplicate variable name */ U_PARSE_ERROR_START = 0x10000, /**< Start of Transliterator errors */ U_MALFORMED_RULE, /**< Elements of a rule are misplaced */ U_MALFORMED_SET, /**< A UnicodeSet pattern is invalid*/ U_MALFORMED_SYMBOL_REFERENCE, /**< UNUSED as of ICU 2.4 */ U_MALFORMED_UNICODE_ESCAPE, /**< A Unicode escape pattern is invalid*/ U_MALFORMED_VARIABLE_DEFINITION, /**< A variable definition is invalid */ U_MALFORMED_VARIABLE_REFERENCE, /**< A variable reference is invalid */ U_MISMATCHED_SEGMENT_DELIMITERS, /**< UNUSED as of ICU 2.4 */ U_MISPLACED_ANCHOR_START, /**< A start anchor appears at an illegal position */ U_MISPLACED_CURSOR_OFFSET, /**< A cursor offset occurs at an illegal position */ U_MISPLACED_QUANTIFIER, /**< A quantifier appears after a segment close delimiter */ U_MISSING_OPERATOR, /**< A rule contains no operator */ U_MISSING_SEGMENT_CLOSE, /**< UNUSED as of ICU 2.4 */ U_MULTIPLE_ANTE_CONTEXTS, /**< More than one ante context */ U_MULTIPLE_CURSORS, /**< More than one cursor */ U_MULTIPLE_POST_CONTEXTS, /**< More than one post context */ U_TRAILING_BACKSLASH, /**< A dangling backslash */ U_UNDEFINED_SEGMENT_REFERENCE, /**< A segment reference does not correspond to a defined segment */ U_UNDEFINED_VARIABLE, /**< A variable reference does not correspond to a defined variable */ U_UNQUOTED_SPECIAL, /**< A special character was not quoted or escaped */ U_UNTERMINATED_QUOTE, /**< A closing single quote is missing */ U_RULE_MASK_ERROR, /**< A rule is hidden by an earlier more general rule */ U_MISPLACED_COMPOUND_FILTER, /**< A compound filter is in an invalid location */ U_MULTIPLE_COMPOUND_FILTERS, /**< More than one compound filter */ U_INVALID_RBT_SYNTAX, /**< A "::id" rule was passed to the RuleBasedTransliterator parser */ U_INVALID_PROPERTY_PATTERN, /**< UNUSED as of ICU 2.4 */ U_MALFORMED_PRAGMA, /**< A 'use' pragma is invlalid */ U_UNCLOSED_SEGMENT, /**< A closing ')' is missing */ U_ILLEGAL_CHAR_IN_SEGMENT, /**< UNUSED as of ICU 2.4 */ U_VARIABLE_RANGE_EXHAUSTED, /**< Too many stand-ins generated for the given variable range */ U_VARIABLE_RANGE_OVERLAP, /**< The variable range overlaps characters used in rules */ U_ILLEGAL_CHARACTER, /**< A special character is outside its allowed context */ U_INTERNAL_TRANSLITERATOR_ERROR, /**< Internal transliterator system error */ U_INVALID_ID, /**< A "::id" rule specifies an unknown transliterator */ U_INVALID_FUNCTION, /**< A "&fn()" rule specifies an unknown transliterator */ U_PARSE_ERROR_LIMIT, /**< The limit for Transliterator errors */ /* * the error code range 0x10100 0x10200 are reserved for formatting API parsing error */ U_UNEXPECTED_TOKEN=0x10100, /**< Syntax error in format pattern */ U_FMT_PARSE_ERROR_START=0x10100, /**< Start of format library errors */ U_MULTIPLE_DECIMAL_SEPARATORS, /**< More than one decimal separator in number pattern */ U_MULTIPLE_DECIMAL_SEPERATORS = U_MULTIPLE_DECIMAL_SEPARATORS, /**< Typo: kept for backward compatibility. Use U_MULTIPLE_DECIMAL_SEPARATORS */ U_MULTIPLE_EXPONENTIAL_SYMBOLS, /**< More than one exponent symbol in number pattern */ U_MALFORMED_EXPONENTIAL_PATTERN, /**< Grouping symbol in exponent pattern */ U_MULTIPLE_PERCENT_SYMBOLS, /**< More than one percent symbol in number pattern */ U_MULTIPLE_PERMILL_SYMBOLS, /**< More than one permill symbol in number pattern */ U_MULTIPLE_PAD_SPECIFIERS, /**< More than one pad symbol in number pattern */ U_PATTERN_SYNTAX_ERROR, /**< Syntax error in format pattern */ U_ILLEGAL_PAD_POSITION, /**< Pad symbol misplaced in number pattern */ U_UNMATCHED_BRACES, /**< Braces do not match in message pattern */ U_UNSUPPORTED_PROPERTY, /**< UNUSED as of ICU 2.4 */ U_UNSUPPORTED_ATTRIBUTE, /**< UNUSED as of ICU 2.4 */ U_FMT_PARSE_ERROR_LIMIT, /**< The limit for format library errors */ /* * the error code range 0x10200 0x102ff are reserved for Break Iterator related error */ U_BRK_ERROR_START=0x10200, /**< Start of codes indicating Break Iterator failures */ U_BRK_INTERNAL_ERROR, /**< An internal error (bug) was detected. */ U_BRK_HEX_DIGITS_EXPECTED, /**< Hex digits expected as part of a escaped char in a rule. */ U_BRK_SEMICOLON_EXPECTED, /**< Missing ';' at the end of a RBBI rule. */ U_BRK_RULE_SYNTAX, /**< Syntax error in RBBI rule. */ U_BRK_UNCLOSED_SET, /**< UnicodeSet witing an RBBI rule missing a closing ']'. */ U_BRK_ASSIGN_ERROR, /**< Syntax error in RBBI rule assignment statement. */ U_BRK_VARIABLE_REDFINITION, /**< RBBI rule $Variable redefined. */ U_BRK_MISMATCHED_PAREN, /**< Mis-matched parentheses in an RBBI rule. */ U_BRK_NEW_LINE_IN_QUOTED_STRING, /**< Missing closing quote in an RBBI rule. */ U_BRK_UNDEFINED_VARIABLE, /**< Use of an undefined $Variable in an RBBI rule. */ U_BRK_INIT_ERROR, /**< Initialization failure. Probable missing ICU Data. */ U_BRK_RULE_EMPTY_SET, /**< Rule contains an empty Unicode Set. */ U_BRK_UNRECOGNIZED_OPTION, /**< !!option in RBBI rules not recognized. */ U_BRK_MALFORMED_RULE_TAG, /**< The {nnn} tag on a rule is mal formed */ U_BRK_ERROR_LIMIT, /**< This must always be the last value to indicate the limit for Break Iterator failures */ /* * The error codes in the range 0x10300-0x103ff are reserved for regular expression related errrs */ U_REGEX_ERROR_START=0x10300, /**< Start of codes indicating Regexp failures */ U_REGEX_INTERNAL_ERROR, /**< An internal error (bug) was detected. */ U_REGEX_RULE_SYNTAX, /**< Syntax error in regexp pattern. */ U_REGEX_INVALID_STATE, /**< RegexMatcher in invalid state for requested operation */ U_REGEX_BAD_ESCAPE_SEQUENCE, /**< Unrecognized backslash escape sequence in pattern */ U_REGEX_PROPERTY_SYNTAX, /**< Incorrect Unicode property */ U_REGEX_UNIMPLEMENTED, /**< Use of regexp feature that is not yet implemented. */ U_REGEX_MISMATCHED_PAREN, /**< Incorrectly nested parentheses in regexp pattern. */ U_REGEX_NUMBER_TOO_BIG, /**< Decimal number is too large. */ U_REGEX_BAD_INTERVAL, /**< Error in {min,max} interval */ U_REGEX_MAX_LT_MIN, /**< In {min,max}, max is less than min. */ U_REGEX_INVALID_BACK_REF, /**< Back-reference to a non-existent capture group. */ U_REGEX_INVALID_FLAG, /**< Invalid value for match mode flags. */ U_REGEX_LOOK_BEHIND_LIMIT, /**< Look-Behind pattern matches must have a bounded maximum length. */ U_REGEX_SET_CONTAINS_STRING, /**< Regexps cannot have UnicodeSets containing strings.*/ U_REGEX_ERROR_LIMIT, /**< This must always be the last value to indicate the limit for regexp errors */ /* * The error code in the range 0x10400-0x104ff are reserved for IDNA related error codes */ U_IDNA_ERROR_START=0x10400, U_IDNA_PROHIBITED_ERROR, U_IDNA_UNASSIGNED_ERROR, U_IDNA_CHECK_BIDI_ERROR, U_IDNA_STD3_ASCII_RULES_ERROR, U_IDNA_ACE_PREFIX_ERROR, U_IDNA_VERIFICATION_ERROR, U_IDNA_LABEL_TOO_LONG_ERROR, U_IDNA_ERROR_LIMIT, /* * Aliases for StringPrep */ U_STRINGPREP_PROHIBITED_ERROR = U_IDNA_PROHIBITED_ERROR, U_STRINGPREP_UNASSIGNED_ERROR = U_IDNA_UNASSIGNED_ERROR, U_STRINGPREP_CHECK_BIDI_ERROR = U_IDNA_CHECK_BIDI_ERROR, U_ERROR_LIMIT=U_IDNA_ERROR_LIMIT /**< This must always be the last value to indicate the limit for UErrorCode (last error code +1) */ } UErrorCode; /* Use the following to determine if an UErrorCode represents */ /* operational success or failure. */ #ifdef XP_CPLUSPLUS /** * Does the error code indicate success? * @stable ICU 2.0 */ static inline UBool U_SUCCESS(UErrorCode code) { return (UBool)(code<=U_ZERO_ERROR); } /** * Does the error code indicate a failure? * @stable ICU 2.0 */ static inline UBool U_FAILURE(UErrorCode code) { return (UBool)(code>U_ZERO_ERROR); } #else /** * Does the error code indicate success? * @stable ICU 2.0 */ # define U_SUCCESS(x) ((x)<=U_ZERO_ERROR) /** * Does the error code indicate a failure? * @stable ICU 2.0 */ # define U_FAILURE(x) ((x)>U_ZERO_ERROR) #endif /** * Return a string for a UErrorCode value. * The string will be the same as the name of the error code constant * in the UErrorCode enum above. * @stable ICU 2.0 */ U_STABLE const char * U_EXPORT2 u_errorName(UErrorCode code); #endif /* _UTYPES */ WebKit/mac/icu/unicode/uscript.h0000644000175000017500000001310310360512352015142 0ustar leelee/* ********************************************************************** * Copyright (C) 1997-2004, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * * File USCRIPT.H * * Modification History: * * Date Name Description * 07/06/2001 Ram Creation. ****************************************************************************** */ #ifndef USCRIPT_H #define USCRIPT_H #include "unicode/utypes.h" /** * Constants for Unicode script values from ScriptNames.txt . * * @stable ICU 2.2 */ typedef enum UScriptCode { USCRIPT_INVALID_CODE = -1, USCRIPT_COMMON = 0 , /* Zyyy */ USCRIPT_INHERITED = 1, /* Qaai */ USCRIPT_ARABIC = 2, /* Arab */ USCRIPT_ARMENIAN = 3, /* Armn */ USCRIPT_BENGALI = 4, /* Beng */ USCRIPT_BOPOMOFO = 5, /* Bopo */ USCRIPT_CHEROKEE = 6, /* Cher */ USCRIPT_COPTIC = 7, /* Copt */ USCRIPT_CYRILLIC = 8, /* Cyrl (Cyrs) */ USCRIPT_DESERET = 9, /* Dsrt */ USCRIPT_DEVANAGARI = 10, /* Deva */ USCRIPT_ETHIOPIC = 11, /* Ethi */ USCRIPT_GEORGIAN = 12, /* Geor (Geon, Geoa) */ USCRIPT_GOTHIC = 13, /* Goth */ USCRIPT_GREEK = 14, /* Grek */ USCRIPT_GUJARATI = 15, /* Gujr */ USCRIPT_GURMUKHI = 16, /* Guru */ USCRIPT_HAN = 17, /* Hani */ USCRIPT_HANGUL = 18, /* Hang */ USCRIPT_HEBREW = 19, /* Hebr */ USCRIPT_HIRAGANA = 20, /* Hira */ USCRIPT_KANNADA = 21, /* Knda */ USCRIPT_KATAKANA = 22, /* Kana */ USCRIPT_KHMER = 23, /* Khmr */ USCRIPT_LAO = 24, /* Laoo */ USCRIPT_LATIN = 25, /* Latn (Latf, Latg) */ USCRIPT_MALAYALAM = 26, /* Mlym */ USCRIPT_MONGOLIAN = 27, /* Mong */ USCRIPT_MYANMAR = 28, /* Mymr */ USCRIPT_OGHAM = 29, /* Ogam */ USCRIPT_OLD_ITALIC = 30, /* Ital */ USCRIPT_ORIYA = 31, /* Orya */ USCRIPT_RUNIC = 32, /* Runr */ USCRIPT_SINHALA = 33, /* Sinh */ USCRIPT_SYRIAC = 34, /* Syrc (Syrj, Syrn, Syre) */ USCRIPT_TAMIL = 35, /* Taml */ USCRIPT_TELUGU = 36, /* Telu */ USCRIPT_THAANA = 37, /* Thaa */ USCRIPT_THAI = 38, /* Thai */ USCRIPT_TIBETAN = 39, /* Tibt */ /** Canadian_Aboriginal script. @stable ICU 2.6 */ USCRIPT_CANADIAN_ABORIGINAL = 40, /* Cans */ /** Canadian_Aboriginal script (alias). @stable ICU 2.2 */ USCRIPT_UCAS = USCRIPT_CANADIAN_ABORIGINAL, USCRIPT_YI = 41, /* Yiii */ USCRIPT_TAGALOG = 42, /* Tglg */ USCRIPT_HANUNOO = 43, /* Hano */ USCRIPT_BUHID = 44, /* Buhd */ USCRIPT_TAGBANWA = 45, /* Tagb */ /* New scripts in Unicode 4 @stable ICU 2.6 */ USCRIPT_BRAILLE, /* Brai */ USCRIPT_CYPRIOT, /* Cprt */ USCRIPT_LIMBU, /* Limb */ USCRIPT_LINEAR_B, /* Linb */ USCRIPT_OSMANYA, /* Osma */ USCRIPT_SHAVIAN, /* Shaw */ USCRIPT_TAI_LE, /* Tale */ USCRIPT_UGARITIC, /* Ugar */ /** New script code in Unicode 4.0.1 @draft ICU 3.0 */ USCRIPT_KATAKANA_OR_HIRAGANA,/*Hrkt */ USCRIPT_CODE_LIMIT } UScriptCode; /** * Gets script codes associated with the given locale or ISO 15924 abbreviation or name. * Fills in USCRIPT_MALAYALAM given "Malayam" OR "Mlym". * Fills in USCRIPT_LATIN given "en" OR "en_US" * If required capacity is greater than capacity of the destination buffer then the error code * is set to U_BUFFER_OVERFLOW_ERROR and the required capacity is returned * *

Note: To search by short or long script alias only, use * u_getPropertyValueEnum(UCHAR_SCRIPT, alias) instead. This does * a fast lookup with no access of the locale data. * @param nameOrAbbrOrLocale name of the script, as given in * PropertyValueAliases.txt, or ISO 15924 code or locale * @param fillIn the UScriptCode buffer to fill in the script code * @param capacity the capacity (size) fo UScriptCode buffer passed in. * @param err the error status code. * @return The number of script codes filled in the buffer passed in * @stable ICU 2.4 */ U_STABLE int32_t U_EXPORT2 uscript_getCode(const char* nameOrAbbrOrLocale,UScriptCode* fillIn,int32_t capacity,UErrorCode *err); /** * Gets a script name associated with the given script code. * Returns "Malayam" given USCRIPT_MALAYALAM * @param scriptCode UScriptCode enum * @return script long name as given in * PropertyValueAliases.txt, or NULL if scriptCode is invalid * @stable ICU 2.4 */ U_STABLE const char* U_EXPORT2 uscript_getName(UScriptCode scriptCode); /** * Gets a script name associated with the given script code. * Returns "Mlym" given USCRIPT_MALAYALAM * @param scriptCode UScriptCode enum * @return script abbreviated name as given in * PropertyValueAliases.txt, or NULL if scriptCode is invalid * @stable ICU 2.4 */ U_STABLE const char* U_EXPORT2 uscript_getShortName(UScriptCode scriptCode); /** * Gets the script code associated with the given codepoint. * Returns USCRIPT_MALAYALAM given 0x0D02 * @param codepoint UChar32 codepoint * @param err the error status code. * @return The UScriptCode, or 0 if codepoint is invalid * @stable ICU 2.4 */ U_STABLE UScriptCode U_EXPORT2 uscript_getScript(UChar32 codepoint, UErrorCode *err); #endif WebKit/mac/icu/unicode/uconfig.h0000644000175000017500000001045310360512352015110 0ustar leelee/* ********************************************************************** * Copyright (C) 2002-2004, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * file name: uconfig.h * encoding: US-ASCII * tab size: 8 (not used) * indentation:4 * * created on: 2002sep19 * created by: Markus W. Scherer */ #ifndef __UCONFIG_H__ #define __UCONFIG_H__ /*! * \file * \brief Switches for excluding parts of ICU library code modules. * * Allows to build partial, smaller libraries for special purposes. * By default, all modules are built. * The switches are fairly coarse, controlling large modules. * Basic services cannot be turned off. * * @stable ICU 2.4 */ /** * \def UCONFIG_ONLY_COLLATION * This switch turns off modules that are not needed for collation. * * It does not turn off legacy conversion because that is necessary * for ICU to work on EBCDIC platforms (for the default converter). * If you want "only collation" and do not build for EBCDIC, * then you can #define UCONFIG_NO_LEGACY_CONVERSION 1 as well. * * @stable ICU 2.4 */ #ifndef UCONFIG_ONLY_COLLATION # define UCONFIG_ONLY_COLLATION 0 #endif #if UCONFIG_ONLY_COLLATION /* common library */ # define UCONFIG_NO_BREAK_ITERATION 1 # define UCONFIG_NO_IDNA 1 /* i18n library */ # if UCONFIG_NO_COLLATION # error Contradictory collation switches in uconfig.h. # endif # define UCONFIG_NO_FORMATTING 1 # define UCONFIG_NO_TRANSLITERATION 1 # define UCONFIG_NO_REGULAR_EXPRESSIONS 1 #endif /* common library switches -------------------------------------------------- */ /** * \def UCONFIG_NO_CONVERSION * ICU will not completely build with this switch turned on. * This switch turns off all converters. * * @draft ICU 3.2 */ #ifndef UCONFIG_NO_CONVERSION # define UCONFIG_NO_CONVERSION 0 #endif #if UCONFIG_NO_CONVERSION # define UCONFIG_NO_LEGACY_CONVERSION 1 #endif /** * \def UCONFIG_NO_LEGACY_CONVERSION * This switch turns off all converters except for * - Unicode charsets (UTF-7/8/16/32, CESU-8, SCSU, BOCU-1) * - US-ASCII * - ISO-8859-1 * * Turning off legacy conversion is not possible on EBCDIC platforms * because they need ibm-37 or ibm-1047 default converters. * * @stable ICU 2.4 */ #ifndef UCONFIG_NO_LEGACY_CONVERSION # define UCONFIG_NO_LEGACY_CONVERSION 0 #endif /** * \def UCONFIG_NO_NORMALIZATION * This switch turns off normalization. * It implies turning off several other services as well, for example * collation and IDNA. * * @stable ICU 2.6 */ #ifndef UCONFIG_NO_NORMALIZATION # define UCONFIG_NO_NORMALIZATION 0 #elif UCONFIG_NO_NORMALIZATION /* common library */ # define UCONFIG_NO_IDNA 1 /* i18n library */ # if UCONFIG_ONLY_COLLATION # error Contradictory collation switches in uconfig.h. # endif # define UCONFIG_NO_COLLATION 1 # define UCONFIG_NO_TRANSLITERATION 1 #endif /** * \def UCONFIG_NO_BREAK_ITERATION * This switch turns off break iteration. * * @stable ICU 2.4 */ #ifndef UCONFIG_NO_BREAK_ITERATION # define UCONFIG_NO_BREAK_ITERATION 0 #endif /** * \def UCONFIG_NO_IDNA * This switch turns off IDNA. * * @stable ICU 2.6 */ #ifndef UCONFIG_NO_IDNA # define UCONFIG_NO_IDNA 0 #endif /* i18n library switches ---------------------------------------------------- */ /** * \def UCONFIG_NO_COLLATION * This switch turns off collation and collation-based string search. * * @stable ICU 2.4 */ #ifndef UCONFIG_NO_COLLATION # define UCONFIG_NO_COLLATION 0 #endif /** * \def UCONFIG_NO_FORMATTING * This switch turns off formatting and calendar/timezone services. * * @stable ICU 2.4 */ #ifndef UCONFIG_NO_FORMATTING # define UCONFIG_NO_FORMATTING 0 #endif /** * \def UCONFIG_NO_TRANSLITERATION * This switch turns off transliteration. * * @stable ICU 2.4 */ #ifndef UCONFIG_NO_TRANSLITERATION # define UCONFIG_NO_TRANSLITERATION 0 #endif /** * \def UCONFIG_NO_REGULAR_EXPRESSIONS * This switch turns off regular expressions. * * @stable ICU 2.4 */ #ifndef UCONFIG_NO_REGULAR_EXPRESSIONS # define UCONFIG_NO_REGULAR_EXPRESSIONS 0 #endif /** * \def UCONFIG_NO_SERVICE * This switch turns off service registration. * * @draft ICU 3.2 */ #ifndef UCONFIG_NO_SERVICE # define UCONFIG_NO_SERVICE 0 #endif #endif WebKit/mac/icu/unicode/ustring.h0000644000175000017500000015045110514017106015152 0ustar leelee/* ********************************************************************** * Copyright (C) 1998-2004, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * * File ustring.h * * Modification History: * * Date Name Description * 12/07/98 bertrand Creation. ****************************************************************************** */ #ifndef USTRING_H #define USTRING_H #include "unicode/utypes.h" #include "unicode/putil.h" #include "unicode/uiter.h" /** Simple declaration for u_strToTitle() to avoid including unicode/ubrk.h. @stable ICU 2.1*/ #ifndef UBRK_TYPEDEF_UBREAK_ITERATOR # define UBRK_TYPEDEF_UBREAK_ITERATOR typedef void UBreakIterator; #endif /** * \file * \brief C API: Unicode string handling functions * * These C API functions provide general Unicode string handling. * * Some functions are equivalent in name, signature, and behavior to the ANSI C * functions. (For example, they do not check for bad arguments like NULL string pointers.) * In some cases, only the thread-safe variant of such a function is implemented here * (see u_strtok_r()). * * Other functions provide more Unicode-specific functionality like locale-specific * upper/lower-casing and string comparison in code point order. * * ICU uses 16-bit Unicode (UTF-16) in the form of arrays of UChar code units. * UTF-16 encodes each Unicode code point with either one or two UChar code units. * (This is the default form of Unicode, and a forward-compatible extension of the original, * fixed-width form that was known as UCS-2. UTF-16 superseded UCS-2 with Unicode 2.0 * in 1996.) * * Some APIs accept a 32-bit UChar32 value for a single code point. * * ICU also handles 16-bit Unicode text with unpaired surrogates. * Such text is not well-formed UTF-16. * Code-point-related functions treat unpaired surrogates as surrogate code points, * i.e., as separate units. * * Although UTF-16 is a variable-width encoding form (like some legacy multi-byte encodings), * it is much more efficient even for random access because the code unit values * for single-unit characters vs. lead units vs. trail units are completely disjoint. * This means that it is easy to determine character (code point) boundaries from * random offsets in the string. * * Unicode (UTF-16) string processing is optimized for the single-unit case. * Although it is important to support supplementary characters * (which use pairs of lead/trail code units called "surrogates"), * their occurrence is rare. Almost all characters in modern use require only * a single UChar code unit (i.e., their code point values are <=0xffff). * * For more details see the User Guide Strings chapter (http://oss.software.ibm.com/icu/userguide/strings.html). * For a discussion of the handling of unpaired surrogates see also * Jitterbug 2145 and its icu mailing list proposal on 2002-sep-18. */ /** * Determine the length of an array of UChar. * * @param s The array of UChars, NULL (U+0000) terminated. * @return The number of UChars in chars, minus the terminator. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_strlen(const UChar *s); /** * Count Unicode code points in the length UChar code units of the string. * A code point may occupy either one or two UChar code units. * Counting code points involves reading all code units. * * This functions is basically the inverse of the U16_FWD_N() macro (see utf.h). * * @param s The input string. * @param length The number of UChar code units to be checked, or -1 to count all * code points before the first NUL (U+0000). * @return The number of code points in the specified code units. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_countChar32(const UChar *s, int32_t length); /** * Check if the string contains more Unicode code points than a certain number. * This is more efficient than counting all code points in the entire string * and comparing that number with a threshold. * This function may not need to scan the string at all if the length is known * (not -1 for NUL-termination) and falls within a certain range, and * never needs to count more than 'number+1' code points. * Logically equivalent to (u_countChar32(s, length)>number). * A Unicode code point may occupy either one or two UChar code units. * * @param s The input string. * @param length The length of the string, or -1 if it is NUL-terminated. * @param number The number of code points in the string is compared against * the 'number' parameter. * @return Boolean value for whether the string contains more Unicode code points * than 'number'. Same as (u_countChar32(s, length)>number). * @stable ICU 2.4 */ U_STABLE UBool U_EXPORT2 u_strHasMoreChar32Than(const UChar *s, int32_t length, int32_t number); /** * Concatenate two ustrings. Appends a copy of src, * including the null terminator, to dst. The initial copied * character from src overwrites the null terminator in dst. * * @param dst The destination string. * @param src The source string. * @return A pointer to dst. * @stable ICU 2.0 */ U_STABLE UChar* U_EXPORT2 u_strcat(UChar *dst, const UChar *src); /** * Concatenate two ustrings. * Appends at most n characters from src to dst. * Adds a terminating NUL. * If src is too long, then only n-1 characters will be copied * before the terminating NUL. * If n<=0 then dst is not modified. * * @param dst The destination string. * @param src The source string. * @param n The maximum number of characters to compare. * @return A pointer to dst. * @stable ICU 2.0 */ U_STABLE UChar* U_EXPORT2 u_strncat(UChar *dst, const UChar *src, int32_t n); /** * Find the first occurrence of a substring in a string. * The substring is found at code point boundaries. * That means that if the substring begins with * a trail surrogate or ends with a lead surrogate, * then it is found only if these surrogates stand alone in the text. * Otherwise, the substring edge units would be matched against * halves of surrogate pairs. * * @param s The string to search (NUL-terminated). * @param substring The substring to find (NUL-terminated). * @return A pointer to the first occurrence of substring in s, * or s itself if the substring is empty, * or NULL if substring is not in s. * @stable ICU 2.0 * * @see u_strrstr * @see u_strFindFirst * @see u_strFindLast */ U_STABLE UChar * U_EXPORT2 u_strstr(const UChar *s, const UChar *substring); /** * Find the first occurrence of a substring in a string. * The substring is found at code point boundaries. * That means that if the substring begins with * a trail surrogate or ends with a lead surrogate, * then it is found only if these surrogates stand alone in the text. * Otherwise, the substring edge units would be matched against * halves of surrogate pairs. * * @param s The string to search. * @param length The length of s (number of UChars), or -1 if it is NUL-terminated. * @param substring The substring to find (NUL-terminated). * @param subLength The length of substring (number of UChars), or -1 if it is NUL-terminated. * @return A pointer to the first occurrence of substring in s, * or s itself if the substring is empty, * or NULL if substring is not in s. * @stable ICU 2.4 * * @see u_strstr * @see u_strFindLast */ U_STABLE UChar * U_EXPORT2 u_strFindFirst(const UChar *s, int32_t length, const UChar *substring, int32_t subLength); /** * Find the first occurrence of a BMP code point in a string. * A surrogate code point is found only if its match in the text is not * part of a surrogate pair. * A NUL character is found at the string terminator. * * @param s The string to search (NUL-terminated). * @param c The BMP code point to find. * @return A pointer to the first occurrence of c in s * or NULL if c is not in s. * @stable ICU 2.0 * * @see u_strchr32 * @see u_memchr * @see u_strstr * @see u_strFindFirst */ U_STABLE UChar * U_EXPORT2 u_strchr(const UChar *s, UChar c); /** * Find the first occurrence of a code point in a string. * A surrogate code point is found only if its match in the text is not * part of a surrogate pair. * A NUL character is found at the string terminator. * * @param s The string to search (NUL-terminated). * @param c The code point to find. * @return A pointer to the first occurrence of c in s * or NULL if c is not in s. * @stable ICU 2.0 * * @see u_strchr * @see u_memchr32 * @see u_strstr * @see u_strFindFirst */ U_STABLE UChar * U_EXPORT2 u_strchr32(const UChar *s, UChar32 c); /** * Find the last occurrence of a substring in a string. * The substring is found at code point boundaries. * That means that if the substring begins with * a trail surrogate or ends with a lead surrogate, * then it is found only if these surrogates stand alone in the text. * Otherwise, the substring edge units would be matched against * halves of surrogate pairs. * * @param s The string to search (NUL-terminated). * @param substring The substring to find (NUL-terminated). * @return A pointer to the last occurrence of substring in s, * or s itself if the substring is empty, * or NULL if substring is not in s. * @stable ICU 2.4 * * @see u_strstr * @see u_strFindFirst * @see u_strFindLast */ U_STABLE UChar * U_EXPORT2 u_strrstr(const UChar *s, const UChar *substring); /** * Find the last occurrence of a substring in a string. * The substring is found at code point boundaries. * That means that if the substring begins with * a trail surrogate or ends with a lead surrogate, * then it is found only if these surrogates stand alone in the text. * Otherwise, the substring edge units would be matched against * halves of surrogate pairs. * * @param s The string to search. * @param length The length of s (number of UChars), or -1 if it is NUL-terminated. * @param substring The substring to find (NUL-terminated). * @param subLength The length of substring (number of UChars), or -1 if it is NUL-terminated. * @return A pointer to the last occurrence of substring in s, * or s itself if the substring is empty, * or NULL if substring is not in s. * @stable ICU 2.4 * * @see u_strstr * @see u_strFindLast */ U_STABLE UChar * U_EXPORT2 u_strFindLast(const UChar *s, int32_t length, const UChar *substring, int32_t subLength); /** * Find the last occurrence of a BMP code point in a string. * A surrogate code point is found only if its match in the text is not * part of a surrogate pair. * A NUL character is found at the string terminator. * * @param s The string to search (NUL-terminated). * @param c The BMP code point to find. * @return A pointer to the last occurrence of c in s * or NULL if c is not in s. * @stable ICU 2.4 * * @see u_strrchr32 * @see u_memrchr * @see u_strrstr * @see u_strFindLast */ U_STABLE UChar * U_EXPORT2 u_strrchr(const UChar *s, UChar c); /** * Find the last occurrence of a code point in a string. * A surrogate code point is found only if its match in the text is not * part of a surrogate pair. * A NUL character is found at the string terminator. * * @param s The string to search (NUL-terminated). * @param c The code point to find. * @return A pointer to the last occurrence of c in s * or NULL if c is not in s. * @stable ICU 2.4 * * @see u_strrchr * @see u_memchr32 * @see u_strrstr * @see u_strFindLast */ U_STABLE UChar * U_EXPORT2 u_strrchr32(const UChar *s, UChar32 c); /** * Locates the first occurrence in the string string of any of the characters * in the string matchSet. * Works just like C's strpbrk but with Unicode. * * @param string The string in which to search, NUL-terminated. * @param matchSet A NUL-terminated string defining a set of code points * for which to search in the text string. * @return A pointer to the character in string that matches one of the * characters in matchSet, or NULL if no such character is found. * @stable ICU 2.0 */ U_STABLE UChar * U_EXPORT2 u_strpbrk(const UChar *string, const UChar *matchSet); /** * Returns the number of consecutive characters in string, * beginning with the first, that do not occur somewhere in matchSet. * Works just like C's strcspn but with Unicode. * * @param string The string in which to search, NUL-terminated. * @param matchSet A NUL-terminated string defining a set of code points * for which to search in the text string. * @return The number of initial characters in string that do not * occur in matchSet. * @see u_strspn * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_strcspn(const UChar *string, const UChar *matchSet); /** * Returns the number of consecutive characters in string, * beginning with the first, that occur somewhere in matchSet. * Works just like C's strspn but with Unicode. * * @param string The string in which to search, NUL-terminated. * @param matchSet A NUL-terminated string defining a set of code points * for which to search in the text string. * @return The number of initial characters in string that do * occur in matchSet. * @see u_strcspn * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_strspn(const UChar *string, const UChar *matchSet); /** * The string tokenizer API allows an application to break a string into * tokens. Unlike strtok(), the saveState (the current pointer within the * original string) is maintained in saveState. In the first call, the * argument src is a pointer to the string. In subsequent calls to * return successive tokens of that string, src must be specified as * NULL. The value saveState is set by this function to maintain the * function's position within the string, and on each subsequent call * you must give this argument the same variable. This function does * handle surrogate pairs. This function is similar to the strtok_r() * the POSIX Threads Extension (1003.1c-1995) version. * * @param src String containing token(s). This string will be modified. * After the first call to u_strtok_r(), this argument must * be NULL to get to the next token. * @param delim Set of delimiter characters (Unicode code points). * @param saveState The current pointer within the original string, * which is set by this function. The saveState * parameter should the address of a local variable of type * UChar *. (i.e. defined "Uhar *myLocalSaveState" and use * &myLocalSaveState for this parameter). * @return A pointer to the next token found in src, or NULL * when there are no more tokens. * @stable ICU 2.0 */ U_STABLE UChar * U_EXPORT2 u_strtok_r(UChar *src, const UChar *delim, UChar **saveState); /** * Compare two Unicode strings for bitwise equality (code unit order). * * @param s1 A string to compare. * @param s2 A string to compare. * @return 0 if s1 and s2 are bitwise equal; a negative * value if s1 is bitwise less than s2,; a positive * value if s1 is bitwise greater than s2. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_strcmp(const UChar *s1, const UChar *s2); /** * Compare two Unicode strings in code point order. * See u_strCompare for details. * * @param s1 A string to compare. * @param s2 A string to compare. * @return a negative/zero/positive integer corresponding to whether * the first string is less than/equal to/greater than the second one * in code point order * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_strcmpCodePointOrder(const UChar *s1, const UChar *s2); /** * Compare two Unicode strings (binary order). * * The comparison can be done in code unit order or in code point order. * They differ only in UTF-16 when * comparing supplementary code points (U+10000..U+10ffff) * to BMP code points near the end of the BMP (i.e., U+e000..U+ffff). * In code unit order, high BMP code points sort after supplementary code points * because they are stored as pairs of surrogates which are at U+d800..U+dfff. * * This functions works with strings of different explicitly specified lengths * unlike the ANSI C-like u_strcmp() and u_memcmp() etc. * NUL-terminated strings are possible with length arguments of -1. * * @param s1 First source string. * @param length1 Length of first source string, or -1 if NUL-terminated. * * @param s2 Second source string. * @param length2 Length of second source string, or -1 if NUL-terminated. * * @param codePointOrder Choose between code unit order (FALSE) * and code point order (TRUE). * * @return <0 or 0 or >0 as usual for string comparisons * * @stable ICU 2.2 */ U_STABLE int32_t U_EXPORT2 u_strCompare(const UChar *s1, int32_t length1, const UChar *s2, int32_t length2, UBool codePointOrder); /** * Compare two Unicode strings (binary order) * as presented by UCharIterator objects. * Works otherwise just like u_strCompare(). * * Both iterators are reset to their start positions. * When the function returns, it is undefined where the iterators * have stopped. * * @param iter1 First source string iterator. * @param iter2 Second source string iterator. * @param codePointOrder Choose between code unit order (FALSE) * and code point order (TRUE). * * @return <0 or 0 or >0 as usual for string comparisons * * @see u_strCompare * * @stable ICU 2.6 */ U_STABLE int32_t U_EXPORT2 u_strCompareIter(UCharIterator *iter1, UCharIterator *iter2, UBool codePointOrder); #ifndef U_COMPARE_CODE_POINT_ORDER /* see also unistr.h and unorm.h */ /** * Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc: * Compare strings in code point order instead of code unit order. * @stable ICU 2.2 */ #define U_COMPARE_CODE_POINT_ORDER 0x8000 #endif /** * Compare two strings case-insensitively using full case folding. * This is equivalent to * u_strCompare(u_strFoldCase(s1, options), * u_strFoldCase(s2, options), * (options&U_COMPARE_CODE_POINT_ORDER)!=0). * * The comparison can be done in UTF-16 code unit order or in code point order. * They differ only when comparing supplementary code points (U+10000..U+10ffff) * to BMP code points near the end of the BMP (i.e., U+e000..U+ffff). * In code unit order, high BMP code points sort after supplementary code points * because they are stored as pairs of surrogates which are at U+d800..U+dfff. * * This functions works with strings of different explicitly specified lengths * unlike the ANSI C-like u_strcmp() and u_memcmp() etc. * NUL-terminated strings are possible with length arguments of -1. * * @param s1 First source string. * @param length1 Length of first source string, or -1 if NUL-terminated. * * @param s2 Second source string. * @param length2 Length of second source string, or -1 if NUL-terminated. * * @param options A bit set of options: * - U_FOLD_CASE_DEFAULT or 0 is used for default options: * Comparison in code unit order with default case folding. * * - U_COMPARE_CODE_POINT_ORDER * Set to choose code point order instead of code unit order * (see u_strCompare for details). * * - U_FOLD_CASE_EXCLUDE_SPECIAL_I * * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * * @return <0 or 0 or >0 as usual for string comparisons * * @stable ICU 2.2 */ U_STABLE int32_t U_EXPORT2 u_strCaseCompare(const UChar *s1, int32_t length1, const UChar *s2, int32_t length2, uint32_t options, UErrorCode *pErrorCode); /** * Compare two ustrings for bitwise equality. * Compares at most n characters. * * @param ucs1 A string to compare. * @param ucs2 A string to compare. * @param n The maximum number of characters to compare. * @return 0 if s1 and s2 are bitwise equal; a negative * value if s1 is bitwise less than s2; a positive * value if s1 is bitwise greater than s2. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_strncmp(const UChar *ucs1, const UChar *ucs2, int32_t n); /** * Compare two Unicode strings in code point order. * This is different in UTF-16 from u_strncmp() if supplementary characters are present. * For details, see u_strCompare(). * * @param s1 A string to compare. * @param s2 A string to compare. * @param n The maximum number of characters to compare. * @return a negative/zero/positive integer corresponding to whether * the first string is less than/equal to/greater than the second one * in code point order * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_strncmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t n); /** * Compare two strings case-insensitively using full case folding. * This is equivalent to u_strcmp(u_strFoldCase(s1, options), u_strFoldCase(s2, options)). * * @param s1 A string to compare. * @param s2 A string to compare. * @param options A bit set of options: * - U_FOLD_CASE_DEFAULT or 0 is used for default options: * Comparison in code unit order with default case folding. * * - U_COMPARE_CODE_POINT_ORDER * Set to choose code point order instead of code unit order * (see u_strCompare for details). * * - U_FOLD_CASE_EXCLUDE_SPECIAL_I * * @return A negative, zero, or positive integer indicating the comparison result. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_strcasecmp(const UChar *s1, const UChar *s2, uint32_t options); /** * Compare two strings case-insensitively using full case folding. * This is equivalent to u_strcmp(u_strFoldCase(s1, at most n, options), * u_strFoldCase(s2, at most n, options)). * * @param s1 A string to compare. * @param s2 A string to compare. * @param n The maximum number of characters each string to case-fold and then compare. * @param options A bit set of options: * - U_FOLD_CASE_DEFAULT or 0 is used for default options: * Comparison in code unit order with default case folding. * * - U_COMPARE_CODE_POINT_ORDER * Set to choose code point order instead of code unit order * (see u_strCompare for details). * * - U_FOLD_CASE_EXCLUDE_SPECIAL_I * * @return A negative, zero, or positive integer indicating the comparison result. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_strncasecmp(const UChar *s1, const UChar *s2, int32_t n, uint32_t options); /** * Compare two strings case-insensitively using full case folding. * This is equivalent to u_strcmp(u_strFoldCase(s1, n, options), * u_strFoldCase(s2, n, options)). * * @param s1 A string to compare. * @param s2 A string to compare. * @param length The number of characters in each string to case-fold and then compare. * @param options A bit set of options: * - U_FOLD_CASE_DEFAULT or 0 is used for default options: * Comparison in code unit order with default case folding. * * - U_COMPARE_CODE_POINT_ORDER * Set to choose code point order instead of code unit order * (see u_strCompare for details). * * - U_FOLD_CASE_EXCLUDE_SPECIAL_I * * @return A negative, zero, or positive integer indicating the comparison result. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_memcasecmp(const UChar *s1, const UChar *s2, int32_t length, uint32_t options); /** * Copy a ustring. Adds a null terminator. * * @param dst The destination string. * @param src The source string. * @return A pointer to dst. * @stable ICU 2.0 */ U_STABLE UChar* U_EXPORT2 u_strcpy(UChar *dst, const UChar *src); /** * Copy a ustring. * Copies at most n characters. The result will be null terminated * if the length of src is less than n. * * @param dst The destination string. * @param src The source string. * @param n The maximum number of characters to copy. * @return A pointer to dst. * @stable ICU 2.0 */ U_STABLE UChar* U_EXPORT2 u_strncpy(UChar *dst, const UChar *src, int32_t n); #if !UCONFIG_NO_CONVERSION /** * Copy a byte string encoded in the default codepage to a ustring. * Adds a null terminator. * Performs a host byte to UChar conversion * * @param dst The destination string. * @param src The source string. * @return A pointer to dst. * @stable ICU 2.0 */ U_STABLE UChar* U_EXPORT2 u_uastrcpy(UChar *dst, const char *src ); /** * Copy a byte string encoded in the default codepage to a ustring. * Copies at most n characters. The result will be null terminated * if the length of src is less than n. * Performs a host byte to UChar conversion * * @param dst The destination string. * @param src The source string. * @param n The maximum number of characters to copy. * @return A pointer to dst. * @stable ICU 2.0 */ U_STABLE UChar* U_EXPORT2 u_uastrncpy(UChar *dst, const char *src, int32_t n); /** * Copy ustring to a byte string encoded in the default codepage. * Adds a null terminator. * Performs a UChar to host byte conversion * * @param dst The destination string. * @param src The source string. * @return A pointer to dst. * @stable ICU 2.0 */ U_STABLE char* U_EXPORT2 u_austrcpy(char *dst, const UChar *src ); /** * Copy ustring to a byte string encoded in the default codepage. * Copies at most n characters. The result will be null terminated * if the length of src is less than n. * Performs a UChar to host byte conversion * * @param dst The destination string. * @param src The source string. * @param n The maximum number of characters to copy. * @return A pointer to dst. * @stable ICU 2.0 */ U_STABLE char* U_EXPORT2 u_austrncpy(char *dst, const UChar *src, int32_t n ); #endif /** * Synonym for memcpy(), but with UChars only. * @param dest The destination string * @param src The source string * @param count The number of characters to copy * @return A pointer to dest * @stable ICU 2.0 */ U_STABLE UChar* U_EXPORT2 u_memcpy(UChar *dest, const UChar *src, int32_t count); /** * Synonym for memmove(), but with UChars only. * @param dest The destination string * @param src The source string * @param count The number of characters to move * @return A pointer to dest * @stable ICU 2.0 */ U_STABLE UChar* U_EXPORT2 u_memmove(UChar *dest, const UChar *src, int32_t count); /** * Initialize count characters of dest to c. * * @param dest The destination string. * @param c The character to initialize the string. * @param count The maximum number of characters to set. * @return A pointer to dest. * @stable ICU 2.0 */ U_STABLE UChar* U_EXPORT2 u_memset(UChar *dest, UChar c, int32_t count); /** * Compare the first count UChars of each buffer. * * @param buf1 The first string to compare. * @param buf2 The second string to compare. * @param count The maximum number of UChars to compare. * @return When buf1 < buf2, a negative number is returned. * When buf1 == buf2, 0 is returned. * When buf1 > buf2, a positive number is returned. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_memcmp(const UChar *buf1, const UChar *buf2, int32_t count); /** * Compare two Unicode strings in code point order. * This is different in UTF-16 from u_memcmp() if supplementary characters are present. * For details, see u_strCompare(). * * @param s1 A string to compare. * @param s2 A string to compare. * @param count The maximum number of characters to compare. * @return a negative/zero/positive integer corresponding to whether * the first string is less than/equal to/greater than the second one * in code point order * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_memcmpCodePointOrder(const UChar *s1, const UChar *s2, int32_t count); /** * Find the first occurrence of a BMP code point in a string. * A surrogate code point is found only if its match in the text is not * part of a surrogate pair. * A NUL character is found at the string terminator. * * @param s The string to search (contains count UChars). * @param c The BMP code point to find. * @param count The length of the string. * @return A pointer to the first occurrence of c in s * or NULL if c is not in s. * @stable ICU 2.0 * * @see u_strchr * @see u_memchr32 * @see u_strFindFirst */ U_STABLE UChar* U_EXPORT2 u_memchr(const UChar *s, UChar c, int32_t count); /** * Find the first occurrence of a code point in a string. * A surrogate code point is found only if its match in the text is not * part of a surrogate pair. * A NUL character is found at the string terminator. * * @param s The string to search (contains count UChars). * @param c The code point to find. * @param count The length of the string. * @return A pointer to the first occurrence of c in s * or NULL if c is not in s. * @stable ICU 2.0 * * @see u_strchr32 * @see u_memchr * @see u_strFindFirst */ U_STABLE UChar* U_EXPORT2 u_memchr32(const UChar *s, UChar32 c, int32_t count); /** * Find the last occurrence of a BMP code point in a string. * A surrogate code point is found only if its match in the text is not * part of a surrogate pair. * A NUL character is found at the string terminator. * * @param s The string to search (contains count UChars). * @param c The BMP code point to find. * @param count The length of the string. * @return A pointer to the last occurrence of c in s * or NULL if c is not in s. * @stable ICU 2.4 * * @see u_strrchr * @see u_memrchr32 * @see u_strFindLast */ U_STABLE UChar* U_EXPORT2 u_memrchr(const UChar *s, UChar c, int32_t count); /** * Find the last occurrence of a code point in a string. * A surrogate code point is found only if its match in the text is not * part of a surrogate pair. * A NUL character is found at the string terminator. * * @param s The string to search (contains count UChars). * @param c The code point to find. * @param count The length of the string. * @return A pointer to the last occurrence of c in s * or NULL if c is not in s. * @stable ICU 2.4 * * @see u_strrchr32 * @see u_memrchr * @see u_strFindLast */ U_STABLE UChar* U_EXPORT2 u_memrchr32(const UChar *s, UChar32 c, int32_t count); /** * Unicode String literals in C. * We need one macro to declare a variable for the string * and to statically preinitialize it if possible, * and a second macro to dynamically intialize such a string variable if necessary. * * The macros are defined for maximum performance. * They work only for strings that contain "invariant characters", i.e., * only latin letters, digits, and some punctuation. * See utypes.h for details. * * A pair of macros for a single string must be used with the same * parameters. * The string parameter must be a C string literal. * The length of the string, not including the terminating * NUL, must be specified as a constant. * The U_STRING_DECL macro should be invoked exactly once for one * such string variable before it is used. * * Usage: *

 *     U_STRING_DECL(ustringVar1, "Quick-Fox 2", 11);
 *     U_STRING_DECL(ustringVar2, "jumps 5%", 8);
 *     static UBool didInit=FALSE;
 *  
 *     int32_t function() {
 *         if(!didInit) {
 *             U_STRING_INIT(ustringVar1, "Quick-Fox 2", 11);
 *             U_STRING_INIT(ustringVar2, "jumps 5%", 8);
 *             didInit=TRUE;
 *         }
 *         return u_strcmp(ustringVar1, ustringVar2);
 *     }
 * 
* @stable ICU 2.0 */ #if U_SIZEOF_WCHAR_T==U_SIZEOF_UCHAR && U_CHARSET_FAMILY==U_ASCII_FAMILY # define U_STRING_DECL(var, cs, length) static const wchar_t var[(length)+1]={ L ## cs } /**@stable ICU 2.0 */ # define U_STRING_INIT(var, cs, length) #elif U_SIZEOF_UCHAR==1 && U_CHARSET_FAMILY==U_ASCII_FAMILY # define U_STRING_DECL(var, cs, length) static const UChar var[(length)+1]={ (const UChar *)cs } /**@stable ICU 2.0 */ # define U_STRING_INIT(var, cs, length) #else # define U_STRING_DECL(var, cs, length) static UChar var[(length)+1] /**@stable ICU 2.0 */ # define U_STRING_INIT(var, cs, length) u_charsToUChars(cs, var, length+1) #endif /** * Unescape a string of characters and write the resulting * Unicode characters to the destination buffer. The following escape * sequences are recognized: * * \\uhhhh 4 hex digits; h in [0-9A-Fa-f] * \\Uhhhhhhhh 8 hex digits * \\xhh 1-2 hex digits * \\x{h...} 1-8 hex digits * \\ooo 1-3 octal digits; o in [0-7] * \\cX control-X; X is masked with 0x1F * * as well as the standard ANSI C escapes: * * \\a => U+0007, \\b => U+0008, \\t => U+0009, \\n => U+000A, * \\v => U+000B, \\f => U+000C, \\r => U+000D, \\e => U+001B, * \\" => U+0022, \\' => U+0027, \\? => U+003F, \\\\ => U+005C * * Anything else following a backslash is generically escaped. For * example, "[a\\-z]" returns "[a-z]". * * If an escape sequence is ill-formed, this method returns an empty * string. An example of an ill-formed sequence is "\\u" followed by * fewer than 4 hex digits. * * The above characters are recognized in the compiler's codepage, * that is, they are coded as 'u', '\\', etc. Characters that are * not parts of escape sequences are converted using u_charsToUChars(). * * This function is similar to UnicodeString::unescape() but not * identical to it. The latter takes a source UnicodeString, so it * does escape recognition but no conversion. * * @param src a zero-terminated string of invariant characters * @param dest pointer to buffer to receive converted and unescaped * text and, if there is room, a zero terminator. May be NULL for * preflighting, in which case no UChars will be written, but the * return value will still be valid. On error, an empty string is * stored here (if possible). * @param destCapacity the number of UChars that may be written at * dest. Ignored if dest == NULL. * @return the length of unescaped string. * @see u_unescapeAt * @see UnicodeString#unescape() * @see UnicodeString#unescapeAt() * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_unescape(const char *src, UChar *dest, int32_t destCapacity); U_CDECL_BEGIN /** * Callback function for u_unescapeAt() that returns a character of * the source text given an offset and a context pointer. The context * pointer will be whatever is passed into u_unescapeAt(). * * @param offset pointer to the offset that will be passed to u_unescapeAt(). * @param context an opaque pointer passed directly into u_unescapeAt() * @return the character represented by the escape sequence at * offset * @see u_unescapeAt * @stable ICU 2.0 */ typedef UChar (U_CALLCONV *UNESCAPE_CHAR_AT)(int32_t offset, void *context); U_CDECL_END /** * Unescape a single sequence. The character at offset-1 is assumed * (without checking) to be a backslash. This method takes a callback * pointer to a function that returns the UChar at a given offset. By * varying this callback, ICU functions are able to unescape char* * strings, UnicodeString objects, and UFILE pointers. * * If offset is out of range, or if the escape sequence is ill-formed, * (UChar32)0xFFFFFFFF is returned. See documentation of u_unescape() * for a list of recognized sequences. * * @param charAt callback function that returns a UChar of the source * text given an offset and a context pointer. * @param offset pointer to the offset that will be passed to charAt. * The offset value will be updated upon return to point after the * last parsed character of the escape sequence. On error the offset * is unchanged. * @param length the number of characters in the source text. The * last character of the source text is considered to be at offset * length-1. * @param context an opaque pointer passed directly into charAt. * @return the character represented by the escape sequence at * offset, or (UChar32)0xFFFFFFFF on error. * @see u_unescape() * @see UnicodeString#unescape() * @see UnicodeString#unescapeAt() * @stable ICU 2.0 */ U_STABLE UChar32 U_EXPORT2 u_unescapeAt(UNESCAPE_CHAR_AT charAt, int32_t *offset, int32_t length, void *context); /** * Uppercase the characters in a string. * Casing is locale-dependent and context-sensitive. * The result may be longer or shorter than the original. * The source string and the destination buffer are allowed to overlap. * * @param dest A buffer for the result string. The result will be zero-terminated if * the buffer is large enough. * @param destCapacity The size of the buffer (number of UChars). If it is 0, then * dest may be NULL and the function will only return the length of the result * without writing any of the result string. * @param src The original string * @param srcLength The length of the original string. If -1, then src must be zero-terminated. * @param locale The locale to consider, or "" for the root locale or NULL for the default locale. * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * @return The length of the result string. It may be greater than destCapacity. In that case, * only some of the result was written to the destination buffer. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_strToUpper(UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, const char *locale, UErrorCode *pErrorCode); /** * Lowercase the characters in a string. * Casing is locale-dependent and context-sensitive. * The result may be longer or shorter than the original. * The source string and the destination buffer are allowed to overlap. * * @param dest A buffer for the result string. The result will be zero-terminated if * the buffer is large enough. * @param destCapacity The size of the buffer (number of UChars). If it is 0, then * dest may be NULL and the function will only return the length of the result * without writing any of the result string. * @param src The original string * @param srcLength The length of the original string. If -1, then src must be zero-terminated. * @param locale The locale to consider, or "" for the root locale or NULL for the default locale. * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * @return The length of the result string. It may be greater than destCapacity. In that case, * only some of the result was written to the destination buffer. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_strToLower(UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, const char *locale, UErrorCode *pErrorCode); #if !UCONFIG_NO_BREAK_ITERATION /** * Titlecase a string. * Casing is locale-dependent and context-sensitive. * Titlecasing uses a break iterator to find the first characters of words * that are to be titlecased. It titlecases those characters and lowercases * all others. * * The titlecase break iterator can be provided to customize for arbitrary * styles, using rules and dictionaries beyond the standard iterators. * It may be more efficient to always provide an iterator to avoid * opening and closing one for each string. * The standard titlecase iterator for the root locale implements the * algorithm of Unicode TR 21. * * This function uses only the first() and next() methods of the * provided break iterator. * * The result may be longer or shorter than the original. * The source string and the destination buffer are allowed to overlap. * * @param dest A buffer for the result string. The result will be zero-terminated if * the buffer is large enough. * @param destCapacity The size of the buffer (number of UChars). If it is 0, then * dest may be NULL and the function will only return the length of the result * without writing any of the result string. * @param src The original string * @param srcLength The length of the original string. If -1, then src must be zero-terminated. * @param titleIter A break iterator to find the first characters of words * that are to be titlecased. * If none is provided (NULL), then a standard titlecase * break iterator is opened. * @param locale The locale to consider, or "" for the root locale or NULL for the default locale. * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * @return The length of the result string. It may be greater than destCapacity. In that case, * only some of the result was written to the destination buffer. * @stable ICU 2.1 */ U_STABLE int32_t U_EXPORT2 u_strToTitle(UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, UBreakIterator *titleIter, const char *locale, UErrorCode *pErrorCode); #endif /** * Case-fold the characters in a string. * Case-folding is locale-independent and not context-sensitive, * but there is an option for whether to include or exclude mappings for dotted I * and dotless i that are marked with 'I' in CaseFolding.txt. * The result may be longer or shorter than the original. * The source string and the destination buffer are allowed to overlap. * * @param dest A buffer for the result string. The result will be zero-terminated if * the buffer is large enough. * @param destCapacity The size of the buffer (number of UChars). If it is 0, then * dest may be NULL and the function will only return the length of the result * without writing any of the result string. * @param src The original string * @param srcLength The length of the original string. If -1, then src must be zero-terminated. * @param options Either U_FOLD_CASE_DEFAULT or U_FOLD_CASE_EXCLUDE_SPECIAL_I * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * @return The length of the result string. It may be greater than destCapacity. In that case, * only some of the result was written to the destination buffer. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_strFoldCase(UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, uint32_t options, UErrorCode *pErrorCode); /** * Converts a sequence of UChars to wchar_t units. * * @param dest A buffer for the result string. The result will be zero-terminated if * the buffer is large enough. * @param destCapacity The size of the buffer (number of wchar_t's). If it is 0, then * dest may be NULL and the function will only return the length of the * result without writing any of the result string (pre-flighting). * @param pDestLength A pointer to receive the number of units written to the destination. If * pDestLength!=NULL then *pDestLength is always set to the * number of output units corresponding to the transformation of * all the input units, even in case of a buffer overflow. * @param src The original source string * @param srcLength The length of the original string. If -1, then src must be zero-terminated. * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @stable ICU 2.0 */ U_STABLE wchar_t* U_EXPORT2 u_strToWCS(wchar_t *dest, int32_t destCapacity, int32_t *pDestLength, const UChar *src, int32_t srcLength, UErrorCode *pErrorCode); /** * Converts a sequence of wchar_t units to UChars * * @param dest A buffer for the result string. The result will be zero-terminated if * the buffer is large enough. * @param destCapacity The size of the buffer (number of UChars). If it is 0, then * dest may be NULL and the function will only return the length of the * result without writing any of the result string (pre-flighting). * @param pDestLength A pointer to receive the number of units written to the destination. If * pDestLength!=NULL then *pDestLength is always set to the * number of output units corresponding to the transformation of * all the input units, even in case of a buffer overflow. * @param src The original source string * @param srcLength The length of the original string. If -1, then src must be zero-terminated. * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @stable ICU 2.0 */ U_STABLE UChar* U_EXPORT2 u_strFromWCS(UChar *dest, int32_t destCapacity, int32_t *pDestLength, const wchar_t *src, int32_t srcLength, UErrorCode *pErrorCode); /** * Converts a sequence of UChars (UTF-16) to UTF-8 bytes * * @param dest A buffer for the result string. The result will be zero-terminated if * the buffer is large enough. * @param destCapacity The size of the buffer (number of chars). If it is 0, then * dest may be NULL and the function will only return the length of the * result without writing any of the result string (pre-flighting). * @param pDestLength A pointer to receive the number of units written to the destination. If * pDestLength!=NULL then *pDestLength is always set to the * number of output units corresponding to the transformation of * all the input units, even in case of a buffer overflow. * @param src The original source string * @param srcLength The length of the original string. If -1, then src must be zero-terminated. * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @stable ICU 2.0 */ U_STABLE char* U_EXPORT2 u_strToUTF8(char *dest, int32_t destCapacity, int32_t *pDestLength, const UChar *src, int32_t srcLength, UErrorCode *pErrorCode); /** * Converts a sequence of UTF-8 bytes to UChars (UTF-16). * * @param dest A buffer for the result string. The result will be zero-terminated if * the buffer is large enough. * @param destCapacity The size of the buffer (number of UChars). If it is 0, then * dest may be NULL and the function will only return the length of the * result without writing any of the result string (pre-flighting). * @param pDestLength A pointer to receive the number of units written to the destination. If * pDestLength!=NULL then *pDestLength is always set to the * number of output units corresponding to the transformation of * all the input units, even in case of a buffer overflow. * @param src The original source string * @param srcLength The length of the original string. If -1, then src must be zero-terminated. * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @stable ICU 2.0 */ U_STABLE UChar* U_EXPORT2 u_strFromUTF8(UChar *dest, int32_t destCapacity, int32_t *pDestLength, const char *src, int32_t srcLength, UErrorCode *pErrorCode); /** * Converts a sequence of UChars (UTF-16) to UTF32 units. * * @param dest A buffer for the result string. The result will be zero-terminated if * the buffer is large enough. * @param destCapacity The size of the buffer (number of UChar32s). If it is 0, then * dest may be NULL and the function will only return the length of the * result without writing any of the result string (pre-flighting). * @param pDestLength A pointer to receive the number of units written to the destination. If * pDestLength!=NULL then *pDestLength is always set to the * number of output units corresponding to the transformation of * all the input units, even in case of a buffer overflow. * @param src The original source string * @param srcLength The length of the original string. If -1, then src must be zero-terminated. * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @stable ICU 2.0 */ U_STABLE UChar32* U_EXPORT2 u_strToUTF32(UChar32 *dest, int32_t destCapacity, int32_t *pDestLength, const UChar *src, int32_t srcLength, UErrorCode *pErrorCode); /** * Converts a sequence of UTF32 units to UChars (UTF-16) * * @param dest A buffer for the result string. The result will be zero-terminated if * the buffer is large enough. * @param destCapacity The size of the buffer (number of UChars). If it is 0, then * dest may be NULL and the function will only return the length of the * result without writing any of the result string (pre-flighting). * @param pDestLength A pointer to receive the number of units written to the destination. If * pDestLength!=NULL then *pDestLength is always set to the * number of output units corresponding to the transformation of * all the input units, even in case of a buffer overflow. * @param src The original source string * @param srcLength The length of the original string. If -1, then src must be zero-terminated. * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * @return The pointer to destination buffer. * @stable ICU 2.0 */ U_STABLE UChar* U_EXPORT2 u_strFromUTF32(UChar *dest, int32_t destCapacity, int32_t *pDestLength, const UChar32 *src, int32_t srcLength, UErrorCode *pErrorCode); #endif WebKit/mac/icu/unicode/urename.h0000644000175000017500000020547410360512352015123 0ustar leelee/* ******************************************************************************* * Copyright (C) 2002-2004, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* * * file name: urename.h * encoding: US-ASCII * tab size: 8 (not used) * indentation:4 * * Created by: Perl script written by Vladimir Weinstein * * Contains data for renaming ICU exports. * Gets included by umachine.h * * THIS FILE IS MACHINE-GENERATED, DON'T PLAY WITH IT IF YOU DON'T KNOW WHAT * YOU ARE DOING, OTHERWISE VERY BAD THINGS WILL HAPPEN! */ #ifndef URENAME_H #define URENAME_H /* Uncomment the following line to disable renaming on platforms that do not use Autoconf. */ /* #define U_DISABLE_RENAMING 1 */ #if !U_DISABLE_RENAMING /* C exports renaming data */ #define T_CString_int64ToString T_CString_int64ToString_3_2 #define T_CString_integerToString T_CString_integerToString_3_2 #define T_CString_stricmp T_CString_stricmp_3_2 #define T_CString_stringToInteger T_CString_stringToInteger_3_2 #define T_CString_strnicmp T_CString_strnicmp_3_2 #define T_CString_toLowerCase T_CString_toLowerCase_3_2 #define T_CString_toUpperCase T_CString_toUpperCase_3_2 #define T_FileStream_close T_FileStream_close_3_2 #define T_FileStream_eof T_FileStream_eof_3_2 #define T_FileStream_error T_FileStream_error_3_2 #define T_FileStream_file_exists T_FileStream_file_exists_3_2 #define T_FileStream_getc T_FileStream_getc_3_2 #define T_FileStream_open T_FileStream_open_3_2 #define T_FileStream_peek T_FileStream_peek_3_2 #define T_FileStream_putc T_FileStream_putc_3_2 #define T_FileStream_read T_FileStream_read_3_2 #define T_FileStream_readLine T_FileStream_readLine_3_2 #define T_FileStream_remove T_FileStream_remove_3_2 #define T_FileStream_rewind T_FileStream_rewind_3_2 #define T_FileStream_size T_FileStream_size_3_2 #define T_FileStream_stderr T_FileStream_stderr_3_2 #define T_FileStream_stdin T_FileStream_stdin_3_2 #define T_FileStream_stdout T_FileStream_stdout_3_2 #define T_FileStream_ungetc T_FileStream_ungetc_3_2 #define T_FileStream_write T_FileStream_write_3_2 #define T_FileStream_writeLine T_FileStream_writeLine_3_2 #define UCNV_FROM_U_CALLBACK_ESCAPE UCNV_FROM_U_CALLBACK_ESCAPE_3_2 #define UCNV_FROM_U_CALLBACK_SKIP UCNV_FROM_U_CALLBACK_SKIP_3_2 #define UCNV_FROM_U_CALLBACK_STOP UCNV_FROM_U_CALLBACK_STOP_3_2 #define UCNV_FROM_U_CALLBACK_SUBSTITUTE UCNV_FROM_U_CALLBACK_SUBSTITUTE_3_2 #define UCNV_TO_U_CALLBACK_ESCAPE UCNV_TO_U_CALLBACK_ESCAPE_3_2 #define UCNV_TO_U_CALLBACK_SKIP UCNV_TO_U_CALLBACK_SKIP_3_2 #define UCNV_TO_U_CALLBACK_STOP UCNV_TO_U_CALLBACK_STOP_3_2 #define UCNV_TO_U_CALLBACK_SUBSTITUTE UCNV_TO_U_CALLBACK_SUBSTITUTE_3_2 #define UDataMemory_createNewInstance UDataMemory_createNewInstance_3_2 #define UDataMemory_init UDataMemory_init_3_2 #define UDataMemory_isLoaded UDataMemory_isLoaded_3_2 #define UDataMemory_normalizeDataPointer UDataMemory_normalizeDataPointer_3_2 #define UDataMemory_setData UDataMemory_setData_3_2 #define UDatamemory_assign UDatamemory_assign_3_2 #define _ASCIIData _ASCIIData_3_2 #define _Bocu1Data _Bocu1Data_3_2 #define _CESU8Data _CESU8Data_3_2 #define _HZData _HZData_3_2 #define _IMAPData _IMAPData_3_2 #define _ISCIIData _ISCIIData_3_2 #define _ISO2022Data _ISO2022Data_3_2 #define _LMBCSData1 _LMBCSData1_3_2 #define _LMBCSData11 _LMBCSData11_3_2 #define _LMBCSData16 _LMBCSData16_3_2 #define _LMBCSData17 _LMBCSData17_3_2 #define _LMBCSData18 _LMBCSData18_3_2 #define _LMBCSData19 _LMBCSData19_3_2 #define _LMBCSData2 _LMBCSData2_3_2 #define _LMBCSData3 _LMBCSData3_3_2 #define _LMBCSData4 _LMBCSData4_3_2 #define _LMBCSData5 _LMBCSData5_3_2 #define _LMBCSData6 _LMBCSData6_3_2 #define _LMBCSData8 _LMBCSData8_3_2 #define _Latin1Data _Latin1Data_3_2 #define _MBCSData _MBCSData_3_2 #define _SCSUData _SCSUData_3_2 #define _UTF16BEData _UTF16BEData_3_2 #define _UTF16Data _UTF16Data_3_2 #define _UTF16LEData _UTF16LEData_3_2 #define _UTF32BEData _UTF32BEData_3_2 #define _UTF32Data _UTF32Data_3_2 #define _UTF32LEData _UTF32LEData_3_2 #define _UTF7Data _UTF7Data_3_2 #define _UTF8Data _UTF8Data_3_2 #define cmemory_cleanup cmemory_cleanup_3_2 #define cmemory_inUse cmemory_inUse_3_2 #define locale_getKeywords locale_getKeywords_3_2 #define locale_get_default locale_get_default_3_2 #define locale_set_default locale_set_default_3_2 #define res_countArrayItems res_countArrayItems_3_2 #define res_findResource res_findResource_3_2 #define res_getAlias res_getAlias_3_2 #define res_getArrayItem res_getArrayItem_3_2 #define res_getBinary res_getBinary_3_2 #define res_getIntVector res_getIntVector_3_2 #define res_getResource res_getResource_3_2 #define res_getString res_getString_3_2 #define res_getTableItemByIndex res_getTableItemByIndex_3_2 #define res_getTableItemByKey res_getTableItemByKey_3_2 #define res_load res_load_3_2 #define res_unload res_unload_3_2 #define transliterator_cleanup transliterator_cleanup_3_2 #define u_UCharsToChars u_UCharsToChars_3_2 #define u_austrcpy u_austrcpy_3_2 #define u_austrncpy u_austrncpy_3_2 #define u_catclose u_catclose_3_2 #define u_catgets u_catgets_3_2 #define u_catopen u_catopen_3_2 #define u_charAge u_charAge_3_2 #define u_charDigitValue u_charDigitValue_3_2 #define u_charDirection u_charDirection_3_2 #define u_charFromName u_charFromName_3_2 #define u_charMirror u_charMirror_3_2 #define u_charName u_charName_3_2 #define u_charType u_charType_3_2 #define u_charsToUChars u_charsToUChars_3_2 #define u_cleanup u_cleanup_3_2 #define u_countChar32 u_countChar32_3_2 #define u_digit u_digit_3_2 #define u_enumCharNames u_enumCharNames_3_2 #define u_enumCharTypes u_enumCharTypes_3_2 #define u_errorName u_errorName_3_2 #define u_fclose u_fclose_3_2 #define u_feof u_feof_3_2 #define u_fflush u_fflush_3_2 #define u_fgetConverter u_fgetConverter_3_2 #define u_fgetc u_fgetc_3_2 #define u_fgetcodepage u_fgetcodepage_3_2 #define u_fgetcx u_fgetcx_3_2 #define u_fgetfile u_fgetfile_3_2 #define u_fgetlocale u_fgetlocale_3_2 #define u_fgets u_fgets_3_2 #define u_file_read u_file_read_3_2 #define u_file_write u_file_write_3_2 #define u_file_write_flush u_file_write_flush_3_2 #define u_finit u_finit_3_2 #define u_foldCase u_foldCase_3_2 #define u_fopen u_fopen_3_2 #define u_forDigit u_forDigit_3_2 #define u_formatMessage u_formatMessage_3_2 #define u_formatMessageWithError u_formatMessageWithError_3_2 #define u_fprintf u_fprintf_3_2 #define u_fprintf_u u_fprintf_u_3_2 #define u_fputc u_fputc_3_2 #define u_fputs u_fputs_3_2 #define u_frewind u_frewind_3_2 #define u_fscanf u_fscanf_3_2 #define u_fscanf_u u_fscanf_u_3_2 #define u_fsetcodepage u_fsetcodepage_3_2 #define u_fsetlocale u_fsetlocale_3_2 #define u_fsettransliterator u_fsettransliterator_3_2 #define u_fstropen u_fstropen_3_2 #define u_fungetc u_fungetc_3_2 #define u_getCombiningClass u_getCombiningClass_3_2 #define u_getDataDirectory u_getDataDirectory_3_2 #define u_getDefaultConverter u_getDefaultConverter_3_2 #define u_getFC_NFKC_Closure u_getFC_NFKC_Closure_3_2 #define u_getISOComment u_getISOComment_3_2 #define u_getIntPropertyMaxValue u_getIntPropertyMaxValue_3_2 #define u_getIntPropertyMinValue u_getIntPropertyMinValue_3_2 #define u_getIntPropertyValue u_getIntPropertyValue_3_2 #define u_getNumericValue u_getNumericValue_3_2 #define u_getPropertyEnum u_getPropertyEnum_3_2 #define u_getPropertyName u_getPropertyName_3_2 #define u_getPropertyValueEnum u_getPropertyValueEnum_3_2 #define u_getPropertyValueName u_getPropertyValueName_3_2 #define u_getUnicodeProperties u_getUnicodeProperties_3_2 #define u_getUnicodeVersion u_getUnicodeVersion_3_2 #define u_getVersion u_getVersion_3_2 #define u_growBufferFromStatic u_growBufferFromStatic_3_2 #define u_hasBinaryProperty u_hasBinaryProperty_3_2 #define u_init u_init_3_2 #define u_isIDIgnorable u_isIDIgnorable_3_2 #define u_isIDPart u_isIDPart_3_2 #define u_isIDStart u_isIDStart_3_2 #define u_isISOControl u_isISOControl_3_2 #define u_isJavaIDPart u_isJavaIDPart_3_2 #define u_isJavaIDStart u_isJavaIDStart_3_2 #define u_isJavaSpaceChar u_isJavaSpaceChar_3_2 #define u_isMirrored u_isMirrored_3_2 #define u_isUAlphabetic u_isUAlphabetic_3_2 #define u_isULowercase u_isULowercase_3_2 #define u_isUUppercase u_isUUppercase_3_2 #define u_isUWhiteSpace u_isUWhiteSpace_3_2 #define u_isWhitespace u_isWhitespace_3_2 #define u_isalnum u_isalnum_3_2 #define u_isalpha u_isalpha_3_2 #define u_isbase u_isbase_3_2 #define u_isblank u_isblank_3_2 #define u_iscntrl u_iscntrl_3_2 #define u_isdefined u_isdefined_3_2 #define u_isdigit u_isdigit_3_2 #define u_isgraph u_isgraph_3_2 #define u_islower u_islower_3_2 #define u_isprint u_isprint_3_2 #define u_ispunct u_ispunct_3_2 #define u_isspace u_isspace_3_2 #define u_istitle u_istitle_3_2 #define u_isupper u_isupper_3_2 #define u_isxdigit u_isxdigit_3_2 #define u_lengthOfIdenticalLevelRun u_lengthOfIdenticalLevelRun_3_2 #define u_locbund_close u_locbund_close_3_2 #define u_locbund_getNumberFormat u_locbund_getNumberFormat_3_2 #define u_locbund_init u_locbund_init_3_2 #define u_memcasecmp u_memcasecmp_3_2 #define u_memchr u_memchr_3_2 #define u_memchr32 u_memchr32_3_2 #define u_memcmp u_memcmp_3_2 #define u_memcmpCodePointOrder u_memcmpCodePointOrder_3_2 #define u_memcpy u_memcpy_3_2 #define u_memmove u_memmove_3_2 #define u_memrchr u_memrchr_3_2 #define u_memrchr32 u_memrchr32_3_2 #define u_memset u_memset_3_2 #define u_parseMessage u_parseMessage_3_2 #define u_parseMessageWithError u_parseMessageWithError_3_2 #define u_printf_parse u_printf_parse_3_2 #define u_releaseDefaultConverter u_releaseDefaultConverter_3_2 #define u_scanf_parse u_scanf_parse_3_2 #define u_setAtomicIncDecFunctions u_setAtomicIncDecFunctions_3_2 #define u_setDataDirectory u_setDataDirectory_3_2 #define u_setMemoryFunctions u_setMemoryFunctions_3_2 #define u_setMutexFunctions u_setMutexFunctions_3_2 #define u_shapeArabic u_shapeArabic_3_2 #define u_snprintf u_snprintf_3_2 #define u_snprintf_u u_snprintf_u_3_2 #define u_sprintf u_sprintf_3_2 #define u_sprintf_u u_sprintf_u_3_2 #define u_sscanf u_sscanf_3_2 #define u_sscanf_u u_sscanf_u_3_2 #define u_strCaseCompare u_strCaseCompare_3_2 #define u_strCompare u_strCompare_3_2 #define u_strCompareIter u_strCompareIter_3_2 #define u_strFindFirst u_strFindFirst_3_2 #define u_strFindLast u_strFindLast_3_2 #define u_strFoldCase u_strFoldCase_3_2 #define u_strFromPunycode u_strFromPunycode_3_2 #define u_strFromUTF32 u_strFromUTF32_3_2 #define u_strFromUTF8 u_strFromUTF8_3_2 #define u_strFromWCS u_strFromWCS_3_2 #define u_strHasMoreChar32Than u_strHasMoreChar32Than_3_2 #define u_strToLower u_strToLower_3_2 #define u_strToPunycode u_strToPunycode_3_2 #define u_strToTitle u_strToTitle_3_2 #define u_strToUTF32 u_strToUTF32_3_2 #define u_strToUTF8 u_strToUTF8_3_2 #define u_strToUpper u_strToUpper_3_2 #define u_strToWCS u_strToWCS_3_2 #define u_strcasecmp u_strcasecmp_3_2 #define u_strcat u_strcat_3_2 #define u_strchr u_strchr_3_2 #define u_strchr32 u_strchr32_3_2 #define u_strcmp u_strcmp_3_2 #define u_strcmpCodePointOrder u_strcmpCodePointOrder_3_2 #define u_strcmpFold u_strcmpFold_3_2 #define u_strcpy u_strcpy_3_2 #define u_strcspn u_strcspn_3_2 #define u_strlen u_strlen_3_2 #define u_strncasecmp u_strncasecmp_3_2 #define u_strncat u_strncat_3_2 #define u_strncmp u_strncmp_3_2 #define u_strncmpCodePointOrder u_strncmpCodePointOrder_3_2 #define u_strncpy u_strncpy_3_2 #define u_strpbrk u_strpbrk_3_2 #define u_strrchr u_strrchr_3_2 #define u_strrchr32 u_strrchr32_3_2 #define u_strrstr u_strrstr_3_2 #define u_strspn u_strspn_3_2 #define u_strstr u_strstr_3_2 #define u_strtok_r u_strtok_r_3_2 #define u_terminateChars u_terminateChars_3_2 #define u_terminateUChar32s u_terminateUChar32s_3_2 #define u_terminateUChars u_terminateUChars_3_2 #define u_terminateWChars u_terminateWChars_3_2 #define u_tolower u_tolower_3_2 #define u_totitle u_totitle_3_2 #define u_toupper u_toupper_3_2 #define u_uastrcpy u_uastrcpy_3_2 #define u_uastrncpy u_uastrncpy_3_2 #define u_unescape u_unescape_3_2 #define u_unescapeAt u_unescapeAt_3_2 #define u_versionFromString u_versionFromString_3_2 #define u_versionToString u_versionToString_3_2 #define u_vformatMessage u_vformatMessage_3_2 #define u_vformatMessageWithError u_vformatMessageWithError_3_2 #define u_vfprintf u_vfprintf_3_2 #define u_vfprintf_u u_vfprintf_u_3_2 #define u_vfscanf u_vfscanf_3_2 #define u_vfscanf_u u_vfscanf_u_3_2 #define u_vparseMessage u_vparseMessage_3_2 #define u_vparseMessageWithError u_vparseMessageWithError_3_2 #define u_vsnprintf u_vsnprintf_3_2 #define u_vsnprintf_u u_vsnprintf_u_3_2 #define u_vsprintf u_vsprintf_3_2 #define u_vsprintf_u u_vsprintf_u_3_2 #define u_vsscanf u_vsscanf_3_2 #define u_vsscanf_u u_vsscanf_u_3_2 #define u_writeDiff u_writeDiff_3_2 #define u_writeIdenticalLevelRun u_writeIdenticalLevelRun_3_2 #define u_writeIdenticalLevelRunTwoChars u_writeIdenticalLevelRunTwoChars_3_2 #define ubidi_close ubidi_close_3_2 #define ubidi_countRuns ubidi_countRuns_3_2 #define ubidi_getDirection ubidi_getDirection_3_2 #define ubidi_getLength ubidi_getLength_3_2 #define ubidi_getLevelAt ubidi_getLevelAt_3_2 #define ubidi_getLevels ubidi_getLevels_3_2 #define ubidi_getLogicalIndex ubidi_getLogicalIndex_3_2 #define ubidi_getLogicalMap ubidi_getLogicalMap_3_2 #define ubidi_getLogicalRun ubidi_getLogicalRun_3_2 #define ubidi_getMemory ubidi_getMemory_3_2 #define ubidi_getParaLevel ubidi_getParaLevel_3_2 #define ubidi_getRuns ubidi_getRuns_3_2 #define ubidi_getText ubidi_getText_3_2 #define ubidi_getVisualIndex ubidi_getVisualIndex_3_2 #define ubidi_getVisualMap ubidi_getVisualMap_3_2 #define ubidi_getVisualRun ubidi_getVisualRun_3_2 #define ubidi_invertMap ubidi_invertMap_3_2 #define ubidi_isInverse ubidi_isInverse_3_2 #define ubidi_open ubidi_open_3_2 #define ubidi_openSized ubidi_openSized_3_2 #define ubidi_reorderLogical ubidi_reorderLogical_3_2 #define ubidi_reorderVisual ubidi_reorderVisual_3_2 #define ubidi_setInverse ubidi_setInverse_3_2 #define ubidi_setLine ubidi_setLine_3_2 #define ubidi_setPara ubidi_setPara_3_2 #define ubidi_writeReordered ubidi_writeReordered_3_2 #define ubidi_writeReverse ubidi_writeReverse_3_2 #define ublock_getCode ublock_getCode_3_2 #define ubrk_close ubrk_close_3_2 #define ubrk_countAvailable ubrk_countAvailable_3_2 #define ubrk_current ubrk_current_3_2 #define ubrk_first ubrk_first_3_2 #define ubrk_following ubrk_following_3_2 #define ubrk_getAvailable ubrk_getAvailable_3_2 #define ubrk_getLocaleByType ubrk_getLocaleByType_3_2 #define ubrk_getRuleStatus ubrk_getRuleStatus_3_2 #define ubrk_getRuleStatusVec ubrk_getRuleStatusVec_3_2 #define ubrk_isBoundary ubrk_isBoundary_3_2 #define ubrk_last ubrk_last_3_2 #define ubrk_next ubrk_next_3_2 #define ubrk_open ubrk_open_3_2 #define ubrk_openRules ubrk_openRules_3_2 #define ubrk_preceding ubrk_preceding_3_2 #define ubrk_previous ubrk_previous_3_2 #define ubrk_safeClone ubrk_safeClone_3_2 #define ubrk_setText ubrk_setText_3_2 #define ubrk_swap ubrk_swap_3_2 #define ucal_add ucal_add_3_2 #define ucal_clear ucal_clear_3_2 #define ucal_clearField ucal_clearField_3_2 #define ucal_close ucal_close_3_2 #define ucal_countAvailable ucal_countAvailable_3_2 #define ucal_equivalentTo ucal_equivalentTo_3_2 #define ucal_get ucal_get_3_2 #define ucal_getAttribute ucal_getAttribute_3_2 #define ucal_getAvailable ucal_getAvailable_3_2 #define ucal_getDSTSavings ucal_getDSTSavings_3_2 #define ucal_getDefaultTimeZone ucal_getDefaultTimeZone_3_2 #define ucal_getLimit ucal_getLimit_3_2 #define ucal_getLocaleByType ucal_getLocaleByType_3_2 #define ucal_getMillis ucal_getMillis_3_2 #define ucal_getNow ucal_getNow_3_2 #define ucal_getTimeZoneDisplayName ucal_getTimeZoneDisplayName_3_2 #define ucal_inDaylightTime ucal_inDaylightTime_3_2 #define ucal_isSet ucal_isSet_3_2 #define ucal_open ucal_open_3_2 #define ucal_openCountryTimeZones ucal_openCountryTimeZones_3_2 #define ucal_openTimeZones ucal_openTimeZones_3_2 #define ucal_roll ucal_roll_3_2 #define ucal_set ucal_set_3_2 #define ucal_setAttribute ucal_setAttribute_3_2 #define ucal_setDate ucal_setDate_3_2 #define ucal_setDateTime ucal_setDateTime_3_2 #define ucal_setDefaultTimeZone ucal_setDefaultTimeZone_3_2 #define ucal_setMillis ucal_setMillis_3_2 #define ucal_setTimeZone ucal_setTimeZone_3_2 #define ucase_addPropertyStarts ucase_addPropertyStarts_3_2 #define ucase_close ucase_close_3_2 #define ucase_fold ucase_fold_3_2 #define ucase_getSingleton ucase_getSingleton_3_2 #define ucase_getType ucase_getType_3_2 #define ucase_getTypeOrIgnorable ucase_getTypeOrIgnorable_3_2 #define ucase_isCaseSensitive ucase_isCaseSensitive_3_2 #define ucase_isSoftDotted ucase_isSoftDotted_3_2 #define ucase_open ucase_open_3_2 #define ucase_openBinary ucase_openBinary_3_2 #define ucase_swap ucase_swap_3_2 #define ucase_toFullFolding ucase_toFullFolding_3_2 #define ucase_toFullLower ucase_toFullLower_3_2 #define ucase_toFullTitle ucase_toFullTitle_3_2 #define ucase_toFullUpper ucase_toFullUpper_3_2 #define ucase_tolower ucase_tolower_3_2 #define ucase_totitle ucase_totitle_3_2 #define ucase_toupper ucase_toupper_3_2 #define uchar_addPropertyStarts uchar_addPropertyStarts_3_2 #define uchar_getHST uchar_getHST_3_2 #define uchar_swapNames uchar_swapNames_3_2 #define ucln_common_lib_cleanup ucln_common_lib_cleanup_3_2 #define ucln_common_registerCleanup ucln_common_registerCleanup_3_2 #define ucln_i18n_registerCleanup ucln_i18n_registerCleanup_3_2 #define ucln_registerCleanup ucln_registerCleanup_3_2 #define ucmp8_close ucmp8_close_3_2 #define ucmp8_compact ucmp8_compact_3_2 #define ucmp8_expand ucmp8_expand_3_2 #define ucmp8_flattenMem ucmp8_flattenMem_3_2 #define ucmp8_getArray ucmp8_getArray_3_2 #define ucmp8_getCount ucmp8_getCount_3_2 #define ucmp8_getIndex ucmp8_getIndex_3_2 #define ucmp8_getkBlockCount ucmp8_getkBlockCount_3_2 #define ucmp8_getkUnicodeCount ucmp8_getkUnicodeCount_3_2 #define ucmp8_init ucmp8_init_3_2 #define ucmp8_initAdopt ucmp8_initAdopt_3_2 #define ucmp8_initAlias ucmp8_initAlias_3_2 #define ucmp8_initBogus ucmp8_initBogus_3_2 #define ucmp8_initFromData ucmp8_initFromData_3_2 #define ucmp8_isBogus ucmp8_isBogus_3_2 #define ucmp8_open ucmp8_open_3_2 #define ucmp8_openAdopt ucmp8_openAdopt_3_2 #define ucmp8_openAlias ucmp8_openAlias_3_2 #define ucmp8_set ucmp8_set_3_2 #define ucmp8_setRange ucmp8_setRange_3_2 #define ucnv_MBCSFromUChar32 ucnv_MBCSFromUChar32_3_2 #define ucnv_MBCSFromUnicodeWithOffsets ucnv_MBCSFromUnicodeWithOffsets_3_2 #define ucnv_MBCSGetType ucnv_MBCSGetType_3_2 #define ucnv_MBCSGetUnicodeSetForBytes ucnv_MBCSGetUnicodeSetForBytes_3_2 #define ucnv_MBCSGetUnicodeSetForUnicode ucnv_MBCSGetUnicodeSetForUnicode_3_2 #define ucnv_MBCSIsLeadByte ucnv_MBCSIsLeadByte_3_2 #define ucnv_MBCSSimpleGetNextUChar ucnv_MBCSSimpleGetNextUChar_3_2 #define ucnv_MBCSToUnicodeWithOffsets ucnv_MBCSToUnicodeWithOffsets_3_2 #define ucnv_cbFromUWriteBytes ucnv_cbFromUWriteBytes_3_2 #define ucnv_cbFromUWriteSub ucnv_cbFromUWriteSub_3_2 #define ucnv_cbFromUWriteUChars ucnv_cbFromUWriteUChars_3_2 #define ucnv_cbToUWriteSub ucnv_cbToUWriteSub_3_2 #define ucnv_cbToUWriteUChars ucnv_cbToUWriteUChars_3_2 #define ucnv_close ucnv_close_3_2 #define ucnv_compareNames ucnv_compareNames_3_2 #define ucnv_convert ucnv_convert_3_2 #define ucnv_convertEx ucnv_convertEx_3_2 #define ucnv_copyPlatformString ucnv_copyPlatformString_3_2 #define ucnv_countAliases ucnv_countAliases_3_2 #define ucnv_countAvailable ucnv_countAvailable_3_2 #define ucnv_countStandards ucnv_countStandards_3_2 #define ucnv_createAlgorithmicConverter ucnv_createAlgorithmicConverter_3_2 #define ucnv_createConverter ucnv_createConverter_3_2 #define ucnv_createConverterFromPackage ucnv_createConverterFromPackage_3_2 #define ucnv_createConverterFromSharedData ucnv_createConverterFromSharedData_3_2 #define ucnv_detectUnicodeSignature ucnv_detectUnicodeSignature_3_2 #define ucnv_extContinueMatchFromU ucnv_extContinueMatchFromU_3_2 #define ucnv_extContinueMatchToU ucnv_extContinueMatchToU_3_2 #define ucnv_extGetUnicodeSet ucnv_extGetUnicodeSet_3_2 #define ucnv_extInitialMatchFromU ucnv_extInitialMatchFromU_3_2 #define ucnv_extInitialMatchToU ucnv_extInitialMatchToU_3_2 #define ucnv_extSimpleMatchFromU ucnv_extSimpleMatchFromU_3_2 #define ucnv_extSimpleMatchToU ucnv_extSimpleMatchToU_3_2 #define ucnv_fixFileSeparator ucnv_fixFileSeparator_3_2 #define ucnv_flushCache ucnv_flushCache_3_2 #define ucnv_fromAlgorithmic ucnv_fromAlgorithmic_3_2 #define ucnv_fromUChars ucnv_fromUChars_3_2 #define ucnv_fromUWriteBytes ucnv_fromUWriteBytes_3_2 #define ucnv_fromUnicode ucnv_fromUnicode_3_2 #define ucnv_fromUnicode_UTF8 ucnv_fromUnicode_UTF8_3_2 #define ucnv_fromUnicode_UTF8_OFFSETS_LOGIC ucnv_fromUnicode_UTF8_OFFSETS_LOGIC_3_2 #define ucnv_getAlias ucnv_getAlias_3_2 #define ucnv_getAliases ucnv_getAliases_3_2 #define ucnv_getAvailableName ucnv_getAvailableName_3_2 #define ucnv_getCCSID ucnv_getCCSID_3_2 #define ucnv_getCanonicalName ucnv_getCanonicalName_3_2 #define ucnv_getCompleteUnicodeSet ucnv_getCompleteUnicodeSet_3_2 #define ucnv_getDefaultName ucnv_getDefaultName_3_2 #define ucnv_getDisplayName ucnv_getDisplayName_3_2 #define ucnv_getFromUCallBack ucnv_getFromUCallBack_3_2 #define ucnv_getInvalidChars ucnv_getInvalidChars_3_2 #define ucnv_getInvalidUChars ucnv_getInvalidUChars_3_2 #define ucnv_getMaxCharSize ucnv_getMaxCharSize_3_2 #define ucnv_getMinCharSize ucnv_getMinCharSize_3_2 #define ucnv_getName ucnv_getName_3_2 #define ucnv_getNextUChar ucnv_getNextUChar_3_2 #define ucnv_getNonSurrogateUnicodeSet ucnv_getNonSurrogateUnicodeSet_3_2 #define ucnv_getPlatform ucnv_getPlatform_3_2 #define ucnv_getStandard ucnv_getStandard_3_2 #define ucnv_getStandardName ucnv_getStandardName_3_2 #define ucnv_getStarters ucnv_getStarters_3_2 #define ucnv_getSubstChars ucnv_getSubstChars_3_2 #define ucnv_getToUCallBack ucnv_getToUCallBack_3_2 #define ucnv_getType ucnv_getType_3_2 #define ucnv_getUnicodeSet ucnv_getUnicodeSet_3_2 #define ucnv_incrementRefCount ucnv_incrementRefCount_3_2 #define ucnv_io_countAliases ucnv_io_countAliases_3_2 #define ucnv_io_countAvailableAliases ucnv_io_countAvailableAliases_3_2 #define ucnv_io_countAvailableConverters ucnv_io_countAvailableConverters_3_2 #define ucnv_io_countStandards ucnv_io_countStandards_3_2 #define ucnv_io_flushAvailableConverterCache ucnv_io_flushAvailableConverterCache_3_2 #define ucnv_io_getAlias ucnv_io_getAlias_3_2 #define ucnv_io_getAliases ucnv_io_getAliases_3_2 #define ucnv_io_getAvailableConverter ucnv_io_getAvailableConverter_3_2 #define ucnv_io_getConverterName ucnv_io_getConverterName_3_2 #define ucnv_io_getDefaultConverterName ucnv_io_getDefaultConverterName_3_2 #define ucnv_io_setDefaultConverterName ucnv_io_setDefaultConverterName_3_2 #define ucnv_io_stripASCIIForCompare ucnv_io_stripASCIIForCompare_3_2 #define ucnv_io_stripEBCDICForCompare ucnv_io_stripEBCDICForCompare_3_2 #define ucnv_isAmbiguous ucnv_isAmbiguous_3_2 #define ucnv_load ucnv_load_3_2 #define ucnv_loadSharedData ucnv_loadSharedData_3_2 #define ucnv_open ucnv_open_3_2 #define ucnv_openAllNames ucnv_openAllNames_3_2 #define ucnv_openCCSID ucnv_openCCSID_3_2 #define ucnv_openPackage ucnv_openPackage_3_2 #define ucnv_openStandardNames ucnv_openStandardNames_3_2 #define ucnv_openU ucnv_openU_3_2 #define ucnv_reset ucnv_reset_3_2 #define ucnv_resetFromUnicode ucnv_resetFromUnicode_3_2 #define ucnv_resetToUnicode ucnv_resetToUnicode_3_2 #define ucnv_safeClone ucnv_safeClone_3_2 #define ucnv_setDefaultName ucnv_setDefaultName_3_2 #define ucnv_setFallback ucnv_setFallback_3_2 #define ucnv_setFromUCallBack ucnv_setFromUCallBack_3_2 #define ucnv_setSubstChars ucnv_setSubstChars_3_2 #define ucnv_setToUCallBack ucnv_setToUCallBack_3_2 #define ucnv_swap ucnv_swap_3_2 #define ucnv_swapAliases ucnv_swapAliases_3_2 #define ucnv_toAlgorithmic ucnv_toAlgorithmic_3_2 #define ucnv_toUChars ucnv_toUChars_3_2 #define ucnv_toUWriteCodePoint ucnv_toUWriteCodePoint_3_2 #define ucnv_toUWriteUChars ucnv_toUWriteUChars_3_2 #define ucnv_toUnicode ucnv_toUnicode_3_2 #define ucnv_unload ucnv_unload_3_2 #define ucnv_unloadSharedDataIfReady ucnv_unloadSharedDataIfReady_3_2 #define ucnv_usesFallback ucnv_usesFallback_3_2 #define ucol_allocWeights ucol_allocWeights_3_2 #define ucol_assembleTailoringTable ucol_assembleTailoringTable_3_2 #define ucol_calcSortKey ucol_calcSortKey_3_2 #define ucol_calcSortKeySimpleTertiary ucol_calcSortKeySimpleTertiary_3_2 #define ucol_cloneBinary ucol_cloneBinary_3_2 #define ucol_cloneRuleData ucol_cloneRuleData_3_2 #define ucol_close ucol_close_3_2 #define ucol_closeElements ucol_closeElements_3_2 #define ucol_collatorToIdentifier ucol_collatorToIdentifier_3_2 #define ucol_countAvailable ucol_countAvailable_3_2 #define ucol_createElements ucol_createElements_3_2 #define ucol_doCE ucol_doCE_3_2 #define ucol_equal ucol_equal_3_2 #define ucol_equals ucol_equals_3_2 #define ucol_getAttribute ucol_getAttribute_3_2 #define ucol_getAttributeOrDefault ucol_getAttributeOrDefault_3_2 #define ucol_getAvailable ucol_getAvailable_3_2 #define ucol_getBound ucol_getBound_3_2 #define ucol_getCEGenerator ucol_getCEGenerator_3_2 #define ucol_getCEStrengthDifference ucol_getCEStrengthDifference_3_2 #define ucol_getContractions ucol_getContractions_3_2 #define ucol_getDisplayName ucol_getDisplayName_3_2 #define ucol_getFirstCE ucol_getFirstCE_3_2 #define ucol_getFunctionalEquivalent ucol_getFunctionalEquivalent_3_2 #define ucol_getKeywordValues ucol_getKeywordValues_3_2 #define ucol_getKeywords ucol_getKeywords_3_2 #define ucol_getLocale ucol_getLocale_3_2 #define ucol_getLocaleByType ucol_getLocaleByType_3_2 #define ucol_getMaxExpansion ucol_getMaxExpansion_3_2 #define ucol_getNextCE ucol_getNextCE_3_2 #define ucol_getNextGenerated ucol_getNextGenerated_3_2 #define ucol_getOffset ucol_getOffset_3_2 #define ucol_getPrevCE ucol_getPrevCE_3_2 #define ucol_getRules ucol_getRules_3_2 #define ucol_getRulesEx ucol_getRulesEx_3_2 #define ucol_getShortDefinitionString ucol_getShortDefinitionString_3_2 #define ucol_getSimpleCEGenerator ucol_getSimpleCEGenerator_3_2 #define ucol_getSortKey ucol_getSortKey_3_2 #define ucol_getSortKeySize ucol_getSortKeySize_3_2 #define ucol_getSortKeyWithAllocation ucol_getSortKeyWithAllocation_3_2 #define ucol_getStrength ucol_getStrength_3_2 #define ucol_getTailoredSet ucol_getTailoredSet_3_2 #define ucol_getUCAVersion ucol_getUCAVersion_3_2 #define ucol_getUnsafeSet ucol_getUnsafeSet_3_2 #define ucol_getVariableTop ucol_getVariableTop_3_2 #define ucol_getVersion ucol_getVersion_3_2 #define ucol_greater ucol_greater_3_2 #define ucol_greaterOrEqual ucol_greaterOrEqual_3_2 #define ucol_identifierToShortString ucol_identifierToShortString_3_2 #define ucol_initBuffers ucol_initBuffers_3_2 #define ucol_initCollator ucol_initCollator_3_2 #define ucol_initInverseUCA ucol_initInverseUCA_3_2 #define ucol_initUCA ucol_initUCA_3_2 #define ucol_inv_getGapPositions ucol_inv_getGapPositions_3_2 #define ucol_inv_getNextCE ucol_inv_getNextCE_3_2 #define ucol_inv_getPrevCE ucol_inv_getPrevCE_3_2 #define ucol_isTailored ucol_isTailored_3_2 #define ucol_keyHashCode ucol_keyHashCode_3_2 #define ucol_mergeSortkeys ucol_mergeSortkeys_3_2 #define ucol_next ucol_next_3_2 #define ucol_nextSortKeyPart ucol_nextSortKeyPart_3_2 #define ucol_nextWeight ucol_nextWeight_3_2 #define ucol_normalizeShortDefinitionString ucol_normalizeShortDefinitionString_3_2 #define ucol_open ucol_open_3_2 #define ucol_openAvailableLocales ucol_openAvailableLocales_3_2 #define ucol_openBinary ucol_openBinary_3_2 #define ucol_openElements ucol_openElements_3_2 #define ucol_openFromIdentifier ucol_openFromIdentifier_3_2 #define ucol_openFromShortString ucol_openFromShortString_3_2 #define ucol_openRules ucol_openRules_3_2 #define ucol_open_internal ucol_open_internal_3_2 #define ucol_previous ucol_previous_3_2 #define ucol_primaryOrder ucol_primaryOrder_3_2 #define ucol_prv_getSpecialCE ucol_prv_getSpecialCE_3_2 #define ucol_prv_getSpecialPrevCE ucol_prv_getSpecialPrevCE_3_2 #define ucol_reset ucol_reset_3_2 #define ucol_restoreVariableTop ucol_restoreVariableTop_3_2 #define ucol_safeClone ucol_safeClone_3_2 #define ucol_secondaryOrder ucol_secondaryOrder_3_2 #define ucol_setAttribute ucol_setAttribute_3_2 #define ucol_setOffset ucol_setOffset_3_2 #define ucol_setOptionsFromHeader ucol_setOptionsFromHeader_3_2 #define ucol_setReqValidLocales ucol_setReqValidLocales_3_2 #define ucol_setStrength ucol_setStrength_3_2 #define ucol_setText ucol_setText_3_2 #define ucol_setVariableTop ucol_setVariableTop_3_2 #define ucol_shortStringToIdentifier ucol_shortStringToIdentifier_3_2 #define ucol_sortKeyToString ucol_sortKeyToString_3_2 #define ucol_strcoll ucol_strcoll_3_2 #define ucol_strcollIter ucol_strcollIter_3_2 #define ucol_swap ucol_swap_3_2 #define ucol_swapBinary ucol_swapBinary_3_2 #define ucol_swapInverseUCA ucol_swapInverseUCA_3_2 #define ucol_tertiaryOrder ucol_tertiaryOrder_3_2 #define ucol_tok_assembleTokenList ucol_tok_assembleTokenList_3_2 #define ucol_tok_closeTokenList ucol_tok_closeTokenList_3_2 #define ucol_tok_getNextArgument ucol_tok_getNextArgument_3_2 #define ucol_tok_initTokenList ucol_tok_initTokenList_3_2 #define ucol_tok_parseNextToken ucol_tok_parseNextToken_3_2 #define ucol_updateInternalState ucol_updateInternalState_3_2 #define ucurr_forLocale ucurr_forLocale_3_2 #define ucurr_getDefaultFractionDigits ucurr_getDefaultFractionDigits_3_2 #define ucurr_getName ucurr_getName_3_2 #define ucurr_getRoundingIncrement ucurr_getRoundingIncrement_3_2 #define ucurr_register ucurr_register_3_2 #define ucurr_unregister ucurr_unregister_3_2 #define udat_applyPattern udat_applyPattern_3_2 #define udat_clone udat_clone_3_2 #define udat_close udat_close_3_2 #define udat_countAvailable udat_countAvailable_3_2 #define udat_countSymbols udat_countSymbols_3_2 #define udat_format udat_format_3_2 #define udat_get2DigitYearStart udat_get2DigitYearStart_3_2 #define udat_getAvailable udat_getAvailable_3_2 #define udat_getCalendar udat_getCalendar_3_2 #define udat_getLocaleByType udat_getLocaleByType_3_2 #define udat_getNumberFormat udat_getNumberFormat_3_2 #define udat_getSymbols udat_getSymbols_3_2 #define udat_isLenient udat_isLenient_3_2 #define udat_open udat_open_3_2 #define udat_parse udat_parse_3_2 #define udat_parseCalendar udat_parseCalendar_3_2 #define udat_set2DigitYearStart udat_set2DigitYearStart_3_2 #define udat_setCalendar udat_setCalendar_3_2 #define udat_setLenient udat_setLenient_3_2 #define udat_setNumberFormat udat_setNumberFormat_3_2 #define udat_setSymbols udat_setSymbols_3_2 #define udat_toPattern udat_toPattern_3_2 #define udata_checkCommonData udata_checkCommonData_3_2 #define udata_close udata_close_3_2 #define udata_closeSwapper udata_closeSwapper_3_2 #define udata_getHeaderSize udata_getHeaderSize_3_2 #define udata_getInfo udata_getInfo_3_2 #define udata_getInfoSize udata_getInfoSize_3_2 #define udata_getLength udata_getLength_3_2 #define udata_getMemory udata_getMemory_3_2 #define udata_getRawMemory udata_getRawMemory_3_2 #define udata_open udata_open_3_2 #define udata_openChoice udata_openChoice_3_2 #define udata_openSwapper udata_openSwapper_3_2 #define udata_openSwapperForInputData udata_openSwapperForInputData_3_2 #define udata_printError udata_printError_3_2 #define udata_readInt16 udata_readInt16_3_2 #define udata_readInt32 udata_readInt32_3_2 #define udata_setAppData udata_setAppData_3_2 #define udata_setCommonData udata_setCommonData_3_2 #define udata_swapDataHeader udata_swapDataHeader_3_2 #define udata_swapInvStringBlock udata_swapInvStringBlock_3_2 #define uenum_close uenum_close_3_2 #define uenum_count uenum_count_3_2 #define uenum_next uenum_next_3_2 #define uenum_nextDefault uenum_nextDefault_3_2 #define uenum_openCharStringsEnumeration uenum_openCharStringsEnumeration_3_2 #define uenum_openStringEnumeration uenum_openStringEnumeration_3_2 #define uenum_reset uenum_reset_3_2 #define uenum_unext uenum_unext_3_2 #define uenum_unextDefault uenum_unextDefault_3_2 #define ufile_close_translit ufile_close_translit_3_2 #define ufile_fill_uchar_buffer ufile_fill_uchar_buffer_3_2 #define ufile_flush_translit ufile_flush_translit_3_2 #define ufile_getch ufile_getch_3_2 #define ufile_getch32 ufile_getch32_3_2 #define ufmt_64tou ufmt_64tou_3_2 #define ufmt_defaultCPToUnicode ufmt_defaultCPToUnicode_3_2 #define ufmt_digitvalue ufmt_digitvalue_3_2 #define ufmt_isdigit ufmt_isdigit_3_2 #define ufmt_ptou ufmt_ptou_3_2 #define ufmt_uto64 ufmt_uto64_3_2 #define ufmt_utop ufmt_utop_3_2 #define uhash_close uhash_close_3_2 #define uhash_compareCaselessUnicodeString uhash_compareCaselessUnicodeString_3_2 #define uhash_compareChars uhash_compareChars_3_2 #define uhash_compareIChars uhash_compareIChars_3_2 #define uhash_compareLong uhash_compareLong_3_2 #define uhash_compareUChars uhash_compareUChars_3_2 #define uhash_compareUnicodeString uhash_compareUnicodeString_3_2 #define uhash_count uhash_count_3_2 #define uhash_deleteHashtable uhash_deleteHashtable_3_2 #define uhash_deleteUVector uhash_deleteUVector_3_2 #define uhash_deleteUnicodeString uhash_deleteUnicodeString_3_2 #define uhash_find uhash_find_3_2 #define uhash_freeBlock uhash_freeBlock_3_2 #define uhash_get uhash_get_3_2 #define uhash_geti uhash_geti_3_2 #define uhash_hashCaselessUnicodeString uhash_hashCaselessUnicodeString_3_2 #define uhash_hashChars uhash_hashChars_3_2 #define uhash_hashIChars uhash_hashIChars_3_2 #define uhash_hashLong uhash_hashLong_3_2 #define uhash_hashUChars uhash_hashUChars_3_2 #define uhash_hashUCharsN uhash_hashUCharsN_3_2 #define uhash_hashUnicodeString uhash_hashUnicodeString_3_2 #define uhash_iget uhash_iget_3_2 #define uhash_igeti uhash_igeti_3_2 #define uhash_iput uhash_iput_3_2 #define uhash_iputi uhash_iputi_3_2 #define uhash_iremove uhash_iremove_3_2 #define uhash_iremovei uhash_iremovei_3_2 #define uhash_nextElement uhash_nextElement_3_2 #define uhash_open uhash_open_3_2 #define uhash_openSize uhash_openSize_3_2 #define uhash_put uhash_put_3_2 #define uhash_puti uhash_puti_3_2 #define uhash_remove uhash_remove_3_2 #define uhash_removeAll uhash_removeAll_3_2 #define uhash_removeElement uhash_removeElement_3_2 #define uhash_removei uhash_removei_3_2 #define uhash_setKeyComparator uhash_setKeyComparator_3_2 #define uhash_setKeyDeleter uhash_setKeyDeleter_3_2 #define uhash_setKeyHasher uhash_setKeyHasher_3_2 #define uhash_setResizePolicy uhash_setResizePolicy_3_2 #define uhash_setValueDeleter uhash_setValueDeleter_3_2 #define uhash_toki uhash_toki_3_2 #define uhash_tokp uhash_tokp_3_2 #define uhst_addPropertyStarts uhst_addPropertyStarts_3_2 #define uidna_IDNToASCII uidna_IDNToASCII_3_2 #define uidna_IDNToUnicode uidna_IDNToUnicode_3_2 #define uidna_compare uidna_compare_3_2 #define uidna_toASCII uidna_toASCII_3_2 #define uidna_toUnicode uidna_toUnicode_3_2 #define uiter_current32 uiter_current32_3_2 #define uiter_getState uiter_getState_3_2 #define uiter_next32 uiter_next32_3_2 #define uiter_previous32 uiter_previous32_3_2 #define uiter_setCharacterIterator uiter_setCharacterIterator_3_2 #define uiter_setReplaceable uiter_setReplaceable_3_2 #define uiter_setState uiter_setState_3_2 #define uiter_setString uiter_setString_3_2 #define uiter_setUTF16BE uiter_setUTF16BE_3_2 #define uiter_setUTF8 uiter_setUTF8_3_2 #define uloc_acceptLanguage uloc_acceptLanguage_3_2 #define uloc_acceptLanguageFromHTTP uloc_acceptLanguageFromHTTP_3_2 #define uloc_canonicalize uloc_canonicalize_3_2 #define uloc_countAvailable uloc_countAvailable_3_2 #define uloc_getAvailable uloc_getAvailable_3_2 #define uloc_getBaseName uloc_getBaseName_3_2 #define uloc_getCountry uloc_getCountry_3_2 #define uloc_getDefault uloc_getDefault_3_2 #define uloc_getDisplayCountry uloc_getDisplayCountry_3_2 #define uloc_getDisplayKeyword uloc_getDisplayKeyword_3_2 #define uloc_getDisplayKeywordValue uloc_getDisplayKeywordValue_3_2 #define uloc_getDisplayLanguage uloc_getDisplayLanguage_3_2 #define uloc_getDisplayName uloc_getDisplayName_3_2 #define uloc_getDisplayScript uloc_getDisplayScript_3_2 #define uloc_getDisplayVariant uloc_getDisplayVariant_3_2 #define uloc_getISO3Country uloc_getISO3Country_3_2 #define uloc_getISO3Language uloc_getISO3Language_3_2 #define uloc_getISOCountries uloc_getISOCountries_3_2 #define uloc_getISOLanguages uloc_getISOLanguages_3_2 #define uloc_getKeywordValue uloc_getKeywordValue_3_2 #define uloc_getLCID uloc_getLCID_3_2 #define uloc_getLanguage uloc_getLanguage_3_2 #define uloc_getName uloc_getName_3_2 #define uloc_getParent uloc_getParent_3_2 #define uloc_getScript uloc_getScript_3_2 #define uloc_getVariant uloc_getVariant_3_2 #define uloc_openKeywordList uloc_openKeywordList_3_2 #define uloc_openKeywords uloc_openKeywords_3_2 #define uloc_setDefault uloc_setDefault_3_2 #define uloc_setKeywordValue uloc_setKeywordValue_3_2 #define ulocdata_getExemplarSet ulocdata_getExemplarSet_3_2 #define ulocdata_getMeasurementSystem ulocdata_getMeasurementSystem_3_2 #define ulocdata_getPaperSize ulocdata_getPaperSize_3_2 #define umsg_applyPattern umsg_applyPattern_3_2 #define umsg_clone umsg_clone_3_2 #define umsg_close umsg_close_3_2 #define umsg_format umsg_format_3_2 #define umsg_getLocale umsg_getLocale_3_2 #define umsg_getLocaleByType umsg_getLocaleByType_3_2 #define umsg_open umsg_open_3_2 #define umsg_parse umsg_parse_3_2 #define umsg_setLocale umsg_setLocale_3_2 #define umsg_toPattern umsg_toPattern_3_2 #define umsg_vformat umsg_vformat_3_2 #define umsg_vparse umsg_vparse_3_2 #define umtx_atomic_dec umtx_atomic_dec_3_2 #define umtx_atomic_inc umtx_atomic_inc_3_2 #define umtx_cleanup umtx_cleanup_3_2 #define umtx_destroy umtx_destroy_3_2 #define umtx_init umtx_init_3_2 #define umtx_lock umtx_lock_3_2 #define umtx_unlock umtx_unlock_3_2 #define unorm_addPropertyStarts unorm_addPropertyStarts_3_2 #define unorm_closeIter unorm_closeIter_3_2 #define unorm_compare unorm_compare_3_2 #define unorm_compose unorm_compose_3_2 #define unorm_concatenate unorm_concatenate_3_2 #define unorm_decompose unorm_decompose_3_2 #define unorm_getCanonStartSet unorm_getCanonStartSet_3_2 #define unorm_getCanonicalDecomposition unorm_getCanonicalDecomposition_3_2 #define unorm_getDecomposition unorm_getDecomposition_3_2 #define unorm_getFCD16FromCodePoint unorm_getFCD16FromCodePoint_3_2 #define unorm_getFCDTrie unorm_getFCDTrie_3_2 #define unorm_getNX unorm_getNX_3_2 #define unorm_getQuickCheck unorm_getQuickCheck_3_2 #define unorm_getUnicodeVersion unorm_getUnicodeVersion_3_2 #define unorm_haveData unorm_haveData_3_2 #define unorm_internalIsFullCompositionExclusion unorm_internalIsFullCompositionExclusion_3_2 #define unorm_internalNormalize unorm_internalNormalize_3_2 #define unorm_internalNormalizeWithNX unorm_internalNormalizeWithNX_3_2 #define unorm_internalQuickCheck unorm_internalQuickCheck_3_2 #define unorm_isCanonSafeStart unorm_isCanonSafeStart_3_2 #define unorm_isNFSkippable unorm_isNFSkippable_3_2 #define unorm_isNormalized unorm_isNormalized_3_2 #define unorm_isNormalizedWithOptions unorm_isNormalizedWithOptions_3_2 #define unorm_next unorm_next_3_2 #define unorm_normalize unorm_normalize_3_2 #define unorm_openIter unorm_openIter_3_2 #define unorm_previous unorm_previous_3_2 #define unorm_quickCheck unorm_quickCheck_3_2 #define unorm_quickCheckWithOptions unorm_quickCheckWithOptions_3_2 #define unorm_setIter unorm_setIter_3_2 #define unorm_swap unorm_swap_3_2 #define unum_applyPattern unum_applyPattern_3_2 #define unum_clone unum_clone_3_2 #define unum_close unum_close_3_2 #define unum_countAvailable unum_countAvailable_3_2 #define unum_format unum_format_3_2 #define unum_formatDouble unum_formatDouble_3_2 #define unum_formatDoubleCurrency unum_formatDoubleCurrency_3_2 #define unum_formatInt64 unum_formatInt64_3_2 #define unum_getAttribute unum_getAttribute_3_2 #define unum_getAvailable unum_getAvailable_3_2 #define unum_getDoubleAttribute unum_getDoubleAttribute_3_2 #define unum_getLocaleByType unum_getLocaleByType_3_2 #define unum_getSymbol unum_getSymbol_3_2 #define unum_getTextAttribute unum_getTextAttribute_3_2 #define unum_open unum_open_3_2 #define unum_parse unum_parse_3_2 #define unum_parseDouble unum_parseDouble_3_2 #define unum_parseDoubleCurrency unum_parseDoubleCurrency_3_2 #define unum_parseInt64 unum_parseInt64_3_2 #define unum_setAttribute unum_setAttribute_3_2 #define unum_setDoubleAttribute unum_setDoubleAttribute_3_2 #define unum_setSymbol unum_setSymbol_3_2 #define unum_setTextAttribute unum_setTextAttribute_3_2 #define unum_toPattern unum_toPattern_3_2 #define upname_swap upname_swap_3_2 #define uprops_getSource uprops_getSource_3_2 #define uprops_swap uprops_swap_3_2 #define uprv_asciiFromEbcdic uprv_asciiFromEbcdic_3_2 #define uprv_asciitolower uprv_asciitolower_3_2 #define uprv_ceil uprv_ceil_3_2 #define uprv_cnttab_addContraction uprv_cnttab_addContraction_3_2 #define uprv_cnttab_changeContraction uprv_cnttab_changeContraction_3_2 #define uprv_cnttab_changeLastCE uprv_cnttab_changeLastCE_3_2 #define uprv_cnttab_clone uprv_cnttab_clone_3_2 #define uprv_cnttab_close uprv_cnttab_close_3_2 #define uprv_cnttab_constructTable uprv_cnttab_constructTable_3_2 #define uprv_cnttab_findCE uprv_cnttab_findCE_3_2 #define uprv_cnttab_findCP uprv_cnttab_findCP_3_2 #define uprv_cnttab_getCE uprv_cnttab_getCE_3_2 #define uprv_cnttab_insertContraction uprv_cnttab_insertContraction_3_2 #define uprv_cnttab_isTailored uprv_cnttab_isTailored_3_2 #define uprv_cnttab_open uprv_cnttab_open_3_2 #define uprv_cnttab_setContraction uprv_cnttab_setContraction_3_2 #define uprv_compareASCIIPropertyNames uprv_compareASCIIPropertyNames_3_2 #define uprv_compareEBCDICPropertyNames uprv_compareEBCDICPropertyNames_3_2 #define uprv_compareInvAscii uprv_compareInvAscii_3_2 #define uprv_compareInvEbcdic uprv_compareInvEbcdic_3_2 #define uprv_convertToLCID uprv_convertToLCID_3_2 #define uprv_convertToPosix uprv_convertToPosix_3_2 #define uprv_copyAscii uprv_copyAscii_3_2 #define uprv_copyEbcdic uprv_copyEbcdic_3_2 #define uprv_dtostr uprv_dtostr_3_2 #define uprv_ebcdicFromAscii uprv_ebcdicFromAscii_3_2 #define uprv_ebcdictolower uprv_ebcdictolower_3_2 #define uprv_fabs uprv_fabs_3_2 #define uprv_floor uprv_floor_3_2 #define uprv_fmax uprv_fmax_3_2 #define uprv_fmin uprv_fmin_3_2 #define uprv_fmod uprv_fmod_3_2 #define uprv_free uprv_free_3_2 #define uprv_getCharNameCharacters uprv_getCharNameCharacters_3_2 #define uprv_getDefaultCodepage uprv_getDefaultCodepage_3_2 #define uprv_getDefaultLocaleID uprv_getDefaultLocaleID_3_2 #define uprv_getInfinity uprv_getInfinity_3_2 #define uprv_getMaxCharNameLength uprv_getMaxCharNameLength_3_2 #define uprv_getMaxValues uprv_getMaxValues_3_2 #define uprv_getNaN uprv_getNaN_3_2 #define uprv_getStaticCurrencyName uprv_getStaticCurrencyName_3_2 #define uprv_getUTCtime uprv_getUTCtime_3_2 #define uprv_haveProperties uprv_haveProperties_3_2 #define uprv_init_collIterate uprv_init_collIterate_3_2 #define uprv_int32Comparator uprv_int32Comparator_3_2 #define uprv_isInfinite uprv_isInfinite_3_2 #define uprv_isInvariantString uprv_isInvariantString_3_2 #define uprv_isInvariantUString uprv_isInvariantUString_3_2 #define uprv_isNaN uprv_isNaN_3_2 #define uprv_isNegativeInfinity uprv_isNegativeInfinity_3_2 #define uprv_isPositiveInfinity uprv_isPositiveInfinity_3_2 #define uprv_isRuleWhiteSpace uprv_isRuleWhiteSpace_3_2 #define uprv_itou uprv_itou_3_2 #define uprv_loadPropsData uprv_loadPropsData_3_2 #define uprv_log uprv_log_3_2 #define uprv_log10 uprv_log10_3_2 #define uprv_malloc uprv_malloc_3_2 #define uprv_mapFile uprv_mapFile_3_2 #define uprv_max uprv_max_3_2 #define uprv_maxMantissa uprv_maxMantissa_3_2 #define uprv_min uprv_min_3_2 #define uprv_modf uprv_modf_3_2 #define uprv_openRuleWhiteSpaceSet uprv_openRuleWhiteSpaceSet_3_2 #define uprv_pathIsAbsolute uprv_pathIsAbsolute_3_2 #define uprv_pow uprv_pow_3_2 #define uprv_pow10 uprv_pow10_3_2 #define uprv_realloc uprv_realloc_3_2 #define uprv_round uprv_round_3_2 #define uprv_sortArray uprv_sortArray_3_2 #define uprv_strCompare uprv_strCompare_3_2 #define uprv_strdup uprv_strdup_3_2 #define uprv_strndup uprv_strndup_3_2 #define uprv_syntaxError uprv_syntaxError_3_2 #define uprv_timezone uprv_timezone_3_2 #define uprv_toupper uprv_toupper_3_2 #define uprv_trunc uprv_trunc_3_2 #define uprv_tzname uprv_tzname_3_2 #define uprv_tzset uprv_tzset_3_2 #define uprv_uca_addAnElement uprv_uca_addAnElement_3_2 #define uprv_uca_assembleTable uprv_uca_assembleTable_3_2 #define uprv_uca_canonicalClosure uprv_uca_canonicalClosure_3_2 #define uprv_uca_cloneTempTable uprv_uca_cloneTempTable_3_2 #define uprv_uca_closeTempTable uprv_uca_closeTempTable_3_2 #define uprv_uca_getCodePointFromRaw uprv_uca_getCodePointFromRaw_3_2 #define uprv_uca_getImplicitFromRaw uprv_uca_getImplicitFromRaw_3_2 #define uprv_uca_getImplicitPrimary uprv_uca_getImplicitPrimary_3_2 #define uprv_uca_getRawFromCodePoint uprv_uca_getRawFromCodePoint_3_2 #define uprv_uca_getRawFromImplicit uprv_uca_getRawFromImplicit_3_2 #define uprv_uca_initImplicitConstants uprv_uca_initImplicitConstants_3_2 #define uprv_uca_initTempTable uprv_uca_initTempTable_3_2 #define uprv_uint16Comparator uprv_uint16Comparator_3_2 #define uprv_uint32Comparator uprv_uint32Comparator_3_2 #define uprv_unmapFile uprv_unmapFile_3_2 #define uregex_appendReplacement uregex_appendReplacement_3_2 #define uregex_appendTail uregex_appendTail_3_2 #define uregex_clone uregex_clone_3_2 #define uregex_close uregex_close_3_2 #define uregex_end uregex_end_3_2 #define uregex_find uregex_find_3_2 #define uregex_findNext uregex_findNext_3_2 #define uregex_flags uregex_flags_3_2 #define uregex_getText uregex_getText_3_2 #define uregex_group uregex_group_3_2 #define uregex_groupCount uregex_groupCount_3_2 #define uregex_lookingAt uregex_lookingAt_3_2 #define uregex_matches uregex_matches_3_2 #define uregex_open uregex_open_3_2 #define uregex_openC uregex_openC_3_2 #define uregex_pattern uregex_pattern_3_2 #define uregex_replaceAll uregex_replaceAll_3_2 #define uregex_replaceFirst uregex_replaceFirst_3_2 #define uregex_reset uregex_reset_3_2 #define uregex_setText uregex_setText_3_2 #define uregex_split uregex_split_3_2 #define uregex_start uregex_start_3_2 #define ures_appendResPath ures_appendResPath_3_2 #define ures_close ures_close_3_2 #define ures_copyResb ures_copyResb_3_2 #define ures_countArrayItems ures_countArrayItems_3_2 #define ures_findResource ures_findResource_3_2 #define ures_findSubResource ures_findSubResource_3_2 #define ures_freeResPath ures_freeResPath_3_2 #define ures_getBinary ures_getBinary_3_2 #define ures_getByIndex ures_getByIndex_3_2 #define ures_getByKey ures_getByKey_3_2 #define ures_getByKeyWithFallback ures_getByKeyWithFallback_3_2 #define ures_getFunctionalEquivalent ures_getFunctionalEquivalent_3_2 #define ures_getInt ures_getInt_3_2 #define ures_getIntVector ures_getIntVector_3_2 #define ures_getKey ures_getKey_3_2 #define ures_getKeywordValues ures_getKeywordValues_3_2 #define ures_getLocale ures_getLocale_3_2 #define ures_getLocaleByType ures_getLocaleByType_3_2 #define ures_getName ures_getName_3_2 #define ures_getNextResource ures_getNextResource_3_2 #define ures_getNextString ures_getNextString_3_2 #define ures_getPath ures_getPath_3_2 #define ures_getSize ures_getSize_3_2 #define ures_getString ures_getString_3_2 #define ures_getStringByIndex ures_getStringByIndex_3_2 #define ures_getStringByKey ures_getStringByKey_3_2 #define ures_getType ures_getType_3_2 #define ures_getUInt ures_getUInt_3_2 #define ures_getVersion ures_getVersion_3_2 #define ures_getVersionNumber ures_getVersionNumber_3_2 #define ures_hasNext ures_hasNext_3_2 #define ures_initStackObject ures_initStackObject_3_2 #define ures_open ures_open_3_2 #define ures_openAvailableLocales ures_openAvailableLocales_3_2 #define ures_openDirect ures_openDirect_3_2 #define ures_openFillIn ures_openFillIn_3_2 #define ures_openU ures_openU_3_2 #define ures_resetIterator ures_resetIterator_3_2 #define ures_swap ures_swap_3_2 #define uscript_closeRun uscript_closeRun_3_2 #define uscript_getCode uscript_getCode_3_2 #define uscript_getName uscript_getName_3_2 #define uscript_getScript uscript_getScript_3_2 #define uscript_getShortName uscript_getShortName_3_2 #define uscript_nextRun uscript_nextRun_3_2 #define uscript_openRun uscript_openRun_3_2 #define uscript_resetRun uscript_resetRun_3_2 #define uscript_setRunText uscript_setRunText_3_2 #define usearch_close usearch_close_3_2 #define usearch_first usearch_first_3_2 #define usearch_following usearch_following_3_2 #define usearch_getAttribute usearch_getAttribute_3_2 #define usearch_getBreakIterator usearch_getBreakIterator_3_2 #define usearch_getCollator usearch_getCollator_3_2 #define usearch_getMatchedLength usearch_getMatchedLength_3_2 #define usearch_getMatchedStart usearch_getMatchedStart_3_2 #define usearch_getMatchedText usearch_getMatchedText_3_2 #define usearch_getOffset usearch_getOffset_3_2 #define usearch_getPattern usearch_getPattern_3_2 #define usearch_getText usearch_getText_3_2 #define usearch_handleNextCanonical usearch_handleNextCanonical_3_2 #define usearch_handleNextExact usearch_handleNextExact_3_2 #define usearch_handlePreviousCanonical usearch_handlePreviousCanonical_3_2 #define usearch_handlePreviousExact usearch_handlePreviousExact_3_2 #define usearch_last usearch_last_3_2 #define usearch_next usearch_next_3_2 #define usearch_open usearch_open_3_2 #define usearch_openFromCollator usearch_openFromCollator_3_2 #define usearch_preceding usearch_preceding_3_2 #define usearch_previous usearch_previous_3_2 #define usearch_reset usearch_reset_3_2 #define usearch_setAttribute usearch_setAttribute_3_2 #define usearch_setBreakIterator usearch_setBreakIterator_3_2 #define usearch_setCollator usearch_setCollator_3_2 #define usearch_setOffset usearch_setOffset_3_2 #define usearch_setPattern usearch_setPattern_3_2 #define usearch_setText usearch_setText_3_2 #define userv_deleteStringPair userv_deleteStringPair_3_2 #define uset_add uset_add_3_2 #define uset_addAll uset_addAll_3_2 #define uset_addRange uset_addRange_3_2 #define uset_addString uset_addString_3_2 #define uset_applyIntPropertyValue uset_applyIntPropertyValue_3_2 #define uset_applyPattern uset_applyPattern_3_2 #define uset_applyPropertyAlias uset_applyPropertyAlias_3_2 #define uset_charAt uset_charAt_3_2 #define uset_clear uset_clear_3_2 #define uset_close uset_close_3_2 #define uset_compact uset_compact_3_2 #define uset_complement uset_complement_3_2 #define uset_complementAll uset_complementAll_3_2 #define uset_contains uset_contains_3_2 #define uset_containsAll uset_containsAll_3_2 #define uset_containsNone uset_containsNone_3_2 #define uset_containsRange uset_containsRange_3_2 #define uset_containsSome uset_containsSome_3_2 #define uset_containsString uset_containsString_3_2 #define uset_equals uset_equals_3_2 #define uset_getItem uset_getItem_3_2 #define uset_getItemCount uset_getItemCount_3_2 #define uset_getSerializedRange uset_getSerializedRange_3_2 #define uset_getSerializedRangeCount uset_getSerializedRangeCount_3_2 #define uset_getSerializedSet uset_getSerializedSet_3_2 #define uset_indexOf uset_indexOf_3_2 #define uset_isEmpty uset_isEmpty_3_2 #define uset_open uset_open_3_2 #define uset_openPattern uset_openPattern_3_2 #define uset_openPatternOptions uset_openPatternOptions_3_2 #define uset_remove uset_remove_3_2 #define uset_removeAll uset_removeAll_3_2 #define uset_removeRange uset_removeRange_3_2 #define uset_removeString uset_removeString_3_2 #define uset_resemblesPattern uset_resemblesPattern_3_2 #define uset_retain uset_retain_3_2 #define uset_retainAll uset_retainAll_3_2 #define uset_serialize uset_serialize_3_2 #define uset_serializedContains uset_serializedContains_3_2 #define uset_set uset_set_3_2 #define uset_setSerializedToOne uset_setSerializedToOne_3_2 #define uset_size uset_size_3_2 #define uset_toPattern uset_toPattern_3_2 #define usprep_close usprep_close_3_2 #define usprep_open usprep_open_3_2 #define usprep_prepare usprep_prepare_3_2 #define usprep_swap usprep_swap_3_2 #define ustr_foldCase ustr_foldCase_3_2 #define ustr_toLower ustr_toLower_3_2 #define ustr_toTitle ustr_toTitle_3_2 #define ustr_toUpper ustr_toUpper_3_2 #define utf8_appendCharSafeBody utf8_appendCharSafeBody_3_2 #define utf8_back1SafeBody utf8_back1SafeBody_3_2 #define utf8_countTrailBytes utf8_countTrailBytes_3_2 #define utf8_nextCharSafeBody utf8_nextCharSafeBody_3_2 #define utf8_prevCharSafeBody utf8_prevCharSafeBody_3_2 #define utmscale_fromInt64 utmscale_fromInt64_3_2 #define utmscale_getTimeScaleValue utmscale_getTimeScaleValue_3_2 #define utmscale_toInt64 utmscale_toInt64_3_2 #define utrace_cleanup utrace_cleanup_3_2 #define utrace_data utrace_data_3_2 #define utrace_entry utrace_entry_3_2 #define utrace_exit utrace_exit_3_2 #define utrace_format utrace_format_3_2 #define utrace_functionName utrace_functionName_3_2 #define utrace_getFunctions utrace_getFunctions_3_2 #define utrace_getLevel utrace_getLevel_3_2 #define utrace_level utrace_level_3_2 #define utrace_setFunctions utrace_setFunctions_3_2 #define utrace_setLevel utrace_setLevel_3_2 #define utrace_vformat utrace_vformat_3_2 #define utrans_clone utrans_clone_3_2 #define utrans_close utrans_close_3_2 #define utrans_countAvailableIDs utrans_countAvailableIDs_3_2 #define utrans_getAvailableID utrans_getAvailableID_3_2 #define utrans_getID utrans_getID_3_2 #define utrans_getUnicodeID utrans_getUnicodeID_3_2 #define utrans_open utrans_open_3_2 #define utrans_openIDs utrans_openIDs_3_2 #define utrans_openInverse utrans_openInverse_3_2 #define utrans_openU utrans_openU_3_2 #define utrans_register utrans_register_3_2 #define utrans_rep_caseContextIterator utrans_rep_caseContextIterator_3_2 #define utrans_setFilter utrans_setFilter_3_2 #define utrans_trans utrans_trans_3_2 #define utrans_transIncremental utrans_transIncremental_3_2 #define utrans_transIncrementalUChars utrans_transIncrementalUChars_3_2 #define utrans_transUChars utrans_transUChars_3_2 #define utrans_unregister utrans_unregister_3_2 #define utrans_unregisterID utrans_unregisterID_3_2 #define utrie_clone utrie_clone_3_2 #define utrie_close utrie_close_3_2 #define utrie_enum utrie_enum_3_2 #define utrie_get32 utrie_get32_3_2 #define utrie_getData utrie_getData_3_2 #define utrie_open utrie_open_3_2 #define utrie_serialize utrie_serialize_3_2 #define utrie_set32 utrie_set32_3_2 #define utrie_setRange32 utrie_setRange32_3_2 #define utrie_swap utrie_swap_3_2 #define utrie_unserialize utrie_unserialize_3_2 /* C++ class names renaming defines */ #ifdef XP_CPLUSPLUS #if !U_HAVE_NAMESPACE #define AbsoluteValueSubstitution AbsoluteValueSubstitution_3_2 #define AlternateSubstitutionSubtable AlternateSubstitutionSubtable_3_2 #define AnchorTable AnchorTable_3_2 #define AnyTransliterator AnyTransliterator_3_2 #define ArabicOpenTypeLayoutEngine ArabicOpenTypeLayoutEngine_3_2 #define ArabicShaping ArabicShaping_3_2 #define BasicCalendarFactory BasicCalendarFactory_3_2 #define BinarySearchLookupTable BinarySearchLookupTable_3_2 #define BreakDictionary BreakDictionary_3_2 #define BreakIterator BreakIterator_3_2 #define BuddhistCalendar BuddhistCalendar_3_2 #define CFactory CFactory_3_2 #define Calendar Calendar_3_2 #define CalendarAstronomer CalendarAstronomer_3_2 #define CalendarCache CalendarCache_3_2 #define CalendarData CalendarData_3_2 #define CalendarService CalendarService_3_2 #define CanonShaping CanonShaping_3_2 #define CanonicalIterator CanonicalIterator_3_2 #define CaseMapTransliterator CaseMapTransliterator_3_2 #define ChainingContextualSubstitutionFormat1Subtable ChainingContextualSubstitutionFormat1Subtable_3_2 #define ChainingContextualSubstitutionFormat2Subtable ChainingContextualSubstitutionFormat2Subtable_3_2 #define ChainingContextualSubstitutionFormat3Subtable ChainingContextualSubstitutionFormat3Subtable_3_2 #define ChainingContextualSubstitutionSubtable ChainingContextualSubstitutionSubtable_3_2 #define CharSubstitutionFilter CharSubstitutionFilter_3_2 #define CharacterIterator CharacterIterator_3_2 #define ChoiceFormat ChoiceFormat_3_2 #define ClassDefFormat1Table ClassDefFormat1Table_3_2 #define ClassDefFormat2Table ClassDefFormat2Table_3_2 #define ClassDefinitionTable ClassDefinitionTable_3_2 #define CollationElementIterator CollationElementIterator_3_2 #define CollationKey CollationKey_3_2 #define Collator Collator_3_2 #define CollatorFactory CollatorFactory_3_2 #define CompoundTransliterator CompoundTransliterator_3_2 #define ContextualGlyphSubstitutionProcessor ContextualGlyphSubstitutionProcessor_3_2 #define ContextualSubstitutionBase ContextualSubstitutionBase_3_2 #define ContextualSubstitutionFormat1Subtable ContextualSubstitutionFormat1Subtable_3_2 #define ContextualSubstitutionFormat2Subtable ContextualSubstitutionFormat2Subtable_3_2 #define ContextualSubstitutionFormat3Subtable ContextualSubstitutionFormat3Subtable_3_2 #define ContextualSubstitutionSubtable ContextualSubstitutionSubtable_3_2 #define CoverageFormat1Table CoverageFormat1Table_3_2 #define CoverageFormat2Table CoverageFormat2Table_3_2 #define CoverageTable CoverageTable_3_2 #define CurrencyAmount CurrencyAmount_3_2 #define CurrencyFormat CurrencyFormat_3_2 #define CurrencyUnit CurrencyUnit_3_2 #define CursiveAttachmentSubtable CursiveAttachmentSubtable_3_2 #define DateFormat DateFormat_3_2 #define DateFormatSymbols DateFormatSymbols_3_2 #define DecimalFormat DecimalFormat_3_2 #define DecimalFormatSymbols DecimalFormatSymbols_3_2 #define DefaultCalendarFactory DefaultCalendarFactory_3_2 #define DefaultCharMapper DefaultCharMapper_3_2 #define DeviceTable DeviceTable_3_2 #define DictionaryBasedBreakIterator DictionaryBasedBreakIterator_3_2 #define DictionaryBasedBreakIteratorTables DictionaryBasedBreakIteratorTables_3_2 #define DigitList DigitList_3_2 #define Entry Entry_3_2 #define EnumToOffset EnumToOffset_3_2 #define EscapeTransliterator EscapeTransliterator_3_2 #define EventListener EventListener_3_2 #define ExtensionSubtable ExtensionSubtable_3_2 #define FeatureListTable FeatureListTable_3_2 #define FieldPosition FieldPosition_3_2 #define FontRuns FontRuns_3_2 #define Format Format_3_2 #define Format1AnchorTable Format1AnchorTable_3_2 #define Format2AnchorTable Format2AnchorTable_3_2 #define Format3AnchorTable Format3AnchorTable_3_2 #define Formattable Formattable_3_2 #define ForwardCharacterIterator ForwardCharacterIterator_3_2 #define FractionalPartSubstitution FractionalPartSubstitution_3_2 #define FunctionReplacer FunctionReplacer_3_2 #define GDEFMarkFilter GDEFMarkFilter_3_2 #define GXLayoutEngine GXLayoutEngine_3_2 #define GlyphDefinitionTableHeader GlyphDefinitionTableHeader_3_2 #define GlyphIterator GlyphIterator_3_2 #define GlyphLookupTableHeader GlyphLookupTableHeader_3_2 #define GlyphPositioningLookupProcessor GlyphPositioningLookupProcessor_3_2 #define GlyphPositioningTableHeader GlyphPositioningTableHeader_3_2 #define GlyphSubstitutionLookupProcessor GlyphSubstitutionLookupProcessor_3_2 #define GlyphSubstitutionTableHeader GlyphSubstitutionTableHeader_3_2 #define Grego Grego_3_2 #define GregorianCalendar GregorianCalendar_3_2 #define HanOpenTypeLayoutEngine HanOpenTypeLayoutEngine_3_2 #define HebrewCalendar HebrewCalendar_3_2 #define ICUBreakIteratorFactory ICUBreakIteratorFactory_3_2 #define ICUBreakIteratorService ICUBreakIteratorService_3_2 #define ICUCollatorFactory ICUCollatorFactory_3_2 #define ICUCollatorService ICUCollatorService_3_2 #define ICULayoutEngine ICULayoutEngine_3_2 #define ICULocaleService ICULocaleService_3_2 #define ICUNotifier ICUNotifier_3_2 #define ICUNumberFormatFactory ICUNumberFormatFactory_3_2 #define ICUNumberFormatService ICUNumberFormatService_3_2 #define ICUResourceBundleFactory ICUResourceBundleFactory_3_2 #define ICUService ICUService_3_2 #define ICUServiceFactory ICUServiceFactory_3_2 #define ICUServiceKey ICUServiceKey_3_2 #define ICU_Utility ICU_Utility_3_2 #define IndicClassTable IndicClassTable_3_2 #define IndicOpenTypeLayoutEngine IndicOpenTypeLayoutEngine_3_2 #define IndicRearrangementProcessor IndicRearrangementProcessor_3_2 #define IndicReordering IndicReordering_3_2 #define IntegralPartSubstitution IntegralPartSubstitution_3_2 #define IslamicCalendar IslamicCalendar_3_2 #define JapaneseCalendar JapaneseCalendar_3_2 #define KeywordEnumeration KeywordEnumeration_3_2 #define LECharMapper LECharMapper_3_2 #define LEFontInstance LEFontInstance_3_2 #define LEGlyphFilter LEGlyphFilter_3_2 #define LEGlyphStorage LEGlyphStorage_3_2 #define LEInsertionCallback LEInsertionCallback_3_2 #define LEInsertionList LEInsertionList_3_2 #define LXUtilities LXUtilities_3_2 #define LayoutEngine LayoutEngine_3_2 #define LigatureSubstitutionProcessor LigatureSubstitutionProcessor_3_2 #define LigatureSubstitutionSubtable LigatureSubstitutionSubtable_3_2 #define LocDataParser LocDataParser_3_2 #define Locale Locale_3_2 #define LocaleBased LocaleBased_3_2 #define LocaleKey LocaleKey_3_2 #define LocaleKeyFactory LocaleKeyFactory_3_2 #define LocaleRuns LocaleRuns_3_2 #define LocaleUtility LocaleUtility_3_2 #define LocalizationInfo LocalizationInfo_3_2 #define LookupListTable LookupListTable_3_2 #define LookupProcessor LookupProcessor_3_2 #define LookupSubtable LookupSubtable_3_2 #define LookupTable LookupTable_3_2 #define LowercaseTransliterator LowercaseTransliterator_3_2 #define MPreFixups MPreFixups_3_2 #define MarkArray MarkArray_3_2 #define MarkToBasePositioningSubtable MarkToBasePositioningSubtable_3_2 #define MarkToLigaturePositioningSubtable MarkToLigaturePositioningSubtable_3_2 #define MarkToMarkPositioningSubtable MarkToMarkPositioningSubtable_3_2 #define Math Math_3_2 #define Measure Measure_3_2 #define MeasureFormat MeasureFormat_3_2 #define MeasureUnit MeasureUnit_3_2 #define MessageFormat MessageFormat_3_2 #define MessageFormatAdapter MessageFormatAdapter_3_2 #define ModulusSubstitution ModulusSubstitution_3_2 #define MoonRiseSetCoordFunc MoonRiseSetCoordFunc_3_2 #define MoonTimeAngleFunc MoonTimeAngleFunc_3_2 #define MorphSubtableHeader MorphSubtableHeader_3_2 #define MorphTableHeader MorphTableHeader_3_2 #define MultipleSubstitutionSubtable MultipleSubstitutionSubtable_3_2 #define MultiplierSubstitution MultiplierSubstitution_3_2 #define NFFactory NFFactory_3_2 #define NFRule NFRule_3_2 #define NFRuleSet NFRuleSet_3_2 #define NFSubstitution NFSubstitution_3_2 #define NameToEnum NameToEnum_3_2 #define NameUnicodeTransliterator NameUnicodeTransliterator_3_2 #define NonContextualGlyphSubstitutionProcessor NonContextualGlyphSubstitutionProcessor_3_2 #define NonContiguousEnumToOffset NonContiguousEnumToOffset_3_2 #define NormalizationTransliterator NormalizationTransliterator_3_2 #define Normalizer Normalizer_3_2 #define NullSubstitution NullSubstitution_3_2 #define NullTransliterator NullTransliterator_3_2 #define NumberFormat NumberFormat_3_2 #define NumberFormatFactory NumberFormatFactory_3_2 #define NumeratorSubstitution NumeratorSubstitution_3_2 #define OlsonTimeZone OlsonTimeZone_3_2 #define OpenTypeLayoutEngine OpenTypeLayoutEngine_3_2 #define OpenTypeUtilities OpenTypeUtilities_3_2 #define PairPositioningFormat1Subtable PairPositioningFormat1Subtable_3_2 #define PairPositioningFormat2Subtable PairPositioningFormat2Subtable_3_2 #define PairPositioningSubtable PairPositioningSubtable_3_2 #define ParagraphLayout ParagraphLayout_3_2 #define ParseData ParseData_3_2 #define ParsePosition ParsePosition_3_2 #define PropertyAliases PropertyAliases_3_2 #define Quantifier Quantifier_3_2 #define RBBIDataWrapper RBBIDataWrapper_3_2 #define RBBINode RBBINode_3_2 #define RBBIRuleBuilder RBBIRuleBuilder_3_2 #define RBBIRuleScanner RBBIRuleScanner_3_2 #define RBBISetBuilder RBBISetBuilder_3_2 #define RBBIStateDescriptor RBBIStateDescriptor_3_2 #define RBBISymbolTable RBBISymbolTable_3_2 #define RBBISymbolTableEntry RBBISymbolTableEntry_3_2 #define RBBITableBuilder RBBITableBuilder_3_2 #define RangeDescriptor RangeDescriptor_3_2 #define RegexCompile RegexCompile_3_2 #define RegexMatcher RegexMatcher_3_2 #define RegexPattern RegexPattern_3_2 #define RegexStaticSets RegexStaticSets_3_2 #define RemoveTransliterator RemoveTransliterator_3_2 #define Replaceable Replaceable_3_2 #define ReplaceableGlue ReplaceableGlue_3_2 #define ResourceBundle ResourceBundle_3_2 #define RiseSetCoordFunc RiseSetCoordFunc_3_2 #define RuleBasedBreakIterator RuleBasedBreakIterator_3_2 #define RuleBasedCollator RuleBasedCollator_3_2 #define RuleBasedNumberFormat RuleBasedNumberFormat_3_2 #define RuleBasedTransliterator RuleBasedTransliterator_3_2 #define RuleCharacterIterator RuleCharacterIterator_3_2 #define RuleHalf RuleHalf_3_2 #define RunArray RunArray_3_2 #define SameValueSubstitution SameValueSubstitution_3_2 #define ScriptListTable ScriptListTable_3_2 #define ScriptRunIterator ScriptRunIterator_3_2 #define ScriptTable ScriptTable_3_2 #define SearchIterator SearchIterator_3_2 #define SegmentArrayProcessor SegmentArrayProcessor_3_2 #define SegmentSingleProcessor SegmentSingleProcessor_3_2 #define ServiceEnumeration ServiceEnumeration_3_2 #define ServiceListener ServiceListener_3_2 #define SimpleArrayProcessor SimpleArrayProcessor_3_2 #define SimpleDateFormat SimpleDateFormat_3_2 #define SimpleFactory SimpleFactory_3_2 #define SimpleLocaleKeyFactory SimpleLocaleKeyFactory_3_2 #define SimpleNumberFormatFactory SimpleNumberFormatFactory_3_2 #define SimpleTimeZone SimpleTimeZone_3_2 #define SinglePositioningFormat1Subtable SinglePositioningFormat1Subtable_3_2 #define SinglePositioningFormat2Subtable SinglePositioningFormat2Subtable_3_2 #define SinglePositioningSubtable SinglePositioningSubtable_3_2 #define SingleSubstitutionFormat1Subtable SingleSubstitutionFormat1Subtable_3_2 #define SingleSubstitutionFormat2Subtable SingleSubstitutionFormat2Subtable_3_2 #define SingleSubstitutionSubtable SingleSubstitutionSubtable_3_2 #define SingleTableProcessor SingleTableProcessor_3_2 #define Spec Spec_3_2 #define StateTableProcessor StateTableProcessor_3_2 #define StringCharacterIterator StringCharacterIterator_3_2 #define StringEnumeration StringEnumeration_3_2 #define StringLocalizationInfo StringLocalizationInfo_3_2 #define StringMatcher StringMatcher_3_2 #define StringPair StringPair_3_2 #define StringReplacer StringReplacer_3_2 #define StringSearch StringSearch_3_2 #define StyleRuns StyleRuns_3_2 #define SubstitutionLookup SubstitutionLookup_3_2 #define SubtableProcessor SubtableProcessor_3_2 #define SunTimeAngleFunc SunTimeAngleFunc_3_2 #define SymbolTable SymbolTable_3_2 #define TZEnumeration TZEnumeration_3_2 #define ThaiLayoutEngine ThaiLayoutEngine_3_2 #define ThaiShaping ThaiShaping_3_2 #define TimeZone TimeZone_3_2 #define TitlecaseTransliterator TitlecaseTransliterator_3_2 #define TransliterationRule TransliterationRule_3_2 #define TransliterationRuleData TransliterationRuleData_3_2 #define TransliterationRuleSet TransliterationRuleSet_3_2 #define Transliterator Transliterator_3_2 #define TransliteratorAlias TransliteratorAlias_3_2 #define TransliteratorIDParser TransliteratorIDParser_3_2 #define TransliteratorParser TransliteratorParser_3_2 #define TransliteratorRegistry TransliteratorRegistry_3_2 #define TrimmedArrayProcessor TrimmedArrayProcessor_3_2 #define UCharCharacterIterator UCharCharacterIterator_3_2 #define UMemory UMemory_3_2 #define UObject UObject_3_2 #define UStack UStack_3_2 #define UStringEnumeration UStringEnumeration_3_2 #define UVector UVector_3_2 #define UVector32 UVector32_3_2 #define UnescapeTransliterator UnescapeTransliterator_3_2 #define UnicodeArabicOpenTypeLayoutEngine UnicodeArabicOpenTypeLayoutEngine_3_2 #define UnicodeFilter UnicodeFilter_3_2 #define UnicodeFunctor UnicodeFunctor_3_2 #define UnicodeMatcher UnicodeMatcher_3_2 #define UnicodeNameTransliterator UnicodeNameTransliterator_3_2 #define UnicodeReplacer UnicodeReplacer_3_2 #define UnicodeSet UnicodeSet_3_2 #define UnicodeSetIterator UnicodeSetIterator_3_2 #define UnicodeString UnicodeString_3_2 #define UppercaseTransliterator UppercaseTransliterator_3_2 #define ValueRecord ValueRecord_3_2 #define ValueRuns ValueRuns_3_2 #define locale_set_default_internal locale_set_default_internal_3_2 #define uprv_parseCurrency uprv_parseCurrency_3_2 #define util64_fromDouble util64_fromDouble_3_2 #define util64_pow util64_pow_3_2 #define util64_tou util64_tou_3_2 #define util64_utoi util64_utoi_3_2 #endif #endif #endif #endif WebKit/mac/icu/unicode/utf_old.h0000644000175000017500000000005511004470500015101 0ustar leelee/* This file is intentionally left blank. */ WebKit/mac/icu/unicode/putil.h0000644000175000017500000001462210514022457014620 0ustar leelee/* ****************************************************************************** * * Copyright (C) 1997-2004, International Business Machines * Corporation and others. All Rights Reserved. * ****************************************************************************** * * FILE NAME : putil.h * * Date Name Description * 05/14/98 nos Creation (content moved here from utypes.h). * 06/17/99 erm Added IEEE_754 * 07/22/98 stephen Added IEEEremainder, max, min, trunc * 08/13/98 stephen Added isNegativeInfinity, isPositiveInfinity * 08/24/98 stephen Added longBitsFromDouble * 03/02/99 stephen Removed openFile(). Added AS400 support. * 04/15/99 stephen Converted to C * 11/15/99 helena Integrated S/390 changes for IEEE support. * 01/11/00 helena Added u_getVersion. ****************************************************************************** */ #ifndef PUTIL_H #define PUTIL_H #include "unicode/utypes.h" /* Define this to 1 if your platform supports IEEE 754 floating point, to 0 if it does not. */ #ifndef IEEE_754 # define IEEE_754 1 #endif /*==========================================================================*/ /* Platform utilities */ /*==========================================================================*/ /** * Platform utilities isolates the platform dependencies of the * libarary. For each platform which this code is ported to, these * functions may have to be re-implemented. */ /** * Return the ICU data directory. * The data directory is where common format ICU data files (.dat files) * are loaded from. Note that normal use of the built-in ICU * facilities does not require loading of an external data file; * unless you are adding custom data to ICU, the data directory * does not need to be set. * * The data directory is determined as follows: * If u_setDataDirectory() has been called, that is it, otherwise * if the ICU_DATA environment variable is set, use that, otherwise * If a data directory was specifed at ICU build time * (#define ICU_DATA_DIR "path"), use that, * otherwise no data directory is available. * * @return the data directory, or an empty string ("") if no data directory has * been specified. * * @stable ICU 2.0 */ U_STABLE const char* U_EXPORT2 u_getDataDirectory(void); /** * Set the ICU data directory. * The data directory is where common format ICU data files (.dat files) * are loaded from. Note that normal use of the built-in ICU * facilities does not require loading of an external data file; * unless you are adding custom data to ICU, the data directory * does not need to be set. * * This function should be called at most once in a process, before the * first ICU operation (e.g., u_init()) that will require the loading of an * ICU data file. * This function is not thread-safe. Use it before calling ICU APIs from * multiple threads. * * @param directory The directory to be set. * * @see u_init * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 u_setDataDirectory(const char *directory); /** * Please use ucnv_getDefaultName() instead. * Return the default codepage for this platform and locale. * This function can call setlocale() on Unix platforms. Please read the * platform documentation on setlocale() before calling this function. * @return the default codepage for this platform * @internal */ U_INTERNAL const char* U_EXPORT2 uprv_getDefaultCodepage(void); /** * Please use uloc_getDefault() instead. * Return the default locale ID string by querying ths system, or * zero if one cannot be found. * This function can call setlocale() on Unix platforms. Please read the * platform documentation on setlocale() before calling this function. * @return the default locale ID string * @internal */ U_INTERNAL const char* U_EXPORT2 uprv_getDefaultLocaleID(void); /** * Filesystem file and path separator characters. * Example: '/' and ':' on Unix, '\\' and ';' on Windows. * @stable ICU 2.0 */ #ifdef XP_MAC # define U_FILE_SEP_CHAR ':' # define U_FILE_ALT_SEP_CHAR ':' # define U_PATH_SEP_CHAR ';' # define U_FILE_SEP_STRING ":" # define U_FILE_ALT_SEP_STRING ":" # define U_PATH_SEP_STRING ";" #elif defined(WIN32) || defined(OS2) # define U_FILE_SEP_CHAR '\\' # define U_FILE_ALT_SEP_CHAR '/' # define U_PATH_SEP_CHAR ';' # define U_FILE_SEP_STRING "\\" # define U_FILE_ALT_SEP_STRING "/" # define U_PATH_SEP_STRING ";" #else # define U_FILE_SEP_CHAR '/' # define U_FILE_ALT_SEP_CHAR '/' # define U_PATH_SEP_CHAR ':' # define U_FILE_SEP_STRING "/" # define U_FILE_ALT_SEP_STRING "/" # define U_PATH_SEP_STRING ":" #endif /** * Convert char characters to UChar characters. * This utility function is useful only for "invariant characters" * that are encoded in the platform default encoding. * They are a small, constant subset of the encoding and include * just the latin letters, digits, and some punctuation. * For details, see U_CHARSET_FAMILY. * * @param cs Input string, points to length * character bytes from a subset of the platform encoding. * @param us Output string, points to memory for length * Unicode characters. * @param length The number of characters to convert; this may * include the terminating NUL. * * @see U_CHARSET_FAMILY * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 u_charsToUChars(const char *cs, UChar *us, int32_t length); /** * Convert UChar characters to char characters. * This utility function is useful only for "invariant characters" * that can be encoded in the platform default encoding. * They are a small, constant subset of the encoding and include * just the latin letters, digits, and some punctuation. * For details, see U_CHARSET_FAMILY. * * @param us Input string, points to length * Unicode characters that can be encoded with the * codepage-invariant subset of the platform encoding. * @param cs Output string, points to memory for length * character bytes. * @param length The number of characters to convert; this may * include the terminating NUL. * * @see U_CHARSET_FAMILY * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 u_UCharsToChars(const UChar *us, char *cs, int32_t length); #endif WebKit/mac/icu/unicode/utf.h0000644000175000017500000001700010360512352014247 0ustar leelee/* ******************************************************************************* * * Copyright (C) 1999-2004, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: utf.h * encoding: US-ASCII * tab size: 8 (not used) * indentation:4 * * created on: 1999sep09 * created by: Markus W. Scherer */ /** * \file * \brief C API: Code point macros * * This file defines macros for checking whether a code point is * a surrogate or a non-character etc. * * The UChar and UChar32 data types for Unicode code units and code points * are defined in umachines.h because they can be machine-dependent. * * utf.h is included by utypes.h and itself includes utf8.h and utf16.h after some * common definitions. Those files define macros for efficiently getting code points * in and out of UTF-8/16 strings. * utf16.h macros have "U16_" prefixes. * utf8.h defines similar macros with "U8_" prefixes for UTF-8 string handling. * * ICU processes 16-bit Unicode strings. * Most of the time, such strings are well-formed UTF-16. * Single, unpaired surrogates must be handled as well, and are treated in ICU * like regular code points where possible. * (Pairs of surrogate code points are indistinguishable from supplementary * code points encoded as pairs of supplementary code units.) * * In fact, almost all Unicode code points in normal text (>99%) * are on the BMP (<=U+ffff) and even <=U+d7ff. * ICU functions handle supplementary code points (U+10000..U+10ffff) * but are optimized for the much more frequently occurring BMP code points. * * utf.h defines UChar to be an unsigned 16-bit integer. If this matches wchar_t, then * UChar is defined to be exactly wchar_t, otherwise uint16_t. * * UChar32 is defined to be a signed 32-bit integer (int32_t), large enough for a 21-bit * Unicode code point (Unicode scalar value, 0..0x10ffff). * Before ICU 2.4, the definition of UChar32 was similarly platform-dependent as * the definition of UChar. For details see the documentation for UChar32 itself. * * utf.h also defines a small number of C macros for single Unicode code points. * These are simple checks for surrogates and non-characters. * For actual Unicode character properties see uchar.h. * * By default, string operations must be done with error checking in case * a string is not well-formed UTF-16. * The macros will detect if a surrogate code unit is unpaired * (lead unit without trail unit or vice versa) and just return the unit itself * as the code point. * (It is an accidental property of Unicode and UTF-16 that all * malformed sequences can be expressed unambiguously with a distinct subrange * of Unicode code points.) * * When it is safe to assume that text is well-formed UTF-16 * (does not contain single, unpaired surrogates), then one can use * U16_..._UNSAFE macros. * These do not check for proper code unit sequences or truncated text and may * yield wrong results or even cause a crash if they are used with "malformed" * text. * In practice, U16_..._UNSAFE macros will produce slightly less code but * should not be faster because the processing is only different when a * surrogate code unit is detected, which will be rare. * * Similarly for UTF-8, there are "safe" macros without a suffix, * and U8_..._UNSAFE versions. * The performance differences are much larger here because UTF-8 provides so * many opportunities for malformed sequences. * The unsafe UTF-8 macros are entirely implemented inside the macro definitions * and are fast, while the safe UTF-8 macros call functions for all but the * trivial (ASCII) cases. * * Unlike with UTF-16, malformed sequences cannot be expressed with distinct * code point values (0..U+10ffff). They are indicated with negative values instead. * * For more information see the ICU User Guide Strings chapter * (http://oss.software.ibm.com/icu/userguide/). * * Usage: * ICU coding guidelines for if() statements should be followed when using these macros. * Compound statements (curly braces {}) must be used for if-else-while... * bodies and all macro statements should be terminated with semicolon. * * @stable ICU 2.4 */ #ifndef __UTF_H__ #define __UTF_H__ #include "unicode/utypes.h" /* include the utfXX.h after the following definitions */ /* single-code point definitions -------------------------------------------- */ /** * This value is intended for sentinel values for APIs that * (take or) return single code points (UChar32). * It is outside of the Unicode code point range 0..0x10ffff. * * For example, a "done" or "error" value in a new API * could be indicated with U_SENTINEL. * * ICU APIs designed before ICU 2.4 usually define service-specific "done" * values, mostly 0xffff. * Those may need to be distinguished from * actual U+ffff text contents by calling functions like * CharacterIterator::hasNext() or UnicodeString::length(). * * @return -1 * @see UChar32 * @stable ICU 2.4 */ #define U_SENTINEL (-1) /** * Is this code point a Unicode noncharacter? * @param c 32-bit code point * @return TRUE or FALSE * @stable ICU 2.4 */ #define U_IS_UNICODE_NONCHAR(c) \ ((c)>=0xfdd0 && \ ((uint32_t)(c)<=0xfdef || ((c)&0xfffe)==0xfffe) && \ (uint32_t)(c)<=0x10ffff) /** * Is c a Unicode code point value (0..U+10ffff) * that can be assigned a character? * * Code points that are not characters include: * - single surrogate code points (U+d800..U+dfff, 2048 code points) * - the last two code points on each plane (U+__fffe and U+__ffff, 34 code points) * - U+fdd0..U+fdef (new with Unicode 3.1, 32 code points) * - the highest Unicode code point value is U+10ffff * * This means that all code points below U+d800 are character code points, * and that boundary is tested first for performance. * * @param c 32-bit code point * @return TRUE or FALSE * @stable ICU 2.4 */ #define U_IS_UNICODE_CHAR(c) \ ((uint32_t)(c)<0xd800 || \ ((uint32_t)(c)>0xdfff && \ (uint32_t)(c)<=0x10ffff && \ !U_IS_UNICODE_NONCHAR(c))) #ifndef U_HIDE_DRAFT_API /** * Is this code point a BMP code point (U+0000..U+ffff)? * @param c 32-bit code point * @return TRUE or FALSE * @draft ICU 2.8 */ #define U_IS_BMP(c) ((uint32_t)(c)<=0xffff) /** * Is this code point a supplementary code point (U+10000..U+10ffff)? * @param c 32-bit code point * @return TRUE or FALSE * @draft ICU 2.8 */ #define U_IS_SUPPLEMENTARY(c) ((uint32_t)((c)-0x10000)<=0xfffff) #endif /*U_HIDE_DRAFT_API*/ /** * Is this code point a lead surrogate (U+d800..U+dbff)? * @param c 32-bit code point * @return TRUE or FALSE * @stable ICU 2.4 */ #define U_IS_LEAD(c) (((c)&0xfffffc00)==0xd800) /** * Is this code point a trail surrogate (U+dc00..U+dfff)? * @param c 32-bit code point * @return TRUE or FALSE * @stable ICU 2.4 */ #define U_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00) /** * Is this code point a surrogate (U+d800..U+dfff)? * @param c 32-bit code point * @return TRUE or FALSE * @stable ICU 2.4 */ #define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800) /** * Assuming c is a surrogate code point (U_IS_SURROGATE(c)), * is it a lead surrogate? * @param c 32-bit code point * @return TRUE or FALSE * @stable ICU 2.4 */ #define U_IS_SURROGATE_LEAD(c) (((c)&0x400)==0) /* include the utfXX.h ------------------------------------------------------ */ #include "unicode/utf8.h" #include "unicode/utf16.h" /* utf_old.h contains deprecated, pre-ICU 2.4 definitions */ #include "unicode/utf_old.h" #endif WebKit/mac/icu/unicode/uidna.h0000644000175000017500000003626110360512352014563 0ustar leelee/* ******************************************************************************* * * Copyright (C) 2003-2004, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: uidna.h * encoding: US-ASCII * tab size: 8 (not used) * indentation:4 * * created on: 2003feb1 * created by: Ram Viswanadha */ #ifndef __UIDNA_H__ #define __UIDNA_H__ #include "unicode/utypes.h" #if !UCONFIG_NO_IDNA #include "unicode/parseerr.h" /** *\file * UIDNA API implements the IDNA protocol as defined in the IDNA RFC * (http://www.ietf.org/rfc/rfc3490.txt). * The RFC defines 2 operations: ToASCII and ToUnicode. Domain labels * containing non-ASCII code points are required to be processed by * ToASCII operation before passing it to resolver libraries. Domain names * that are obtained from resolver libraries are required to be processed by * ToUnicode operation before displaying the domain name to the user. * IDNA requires that implementations process input strings with Nameprep * (http://www.ietf.org/rfc/rfc3491.txt), * which is a profile of Stringprep (http://www.ietf.org/rfc/rfc3454.txt), * and then with Punycode (http://www.ietf.org/rfc/rfc3492.txt). * Implementations of IDNA MUST fully implement Nameprep and Punycode; * neither Nameprep nor Punycode are optional. * The input and output of ToASCII and ToUnicode operations are Unicode * and are designed to be chainable, i.e., applying ToASCII or ToUnicode operations * multiple times to an input string will yield the same result as applying the operation * once. * ToUnicode(ToUnicode(ToUnicode...(ToUnicode(string)))) == ToUnicode(string) * ToASCII(ToASCII(ToASCII...(ToASCII(string))) == ToASCII(string). * */ #ifndef U_HIDE_DRAFT_API /** * Option to prohibit processing of unassigned codepoints in the input and * do not check if the input conforms to STD-3 ASCII rules. * * @see uidna_toASCII uidna_toUnicode * @stable ICU 2.6 */ #define UIDNA_DEFAULT 0x0000 /** * Option to allow processing of unassigned codepoints in the input * * @see uidna_toASCII uidna_toUnicode * @stable ICU 2.6 */ #define UIDNA_ALLOW_UNASSIGNED 0x0001 /** * Option to check if input conforms to STD-3 ASCII rules * * @see uidna_toASCII uidna_toUnicode * @stable ICU 2.6 */ #define UIDNA_USE_STD3_RULES 0x0002 #endif /*U_HIDE_DRAFT_API*/ /** * This function implements the ToASCII operation as defined in the IDNA RFC. * This operation is done on single labels before sending it to something that expects * ASCII names. A label is an individual part of a domain name. Labels are usually * separated by dots; e.g." "www.example.com" is composed of 3 labels * "www","example", and "com". * * * @param src Input UChar array containing label in Unicode. * @param srcLength Number of UChars in src, or -1 if NUL-terminated. * @param dest Output UChar array with ASCII (ACE encoded) label. * @param destCapacity Size of dest. * @param options A bit set of options: * * - UIDNA_DEFAULT Use default options, i.e., do not process unassigned code points * and do not use STD3 ASCII rules * If unassigned code points are found the operation fails with * U_UNASSIGNED_ERROR error code. * * - UIDNA_ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations * If this option is set, the unassigned code points are in the input * are treated as normal Unicode code points. * * - UIDNA_USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions * If this option is set and the input does not satisfy STD3 rules, * the operation will fail with U_IDNA_STD3_ASCII_RULES_ERROR * * @param parseError Pointer to UParseError struct to receive information on position * of error if an error is encountered. Can be NULL. * @param status ICU in/out error code parameter. * U_INVALID_CHAR_FOUND if src contains * unmatched single surrogates. * U_INDEX_OUTOFBOUNDS_ERROR if src contains * too many code points. * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough * @return Number of ASCII characters converted. * @stable ICU 2.6 */ U_STABLE int32_t U_EXPORT2 uidna_toASCII(const UChar* src, int32_t srcLength, UChar* dest, int32_t destCapacity, int32_t options, UParseError* parseError, UErrorCode* status); /** * This function implements the ToUnicode operation as defined in the IDNA RFC. * This operation is done on single labels before sending it to something that expects * Unicode names. A label is an individual part of a domain name. Labels are usually * separated by dots; for e.g." "www.example.com" is composed of 3 labels * "www","example", and "com". * * @param src Input UChar array containing ASCII (ACE encoded) label. * @param srcLength Number of UChars in src, or -1 if NUL-terminated. * @param dest Output Converted UChar array containing Unicode equivalent of label. * @param destCapacity Size of dest. * @param options A bit set of options: * * - UIDNA_DEFAULT Use default options, i.e., do not process unassigned code points * and do not use STD3 ASCII rules * If unassigned code points are found the operation fails with * U_UNASSIGNED_ERROR error code. * * - UIDNA_ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations * If this option is set, the unassigned code points are in the input * are treated as normal Unicode code points. Note: This option is * required on toUnicode operation because the RFC mandates * verification of decoded ACE input by applying toASCII and comparing * its output with source * * * * - UIDNA_USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions * If this option is set and the input does not satisfy STD3 rules, * the operation will fail with U_IDNA_STD3_ASCII_RULES_ERROR * * @param parseError Pointer to UParseError struct to receive information on position * of error if an error is encountered. Can be NULL. * @param status ICU in/out error code parameter. * U_INVALID_CHAR_FOUND if src contains * unmatched single surrogates. * U_INDEX_OUTOFBOUNDS_ERROR if src contains * too many code points. * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough * @return Number of Unicode characters converted. * @stable ICU 2.6 */ U_STABLE int32_t U_EXPORT2 uidna_toUnicode(const UChar* src, int32_t srcLength, UChar* dest, int32_t destCapacity, int32_t options, UParseError* parseError, UErrorCode* status); /** * Convenience function that implements the IDNToASCII operation as defined in the IDNA RFC. * This operation is done on complete domain names, e.g: "www.example.com". * It is important to note that this operation can fail. If it fails, then the input * domain name cannot be used as an Internationalized Domain Name and the application * should have methods defined to deal with the failure. * * Note: IDNA RFC specifies that a conformant application should divide a domain name * into separate labels, decide whether to apply allowUnassigned and useSTD3ASCIIRules on each, * and then convert. This function does not offer that level of granularity. The options once * set will apply to all labels in the domain name * * @param src Input UChar array containing IDN in Unicode. * @param srcLength Number of UChars in src, or -1 if NUL-terminated. * @param dest Output UChar array with ASCII (ACE encoded) IDN. * @param destCapacity Size of dest. * @param options A bit set of options: * * - UIDNA_DEFAULT Use default options, i.e., do not process unassigned code points * and do not use STD3 ASCII rules * If unassigned code points are found the operation fails with * U_UNASSIGNED_CODE_POINT_FOUND error code. * * - UIDNA_ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations * If this option is set, the unassigned code points are in the input * are treated as normal Unicode code points. * * - UIDNA_USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions * If this option is set and the input does not satisfy STD3 rules, * the operation will fail with U_IDNA_STD3_ASCII_RULES_ERROR * * @param parseError Pointer to UParseError struct to receive information on position * of error if an error is encountered. Can be NULL. * @param status ICU in/out error code parameter. * U_INVALID_CHAR_FOUND if src contains * unmatched single surrogates. * U_INDEX_OUTOFBOUNDS_ERROR if src contains * too many code points. * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough * @return Number of ASCII characters converted. * @stable ICU 2.6 */ U_STABLE int32_t U_EXPORT2 uidna_IDNToASCII( const UChar* src, int32_t srcLength, UChar* dest, int32_t destCapacity, int32_t options, UParseError* parseError, UErrorCode* status); /** * Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC. * This operation is done on complete domain names, e.g: "www.example.com". * * Note: IDNA RFC specifies that a conformant application should divide a domain name * into separate labels, decide whether to apply allowUnassigned and useSTD3ASCIIRules on each, * and then convert. This function does not offer that level of granularity. The options once * set will apply to all labels in the domain name * * @param src Input UChar array containing IDN in ASCII (ACE encoded) form. * @param srcLength Number of UChars in src, or -1 if NUL-terminated. * @param dest Output UChar array containing Unicode equivalent of source IDN. * @param destCapacity Size of dest. * @param options A bit set of options: * * - UIDNA_DEFAULT Use default options, i.e., do not process unassigned code points * and do not use STD3 ASCII rules * If unassigned code points are found the operation fails with * U_UNASSIGNED_CODE_POINT_FOUND error code. * * - UIDNA_ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations * If this option is set, the unassigned code points are in the input * are treated as normal Unicode code points. * * - UIDNA_USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions * If this option is set and the input does not satisfy STD3 rules, * the operation will fail with U_IDNA_STD3_ASCII_RULES_ERROR * * @param parseError Pointer to UParseError struct to receive information on position * of error if an error is encountered. Can be NULL. * @param status ICU in/out error code parameter. * U_INVALID_CHAR_FOUND if src contains * unmatched single surrogates. * U_INDEX_OUTOFBOUNDS_ERROR if src contains * too many code points. * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough * @return Number of ASCII characters converted. * @stable ICU 2.6 */ U_STABLE int32_t U_EXPORT2 uidna_IDNToUnicode( const UChar* src, int32_t srcLength, UChar* dest, int32_t destCapacity, int32_t options, UParseError* parseError, UErrorCode* status); /** * Compare two IDN strings for equivalence. * This function splits the domain names into labels and compares them. * According to IDN RFC, whenever two labels are compared, they are * considered equal if and only if their ASCII forms (obtained by * applying toASCII) match using an case-insensitive ASCII comparison. * Two domain names are considered a match if and only if all labels * match regardless of whether label separators match. * * @param s1 First source string. * @param length1 Length of first source string, or -1 if NUL-terminated. * * @param s2 Second source string. * @param length2 Length of second source string, or -1 if NUL-terminated. * @param options A bit set of options: * * - UIDNA_DEFAULT Use default options, i.e., do not process unassigned code points * and do not use STD3 ASCII rules * If unassigned code points are found the operation fails with * U_UNASSIGNED_CODE_POINT_FOUND error code. * * - UIDNA_ALLOW_UNASSIGNED Unassigned values can be converted to ASCII for query operations * If this option is set, the unassigned code points are in the input * are treated as normal Unicode code points. * * - UIDNA_USE_STD3_RULES Use STD3 ASCII rules for host name syntax restrictions * If this option is set and the input does not satisfy STD3 rules, * the operation will fail with U_IDNA_STD3_ASCII_RULES_ERROR * * @param status ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return <0 or 0 or >0 as usual for string comparisons * @stable ICU 2.6 */ U_STABLE int32_t U_EXPORT2 uidna_compare( const UChar *s1, int32_t length1, const UChar *s2, int32_t length2, int32_t options, UErrorCode* status); #endif /* #if !UCONFIG_NO_IDNA */ #endif WebKit/mac/icu/unicode/unorm.h0000644000175000017500000005573610360512352014633 0ustar leelee/* ******************************************************************************* * Copyright (c) 1996-2004, International Business Machines Corporation * and others. All Rights Reserved. ******************************************************************************* * File unorm.h * * Created by: Vladimir Weinstein 12052000 * * Modification history : * * Date Name Description * 02/01/01 synwee Added normalization quickcheck enum and method. */ #ifndef UNORM_H #define UNORM_H #include "unicode/utypes.h" #if !UCONFIG_NO_NORMALIZATION #include "unicode/uiter.h" /** * \file * \brief C API: Unicode Normalization * *

Unicode normalization API

* * unorm_normalize transforms Unicode text into an equivalent composed or * decomposed form, allowing for easier sorting and searching of text. * unorm_normalize supports the standard normalization forms described in * * Unicode Standard Annex #15 — Unicode Normalization Forms. * * Characters with accents or other adornments can be encoded in * several different ways in Unicode. For example, take the character A-acute. * In Unicode, this can be encoded as a single character (the * "composed" form): * * \code * 00C1 LATIN CAPITAL LETTER A WITH ACUTE * \endcode * * or as two separate characters (the "decomposed" form): * * \code * 0041 LATIN CAPITAL LETTER A * 0301 COMBINING ACUTE ACCENT * \endcode * * To a user of your program, however, both of these sequences should be * treated as the same "user-level" character "A with acute accent". When you are searching or * comparing text, you must ensure that these two sequences are treated * equivalently. In addition, you must handle characters with more than one * accent. Sometimes the order of a character's combining accents is * significant, while in other cases accent sequences in different orders are * really equivalent. * * Similarly, the string "ffi" can be encoded as three separate letters: * * \code * 0066 LATIN SMALL LETTER F * 0066 LATIN SMALL LETTER F * 0069 LATIN SMALL LETTER I * \endcode * * or as the single character * * \code * FB03 LATIN SMALL LIGATURE FFI * \endcode * * The ffi ligature is not a distinct semantic character, and strictly speaking * it shouldn't be in Unicode at all, but it was included for compatibility * with existing character sets that already provided it. The Unicode standard * identifies such characters by giving them "compatibility" decompositions * into the corresponding semantic characters. When sorting and searching, you * will often want to use these mappings. * * unorm_normalize helps solve these problems by transforming text into the * canonical composed and decomposed forms as shown in the first example above. * In addition, you can have it perform compatibility decompositions so that * you can treat compatibility characters the same as their equivalents. * Finally, unorm_normalize rearranges accents into the proper canonical * order, so that you do not have to worry about accent rearrangement on your * own. * * Form FCD, "Fast C or D", is also designed for collation. * It allows to work on strings that are not necessarily normalized * with an algorithm (like in collation) that works under "canonical closure", i.e., it treats precomposed * characters and their decomposed equivalents the same. * * It is not a normalization form because it does not provide for uniqueness of representation. Multiple strings * may be canonically equivalent (their NFDs are identical) and may all conform to FCD without being identical * themselves. * * The form is defined such that the "raw decomposition", the recursive canonical decomposition of each character, * results in a string that is canonically ordered. This means that precomposed characters are allowed for as long * as their decompositions do not need canonical reordering. * * Its advantage for a process like collation is that all NFD and most NFC texts - and many unnormalized texts - * already conform to FCD and do not need to be normalized (NFD) for such a process. The FCD quick check will * return UNORM_YES for most strings in practice. * * unorm_normalize(UNORM_FCD) may be implemented with UNORM_NFD. * * For more details on FCD see the collation design document: * http://oss.software.ibm.com/cvs/icu/~checkout~/icuhtml/design/collation/ICU_collation_design.htm * * ICU collation performs either NFD or FCD normalization automatically if normalization * is turned on for the collator object. * Beyond collation and string search, normalized strings may be useful for string equivalence comparisons, * transliteration/transcription, unique representations, etc. * * The W3C generally recommends to exchange texts in NFC. * Note also that most legacy character encodings use only precomposed forms and often do not * encode any combining marks by themselves. For conversion to such character encodings the * Unicode text needs to be normalized to NFC. * For more usage examples, see the Unicode Standard Annex. */ /** * Constants for normalization modes. * @stable ICU 2.0 */ typedef enum { /** No decomposition/composition. @stable ICU 2.0 */ UNORM_NONE = 1, /** Canonical decomposition. @stable ICU 2.0 */ UNORM_NFD = 2, /** Compatibility decomposition. @stable ICU 2.0 */ UNORM_NFKD = 3, /** Canonical decomposition followed by canonical composition. @stable ICU 2.0 */ UNORM_NFC = 4, /** Default normalization. @stable ICU 2.0 */ UNORM_DEFAULT = UNORM_NFC, /** Compatibility decomposition followed by canonical composition. @stable ICU 2.0 */ UNORM_NFKC =5, /** "Fast C or D" form. @stable ICU 2.0 */ UNORM_FCD = 6, /** One more than the highest normalization mode constant. @stable ICU 2.0 */ UNORM_MODE_COUNT } UNormalizationMode; /** * Constants for options flags for normalization. * Use 0 for default options, * including normalization according to the Unicode version * that is currently supported by ICU (see u_getUnicodeVersion). * @stable ICU 2.6 */ enum { /** * Options bit set value to select Unicode 3.2 normalization * (except NormalizationCorrections). * At most one Unicode version can be selected at a time. * @stable ICU 2.6 */ UNORM_UNICODE_3_2=0x20 }; /** * Lowest-order bit number of unorm_compare() options bits corresponding to * normalization options bits. * * The options parameter for unorm_compare() uses most bits for * itself and for various comparison and folding flags. * The most significant bits, however, are shifted down and passed on * to the normalization implementation. * (That is, from unorm_compare(..., options, ...), * options>>UNORM_COMPARE_NORM_OPTIONS_SHIFT will be passed on to the * internal normalization functions.) * * @see unorm_compare * @stable ICU 2.6 */ #define UNORM_COMPARE_NORM_OPTIONS_SHIFT 20 /** * Normalize a string. * The string will be normalized according the specified normalization mode * and options. * * @param source The string to normalize. * @param sourceLength The length of source, or -1 if NUL-terminated. * @param mode The normalization mode; one of UNORM_NONE, * UNORM_NFD, UNORM_NFC, UNORM_NFKC, UNORM_NFKD, UNORM_DEFAULT. * @param options The normalization options, ORed together (0 for no options). * @param result A pointer to a buffer to receive the result string. * The result string is NUL-terminated if possible. * @param resultLength The maximum size of result. * @param status A pointer to a UErrorCode to receive any errors. * @return The total buffer size needed; if greater than resultLength, * the output was truncated, and the error code is set to U_BUFFER_OVERFLOW_ERROR. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 unorm_normalize(const UChar *source, int32_t sourceLength, UNormalizationMode mode, int32_t options, UChar *result, int32_t resultLength, UErrorCode *status); #endif /** * Result values for unorm_quickCheck(). * For details see Unicode Technical Report 15. * @stable ICU 2.0 */ typedef enum UNormalizationCheckResult { /** * Indicates that string is not in the normalized format */ UNORM_NO, /** * Indicates that string is in the normalized format */ UNORM_YES, /** * Indicates that string cannot be determined if it is in the normalized * format without further thorough checks. */ UNORM_MAYBE } UNormalizationCheckResult; #if !UCONFIG_NO_NORMALIZATION /** * Performing quick check on a string, to quickly determine if the string is * in a particular normalization format. * Three types of result can be returned UNORM_YES, UNORM_NO or * UNORM_MAYBE. Result UNORM_YES indicates that the argument * string is in the desired normalized format, UNORM_NO determines that * argument string is not in the desired normalized format. A * UNORM_MAYBE result indicates that a more thorough check is required, * the user may have to put the string in its normalized form and compare the * results. * * @param source string for determining if it is in a normalized format * @param sourcelength length of source to test, or -1 if NUL-terminated * @param mode which normalization form to test for * @param status a pointer to a UErrorCode to receive any errors * @return UNORM_YES, UNORM_NO or UNORM_MAYBE * * @see unorm_isNormalized * @stable ICU 2.0 */ U_STABLE UNormalizationCheckResult U_EXPORT2 unorm_quickCheck(const UChar *source, int32_t sourcelength, UNormalizationMode mode, UErrorCode *status); /** * Performing quick check on a string; same as unorm_quickCheck but * takes an extra options parameter like most normalization functions. * * @param src String that is to be tested if it is in a normalization format. * @param srcLength Length of source to test, or -1 if NUL-terminated. * @param mode Which normalization form to test for. * @param options The normalization options, ORed together (0 for no options). * @param pErrorCode ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return UNORM_YES, UNORM_NO or UNORM_MAYBE * * @see unorm_quickCheck * @see unorm_isNormalized * @stable ICU 2.6 */ U_STABLE UNormalizationCheckResult U_EXPORT2 unorm_quickCheckWithOptions(const UChar *src, int32_t srcLength, UNormalizationMode mode, int32_t options, UErrorCode *pErrorCode); /** * Test if a string is in a given normalization form. * This is semantically equivalent to source.equals(normalize(source, mode)) . * * Unlike unorm_quickCheck(), this function returns a definitive result, * never a "maybe". * For NFD, NFKD, and FCD, both functions work exactly the same. * For NFC and NFKC where quickCheck may return "maybe", this function will * perform further tests to arrive at a TRUE/FALSE result. * * @param src String that is to be tested if it is in a normalization format. * @param srcLength Length of source to test, or -1 if NUL-terminated. * @param mode Which normalization form to test for. * @param pErrorCode ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return Boolean value indicating whether the source string is in the * "mode" normalization form. * * @see unorm_quickCheck * @stable ICU 2.2 */ U_STABLE UBool U_EXPORT2 unorm_isNormalized(const UChar *src, int32_t srcLength, UNormalizationMode mode, UErrorCode *pErrorCode); /** * Test if a string is in a given normalization form; same as unorm_isNormalized but * takes an extra options parameter like most normalization functions. * * @param src String that is to be tested if it is in a normalization format. * @param srcLength Length of source to test, or -1 if NUL-terminated. * @param mode Which normalization form to test for. * @param options The normalization options, ORed together (0 for no options). * @param pErrorCode ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return Boolean value indicating whether the source string is in the * "mode/options" normalization form. * * @see unorm_quickCheck * @see unorm_isNormalized * @stable ICU 2.6 */ U_STABLE UBool U_EXPORT2 unorm_isNormalizedWithOptions(const UChar *src, int32_t srcLength, UNormalizationMode mode, int32_t options, UErrorCode *pErrorCode); /** * Iterative normalization forward. * This function (together with unorm_previous) is somewhat * similar to the C++ Normalizer class (see its non-static functions). * * Iterative normalization is useful when only a small portion of a longer * string/text needs to be processed. * * For example, the likelihood may be high that processing the first 10% of some * text will be sufficient to find certain data. * Another example: When one wants to concatenate two normalized strings and get a * normalized result, it is much more efficient to normalize just a small part of * the result around the concatenation place instead of re-normalizing everything. * * The input text is an instance of the C character iteration API UCharIterator. * It may wrap around a simple string, a CharacterIterator, a Replaceable, or any * other kind of text object. * * If a buffer overflow occurs, then the caller needs to reset the iterator to the * old index and call the function again with a larger buffer - if the caller cares * for the actual output. * Regardless of the output buffer, the iterator will always be moved to the next * normalization boundary. * * This function (like unorm_previous) serves two purposes: * * 1) To find the next boundary so that the normalization of the part of the text * from the current position to that boundary does not affect and is not affected * by the part of the text beyond that boundary. * * 2) To normalize the text up to the boundary. * * The second step is optional, per the doNormalize parameter. * It is omitted for operations like string concatenation, where the two adjacent * string ends need to be normalized together. * In such a case, the output buffer will just contain a copy of the text up to the * boundary. * * pNeededToNormalize is an output-only parameter. Its output value is only defined * if normalization was requested (doNormalize) and successful (especially, no * buffer overflow). * It is useful for operations like a normalizing transliterator, where one would * not want to replace a piece of text if it is not modified. * * If doNormalize==TRUE and pNeededToNormalize!=NULL then *pNeeded... is set TRUE * if the normalization was necessary. * * If doNormalize==FALSE then *pNeededToNormalize will be set to FALSE. * * If the buffer overflows, then *pNeededToNormalize will be undefined; * essentially, whenever U_FAILURE is true (like in buffer overflows), this result * will be undefined. * * @param src The input text in the form of a C character iterator. * @param dest The output buffer; can be NULL if destCapacity==0 for pure preflighting. * @param destCapacity The number of UChars that fit into dest. * @param mode The normalization mode. * @param options The normalization options, ORed together (0 for no options). * @param doNormalize Indicates if the source text up to the next boundary * is to be normalized (TRUE) or just copied (FALSE). * @param pNeededToNormalize Output flag indicating if the normalization resulted in * different text from the input. * Not defined if an error occurs including buffer overflow. * Always FALSE if !doNormalize. * @param pErrorCode ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return Length of output (number of UChars) when successful or buffer overflow. * * @see unorm_previous * @see unorm_normalize * * @stable ICU 2.1 */ U_STABLE int32_t U_EXPORT2 unorm_next(UCharIterator *src, UChar *dest, int32_t destCapacity, UNormalizationMode mode, int32_t options, UBool doNormalize, UBool *pNeededToNormalize, UErrorCode *pErrorCode); /** * Iterative normalization backward. * This function (together with unorm_next) is somewhat * similar to the C++ Normalizer class (see its non-static functions). * For all details see unorm_next. * * @param src The input text in the form of a C character iterator. * @param dest The output buffer; can be NULL if destCapacity==0 for pure preflighting. * @param destCapacity The number of UChars that fit into dest. * @param mode The normalization mode. * @param options The normalization options, ORed together (0 for no options). * @param doNormalize Indicates if the source text up to the next boundary * is to be normalized (TRUE) or just copied (FALSE). * @param pNeededToNormalize Output flag indicating if the normalization resulted in * different text from the input. * Not defined if an error occurs including buffer overflow. * Always FALSE if !doNormalize. * @param pErrorCode ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return Length of output (number of UChars) when successful or buffer overflow. * * @see unorm_next * @see unorm_normalize * * @stable ICU 2.1 */ U_STABLE int32_t U_EXPORT2 unorm_previous(UCharIterator *src, UChar *dest, int32_t destCapacity, UNormalizationMode mode, int32_t options, UBool doNormalize, UBool *pNeededToNormalize, UErrorCode *pErrorCode); /** * Concatenate normalized strings, making sure that the result is normalized as well. * * If both the left and the right strings are in * the normalization form according to "mode/options", * then the result will be * * \code * dest=normalize(left+right, mode, options) * \endcode * * With the input strings already being normalized, * this function will use unorm_next() and unorm_previous() * to find the adjacent end pieces of the input strings. * Only the concatenation of these end pieces will be normalized and * then concatenated with the remaining parts of the input strings. * * It is allowed to have dest==left to avoid copying the entire left string. * * @param left Left source string, may be same as dest. * @param leftLength Length of left source string, or -1 if NUL-terminated. * @param right Right source string. * @param rightLength Length of right source string, or -1 if NUL-terminated. * @param dest The output buffer; can be NULL if destCapacity==0 for pure preflighting. * @param destCapacity The number of UChars that fit into dest. * @param mode The normalization mode. * @param options The normalization options, ORed together (0 for no options). * @param pErrorCode ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return Length of output (number of UChars) when successful or buffer overflow. * * @see unorm_normalize * @see unorm_next * @see unorm_previous * * @stable ICU 2.1 */ U_STABLE int32_t U_EXPORT2 unorm_concatenate(const UChar *left, int32_t leftLength, const UChar *right, int32_t rightLength, UChar *dest, int32_t destCapacity, UNormalizationMode mode, int32_t options, UErrorCode *pErrorCode); /** * Option bit for unorm_compare: * Both input strings are assumed to fulfill FCD conditions. * @stable ICU 2.2 */ #define UNORM_INPUT_IS_FCD 0x20000 /** * Option bit for unorm_compare: * Perform case-insensitive comparison. * @stable ICU 2.2 */ #define U_COMPARE_IGNORE_CASE 0x10000 #ifndef U_COMPARE_CODE_POINT_ORDER /* see also unistr.h and ustring.h */ /** * Option bit for u_strCaseCompare, u_strcasecmp, unorm_compare, etc: * Compare strings in code point order instead of code unit order. * @stable ICU 2.2 */ #define U_COMPARE_CODE_POINT_ORDER 0x8000 #endif /** * Compare two strings for canonical equivalence. * Further options include case-insensitive comparison and * code point order (as opposed to code unit order). * * Canonical equivalence between two strings is defined as their normalized * forms (NFD or NFC) being identical. * This function compares strings incrementally instead of normalizing * (and optionally case-folding) both strings entirely, * improving performance significantly. * * Bulk normalization is only necessary if the strings do not fulfill the FCD * conditions. Only in this case, and only if the strings are relatively long, * is memory allocated temporarily. * For FCD strings and short non-FCD strings there is no memory allocation. * * Semantically, this is equivalent to * strcmp[CodePointOrder](NFD(foldCase(NFD(s1))), NFD(foldCase(NFD(s2)))) * where code point order and foldCase are all optional. * * UAX 21 2.5 Caseless Matching specifies that for a canonical caseless match * the case folding must be performed first, then the normalization. * * @param s1 First source string. * @param length1 Length of first source string, or -1 if NUL-terminated. * * @param s2 Second source string. * @param length2 Length of second source string, or -1 if NUL-terminated. * * @param options A bit set of options: * - U_FOLD_CASE_DEFAULT or 0 is used for default options: * Case-sensitive comparison in code unit order, and the input strings * are quick-checked for FCD. * * - UNORM_INPUT_IS_FCD * Set if the caller knows that both s1 and s2 fulfill the FCD conditions. * If not set, the function will quickCheck for FCD * and normalize if necessary. * * - U_COMPARE_CODE_POINT_ORDER * Set to choose code point order instead of code unit order * (see u_strCompare for details). * * - U_COMPARE_IGNORE_CASE * Set to compare strings case-insensitively using case folding, * instead of case-sensitively. * If set, then the following case folding options are used. * * - Options as used with case-insensitive comparisons, currently: * * - U_FOLD_CASE_EXCLUDE_SPECIAL_I * (see u_strCaseCompare for details) * * - regular normalization options shifted left by UNORM_COMPARE_NORM_OPTIONS_SHIFT * * @param pErrorCode ICU error code in/out parameter. * Must fulfill U_SUCCESS before the function call. * @return <0 or 0 or >0 as usual for string comparisons * * @see unorm_normalize * @see UNORM_FCD * @see u_strCompare * @see u_strCaseCompare * * @stable ICU 2.2 */ U_STABLE int32_t U_EXPORT2 unorm_compare(const UChar *s1, int32_t length1, const UChar *s2, int32_t length2, uint32_t options, UErrorCode *pErrorCode); #endif /* #if !UCONFIG_NO_NORMALIZATION */ #endif WebKit/mac/icu/unicode/uchar.h0000644000175000017500000030311210360512352014555 0ustar leelee/* ********************************************************************** * Copyright (C) 1997-2004, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * * File UCHAR.H * * Modification History: * * Date Name Description * 04/02/97 aliu Creation. * 03/29/99 helena Updated for C APIs. * 4/15/99 Madhu Updated for C Implementation and Javadoc * 5/20/99 Madhu Added the function u_getVersion() * 8/19/1999 srl Upgraded scripts to Unicode 3.0 * 8/27/1999 schererm UCharDirection constants: U_... * 11/11/1999 weiv added u_isalnum(), cleaned comments * 01/11/2000 helena Renamed u_getVersion to u_getUnicodeVersion(). ****************************************************************************** */ #ifndef UCHAR_H #define UCHAR_H #include "unicode/utypes.h" U_CDECL_BEGIN /*==========================================================================*/ /* Unicode version number */ /*==========================================================================*/ /** * Unicode version number, default for the current ICU version. * The actual Unicode Character Database (UCD) data is stored in uprops.dat * and may be generated from UCD files from a different Unicode version. * Call u_getUnicodeVersion to get the actual Unicode version of the data. * * @see u_getUnicodeVersion * @stable ICU 2.0 */ #define U_UNICODE_VERSION "4.0.1" /** * \file * \brief C API: Unicode Properties * * This C API provides low-level access to the Unicode Character Database. * In addition to raw property values, some convenience functions calculate * derived properties, for example for Java-style programming. * * Unicode assigns each code point (not just assigned character) values for * many properties. * Most of them are simple boolean flags, or constants from a small enumerated list. * For some properties, values are strings or other relatively more complex types. * * For more information see * "About the Unicode Character Database" (http://www.unicode.org/ucd/) * and the ICU User Guide chapter on Properties (http://oss.software.ibm.com/icu/userguide/properties.html). * * Many functions are designed to match java.lang.Character functions. * See the individual function documentation, * and see the JDK 1.4.1 java.lang.Character documentation * at http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Character.html * * There are also functions that provide easy migration from C/POSIX functions * like isblank(). Their use is generally discouraged because the C/POSIX * standards do not define their semantics beyond the ASCII range, which means * that different implementations exhibit very different behavior. * Instead, Unicode properties should be used directly. * * There are also only a few, broad C/POSIX character classes, and they tend * to be used for conflicting purposes. For example, the "isalpha()" class * is sometimes used to determine word boundaries, while a more sophisticated * approach would at least distinguish initial letters from continuation * characters (the latter including combining marks). * (In ICU, BreakIterator is the most sophisticated API for word boundaries.) * Another example: There is no "istitle()" class for titlecase characters. * * A summary of the behavior of some C/POSIX character classification implementations * for Unicode is available at http://oss.software.ibm.com/cvs/icu/~checkout~/icuhtml/design/posix_classes.html * * Important: * The behavior of the ICU C/POSIX-style character classification * functions is subject to change according to discussion of the above summary. * * Note: There are several ICU whitespace functions. * Comparison: * - u_isUWhiteSpace=UCHAR_WHITE_SPACE: Unicode White_Space property; * most of general categories "Z" (separators) + most whitespace ISO controls * (including no-break spaces, but excluding IS1..IS4 and ZWSP) * - u_isWhitespace: Java isWhitespace; Z + whitespace ISO controls but excluding no-break spaces * - u_isJavaSpaceChar: Java isSpaceChar; just Z (including no-break spaces) * - u_isspace: Z + whitespace ISO controls (including no-break spaces) * - u_isblank: "horizontal spaces" = TAB + Zs - ZWSP */ /** * Constants. */ /** The lowest Unicode code point value. Code points are non-negative. @stable ICU 2.0 */ #define UCHAR_MIN_VALUE 0 /** * The highest Unicode code point value (scalar value) according to * The Unicode Standard. This is a 21-bit value (20.1 bits, rounded up). * For a single character, UChar32 is a simple type that can hold any code point value. * * @see UChar32 * @stable ICU 2.0 */ #define UCHAR_MAX_VALUE 0x10ffff /** * Get a single-bit bit set (a flag) from a bit number 0..31. * @stable ICU 2.1 */ #define U_MASK(x) ((uint32_t)1<<(x)) /* * !! Note: Several comments in this file are machine-read by the * genpname tool. These comments describe the correspondence between * icu enum constants and UCD entities. Do not delete them. Update * these comments as needed. * * Any comment of the form "/ *[name]* /" (spaces added) is such * a comment. * * The U_JG_* and U_GC_*_MASK constants are matched by their symbolic * name, which must match PropertyValueAliases.txt. */ /** * Selection constants for Unicode properties. * These constants are used in functions like u_hasBinaryProperty to select * one of the Unicode properties. * * The properties APIs are intended to reflect Unicode properties as defined * in the Unicode Character Database (UCD) and Unicode Technical Reports (UTR). * For details about the properties see http://www.unicode.org/ucd/ . * For names of Unicode properties see the UCD file PropertyAliases.txt. * * Important: If ICU is built with UCD files from Unicode versions below, e.g., 3.2, * then properties marked with "new in Unicode 3.2" are not or not fully available. * Check u_getUnicodeVersion to be sure. * * @see u_hasBinaryProperty * @see u_getIntPropertyValue * @see u_getUnicodeVersion * @stable ICU 2.1 */ typedef enum UProperty { /* See note !!. Comments of the form "Binary property Dash", "Enumerated property Script", "Double property Numeric_Value", and "String property Age" are read by genpname. */ /* Note: Place UCHAR_ALPHABETIC before UCHAR_BINARY_START so that debuggers display UCHAR_ALPHABETIC as the symbolic name for 0, rather than UCHAR_BINARY_START. Likewise for other *_START identifiers. */ /** Binary property Alphabetic. Same as u_isUAlphabetic, different from u_isalpha. Lu+Ll+Lt+Lm+Lo+Nl+Other_Alphabetic @stable ICU 2.1 */ UCHAR_ALPHABETIC=0, /** First constant for binary Unicode properties. @stable ICU 2.1 */ UCHAR_BINARY_START=UCHAR_ALPHABETIC, /** Binary property ASCII_Hex_Digit. 0-9 A-F a-f @stable ICU 2.1 */ UCHAR_ASCII_HEX_DIGIT, /** Binary property Bidi_Control. Format controls which have specific functions in the Bidi Algorithm. @stable ICU 2.1 */ UCHAR_BIDI_CONTROL, /** Binary property Bidi_Mirrored. Characters that may change display in RTL text. Same as u_isMirrored. See Bidi Algorithm, UTR 9. @stable ICU 2.1 */ UCHAR_BIDI_MIRRORED, /** Binary property Dash. Variations of dashes. @stable ICU 2.1 */ UCHAR_DASH, /** Binary property Default_Ignorable_Code_Point (new in Unicode 3.2). Ignorable in most processing. <2060..206F, FFF0..FFFB, E0000..E0FFF>+Other_Default_Ignorable_Code_Point+(Cf+Cc+Cs-White_Space) @stable ICU 2.1 */ UCHAR_DEFAULT_IGNORABLE_CODE_POINT, /** Binary property Deprecated (new in Unicode 3.2). The usage of deprecated characters is strongly discouraged. @stable ICU 2.1 */ UCHAR_DEPRECATED, /** Binary property Diacritic. Characters that linguistically modify the meaning of another character to which they apply. @stable ICU 2.1 */ UCHAR_DIACRITIC, /** Binary property Extender. Extend the value or shape of a preceding alphabetic character, e.g., length and iteration marks. @stable ICU 2.1 */ UCHAR_EXTENDER, /** Binary property Full_Composition_Exclusion. CompositionExclusions.txt+Singleton Decompositions+ Non-Starter Decompositions. @stable ICU 2.1 */ UCHAR_FULL_COMPOSITION_EXCLUSION, /** Binary property Grapheme_Base (new in Unicode 3.2). For programmatic determination of grapheme cluster boundaries. [0..10FFFF]-Cc-Cf-Cs-Co-Cn-Zl-Zp-Grapheme_Link-Grapheme_Extend-CGJ @stable ICU 2.1 */ UCHAR_GRAPHEME_BASE, /** Binary property Grapheme_Extend (new in Unicode 3.2). For programmatic determination of grapheme cluster boundaries. Me+Mn+Mc+Other_Grapheme_Extend-Grapheme_Link-CGJ @stable ICU 2.1 */ UCHAR_GRAPHEME_EXTEND, /** Binary property Grapheme_Link (new in Unicode 3.2). For programmatic determination of grapheme cluster boundaries. @stable ICU 2.1 */ UCHAR_GRAPHEME_LINK, /** Binary property Hex_Digit. Characters commonly used for hexadecimal numbers. @stable ICU 2.1 */ UCHAR_HEX_DIGIT, /** Binary property Hyphen. Dashes used to mark connections between pieces of words, plus the Katakana middle dot. @stable ICU 2.1 */ UCHAR_HYPHEN, /** Binary property ID_Continue. Characters that can continue an identifier. DerivedCoreProperties.txt also says "NOTE: Cf characters should be filtered out." ID_Start+Mn+Mc+Nd+Pc @stable ICU 2.1 */ UCHAR_ID_CONTINUE, /** Binary property ID_Start. Characters that can start an identifier. Lu+Ll+Lt+Lm+Lo+Nl @stable ICU 2.1 */ UCHAR_ID_START, /** Binary property Ideographic. CJKV ideographs. @stable ICU 2.1 */ UCHAR_IDEOGRAPHIC, /** Binary property IDS_Binary_Operator (new in Unicode 3.2). For programmatic determination of Ideographic Description Sequences. @stable ICU 2.1 */ UCHAR_IDS_BINARY_OPERATOR, /** Binary property IDS_Trinary_Operator (new in Unicode 3.2). For programmatic determination of Ideographic Description Sequences. @stable ICU 2.1 */ UCHAR_IDS_TRINARY_OPERATOR, /** Binary property Join_Control. Format controls for cursive joining and ligation. @stable ICU 2.1 */ UCHAR_JOIN_CONTROL, /** Binary property Logical_Order_Exception (new in Unicode 3.2). Characters that do not use logical order and require special handling in most processing. @stable ICU 2.1 */ UCHAR_LOGICAL_ORDER_EXCEPTION, /** Binary property Lowercase. Same as u_isULowercase, different from u_islower. Ll+Other_Lowercase @stable ICU 2.1 */ UCHAR_LOWERCASE, /** Binary property Math. Sm+Other_Math @stable ICU 2.1 */ UCHAR_MATH, /** Binary property Noncharacter_Code_Point. Code points that are explicitly defined as illegal for the encoding of characters. @stable ICU 2.1 */ UCHAR_NONCHARACTER_CODE_POINT, /** Binary property Quotation_Mark. @stable ICU 2.1 */ UCHAR_QUOTATION_MARK, /** Binary property Radical (new in Unicode 3.2). For programmatic determination of Ideographic Description Sequences. @stable ICU 2.1 */ UCHAR_RADICAL, /** Binary property Soft_Dotted (new in Unicode 3.2). Characters with a "soft dot", like i or j. An accent placed on these characters causes the dot to disappear. @stable ICU 2.1 */ UCHAR_SOFT_DOTTED, /** Binary property Terminal_Punctuation. Punctuation characters that generally mark the end of textual units. @stable ICU 2.1 */ UCHAR_TERMINAL_PUNCTUATION, /** Binary property Unified_Ideograph (new in Unicode 3.2). For programmatic determination of Ideographic Description Sequences. @stable ICU 2.1 */ UCHAR_UNIFIED_IDEOGRAPH, /** Binary property Uppercase. Same as u_isUUppercase, different from u_isupper. Lu+Other_Uppercase @stable ICU 2.1 */ UCHAR_UPPERCASE, /** Binary property White_Space. Same as u_isUWhiteSpace, different from u_isspace and u_isWhitespace. Space characters+TAB+CR+LF-ZWSP-ZWNBSP @stable ICU 2.1 */ UCHAR_WHITE_SPACE, /** Binary property XID_Continue. ID_Continue modified to allow closure under normalization forms NFKC and NFKD. @stable ICU 2.1 */ UCHAR_XID_CONTINUE, /** Binary property XID_Start. ID_Start modified to allow closure under normalization forms NFKC and NFKD. @stable ICU 2.1 */ UCHAR_XID_START, /** Binary property Case_Sensitive. Either the source of a case mapping or _in_ the target of a case mapping. Not the same as the general category Cased_Letter. @stable ICU 2.6 */ UCHAR_CASE_SENSITIVE, /** Binary property STerm (new in Unicode 4.0.1). Sentence Terminal. Used in UAX #29: Text Boundaries (http://www.unicode.org/reports/tr29/) @draft ICU 3.0 */ UCHAR_S_TERM, /** Binary property Variation_Selector (new in Unicode 4.0.1). Indicates all those characters that qualify as Variation Selectors. For details on the behavior of these characters, see StandardizedVariants.html and 15.6 Variation Selectors. @draft ICU 3.0 */ UCHAR_VARIATION_SELECTOR, /** Binary property NFD_Inert. ICU-specific property for characters that are inert under NFD, i.e., they do not interact with adjacent characters. Used for example in normalizing transforms in incremental mode to find the boundary of safely normalizable text despite possible text additions. There is one such property per normalization form. These properties are computed as follows - an inert character is: a) unassigned, or ALL of the following: b) of combining class 0. c) not decomposed by this normalization form. AND if NFC or NFKC, d) can never compose with a previous character. e) can never compose with a following character. f) can never change if another character is added. Example: a-breve might satisfy all but f, but if you add an ogonek it changes to a-ogonek + breve See also com.ibm.text.UCD.NFSkippable in the ICU4J repository, and icu/source/common/unormimp.h . @draft ICU 3.0 */ UCHAR_NFD_INERT, /** Binary property NFKD_Inert. ICU-specific property for characters that are inert under NFKD, i.e., they do not interact with adjacent characters. Used for example in normalizing transforms in incremental mode to find the boundary of safely normalizable text despite possible text additions. @see UCHAR_NFD_INERT @draft ICU 3.0 */ UCHAR_NFKD_INERT, /** Binary property NFC_Inert. ICU-specific property for characters that are inert under NFC, i.e., they do not interact with adjacent characters. Used for example in normalizing transforms in incremental mode to find the boundary of safely normalizable text despite possible text additions. @see UCHAR_NFD_INERT @draft ICU 3.0 */ UCHAR_NFC_INERT, /** Binary property NFKC_Inert. ICU-specific property for characters that are inert under NFKC, i.e., they do not interact with adjacent characters. Used for example in normalizing transforms in incremental mode to find the boundary of safely normalizable text despite possible text additions. @see UCHAR_NFD_INERT @draft ICU 3.0 */ UCHAR_NFKC_INERT, /** Binary Property Segment_Starter. ICU-specific property for characters that are starters in terms of Unicode normalization and combining character sequences. They have ccc=0 and do not occur in non-initial position of the canonical decomposition of any character (like " in NFD(a-umlaut) and a Jamo T in an NFD(Hangul LVT)). ICU uses this property for segmenting a string for generating a set of canonically equivalent strings, e.g. for canonical closure while processing collation tailoring rules. @draft ICU 3.0 */ UCHAR_SEGMENT_STARTER, /** One more than the last constant for binary Unicode properties. @stable ICU 2.1 */ UCHAR_BINARY_LIMIT, /** Enumerated property Bidi_Class. Same as u_charDirection, returns UCharDirection values. @stable ICU 2.2 */ UCHAR_BIDI_CLASS=0x1000, /** First constant for enumerated/integer Unicode properties. @stable ICU 2.2 */ UCHAR_INT_START=UCHAR_BIDI_CLASS, /** Enumerated property Block. Same as ublock_getCode, returns UBlockCode values. @stable ICU 2.2 */ UCHAR_BLOCK, /** Enumerated property Canonical_Combining_Class. Same as u_getCombiningClass, returns 8-bit numeric values. @stable ICU 2.2 */ UCHAR_CANONICAL_COMBINING_CLASS, /** Enumerated property Decomposition_Type. Returns UDecompositionType values. @stable ICU 2.2 */ UCHAR_DECOMPOSITION_TYPE, /** Enumerated property East_Asian_Width. See http://www.unicode.org/reports/tr11/ Returns UEastAsianWidth values. @stable ICU 2.2 */ UCHAR_EAST_ASIAN_WIDTH, /** Enumerated property General_Category. Same as u_charType, returns UCharCategory values. @stable ICU 2.2 */ UCHAR_GENERAL_CATEGORY, /** Enumerated property Joining_Group. Returns UJoiningGroup values. @stable ICU 2.2 */ UCHAR_JOINING_GROUP, /** Enumerated property Joining_Type. Returns UJoiningType values. @stable ICU 2.2 */ UCHAR_JOINING_TYPE, /** Enumerated property Line_Break. Returns ULineBreak values. @stable ICU 2.2 */ UCHAR_LINE_BREAK, /** Enumerated property Numeric_Type. Returns UNumericType values. @stable ICU 2.2 */ UCHAR_NUMERIC_TYPE, /** Enumerated property Script. Same as uscript_getScript, returns UScriptCode values. @stable ICU 2.2 */ UCHAR_SCRIPT, /** Enumerated property Hangul_Syllable_Type, new in Unicode 4. Returns UHangulSyllableType values. @stable ICU 2.6 */ UCHAR_HANGUL_SYLLABLE_TYPE, /** Enumerated property NFD_Quick_Check. Returns UNormalizationCheckResult values. @draft ICU 3.0 */ UCHAR_NFD_QUICK_CHECK, /** Enumerated property NFKD_Quick_Check. Returns UNormalizationCheckResult values. @draft ICU 3.0 */ UCHAR_NFKD_QUICK_CHECK, /** Enumerated property NFC_Quick_Check. Returns UNormalizationCheckResult values. @draft ICU 3.0 */ UCHAR_NFC_QUICK_CHECK, /** Enumerated property NFKC_Quick_Check. Returns UNormalizationCheckResult values. @draft ICU 3.0 */ UCHAR_NFKC_QUICK_CHECK, /** Enumerated property Lead_Canonical_Combining_Class. ICU-specific property for the ccc of the first code point of the decomposition, or lccc(c)=ccc(NFD(c)[0]). Useful for checking for canonically ordered text; see UNORM_FCD and http://www.unicode.org/notes/tn5/#FCD . Returns 8-bit numeric values like UCHAR_CANONICAL_COMBINING_CLASS. @draft ICU 3.0 */ UCHAR_LEAD_CANONICAL_COMBINING_CLASS, /** Enumerated property Trail_Canonical_Combining_Class. ICU-specific property for the ccc of the last code point of the decomposition, or tccc(c)=ccc(NFD(c)[last]). Useful for checking for canonically ordered text; see UNORM_FCD and http://www.unicode.org/notes/tn5/#FCD . Returns 8-bit numeric values like UCHAR_CANONICAL_COMBINING_CLASS. @draft ICU 3.0 */ UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, /** One more than the last constant for enumerated/integer Unicode properties. @stable ICU 2.2 */ UCHAR_INT_LIMIT, /** Bitmask property General_Category_Mask. This is the General_Category property returned as a bit mask. When used in u_getIntPropertyValue(c), same as U_MASK(u_charType(c)), returns bit masks for UCharCategory values where exactly one bit is set. When used with u_getPropertyValueName() and u_getPropertyValueEnum(), a multi-bit mask is used for sets of categories like "Letters". Mask values should be cast to uint32_t. @stable ICU 2.4 */ UCHAR_GENERAL_CATEGORY_MASK=0x2000, /** First constant for bit-mask Unicode properties. @stable ICU 2.4 */ UCHAR_MASK_START=UCHAR_GENERAL_CATEGORY_MASK, /** One more than the last constant for bit-mask Unicode properties. @stable ICU 2.4 */ UCHAR_MASK_LIMIT, /** Double property Numeric_Value. Corresponds to u_getNumericValue. @stable ICU 2.4 */ UCHAR_NUMERIC_VALUE=0x3000, /** First constant for double Unicode properties. @stable ICU 2.4 */ UCHAR_DOUBLE_START=UCHAR_NUMERIC_VALUE, /** One more than the last constant for double Unicode properties. @stable ICU 2.4 */ UCHAR_DOUBLE_LIMIT, /** String property Age. Corresponds to u_charAge. @stable ICU 2.4 */ UCHAR_AGE=0x4000, /** First constant for string Unicode properties. @stable ICU 2.4 */ UCHAR_STRING_START=UCHAR_AGE, /** String property Bidi_Mirroring_Glyph. Corresponds to u_charMirror. @stable ICU 2.4 */ UCHAR_BIDI_MIRRORING_GLYPH, /** String property Case_Folding. Corresponds to u_strFoldCase in ustring.h. @stable ICU 2.4 */ UCHAR_CASE_FOLDING, /** String property ISO_Comment. Corresponds to u_getISOComment. @stable ICU 2.4 */ UCHAR_ISO_COMMENT, /** String property Lowercase_Mapping. Corresponds to u_strToLower in ustring.h. @stable ICU 2.4 */ UCHAR_LOWERCASE_MAPPING, /** String property Name. Corresponds to u_charName. @stable ICU 2.4 */ UCHAR_NAME, /** String property Simple_Case_Folding. Corresponds to u_foldCase. @stable ICU 2.4 */ UCHAR_SIMPLE_CASE_FOLDING, /** String property Simple_Lowercase_Mapping. Corresponds to u_tolower. @stable ICU 2.4 */ UCHAR_SIMPLE_LOWERCASE_MAPPING, /** String property Simple_Titlecase_Mapping. Corresponds to u_totitle. @stable ICU 2.4 */ UCHAR_SIMPLE_TITLECASE_MAPPING, /** String property Simple_Uppercase_Mapping. Corresponds to u_toupper. @stable ICU 2.4 */ UCHAR_SIMPLE_UPPERCASE_MAPPING, /** String property Titlecase_Mapping. Corresponds to u_strToTitle in ustring.h. @stable ICU 2.4 */ UCHAR_TITLECASE_MAPPING, /** String property Unicode_1_Name. Corresponds to u_charName. @stable ICU 2.4 */ UCHAR_UNICODE_1_NAME, /** String property Uppercase_Mapping. Corresponds to u_strToUpper in ustring.h. @stable ICU 2.4 */ UCHAR_UPPERCASE_MAPPING, /** One more than the last constant for string Unicode properties. @stable ICU 2.4 */ UCHAR_STRING_LIMIT, /** Represents a nonexistent or invalid property or property value. @stable ICU 2.4 */ UCHAR_INVALID_CODE = -1 } UProperty; /** * Data for enumerated Unicode general category types. * See http://www.unicode.org/Public/UNIDATA/UnicodeData.html . * @stable ICU 2.0 */ typedef enum UCharCategory { /** See note !!. Comments of the form "Cn" are read by genpname. */ /** Non-category for unassigned and non-character code points. @stable ICU 2.0 */ U_UNASSIGNED = 0, /** Cn "Other, Not Assigned (no characters in [UnicodeData.txt] have this property)" (same as U_UNASSIGNED!) @stable ICU 2.0 */ U_GENERAL_OTHER_TYPES = 0, /** Lu @stable ICU 2.0 */ U_UPPERCASE_LETTER = 1, /** Ll @stable ICU 2.0 */ U_LOWERCASE_LETTER = 2, /** Lt @stable ICU 2.0 */ U_TITLECASE_LETTER = 3, /** Lm @stable ICU 2.0 */ U_MODIFIER_LETTER = 4, /** Lo @stable ICU 2.0 */ U_OTHER_LETTER = 5, /** Mn @stable ICU 2.0 */ U_NON_SPACING_MARK = 6, /** Me @stable ICU 2.0 */ U_ENCLOSING_MARK = 7, /** Mc @stable ICU 2.0 */ U_COMBINING_SPACING_MARK = 8, /** Nd @stable ICU 2.0 */ U_DECIMAL_DIGIT_NUMBER = 9, /** Nl @stable ICU 2.0 */ U_LETTER_NUMBER = 10, /** No @stable ICU 2.0 */ U_OTHER_NUMBER = 11, /** Zs @stable ICU 2.0 */ U_SPACE_SEPARATOR = 12, /** Zl @stable ICU 2.0 */ U_LINE_SEPARATOR = 13, /** Zp @stable ICU 2.0 */ U_PARAGRAPH_SEPARATOR = 14, /** Cc @stable ICU 2.0 */ U_CONTROL_CHAR = 15, /** Cf @stable ICU 2.0 */ U_FORMAT_CHAR = 16, /** Co @stable ICU 2.0 */ U_PRIVATE_USE_CHAR = 17, /** Cs @stable ICU 2.0 */ U_SURROGATE = 18, /** Pd @stable ICU 2.0 */ U_DASH_PUNCTUATION = 19, /** Ps @stable ICU 2.0 */ U_START_PUNCTUATION = 20, /** Pe @stable ICU 2.0 */ U_END_PUNCTUATION = 21, /** Pc @stable ICU 2.0 */ U_CONNECTOR_PUNCTUATION = 22, /** Po @stable ICU 2.0 */ U_OTHER_PUNCTUATION = 23, /** Sm @stable ICU 2.0 */ U_MATH_SYMBOL = 24, /** Sc @stable ICU 2.0 */ U_CURRENCY_SYMBOL = 25, /** Sk @stable ICU 2.0 */ U_MODIFIER_SYMBOL = 26, /** So @stable ICU 2.0 */ U_OTHER_SYMBOL = 27, /** Pi @stable ICU 2.0 */ U_INITIAL_PUNCTUATION = 28, /** Pf @stable ICU 2.0 */ U_FINAL_PUNCTUATION = 29, /** One higher than the last enum UCharCategory constant. @stable ICU 2.0 */ U_CHAR_CATEGORY_COUNT } UCharCategory; /** * U_GC_XX_MASK constants are bit flags corresponding to Unicode * general category values. * For each category, the nth bit is set if the numeric value of the * corresponding UCharCategory constant is n. * * There are also some U_GC_Y_MASK constants for groups of general categories * like L for all letter categories. * * @see u_charType * @see U_GET_GC_MASK * @see UCharCategory * @stable ICU 2.1 */ #define U_GC_CN_MASK U_MASK(U_GENERAL_OTHER_TYPES) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_LU_MASK U_MASK(U_UPPERCASE_LETTER) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_LL_MASK U_MASK(U_LOWERCASE_LETTER) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_LT_MASK U_MASK(U_TITLECASE_LETTER) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_LM_MASK U_MASK(U_MODIFIER_LETTER) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_LO_MASK U_MASK(U_OTHER_LETTER) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_MN_MASK U_MASK(U_NON_SPACING_MARK) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_ME_MASK U_MASK(U_ENCLOSING_MARK) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_MC_MASK U_MASK(U_COMBINING_SPACING_MARK) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_ND_MASK U_MASK(U_DECIMAL_DIGIT_NUMBER) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_NL_MASK U_MASK(U_LETTER_NUMBER) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_NO_MASK U_MASK(U_OTHER_NUMBER) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_ZS_MASK U_MASK(U_SPACE_SEPARATOR) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_ZL_MASK U_MASK(U_LINE_SEPARATOR) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_ZP_MASK U_MASK(U_PARAGRAPH_SEPARATOR) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_CC_MASK U_MASK(U_CONTROL_CHAR) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_CF_MASK U_MASK(U_FORMAT_CHAR) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_CO_MASK U_MASK(U_PRIVATE_USE_CHAR) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_CS_MASK U_MASK(U_SURROGATE) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_PD_MASK U_MASK(U_DASH_PUNCTUATION) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_PS_MASK U_MASK(U_START_PUNCTUATION) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_PE_MASK U_MASK(U_END_PUNCTUATION) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_PC_MASK U_MASK(U_CONNECTOR_PUNCTUATION) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_PO_MASK U_MASK(U_OTHER_PUNCTUATION) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_SM_MASK U_MASK(U_MATH_SYMBOL) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_SC_MASK U_MASK(U_CURRENCY_SYMBOL) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_SK_MASK U_MASK(U_MODIFIER_SYMBOL) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_SO_MASK U_MASK(U_OTHER_SYMBOL) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_PI_MASK U_MASK(U_INITIAL_PUNCTUATION) /** Mask constant for a UCharCategory. @stable ICU 2.1 */ #define U_GC_PF_MASK U_MASK(U_FINAL_PUNCTUATION) /** Mask constant for multiple UCharCategory bits (L Letters). @stable ICU 2.1 */ #define U_GC_L_MASK \ (U_GC_LU_MASK|U_GC_LL_MASK|U_GC_LT_MASK|U_GC_LM_MASK|U_GC_LO_MASK) /** Mask constant for multiple UCharCategory bits (LC Cased Letters). @stable ICU 2.1 */ #define U_GC_LC_MASK \ (U_GC_LU_MASK|U_GC_LL_MASK|U_GC_LT_MASK) /** Mask constant for multiple UCharCategory bits (M Marks). @stable ICU 2.1 */ #define U_GC_M_MASK (U_GC_MN_MASK|U_GC_ME_MASK|U_GC_MC_MASK) /** Mask constant for multiple UCharCategory bits (N Numbers). @stable ICU 2.1 */ #define U_GC_N_MASK (U_GC_ND_MASK|U_GC_NL_MASK|U_GC_NO_MASK) /** Mask constant for multiple UCharCategory bits (Z Separators). @stable ICU 2.1 */ #define U_GC_Z_MASK (U_GC_ZS_MASK|U_GC_ZL_MASK|U_GC_ZP_MASK) /** Mask constant for multiple UCharCategory bits (C Others). @stable ICU 2.1 */ #define U_GC_C_MASK \ (U_GC_CN_MASK|U_GC_CC_MASK|U_GC_CF_MASK|U_GC_CO_MASK|U_GC_CS_MASK) /** Mask constant for multiple UCharCategory bits (P Punctuation). @stable ICU 2.1 */ #define U_GC_P_MASK \ (U_GC_PD_MASK|U_GC_PS_MASK|U_GC_PE_MASK|U_GC_PC_MASK|U_GC_PO_MASK| \ U_GC_PI_MASK|U_GC_PF_MASK) /** Mask constant for multiple UCharCategory bits (S Symbols). @stable ICU 2.1 */ #define U_GC_S_MASK (U_GC_SM_MASK|U_GC_SC_MASK|U_GC_SK_MASK|U_GC_SO_MASK) /** * This specifies the language directional property of a character set. * @stable ICU 2.0 */ typedef enum UCharDirection { /** See note !!. Comments of the form "EN" are read by genpname. */ /** L @stable ICU 2.0 */ U_LEFT_TO_RIGHT = 0, /** R @stable ICU 2.0 */ U_RIGHT_TO_LEFT = 1, /** EN @stable ICU 2.0 */ U_EUROPEAN_NUMBER = 2, /** ES @stable ICU 2.0 */ U_EUROPEAN_NUMBER_SEPARATOR = 3, /** ET @stable ICU 2.0 */ U_EUROPEAN_NUMBER_TERMINATOR = 4, /** AN @stable ICU 2.0 */ U_ARABIC_NUMBER = 5, /** CS @stable ICU 2.0 */ U_COMMON_NUMBER_SEPARATOR = 6, /** B @stable ICU 2.0 */ U_BLOCK_SEPARATOR = 7, /** S @stable ICU 2.0 */ U_SEGMENT_SEPARATOR = 8, /** WS @stable ICU 2.0 */ U_WHITE_SPACE_NEUTRAL = 9, /** ON @stable ICU 2.0 */ U_OTHER_NEUTRAL = 10, /** LRE @stable ICU 2.0 */ U_LEFT_TO_RIGHT_EMBEDDING = 11, /** LRO @stable ICU 2.0 */ U_LEFT_TO_RIGHT_OVERRIDE = 12, /** AL @stable ICU 2.0 */ U_RIGHT_TO_LEFT_ARABIC = 13, /** RLE @stable ICU 2.0 */ U_RIGHT_TO_LEFT_EMBEDDING = 14, /** RLO @stable ICU 2.0 */ U_RIGHT_TO_LEFT_OVERRIDE = 15, /** PDF @stable ICU 2.0 */ U_POP_DIRECTIONAL_FORMAT = 16, /** NSM @stable ICU 2.0 */ U_DIR_NON_SPACING_MARK = 17, /** BN @stable ICU 2.0 */ U_BOUNDARY_NEUTRAL = 18, /** @stable ICU 2.0 */ U_CHAR_DIRECTION_COUNT } UCharDirection; /** * Constants for Unicode blocks, see the Unicode Data file Blocks.txt * @stable ICU 2.0 */ enum UBlockCode { /** New No_Block value in Unicode 4. @stable ICU 2.6 */ UBLOCK_NO_BLOCK = 0, /*[none]*/ /* Special range indicating No_Block */ /** @stable ICU 2.0 */ UBLOCK_BASIC_LATIN = 1, /*[0000]*/ /*See note !!*/ /** @stable ICU 2.0 */ UBLOCK_LATIN_1_SUPPLEMENT=2, /*[0080]*/ /** @stable ICU 2.0 */ UBLOCK_LATIN_EXTENDED_A =3, /*[0100]*/ /** @stable ICU 2.0 */ UBLOCK_LATIN_EXTENDED_B =4, /*[0180]*/ /** @stable ICU 2.0 */ UBLOCK_IPA_EXTENSIONS =5, /*[0250]*/ /** @stable ICU 2.0 */ UBLOCK_SPACING_MODIFIER_LETTERS =6, /*[02B0]*/ /** @stable ICU 2.0 */ UBLOCK_COMBINING_DIACRITICAL_MARKS =7, /*[0300]*/ /** * Unicode 3.2 renames this block to "Greek and Coptic". * @stable ICU 2.0 */ UBLOCK_GREEK =8, /*[0370]*/ /** @stable ICU 2.0 */ UBLOCK_CYRILLIC =9, /*[0400]*/ /** @stable ICU 2.0 */ UBLOCK_ARMENIAN =10, /*[0530]*/ /** @stable ICU 2.0 */ UBLOCK_HEBREW =11, /*[0590]*/ /** @stable ICU 2.0 */ UBLOCK_ARABIC =12, /*[0600]*/ /** @stable ICU 2.0 */ UBLOCK_SYRIAC =13, /*[0700]*/ /** @stable ICU 2.0 */ UBLOCK_THAANA =14, /*[0780]*/ /** @stable ICU 2.0 */ UBLOCK_DEVANAGARI =15, /*[0900]*/ /** @stable ICU 2.0 */ UBLOCK_BENGALI =16, /*[0980]*/ /** @stable ICU 2.0 */ UBLOCK_GURMUKHI =17, /*[0A00]*/ /** @stable ICU 2.0 */ UBLOCK_GUJARATI =18, /*[0A80]*/ /** @stable ICU 2.0 */ UBLOCK_ORIYA =19, /*[0B00]*/ /** @stable ICU 2.0 */ UBLOCK_TAMIL =20, /*[0B80]*/ /** @stable ICU 2.0 */ UBLOCK_TELUGU =21, /*[0C00]*/ /** @stable ICU 2.0 */ UBLOCK_KANNADA =22, /*[0C80]*/ /** @stable ICU 2.0 */ UBLOCK_MALAYALAM =23, /*[0D00]*/ /** @stable ICU 2.0 */ UBLOCK_SINHALA =24, /*[0D80]*/ /** @stable ICU 2.0 */ UBLOCK_THAI =25, /*[0E00]*/ /** @stable ICU 2.0 */ UBLOCK_LAO =26, /*[0E80]*/ /** @stable ICU 2.0 */ UBLOCK_TIBETAN =27, /*[0F00]*/ /** @stable ICU 2.0 */ UBLOCK_MYANMAR =28, /*[1000]*/ /** @stable ICU 2.0 */ UBLOCK_GEORGIAN =29, /*[10A0]*/ /** @stable ICU 2.0 */ UBLOCK_HANGUL_JAMO =30, /*[1100]*/ /** @stable ICU 2.0 */ UBLOCK_ETHIOPIC =31, /*[1200]*/ /** @stable ICU 2.0 */ UBLOCK_CHEROKEE =32, /*[13A0]*/ /** @stable ICU 2.0 */ UBLOCK_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS =33, /*[1400]*/ /** @stable ICU 2.0 */ UBLOCK_OGHAM =34, /*[1680]*/ /** @stable ICU 2.0 */ UBLOCK_RUNIC =35, /*[16A0]*/ /** @stable ICU 2.0 */ UBLOCK_KHMER =36, /*[1780]*/ /** @stable ICU 2.0 */ UBLOCK_MONGOLIAN =37, /*[1800]*/ /** @stable ICU 2.0 */ UBLOCK_LATIN_EXTENDED_ADDITIONAL =38, /*[1E00]*/ /** @stable ICU 2.0 */ UBLOCK_GREEK_EXTENDED =39, /*[1F00]*/ /** @stable ICU 2.0 */ UBLOCK_GENERAL_PUNCTUATION =40, /*[2000]*/ /** @stable ICU 2.0 */ UBLOCK_SUPERSCRIPTS_AND_SUBSCRIPTS =41, /*[2070]*/ /** @stable ICU 2.0 */ UBLOCK_CURRENCY_SYMBOLS =42, /*[20A0]*/ /** * Unicode 3.2 renames this block to "Combining Diacritical Marks for Symbols". * @stable ICU 2.0 */ UBLOCK_COMBINING_MARKS_FOR_SYMBOLS =43, /*[20D0]*/ /** @stable ICU 2.0 */ UBLOCK_LETTERLIKE_SYMBOLS =44, /*[2100]*/ /** @stable ICU 2.0 */ UBLOCK_NUMBER_FORMS =45, /*[2150]*/ /** @stable ICU 2.0 */ UBLOCK_ARROWS =46, /*[2190]*/ /** @stable ICU 2.0 */ UBLOCK_MATHEMATICAL_OPERATORS =47, /*[2200]*/ /** @stable ICU 2.0 */ UBLOCK_MISCELLANEOUS_TECHNICAL =48, /*[2300]*/ /** @stable ICU 2.0 */ UBLOCK_CONTROL_PICTURES =49, /*[2400]*/ /** @stable ICU 2.0 */ UBLOCK_OPTICAL_CHARACTER_RECOGNITION =50, /*[2440]*/ /** @stable ICU 2.0 */ UBLOCK_ENCLOSED_ALPHANUMERICS =51, /*[2460]*/ /** @stable ICU 2.0 */ UBLOCK_BOX_DRAWING =52, /*[2500]*/ /** @stable ICU 2.0 */ UBLOCK_BLOCK_ELEMENTS =53, /*[2580]*/ /** @stable ICU 2.0 */ UBLOCK_GEOMETRIC_SHAPES =54, /*[25A0]*/ /** @stable ICU 2.0 */ UBLOCK_MISCELLANEOUS_SYMBOLS =55, /*[2600]*/ /** @stable ICU 2.0 */ UBLOCK_DINGBATS =56, /*[2700]*/ /** @stable ICU 2.0 */ UBLOCK_BRAILLE_PATTERNS =57, /*[2800]*/ /** @stable ICU 2.0 */ UBLOCK_CJK_RADICALS_SUPPLEMENT =58, /*[2E80]*/ /** @stable ICU 2.0 */ UBLOCK_KANGXI_RADICALS =59, /*[2F00]*/ /** @stable ICU 2.0 */ UBLOCK_IDEOGRAPHIC_DESCRIPTION_CHARACTERS =60, /*[2FF0]*/ /** @stable ICU 2.0 */ UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION =61, /*[3000]*/ /** @stable ICU 2.0 */ UBLOCK_HIRAGANA =62, /*[3040]*/ /** @stable ICU 2.0 */ UBLOCK_KATAKANA =63, /*[30A0]*/ /** @stable ICU 2.0 */ UBLOCK_BOPOMOFO =64, /*[3100]*/ /** @stable ICU 2.0 */ UBLOCK_HANGUL_COMPATIBILITY_JAMO =65, /*[3130]*/ /** @stable ICU 2.0 */ UBLOCK_KANBUN =66, /*[3190]*/ /** @stable ICU 2.0 */ UBLOCK_BOPOMOFO_EXTENDED =67, /*[31A0]*/ /** @stable ICU 2.0 */ UBLOCK_ENCLOSED_CJK_LETTERS_AND_MONTHS =68, /*[3200]*/ /** @stable ICU 2.0 */ UBLOCK_CJK_COMPATIBILITY =69, /*[3300]*/ /** @stable ICU 2.0 */ UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A =70, /*[3400]*/ /** @stable ICU 2.0 */ UBLOCK_CJK_UNIFIED_IDEOGRAPHS =71, /*[4E00]*/ /** @stable ICU 2.0 */ UBLOCK_YI_SYLLABLES =72, /*[A000]*/ /** @stable ICU 2.0 */ UBLOCK_YI_RADICALS =73, /*[A490]*/ /** @stable ICU 2.0 */ UBLOCK_HANGUL_SYLLABLES =74, /*[AC00]*/ /** @stable ICU 2.0 */ UBLOCK_HIGH_SURROGATES =75, /*[D800]*/ /** @stable ICU 2.0 */ UBLOCK_HIGH_PRIVATE_USE_SURROGATES =76, /*[DB80]*/ /** @stable ICU 2.0 */ UBLOCK_LOW_SURROGATES =77, /*[DC00]*/ /** * Same as UBLOCK_PRIVATE_USE_AREA. * Until Unicode 3.1.1, the corresponding block name was "Private Use", * and multiple code point ranges had this block. * Unicode 3.2 renames the block for the BMP PUA to "Private Use Area" and * adds separate blocks for the supplementary PUAs. * * @stable ICU 2.0 */ UBLOCK_PRIVATE_USE = 78, /** * Same as UBLOCK_PRIVATE_USE. * Until Unicode 3.1.1, the corresponding block name was "Private Use", * and multiple code point ranges had this block. * Unicode 3.2 renames the block for the BMP PUA to "Private Use Area" and * adds separate blocks for the supplementary PUAs. * * @stable ICU 2.0 */ UBLOCK_PRIVATE_USE_AREA =UBLOCK_PRIVATE_USE, /*[E000]*/ /** @stable ICU 2.0 */ UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS =79, /*[F900]*/ /** @stable ICU 2.0 */ UBLOCK_ALPHABETIC_PRESENTATION_FORMS =80, /*[FB00]*/ /** @stable ICU 2.0 */ UBLOCK_ARABIC_PRESENTATION_FORMS_A =81, /*[FB50]*/ /** @stable ICU 2.0 */ UBLOCK_COMBINING_HALF_MARKS =82, /*[FE20]*/ /** @stable ICU 2.0 */ UBLOCK_CJK_COMPATIBILITY_FORMS =83, /*[FE30]*/ /** @stable ICU 2.0 */ UBLOCK_SMALL_FORM_VARIANTS =84, /*[FE50]*/ /** @stable ICU 2.0 */ UBLOCK_ARABIC_PRESENTATION_FORMS_B =85, /*[FE70]*/ /** @stable ICU 2.0 */ UBLOCK_SPECIALS =86, /*[FFF0]*/ /** @stable ICU 2.0 */ UBLOCK_HALFWIDTH_AND_FULLWIDTH_FORMS =87, /*[FF00]*/ /* New blocks in Unicode 3.1 */ /** @stable ICU 2.0 */ UBLOCK_OLD_ITALIC = 88 , /*[10300]*/ /** @stable ICU 2.0 */ UBLOCK_GOTHIC = 89 , /*[10330]*/ /** @stable ICU 2.0 */ UBLOCK_DESERET = 90 , /*[10400]*/ /** @stable ICU 2.0 */ UBLOCK_BYZANTINE_MUSICAL_SYMBOLS = 91 , /*[1D000]*/ /** @stable ICU 2.0 */ UBLOCK_MUSICAL_SYMBOLS = 92 , /*[1D100]*/ /** @stable ICU 2.0 */ UBLOCK_MATHEMATICAL_ALPHANUMERIC_SYMBOLS = 93 , /*[1D400]*/ /** @stable ICU 2.0 */ UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B = 94 , /*[20000]*/ /** @stable ICU 2.0 */ UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT = 95 , /*[2F800]*/ /** @stable ICU 2.0 */ UBLOCK_TAGS = 96, /*[E0000]*/ /* New blocks in Unicode 3.2 */ /** * Unicode 4.0.1 renames the "Cyrillic Supplementary" block to "Cyrillic Supplement". * @stable ICU 2.2 */ UBLOCK_CYRILLIC_SUPPLEMENTARY = 97, /** @draft ICU 3.0 */ UBLOCK_CYRILLIC_SUPPLEMENT = UBLOCK_CYRILLIC_SUPPLEMENTARY, /*[0500]*/ /** @stable ICU 2.2 */ UBLOCK_TAGALOG = 98, /*[1700]*/ /** @stable ICU 2.2 */ UBLOCK_HANUNOO = 99, /*[1720]*/ /** @stable ICU 2.2 */ UBLOCK_BUHID = 100, /*[1740]*/ /** @stable ICU 2.2 */ UBLOCK_TAGBANWA = 101, /*[1760]*/ /** @stable ICU 2.2 */ UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A = 102, /*[27C0]*/ /** @stable ICU 2.2 */ UBLOCK_SUPPLEMENTAL_ARROWS_A = 103, /*[27F0]*/ /** @stable ICU 2.2 */ UBLOCK_SUPPLEMENTAL_ARROWS_B = 104, /*[2900]*/ /** @stable ICU 2.2 */ UBLOCK_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B = 105, /*[2980]*/ /** @stable ICU 2.2 */ UBLOCK_SUPPLEMENTAL_MATHEMATICAL_OPERATORS = 106, /*[2A00]*/ /** @stable ICU 2.2 */ UBLOCK_KATAKANA_PHONETIC_EXTENSIONS = 107, /*[31F0]*/ /** @stable ICU 2.2 */ UBLOCK_VARIATION_SELECTORS = 108, /*[FE00]*/ /** @stable ICU 2.2 */ UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_A = 109, /*[F0000]*/ /** @stable ICU 2.2 */ UBLOCK_SUPPLEMENTARY_PRIVATE_USE_AREA_B = 110, /*[100000]*/ /* New blocks in Unicode 4 */ /** @stable ICU 2.6 */ UBLOCK_LIMBU = 111, /*[1900]*/ /** @stable ICU 2.6 */ UBLOCK_TAI_LE = 112, /*[1950]*/ /** @stable ICU 2.6 */ UBLOCK_KHMER_SYMBOLS = 113, /*[19E0]*/ /** @stable ICU 2.6 */ UBLOCK_PHONETIC_EXTENSIONS = 114, /*[1D00]*/ /** @stable ICU 2.6 */ UBLOCK_MISCELLANEOUS_SYMBOLS_AND_ARROWS = 115, /*[2B00]*/ /** @stable ICU 2.6 */ UBLOCK_YIJING_HEXAGRAM_SYMBOLS = 116, /*[4DC0]*/ /** @stable ICU 2.6 */ UBLOCK_LINEAR_B_SYLLABARY = 117, /*[10000]*/ /** @stable ICU 2.6 */ UBLOCK_LINEAR_B_IDEOGRAMS = 118, /*[10080]*/ /** @stable ICU 2.6 */ UBLOCK_AEGEAN_NUMBERS = 119, /*[10100]*/ /** @stable ICU 2.6 */ UBLOCK_UGARITIC = 120, /*[10380]*/ /** @stable ICU 2.6 */ UBLOCK_SHAVIAN = 121, /*[10450]*/ /** @stable ICU 2.6 */ UBLOCK_OSMANYA = 122, /*[10480]*/ /** @stable ICU 2.6 */ UBLOCK_CYPRIOT_SYLLABARY = 123, /*[10800]*/ /** @stable ICU 2.6 */ UBLOCK_TAI_XUAN_JING_SYMBOLS = 124, /*[1D300]*/ /** @stable ICU 2.6 */ UBLOCK_VARIATION_SELECTORS_SUPPLEMENT = 125, /*[E0100]*/ /** @stable ICU 2.0 */ UBLOCK_COUNT, /** @stable ICU 2.0 */ UBLOCK_INVALID_CODE=-1 }; /** @stable ICU 2.0 */ typedef enum UBlockCode UBlockCode; /** * East Asian Width constants. * * @see UCHAR_EAST_ASIAN_WIDTH * @see u_getIntPropertyValue * @stable ICU 2.2 */ typedef enum UEastAsianWidth { U_EA_NEUTRAL, /*[N]*/ /*See note !!*/ U_EA_AMBIGUOUS, /*[A]*/ U_EA_HALFWIDTH, /*[H]*/ U_EA_FULLWIDTH, /*[F]*/ U_EA_NARROW, /*[Na]*/ U_EA_WIDE, /*[W]*/ U_EA_COUNT } UEastAsianWidth; /* * Implementation note: * Keep UEastAsianWidth constant values in sync with names list in genprops/props2.c. */ /** * Selector constants for u_charName(). * u_charName() returns the "modern" name of a * Unicode character; or the name that was defined in * Unicode version 1.0, before the Unicode standard merged * with ISO-10646; or an "extended" name that gives each * Unicode code point a unique name. * * @see u_charName * @stable ICU 2.0 */ typedef enum UCharNameChoice { U_UNICODE_CHAR_NAME, U_UNICODE_10_CHAR_NAME, U_EXTENDED_CHAR_NAME, U_CHAR_NAME_CHOICE_COUNT } UCharNameChoice; /** * Selector constants for u_getPropertyName() and * u_getPropertyValueName(). These selectors are used to choose which * name is returned for a given property or value. All properties and * values have a long name. Most have a short name, but some do not. * Unicode allows for additional names, beyond the long and short * name, which would be indicated by U_LONG_PROPERTY_NAME + i, where * i=1, 2,... * * @see u_getPropertyName() * @see u_getPropertyValueName() * @stable ICU 2.4 */ typedef enum UPropertyNameChoice { U_SHORT_PROPERTY_NAME, U_LONG_PROPERTY_NAME, U_PROPERTY_NAME_CHOICE_COUNT } UPropertyNameChoice; /** * Decomposition Type constants. * * @see UCHAR_DECOMPOSITION_TYPE * @stable ICU 2.2 */ typedef enum UDecompositionType { U_DT_NONE, /*[none]*/ /*See note !!*/ U_DT_CANONICAL, /*[can]*/ U_DT_COMPAT, /*[com]*/ U_DT_CIRCLE, /*[enc]*/ U_DT_FINAL, /*[fin]*/ U_DT_FONT, /*[font]*/ U_DT_FRACTION, /*[fra]*/ U_DT_INITIAL, /*[init]*/ U_DT_ISOLATED, /*[iso]*/ U_DT_MEDIAL, /*[med]*/ U_DT_NARROW, /*[nar]*/ U_DT_NOBREAK, /*[nb]*/ U_DT_SMALL, /*[sml]*/ U_DT_SQUARE, /*[sqr]*/ U_DT_SUB, /*[sub]*/ U_DT_SUPER, /*[sup]*/ U_DT_VERTICAL, /*[vert]*/ U_DT_WIDE, /*[wide]*/ U_DT_COUNT /* 18 */ } UDecompositionType; /** * Joining Type constants. * * @see UCHAR_JOINING_TYPE * @stable ICU 2.2 */ typedef enum UJoiningType { U_JT_NON_JOINING, /*[U]*/ /*See note !!*/ U_JT_JOIN_CAUSING, /*[C]*/ U_JT_DUAL_JOINING, /*[D]*/ U_JT_LEFT_JOINING, /*[L]*/ U_JT_RIGHT_JOINING, /*[R]*/ U_JT_TRANSPARENT, /*[T]*/ U_JT_COUNT /* 6 */ } UJoiningType; /** * Joining Group constants. * * @see UCHAR_JOINING_GROUP * @stable ICU 2.2 */ typedef enum UJoiningGroup { U_JG_NO_JOINING_GROUP, U_JG_AIN, U_JG_ALAPH, U_JG_ALEF, U_JG_BEH, U_JG_BETH, U_JG_DAL, U_JG_DALATH_RISH, U_JG_E, U_JG_FEH, U_JG_FINAL_SEMKATH, U_JG_GAF, U_JG_GAMAL, U_JG_HAH, U_JG_HAMZA_ON_HEH_GOAL, U_JG_HE, U_JG_HEH, U_JG_HEH_GOAL, U_JG_HETH, U_JG_KAF, U_JG_KAPH, U_JG_KNOTTED_HEH, U_JG_LAM, U_JG_LAMADH, U_JG_MEEM, U_JG_MIM, U_JG_NOON, U_JG_NUN, U_JG_PE, U_JG_QAF, U_JG_QAPH, U_JG_REH, U_JG_REVERSED_PE, U_JG_SAD, U_JG_SADHE, U_JG_SEEN, U_JG_SEMKATH, U_JG_SHIN, U_JG_SWASH_KAF, U_JG_SYRIAC_WAW, U_JG_TAH, U_JG_TAW, U_JG_TEH_MARBUTA, U_JG_TETH, U_JG_WAW, U_JG_YEH, U_JG_YEH_BARREE, U_JG_YEH_WITH_TAIL, U_JG_YUDH, U_JG_YUDH_HE, U_JG_ZAIN, U_JG_FE, /**< @stable ICU 2.6 */ U_JG_KHAPH, /**< @stable ICU 2.6 */ U_JG_ZHAIN, /**< @stable ICU 2.6 */ U_JG_COUNT } UJoiningGroup; /** * Line Break constants. * * @see UCHAR_LINE_BREAK * @stable ICU 2.2 */ typedef enum ULineBreak { U_LB_UNKNOWN, /*[XX]*/ /*See note !!*/ U_LB_AMBIGUOUS, /*[AI]*/ U_LB_ALPHABETIC, /*[AL]*/ U_LB_BREAK_BOTH, /*[B2]*/ U_LB_BREAK_AFTER, /*[BA]*/ U_LB_BREAK_BEFORE, /*[BB]*/ U_LB_MANDATORY_BREAK, /*[BK]*/ U_LB_CONTINGENT_BREAK, /*[CB]*/ U_LB_CLOSE_PUNCTUATION, /*[CL]*/ U_LB_COMBINING_MARK, /*[CM]*/ U_LB_CARRIAGE_RETURN, /*[CR]*/ U_LB_EXCLAMATION, /*[EX]*/ U_LB_GLUE, /*[GL]*/ U_LB_HYPHEN, /*[HY]*/ U_LB_IDEOGRAPHIC, /*[ID]*/ U_LB_INSEPERABLE, /** Renamed from the misspelled "inseperable" in Unicode 4.0.1/ICU 3.0 @draft ICU 3.0 */ U_LB_INSEPARABLE=U_LB_INSEPERABLE,/*[IN]*/ U_LB_INFIX_NUMERIC, /*[IS]*/ U_LB_LINE_FEED, /*[LF]*/ U_LB_NONSTARTER, /*[NS]*/ U_LB_NUMERIC, /*[NU]*/ U_LB_OPEN_PUNCTUATION, /*[OP]*/ U_LB_POSTFIX_NUMERIC, /*[PO]*/ U_LB_PREFIX_NUMERIC, /*[PR]*/ U_LB_QUOTATION, /*[QU]*/ U_LB_COMPLEX_CONTEXT, /*[SA]*/ U_LB_SURROGATE, /*[SG]*/ U_LB_SPACE, /*[SP]*/ U_LB_BREAK_SYMBOLS, /*[SY]*/ U_LB_ZWSPACE, /*[ZW]*/ U_LB_NEXT_LINE, /*[NL]*/ /* from here on: new in Unicode 4/ICU 2.6 */ U_LB_WORD_JOINER, /*[WJ]*/ U_LB_COUNT } ULineBreak; /** * Numeric Type constants. * * @see UCHAR_NUMERIC_TYPE * @stable ICU 2.2 */ typedef enum UNumericType { U_NT_NONE, /*[None]*/ /*See note !!*/ U_NT_DECIMAL, /*[de]*/ U_NT_DIGIT, /*[di]*/ U_NT_NUMERIC, /*[nu]*/ U_NT_COUNT } UNumericType; /** * Hangul Syllable Type constants. * * @see UCHAR_HANGUL_SYLLABLE_TYPE * @stable ICU 2.6 */ typedef enum UHangulSyllableType { U_HST_NOT_APPLICABLE, /*[NA]*/ /*See note !!*/ U_HST_LEADING_JAMO, /*[L]*/ U_HST_VOWEL_JAMO, /*[V]*/ U_HST_TRAILING_JAMO, /*[T]*/ U_HST_LV_SYLLABLE, /*[LV]*/ U_HST_LVT_SYLLABLE, /*[LVT]*/ U_HST_COUNT } UHangulSyllableType; /** * Check a binary Unicode property for a code point. * * Unicode, especially in version 3.2, defines many more properties than the * original set in UnicodeData.txt. * * The properties APIs are intended to reflect Unicode properties as defined * in the Unicode Character Database (UCD) and Unicode Technical Reports (UTR). * For details about the properties see http://www.unicode.org/ucd/ . * For names of Unicode properties see the UCD file PropertyAliases.txt. * * Important: If ICU is built with UCD files from Unicode versions below 3.2, * then properties marked with "new in Unicode 3.2" are not or not fully available. * * @param c Code point to test. * @param which UProperty selector constant, identifies which binary property to check. * Must be UCHAR_BINARY_START<=which=0. * True for characters with general category "Nd" (decimal digit numbers) * as well as Latin letters a-f and A-F in both ASCII and Fullwidth ASCII. * (That is, for letters with code points * 0041..0046, 0061..0066, FF21..FF26, FF41..FF46.) * * In order to narrow the definition of hexadecimal digits to only ASCII * characters, use (c<=0x7f && u_isxdigit(c)). * * This is a C/POSIX migration function. * See the comments about C/POSIX character classification functions in the * documentation at the top of this header file. * * @param c the code point to be tested * @return TRUE if the code point is a hexadecimal digit * * @stable ICU 2.6 */ U_STABLE UBool U_EXPORT2 u_isxdigit(UChar32 c); /** * Determines whether the specified code point is a punctuation character. * True for characters with general categories "P" (punctuation). * * This is a C/POSIX migration function. * See the comments about C/POSIX character classification functions in the * documentation at the top of this header file. * * @param c the code point to be tested * @return TRUE if the code point is a punctuation character * * @stable ICU 2.6 */ U_STABLE UBool U_EXPORT2 u_ispunct(UChar32 c); /** * Determines whether the specified code point is a "graphic" character * (printable, excluding spaces). * TRUE for all characters except those with general categories * "Cc" (control codes), "Cf" (format controls), "Cs" (surrogates), * "Cn" (unassigned), and "Z" (separators). * * This is a C/POSIX migration function. * See the comments about C/POSIX character classification functions in the * documentation at the top of this header file. * * @param c the code point to be tested * @return TRUE if the code point is a "graphic" character * * @stable ICU 2.6 */ U_STABLE UBool U_EXPORT2 u_isgraph(UChar32 c); /** * Determines whether the specified code point is a "blank" or "horizontal space", * a character that visibly separates words on a line. * The following are equivalent definitions: * * TRUE for Unicode White_Space characters except for "vertical space controls" * where "vertical space controls" are the following characters: * U+000A (LF) U+000B (VT) U+000C (FF) U+000D (CR) U+0085 (NEL) U+2028 (LS) U+2029 (PS) * * same as * * TRUE for U+0009 (TAB) and characters with general category "Zs" (space separators) * except Zero Width Space (ZWSP, U+200B). * * Note: There are several ICU whitespace functions; please see the uchar.h * file documentation for a detailed comparison. * * This is a C/POSIX migration function. * See the comments about C/POSIX character classification functions in the * documentation at the top of this header file. * * @param c the code point to be tested * @return TRUE if the code point is a "blank" * * @stable ICU 2.6 */ U_STABLE UBool U_EXPORT2 u_isblank(UChar32 c); /** * Determines whether the specified code point is "defined", * which usually means that it is assigned a character. * True for general categories other than "Cn" (other, not assigned), * i.e., true for all code points mentioned in UnicodeData.txt. * * Note that non-character code points (e.g., U+FDD0) are not "defined" * (they are Cn), but surrogate code points are "defined" (Cs). * * Same as java.lang.Character.isDefined(). * * @param c the code point to be tested * @return TRUE if the code point is assigned a character * * @see u_isdigit * @see u_isalpha * @see u_isalnum * @see u_isupper * @see u_islower * @see u_istitle * @stable ICU 2.0 */ U_STABLE UBool U_EXPORT2 u_isdefined(UChar32 c); /** * Determines if the specified character is a space character or not. * * Note: There are several ICU whitespace functions; please see the uchar.h * file documentation for a detailed comparison. * * This is a C/POSIX migration function. * See the comments about C/POSIX character classification functions in the * documentation at the top of this header file. * * @param c the character to be tested * @return true if the character is a space character; false otherwise. * * @see u_isJavaSpaceChar * @see u_isWhitespace * @see u_isUWhiteSpace * @stable ICU 2.0 */ U_STABLE UBool U_EXPORT2 u_isspace(UChar32 c); /** * Determine if the specified code point is a space character according to Java. * True for characters with general categories "Z" (separators), * which does not include control codes (e.g., TAB or Line Feed). * * Same as java.lang.Character.isSpaceChar(). * * Note: There are several ICU whitespace functions; please see the uchar.h * file documentation for a detailed comparison. * * @param c the code point to be tested * @return TRUE if the code point is a space character according to Character.isSpaceChar() * * @see u_isspace * @see u_isWhitespace * @see u_isUWhiteSpace * @stable ICU 2.6 */ U_STABLE UBool U_EXPORT2 u_isJavaSpaceChar(UChar32 c); /** * Determines if the specified code point is a whitespace character according to Java/ICU. * A character is considered to be a Java whitespace character if and only * if it satisfies one of the following criteria: * * - It is a Unicode separator (categories "Z"), but is not * a no-break space (U+00A0 NBSP or U+2007 Figure Space or U+202F Narrow NBSP). * - It is U+0009 HORIZONTAL TABULATION. * - It is U+000A LINE FEED. * - It is U+000B VERTICAL TABULATION. * - It is U+000C FORM FEED. * - It is U+000D CARRIAGE RETURN. * - It is U+001C FILE SEPARATOR. * - It is U+001D GROUP SEPARATOR. * - It is U+001E RECORD SEPARATOR. * - It is U+001F UNIT SEPARATOR. * - It is U+0085 NEXT LINE. * * Same as java.lang.Character.isWhitespace() except that Java omits U+0085. * * Note: There are several ICU whitespace functions; please see the uchar.h * file documentation for a detailed comparison. * * @param c the code point to be tested * @return TRUE if the code point is a whitespace character according to Java/ICU * * @see u_isspace * @see u_isJavaSpaceChar * @see u_isUWhiteSpace * @stable ICU 2.0 */ U_STABLE UBool U_EXPORT2 u_isWhitespace(UChar32 c); /** * Determines whether the specified code point is a control character * (as defined by this function). * A control character is one of the following: * - ISO 8-bit control character (U+0000..U+001f and U+007f..U+009f) * - U_CONTROL_CHAR (Cc) * - U_FORMAT_CHAR (Cf) * - U_LINE_SEPARATOR (Zl) * - U_PARAGRAPH_SEPARATOR (Zp) * * This is a C/POSIX migration function. * See the comments about C/POSIX character classification functions in the * documentation at the top of this header file. * * @param c the code point to be tested * @return TRUE if the code point is a control character * * @see UCHAR_DEFAULT_IGNORABLE_CODE_POINT * @see u_isprint * @stable ICU 2.0 */ U_STABLE UBool U_EXPORT2 u_iscntrl(UChar32 c); /** * Determines whether the specified code point is an ISO control code. * True for U+0000..U+001f and U+007f..U+009f (general category "Cc"). * * Same as java.lang.Character.isISOControl(). * * @param c the code point to be tested * @return TRUE if the code point is an ISO control code * * @see u_iscntrl * @stable ICU 2.6 */ U_STABLE UBool U_EXPORT2 u_isISOControl(UChar32 c); /** * Determines whether the specified code point is a printable character. * True for general categories other than "C" (controls). * * This is a C/POSIX migration function. * See the comments about C/POSIX character classification functions in the * documentation at the top of this header file. * * @param c the code point to be tested * @return TRUE if the code point is a printable character * * @see UCHAR_DEFAULT_IGNORABLE_CODE_POINT * @see u_iscntrl * @stable ICU 2.0 */ U_STABLE UBool U_EXPORT2 u_isprint(UChar32 c); /** * Determines whether the specified code point is a base character. * True for general categories "L" (letters), "N" (numbers), * "Mc" (spacing combining marks), and "Me" (enclosing marks). * * Note that this is different from the Unicode definition in * chapter 3.5, conformance clause D13, * which defines base characters to be all characters (not Cn) * that do not graphically combine with preceding characters (M) * and that are neither control (Cc) or format (Cf) characters. * * @param c the code point to be tested * @return TRUE if the code point is a base character according to this function * * @see u_isalpha * @see u_isdigit * @stable ICU 2.0 */ U_STABLE UBool U_EXPORT2 u_isbase(UChar32 c); /** * Returns the bidirectional category value for the code point, * which is used in the Unicode bidirectional algorithm * (UAX #9 http://www.unicode.org/reports/tr9/). * Note that some unassigned code points have bidi values * of R or AL because they are in blocks that are reserved * for Right-To-Left scripts. * * Same as java.lang.Character.getDirectionality() * * @param c the code point to be tested * @return the bidirectional category (UCharDirection) value * * @see UCharDirection * @stable ICU 2.0 */ U_STABLE UCharDirection U_EXPORT2 u_charDirection(UChar32 c); /** * Determines whether the code point has the Bidi_Mirrored property. * This property is set for characters that are commonly used in * Right-To-Left contexts and need to be displayed with a "mirrored" * glyph. * * Same as java.lang.Character.isMirrored(). * Same as UCHAR_BIDI_MIRRORED * * @param c the code point to be tested * @return TRUE if the character has the Bidi_Mirrored property * * @see UCHAR_BIDI_MIRRORED * @stable ICU 2.0 */ U_STABLE UBool U_EXPORT2 u_isMirrored(UChar32 c); /** * Maps the specified character to a "mirror-image" character. * For characters with the Bidi_Mirrored property, implementations * sometimes need a "poor man's" mapping to another Unicode * character (code point) such that the default glyph may serve * as the mirror-image of the default glyph of the specified * character. This is useful for text conversion to and from * codepages with visual order, and for displays without glyph * selecetion capabilities. * * @param c the code point to be mapped * @return another Unicode code point that may serve as a mirror-image * substitute, or c itself if there is no such mapping or c * does not have the Bidi_Mirrored property * * @see UCHAR_BIDI_MIRRORED * @see u_isMirrored * @stable ICU 2.0 */ U_STABLE UChar32 U_EXPORT2 u_charMirror(UChar32 c); /** * Returns the general category value for the code point. * * Same as java.lang.Character.getType(). * * @param c the code point to be tested * @return the general category (UCharCategory) value * * @see UCharCategory * @stable ICU 2.0 */ U_STABLE int8_t U_EXPORT2 u_charType(UChar32 c); /** * Get a single-bit bit set for the general category of a character. * This bit set can be compared bitwise with U_GC_SM_MASK, U_GC_L_MASK, etc. * Same as U_MASK(u_charType(c)). * * @param c the code point to be tested * @return a single-bit mask corresponding to the general category (UCharCategory) value * * @see u_charType * @see UCharCategory * @see U_GC_CN_MASK * @stable ICU 2.1 */ #define U_GET_GC_MASK(c) U_MASK(u_charType(c)) /** * Callback from u_enumCharTypes(), is called for each contiguous range * of code points c (where start<=cnameChoice, the character name written * into the buffer is the "modern" name or the name that was defined * in Unicode version 1.0. * The name contains only "invariant" characters * like A-Z, 0-9, space, and '-'. * Unicode 1.0 names are only retrieved if they are different from the modern * names and if the data file contains the data for them. gennames may or may * not be called with a command line option to include 1.0 names in unames.dat. * * @param code The character (code point) for which to get the name. * It must be 0<=code<=0x10ffff. * @param nameChoice Selector for which name to get. * @param buffer Destination address for copying the name. * The name will always be zero-terminated. * If there is no name, then the buffer will be set to the empty string. * @param bufferLength ==sizeof(buffer) * @param pErrorCode Pointer to a UErrorCode variable; * check for U_SUCCESS() after u_charName() * returns. * @return The length of the name, or 0 if there is no name for this character. * If the bufferLength is less than or equal to the length, then the buffer * contains the truncated name and the returned length indicates the full * length of the name. * The length does not include the zero-termination. * * @see UCharNameChoice * @see u_charFromName * @see u_enumCharNames * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_charName(UChar32 code, UCharNameChoice nameChoice, char *buffer, int32_t bufferLength, UErrorCode *pErrorCode); /** * Get the ISO 10646 comment for a character. * The ISO 10646 comment is an informative field in the Unicode Character * Database (UnicodeData.txt field 11) and is from the ISO 10646 names list. * * @param c The character (code point) for which to get the ISO comment. * It must be 0<=c<=0x10ffff. * @param dest Destination address for copying the comment. * The comment will be zero-terminated if possible. * If there is no comment, then the buffer will be set to the empty string. * @param destCapacity ==sizeof(dest) * @param pErrorCode Pointer to a UErrorCode variable; * check for U_SUCCESS() after u_getISOComment() * returns. * @return The length of the comment, or 0 if there is no comment for this character. * If the destCapacity is less than or equal to the length, then the buffer * contains the truncated name and the returned length indicates the full * length of the name. * The length does not include the zero-termination. * * @stable ICU 2.2 */ U_STABLE int32_t U_EXPORT2 u_getISOComment(UChar32 c, char *dest, int32_t destCapacity, UErrorCode *pErrorCode); /** * Find a Unicode character by its name and return its code point value. * The name is matched exactly and completely. * If the name does not correspond to a code point, pErrorCode * is set to U_INVALID_CHAR_FOUND. * A Unicode 1.0 name is matched only if it differs from the modern name. * Unicode names are all uppercase. Extended names are lowercase followed * by an uppercase hexadecimal number, and within angle brackets. * * @param nameChoice Selector for which name to match. * @param name The name to match. * @param pErrorCode Pointer to a UErrorCode variable * @return The Unicode value of the code point with the given name, * or an undefined value if there is no such code point. * * @see UCharNameChoice * @see u_charName * @see u_enumCharNames * @stable ICU 1.7 */ U_STABLE UChar32 U_EXPORT2 u_charFromName(UCharNameChoice nameChoice, const char *name, UErrorCode *pErrorCode); /** * Type of a callback function for u_enumCharNames() that gets called * for each Unicode character with the code point value and * the character name. * If such a function returns FALSE, then the enumeration is stopped. * * @param context The context pointer that was passed to u_enumCharNames(). * @param code The Unicode code point for the character with this name. * @param nameChoice Selector for which kind of names is enumerated. * @param name The character's name, zero-terminated. * @param length The length of the name. * @return TRUE if the enumeration should continue, FALSE to stop it. * * @see UCharNameChoice * @see u_enumCharNames * @stable ICU 1.7 */ typedef UBool UEnumCharNamesFn(void *context, UChar32 code, UCharNameChoice nameChoice, const char *name, int32_t length); /** * Enumerate all assigned Unicode characters between the start and limit * code points (start inclusive, limit exclusive) and call a function * for each, passing the code point value and the character name. * For Unicode 1.0 names, only those are enumerated that differ from the * modern names. * * @param start The first code point in the enumeration range. * @param limit One more than the last code point in the enumeration range * (the first one after the range). * @param fn The function that is to be called for each character name. * @param context An arbitrary pointer that is passed to the function. * @param nameChoice Selector for which kind of names to enumerate. * @param pErrorCode Pointer to a UErrorCode variable * * @see UCharNameChoice * @see UEnumCharNamesFn * @see u_charName * @see u_charFromName * @stable ICU 1.7 */ U_STABLE void U_EXPORT2 u_enumCharNames(UChar32 start, UChar32 limit, UEnumCharNamesFn *fn, void *context, UCharNameChoice nameChoice, UErrorCode *pErrorCode); /** * Return the Unicode name for a given property, as given in the * Unicode database file PropertyAliases.txt. * * In addition, this function maps the property * UCHAR_GENERAL_CATEGORY_MASK to the synthetic names "gcm" / * "General_Category_Mask". These names are not in * PropertyAliases.txt. * * @param property UProperty selector other than UCHAR_INVALID_CODE. * If out of range, NULL is returned. * * @param nameChoice selector for which name to get. If out of range, * NULL is returned. All properties have a long name. Most * have a short name, but some do not. Unicode allows for * additional names; if present these will be returned by * U_LONG_PROPERTY_NAME + i, where i=1, 2,... * * @return a pointer to the name, or NULL if either the * property or the nameChoice is out of range. If a given * nameChoice returns NULL, then all larger values of * nameChoice will return NULL, with one exception: if NULL is * returned for U_SHORT_PROPERTY_NAME, then * U_LONG_PROPERTY_NAME (and higher) may still return a * non-NULL value. The returned pointer is valid until * u_cleanup() is called. * * @see UProperty * @see UPropertyNameChoice * @stable ICU 2.4 */ U_STABLE const char* U_EXPORT2 u_getPropertyName(UProperty property, UPropertyNameChoice nameChoice); /** * Return the UProperty enum for a given property name, as specified * in the Unicode database file PropertyAliases.txt. Short, long, and * any other variants are recognized. * * In addition, this function maps the synthetic names "gcm" / * "General_Category_Mask" to the property * UCHAR_GENERAL_CATEGORY_MASK. These names are not in * PropertyAliases.txt. * * @param alias the property name to be matched. The name is compared * using "loose matching" as described in PropertyAliases.txt. * * @return a UProperty enum, or UCHAR_INVALID_CODE if the given name * does not match any property. * * @see UProperty * @stable ICU 2.4 */ U_STABLE UProperty U_EXPORT2 u_getPropertyEnum(const char* alias); /** * Return the Unicode name for a given property value, as given in the * Unicode database file PropertyValueAliases.txt. * * Note: Some of the names in PropertyValueAliases.txt can only be * retrieved using UCHAR_GENERAL_CATEGORY_MASK, not * UCHAR_GENERAL_CATEGORY. These include: "C" / "Other", "L" / * "Letter", "LC" / "Cased_Letter", "M" / "Mark", "N" / "Number", "P" * / "Punctuation", "S" / "Symbol", and "Z" / "Separator". * * @param property UProperty selector constant. * Must be UCHAR_BINARY_START<=which2<=radix<=36 or if the * value of c is not a valid digit in the specified * radix, -1 is returned. A character is a valid digit * if at least one of the following is true: *
    *
  • The character has a decimal digit value. * Such characters have the general category "Nd" (decimal digit numbers) * and a Numeric_Type of Decimal. * In this case the value is the character's decimal digit value.
  • *
  • The character is one of the uppercase Latin letters * 'A' through 'Z'. * In this case the value is c-'A'+10.
  • *
  • The character is one of the lowercase Latin letters * 'a' through 'z'. * In this case the value is ch-'a'+10.
  • *
  • Latin letters from both the ASCII range (0061..007A, 0041..005A) * as well as from the Fullwidth ASCII range (FF41..FF5A, FF21..FF3A) * are recognized.
  • *
* * Same as java.lang.Character.digit(). * * @param ch the code point to be tested. * @param radix the radix. * @return the numeric value represented by the character in the * specified radix, * or -1 if there is no value or if the value exceeds the radix. * * @see UCHAR_NUMERIC_TYPE * @see u_forDigit * @see u_charDigitValue * @see u_isdigit * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_digit(UChar32 ch, int8_t radix); /** * Determines the character representation for a specific digit in * the specified radix. If the value of radix is not a * valid radix, or the value of digit is not a valid * digit in the specified radix, the null character * (U+0000) is returned. *

* The radix argument is valid if it is greater than or * equal to 2 and less than or equal to 36. * The digit argument is valid if * 0 <= digit < radix. *

* If the digit is less than 10, then * '0' + digit is returned. Otherwise, the value * 'a' + digit - 10 is returned. * * Same as java.lang.Character.forDigit(). * * @param digit the number to convert to a character. * @param radix the radix. * @return the char representation of the specified digit * in the specified radix. * * @see u_digit * @see u_charDigitValue * @see u_isdigit * @stable ICU 2.0 */ U_STABLE UChar32 U_EXPORT2 u_forDigit(int32_t digit, int8_t radix); /** * Get the "age" of the code point. * The "age" is the Unicode version when the code point was first * designated (as a non-character or for Private Use) * or assigned a character. * This can be useful to avoid emitting code points to receiving * processes that do not accept newer characters. * The data is from the UCD file DerivedAge.txt. * * @param c The code point. * @param versionArray The Unicode version number array, to be filled in. * * @stable ICU 2.1 */ U_STABLE void U_EXPORT2 u_charAge(UChar32 c, UVersionInfo versionArray); /** * Gets the Unicode version information. * The version array is filled in with the version information * for the Unicode standard that is currently used by ICU. * For example, Unicode version 3.1.1 is represented as an array with * the values { 3, 1, 1, 0 }. * * @param versionArray an output array that will be filled in with * the Unicode version number * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 u_getUnicodeVersion(UVersionInfo versionArray); /** * Get the FC_NFKC_Closure property string for a character. * See Unicode Standard Annex #15 for details, search for "FC_NFKC_Closure" * or for "FNC": http://www.unicode.org/reports/tr15/ * * @param c The character (code point) for which to get the FC_NFKC_Closure string. * It must be 0<=c<=0x10ffff. * @param dest Destination address for copying the string. * The string will be zero-terminated if possible. * If there is no FC_NFKC_Closure string, * then the buffer will be set to the empty string. * @param destCapacity ==sizeof(dest) * @param pErrorCode Pointer to a UErrorCode variable. * @return The length of the string, or 0 if there is no FC_NFKC_Closure string for this character. * If the destCapacity is less than or equal to the length, then the buffer * contains the truncated name and the returned length indicates the full * length of the name. * The length does not include the zero-termination. * * @stable ICU 2.2 */ U_STABLE int32_t U_EXPORT2 u_getFC_NFKC_Closure(UChar32 c, UChar *dest, int32_t destCapacity, UErrorCode *pErrorCode); U_CDECL_END #endif /*_UCHAR*/ /*eof*/ WebKit/mac/icu/unicode/utf16.h0000644000175000017500000004405710360512352014432 0ustar leelee/* ******************************************************************************* * * Copyright (C) 1999-2004, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: utf16.h * encoding: US-ASCII * tab size: 8 (not used) * indentation:4 * * created on: 1999sep09 * created by: Markus W. Scherer */ /** * \file * \brief C API: 16-bit Unicode handling macros * * This file defines macros to deal with 16-bit Unicode (UTF-16) code units and strings. * utf16.h is included by utf.h after unicode/umachine.h * and some common definitions. * * For more information see utf.h and the ICU User Guide Strings chapter * (http://oss.software.ibm.com/icu/userguide/). * * Usage: * ICU coding guidelines for if() statements should be followed when using these macros. * Compound statements (curly braces {}) must be used for if-else-while... * bodies and all macro statements should be terminated with semicolon. */ #ifndef __UTF16_H__ #define __UTF16_H__ /* utf.h must be included first. */ #ifndef __UTF_H__ # include "unicode/utf.h" #endif /* single-code point definitions -------------------------------------------- */ /** * Does this code unit alone encode a code point (BMP, not a surrogate)? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_SINGLE(c) !U_IS_SURROGATE(c) /** * Is this code unit a lead surrogate (U+d800..U+dbff)? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_LEAD(c) (((c)&0xfffffc00)==0xd800) /** * Is this code unit a trail surrogate (U+dc00..U+dfff)? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00) /** * Is this code unit a surrogate (U+d800..U+dfff)? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_SURROGATE(c) U_IS_SURROGATE(c) /** * Assuming c is a surrogate code point (U16_IS_SURROGATE(c)), * is it a lead surrogate? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0) /** * Helper constant for U16_GET_SUPPLEMENTARY. * @internal */ #define U16_SURROGATE_OFFSET ((0xd800<<10UL)+0xdc00-0x10000) /** * Get a supplementary code point value (U+10000..U+10ffff) * from its lead and trail surrogates. * The result is undefined if the input values are not * lead and trail surrogates. * * @param lead lead surrogate (U+d800..U+dbff) * @param trail trail surrogate (U+dc00..U+dfff) * @return supplementary code point (U+10000..U+10ffff) * @stable ICU 2.4 */ #define U16_GET_SUPPLEMENTARY(lead, trail) \ (((UChar32)(lead)<<10UL)+(UChar32)(trail)-U16_SURROGATE_OFFSET) /** * Get the lead surrogate (0xd800..0xdbff) for a * supplementary code point (0x10000..0x10ffff). * @param supplementary 32-bit code point (U+10000..U+10ffff) * @return lead surrogate (U+d800..U+dbff) for supplementary * @stable ICU 2.4 */ #define U16_LEAD(supplementary) (UChar)(((supplementary)>>10)+0xd7c0) /** * Get the trail surrogate (0xdc00..0xdfff) for a * supplementary code point (0x10000..0x10ffff). * @param supplementary 32-bit code point (U+10000..U+10ffff) * @return trail surrogate (U+dc00..U+dfff) for supplementary * @stable ICU 2.4 */ #define U16_TRAIL(supplementary) (UChar)(((supplementary)&0x3ff)|0xdc00) /** * How many 16-bit code units are used to encode this Unicode code point? (1 or 2) * The result is not defined if c is not a Unicode code point (U+0000..U+10ffff). * @param c 32-bit code point * @return 1 or 2 * @stable ICU 2.4 */ #define U16_LENGTH(c) ((uint32_t)(c)<=0xffff ? 1 : 2) /** * The maximum number of 16-bit code units per Unicode code point (U+0000..U+10ffff). * @return 2 * @stable ICU 2.4 */ #define U16_MAX_LENGTH 2 /** * Get a code point from a string at a random-access offset, * without changing the offset. * "Unsafe" macro, assumes well-formed UTF-16. * * The offset may point to either the lead or trail surrogate unit * for a supplementary code point, in which case the macro will read * the adjacent matching surrogate as well. * The result is undefined if the offset points to a single, unpaired surrogate. * Iteration through a string is more efficient with U16_NEXT_UNSAFE or U16_NEXT. * * @param s const UChar * string * @param i string offset * @param c output UChar32 variable * @see U16_GET * @stable ICU 2.4 */ #define U16_GET_UNSAFE(s, i, c) { \ (c)=(s)[i]; \ if(U16_IS_SURROGATE(c)) { \ if(U16_IS_SURROGATE_LEAD(c)) { \ (c)=U16_GET_SUPPLEMENTARY((c), (s)[(i)+1]); \ } else { \ (c)=U16_GET_SUPPLEMENTARY((s)[(i)-1], (c)); \ } \ } \ } /** * Get a code point from a string at a random-access offset, * without changing the offset. * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * The offset may point to either the lead or trail surrogate unit * for a supplementary code point, in which case the macro will read * the adjacent matching surrogate as well. * If the offset points to a single, unpaired surrogate, then that itself * will be returned as the code point. * Iteration through a string is more efficient with U16_NEXT_UNSAFE or U16_NEXT. * * @param s const UChar * string * @param start starting string offset (usually 0) * @param i string offset, start<=i=(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \ } \ } \ } \ } /* definitions with forward iteration --------------------------------------- */ /** * Get a code point from a string at a code point boundary offset, * and advance the offset to the next code point boundary. * (Post-incrementing forward iteration.) * "Unsafe" macro, assumes well-formed UTF-16. * * The offset may point to the lead surrogate unit * for a supplementary code point, in which case the macro will read * the following trail surrogate as well. * If the offset points to a trail surrogate, then that itself * will be returned as the code point. * The result is undefined if the offset points to a single, unpaired lead surrogate. * * @param s const UChar * string * @param i string offset * @param c output UChar32 variable * @see U16_NEXT * @stable ICU 2.4 */ #define U16_NEXT_UNSAFE(s, i, c) { \ (c)=(s)[(i)++]; \ if(U16_IS_LEAD(c)) { \ (c)=U16_GET_SUPPLEMENTARY((c), (s)[(i)++]); \ } \ } /** * Get a code point from a string at a code point boundary offset, * and advance the offset to the next code point boundary. * (Post-incrementing forward iteration.) * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * The offset may point to the lead surrogate unit * for a supplementary code point, in which case the macro will read * the following trail surrogate as well. * If the offset points to a trail surrogate or * to a single, unpaired lead surrogate, then that itself * will be returned as the code point. * * @param s const UChar * string * @param i string offset, i>10)+0xd7c0); \ (s)[(i)++]=(uint16_t)(((c)&0x3ff)|0xdc00); \ } \ } /** * Append a code point to a string, overwriting 1 or 2 code units. * The offset points to the current end of the string contents * and is advanced (post-increment). * "Safe" macro, checks for a valid code point. * If a surrogate pair is written, checks for sufficient space in the string. * If the code point is not valid or a trail surrogate does not fit, * then isError is set to TRUE. * * @param s const UChar * string buffer * @param i string offset, i>10)+0xd7c0); \ (s)[(i)++]=(uint16_t)(((c)&0x3ff)|0xdc00); \ } else /* c>0x10ffff or not enough space */ { \ (isError)=TRUE; \ } \ } /** * Advance the string offset from one code point boundary to the next. * (Post-incrementing iteration.) * "Unsafe" macro, assumes well-formed UTF-16. * * @param s const UChar * string * @param i string offset * @see U16_FWD_1 * @stable ICU 2.4 */ #define U16_FWD_1_UNSAFE(s, i) { \ if(U16_IS_LEAD((s)[(i)++])) { \ ++(i); \ } \ } /** * Advance the string offset from one code point boundary to the next. * (Post-incrementing iteration.) * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * @param s const UChar * string * @param i string offset, i0) { \ U16_FWD_1_UNSAFE(s, i); \ --__N; \ } \ } /** * Advance the string offset from one code point boundary to the n-th next one, * i.e., move forward by n code points. * (Post-incrementing iteration.) * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * @param s const UChar * string * @param i string offset, i0 && (i)<(length)) { \ U16_FWD_1(s, i, length); \ --__N; \ } \ } /** * Adjust a random-access offset to a code point boundary * at the start of a code point. * If the offset points to the trail surrogate of a surrogate pair, * then the offset is decremented. * Otherwise, it is not modified. * "Unsafe" macro, assumes well-formed UTF-16. * * @param s const UChar * string * @param i string offset * @see U16_SET_CP_START * @stable ICU 2.4 */ #define U16_SET_CP_START_UNSAFE(s, i) { \ if(U16_IS_TRAIL((s)[i])) { \ --(i); \ } \ } /** * Adjust a random-access offset to a code point boundary * at the start of a code point. * If the offset points to the trail surrogate of a surrogate pair, * then the offset is decremented. * Otherwise, it is not modified. * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * @param s const UChar * string * @param start starting string offset (usually 0) * @param i string offset, start<=i * @see U16_SET_CP_START_UNSAFE * @stable ICU 2.4 */ #define U16_SET_CP_START(s, start, i) { \ if(U16_IS_TRAIL((s)[i]) && (i)>(start) && U16_IS_LEAD((s)[(i)-1])) { \ --(i); \ } \ } /* definitions with backward iteration -------------------------------------- */ /** * Move the string offset from one code point boundary to the previous one * and get the code point between them. * (Pre-decrementing backward iteration.) * "Unsafe" macro, assumes well-formed UTF-16. * * The input offset may be the same as the string length. * If the offset is behind a trail surrogate unit * for a supplementary code point, then the macro will read * the preceding lead surrogate as well. * If the offset is behind a lead surrogate, then that itself * will be returned as the code point. * The result is undefined if the offset is behind a single, unpaired trail surrogate. * * @param s const UChar * string * @param i string offset * @param c output UChar32 variable * @see U16_PREV * @stable ICU 2.4 */ #define U16_PREV_UNSAFE(s, i, c) { \ (c)=(s)[--(i)]; \ if(U16_IS_TRAIL(c)) { \ (c)=U16_GET_SUPPLEMENTARY((s)[--(i)], (c)); \ } \ } /** * Move the string offset from one code point boundary to the previous one * and get the code point between them. * (Pre-decrementing backward iteration.) * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * The input offset may be the same as the string length. * If the offset is behind a trail surrogate unit * for a supplementary code point, then the macro will read * the preceding lead surrogate as well. * If the offset is behind a lead surrogate or behind a single, unpaired * trail surrogate, then that itself * will be returned as the code point. * * @param s const UChar * string * @param start starting string offset (usually 0) * @param i string offset, start<=i * @param c output UChar32 variable * @see U16_PREV_UNSAFE * @stable ICU 2.4 */ #define U16_PREV(s, start, i, c) { \ (c)=(s)[--(i)]; \ if(U16_IS_TRAIL(c)) { \ uint16_t __c2; \ if((i)>(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ --(i); \ (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \ } \ } \ } /** * Move the string offset from one code point boundary to the previous one. * (Pre-decrementing backward iteration.) * The input offset may be the same as the string length. * "Unsafe" macro, assumes well-formed UTF-16. * * @param s const UChar * string * @param i string offset * @see U16_BACK_1 * @stable ICU 2.4 */ #define U16_BACK_1_UNSAFE(s, i) { \ if(U16_IS_TRAIL((s)[--(i)])) { \ --(i); \ } \ } /** * Move the string offset from one code point boundary to the previous one. * (Pre-decrementing backward iteration.) * The input offset may be the same as the string length. * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * @param s const UChar * string * @param start starting string offset (usually 0) * @param i string offset, start<=i * @see U16_BACK_1_UNSAFE * @stable ICU 2.4 */ #define U16_BACK_1(s, start, i) { \ if(U16_IS_TRAIL((s)[--(i)]) && (i)>(start) && U16_IS_LEAD((s)[(i)-1])) { \ --(i); \ } \ } /** * Move the string offset from one code point boundary to the n-th one before it, * i.e., move backward by n code points. * (Pre-decrementing backward iteration.) * The input offset may be the same as the string length. * "Unsafe" macro, assumes well-formed UTF-16. * * @param s const UChar * string * @param i string offset * @param n number of code points to skip * @see U16_BACK_N * @stable ICU 2.4 */ #define U16_BACK_N_UNSAFE(s, i, n) { \ int32_t __N=(n); \ while(__N>0) { \ U16_BACK_1_UNSAFE(s, i); \ --__N; \ } \ } /** * Move the string offset from one code point boundary to the n-th one before it, * i.e., move backward by n code points. * (Pre-decrementing backward iteration.) * The input offset may be the same as the string length. * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * @param s const UChar * string * @param start start of string * @param i string offset, i0 && (i)>(start)) { \ U16_BACK_1(s, start, i); \ --__N; \ } \ } /** * Adjust a random-access offset to a code point boundary after a code point. * If the offset is behind the lead surrogate of a surrogate pair, * then the offset is incremented. * Otherwise, it is not modified. * The input offset may be the same as the string length. * "Unsafe" macro, assumes well-formed UTF-16. * * @param s const UChar * string * @param i string offset * @see U16_SET_CP_LIMIT * @stable ICU 2.4 */ #define U16_SET_CP_LIMIT_UNSAFE(s, i) { \ if(U16_IS_LEAD((s)[(i)-1])) { \ ++(i); \ } \ } /** * Adjust a random-access offset to a code point boundary after a code point. * If the offset is behind the lead surrogate of a surrogate pair, * then the offset is incremented. * Otherwise, it is not modified. * The input offset may be the same as the string length. * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * @param s const UChar * string * @param start starting string offset (usually 0) * @param i string offset, start<=i<=length * @param length string length * @see U16_SET_CP_LIMIT_UNSAFE * @stable ICU 2.4 */ #define U16_SET_CP_LIMIT(s, start, i, length) { \ if((start)<(i) && (i)<(length) && U16_IS_LEAD((s)[(i)-1]) && U16_IS_TRAIL((s)[i])) { \ ++(i); \ } \ } #endif WebKit/mac/icu/unicode/uversion.h0000644000175000017500000002016310360512352015327 0ustar leelee/* ******************************************************************************* * Copyright (C) 2000-2004, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* * * file name: uversion.h * encoding: US-ASCII * tab size: 8 (not used) * indentation:4 * * Created by: Vladimir Weinstein * * Contains all the important version numbers for ICU. * Gets included by utypes.h and Windows .rc files */ /*===========================================================================*/ /* Main ICU version information */ /*===========================================================================*/ #ifndef UVERSION_H #define UVERSION_H /** IMPORTANT: When updating version, the following things need to be done: */ /** source/common/unicode/uversion.h - this file: update major, minor, */ /** patchlevel, suffix, version, short version constants, namespace, */ /** and copyright */ /** source/common/common.dsp - update 'Output file name' on the link tab so */ /** that it contains the new major/minor combination */ /** source/i18n/i18n.dsp - same as for the common.dsp */ /** source/layout/layout.dsp - same as for the common.dsp */ /** source/stubdata/stubdata.dsp - same as for the common.dsp */ /** source/extra/ustdio/ustdio.dsp - same as for the common.dsp */ /** source/data/makedata.mak - change U_ICUDATA_NAME so that it contains */ /** the new major/minor combination */ /** source/tools/genren/genren.pl - use this script according to the README */ /** in that folder */ #include "unicode/umachine.h" /** The standard copyright notice that gets compiled into each library. * This value will change in the subsequent releases of ICU * @stable ICU 2.4 */ #define U_COPYRIGHT_STRING \ " Copyright (C) 2004, International Business Machines Corporation and others. All Rights Reserved. " /** Maximum length of the copyright string. * @stable ICU 2.4 */ #define U_COPYRIGHT_STRING_LENGTH 128 /** The current ICU major version as an integer. * This value will change in the subsequent releases of ICU * @stable ICU 2.4 */ #define U_ICU_VERSION_MAJOR_NUM 3 /** The current ICU minor version as an integer. * This value will change in the subsequent releases of ICU * @stable ICU 2.6 */ #define U_ICU_VERSION_MINOR_NUM 2 /** The current ICU patchlevel version as an integer. * This value will change in the subsequent releases of ICU * @stable ICU 2.4 */ #define U_ICU_VERSION_PATCHLEVEL_NUM 0 /** Glued version suffix for renamers * This value will change in the subsequent releases of ICU * @stable ICU 2.6 */ #define U_ICU_VERSION_SUFFIX _3_2 /** The current ICU library version as a dotted-decimal string. The patchlevel * only appears in this string if it non-zero. * This value will change in the subsequent releases of ICU * @stable ICU 2.4 */ #define U_ICU_VERSION "3.2" /** The current ICU library major/minor version as a string without dots, for library name suffixes. * This value will change in the subsequent releases of ICU * @stable ICU 2.6 */ #define U_ICU_VERSION_SHORT "32" /** An ICU version consists of up to 4 numbers from 0..255. * @stable ICU 2.4 */ #define U_MAX_VERSION_LENGTH 4 /** In a string, ICU version fields are delimited by dots. * @stable ICU 2.4 */ #define U_VERSION_DELIMITER '.' /** The maximum length of an ICU version string. * @stable ICU 2.4 */ #define U_MAX_VERSION_STRING_LENGTH 20 /** The binary form of a version on ICU APIs is an array of 4 uint8_t. * @stable ICU 2.4 */ typedef uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]; #if U_HAVE_NAMESPACE && defined(XP_CPLUSPLUS) #if U_DISABLE_RENAMING #define U_ICU_NAMESPACE icu namespace U_ICU_NAMESPACE { } #else #define U_ICU_NAMESPACE icu_3_2 namespace U_ICU_NAMESPACE { } namespace icu = U_ICU_NAMESPACE; #endif U_NAMESPACE_USE #endif /*===========================================================================*/ /* General version helper functions. Definitions in putil.c */ /*===========================================================================*/ /** * Parse a string with dotted-decimal version information and * fill in a UVersionInfo structure with the result. * Definition of this function lives in putil.c * * @param versionArray The destination structure for the version information. * @param versionString A string with dotted-decimal version information, * with up to four non-negative number fields with * values of up to 255 each. * @stable ICU 2.4 */ U_STABLE void U_EXPORT2 u_versionFromString(UVersionInfo versionArray, const char *versionString); /** * Write a string with dotted-decimal version information according * to the input UVersionInfo. * Definition of this function lives in putil.c * * @param versionArray The version information to be written as a string. * @param versionString A string buffer that will be filled in with * a string corresponding to the numeric version * information in versionArray. * The buffer size must be at least U_MAX_VERSION_STRING_LENGTH. * @stable ICU 2.4 */ U_STABLE void U_EXPORT2 u_versionToString(UVersionInfo versionArray, char *versionString); /** * Gets the ICU release version. The version array stores the version information * for ICU. For example, release "1.3.31.2" is then represented as 0x01031F02. * Definition of this function lives in putil.c * * @param versionArray the version # information, the result will be filled in * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 u_getVersion(UVersionInfo versionArray); /*=========================================================================== * ICU collation framework version information * Version info that can be obtained from a collator is affected by these * numbers in a secret and magic way. Please use collator version as whole *=========================================================================== */ /** Collation runtime version (sort key generator, strcoll). * If the version is different, sortkeys for the same string could be different * version 2 was in ICU 1.8.1. changed is: compression intervals, French secondary * compression, generating quad level always when strength is quad or more * version 4 - ICU 2.2 - tracking UCA changes, ignore completely ignorables * in contractions, ignore primary ignorables after shifted * version 5 - ICU 2.8 - changed implicit generation code * This value may change in the subsequent releases of ICU * @stable ICU 2.4 */ #define UCOL_RUNTIME_VERSION 5 /** Builder code version. When this is different, same tailoring might result * in assigning different collation elements to code points * version 2 was in ICU 1.8.1. added support for prefixes, tweaked canonical * closure. However, the tailorings should probably get same CEs assigned * version 5 - ICU 2.2 - fixed some bugs, renamed some indirect values. * version 6 - ICU 2.8 - fixed bug in builder that allowed 0xFF in primary values * Backward compatible with the old rules. * This value may change in the subsequent releases of ICU * @stable ICU 2.4 */ #define UCOL_BUILDER_VERSION 6 /** *** Removed *** Instead we use the data we read from FractionalUCA.txt * This is the version of FractionalUCA.txt tailoring rules * Version 1 was in ICU 1.8.1. Version two contains canonical closure for * supplementary code points * Version 4 in ICU 2.2, following UCA=3.1.1d6, UCD=3.2.0 * This value may change in the subsequent releases of ICU * @stable ICU 2.4 */ /*#define UCOL_FRACTIONAL_UCA_VERSION 4*/ /** This is the version of the tailorings * This value may change in the subsequent releases of ICU * @stable ICU 2.4 */ #define UCOL_TAILORINGS_VERSION 1 #endif WebKit/mac/icu/unicode/parseerr.h0000644000175000017500000000565210360512352015306 0ustar leelee/* ********************************************************************** * Copyright (C) 1999-2004, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * Date Name Description * 03/14/00 aliu Creation. * 06/27/00 aliu Change from C++ class to C struct ********************************************************************** */ #ifndef PARSEERR_H #define PARSEERR_H #include "unicode/utypes.h" /** * The capacity of the context strings in UParseError. * @stable ICU 2.0 */ enum { U_PARSE_CONTEXT_LEN = 16 }; /** * A UParseError struct is used to returned detailed information about * parsing errors. It is used by ICU parsing engines that parse long * rules, patterns, or programs, where the text being parsed is long * enough that more information than a UErrorCode is needed to * localize the error. * *

The line, offset, and context fields are optional; parsing * engines may choose not to use to use them. * *

The preContext and postContext strings include some part of the * context surrounding the error. If the source text is "let for=7" * and "for" is the error (e.g., because it is a reserved word), then * some examples of what a parser might produce are the following: * *

 * preContext   postContext
 * ""           ""            The parser does not support context
 * "let "       "=7"          Pre- and post-context only
 * "let "       "for=7"       Pre- and post-context and error text
 * ""           "for"         Error text only
 * 
* *

Examples of engines which use UParseError (or may use it in the * future) are Transliterator, RuleBasedBreakIterator, and * RegexPattern. * * @stable ICU 2.0 */ typedef struct UParseError { /** * The line on which the error occured. If the parser uses this * field, it sets it to the line number of the source text line on * which the error appears, which will be be a value >= 1. If the * parse does not support line numbers, the value will be <= 0. * @stable ICU 2.0 */ int32_t line; /** * The character offset to the error. If the line field is >= 1, * then this is the offset from the start of the line. Otherwise, * this is the offset from the start of the text. If the parser * does not support this field, it will have a value < 0. * @stable ICU 2.0 */ int32_t offset; /** * Textual context before the error. Null-terminated. The empty * string if not supported by parser. * @stable ICU 2.0 */ UChar preContext[U_PARSE_CONTEXT_LEN]; /** * The error itself and/or textual context after the error. * Null-terminated. The empty string if not supported by parser. * @stable ICU 2.0 */ UChar postContext[U_PARSE_CONTEXT_LEN]; } UParseError; #endif WebKit/mac/icu/unicode/platform.h0000644000175000017500000001634310360512352015306 0ustar leelee/* ****************************************************************************** * * Copyright (C) 1997-2004, International Business Machines * Corporation and others. All Rights Reserved. * ****************************************************************************** * * FILE NAME : platform.h * * Date Name Description * 05/13/98 nos Creation (content moved here from ptypes.h). * 03/02/99 stephen Added AS400 support. * 03/30/99 stephen Added Linux support. * 04/13/99 stephen Reworked for autoconf. ****************************************************************************** */ /* Define the platform we're on. */ #ifndef U_DARWIN #define U_DARWIN #endif /* Define whether inttypes.h is available */ #ifndef U_HAVE_INTTYPES_H #define U_HAVE_INTTYPES_H 1 #endif /* * Define what support for C++ streams is available. * If U_IOSTREAM_SOURCE is set to 199711, then is available * (1997711 is the date the ISO/IEC C++ FDIS was published), and then * one should qualify streams using the std namespace in ICU header * files. * If U_IOSTREAM_SOURCE is set to 198506, then is * available instead (198506 is the date when Stroustrup published * "An Extensible I/O Facility for C++" at the summer USENIX conference). * If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and * support for them will be silently suppressed in ICU. * */ #ifndef U_IOSTREAM_SOURCE #define U_IOSTREAM_SOURCE 199711 #endif /* Determines whether specific types are available */ #ifndef U_HAVE_INT8_T #define U_HAVE_INT8_T 1 #endif #ifndef U_HAVE_UINT8_T #define U_HAVE_UINT8_T 0 #endif #ifndef U_HAVE_INT16_T #define U_HAVE_INT16_T 1 #endif #ifndef U_HAVE_UINT16_T #define U_HAVE_UINT16_T 0 #endif #ifndef U_HAVE_INT32_T #define U_HAVE_INT32_T 1 #endif #ifndef U_HAVE_UINT32_T #define U_HAVE_UINT32_T 0 #endif #ifndef U_HAVE_INT64_T #define U_HAVE_INT64_T 1 #endif #ifndef U_HAVE_UINT64_T #define U_HAVE_UINT64_T 0 #endif /*===========================================================================*/ /* Generic data types */ /*===========================================================================*/ #include /* If your platform does not have the header, you may need to edit the typedefs below. */ #if U_HAVE_INTTYPES_H /* autoconf 2.13 sometimes can't properly find the data types in */ /* os/390 needs , but it doesn't have int8_t, and it sometimes */ /* doesn't have uint8_t depending on the OS version. */ /* So we have this work around. */ #ifdef OS390 /* The features header is needed to get (u)int64_t sometimes. */ #include #if ! U_HAVE_INT8_T typedef signed char int8_t; #endif #if !defined(__uint8_t) #define __uint8_t 1 typedef unsigned char uint8_t; #endif #endif /* OS390 */ #include #else /* U_HAVE_INTTYPES_H */ #if ! U_HAVE_INT8_T typedef signed char int8_t; #endif #if ! U_HAVE_UINT8_T typedef unsigned char uint8_t; #endif #if ! U_HAVE_INT16_T typedef signed short int16_t; #endif #if ! U_HAVE_UINT16_T typedef unsigned short uint16_t; #endif #if ! U_HAVE_INT32_T typedef signed int int32_t; #endif #if ! U_HAVE_UINT32_T typedef unsigned int uint32_t; #endif #if ! U_HAVE_INT64_T typedef signed long long int64_t; /* else we may not have a 64-bit type */ #endif #if ! U_HAVE_UINT64_T typedef unsigned long long uint64_t; /* else we may not have a 64-bit type */ #endif #endif /*===========================================================================*/ /* Compiler and environment features */ /*===========================================================================*/ /* Define whether namespace is supported */ #ifndef U_HAVE_NAMESPACE #define U_HAVE_NAMESPACE 1 #endif /* Determines the endianness of the platform It's done this way in case multiple architectures are being built at once. For example, Darwin supports fat binaries, which can be both PPC and x86 based. */ #if defined(BYTE_ORDER) && defined(BIG_ENDIAN) #define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN) #else #define U_IS_BIG_ENDIAN 1 #endif /* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */ #define ICU_USE_THREADS 1 #ifndef U_DEBUG #define U_DEBUG 0 #endif #ifndef U_RELEASE #define U_RELEASE 1 #endif /* Determine whether to disable renaming or not. This overrides the setting in umachine.h which is for all platforms. */ #ifndef U_DISABLE_RENAMING #define U_DISABLE_RENAMING 1 #endif /* Determine whether to override new and delete. */ #ifndef U_OVERRIDE_CXX_ALLOCATION #define U_OVERRIDE_CXX_ALLOCATION 1 #endif /* Determine whether to override placement new and delete for STL. */ #ifndef U_HAVE_PLACEMENT_NEW #define U_HAVE_PLACEMENT_NEW 1 #endif /* Determine whether to enable tracing. */ #ifndef U_ENABLE_TRACING #define U_ENABLE_TRACING 1 #endif /* Define the library suffix in a C syntax. */ #define U_HAVE_LIB_SUFFIX 0 #define U_LIB_SUFFIX_C_NAME #define U_LIB_SUFFIX_C_NAME_STRING "" /*===========================================================================*/ /* Character data types */ /*===========================================================================*/ #if defined(OS390) || defined(OS400) # define U_CHARSET_FAMILY 1 #endif /*===========================================================================*/ /* Information about wchar support */ /*===========================================================================*/ #define U_HAVE_WCHAR_H 1 #define U_SIZEOF_WCHAR_T 4 #define U_HAVE_WCSCPY 1 /*===========================================================================*/ /* Information about POSIX support */ /*===========================================================================*/ #define U_HAVE_NL_LANGINFO 1 #define U_HAVE_NL_LANGINFO_CODESET 1 #define U_NL_LANGINFO_CODESET CODESET #if 1 #define U_TZSET tzset #endif #if 0 #define U_TIMEZONE #endif #if 1 #define U_TZNAME tzname #endif #define U_HAVE_MMAP 1 #define U_HAVE_POPEN 1 /*===========================================================================*/ /* Symbol import-export control */ /*===========================================================================*/ #define U_EXPORT /* U_CALLCONV is releated to U_EXPORT2 */ #define U_EXPORT2 /* cygwin needs to export/import data */ #ifdef U_CYGWIN #define U_IMPORT __declspec(dllimport) #else #define U_IMPORT #endif /*===========================================================================*/ /* Code alignment and C function inlining */ /*===========================================================================*/ #ifndef U_INLINE #define U_INLINE inline #endif #define U_ALIGN_CODE(n) /*===========================================================================*/ /* Programs used by ICU code */ /*===========================================================================*/ #define U_MAKE "/usr/bin/gnumake" WebKit/mac/icu/unicode/utf8.h0000644000175000017500000004533510360512352014353 0ustar leelee/* ******************************************************************************* * * Copyright (C) 1999-2004, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: utf8.h * encoding: US-ASCII * tab size: 8 (not used) * indentation:4 * * created on: 1999sep13 * created by: Markus W. Scherer */ /** * \file * \brief C API: 8-bit Unicode handling macros * * This file defines macros to deal with 8-bit Unicode (UTF-8) code units (bytes) and strings. * utf8.h is included by utf.h after unicode/umachine.h * and some common definitions. * * For more information see utf.h and the ICU User Guide Strings chapter * (http://oss.software.ibm.com/icu/userguide/). * * Usage: * ICU coding guidelines for if() statements should be followed when using these macros. * Compound statements (curly braces {}) must be used for if-else-while... * bodies and all macro statements should be terminated with semicolon. */ #ifndef __UTF8_H__ #define __UTF8_H__ /* utf.h must be included first. */ #ifndef __UTF_H__ # include "unicode/utf.h" #endif /* internal definitions ----------------------------------------------------- */ /** * \var utf8_countTrailBytes * Internal array with numbers of trail bytes for any given byte used in * lead byte position. * @internal */ #ifdef U_UTF8_IMPL U_INTERNAL const uint8_t #elif defined(U_STATIC_IMPLEMENTATION) U_CFUNC const uint8_t #else U_CFUNC U_IMPORT const uint8_t /* U_IMPORT2? */ /*U_IMPORT*/ #endif utf8_countTrailBytes[256]; /** * Count the trail bytes for a UTF-8 lead byte. * @internal */ #define U8_COUNT_TRAIL_BYTES(leadByte) (utf8_countTrailBytes[(uint8_t)leadByte]) /** * Mask a UTF-8 lead byte, leave only the lower bits that form part of the code point value. * @internal */ #define U8_MASK_LEAD_BYTE(leadByte, countTrailBytes) ((leadByte)&=(1<<(6-(countTrailBytes)))-1) /** * Function for handling "next code point" with error-checking. * @internal */ U_INTERNAL UChar32 U_EXPORT2 utf8_nextCharSafeBody(const uint8_t *s, int32_t *pi, int32_t length, UChar32 c, UBool strict); /** * Function for handling "append code point" with error-checking. * @internal */ U_INTERNAL int32_t U_EXPORT2 utf8_appendCharSafeBody(uint8_t *s, int32_t i, int32_t length, UChar32 c, UBool *pIsError); /** * Function for handling "previous code point" with error-checking. * @internal */ U_INTERNAL UChar32 U_EXPORT2 utf8_prevCharSafeBody(const uint8_t *s, int32_t start, int32_t *pi, UChar32 c, UBool strict); /** * Function for handling "skip backward one code point" with error-checking. * @internal */ U_INTERNAL int32_t U_EXPORT2 utf8_back1SafeBody(const uint8_t *s, int32_t start, int32_t i); /* single-code point definitions -------------------------------------------- */ /** * Does this code unit (byte) encode a code point by itself (US-ASCII 0..0x7f)? * @param c 8-bit code unit (byte) * @return TRUE or FALSE * @stable ICU 2.4 */ #define U8_IS_SINGLE(c) (((c)&0x80)==0) /** * Is this code unit (byte) a UTF-8 lead byte? * @param c 8-bit code unit (byte) * @return TRUE or FALSE * @stable ICU 2.4 */ #define U8_IS_LEAD(c) ((uint8_t)((c)-0xc0)<0x3e) /** * Is this code unit (byte) a UTF-8 trail byte? * @param c 8-bit code unit (byte) * @return TRUE or FALSE * @stable ICU 2.4 */ #define U8_IS_TRAIL(c) (((c)&0xc0)==0x80) /** * How many code units (bytes) are used for the UTF-8 encoding * of this Unicode code point? * @param c 32-bit code point * @return 1..4, or 0 if c is a surrogate or not a Unicode code point * @stable ICU 2.4 */ #define U8_LENGTH(c) \ ((uint32_t)(c)<=0x7f ? 1 : \ ((uint32_t)(c)<=0x7ff ? 2 : \ ((uint32_t)(c)<=0xd7ff ? 3 : \ ((uint32_t)(c)<=0xdfff || (uint32_t)(c)>0x10ffff ? 0 : \ ((uint32_t)(c)<=0xffff ? 3 : 4)\ ) \ ) \ ) \ ) /** * The maximum number of UTF-8 code units (bytes) per Unicode code point (U+0000..U+10ffff). * @return 4 * @stable ICU 2.4 */ #define U8_MAX_LENGTH 4 /** * Get a code point from a string at a random-access offset, * without changing the offset. * The offset may point to either the lead byte or one of the trail bytes * for a code point, in which case the macro will read all of the bytes * for the code point. * The result is undefined if the offset points to an illegal UTF-8 * byte sequence. * Iteration through a string is more efficient with U8_NEXT_UNSAFE or U8_NEXT. * * @param s const uint8_t * string * @param i string offset * @param c output UChar32 variable * @see U8_GET * @stable ICU 2.4 */ #define U8_GET_UNSAFE(s, i, c) { \ int32_t _u8_get_unsafe_index=(int32_t)(i); \ U8_SET_CP_START_UNSAFE(s, _u8_get_unsafe_index); \ U8_NEXT_UNSAFE(s, _u8_get_unsafe_index, c); \ } /** * Get a code point from a string at a random-access offset, * without changing the offset. * The offset may point to either the lead byte or one of the trail bytes * for a code point, in which case the macro will read all of the bytes * for the code point. * If the offset points to an illegal UTF-8 byte sequence, then * c is set to a negative value. * Iteration through a string is more efficient with U8_NEXT_UNSAFE or U8_NEXT. * * @param s const uint8_t * string * @param start starting string offset * @param i string offset, start<=i=0x80) { \ if(U8_IS_LEAD(c)) { \ (c)=utf8_nextCharSafeBody((const uint8_t *)s, &(i), (int32_t)(length), c, -1); \ } else { \ (c)=U_SENTINEL; \ } \ } \ } /** * Append a code point to a string, overwriting 1 to 4 bytes. * The offset points to the current end of the string contents * and is advanced (post-increment). * "Unsafe" macro, assumes a valid code point and sufficient space in the string. * Otherwise, the result is undefined. * * @param s const uint8_t * string buffer * @param i string offset * @param c code point to append * @see U8_APPEND * @stable ICU 2.4 */ #define U8_APPEND_UNSAFE(s, i, c) { \ if((uint32_t)(c)<=0x7f) { \ (s)[(i)++]=(uint8_t)(c); \ } else { \ if((uint32_t)(c)<=0x7ff) { \ (s)[(i)++]=(uint8_t)(((c)>>6)|0xc0); \ } else { \ if((uint32_t)(c)<=0xffff) { \ (s)[(i)++]=(uint8_t)(((c)>>12)|0xe0); \ } else { \ (s)[(i)++]=(uint8_t)(((c)>>18)|0xf0); \ (s)[(i)++]=(uint8_t)((((c)>>12)&0x3f)|0x80); \ } \ (s)[(i)++]=(uint8_t)((((c)>>6)&0x3f)|0x80); \ } \ (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); \ } \ } /** * Append a code point to a string, overwriting 1 or 2 code units. * The offset points to the current end of the string contents * and is advanced (post-increment). * "Safe" macro, checks for a valid code point. * If a non-ASCII code point is written, checks for sufficient space in the string. * If the code point is not valid or trail bytes do not fit, * then isError is set to TRUE. * * @param s const uint8_t * string buffer * @param i string offset, i(length)) { \ __count=(uint8_t)((length)-(i)); \ } \ while(__count>0 && U8_IS_TRAIL((s)[i])) { \ ++(i); \ --__count; \ } \ } \ } /** * Advance the string offset from one code point boundary to the n-th next one, * i.e., move forward by n code points. * (Post-incrementing iteration.) * "Unsafe" macro, assumes well-formed UTF-8. * * @param s const uint8_t * string * @param i string offset * @param n number of code points to skip * @see U8_FWD_N * @stable ICU 2.4 */ #define U8_FWD_N_UNSAFE(s, i, n) { \ int32_t __N=(n); \ while(__N>0) { \ U8_FWD_1_UNSAFE(s, i); \ --__N; \ } \ } /** * Advance the string offset from one code point boundary to the n-th next one, * i.e., move forward by n code points. * (Post-incrementing iteration.) * "Safe" macro, checks for illegal sequences and for string boundaries. * * @param s const uint8_t * string * @param i string offset, i0 && (i)<(length)) { \ U8_FWD_1(s, i, length); \ --__N; \ } \ } /** * Adjust a random-access offset to a code point boundary * at the start of a code point. * If the offset points to a UTF-8 trail byte, * then the offset is moved backward to the corresponding lead byte. * Otherwise, it is not modified. * "Unsafe" macro, assumes well-formed UTF-8. * * @param s const uint8_t * string * @param i string offset * @see U8_SET_CP_START * @stable ICU 2.4 */ #define U8_SET_CP_START_UNSAFE(s, i) { \ while(U8_IS_TRAIL((s)[i])) { --(i); } \ } /** * Adjust a random-access offset to a code point boundary * at the start of a code point. * If the offset points to a UTF-8 trail byte, * then the offset is moved backward to the corresponding lead byte. * Otherwise, it is not modified. * "Safe" macro, checks for illegal sequences and for string boundaries. * * @param s const uint8_t * string * @param start starting string offset (usually 0) * @param i string offset, start<=i * @see U8_SET_CP_START_UNSAFE * @stable ICU 2.4 */ #define U8_SET_CP_START(s, start, i) { \ if(U8_IS_TRAIL((s)[(i)])) { \ (i)=utf8_back1SafeBody(s, start, (int32_t)(i)); \ } \ } /* definitions with backward iteration -------------------------------------- */ /** * Move the string offset from one code point boundary to the previous one * and get the code point between them. * (Pre-decrementing backward iteration.) * "Unsafe" macro, assumes well-formed UTF-8. * * The input offset may be the same as the string length. * If the offset is behind a multi-byte sequence, then the macro will read * the whole sequence. * If the offset is behind a lead byte, then that itself * will be returned as the code point. * The result is undefined if the offset is behind an illegal UTF-8 sequence. * * @param s const uint8_t * string * @param i string offset * @param c output UChar32 variable * @see U8_PREV * @stable ICU 2.4 */ #define U8_PREV_UNSAFE(s, i, c) { \ (c)=(s)[--(i)]; \ if(U8_IS_TRAIL(c)) { \ uint8_t __b, __count=1, __shift=6; \ \ /* c is a trail byte */ \ (c)&=0x3f; \ for(;;) { \ __b=(s)[--(i)]; \ if(__b>=0xc0) { \ U8_MASK_LEAD_BYTE(__b, __count); \ (c)|=(UChar32)__b<<__shift; \ break; \ } else { \ (c)|=(UChar32)(__b&0x3f)<<__shift; \ ++__count; \ __shift+=6; \ } \ } \ } \ } /** * Move the string offset from one code point boundary to the previous one * and get the code point between them. * (Pre-decrementing backward iteration.) * "Safe" macro, checks for illegal sequences and for string boundaries. * * The input offset may be the same as the string length. * If the offset is behind a multi-byte sequence, then the macro will read * the whole sequence. * If the offset is behind a lead byte, then that itself * will be returned as the code point. * If the offset is behind an illegal UTF-8 sequence, then c is set to a negative value. * * @param s const uint8_t * string * @param start starting string offset (usually 0) * @param i string offset, start<=i * @param c output UChar32 variable, set to <0 in case of an error * @see U8_PREV_UNSAFE * @stable ICU 2.4 */ #define U8_PREV(s, start, i, c) { \ (c)=(s)[--(i)]; \ if((c)>=0x80) { \ if((c)<=0xbf) { \ (c)=utf8_prevCharSafeBody(s, start, &(i), c, -1); \ } else { \ (c)=U_SENTINEL; \ } \ } \ } /** * Move the string offset from one code point boundary to the previous one. * (Pre-decrementing backward iteration.) * The input offset may be the same as the string length. * "Unsafe" macro, assumes well-formed UTF-8. * * @param s const uint8_t * string * @param i string offset * @see U8_BACK_1 * @stable ICU 2.4 */ #define U8_BACK_1_UNSAFE(s, i) { \ while(U8_IS_TRAIL((s)[--(i)])) {} \ } /** * Move the string offset from one code point boundary to the previous one. * (Pre-decrementing backward iteration.) * The input offset may be the same as the string length. * "Safe" macro, checks for illegal sequences and for string boundaries. * * @param s const uint8_t * string * @param start starting string offset (usually 0) * @param i string offset, start<=i * @see U8_BACK_1_UNSAFE * @stable ICU 2.4 */ #define U8_BACK_1(s, start, i) { \ if(U8_IS_TRAIL((s)[--(i)])) { \ (i)=utf8_back1SafeBody(s, start, (int32_t)(i)); \ } \ } /** * Move the string offset from one code point boundary to the n-th one before it, * i.e., move backward by n code points. * (Pre-decrementing backward iteration.) * The input offset may be the same as the string length. * "Unsafe" macro, assumes well-formed UTF-8. * * @param s const uint8_t * string * @param i string offset * @param n number of code points to skip * @see U8_BACK_N * @stable ICU 2.4 */ #define U8_BACK_N_UNSAFE(s, i, n) { \ int32_t __N=(n); \ while(__N>0) { \ U8_BACK_1_UNSAFE(s, i); \ --__N; \ } \ } /** * Move the string offset from one code point boundary to the n-th one before it, * i.e., move backward by n code points. * (Pre-decrementing backward iteration.) * The input offset may be the same as the string length. * "Safe" macro, checks for illegal sequences and for string boundaries. * * @param s const uint8_t * string * @param start index of the start of the string * @param i string offset, i0 && (i)>(start)) { \ U8_BACK_1(s, start, i); \ --__N; \ } \ } /** * Adjust a random-access offset to a code point boundary after a code point. * If the offset is behind a partial multi-byte sequence, * then the offset is incremented to behind the whole sequence. * Otherwise, it is not modified. * The input offset may be the same as the string length. * "Unsafe" macro, assumes well-formed UTF-8. * * @param s const uint8_t * string * @param i string offset * @see U8_SET_CP_LIMIT * @stable ICU 2.4 */ #define U8_SET_CP_LIMIT_UNSAFE(s, i) { \ U8_BACK_1_UNSAFE(s, i); \ U8_FWD_1_UNSAFE(s, i); \ } /** * Adjust a random-access offset to a code point boundary after a code point. * If the offset is behind a partial multi-byte sequence, * then the offset is incremented to behind the whole sequence. * Otherwise, it is not modified. * The input offset may be the same as the string length. * "Safe" macro, checks for illegal sequences and for string boundaries. * * @param s const uint8_t * string * @param start starting string offset (usually 0) * @param i string offset, start<=i<=length * @param length string length * @see U8_SET_CP_LIMIT_UNSAFE * @stable ICU 2.4 */ #define U8_SET_CP_LIMIT(s, start, i, length) { \ if((start)<(i) && (i)<(length)) { \ U8_BACK_1(s, start, i); \ U8_FWD_1(s, i, length); \ } \ } #endif WebKit/mac/icu/unicode/uiter.h0000644000175000017500000005522610360512352014615 0ustar leelee/* ******************************************************************************* * * Copyright (C) 2002-2004, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: uiter.h * encoding: US-ASCII * tab size: 8 (not used) * indentation:4 * * created on: 2002jan18 * created by: Markus W. Scherer */ #ifndef __UITER_H__ #define __UITER_H__ /** * \file * \brief C API: Unicode Character Iteration * * @see UCharIterator */ #include "unicode/utypes.h" #ifdef XP_CPLUSPLUS U_NAMESPACE_BEGIN class CharacterIterator; class Replaceable; U_NAMESPACE_END #endif U_CDECL_BEGIN struct UCharIterator; typedef struct UCharIterator UCharIterator; /**< C typedef for struct UCharIterator. @stable ICU 2.1 */ /** * Origin constants for UCharIterator.getIndex() and UCharIterator.move(). * @see UCharIteratorMove * @see UCharIterator * @stable ICU 2.1 */ typedef enum UCharIteratorOrigin { UITER_START, UITER_CURRENT, UITER_LIMIT, UITER_ZERO, UITER_LENGTH } UCharIteratorOrigin; /** Constants for UCharIterator. @stable ICU 2.6 */ enum { /** * Constant value that may be returned by UCharIteratorMove * indicating that the final UTF-16 index is not known, but that the move succeeded. * This can occur when moving relative to limit or length, or * when moving relative to the current index after a setState() * when the current UTF-16 index is not known. * * It would be very inefficient to have to count from the beginning of the text * just to get the current/limit/length index after moving relative to it. * The actual index can be determined with getIndex(UITER_CURRENT) * which will count the UChars if necessary. * * @stable ICU 2.6 */ UITER_UNKNOWN_INDEX=-2 }; /** * Constant for UCharIterator getState() indicating an error or * an unknown state. * Returned by uiter_getState()/UCharIteratorGetState * when an error occurs. * Also, some UCharIterator implementations may not be able to return * a valid state for each position. This will be clearly documented * for each such iterator (none of the public ones here). * * @stable ICU 2.6 */ #define UITER_NO_STATE ((uint32_t)0xffffffff) /** * Function type declaration for UCharIterator.getIndex(). * * Gets the current position, or the start or limit of the * iteration range. * * This function may perform slowly for UITER_CURRENT after setState() was called, * or for UITER_LENGTH, because an iterator implementation may have to count * UChars if the underlying storage is not UTF-16. * * @param iter the UCharIterator structure ("this pointer") * @param origin get the 0, start, limit, length, or current index * @return the requested index, or U_SENTINEL in an error condition * * @see UCharIteratorOrigin * @see UCharIterator * @stable ICU 2.1 */ typedef int32_t U_CALLCONV UCharIteratorGetIndex(UCharIterator *iter, UCharIteratorOrigin origin); /** * Function type declaration for UCharIterator.move(). * * Use iter->move(iter, index, UITER_ZERO) like CharacterIterator::setIndex(index). * * Moves the current position relative to the start or limit of the * iteration range, or relative to the current position itself. * The movement is expressed in numbers of code units forward * or backward by specifying a positive or negative delta. * Out of bounds movement will be pinned to the start or limit. * * This function may perform slowly for moving relative to UITER_LENGTH * because an iterator implementation may have to count the rest of the * UChars if the native storage is not UTF-16. * * When moving relative to the limit or length, or * relative to the current position after setState() was called, * move() may return UITER_UNKNOWN_INDEX (-2) to avoid an inefficient * determination of the actual UTF-16 index. * The actual index can be determined with getIndex(UITER_CURRENT) * which will count the UChars if necessary. * See UITER_UNKNOWN_INDEX for details. * * @param iter the UCharIterator structure ("this pointer") * @param delta can be positive, zero, or negative * @param origin move relative to the 0, start, limit, length, or current index * @return the new index, or U_SENTINEL on an error condition, * or UITER_UNKNOWN_INDEX when the index is not known. * * @see UCharIteratorOrigin * @see UCharIterator * @see UITER_UNKNOWN_INDEX * @stable ICU 2.1 */ typedef int32_t U_CALLCONV UCharIteratorMove(UCharIterator *iter, int32_t delta, UCharIteratorOrigin origin); /** * Function type declaration for UCharIterator.hasNext(). * * Check if current() and next() can still * return another code unit. * * @param iter the UCharIterator structure ("this pointer") * @return boolean value for whether current() and next() can still return another code unit * * @see UCharIterator * @stable ICU 2.1 */ typedef UBool U_CALLCONV UCharIteratorHasNext(UCharIterator *iter); /** * Function type declaration for UCharIterator.hasPrevious(). * * Check if previous() can still return another code unit. * * @param iter the UCharIterator structure ("this pointer") * @return boolean value for whether previous() can still return another code unit * * @see UCharIterator * @stable ICU 2.1 */ typedef UBool U_CALLCONV UCharIteratorHasPrevious(UCharIterator *iter); /** * Function type declaration for UCharIterator.current(). * * Return the code unit at the current position, * or U_SENTINEL if there is none (index is at the limit). * * @param iter the UCharIterator structure ("this pointer") * @return the current code unit * * @see UCharIterator * @stable ICU 2.1 */ typedef UChar32 U_CALLCONV UCharIteratorCurrent(UCharIterator *iter); /** * Function type declaration for UCharIterator.next(). * * Return the code unit at the current index and increment * the index (post-increment, like s[i++]), * or return U_SENTINEL if there is none (index is at the limit). * * @param iter the UCharIterator structure ("this pointer") * @return the current code unit (and post-increment the current index) * * @see UCharIterator * @stable ICU 2.1 */ typedef UChar32 U_CALLCONV UCharIteratorNext(UCharIterator *iter); /** * Function type declaration for UCharIterator.previous(). * * Decrement the index and return the code unit from there * (pre-decrement, like s[--i]), * or return U_SENTINEL if there is none (index is at the start). * * @param iter the UCharIterator structure ("this pointer") * @return the previous code unit (after pre-decrementing the current index) * * @see UCharIterator * @stable ICU 2.1 */ typedef UChar32 U_CALLCONV UCharIteratorPrevious(UCharIterator *iter); /** * Function type declaration for UCharIterator.reservedFn(). * Reserved for future use. * * @param iter the UCharIterator structure ("this pointer") * @param something some integer argument * @return some integer * * @see UCharIterator * @stable ICU 2.1 */ typedef int32_t U_CALLCONV UCharIteratorReserved(UCharIterator *iter, int32_t something); /** * Function type declaration for UCharIterator.getState(). * * Get the "state" of the iterator in the form of a single 32-bit word. * It is recommended that the state value be calculated to be as small as * is feasible. For strings with limited lengths, fewer than 32 bits may * be sufficient. * * This is used together with setState()/UCharIteratorSetState * to save and restore the iterator position more efficiently than with * getIndex()/move(). * * The iterator state is defined as a uint32_t value because it is designed * for use in ucol_nextSortKeyPart() which provides 32 bits to store the state * of the character iterator. * * With some UCharIterator implementations (e.g., UTF-8), * getting and setting the UTF-16 index with existing functions * (getIndex(UITER_CURRENT) followed by move(pos, UITER_ZERO)) is possible but * relatively slow because the iterator has to "walk" from a known index * to the requested one. * This takes more time the farther it needs to go. * * An opaque state value allows an iterator implementation to provide * an internal index (UTF-8: the source byte array index) for * fast, constant-time restoration. * * After calling setState(), a getIndex(UITER_CURRENT) may be slow because * the UTF-16 index may not be restored as well, but the iterator can deliver * the correct text contents and move relative to the current position * without performance degradation. * * Some UCharIterator implementations may not be able to return * a valid state for each position, in which case they return UITER_NO_STATE instead. * This will be clearly documented for each such iterator (none of the public ones here). * * @param iter the UCharIterator structure ("this pointer") * @return the state word * * @see UCharIterator * @see UCharIteratorSetState * @see UITER_NO_STATE * @stable ICU 2.6 */ typedef uint32_t U_CALLCONV UCharIteratorGetState(const UCharIterator *iter); /** * Function type declaration for UCharIterator.setState(). * * Restore the "state" of the iterator using a state word from a getState() call. * The iterator object need not be the same one as for which getState() was called, * but it must be of the same type (set up using the same uiter_setXYZ function) * and it must iterate over the same string * (binary identical regardless of memory address). * For more about the state word see UCharIteratorGetState. * * After calling setState(), a getIndex(UITER_CURRENT) may be slow because * the UTF-16 index may not be restored as well, but the iterator can deliver * the correct text contents and move relative to the current position * without performance degradation. * * @param iter the UCharIterator structure ("this pointer") * @param state the state word from a getState() call * on a same-type, same-string iterator * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * * @see UCharIterator * @see UCharIteratorGetState * @stable ICU 2.6 */ typedef void U_CALLCONV UCharIteratorSetState(UCharIterator *iter, uint32_t state, UErrorCode *pErrorCode); /** * C API for code unit iteration. * This can be used as a C wrapper around * CharacterIterator, Replaceable, or implemented using simple strings, etc. * * There are two roles for using UCharIterator: * * A "provider" sets the necessary function pointers and controls the "protected" * fields of the UCharIterator structure. A "provider" passes a UCharIterator * into C APIs that need a UCharIterator as an abstract, flexible string interface. * * Implementations of such C APIs are "callers" of UCharIterator functions; * they only use the "public" function pointers and never access the "protected" * fields directly. * * The current() and next() functions only check the current index against the * limit, and previous() only checks the current index against the start, * to see if the iterator already reached the end of the iteration range. * * The assumption - in all iterators - is that the index is moved via the API, * which means it won't go out of bounds, or the index is modified by * user code that knows enough about the iterator implementation to set valid * index values. * * UCharIterator functions return code unit values 0..0xffff, * or U_SENTINEL if the iteration bounds are reached. * * @stable ICU 2.1 */ struct UCharIterator { /** * (protected) Pointer to string or wrapped object or similar. * Not used by caller. * @stable ICU 2.1 */ const void *context; /** * (protected) Length of string or similar. * Not used by caller. * @stable ICU 2.1 */ int32_t length; /** * (protected) Start index or similar. * Not used by caller. * @stable ICU 2.1 */ int32_t start; /** * (protected) Current index or similar. * Not used by caller. * @stable ICU 2.1 */ int32_t index; /** * (protected) Limit index or similar. * Not used by caller. * @stable ICU 2.1 */ int32_t limit; /** * (protected) Used by UTF-8 iterators and possibly others. * @stable ICU 2.1 */ int32_t reservedField; /** * (public) Returns the current position or the * start or limit index of the iteration range. * * @see UCharIteratorGetIndex * @stable ICU 2.1 */ UCharIteratorGetIndex *getIndex; /** * (public) Moves the current position relative to the start or limit of the * iteration range, or relative to the current position itself. * The movement is expressed in numbers of code units forward * or backward by specifying a positive or negative delta. * * @see UCharIteratorMove * @stable ICU 2.1 */ UCharIteratorMove *move; /** * (public) Check if current() and next() can still * return another code unit. * * @see UCharIteratorHasNext * @stable ICU 2.1 */ UCharIteratorHasNext *hasNext; /** * (public) Check if previous() can still return another code unit. * * @see UCharIteratorHasPrevious * @stable ICU 2.1 */ UCharIteratorHasPrevious *hasPrevious; /** * (public) Return the code unit at the current position, * or U_SENTINEL if there is none (index is at the limit). * * @see UCharIteratorCurrent * @stable ICU 2.1 */ UCharIteratorCurrent *current; /** * (public) Return the code unit at the current index and increment * the index (post-increment, like s[i++]), * or return U_SENTINEL if there is none (index is at the limit). * * @see UCharIteratorNext * @stable ICU 2.1 */ UCharIteratorNext *next; /** * (public) Decrement the index and return the code unit from there * (pre-decrement, like s[--i]), * or return U_SENTINEL if there is none (index is at the start). * * @see UCharIteratorPrevious * @stable ICU 2.1 */ UCharIteratorPrevious *previous; /** * (public) Reserved for future use. Currently NULL. * * @see UCharIteratorReserved * @stable ICU 2.1 */ UCharIteratorReserved *reservedFn; /** * (public) Return the state of the iterator, to be restored later with setState(). * This function pointer is NULL if the iterator does not implement it. * * @see UCharIteratorGet * @stable ICU 2.6 */ UCharIteratorGetState *getState; /** * (public) Restore the iterator state from the state word from a call * to getState(). * This function pointer is NULL if the iterator does not implement it. * * @see UCharIteratorSet * @stable ICU 2.6 */ UCharIteratorSetState *setState; }; /** * Helper function for UCharIterator to get the code point * at the current index. * * Return the code point that includes the code unit at the current position, * or U_SENTINEL if there is none (index is at the limit). * If the current code unit is a lead or trail surrogate, * then the following or preceding surrogate is used to form * the code point value. * * @param iter the UCharIterator structure ("this pointer") * @return the current code point * * @see UCharIterator * @see U16_GET * @see UnicodeString::char32At() * @stable ICU 2.1 */ U_STABLE UChar32 U_EXPORT2 uiter_current32(UCharIterator *iter); /** * Helper function for UCharIterator to get the next code point. * * Return the code point at the current index and increment * the index (post-increment, like s[i++]), * or return U_SENTINEL if there is none (index is at the limit). * * @param iter the UCharIterator structure ("this pointer") * @return the current code point (and post-increment the current index) * * @see UCharIterator * @see U16_NEXT * @stable ICU 2.1 */ U_STABLE UChar32 U_EXPORT2 uiter_next32(UCharIterator *iter); /** * Helper function for UCharIterator to get the previous code point. * * Decrement the index and return the code point from there * (pre-decrement, like s[--i]), * or return U_SENTINEL if there is none (index is at the start). * * @param iter the UCharIterator structure ("this pointer") * @return the previous code point (after pre-decrementing the current index) * * @see UCharIterator * @see U16_PREV * @stable ICU 2.1 */ U_STABLE UChar32 U_EXPORT2 uiter_previous32(UCharIterator *iter); /** * Get the "state" of the iterator in the form of a single 32-bit word. * This is a convenience function that calls iter->getState(iter) * if iter->getState is not NULL; * if it is NULL or any other error occurs, then UITER_NO_STATE is returned. * * Some UCharIterator implementations may not be able to return * a valid state for each position, in which case they return UITER_NO_STATE instead. * This will be clearly documented for each such iterator (none of the public ones here). * * @param iter the UCharIterator structure ("this pointer") * @return the state word * * @see UCharIterator * @see UCharIteratorGetState * @see UITER_NO_STATE * @stable ICU 2.6 */ U_STABLE uint32_t U_EXPORT2 uiter_getState(const UCharIterator *iter); /** * Restore the "state" of the iterator using a state word from a getState() call. * This is a convenience function that calls iter->setState(iter, state, pErrorCode) * if iter->setState is not NULL; if it is NULL, then U_UNSUPPORTED_ERROR is set. * * @param iter the UCharIterator structure ("this pointer") * @param state the state word from a getState() call * on a same-type, same-string iterator * @param pErrorCode Must be a valid pointer to an error code value, * which must not indicate a failure before the function call. * * @see UCharIterator * @see UCharIteratorSetState * @stable ICU 2.6 */ U_STABLE void U_EXPORT2 uiter_setState(UCharIterator *iter, uint32_t state, UErrorCode *pErrorCode); /** * Set up a UCharIterator to iterate over a string. * * Sets the UCharIterator function pointers for iteration over the string s * with iteration boundaries start=index=0 and length=limit=string length. * The "provider" may set the start, index, and limit values at any time * within the range 0..length. * The length field will be ignored. * * The string pointer s is set into UCharIterator.context without copying * or reallocating the string contents. * * getState() simply returns the current index. * move() will always return the final index. * * @param iter UCharIterator structure to be set for iteration * @param s String to iterate over * @param length Length of s, or -1 if NUL-terminated * * @see UCharIterator * @stable ICU 2.1 */ U_STABLE void U_EXPORT2 uiter_setString(UCharIterator *iter, const UChar *s, int32_t length); /** * Set up a UCharIterator to iterate over a UTF-16BE string * (byte vector with a big-endian pair of bytes per UChar). * * Everything works just like with a normal UChar iterator (uiter_setString), * except that UChars are assembled from byte pairs, * and that the length argument here indicates an even number of bytes. * * getState() simply returns the current index. * move() will always return the final index. * * @param iter UCharIterator structure to be set for iteration * @param s UTF-16BE string to iterate over * @param length Length of s as an even number of bytes, or -1 if NUL-terminated * (NUL means pair of 0 bytes at even index from s) * * @see UCharIterator * @see uiter_setString * @stable ICU 2.6 */ U_STABLE void U_EXPORT2 uiter_setUTF16BE(UCharIterator *iter, const char *s, int32_t length); /** * Set up a UCharIterator to iterate over a UTF-8 string. * * Sets the UCharIterator function pointers for iteration over the UTF-8 string s * with UTF-8 iteration boundaries 0 and length. * The implementation counts the UTF-16 index on the fly and * lazily evaluates the UTF-16 length of the text. * * The start field is used as the UTF-8 offset, the limit field as the UTF-8 length. * When the reservedField is not 0, then it contains a supplementary code point * and the UTF-16 index is between the two corresponding surrogates. * At that point, the UTF-8 index is behind that code point. * * The UTF-8 string pointer s is set into UCharIterator.context without copying * or reallocating the string contents. * * getState() returns a state value consisting of * - the current UTF-8 source byte index (bits 31..1) * - a flag (bit 0) that indicates whether the UChar position is in the middle * of a surrogate pair * (from a 4-byte UTF-8 sequence for the corresponding supplementary code point) * * getState() cannot also encode the UTF-16 index in the state value. * move(relative to limit or length), or * move(relative to current) after setState(), may return UITER_UNKNOWN_INDEX. * * @param iter UCharIterator structure to be set for iteration * @param s UTF-8 string to iterate over * @param length Length of s in bytes, or -1 if NUL-terminated * * @see UCharIterator * @stable ICU 2.6 */ U_STABLE void U_EXPORT2 uiter_setUTF8(UCharIterator *iter, const char *s, int32_t length); #ifdef XP_CPLUSPLUS /** * Set up a UCharIterator to wrap around a C++ CharacterIterator. * * Sets the UCharIterator function pointers for iteration using the * CharacterIterator charIter. * * The CharacterIterator pointer charIter is set into UCharIterator.context * without copying or cloning the CharacterIterator object. * The other "protected" UCharIterator fields are set to 0 and will be ignored. * The iteration index and boundaries are controlled by the CharacterIterator. * * getState() simply returns the current index. * move() will always return the final index. * * @param iter UCharIterator structure to be set for iteration * @param charIter CharacterIterator to wrap * * @see UCharIterator * @stable ICU 2.1 */ U_STABLE void U_EXPORT2 uiter_setCharacterIterator(UCharIterator *iter, CharacterIterator *charIter); /** * Set up a UCharIterator to iterate over a C++ Replaceable. * * Sets the UCharIterator function pointers for iteration over the * Replaceable rep with iteration boundaries start=index=0 and * length=limit=rep->length(). * The "provider" may set the start, index, and limit values at any time * within the range 0..length=rep->length(). * The length field will be ignored. * * The Replaceable pointer rep is set into UCharIterator.context without copying * or cloning/reallocating the Replaceable object. * * getState() simply returns the current index. * move() will always return the final index. * * @param iter UCharIterator structure to be set for iteration * @param rep Replaceable to iterate over * * @see UCharIterator * @stable ICU 2.1 */ U_STABLE void U_EXPORT2 uiter_setReplaceable(UCharIterator *iter, const Replaceable *rep); #endif U_CDECL_END #endif WebKit/mac/icu/README0000644000175000017500000000037310360512352012537 0ustar leeleeThe headers in this directory are for compiling on Mac OS X 10.4. The Mac OS X 10.4 release includes the ICU binary, but not ICU headers. For other platforms, installed ICU headers should be used rather than these. They are specific to Mac OS X 10.4. WebKit/mac/Plugins/0000755000175000017500000000000011527024244012521 5ustar leeleeWebKit/mac/Plugins/WebJavaPlugIn.h0000644000175000017500000000755310360512352015336 0ustar leelee/* * Copyright (C) 2004 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 /*! The Java plug-in adds the following additional methods to facilitate JNI access to Java VM via the plug-in. */ typedef enum { WebJNIReturnTypeInvalid = 0, WebJNIReturnTypeVoid, WebJNIReturnTypeObject, WebJNIReturnTypeBoolean, WebJNIReturnTypeByte, WebJNIReturnTypeChar, WebJNIReturnTypeShort, WebJNIReturnTypeInt, WebJNIReturnTypeLong, WebJNIReturnTypeFloat, WebJNIReturnTypeDouble } WebJNIReturnType; @interface NSObject (WebJavaPlugIn) /*! @method webPlugInGetApplet @discusssion This returns the jobject representing the java applet to the WebPlugInContainer. It should always be called from the AppKit Main Thread. This method is only implemented by the Java plug-in. */ - (jobject)webPlugInGetApplet; /*! @method webPlugInCallJava:isStatic:returnType:method:arguments:callingURL:exceptionDescription: @param object The Java instance that will receive the method call. @param isStatic A flag that indicated whether the method is a class method. @param returnType The return type of the Java method. @param method The ID of the Java method to call. @param args The arguments to use with the method invocation. @param callingURL The URL of the page that contains the JavaScript that is calling Java. @param exceptionDescription Pass in nil or the address of pointer to a string object. If any exception is thrown by Java the return value will be a description of the exception, otherwise nil. @discussion Calls to Java from native code should not make direct use of JNI. Instead they should use this method to dispatch calls to the Java VM. This is required to guarantee that the correct thread will receive the call. webPlugInCallJava:isStatic:returnType:method:arguments:callingURL:exceptionDescription: must always be called from the AppKit main thread. This method is only implemented by the Java plug-in. @result The result of the method invocation. */ - (jvalue)webPlugInCallJava:(jobject)object isStatic:(BOOL)isStatic returnType:(WebJNIReturnType)returnType method:(jmethodID)method arguments:(jvalue*)args callingURL:(NSURL *)url exceptionDescription:(NSString **)exceptionString; @end WebKit/mac/Plugins/WebPlugin.h0000644000175000017500000001352711150764637014607 0ustar leelee/* * Copyright (C) 2004 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import /*! WebPlugIn is an informal protocol that enables interaction between an application and web related plug-ins it may contain. */ @interface NSObject (WebPlugIn) /*! @method webPlugInInitialize @abstract Tell the plug-in to perform one-time initialization. @discussion This method must be only called once per instance of the plug-in object and must be called before any other methods in this protocol. */ - (void)webPlugInInitialize; /*! @method webPlugInStart @abstract Tell the plug-in to start normal operation. @discussion The plug-in usually begins drawing, playing sounds and/or animation in this method. This method must be called before calling webPlugInStop. This method may called more than once, provided that the application has already called webPlugInInitialize and that each call to webPlugInStart is followed by a call to webPlugInStop. */ - (void)webPlugInStart; /*! @method webPlugInStop @abstract Tell the plug-in to stop normal operation. @discussion webPlugInStop must be called before this method. This method may be called more than once, provided that the application has already called webPlugInInitialize and that each call to webPlugInStop is preceded by a call to webPlugInStart. */ - (void)webPlugInStop; /*! @method webPlugInDestroy @abstract Tell the plug-in perform cleanup and prepare to be deallocated. @discussion The plug-in typically releases memory and other resources in this method. If the plug-in has retained the WebPlugInContainer, it must release it in this mehthod. This method must be only called once per instance of the plug-in object. No other methods in this interface may be called after the application has called webPlugInDestroy. */ - (void)webPlugInDestroy; /*! @method webPlugInSetIsSelected: @discusssion Informs the plug-in whether or not it is selected. This is typically used to allow the plug-in to alter it's appearance when selected. */ - (void)webPlugInSetIsSelected:(BOOL)isSelected; /*! @method objectForWebScript @discussion objectForWebScript is used to expose a plug-in's scripting interface. The methods of the object are exposed to the script environment. See the WebScripting informal protocol for more details. @result Returns the object that exposes the plug-in's interface. The class of this object can implement methods from the WebScripting informal protocol. */ - (id)objectForWebScript; /*! @method webPlugInMainResourceDidReceiveResponse: @abstract Called on the plug-in when WebKit receives -connection:didReceiveResponse: for the plug-in's main resource. @discussion This method is only sent to the plug-in if the WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO. */ - (void)webPlugInMainResourceDidReceiveResponse:(NSURLResponse *)response WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0); /*! @method webPlugInMainResourceDidReceiveData: @abstract Called on the plug-in when WebKit recieves -connection:didReceiveData: for the plug-in's main resource. @discussion This method is only sent to the plug-in if the WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO. */ - (void)webPlugInMainResourceDidReceiveData:(NSData *)data WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0); /*! @method webPlugInMainResourceDidFailWithError: @abstract Called on the plug-in when WebKit receives -connection:didFailWithError: for the plug-in's main resource. @discussion This method is only sent to the plug-in if the WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO. */ - (void)webPlugInMainResourceDidFailWithError:(NSError *)error WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0); /*! @method webPlugInMainResourceDidFinishLoading @abstract Called on the plug-in when WebKit receives -connectionDidFinishLoading: for the plug-in's main resource. @discussion This method is only sent to the plug-in if the WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO. */ - (void)webPlugInMainResourceDidFinishLoading WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0); @end WebKit/mac/Plugins/npapi.mm0000644000175000017500000002027111203324471014161 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) #import #import "WebNetscapePluginView.h" #import "WebKitLogging.h" #import using namespace WebCore; WebNetscapePluginView *pluginViewForInstance(NPP instance); // general plug-in to browser functions void* NPN_MemAlloc(uint32 size) { return malloc(size); } void NPN_MemFree(void* ptr) { free(ptr); } uint32 NPN_MemFlush(uint32 size) { LOG(Plugins, "NPN_MemFlush"); return size; } void NPN_ReloadPlugins(NPBool reloadPages) { LOG(Plugins, "NPN_ReloadPlugins"); } NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) { LOG(Plugins, "NPN_RequestRead"); return NPERR_GENERIC_ERROR; } // instance-specific functions // The plugin view is always the ndata of the instance. Sometimes, plug-ins will call an instance-specific function // with a NULL instance. To workaround this, call the last plug-in view that made a call to a plug-in. // Currently, the current plug-in view is only set before NPP_New in [WebNetscapePluginView start]. // This specifically works around Flash and Shockwave. When we call NPP_New, they call NPN_UserAgent with a NULL instance. WebNetscapePluginView *pluginViewForInstance(NPP instance) { if (instance && instance->ndata) return (WebNetscapePluginView *)instance->ndata; else return [WebNetscapePluginView currentPluginView]; } NPError NPN_GetURLNotify(NPP instance, const char* URL, const char* target, void* notifyData) { return [pluginViewForInstance(instance) getURLNotify:URL target:target notifyData:notifyData]; } NPError NPN_GetURL(NPP instance, const char* URL, const char* target) { return [pluginViewForInstance(instance) getURL:URL target:target]; } NPError NPN_PostURLNotify(NPP instance, const char* URL, const char* target, uint32 len, const char* buf, NPBool file, void* notifyData) { return [pluginViewForInstance(instance) postURLNotify:URL target:target len:len buf:buf file:file notifyData:notifyData]; } NPError NPN_PostURL(NPP instance, const char* URL, const char* target, uint32 len, const char* buf, NPBool file) { return [pluginViewForInstance(instance) postURL:URL target:target len:len buf:buf file:file]; } NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream) { return [pluginViewForInstance(instance) newStream:type target:target stream:stream]; } int32 NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer) { return [pluginViewForInstance(instance) write:stream len:len buffer:buffer]; } NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason) { return [pluginViewForInstance(instance) destroyStream:stream reason:reason]; } const char* NPN_UserAgent(NPP instance) { return [pluginViewForInstance(instance) userAgent]; } void NPN_Status(NPP instance, const char* message) { [pluginViewForInstance(instance) status:message]; } void NPN_InvalidateRect(NPP instance, NPRect *invalidRect) { [pluginViewForInstance(instance) invalidateRect:invalidRect]; } void NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion) { [pluginViewForInstance(instance) invalidateRegion:invalidRegion]; } void NPN_ForceRedraw(NPP instance) { [pluginViewForInstance(instance) forceRedraw]; } NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value) { return [pluginViewForInstance(instance) getVariable:variable value:value]; } NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value) { return [pluginViewForInstance(instance) setVariable:variable value:value]; } // Unsupported functions void* NPN_GetJavaEnv(void) { LOG(Plugins, "NPN_GetJavaEnv"); return NULL; } void* NPN_GetJavaPeer(NPP instance) { LOG(Plugins, "NPN_GetJavaPeer"); return NULL; } void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled) { } void NPN_PopPopupsEnabledState(NPP instance) { } void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userData) { PluginMainThreadScheduler::scheduler().scheduleCall(instance, func, userData); } uint32 NPN_ScheduleTimer(NPP instance, uint32 interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32 timerID)) { return [pluginViewForInstance(instance) scheduleTimerWithInterval:interval repeat:repeat timerFunc:timerFunc]; } void NPN_UnscheduleTimer(NPP instance, uint32 timerID) { [pluginViewForInstance(instance) unscheduleTimer:timerID]; } NPError NPN_PopUpContextMenu(NPP instance, NPMenu *menu) { return [pluginViewForInstance(instance) popUpContextMenu:menu]; } NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char* url, char** value, uint32* len) { return [pluginViewForInstance(instance) getVariable:variable forURL:url value:value length:len]; } NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char* url, const char* value, uint32 len) { return [pluginViewForInstance(instance) setVariable:variable forURL:url value:value length:len]; } NPError NPN_GetAuthenticationInfo(NPP instance, const char* protocol, const char* host, int32 port, const char* scheme, const char *realm, char** username, uint32* ulen, char** password, uint32* plen) { return [pluginViewForInstance(instance) getAuthenticationInfoWithProtocol:protocol host:host port:port scheme:scheme realm:realm username:username usernameLength:ulen password:password passwordLength:plen]; } NPBool NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace) { return [pluginViewForInstance(instance) convertFromX:sourceX andY:sourceY space:sourceSpace toX:destX andY:destY space:destSpace]; } uint32 WKN_CheckIfAllowedToLoadURL(NPP instance, const char* url, const char* frame, void (*callbackFunc)(NPP npp, uint32, NPBool, void*), void* context) { return [pluginViewForInstance(instance) checkIfAllowedToLoadURL:url frame:frame callbackFunc:callbackFunc context:context]; } void WKN_CancelCheckIfAllowedToLoadURL(NPP instance, uint32 checkID) { [pluginViewForInstance(instance) cancelCheckIfAllowedToLoadURL:checkID]; } char* WKN_ResolveURL(NPP instance, const char* url, const char* target) { return [pluginViewForInstance(instance) resolveURL:url forTarget:target]; } #endif WebKit/mac/Plugins/WebNetscapeContainerCheckPrivate.mm0000644000175000017500000000402411224532552021410 0ustar leelee/* * Copyright (C) 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNetscapeContainerCheckPrivate.h" #import "WebNetscapePluginView.h" #if ENABLE(NETSCAPE_PLUGIN_API) WKNBrowserContainerCheckFuncs *browserContainerCheckFuncs() { static WKNBrowserContainerCheckFuncs funcs = { sizeof(WKNBrowserContainerCheckFuncs), WKNVBrowserContainerCheckFuncsVersion, WKN_CheckIfAllowedToLoadURL, WKN_CancelCheckIfAllowedToLoadURL, WKN_ResolveURL }; return &funcs; } #endif // ENABLE(NETSCAPE_PLUGIN_API) WebKit/mac/Plugins/WebPluginContainerPrivate.h0000644000175000017500000000441411156006132017761 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #if !defined(ENABLE_PLUGIN_PROXY_FOR_VIDEO) #define ENABLE_PLUGIN_PROXY_FOR_VIDEO 1 #endif #if ENABLE_PLUGIN_PROXY_FOR_VIDEO @class WebMediaPlayerProxy; #endif @interface NSObject (WebPlugInContainerPrivate) - (id)_webPluginContainerCheckIfAllowedToLoadRequest:(NSURLRequest *)Request inFrame:(NSString *)target resultObject:(id)obj selector:(SEL)selector; - (void)_webPluginContainerCancelCheckIfAllowedToLoadRequest:(id)checkIdentifier; #if ENABLE_PLUGIN_PROXY_FOR_VIDEO - (void)_webPluginContainerSetMediaPlayerProxy:(WebMediaPlayerProxy *)proxy forElement:(DOMElement *)element; - (void)_webPluginContainerPostMediaPlayerNotification:(int)notification forElement:(DOMElement *)element; #endif @end WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.c0000644000175000017500000000377411006467644020761 0ustar leelee/* * Copyright (C) 2006, 2007 Apple 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 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 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. */ #include "WebNetscapeDeprecatedFunctions.h" #if ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__) OSErr WebGetDiskFragment(const FSSpec *fileSpec, UInt32 offset, UInt32 length, ConstStr63Param fragName, CFragLoadOptions options, CFragConnectionID *connID, Ptr *mainAddr, Str255 errMessage) { return GetDiskFragment(fileSpec, offset, length, fragName, options, connID, mainAddr, errMessage); } OSErr WebCloseConnection(CFragConnectionID *connID) { return CloseConnection(connID); } SInt16 WebLMGetCurApRefNum(void) { return LMGetCurApRefNum(); } extern void WebLMSetCurApRefNum(SInt16 value) { LMSetCurApRefNum(value); } #endif /* ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__) */ WebKit/mac/Plugins/WebNetscapePluginView.mm0000644000175000017500000025041011242107332017262 0ustar leelee/* * Copyright (C) 2005, 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) #import "WebNetscapePluginView.h" #import "WebDataSourceInternal.h" #import "WebDefaultUIDelegate.h" #import "WebFrameInternal.h" #import "WebFrameView.h" #import "WebKitErrorsPrivate.h" #import "WebKitLogging.h" #import "WebNetscapeContainerCheckPrivate.h" #import "WebKitNSStringExtras.h" #import "WebKitSystemInterface.h" #import "WebNSDataExtras.h" #import "WebNSDictionaryExtras.h" #import "WebNSObjectExtras.h" #import "WebNSURLExtras.h" #import "WebNSURLRequestExtras.h" #import "WebNSViewExtras.h" #import "WebNetscapePluginPackage.h" #import "WebBaseNetscapePluginStream.h" #import "WebPluginContainerCheck.h" #import "WebNetscapeContainerCheckContextInfo.h" #import "WebNetscapePluginEventHandler.h" #import "WebNullPluginView.h" #import "WebPreferences.h" #import "WebPluginRequest.h" #import "WebViewInternal.h" #import "WebUIDelegatePrivate.h" #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #define LoginWindowDidSwitchFromUserNotification @"WebLoginWindowDidSwitchFromUserNotification" #define LoginWindowDidSwitchToUserNotification @"WebLoginWindowDidSwitchToUserNotification" using namespace WebCore; using namespace WebKit; using namespace std; static inline bool isDrawingModelQuickDraw(NPDrawingModel drawingModel) { #ifndef NP_NO_QUICKDRAW return drawingModel == NPDrawingModelQuickDraw; #else return false; #endif }; @interface WebNetscapePluginView (Internal) - (NPError)_createPlugin; - (void)_destroyPlugin; - (NSBitmapImageRep *)_printedPluginBitmap; - (void)_redeliverStream; - (BOOL)_shouldCancelSrcStream; @end static WebNetscapePluginView *currentPluginView = nil; typedef struct OpaquePortState* PortState; static const double ThrottledTimerInterval = 0.25; class PluginTimer : public TimerBase { public: typedef void (*TimerFunc)(NPP npp, uint32 timerID); PluginTimer(NPP npp, uint32 timerID, uint32 interval, NPBool repeat, TimerFunc timerFunc) : m_npp(npp) , m_timerID(timerID) , m_interval(interval) , m_repeat(repeat) , m_timerFunc(timerFunc) { } void start(bool throttle) { ASSERT(!isActive()); double timeInterval = m_interval / 1000.0; if (throttle) timeInterval = max(timeInterval, ThrottledTimerInterval); if (m_repeat) startRepeating(timeInterval); else startOneShot(timeInterval); } private: virtual void fired() { m_timerFunc(m_npp, m_timerID); if (!m_repeat) delete this; } NPP m_npp; uint32 m_timerID; uint32 m_interval; NPBool m_repeat; TimerFunc m_timerFunc; }; #ifndef NP_NO_QUICKDRAW // QuickDraw is not available in 64-bit typedef struct { GrafPtr oldPort; GDHandle oldDevice; Point oldOrigin; RgnHandle oldClipRegion; RgnHandle oldVisibleRegion; RgnHandle clipRegion; BOOL forUpdate; } PortState_QD; #endif /* NP_NO_QUICKDRAW */ typedef struct { CGContextRef context; } PortState_CG; @class NSTextInputContext; @interface NSResponder (AppKitDetails) - (NSTextInputContext *)inputContext; @end @interface WebNetscapePluginView (ForwardDeclarations) - (void)setWindowIfNecessary; - (NPError)loadRequest:(NSMutableURLRequest *)request inTarget:(const char *)cTarget withNotifyData:(void *)notifyData sendNotification:(BOOL)sendNotification; @end @implementation WebNetscapePluginView + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif WKSendUserChangeNotifications(); } #pragma mark EVENTS - (BOOL)superviewsHaveSuperviews { NSView *contentView = [[self window] contentView]; NSView *view; for (view = self; view != nil; view = [view superview]) { if (view == contentView) { return YES; } } return NO; } // The WindowRef created by -[NSWindow windowRef] has a QuickDraw GrafPort that covers // the entire window frame (or structure region to use the Carbon term) rather then just the window content. // We can remove this when is fixed. - (void)fixWindowPort { #ifndef NP_NO_QUICKDRAW ASSERT(isDrawingModelQuickDraw(drawingModel)); NSWindow *currentWindow = [self currentWindow]; if ([currentWindow isKindOfClass:objc_getClass("NSCarbonWindow")]) return; float windowHeight = [currentWindow frame].size.height; NSView *contentView = [currentWindow contentView]; NSRect contentRect = [contentView convertRect:[contentView frame] toView:nil]; // convert to window-relative coordinates CGrafPtr oldPort; GetPort(&oldPort); SetPort(GetWindowPort((WindowRef)[currentWindow windowRef])); MovePortTo(static_cast(contentRect.origin.x), /* Flip Y */ static_cast(windowHeight - NSMaxY(contentRect))); PortSize(static_cast(contentRect.size.width), static_cast(contentRect.size.height)); SetPort(oldPort); #endif } #ifndef NP_NO_QUICKDRAW static UInt32 getQDPixelFormatForBitmapContext(CGContextRef context) { UInt32 byteOrder = CGBitmapContextGetBitmapInfo(context) & kCGBitmapByteOrderMask; if (byteOrder == kCGBitmapByteOrderDefault) switch (CGBitmapContextGetBitsPerPixel(context)) { case 16: byteOrder = kCGBitmapByteOrder16Host; break; case 32: byteOrder = kCGBitmapByteOrder32Host; break; } switch (byteOrder) { case kCGBitmapByteOrder16Little: return k16LE555PixelFormat; case kCGBitmapByteOrder32Little: return k32BGRAPixelFormat; case kCGBitmapByteOrder16Big: return k16BE555PixelFormat; case kCGBitmapByteOrder32Big: return k32ARGBPixelFormat; } ASSERT_NOT_REACHED(); return 0; } static inline void getNPRect(const CGRect& cgr, NPRect& npr) { npr.top = static_cast(cgr.origin.y); npr.left = static_cast(cgr.origin.x); npr.bottom = static_cast(CGRectGetMaxY(cgr)); npr.right = static_cast(CGRectGetMaxX(cgr)); } #endif static inline void getNPRect(const NSRect& nr, NPRect& npr) { npr.top = static_cast(nr.origin.y); npr.left = static_cast(nr.origin.x); npr.bottom = static_cast(NSMaxY(nr)); npr.right = static_cast(NSMaxX(nr)); } - (PortState)saveAndSetNewPortStateForUpdate:(BOOL)forUpdate { ASSERT([self currentWindow] != nil); // Use AppKit to convert view coordinates to NSWindow coordinates. NSRect boundsInWindow = [self convertRect:[self bounds] toView:nil]; NSRect visibleRectInWindow = [self convertRect:[self visibleRect] toView:nil]; // Flip Y to convert NSWindow coordinates to top-left-based window coordinates. float borderViewHeight = [[self currentWindow] frame].size.height; boundsInWindow.origin.y = borderViewHeight - NSMaxY(boundsInWindow); visibleRectInWindow.origin.y = borderViewHeight - NSMaxY(visibleRectInWindow); #ifndef NP_NO_QUICKDRAW WindowRef windowRef = (WindowRef)[[self currentWindow] windowRef]; ASSERT(windowRef); // Look at the Carbon port to convert top-left-based window coordinates into top-left-based content coordinates. if (isDrawingModelQuickDraw(drawingModel)) { // If drawing with QuickDraw, fix the window port so that it has the same bounds as the NSWindow's // content view. This makes it easier to convert between AppKit view and QuickDraw port coordinates. [self fixWindowPort]; ::Rect portBounds; CGrafPtr port = GetWindowPort(windowRef); GetPortBounds(port, &portBounds); PixMap *pix = *GetPortPixMap(port); boundsInWindow.origin.x += pix->bounds.left - portBounds.left; boundsInWindow.origin.y += pix->bounds.top - portBounds.top; visibleRectInWindow.origin.x += pix->bounds.left - portBounds.left; visibleRectInWindow.origin.y += pix->bounds.top - portBounds.top; } #endif window.type = NPWindowTypeWindow; window.x = (int32)boundsInWindow.origin.x; window.y = (int32)boundsInWindow.origin.y; window.width = static_cast(NSWidth(boundsInWindow)); window.height = static_cast(NSHeight(boundsInWindow)); // "Clip-out" the plug-in when: // 1) it's not really in a window or off-screen or has no height or width. // 2) window.x is a "big negative number" which is how WebCore expresses off-screen widgets. // 3) the window is miniaturized or the app is hidden // 4) we're inside of viewWillMoveToWindow: with a nil window. In this case, superviews may already have nil // superviews and nil windows and results from convertRect:toView: are incorrect. NSWindow *realWindow = [self window]; if (window.width <= 0 || window.height <= 0 || window.x < -100000 || realWindow == nil || [realWindow isMiniaturized] || [NSApp isHidden] || ![self superviewsHaveSuperviews] || [self isHiddenOrHasHiddenAncestor]) { // The following code tries to give plug-ins the same size they will eventually have. // The specifiedWidth and specifiedHeight variables are used to predict the size that // WebCore will eventually resize us to. // The QuickTime plug-in has problems if you give it a width or height of 0. // Since other plug-ins also might have the same sort of trouble, we make sure // to always give plug-ins a size other than 0,0. if (window.width <= 0) window.width = specifiedWidth > 0 ? specifiedWidth : 100; if (window.height <= 0) window.height = specifiedHeight > 0 ? specifiedHeight : 100; window.clipRect.bottom = window.clipRect.top; window.clipRect.left = window.clipRect.right; } else { getNPRect(visibleRectInWindow, window.clipRect); } // Save the port state, set up the port for entry into the plugin PortState portState; switch (drawingModel) { #ifndef NP_NO_QUICKDRAW case NPDrawingModelQuickDraw: { // Set up NS_Port. ::Rect portBounds; CGrafPtr port = GetWindowPort(windowRef); GetPortBounds(port, &portBounds); nPort.qdPort.port = port; nPort.qdPort.portx = (int32)-boundsInWindow.origin.x; nPort.qdPort.porty = (int32)-boundsInWindow.origin.y; window.window = &nPort; PortState_QD *qdPortState = (PortState_QD*)malloc(sizeof(PortState_QD)); portState = (PortState)qdPortState; GetGWorld(&qdPortState->oldPort, &qdPortState->oldDevice); qdPortState->oldOrigin.h = portBounds.left; qdPortState->oldOrigin.v = portBounds.top; qdPortState->oldClipRegion = NewRgn(); GetPortClipRegion(port, qdPortState->oldClipRegion); qdPortState->oldVisibleRegion = NewRgn(); GetPortVisibleRegion(port, qdPortState->oldVisibleRegion); RgnHandle clipRegion = NewRgn(); qdPortState->clipRegion = clipRegion; CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; if (currentContext && WKCGContextIsBitmapContext(currentContext)) { // We use WKCGContextIsBitmapContext here, because if we just called CGBitmapContextGetData // on any context, we'd log to the console every time. But even if WKCGContextIsBitmapContext // returns true, it still might not be a context we need to create a GWorld for; for example // transparency layers will return true, but return 0 for CGBitmapContextGetData. void* offscreenData = CGBitmapContextGetData(currentContext); if (offscreenData) { // If the current context is an offscreen bitmap, then create a GWorld for it. ::Rect offscreenBounds; offscreenBounds.top = 0; offscreenBounds.left = 0; offscreenBounds.right = CGBitmapContextGetWidth(currentContext); offscreenBounds.bottom = CGBitmapContextGetHeight(currentContext); GWorldPtr newOffscreenGWorld; QDErr err = NewGWorldFromPtr(&newOffscreenGWorld, getQDPixelFormatForBitmapContext(currentContext), &offscreenBounds, 0, 0, 0, static_cast(offscreenData), CGBitmapContextGetBytesPerRow(currentContext)); ASSERT(newOffscreenGWorld && !err); if (!err) { if (offscreenGWorld) DisposeGWorld(offscreenGWorld); offscreenGWorld = newOffscreenGWorld; SetGWorld(offscreenGWorld, NULL); port = offscreenGWorld; nPort.qdPort.port = port; boundsInWindow = [self bounds]; // Generate a QD origin based on the current affine transform for currentContext. CGAffineTransform offscreenMatrix = CGContextGetCTM(currentContext); CGPoint origin = {0,0}; CGPoint axisFlip = {1,1}; origin = CGPointApplyAffineTransform(origin, offscreenMatrix); axisFlip = CGPointApplyAffineTransform(axisFlip, offscreenMatrix); // Quartz bitmaps have origins at the bottom left, but the axes may be inverted, so handle that. origin.x = offscreenBounds.left - origin.x * (axisFlip.x - origin.x); origin.y = offscreenBounds.bottom + origin.y * (axisFlip.y - origin.y); nPort.qdPort.portx = static_cast(-boundsInWindow.origin.x + origin.x); nPort.qdPort.porty = static_cast(-boundsInWindow.origin.y - origin.y); window.x = 0; window.y = 0; window.window = &nPort; // Use the clip bounds from the context instead of the bounds we created // from the window above. getNPRect(CGRectOffset(CGContextGetClipBoundingBox(currentContext), -origin.x, origin.y), window.clipRect); } } } MacSetRectRgn(clipRegion, window.clipRect.left + nPort.qdPort.portx, window.clipRect.top + nPort.qdPort.porty, window.clipRect.right + nPort.qdPort.portx, window.clipRect.bottom + nPort.qdPort.porty); // Clip to the dirty region if drawing to a window. When drawing to another bitmap context, do not clip. if ([NSGraphicsContext currentContext] == [[self currentWindow] graphicsContext]) { // Clip to dirty region so plug-in does not draw over already-drawn regions of the window that are // not going to be redrawn this update. This forces plug-ins to play nice with z-index ordering. if (forUpdate) { RgnHandle viewClipRegion = NewRgn(); // Get list of dirty rects from the opaque ancestor -- WebKit does some tricks with invalidation and // display to enable z-ordering for NSViews; a side-effect of this is that only the WebHTMLView // knows about the true set of dirty rects. NSView *opaqueAncestor = [self opaqueAncestor]; const NSRect *dirtyRects; NSInteger dirtyRectCount, dirtyRectIndex; [opaqueAncestor getRectsBeingDrawn:&dirtyRects count:&dirtyRectCount]; for (dirtyRectIndex = 0; dirtyRectIndex < dirtyRectCount; dirtyRectIndex++) { NSRect dirtyRect = [self convertRect:dirtyRects[dirtyRectIndex] fromView:opaqueAncestor]; if (!NSEqualSizes(dirtyRect.size, NSZeroSize)) { // Create a region for this dirty rect RgnHandle dirtyRectRegion = NewRgn(); SetRectRgn(dirtyRectRegion, static_cast(NSMinX(dirtyRect)), static_cast(NSMinY(dirtyRect)), static_cast(NSMaxX(dirtyRect)), static_cast(NSMaxY(dirtyRect))); // Union this dirty rect with the rest of the dirty rects UnionRgn(viewClipRegion, dirtyRectRegion, viewClipRegion); DisposeRgn(dirtyRectRegion); } } // Intersect the dirty region with the clip region, so that we only draw over dirty parts SectRgn(clipRegion, viewClipRegion, clipRegion); DisposeRgn(viewClipRegion); } } // Switch to the port and set it up. SetPort(port); PenNormal(); ForeColor(blackColor); BackColor(whiteColor); SetOrigin(nPort.qdPort.portx, nPort.qdPort.porty); SetPortClipRegion(nPort.qdPort.port, clipRegion); if (forUpdate) { // AppKit may have tried to help us by doing a BeginUpdate. // But the invalid region at that level didn't include AppKit's notion of what was not valid. // We reset the port's visible region to counteract what BeginUpdate did. SetPortVisibleRegion(nPort.qdPort.port, clipRegion); InvalWindowRgn(windowRef, clipRegion); } qdPortState->forUpdate = forUpdate; break; } #endif /* NP_NO_QUICKDRAW */ case NPDrawingModelCoreGraphics: { if (![self canDraw]) { portState = NULL; break; } ASSERT([NSView focusView] == self); CGContextRef context = static_cast([[NSGraphicsContext currentContext] graphicsPort]); PortState_CG *cgPortState = (PortState_CG *)malloc(sizeof(PortState_CG)); portState = (PortState)cgPortState; cgPortState->context = context; #ifndef NP_NO_CARBON if (eventModel != NPEventModelCocoa) { // Update the plugin's window/context nPort.cgPort.window = windowRef; nPort.cgPort.context = context; window.window = &nPort.cgPort; } #endif /* NP_NO_CARBON */ // Save current graphics context's state; will be restored by -restorePortState: CGContextSaveGState(context); // Clip to the dirty region if drawing to a window. When drawing to another bitmap context, do not clip. if ([NSGraphicsContext currentContext] == [[self currentWindow] graphicsContext]) { // Get list of dirty rects from the opaque ancestor -- WebKit does some tricks with invalidation and // display to enable z-ordering for NSViews; a side-effect of this is that only the WebHTMLView // knows about the true set of dirty rects. NSView *opaqueAncestor = [self opaqueAncestor]; const NSRect *dirtyRects; NSInteger count; [opaqueAncestor getRectsBeingDrawn:&dirtyRects count:&count]; Vector convertedDirtyRects; convertedDirtyRects.resize(count); for (int i = 0; i < count; ++i) reinterpret_cast(convertedDirtyRects[i]) = [self convertRect:dirtyRects[i] fromView:opaqueAncestor]; CGContextClipToRects(context, convertedDirtyRects.data(), count); } break; } case NPDrawingModelCoreAnimation: // Just set the port state to a dummy value. portState = (PortState)1; break; default: ASSERT_NOT_REACHED(); portState = NULL; break; } return portState; } - (PortState)saveAndSetNewPortState { return [self saveAndSetNewPortStateForUpdate:NO]; } - (void)restorePortState:(PortState)portState { ASSERT([self currentWindow]); ASSERT(portState); switch (drawingModel) { #ifndef NP_NO_QUICKDRAW case NPDrawingModelQuickDraw: { PortState_QD *qdPortState = (PortState_QD *)portState; WindowRef windowRef = (WindowRef)[[self currentWindow] windowRef]; CGrafPtr port = GetWindowPort(windowRef); SetPort(port); if (qdPortState->forUpdate) ValidWindowRgn(windowRef, qdPortState->clipRegion); SetOrigin(qdPortState->oldOrigin.h, qdPortState->oldOrigin.v); SetPortClipRegion(port, qdPortState->oldClipRegion); if (qdPortState->forUpdate) SetPortVisibleRegion(port, qdPortState->oldVisibleRegion); DisposeRgn(qdPortState->oldClipRegion); DisposeRgn(qdPortState->oldVisibleRegion); DisposeRgn(qdPortState->clipRegion); SetGWorld(qdPortState->oldPort, qdPortState->oldDevice); break; } #endif /* NP_NO_QUICKDRAW */ case NPDrawingModelCoreGraphics: { ASSERT([NSView focusView] == self); CGContextRef context = ((PortState_CG *)portState)->context; ASSERT(!nPort.cgPort.context || (context == nPort.cgPort.context)); CGContextRestoreGState(context); break; } case NPDrawingModelCoreAnimation: ASSERT(portState == (PortState)1); break; default: ASSERT_NOT_REACHED(); break; } } - (BOOL)sendEvent:(void*)event isDrawRect:(BOOL)eventIsDrawRect { if (![self window]) return NO; ASSERT(event); if (!_isStarted) return NO; ASSERT([_pluginPackage.get() pluginFuncs]->event); // Make sure we don't call NPP_HandleEvent while we're inside NPP_SetWindow. // We probably don't want more general reentrancy protection; we are really // protecting only against this one case, which actually comes up when // you first install the SVG viewer plug-in. if (inSetWindow) return NO; Frame* frame = core([self webFrame]); if (!frame) return NO; Page* page = frame->page(); if (!page) return NO; // Can only send drawRect (updateEvt) to CoreGraphics plugins when actually drawing ASSERT((drawingModel != NPDrawingModelCoreGraphics) || !eventIsDrawRect || [NSView focusView] == self); PortState portState = NULL; if (isDrawingModelQuickDraw(drawingModel) || (drawingModel != NPDrawingModelCoreAnimation && eventIsDrawRect)) { // In CoreGraphics mode, the port state only needs to be saved/set when redrawing the plug-in view. // The plug-in is not allowed to draw at any other time. portState = [self saveAndSetNewPortStateForUpdate:eventIsDrawRect]; // We may have changed the window, so inform the plug-in. [self setWindowIfNecessary]; } #if !defined(NDEBUG) && !defined(NP_NO_QUICKDRAW) // Draw green to help debug. // If we see any green we know something's wrong. // Note that PaintRect() only works for QuickDraw plugins; otherwise the current QD port is undefined. if (isDrawingModelQuickDraw(drawingModel) && eventIsDrawRect) { ForeColor(greenColor); const ::Rect bigRect = { -10000, -10000, 10000, 10000 }; PaintRect(&bigRect); ForeColor(blackColor); } #endif // Temporarily retain self in case the plug-in view is released while sending an event. [[self retain] autorelease]; BOOL acceptedEvent; [self willCallPlugInFunction]; { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); acceptedEvent = [_pluginPackage.get() pluginFuncs]->event(plugin, event); } [self didCallPlugInFunction]; if (portState) { if ([self currentWindow]) [self restorePortState:portState]; if (portState != (PortState)1) free(portState); } return acceptedEvent; } - (void)windowFocusChanged:(BOOL)hasFocus { _eventHandler->windowFocusChanged(hasFocus); } - (void)sendDrawRectEvent:(NSRect)rect { ASSERT(_eventHandler); CGContextRef context = static_cast([[NSGraphicsContext currentContext] graphicsPort]); _eventHandler->drawRect(context, rect); } - (void)stopTimers { [super stopTimers]; if (_eventHandler) _eventHandler->stopTimers(); if (!timers) return; HashMap::const_iterator end = timers->end(); for (HashMap::const_iterator it = timers->begin(); it != end; ++it) { PluginTimer* timer = it->second; timer->stop(); } } - (void)startTimers { [super startTimers]; // If the plugin is completely obscured (scrolled out of view, for example), then we will // send null events at a reduced rate. _eventHandler->startTimers(_isCompletelyObscured); if (!timers) return; HashMap::const_iterator end = timers->end(); for (HashMap::const_iterator it = timers->begin(); it != end; ++it) { PluginTimer* timer = it->second; ASSERT(!timer->isActive()); timer->start(_isCompletelyObscured); } } - (void)focusChanged { // We need to null check the event handler here because // the plug-in view can resign focus after it's been stopped // and the event handler has been deleted. if (_eventHandler) _eventHandler->focusChanged(_hasFocus); } - (void)mouseDown:(NSEvent *)theEvent { if (!_isStarted) return; _eventHandler->mouseDown(theEvent); } - (void)mouseUp:(NSEvent *)theEvent { if (!_isStarted) return; _eventHandler->mouseUp(theEvent); } - (void)mouseEntered:(NSEvent *)theEvent { if (!_isStarted) return; _eventHandler->mouseEntered(theEvent); } - (void)mouseExited:(NSEvent *)theEvent { if (!_isStarted) return; _eventHandler->mouseExited(theEvent); // Set cursor back to arrow cursor. Because NSCursor doesn't know about changes that the plugin made, we could get confused about what we think the // current cursor is otherwise. Therefore we have no choice but to unconditionally reset the cursor when the mouse exits the plugin. [[NSCursor arrowCursor] set]; } // We can't name this method mouseMoved because we don't want to override // the NSView mouseMoved implementation. - (void)handleMouseMoved:(NSEvent *)theEvent { if (!_isStarted) return; _eventHandler->mouseMoved(theEvent); } - (void)mouseDragged:(NSEvent *)theEvent { if (!_isStarted) return; _eventHandler->mouseDragged(theEvent); } - (void)scrollWheel:(NSEvent *)theEvent { if (!_isStarted) { [super scrollWheel:theEvent]; return; } if (!_eventHandler->scrollWheel(theEvent)) [super scrollWheel:theEvent]; } - (void)keyUp:(NSEvent *)theEvent { if (!_isStarted) return; _eventHandler->keyUp(theEvent); } - (void)keyDown:(NSEvent *)theEvent { if (!_isStarted) return; _eventHandler->keyDown(theEvent); } - (void)flagsChanged:(NSEvent *)theEvent { if (!_isStarted) return; _eventHandler->flagsChanged(theEvent); } - (void)sendModifierEventWithKeyCode:(int)keyCode character:(char)character { if (!_isStarted) return; _eventHandler->syntheticKeyDownWithCommandModifier(keyCode, character); } #pragma mark WEB_NETSCAPE_PLUGIN - (BOOL)isNewWindowEqualToOldWindow { if (window.x != lastSetWindow.x) return NO; if (window.y != lastSetWindow.y) return NO; if (window.width != lastSetWindow.width) return NO; if (window.height != lastSetWindow.height) return NO; if (window.clipRect.top != lastSetWindow.clipRect.top) return NO; if (window.clipRect.left != lastSetWindow.clipRect.left) return NO; if (window.clipRect.bottom != lastSetWindow.clipRect.bottom) return NO; if (window.clipRect.right != lastSetWindow.clipRect.right) return NO; if (window.type != lastSetWindow.type) return NO; switch (drawingModel) { #ifndef NP_NO_QUICKDRAW case NPDrawingModelQuickDraw: if (nPort.qdPort.portx != lastSetPort.qdPort.portx) return NO; if (nPort.qdPort.porty != lastSetPort.qdPort.porty) return NO; if (nPort.qdPort.port != lastSetPort.qdPort.port) return NO; break; #endif /* NP_NO_QUICKDRAW */ case NPDrawingModelCoreGraphics: if (nPort.cgPort.window != lastSetPort.cgPort.window) return NO; if (nPort.cgPort.context != lastSetPort.cgPort.context) return NO; break; case NPDrawingModelCoreAnimation: if (window.window != lastSetWindow.window) return NO; break; default: ASSERT_NOT_REACHED(); break; } return YES; } -(void)tellQuickTimeToChill { #ifndef NP_NO_QUICKDRAW ASSERT(isDrawingModelQuickDraw(drawingModel)); // Make a call to the secret QuickDraw API that makes QuickTime calm down. WindowRef windowRef = (WindowRef)[[self window] windowRef]; if (!windowRef) { return; } CGrafPtr port = GetWindowPort(windowRef); ::Rect bounds; GetPortBounds(port, &bounds); WKCallDrawingNotification(port, &bounds); #endif /* NP_NO_QUICKDRAW */ } - (void)updateAndSetWindow { // A plug-in can only update if it's (1) already been started (2) isn't stopped // and (3) is able to draw on-screen. To meet condition (3) the plug-in must not // be hidden and be attached to a window. There are two exceptions to this rule: // // Exception 1: QuickDraw plug-ins must be manually told when to stop writing // bits to the window backing store, thus to do so requires a new call to // NPP_SetWindow() with an empty NPWindow struct. // // Exception 2: CoreGraphics plug-ins expect to have their drawable area updated // when they are moved to a background tab, via a NPP_SetWindow call. This is // accomplished by allowing -saveAndSetNewPortStateForUpdate to "clip-out" the window's // clipRect. Flash is curently an exception to this. See 6453738. // if (!_isStarted) return; #ifdef NP_NO_QUICKDRAW if (![self canDraw]) return; #else if (drawingModel == NPDrawingModelQuickDraw) [self tellQuickTimeToChill]; else if (drawingModel == NPDrawingModelCoreGraphics && ![self canDraw] && _isFlash) { // The Flash plug-in does not expect an NPP_SetWindow call from WebKit in this case. // See Exception 2 above. return; } #endif // NP_NO_QUICKDRAW BOOL didLockFocus = [NSView focusView] != self && [self lockFocusIfCanDraw]; PortState portState = [self saveAndSetNewPortState]; if (portState) { [self setWindowIfNecessary]; [self restorePortState:portState]; if (portState != (PortState)1) free(portState); } else if (drawingModel == NPDrawingModelCoreGraphics) [self setWindowIfNecessary]; if (didLockFocus) [self unlockFocus]; } - (void)setWindowIfNecessary { if (!_isStarted) return; if (![self isNewWindowEqualToOldWindow]) { // Make sure we don't call NPP_HandleEvent while we're inside NPP_SetWindow. // We probably don't want more general reentrancy protection; we are really // protecting only against this one case, which actually comes up when // you first install the SVG viewer plug-in. NPError npErr; ASSERT(!inSetWindow); inSetWindow = YES; [self willCallPlugInFunction]; { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); npErr = [_pluginPackage.get() pluginFuncs]->setwindow(plugin, &window); } [self didCallPlugInFunction]; inSetWindow = NO; #ifndef NDEBUG switch (drawingModel) { #ifndef NP_NO_QUICKDRAW case NPDrawingModelQuickDraw: LOG(Plugins, "NPP_SetWindow (QuickDraw): %d, port=0x%08x, window.x:%d window.y:%d window.width:%d window.height:%d", npErr, (int)nPort.qdPort.port, (int)window.x, (int)window.y, (int)window.width, (int)window.height); break; #endif /* NP_NO_QUICKDRAW */ case NPDrawingModelCoreGraphics: LOG(Plugins, "NPP_SetWindow (CoreGraphics): %d, window=%p, context=%p, window.x:%d window.y:%d window.width:%d window.height:%d window.clipRect size:%dx%d", npErr, nPort.cgPort.window, nPort.cgPort.context, (int)window.x, (int)window.y, (int)window.width, (int)window.height, window.clipRect.right - window.clipRect.left, window.clipRect.bottom - window.clipRect.top); break; case NPDrawingModelCoreAnimation: LOG(Plugins, "NPP_SetWindow (CoreAnimation): %d, window=%p window.x:%d window.y:%d window.width:%d window.height:%d", npErr, window.window, nPort.cgPort.context, (int)window.x, (int)window.y, (int)window.width, (int)window.height); break; default: ASSERT_NOT_REACHED(); break; } #endif /* !defined(NDEBUG) */ lastSetWindow = window; lastSetPort = nPort; } } + (void)setCurrentPluginView:(WebNetscapePluginView *)view { currentPluginView = view; } + (WebNetscapePluginView *)currentPluginView { return currentPluginView; } - (BOOL)createPlugin { // Open the plug-in package so it remains loaded while our plugin uses it [_pluginPackage.get() open]; // Initialize drawingModel to an invalid value so that we can detect when the plugin does not specify a drawingModel drawingModel = (NPDrawingModel)-1; // Initialize eventModel to an invalid value so that we can detect when the plugin does not specify an event model. eventModel = (NPEventModel)-1; NPError npErr = [self _createPlugin]; if (npErr != NPERR_NO_ERROR) { LOG_ERROR("NPP_New failed with error: %d", npErr); [self _destroyPlugin]; [_pluginPackage.get() close]; return NO; } if (drawingModel == (NPDrawingModel)-1) { #ifndef NP_NO_QUICKDRAW // Default to QuickDraw if the plugin did not specify a drawing model. drawingModel = NPDrawingModelQuickDraw; #else // QuickDraw is not available, so we can't default to it. Instead, default to CoreGraphics. drawingModel = NPDrawingModelCoreGraphics; #endif } if (eventModel == (NPEventModel)-1) { // If the plug-in did not specify a drawing model we default to Carbon when it is available. #ifndef NP_NO_CARBON eventModel = NPEventModelCarbon; #else eventModel = NPEventModelCocoa; #endif // NP_NO_CARBON } #ifndef NP_NO_CARBON if (eventModel == NPEventModelCocoa && isDrawingModelQuickDraw(drawingModel)) { LOG(Plugins, "Plugin can't use use Cocoa event model with QuickDraw drawing model: %@", _pluginPackage.get()); [self _destroyPlugin]; [_pluginPackage.get() close]; return NO; } #endif // NP_NO_CARBON #ifndef BUILDING_ON_TIGER if (drawingModel == NPDrawingModelCoreAnimation) { void *value = 0; if ([_pluginPackage.get() pluginFuncs]->getvalue(plugin, NPPVpluginCoreAnimationLayer, &value) == NPERR_NO_ERROR && value) { // The plug-in gives us a retained layer. _pluginLayer.adoptNS((CALayer *)value); [self setWantsLayer:YES]; LOG(Plugins, "%@ is using Core Animation drawing model with layer %@", _pluginPackage.get(), _pluginLayer.get()); } ASSERT(_pluginLayer); } #endif // Create the event handler _eventHandler.set(WebNetscapePluginEventHandler::create(self)); return YES; } #ifndef BUILDING_ON_TIGER - (void)setLayer:(CALayer *)newLayer { [super setLayer:newLayer]; if (newLayer && _pluginLayer) { _pluginLayer.get().frame = [newLayer frame]; _pluginLayer.get().autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable; [newLayer addSublayer:_pluginLayer.get()]; } } #endif - (void)loadStream { if ([self _shouldCancelSrcStream]) return; if (_loadManually) { [self _redeliverStream]; return; } // If the OBJECT/EMBED tag has no SRC, the URL is passed to us as "". // Check for this and don't start a load in this case. if (_sourceURL && ![_sourceURL.get() _web_isEmpty]) { NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:_sourceURL.get()]; [request _web_setHTTPReferrer:core([self webFrame])->loader()->outgoingReferrer()]; [self loadRequest:request inTarget:nil withNotifyData:nil sendNotification:NO]; } } - (BOOL)shouldStop { // If we're already calling a plug-in function, do not call NPP_Destroy(). The plug-in function we are calling // may assume that its instance->pdata, or other memory freed by NPP_Destroy(), is valid and unchanged until said // plugin-function returns. // See . if (pluginFunctionCallDepth > 0) { shouldStopSoon = YES; return NO; } return YES; } - (void)destroyPlugin { // To stop active streams it's necessary to invoke stop() on a copy // of streams. This is because calling WebNetscapePluginStream::stop() also has the side effect // of removing a stream from this hash set. Vector > streamsCopy; copyToVector(streams, streamsCopy); for (size_t i = 0; i < streamsCopy.size(); i++) streamsCopy[i]->stop(); [[_pendingFrameLoads.get() allKeys] makeObjectsPerformSelector:@selector(_setInternalLoadDelegate:) withObject:nil]; [NSObject cancelPreviousPerformRequestsWithTarget:self]; // Setting the window type to 0 ensures that NPP_SetWindow will be called if the plug-in is restarted. lastSetWindow.type = (NPWindowType)0; #ifndef BUILDING_ON_TIGER _pluginLayer = 0; #endif [self _destroyPlugin]; [_pluginPackage.get() close]; _eventHandler.clear(); } - (NPEventModel)eventModel { return eventModel; } - (NPP)plugin { return plugin; } - (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values { ASSERT([keys count] == [values count]); // Convert the attributes to 2 C string arrays. // These arrays are passed to NPP_New, but the strings need to be // modifiable and live the entire life of the plugin. // The Java plug-in requires the first argument to be the base URL if ([_MIMEType.get() isEqualToString:@"application/x-java-applet"]) { cAttributes = (char **)malloc(([keys count] + 1) * sizeof(char *)); cValues = (char **)malloc(([values count] + 1) * sizeof(char *)); cAttributes[0] = strdup("DOCBASE"); cValues[0] = strdup([_baseURL.get() _web_URLCString]); argsCount++; } else { cAttributes = (char **)malloc([keys count] * sizeof(char *)); cValues = (char **)malloc([values count] * sizeof(char *)); } BOOL isWMP = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.microsoft.WMP.defaultplugin"]; unsigned i; unsigned count = [keys count]; for (i = 0; i < count; i++) { NSString *key = [keys objectAtIndex:i]; NSString *value = [values objectAtIndex:i]; if ([key _webkit_isCaseInsensitiveEqualToString:@"height"]) { specifiedHeight = [value intValue]; } else if ([key _webkit_isCaseInsensitiveEqualToString:@"width"]) { specifiedWidth = [value intValue]; } // Avoid Window Media Player crash when these attributes are present. if (isWMP && ([key _webkit_isCaseInsensitiveEqualToString:@"SAMIStyle"] || [key _webkit_isCaseInsensitiveEqualToString:@"SAMILang"])) { continue; } cAttributes[argsCount] = strdup([key UTF8String]); cValues[argsCount] = strdup([value UTF8String]); LOG(Plugins, "%@ = %@", key, value); argsCount++; } } - (uint32)checkIfAllowedToLoadURL:(const char*)urlCString frame:(const char*)frameNameCString callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed, void* context))callbackFunc context:(void*)context { if (!_containerChecksInProgress) _containerChecksInProgress = [[NSMutableDictionary alloc] init]; NSString *frameName = frameNameCString ? [NSString stringWithCString:frameNameCString encoding:NSISOLatin1StringEncoding] : nil; ++_currentContainerCheckRequestID; WebNetscapeContainerCheckContextInfo *contextInfo = [[WebNetscapeContainerCheckContextInfo alloc] initWithCheckRequestID:_currentContainerCheckRequestID callbackFunc:callbackFunc context:context]; WebPluginContainerCheck *check = [WebPluginContainerCheck checkWithRequest:[self requestWithURLCString:urlCString] target:frameName resultObject:self selector:@selector(_containerCheckResult:contextInfo:) controller:self contextInfo:contextInfo]; [contextInfo release]; [_containerChecksInProgress setObject:check forKey:[NSNumber numberWithInt:_currentContainerCheckRequestID]]; [check start]; return _currentContainerCheckRequestID; } - (void)_containerCheckResult:(PolicyAction)policy contextInfo:(id)contextInfo { ASSERT([contextInfo isKindOfClass:[WebNetscapeContainerCheckContextInfo class]]); void (*pluginCallback)(NPP npp, uint32, NPBool, void*) = [contextInfo callback]; if (!pluginCallback) { ASSERT_NOT_REACHED(); return; } pluginCallback([self plugin], [contextInfo checkRequestID], (policy == PolicyUse), [contextInfo context]); } - (void)cancelCheckIfAllowedToLoadURL:(uint32)checkID { WebPluginContainerCheck *check = (WebPluginContainerCheck *)[_containerChecksInProgress objectForKey:[NSNumber numberWithInt:checkID]]; if (!check) return; [check cancel]; [_containerChecksInProgress removeObjectForKey:[NSNumber numberWithInt:checkID]]; } // WebPluginContainerCheck automatically calls this method after invoking our _containerCheckResult: selector. // It works this way because calling -[WebPluginContainerCheck cancel] allows it to do it's teardown process. - (void)_webPluginContainerCancelCheckIfAllowedToLoadRequest:(id)webPluginContainerCheck { ASSERT([webPluginContainerCheck isKindOfClass:[WebPluginContainerCheck class]]); WebPluginContainerCheck *check = (WebPluginContainerCheck *)webPluginContainerCheck; ASSERT([check contextInfo] && [[check contextInfo] isKindOfClass:[WebNetscapeContainerCheckContextInfo class]]); [self cancelCheckIfAllowedToLoadURL:[[check contextInfo] checkRequestID]]; } #ifdef BUILDING_ON_TIGER // The Tiger compiler requires these two methods be present. Otherwise it doesn't think WebNetscapePluginView // conforms to the WebPluginContainerCheckController protocol. - (WebView *)webView { return [super webView]; } - (WebFrame *)webFrame { return [super webFrame]; } #endif #pragma mark NSVIEW - (id)initWithFrame:(NSRect)frame pluginPackage:(WebNetscapePluginPackage *)pluginPackage URL:(NSURL *)URL baseURL:(NSURL *)baseURL MIMEType:(NSString *)MIME attributeKeys:(NSArray *)keys attributeValues:(NSArray *)values loadManually:(BOOL)loadManually element:(PassRefPtr)element { self = [super initWithFrame:frame pluginPackage:pluginPackage URL:URL baseURL:baseURL MIMEType:MIME attributeKeys:keys attributeValues:values loadManually:loadManually element:element]; if (!self) return nil; _pendingFrameLoads.adoptNS([[NSMutableDictionary alloc] init]); // load the plug-in if it is not already loaded if (![pluginPackage load]) { [self release]; return nil; } return self; } - (id)initWithFrame:(NSRect)frame { ASSERT_NOT_REACHED(); return nil; } - (void)fini { #ifndef NP_NO_QUICKDRAW if (offscreenGWorld) DisposeGWorld(offscreenGWorld); #endif for (unsigned i = 0; i < argsCount; i++) { free(cAttributes[i]); free(cValues[i]); } free(cAttributes); free(cValues); ASSERT(!_eventHandler); if (timers) { deleteAllValues(*timers); delete timers; } [_containerChecksInProgress release]; } - (void)disconnectStream:(WebNetscapePluginStream*)stream { streams.remove(stream); } - (void)dealloc { ASSERT(!_isStarted); ASSERT(!plugin); [self fini]; [super dealloc]; } - (void)finalize { ASSERT_MAIN_THREAD(); ASSERT(!_isStarted); [self fini]; [super finalize]; } - (void)drawRect:(NSRect)rect { if (drawingModel == NPDrawingModelCoreAnimation) return; if (!_isStarted) return; if ([NSGraphicsContext currentContextDrawingToScreen]) [self sendDrawRectEvent:rect]; else { NSBitmapImageRep *printedPluginBitmap = [self _printedPluginBitmap]; if (printedPluginBitmap) { // Flip the bitmap before drawing because the QuickDraw port is flipped relative // to this view. CGContextRef cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; CGContextSaveGState(cgContext); NSRect bounds = [self bounds]; CGContextTranslateCTM(cgContext, 0.0f, NSHeight(bounds)); CGContextScaleCTM(cgContext, 1.0f, -1.0f); [printedPluginBitmap drawInRect:bounds]; CGContextRestoreGState(cgContext); } } } - (NPObject *)createPluginScriptableObject { if (![_pluginPackage.get() pluginFuncs]->getvalue || !_isStarted) return NULL; NPObject *value = NULL; NPError error; [self willCallPlugInFunction]; { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); error = [_pluginPackage.get() pluginFuncs]->getvalue(plugin, NPPVpluginScriptableNPObject, &value); } [self didCallPlugInFunction]; if (error != NPERR_NO_ERROR) return NULL; return value; } - (void)willCallPlugInFunction { ASSERT(plugin); // Could try to prevent infinite recursion here, but it's probably not worth the effort. pluginFunctionCallDepth++; } - (void)didCallPlugInFunction { ASSERT(pluginFunctionCallDepth > 0); pluginFunctionCallDepth--; // If -stop was called while we were calling into a plug-in function, and we're no longer // inside a plug-in function, stop now. if (pluginFunctionCallDepth == 0 && shouldStopSoon) { shouldStopSoon = NO; [self stop]; } } -(void)pluginView:(NSView *)pluginView receivedResponse:(NSURLResponse *)response { ASSERT(_loadManually); ASSERT(!_manualStream); _manualStream = WebNetscapePluginStream::create(core([self webFrame])->loader()); } - (void)pluginView:(NSView *)pluginView receivedData:(NSData *)data { ASSERT(_loadManually); ASSERT(_manualStream); _dataLengthReceived += [data length]; if (!_isStarted) return; if (!_manualStream->plugin()) { // Check if the load should be cancelled if ([self _shouldCancelSrcStream]) { NSURLResponse *response = [[self dataSource] response]; NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInWillHandleLoad contentURL:[response URL] pluginPageURL:nil pluginName:nil // FIXME: Get this from somewhere MIMEType:[response MIMEType]]; [[self dataSource] _documentLoader]->cancelMainResourceLoad(error); [error release]; return; } _manualStream->setRequestURL([[[self dataSource] request] URL]); _manualStream->setPlugin([self plugin]); ASSERT(_manualStream->plugin()); _manualStream->startStreamWithResponse([[self dataSource] response]); } if (_manualStream->plugin()) _manualStream->didReceiveData(0, static_cast([data bytes]), [data length]); } - (void)pluginView:(NSView *)pluginView receivedError:(NSError *)error { ASSERT(_loadManually); _error = error; if (!_isStarted) { return; } _manualStream->destroyStreamWithError(error); } - (void)pluginViewFinishedLoading:(NSView *)pluginView { ASSERT(_loadManually); ASSERT(_manualStream); if (_isStarted) _manualStream->didFinishLoading(0); } - (NSTextInputContext *)inputContext { return nil; } @end @implementation WebNetscapePluginView (WebNPPCallbacks) - (void)evaluateJavaScriptPluginRequest:(WebPluginRequest *)JSPluginRequest { // FIXME: Is this isStarted check needed here? evaluateJavaScriptPluginRequest should not be called // if we are stopped since this method is called after a delay and we call // cancelPreviousPerformRequestsWithTarget inside of stop. if (!_isStarted) { return; } NSURL *URL = [[JSPluginRequest request] URL]; NSString *JSString = [URL _webkit_scriptIfJavaScriptURL]; ASSERT(JSString); NSString *result = [[self webFrame] _stringByEvaluatingJavaScriptFromString:JSString forceUserGesture:[JSPluginRequest isCurrentEventUserGesture]]; // Don't continue if stringByEvaluatingJavaScriptFromString caused the plug-in to stop. if (!_isStarted) { return; } if ([JSPluginRequest frameName] != nil) { // FIXME: If the result is a string, we probably want to put that string into the frame. if ([JSPluginRequest sendNotification]) { [self willCallPlugInFunction]; { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [_pluginPackage.get() pluginFuncs]->urlnotify(plugin, [URL _web_URLCString], NPRES_DONE, [JSPluginRequest notifyData]); } [self didCallPlugInFunction]; } } else if ([result length] > 0) { // Don't call NPP_NewStream and other stream methods if there is no JS result to deliver. This is what Mozilla does. NSData *JSData = [result dataUsingEncoding:NSUTF8StringEncoding]; RefPtr stream = WebNetscapePluginStream::create([NSURLRequest requestWithURL:URL], plugin, [JSPluginRequest sendNotification], [JSPluginRequest notifyData]); RetainPtr response(AdoptNS, [[NSURLResponse alloc] initWithURL:URL MIMEType:@"text/plain" expectedContentLength:[JSData length] textEncodingName:nil]); stream->startStreamWithResponse(response.get()); stream->didReceiveData(0, static_cast([JSData bytes]), [JSData length]); stream->didFinishLoading(0); } } - (void)webFrame:(WebFrame *)webFrame didFinishLoadWithReason:(NPReason)reason { ASSERT(_isStarted); WebPluginRequest *pluginRequest = [_pendingFrameLoads.get() objectForKey:webFrame]; ASSERT(pluginRequest != nil); ASSERT([pluginRequest sendNotification]); [self willCallPlugInFunction]; { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [_pluginPackage.get() pluginFuncs]->urlnotify(plugin, [[[pluginRequest request] URL] _web_URLCString], reason, [pluginRequest notifyData]); } [self didCallPlugInFunction]; [_pendingFrameLoads.get() removeObjectForKey:webFrame]; [webFrame _setInternalLoadDelegate:nil]; } - (void)webFrame:(WebFrame *)webFrame didFinishLoadWithError:(NSError *)error { NPReason reason = NPRES_DONE; if (error != nil) reason = WebNetscapePluginStream::reasonForError(error); [self webFrame:webFrame didFinishLoadWithReason:reason]; } - (void)loadPluginRequest:(WebPluginRequest *)pluginRequest { NSURLRequest *request = [pluginRequest request]; NSString *frameName = [pluginRequest frameName]; WebFrame *frame = nil; NSURL *URL = [request URL]; NSString *JSString = [URL _webkit_scriptIfJavaScriptURL]; ASSERT(frameName || JSString); if (frameName) { // FIXME - need to get rid of this window creation which // bypasses normal targeted link handling frame = kit(core([self webFrame])->loader()->findFrameForNavigation(frameName)); if (frame == nil) { WebView *currentWebView = [self webView]; NSDictionary *features = [[NSDictionary alloc] init]; WebView *newWebView = [[currentWebView _UIDelegateForwarder] webView:currentWebView createWebViewWithRequest:nil windowFeatures:features]; [features release]; if (!newWebView) { if ([pluginRequest sendNotification]) { [self willCallPlugInFunction]; { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [_pluginPackage.get() pluginFuncs]->urlnotify(plugin, [[[pluginRequest request] URL] _web_URLCString], NPERR_GENERIC_ERROR, [pluginRequest notifyData]); } [self didCallPlugInFunction]; } return; } frame = [newWebView mainFrame]; core(frame)->tree()->setName(frameName); [[newWebView _UIDelegateForwarder] webViewShow:newWebView]; } } if (JSString) { ASSERT(frame == nil || [self webFrame] == frame); [self evaluateJavaScriptPluginRequest:pluginRequest]; } else { [frame loadRequest:request]; if ([pluginRequest sendNotification]) { // Check if another plug-in view or even this view is waiting for the frame to load. // If it is, tell it that the load was cancelled because it will be anyway. WebNetscapePluginView *view = [frame _internalLoadDelegate]; if (view != nil) { ASSERT([view isKindOfClass:[WebNetscapePluginView class]]); [view webFrame:frame didFinishLoadWithReason:NPRES_USER_BREAK]; } [_pendingFrameLoads.get() _webkit_setObject:pluginRequest forUncopiedKey:frame]; [frame _setInternalLoadDelegate:self]; } } } - (NPError)loadRequest:(NSMutableURLRequest *)request inTarget:(const char *)cTarget withNotifyData:(void *)notifyData sendNotification:(BOOL)sendNotification { NSURL *URL = [request URL]; if (!URL) return NPERR_INVALID_URL; // Don't allow requests to be loaded when the document loader is stopping all loaders. if ([[self dataSource] _documentLoader]->isStopping()) return NPERR_GENERIC_ERROR; NSString *target = nil; if (cTarget) { // Find the frame given the target string. target = [NSString stringWithCString:cTarget encoding:NSISOLatin1StringEncoding]; } WebFrame *frame = [self webFrame]; // don't let a plugin start any loads if it is no longer part of a document that is being // displayed unless the loads are in the same frame as the plugin. if ([[self dataSource] _documentLoader] != core([self webFrame])->loader()->activeDocumentLoader() && (!cTarget || [frame findFrameNamed:target] != frame)) { return NPERR_GENERIC_ERROR; } NSString *JSString = [URL _webkit_scriptIfJavaScriptURL]; if (JSString != nil) { if (![[[self webView] preferences] isJavaScriptEnabled]) { // Return NPERR_GENERIC_ERROR if JS is disabled. This is what Mozilla does. return NPERR_GENERIC_ERROR; } else if (cTarget == NULL && _mode == NP_FULL) { // Don't allow a JavaScript request from a standalone plug-in that is self-targetted // because this can cause the user to be redirected to a blank page (3424039). return NPERR_INVALID_PARAM; } } else { if (!FrameLoader::canLoad(URL, String(), core([self webFrame])->document())) return NPERR_GENERIC_ERROR; } if (cTarget || JSString) { // Make when targetting a frame or evaluating a JS string, perform the request after a delay because we don't // want to potentially kill the plug-in inside of its URL request. if (JSString && target && [frame findFrameNamed:target] != frame) { // For security reasons, only allow JS requests to be made on the frame that contains the plug-in. return NPERR_INVALID_PARAM; } bool currentEventIsUserGesture = false; if (_eventHandler) currentEventIsUserGesture = _eventHandler->currentEventIsUserGesture(); WebPluginRequest *pluginRequest = [[WebPluginRequest alloc] initWithRequest:request frameName:target notifyData:notifyData sendNotification:sendNotification didStartFromUserGesture:currentEventIsUserGesture]; [self performSelector:@selector(loadPluginRequest:) withObject:pluginRequest afterDelay:0]; [pluginRequest release]; } else { RefPtr stream = WebNetscapePluginStream::create(request, plugin, sendNotification, notifyData); streams.add(stream.get()); stream->start(); } return NPERR_NO_ERROR; } -(NPError)getURLNotify:(const char *)URLCString target:(const char *)cTarget notifyData:(void *)notifyData { LOG(Plugins, "NPN_GetURLNotify: %s target: %s", URLCString, cTarget); NSMutableURLRequest *request = [self requestWithURLCString:URLCString]; return [self loadRequest:request inTarget:cTarget withNotifyData:notifyData sendNotification:YES]; } -(NPError)getURL:(const char *)URLCString target:(const char *)cTarget { LOG(Plugins, "NPN_GetURL: %s target: %s", URLCString, cTarget); NSMutableURLRequest *request = [self requestWithURLCString:URLCString]; return [self loadRequest:request inTarget:cTarget withNotifyData:NULL sendNotification:NO]; } - (NPError)_postURL:(const char *)URLCString target:(const char *)target len:(UInt32)len buf:(const char *)buf file:(NPBool)file notifyData:(void *)notifyData sendNotification:(BOOL)sendNotification allowHeaders:(BOOL)allowHeaders { if (!URLCString || !len || !buf) { return NPERR_INVALID_PARAM; } NSData *postData = nil; if (file) { // If we're posting a file, buf is either a file URL or a path to the file. NSString *bufString = (NSString *)CFStringCreateWithCString(kCFAllocatorDefault, buf, kCFStringEncodingWindowsLatin1); if (!bufString) { return NPERR_INVALID_PARAM; } NSURL *fileURL = [NSURL _web_URLWithDataAsString:bufString]; NSString *path; if ([fileURL isFileURL]) { path = [fileURL path]; } else { path = bufString; } postData = [NSData dataWithContentsOfFile:[path _webkit_fixedCarbonPOSIXPath]]; CFRelease(bufString); if (!postData) { return NPERR_FILE_NOT_FOUND; } } else { postData = [NSData dataWithBytes:buf length:len]; } if ([postData length] == 0) { return NPERR_INVALID_PARAM; } NSMutableURLRequest *request = [self requestWithURLCString:URLCString]; [request setHTTPMethod:@"POST"]; if (allowHeaders) { if ([postData _web_startsWithBlankLine]) { postData = [postData subdataWithRange:NSMakeRange(1, [postData length] - 1)]; } else { NSInteger location = [postData _web_locationAfterFirstBlankLine]; if (location != NSNotFound) { // If the blank line is somewhere in the middle of postData, everything before is the header. NSData *headerData = [postData subdataWithRange:NSMakeRange(0, location)]; NSMutableDictionary *header = [headerData _webkit_parseRFC822HeaderFields]; unsigned dataLength = [postData length] - location; // Sometimes plugins like to set Content-Length themselves when they post, // but WebFoundation does not like that. So we will remove the header // and instead truncate the data to the requested length. NSString *contentLength = [header objectForKey:@"Content-Length"]; if (contentLength != nil) dataLength = min([contentLength intValue], dataLength); [header removeObjectForKey:@"Content-Length"]; if ([header count] > 0) { [request setAllHTTPHeaderFields:header]; } // Everything after the blank line is the actual content of the POST. postData = [postData subdataWithRange:NSMakeRange(location, dataLength)]; } } if ([postData length] == 0) { return NPERR_INVALID_PARAM; } } // Plug-ins expect to receive uncached data when doing a POST (3347134). [request setCachePolicy:NSURLRequestReloadIgnoringCacheData]; [request setHTTPBody:postData]; return [self loadRequest:request inTarget:target withNotifyData:notifyData sendNotification:sendNotification]; } - (NPError)postURLNotify:(const char *)URLCString target:(const char *)target len:(UInt32)len buf:(const char *)buf file:(NPBool)file notifyData:(void *)notifyData { LOG(Plugins, "NPN_PostURLNotify: %s", URLCString); return [self _postURL:URLCString target:target len:len buf:buf file:file notifyData:notifyData sendNotification:YES allowHeaders:YES]; } -(NPError)postURL:(const char *)URLCString target:(const char *)target len:(UInt32)len buf:(const char *)buf file:(NPBool)file { LOG(Plugins, "NPN_PostURL: %s", URLCString); // As documented, only allow headers to be specified via NPP_PostURL when using a file. return [self _postURL:URLCString target:target len:len buf:buf file:file notifyData:NULL sendNotification:NO allowHeaders:file]; } -(NPError)newStream:(NPMIMEType)type target:(const char *)target stream:(NPStream**)stream { LOG(Plugins, "NPN_NewStream"); return NPERR_GENERIC_ERROR; } -(NPError)write:(NPStream*)stream len:(SInt32)len buffer:(void *)buffer { LOG(Plugins, "NPN_Write"); return NPERR_GENERIC_ERROR; } -(NPError)destroyStream:(NPStream*)stream reason:(NPReason)reason { LOG(Plugins, "NPN_DestroyStream"); // This function does a sanity check to ensure that the NPStream provided actually // belongs to the plug-in that provided it, which fixes a crash in the DivX // plug-in: | http://bugs.webkit.org/show_bug.cgi?id=13203 if (!stream || WebNetscapePluginStream::ownerForStream(stream) != plugin) { LOG(Plugins, "Invalid NPStream passed to NPN_DestroyStream: %p", stream); return NPERR_INVALID_INSTANCE_ERROR; } WebNetscapePluginStream* browserStream = static_cast(stream->ndata); browserStream->cancelLoadAndDestroyStreamWithError(browserStream->errorForReason(reason)); return NPERR_NO_ERROR; } - (const char *)userAgent { NSString *userAgent = [[self webView] userAgentForURL:_baseURL.get()]; if (_isSilverlight) { // Silverlight has a workaround for a leak in Safari 2. This workaround is // applied when the user agent does not contain "Version/3" so we append it // at the end of the user agent. userAgent = [userAgent stringByAppendingString:@" Version/3.2.1"]; } return [userAgent UTF8String]; } -(void)status:(const char *)message { if (!message) { LOG_ERROR("NPN_Status passed a NULL status message"); return; } CFStringRef status = CFStringCreateWithCString(NULL, message, kCFStringEncodingUTF8); if (!status) { LOG_ERROR("NPN_Status: the message was not valid UTF-8"); return; } LOG(Plugins, "NPN_Status: %@", status); WebView *wv = [self webView]; [[wv _UIDelegateForwarder] webView:wv setStatusText:(NSString *)status]; CFRelease(status); } -(void)invalidateRect:(NPRect *)invalidRect { LOG(Plugins, "NPN_InvalidateRect"); [self invalidatePluginContentRect:NSMakeRect(invalidRect->left, invalidRect->top, (float)invalidRect->right - invalidRect->left, (float)invalidRect->bottom - invalidRect->top)]; } - (void)invalidateRegion:(NPRegion)invalidRegion { LOG(Plugins, "NPN_InvalidateRegion"); NSRect invalidRect = NSZeroRect; switch (drawingModel) { #ifndef NP_NO_QUICKDRAW case NPDrawingModelQuickDraw: { ::Rect qdRect; GetRegionBounds((NPQDRegion)invalidRegion, &qdRect); invalidRect = NSMakeRect(qdRect.left, qdRect.top, qdRect.right - qdRect.left, qdRect.bottom - qdRect.top); } break; #endif /* NP_NO_QUICKDRAW */ case NPDrawingModelCoreGraphics: { CGRect cgRect = CGPathGetBoundingBox((NPCGRegion)invalidRegion); invalidRect = *(NSRect*)&cgRect; break; } default: ASSERT_NOT_REACHED(); break; } [self invalidatePluginContentRect:invalidRect]; } -(void)forceRedraw { LOG(Plugins, "forceRedraw"); [self invalidatePluginContentRect:[self bounds]]; [[self window] displayIfNeeded]; } - (NPError)getVariable:(NPNVariable)variable value:(void *)value { switch (variable) { case NPNVWindowNPObject: { Frame* frame = core([self webFrame]); NPObject* windowScriptObject = frame ? frame->script()->windowScriptNPObject() : 0; // Return value is expected to be retained, as described here: if (windowScriptObject) _NPN_RetainObject(windowScriptObject); void **v = (void **)value; *v = windowScriptObject; return NPERR_NO_ERROR; } case NPNVPluginElementNPObject: { if (!_element) return NPERR_GENERIC_ERROR; NPObject *plugInScriptObject = _element->getNPObject(); // Return value is expected to be retained, as described here: if (plugInScriptObject) _NPN_RetainObject(plugInScriptObject); void **v = (void **)value; *v = plugInScriptObject; return NPERR_NO_ERROR; } case NPNVpluginDrawingModel: { *(NPDrawingModel *)value = drawingModel; return NPERR_NO_ERROR; } #ifndef NP_NO_QUICKDRAW case NPNVsupportsQuickDrawBool: { *(NPBool *)value = TRUE; return NPERR_NO_ERROR; } #endif /* NP_NO_QUICKDRAW */ case NPNVsupportsCoreGraphicsBool: { *(NPBool *)value = TRUE; return NPERR_NO_ERROR; } case NPNVsupportsOpenGLBool: { *(NPBool *)value = FALSE; return NPERR_NO_ERROR; } case NPNVsupportsCoreAnimationBool: { #ifdef BUILDING_ON_TIGER *(NPBool *)value = FALSE; #else *(NPBool *)value = TRUE; #endif return NPERR_NO_ERROR; } #ifndef NP_NO_CARBON case NPNVsupportsCarbonBool: { *(NPBool *)value = TRUE; return NPERR_NO_ERROR; } #endif /* NP_NO_CARBON */ case NPNVsupportsCocoaBool: { *(NPBool *)value = TRUE; return NPERR_NO_ERROR; } case WKNVBrowserContainerCheckFuncs: { *(WKNBrowserContainerCheckFuncs **)value = browserContainerCheckFuncs(); return NPERR_NO_ERROR; } default: break; } return NPERR_GENERIC_ERROR; } - (NPError)setVariable:(NPPVariable)variable value:(void *)value { switch (variable) { case NPPVpluginDrawingModel: { // Can only set drawing model inside NPP_New() if (self != [[self class] currentPluginView]) return NPERR_GENERIC_ERROR; // Check for valid, supported drawing model NPDrawingModel newDrawingModel = (NPDrawingModel)(uintptr_t)value; switch (newDrawingModel) { // Supported drawing models: #ifndef NP_NO_QUICKDRAW case NPDrawingModelQuickDraw: #endif case NPDrawingModelCoreGraphics: #ifndef BUILDING_ON_TIGER case NPDrawingModelCoreAnimation: #endif drawingModel = newDrawingModel; return NPERR_NO_ERROR; // Unsupported (or unknown) drawing models: default: LOG(Plugins, "Plugin %@ uses unsupported drawing model: %d", _eventHandler.get(), drawingModel); return NPERR_GENERIC_ERROR; } } case NPPVpluginEventModel: { // Can only set event model inside NPP_New() if (self != [[self class] currentPluginView]) return NPERR_GENERIC_ERROR; // Check for valid, supported event model NPEventModel newEventModel = (NPEventModel)(uintptr_t)value; switch (newEventModel) { // Supported event models: #ifndef NP_NO_CARBON case NPEventModelCarbon: #endif case NPEventModelCocoa: eventModel = newEventModel; return NPERR_NO_ERROR; // Unsupported (or unknown) event models: default: LOG(Plugins, "Plugin %@ uses unsupported event model: %d", _eventHandler.get(), eventModel); return NPERR_GENERIC_ERROR; } } default: return NPERR_GENERIC_ERROR; } } - (uint32)scheduleTimerWithInterval:(uint32)interval repeat:(NPBool)repeat timerFunc:(void (*)(NPP npp, uint32 timerID))timerFunc { if (!timerFunc) return 0; if (!timers) timers = new HashMap; uint32 timerID; do { timerID = ++currentTimerID; } while (timers->contains(timerID) || timerID == 0); PluginTimer* timer = new PluginTimer(plugin, timerID, interval, repeat, timerFunc); timers->set(timerID, timer); if (_shouldFireTimers) timer->start(_isCompletelyObscured); return timerID; } - (void)unscheduleTimer:(uint32)timerID { if (!timers) return; if (PluginTimer* timer = timers->take(timerID)) delete timer; } - (NPError)popUpContextMenu:(NPMenu *)menu { NSEvent *currentEvent = [NSApp currentEvent]; // NPN_PopUpContextMenu must be called from within the plug-in's NPP_HandleEvent. if (!currentEvent) return NPERR_GENERIC_ERROR; [NSMenu popUpContextMenu:(NSMenu *)menu withEvent:currentEvent forView:self]; return NPERR_NO_ERROR; } - (NPError)getVariable:(NPNURLVariable)variable forURL:(const char*)url value:(char**)value length:(uint32*)length { switch (variable) { case NPNURLVCookie: { if (!value) break; NSURL *URL = [self URLWithCString:url]; if (!URL) break; if (Frame* frame = core([self webFrame])) { String cookieString = cookies(frame->document(), URL); CString cookieStringUTF8 = cookieString.utf8(); if (cookieStringUTF8.isNull()) return NPERR_GENERIC_ERROR; *value = static_cast(NPN_MemAlloc(cookieStringUTF8.length())); memcpy(*value, cookieStringUTF8.data(), cookieStringUTF8.length()); if (length) *length = cookieStringUTF8.length(); return NPERR_NO_ERROR; } break; } case NPNURLVProxy: { #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) if (!value) break; NSURL *URL = [self URLWithCString:url]; if (!URL) break; CString proxiesUTF8 = proxiesForURL(URL); *value = static_cast(NPN_MemAlloc(proxiesUTF8.length())); memcpy(*value, proxiesUTF8.data(), proxiesUTF8.length()); if (length) *length = proxiesUTF8.length(); return NPERR_NO_ERROR; #else break; #endif } } return NPERR_GENERIC_ERROR; } - (NPError)setVariable:(NPNURLVariable)variable forURL:(const char*)url value:(const char*)value length:(uint32)length { switch (variable) { case NPNURLVCookie: { NSURL *URL = [self URLWithCString:url]; if (!URL) break; String cookieString = String::fromUTF8(value, length); if (!cookieString) break; if (Frame* frame = core([self webFrame])) { setCookies(frame->document(), URL, cookieString); return NPERR_NO_ERROR; } break; } case NPNURLVProxy: // Can't set the proxy for a URL. break; } return NPERR_GENERIC_ERROR; } - (NPError)getAuthenticationInfoWithProtocol:(const char*)protocolStr host:(const char*)hostStr port:(int32)port scheme:(const char*)schemeStr realm:(const char*)realmStr username:(char**)usernameStr usernameLength:(uint32*)usernameLength password:(char**)passwordStr passwordLength:(uint32*)passwordLength { if (!protocolStr || !hostStr || !schemeStr || !realmStr || !usernameStr || !usernameLength || !passwordStr || !passwordLength) return NPERR_GENERIC_ERROR; CString username; CString password; if (!getAuthenticationInfo(protocolStr, hostStr, port, schemeStr, realmStr, username, password)) return NPERR_GENERIC_ERROR; *usernameLength = username.length(); *usernameStr = static_cast(NPN_MemAlloc(username.length())); memcpy(*usernameStr, username.data(), username.length()); *passwordLength = password.length(); *passwordStr = static_cast(NPN_MemAlloc(password.length())); memcpy(*passwordStr, password.data(), password.length()); return NPERR_NO_ERROR; } - (char*)resolveURL:(const char*)url forTarget:(const char*)target { WebCore::CString location = [self resolvedURLStringForURL:url target:target]; if (location.isNull()) return 0; // We use strdup here because the caller needs to free it with NPN_MemFree (which calls free). return strdup(location.data()); } @end @implementation WebNetscapePluginView (Internal) - (BOOL)_shouldCancelSrcStream { ASSERT(_isStarted); // Check if we should cancel the load NPBool cancelSrcStream = 0; if ([_pluginPackage.get() pluginFuncs]->getvalue && [_pluginPackage.get() pluginFuncs]->getvalue(plugin, NPPVpluginCancelSrcStream, &cancelSrcStream) == NPERR_NO_ERROR && cancelSrcStream) return YES; return NO; } - (NPError)_createPlugin { plugin = (NPP)calloc(1, sizeof(NPP_t)); plugin->ndata = self; ASSERT([_pluginPackage.get() pluginFuncs]->newp); // NPN_New(), which creates the plug-in instance, should never be called while calling a plug-in function for that instance. ASSERT(pluginFunctionCallDepth == 0); PluginMainThreadScheduler::scheduler().registerPlugin(plugin); _isFlash = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.macromedia.Flash Player.plugin"]; _isSilverlight = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.microsoft.SilverlightPlugin"]; [[self class] setCurrentPluginView:self]; NPError npErr = [_pluginPackage.get() pluginFuncs]->newp((char *)[_MIMEType.get() cString], plugin, _mode, argsCount, cAttributes, cValues, NULL); [[self class] setCurrentPluginView:nil]; LOG(Plugins, "NPP_New: %d", npErr); return npErr; } - (void)_destroyPlugin { PluginMainThreadScheduler::scheduler().unregisterPlugin(plugin); NPError npErr; npErr = ![_pluginPackage.get() pluginFuncs]->destroy(plugin, NULL); LOG(Plugins, "NPP_Destroy: %d", npErr); if (Frame* frame = core([self webFrame])) frame->script()->cleanupScriptObjectsForPlugin(self); free(plugin); plugin = NULL; } - (NSBitmapImageRep *)_printedPluginBitmap { #ifdef NP_NO_QUICKDRAW return nil; #else // Cannot print plugins that do not implement NPP_Print if (![_pluginPackage.get() pluginFuncs]->print) return nil; // This NSBitmapImageRep will share its bitmap buffer with a GWorld that the plugin will draw into. // The bitmap is created in 32-bits-per-pixel ARGB format, which is the default GWorld pixel format. NSBitmapImageRep *bitmap = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:window.width pixelsHigh:window.height bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bitmapFormat:NSAlphaFirstBitmapFormat bytesPerRow:0 bitsPerPixel:0] autorelease]; ASSERT(bitmap); // Create a GWorld with the same underlying buffer into which the plugin can draw ::Rect printGWorldBounds; SetRect(&printGWorldBounds, 0, 0, window.width, window.height); GWorldPtr printGWorld; if (NewGWorldFromPtr(&printGWorld, k32ARGBPixelFormat, &printGWorldBounds, NULL, NULL, 0, (Ptr)[bitmap bitmapData], [bitmap bytesPerRow]) != noErr) { LOG_ERROR("Could not create GWorld for printing"); return nil; } /// Create NPWindow for the GWorld NPWindow printNPWindow; printNPWindow.window = &printGWorld; // Normally this is an NP_Port, but when printing it is the actual CGrafPtr printNPWindow.x = 0; printNPWindow.y = 0; printNPWindow.width = window.width; printNPWindow.height = window.height; printNPWindow.clipRect.top = 0; printNPWindow.clipRect.left = 0; printNPWindow.clipRect.right = window.width; printNPWindow.clipRect.bottom = window.height; printNPWindow.type = NPWindowTypeDrawable; // Offscreen graphics port as opposed to a proper window // Create embed-mode NPPrint NPPrint npPrint; npPrint.mode = NP_EMBED; npPrint.print.embedPrint.window = printNPWindow; npPrint.print.embedPrint.platformPrint = printGWorld; // Tell the plugin to print into the GWorld [self willCallPlugInFunction]; { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [_pluginPackage.get() pluginFuncs]->print(plugin, &npPrint); } [self didCallPlugInFunction]; // Don't need the GWorld anymore DisposeGWorld(printGWorld); return bitmap; #endif } - (void)_redeliverStream { if ([self dataSource] && _isStarted) { // Deliver what has not been passed to the plug-in up to this point. if (_dataLengthReceived > 0) { NSData *data = [[[self dataSource] data] subdataWithRange:NSMakeRange(0, _dataLengthReceived)]; _dataLengthReceived = 0; [self pluginView:self receivedData:data]; if (![[self dataSource] isLoading]) { if (_error) [self pluginView:self receivedError:_error.get()]; else [self pluginViewFinishedLoading:self]; } } } } @end #endif WebKit/mac/Plugins/WebPluginDatabase.mm0000644000175000017500000004114211224533217016376 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebPluginDatabase.h" #import "WebBaseNetscapePluginView.h" #import "WebBasePluginPackage.h" #import "WebDataSourcePrivate.h" #import "WebFrame.h" #import "WebFrameViewInternal.h" #import "WebHTMLRepresentation.h" #import "WebHTMLView.h" #import "WebHTMLView.h" #import "WebKitLogging.h" #import "WebNSFileManagerExtras.h" #import "WebNetscapePluginPackage.h" #import "WebPluginController.h" #import "WebPluginPackage.h" #import "WebViewPrivate.h" #import #import static void checkCandidate(WebBasePluginPackage **currentPlugin, WebBasePluginPackage **candidatePlugin); @interface WebPluginDatabase (Internal) + (NSArray *)_defaultPlugInPaths; - (NSArray *)_plugInPaths; - (void)_addPlugin:(WebBasePluginPackage *)plugin; - (void)_removePlugin:(WebBasePluginPackage *)plugin; - (NSMutableSet *)_scanForNewPlugins; @end @implementation WebPluginDatabase static WebPluginDatabase *sharedDatabase = nil; + (WebPluginDatabase *)sharedDatabase { if (!sharedDatabase) { sharedDatabase = [[WebPluginDatabase alloc] init]; [sharedDatabase setPlugInPaths:[self _defaultPlugInPaths]]; [sharedDatabase refresh]; } return sharedDatabase; } + (void)closeSharedDatabase { [sharedDatabase close]; } static void checkCandidate(WebBasePluginPackage **currentPlugin, WebBasePluginPackage **candidatePlugin) { if (!*currentPlugin) { *currentPlugin = *candidatePlugin; return; } if ([[[*currentPlugin bundle] bundleIdentifier] isEqualToString:[[*candidatePlugin bundle] bundleIdentifier]] && [*candidatePlugin versionNumber] > [*currentPlugin versionNumber]) *currentPlugin = *candidatePlugin; } - (WebBasePluginPackage *)pluginForKey:(NSString *)key withEnumeratorSelector:(SEL)enumeratorSelector { WebBasePluginPackage *plugin = nil; WebBasePluginPackage *webPlugin = nil; #ifdef SUPPORT_CFM WebBasePluginPackage *CFMPlugin = nil; #endif WebBasePluginPackage *machoPlugin = nil; NSEnumerator *pluginEnumerator = [plugins objectEnumerator]; key = [key lowercaseString]; while ((plugin = [pluginEnumerator nextObject]) != nil) { if ([[[plugin performSelector:enumeratorSelector] allObjects] containsObject:key]) { if ([plugin isKindOfClass:[WebPluginPackage class]]) checkCandidate(&webPlugin, &plugin); #if ENABLE(NETSCAPE_PLUGIN_API) else if([plugin isKindOfClass:[WebNetscapePluginPackage class]]) { WebExecutableType executableType = [(WebNetscapePluginPackage *)plugin executableType]; #ifdef SUPPORT_CFM if (executableType == WebCFMExecutableType) { checkCandidate(&CFMPlugin, &plugin); } else #endif // SUPPORT_CFM if (executableType == WebMachOExecutableType) { checkCandidate(&machoPlugin, &plugin); } else { ASSERT_NOT_REACHED(); } } else { ASSERT_NOT_REACHED(); } #endif } } // Allow other plug-ins to win over QT because if the user has installed a plug-in that can handle a type // that the QT plug-in can handle, they probably intended to override QT. if (webPlugin && ![webPlugin isQuickTimePlugIn]) return webPlugin; else if (machoPlugin && ![machoPlugin isQuickTimePlugIn]) return machoPlugin; #ifdef SUPPORT_CFM else if (CFMPlugin && ![CFMPlugin isQuickTimePlugIn]) return CFMPlugin; #endif // SUPPORT_CFM else if (webPlugin) return webPlugin; else if (machoPlugin) return machoPlugin; #ifdef SUPPORT_CFM else if (CFMPlugin) return CFMPlugin; #endif return nil; } - (WebBasePluginPackage *)pluginForMIMEType:(NSString *)MIMEType { return [self pluginForKey:[MIMEType lowercaseString] withEnumeratorSelector:@selector(MIMETypeEnumerator)]; } - (WebBasePluginPackage *)pluginForExtension:(NSString *)extension { WebBasePluginPackage *plugin = [self pluginForKey:[extension lowercaseString] withEnumeratorSelector:@selector(extensionEnumerator)]; if (!plugin) { // If no plug-in was found from the extension, attempt to map from the extension to a MIME type // and find the a plug-in from the MIME type. This is done in case the plug-in has not fully specified // an extension <-> MIME type mapping. NSString *MIMEType = WKGetMIMETypeForExtension(extension); if ([MIMEType length] > 0) plugin = [self pluginForMIMEType:MIMEType]; } return plugin; } - (NSArray *)plugins { return [plugins allValues]; } static NSArray *additionalWebPlugInPaths; + (void)setAdditionalWebPlugInPaths:(NSArray *)additionalPaths { if (additionalPaths == additionalWebPlugInPaths) return; [additionalWebPlugInPaths release]; additionalWebPlugInPaths = [additionalPaths copy]; // One might be tempted to add additionalWebPlugInPaths to the global WebPluginDatabase here. // For backward compatibility with earlier versions of the +setAdditionalWebPlugInPaths: SPI, // we need to save a copy of the additional paths and not cause a refresh of the plugin DB // at this time. // See Radars 4608487 and 4609047. } - (void)setPlugInPaths:(NSArray *)newPaths { if (plugInPaths == newPaths) return; [plugInPaths release]; plugInPaths = [newPaths copy]; } - (void)close { NSEnumerator *pluginEnumerator = [[self plugins] objectEnumerator]; WebBasePluginPackage *plugin; while ((plugin = [pluginEnumerator nextObject]) != nil) [self _removePlugin:plugin]; [plugins release]; plugins = nil; } - (id)init { if (!(self = [super init])) return nil; registeredMIMETypes = [[NSMutableSet alloc] init]; pluginInstanceViews = [[NSMutableSet alloc] init]; return self; } - (void)dealloc { [plugInPaths release]; [plugins release]; [registeredMIMETypes release]; [pluginInstanceViews release]; [super dealloc]; } - (void)refresh { // This method does a bit of autoreleasing, so create an autorelease pool to ensure that calling // -refresh multiple times does not bloat the default pool. NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // Create map from plug-in path to WebBasePluginPackage if (!plugins) plugins = [[NSMutableDictionary alloc] initWithCapacity:12]; // Find all plug-ins on disk NSMutableSet *newPlugins = [self _scanForNewPlugins]; // Find plug-ins to remove from database (i.e., plug-ins that no longer exist on disk) NSMutableSet *pluginsToRemove = [NSMutableSet set]; NSEnumerator *pluginEnumerator = [plugins objectEnumerator]; WebBasePluginPackage *plugin; while ((plugin = [pluginEnumerator nextObject]) != nil) { // Any plug-ins that were removed from disk since the last refresh should be removed from // the database. if (![newPlugins containsObject:plugin]) [pluginsToRemove addObject:plugin]; // Remove every member of 'plugins' from 'newPlugins'. After this loop exits, 'newPlugins' // will be the set of new plug-ins that should be added to the database. [newPlugins removeObject:plugin]; } #if !LOG_DISABLED if ([newPlugins count] > 0) LOG(Plugins, "New plugins:\n%@", newPlugins); if ([pluginsToRemove count] > 0) LOG(Plugins, "Removed plugins:\n%@", pluginsToRemove); #endif // Remove plugins from database pluginEnumerator = [pluginsToRemove objectEnumerator]; while ((plugin = [pluginEnumerator nextObject]) != nil) [self _removePlugin:plugin]; // Add new plugins to database pluginEnumerator = [newPlugins objectEnumerator]; while ((plugin = [pluginEnumerator nextObject]) != nil) [self _addPlugin:plugin]; // Build a list of MIME types. NSMutableSet *MIMETypes = [[NSMutableSet alloc] init]; pluginEnumerator = [plugins objectEnumerator]; while ((plugin = [pluginEnumerator nextObject]) != nil) [MIMETypes addObjectsFromArray:[[plugin MIMETypeEnumerator] allObjects]]; // Register plug-in views and representations. NSEnumerator *MIMEEnumerator = [MIMETypes objectEnumerator]; NSString *MIMEType; while ((MIMEType = [MIMEEnumerator nextObject]) != nil) { [registeredMIMETypes addObject:MIMEType]; if ([WebView canShowMIMETypeAsHTML:MIMEType]) // Don't allow plug-ins to override our core HTML types. continue; plugin = [self pluginForMIMEType:MIMEType]; if ([plugin isJavaPlugIn]) // Don't register the Java plug-in for a document view since Java files should be downloaded when not embedded. continue; if ([plugin isQuickTimePlugIn] && [[WebFrameView _viewTypesAllowImageTypeOmission:NO] objectForKey:MIMEType]) // Don't allow the QT plug-in to override any types because it claims many that we can handle ourselves. continue; if (self == sharedDatabase) [WebView registerViewClass:[WebHTMLView class] representationClass:[WebHTMLRepresentation class] forMIMEType:MIMEType]; } [MIMETypes release]; [pool drain]; } - (BOOL)isMIMETypeRegistered:(NSString *)MIMEType { return [registeredMIMETypes containsObject:MIMEType]; } - (void)addPluginInstanceView:(NSView *)view { [pluginInstanceViews addObject:view]; } - (void)removePluginInstanceView:(NSView *)view { [pluginInstanceViews removeObject:view]; } - (void)removePluginInstanceViewsFor:(WebFrame*)webFrame { // This handles handles the case where a frame or view is being destroyed and the plugin needs to be removed from the list first if( [pluginInstanceViews count] == 0 ) return; NSView *documentView = [[webFrame frameView] documentView]; if ([documentView isKindOfClass:[WebHTMLView class]]) { NSArray *subviews = [documentView subviews]; unsigned int subviewCount = [subviews count]; unsigned int subviewIndex; for (subviewIndex = 0; subviewIndex < subviewCount; subviewIndex++) { NSView *subview = [subviews objectAtIndex:subviewIndex]; #if ENABLE(NETSCAPE_PLUGIN_API) if ([subview isKindOfClass:[WebBaseNetscapePluginView class]] || [WebPluginController isPlugInView:subview]) #else if ([WebPluginController isPlugInView:subview]) #endif [pluginInstanceViews removeObject:subview]; } } } - (void)destroyAllPluginInstanceViews { NSView *view; NSArray *pli = [pluginInstanceViews allObjects]; NSEnumerator *enumerator = [pli objectEnumerator]; while ((view = [enumerator nextObject]) != nil) { #if ENABLE(NETSCAPE_PLUGIN_API) if ([view isKindOfClass:[WebBaseNetscapePluginView class]]) { ASSERT([view respondsToSelector:@selector(stop)]); [view performSelector:@selector(stop)]; } else #endif if ([WebPluginController isPlugInView:view]) { ASSERT([[view superview] isKindOfClass:[WebHTMLView class]]); ASSERT([[view superview] respondsToSelector:@selector(_destroyAllWebPlugins)]); // this will actually destroy all plugin instances for a webHTMLView and remove them from this list [[view superview] performSelector:@selector(_destroyAllWebPlugins)]; } } } @end @implementation WebPluginDatabase (Internal) + (NSArray *)_defaultPlugInPaths { // Plug-ins are found in order of precedence. // If there are duplicates, the first found plug-in is used. // For example, if there is a QuickTime.plugin in the users's home directory // that is used instead of the /Library/Internet Plug-ins version. // The purpose is to allow non-admin users to update their plug-ins. return [NSArray arrayWithObjects: [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Internet Plug-Ins"], @"/Library/Internet Plug-Ins", [[NSBundle mainBundle] builtInPlugInsPath], nil]; } - (NSArray *)_plugInPaths { if (self == sharedDatabase && additionalWebPlugInPaths) { // Add additionalWebPlugInPaths to the global WebPluginDatabase. We do this here for // backward compatibility with earlier versions of the +setAdditionalWebPlugInPaths: SPI, // which simply saved a copy of the additional paths and did not cause the plugin DB to // refresh. See Radars 4608487 and 4609047. NSMutableArray *modifiedPlugInPaths = [[plugInPaths mutableCopy] autorelease]; [modifiedPlugInPaths addObjectsFromArray:additionalWebPlugInPaths]; return modifiedPlugInPaths; } else return plugInPaths; } - (void)_addPlugin:(WebBasePluginPackage *)plugin { ASSERT(plugin); NSString *pluginPath = [plugin path]; ASSERT(pluginPath); [plugins setObject:plugin forKey:pluginPath]; [plugin wasAddedToPluginDatabase:self]; } - (void)_removePlugin:(WebBasePluginPackage *)plugin { ASSERT(plugin); // Unregister plug-in's MIME type registrations NSEnumerator *MIMETypeEnumerator = [plugin MIMETypeEnumerator]; NSString *MIMEType; while ((MIMEType = [MIMETypeEnumerator nextObject])) { if ([registeredMIMETypes containsObject:MIMEType]) { if (self == sharedDatabase) [WebView _unregisterViewClassAndRepresentationClassForMIMEType:MIMEType]; [registeredMIMETypes removeObject:MIMEType]; } } // Remove plug-in from database NSString *pluginPath = [plugin path]; ASSERT(pluginPath); [plugin retain]; [plugins removeObjectForKey:pluginPath]; [plugin wasRemovedFromPluginDatabase:self]; [plugin release]; } - (NSMutableSet *)_scanForNewPlugins { NSMutableSet *newPlugins = [NSMutableSet set]; NSEnumerator *directoryEnumerator = [[self _plugInPaths] objectEnumerator]; NSMutableSet *uniqueFilenames = [[NSMutableSet alloc] init]; NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *pluginDirectory; while ((pluginDirectory = [directoryEnumerator nextObject]) != nil) { // Get contents of each plug-in directory NSEnumerator *filenameEnumerator = [[fileManager contentsOfDirectoryAtPath:pluginDirectory error:NULL] objectEnumerator]; NSString *filename; while ((filename = [filenameEnumerator nextObject]) != nil) { // Unique plug-ins by filename if ([uniqueFilenames containsObject:filename]) continue; [uniqueFilenames addObject:filename]; // Create a plug-in package for this path NSString *pluginPath = [pluginDirectory stringByAppendingPathComponent:filename]; WebBasePluginPackage *pluginPackage = [plugins objectForKey:pluginPath]; if (!pluginPackage) pluginPackage = [WebBasePluginPackage pluginWithPath:pluginPath]; if (pluginPackage) [newPlugins addObject:pluginPackage]; } } [uniqueFilenames release]; return newPlugins; } @end WebKit/mac/Plugins/WebNullPluginView.mm0000644000175000017500000000645211212126444016441 0ustar leelee/* * Copyright (C) 2005, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNullPluginView.h" #import "DOMElementInternal.h" #import "WebDelegateImplementationCaching.h" #import "WebFrameInternal.h" #import "WebViewInternal.h" #import #import @implementation WebNullPluginView - initWithFrame:(NSRect)frame error:(NSError *)err DOMElement:(DOMElement *)elem { static NSImage *nullPlugInImage; if (!nullPlugInImage) { NSBundle *bundle = [NSBundle bundleForClass:[WebNullPluginView class]]; NSString *imagePath = [bundle pathForResource:@"nullplugin" ofType:@"tiff"]; nullPlugInImage = [[NSImage alloc] initWithContentsOfFile:imagePath]; } self = [super initWithFrame:frame]; if (!self) return nil; error = [err retain]; if (err) element = [elem retain]; [self setImage:nullPlugInImage]; return self; } - (void)dealloc { [error release]; [element release]; [super dealloc]; } - (void)reportFailure { NSError *localError = error; DOMElement *localElement = element; error = nil; element = nil; WebFrame *webFrame = kit(core(localElement)->document()->frame()); if (webFrame) { WebView *webView = [webFrame webView]; WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); if (implementations->plugInFailedWithErrorFunc) CallResourceLoadDelegate(implementations->plugInFailedWithErrorFunc, webView, @selector(webView:plugInFailedWithError:dataSource:), localError, [webFrame _dataSource]); } [localError release]; [localElement release]; } - (void)viewDidMoveToWindow { if (!error) return; if ([self window]) [self reportFailure]; } @end WebKit/mac/Plugins/WebNetscapeDeprecatedFunctions.h0000644000175000017500000000360211153071456020747 0ustar leelee/* * Copyright (C) 2006, 2007 Apple 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 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 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__) #import #ifdef __cplusplus extern "C" { #endif extern OSErr WebGetDiskFragment(const FSSpec *fileSpec, UInt32 offset, UInt32 length, ConstStr63Param fragName, CFragLoadOptions options, CFragConnectionID *connID, Ptr *mainAddr, Str255 errMessage); extern OSErr WebCloseConnection(CFragConnectionID *connID); extern SInt16 WebLMGetCurApRefNum(void); extern void WebLMSetCurApRefNum(SInt16 value); #ifdef __cplusplus } #endif #endif /* ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__) */ WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm0000644000175000017500000005501211242107332020377 0ustar leelee/* * Copyright (C) 2005, 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) #import "WebBaseNetscapePluginStream.h" #import "WebNetscapePluginView.h" #import "WebFrameInternal.h" #import "WebKitErrorsPrivate.h" #import "WebKitLogging.h" #import "WebNSObjectExtras.h" #import "WebNSURLExtras.h" #import "WebNSURLRequestExtras.h" #import "WebNetscapePluginPackage.h" #import #import #import #import #import #import #import #import #import #import using namespace WebCore; using namespace std; #define WEB_REASON_NONE -1 static NSString *CarbonPathFromPOSIXPath(NSString *posixPath); class PluginStopDeferrer { public: PluginStopDeferrer(WebNetscapePluginView* pluginView) : m_pluginView(pluginView) { ASSERT(m_pluginView); [m_pluginView.get() willCallPlugInFunction]; } ~PluginStopDeferrer() { ASSERT(m_pluginView); [m_pluginView.get() didCallPlugInFunction]; } private: RetainPtr m_pluginView; }; typedef HashMap StreamMap; static StreamMap& streams() { DEFINE_STATIC_LOCAL(StreamMap, staticStreams, ()); return staticStreams; } NPP WebNetscapePluginStream::ownerForStream(NPStream *stream) { return streams().get(stream); } NPReason WebNetscapePluginStream::reasonForError(NSError *error) { if (!error) return NPRES_DONE; if ([[error domain] isEqualToString:NSURLErrorDomain] && [error code] == NSURLErrorCancelled) return NPRES_USER_BREAK; return NPRES_NETWORK_ERR; } NSError *WebNetscapePluginStream::pluginCancelledConnectionError() const { return [[[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInCancelledConnection contentURL:m_responseURL ? m_responseURL.get() : m_requestURL.get() pluginPageURL:nil pluginName:[[m_pluginView.get() pluginPackage] name] MIMEType:m_mimeType.get()] autorelease]; } NSError *WebNetscapePluginStream::errorForReason(NPReason reason) const { if (reason == NPRES_DONE) return nil; if (reason == NPRES_USER_BREAK) return [NSError _webKitErrorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled URL:m_responseURL ? m_responseURL.get() : m_requestURL.get()]; return pluginCancelledConnectionError(); } WebNetscapePluginStream::WebNetscapePluginStream(FrameLoader* frameLoader) : m_plugin(0) , m_transferMode(0) , m_offset(0) , m_fileDescriptor(-1) , m_sendNotification(false) , m_notifyData(0) , m_headers(0) , m_reason(NPRES_BASE) , m_isTerminated(false) , m_newStreamSuccessful(false) , m_frameLoader(frameLoader) , m_pluginFuncs(0) , m_deliverDataTimer(this, &WebNetscapePluginStream::deliverDataTimerFired) { memset(&m_stream, 0, sizeof(NPStream)); } WebNetscapePluginStream::WebNetscapePluginStream(NSURLRequest *request, NPP plugin, bool sendNotification, void* notifyData) : m_requestURL([request URL]) , m_plugin(0) , m_transferMode(0) , m_offset(0) , m_fileDescriptor(-1) , m_sendNotification(sendNotification) , m_notifyData(notifyData) , m_headers(0) , m_reason(NPRES_BASE) , m_isTerminated(false) , m_newStreamSuccessful(false) , m_frameLoader(0) , m_request(AdoptNS, [request mutableCopy]) , m_pluginFuncs(0) , m_deliverDataTimer(this, &WebNetscapePluginStream::deliverDataTimerFired) { memset(&m_stream, 0, sizeof(NPStream)); WebNetscapePluginView *view = (WebNetscapePluginView *)plugin->ndata; // This check has already been done by the plug-in view. ASSERT(FrameLoader::canLoad([request URL], String(), core([view webFrame])->document())); ASSERT([request URL]); ASSERT(plugin); setPlugin(plugin); streams().add(&m_stream, plugin); if (core([view webFrame])->loader()->shouldHideReferrer([request URL], core([view webFrame])->loader()->outgoingReferrer())) [m_request.get() _web_setHTTPReferrer:nil]; } WebNetscapePluginStream::~WebNetscapePluginStream() { ASSERT(!m_plugin); ASSERT(m_isTerminated); ASSERT(!m_stream.ndata); // The stream file should have been deleted, and the path freed, in -_destroyStream ASSERT(!m_path); ASSERT(m_fileDescriptor == -1); free((void *)m_stream.url); free(m_headers); streams().remove(&m_stream); } void WebNetscapePluginStream::setPlugin(NPP plugin) { if (plugin) { m_plugin = plugin; m_pluginView = static_cast(m_plugin->ndata); WebNetscapePluginPackage *pluginPackage = [m_pluginView.get() pluginPackage]; m_pluginFuncs = [pluginPackage pluginFuncs]; } else { WebNetscapePluginView *view = m_pluginView.get(); m_plugin = 0; m_pluginFuncs = 0; [view disconnectStream:this]; m_pluginView = 0; } } void WebNetscapePluginStream::startStream(NSURL *url, long long expectedContentLength, NSDate *lastModifiedDate, NSString *mimeType, NSData *headers) { ASSERT(!m_isTerminated); m_responseURL = url; m_mimeType = mimeType; free((void *)m_stream.url); m_stream.url = strdup([m_responseURL.get() _web_URLCString]); m_stream.ndata = this; m_stream.end = expectedContentLength > 0 ? (uint32)expectedContentLength : 0; m_stream.lastmodified = (uint32)[lastModifiedDate timeIntervalSince1970]; m_stream.notifyData = m_notifyData; if (headers) { unsigned len = [headers length]; m_headers = (char*) malloc(len + 1); [headers getBytes:m_headers]; m_headers[len] = 0; m_stream.headers = m_headers; } m_transferMode = NP_NORMAL; m_offset = 0; m_reason = WEB_REASON_NONE; // FIXME: If WebNetscapePluginStream called our initializer we wouldn't have to do this here. m_fileDescriptor = -1; // FIXME: Need a way to check if stream is seekable NPError npErr; { PluginStopDeferrer deferrer(m_pluginView.get()); npErr = m_pluginFuncs->newstream(m_plugin, (char *)[m_mimeType.get() UTF8String], &m_stream, NO, &m_transferMode); } LOG(Plugins, "NPP_NewStream URL=%@ MIME=%@ error=%d", m_responseURL.get(), m_mimeType.get(), npErr); if (npErr != NPERR_NO_ERROR) { LOG_ERROR("NPP_NewStream failed with error: %d responseURL: %@", npErr, m_responseURL.get()); // Calling cancelLoadWithError: cancels the load, but doesn't call NPP_DestroyStream. cancelLoadWithError(pluginCancelledConnectionError()); return; } m_newStreamSuccessful = true; switch (m_transferMode) { case NP_NORMAL: LOG(Plugins, "Stream type: NP_NORMAL"); break; case NP_ASFILEONLY: LOG(Plugins, "Stream type: NP_ASFILEONLY"); break; case NP_ASFILE: LOG(Plugins, "Stream type: NP_ASFILE"); break; case NP_SEEK: LOG_ERROR("Stream type: NP_SEEK not yet supported"); cancelLoadAndDestroyStreamWithError(pluginCancelledConnectionError()); break; default: LOG_ERROR("unknown stream type"); } } void WebNetscapePluginStream::start() { ASSERT(m_request); ASSERT(!m_frameLoader); ASSERT(!m_loader); m_loader = NetscapePlugInStreamLoader::create(core([m_pluginView.get() webFrame]), this); m_loader->setShouldBufferData(false); m_loader->documentLoader()->addPlugInStreamLoader(m_loader.get()); m_loader->load(m_request.get()); } void WebNetscapePluginStream::stop() { ASSERT(!m_frameLoader); if (!m_loader->isDone()) cancelLoadAndDestroyStreamWithError(m_loader->cancelledError()); } void WebNetscapePluginStream::didReceiveResponse(NetscapePlugInStreamLoader*, const ResourceResponse& response) { NSURLResponse *r = response.nsURLResponse(); NSMutableData *theHeaders = nil; long long expectedContentLength = [r expectedContentLength]; if ([r isKindOfClass:[NSHTTPURLResponse class]]) { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)r; theHeaders = [NSMutableData dataWithCapacity:1024]; // FIXME: it would be nice to be able to get the raw HTTP header block. // This includes the HTTP version, the real status text, // all headers in their original order and including duplicates, // and all original bytes verbatim, rather than sent through Unicode translation. // Unfortunately NSHTTPURLResponse doesn't provide access at that low a level. [theHeaders appendBytes:"HTTP " length:5]; char statusStr[10]; long statusCode = [httpResponse statusCode]; snprintf(statusStr, sizeof(statusStr), "%ld", statusCode); [theHeaders appendBytes:statusStr length:strlen(statusStr)]; [theHeaders appendBytes:" OK\n" length:4]; // HACK: pass the headers through as UTF-8. // This is not the intended behavior; we're supposed to pass original bytes verbatim. // But we don't have the original bytes, we have NSStrings built by the URL loading system. // It hopefully shouldn't matter, since RFC2616/RFC822 require ASCII-only headers, // but surely someone out there is using non-ASCII characters, and hopefully UTF-8 is adequate here. // It seems better than NSASCIIStringEncoding, which will lose information if non-ASCII is used. NSDictionary *headerDict = [httpResponse allHeaderFields]; NSArray *keys = [[headerDict allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; NSEnumerator *i = [keys objectEnumerator]; NSString *k; while ((k = [i nextObject]) != nil) { NSString *v = [headerDict objectForKey:k]; [theHeaders appendData:[k dataUsingEncoding:NSUTF8StringEncoding]]; [theHeaders appendBytes:": " length:2]; [theHeaders appendData:[v dataUsingEncoding:NSUTF8StringEncoding]]; [theHeaders appendBytes:"\n" length:1]; } // If the content is encoded (most likely compressed), then don't send its length to the plugin, // which is only interested in the decoded length, not yet known at the moment. // tracks a request for -[NSURLResponse expectedContentLength] to incorporate this logic. NSString *contentEncoding = (NSString *)[[(NSHTTPURLResponse *)r allHeaderFields] objectForKey:@"Content-Encoding"]; if (contentEncoding && ![contentEncoding isEqualToString:@"identity"]) expectedContentLength = -1; // startStreamResponseURL:... will null-terminate. } startStream([r URL], expectedContentLength, WKGetNSURLResponseLastModifiedDate(r), [r MIMEType], theHeaders); } void WebNetscapePluginStream::startStreamWithResponse(NSURLResponse *response) { didReceiveResponse(0, response); } bool WebNetscapePluginStream::wantsAllStreams() const { if (!m_pluginFuncs->getvalue) return false; void *value = 0; NPError error; { PluginStopDeferrer deferrer(m_pluginView.get()); JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); error = m_pluginFuncs->getvalue(m_plugin, NPPVpluginWantsAllNetworkStreams, &value); } if (error != NPERR_NO_ERROR) return false; return value; } void WebNetscapePluginStream::destroyStream() { if (m_isTerminated) return; RefPtr protect(this); ASSERT(m_reason != WEB_REASON_NONE); ASSERT([m_deliveryData.get() length] == 0); m_deliverDataTimer.stop(); if (m_stream.ndata) { if (m_reason == NPRES_DONE && (m_transferMode == NP_ASFILE || m_transferMode == NP_ASFILEONLY)) { ASSERT(m_fileDescriptor == -1); ASSERT(m_path); NSString *carbonPath = CarbonPathFromPOSIXPath(m_path.get()); ASSERT(carbonPath != NULL); PluginStopDeferrer deferrer(m_pluginView.get()); m_pluginFuncs->asfile(m_plugin, &m_stream, [carbonPath fileSystemRepresentation]); LOG(Plugins, "NPP_StreamAsFile responseURL=%@ path=%s", m_responseURL.get(), carbonPath); } if (m_path) { // Delete the file after calling NPP_StreamAsFile(), instead of in -dealloc/-finalize. It should be OK // to delete the file here -- NPP_StreamAsFile() is always called immediately before NPP_DestroyStream() // (the stream destruction function), so there can be no expectation that a plugin will read the stream // file asynchronously after NPP_StreamAsFile() is called. unlink([m_path.get() fileSystemRepresentation]); m_path = 0; if (m_isTerminated) return; } if (m_fileDescriptor != -1) { // The file may still be open if we are destroying the stream before it completed loading. close(m_fileDescriptor); m_fileDescriptor = -1; } if (m_newStreamSuccessful) { PluginStopDeferrer deferrer(m_pluginView.get()); #if !LOG_DISABLED NPError npErr = #endif m_pluginFuncs->destroystream(m_plugin, &m_stream, m_reason); LOG(Plugins, "NPP_DestroyStream responseURL=%@ error=%d", m_responseURL.get(), npErr); } free(m_headers); m_headers = NULL; m_stream.headers = NULL; m_stream.ndata = 0; if (m_isTerminated) return; } if (m_sendNotification) { // NPP_URLNotify expects the request URL, not the response URL. PluginStopDeferrer deferrer(m_pluginView.get()); m_pluginFuncs->urlnotify(m_plugin, [m_requestURL.get() _web_URLCString], m_reason, m_notifyData); LOG(Plugins, "NPP_URLNotify requestURL=%@ reason=%d", m_requestURL.get(), m_reason); } m_isTerminated = true; setPlugin(0); } void WebNetscapePluginStream::destroyStreamWithReason(NPReason reason) { m_reason = reason; if (m_reason != NPRES_DONE) { // Stop any pending data from being streamed. [m_deliveryData.get() setLength:0]; } else if ([m_deliveryData.get() length] > 0) { // There is more data to be streamed, don't destroy the stream now. return; } RefPtr protect(this); destroyStream(); ASSERT(!m_stream.ndata); } void WebNetscapePluginStream::cancelLoadWithError(NSError *error) { if (m_frameLoader) { ASSERT(!m_loader); DocumentLoader* documentLoader = m_frameLoader->activeDocumentLoader(); ASSERT(documentLoader); if (documentLoader->isLoadingMainResource()) documentLoader->cancelMainResourceLoad(error); return; } if (!m_loader->isDone()) m_loader->cancel(error); } void WebNetscapePluginStream::destroyStreamWithError(NSError *error) { destroyStreamWithReason(reasonForError(error)); } void WebNetscapePluginStream::didFail(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceError& error) { destroyStreamWithError(error); } void WebNetscapePluginStream::cancelLoadAndDestroyStreamWithError(NSError *error) { RefPtr protect(this); cancelLoadWithError(error); destroyStreamWithError(error); setPlugin(0); } void WebNetscapePluginStream::deliverData() { if (!m_stream.ndata || [m_deliveryData.get() length] == 0) return; RefPtr protect(this); int32 totalBytes = [m_deliveryData.get() length]; int32 totalBytesDelivered = 0; while (totalBytesDelivered < totalBytes) { PluginStopDeferrer deferrer(m_pluginView.get()); int32 deliveryBytes = m_pluginFuncs->writeready(m_plugin, &m_stream); LOG(Plugins, "NPP_WriteReady responseURL=%@ bytes=%d", m_responseURL.get(), deliveryBytes); if (m_isTerminated) return; if (deliveryBytes <= 0) { // Plug-in can't receive anymore data right now. Send it later. if (!m_deliverDataTimer.isActive()) m_deliverDataTimer.startOneShot(0); break; } else { deliveryBytes = min(deliveryBytes, totalBytes - totalBytesDelivered); NSData *subdata = [m_deliveryData.get() subdataWithRange:NSMakeRange(totalBytesDelivered, deliveryBytes)]; PluginStopDeferrer deferrer(m_pluginView.get()); deliveryBytes = m_pluginFuncs->write(m_plugin, &m_stream, m_offset, [subdata length], (void *)[subdata bytes]); if (deliveryBytes < 0) { // Netscape documentation says that a negative result from NPP_Write means cancel the load. cancelLoadAndDestroyStreamWithError(pluginCancelledConnectionError()); return; } deliveryBytes = min(deliveryBytes, [subdata length]); m_offset += deliveryBytes; totalBytesDelivered += deliveryBytes; LOG(Plugins, "NPP_Write responseURL=%@ bytes=%d total-delivered=%d/%d", m_responseURL.get(), deliveryBytes, m_offset, m_stream.end); } } if (totalBytesDelivered > 0) { if (totalBytesDelivered < totalBytes) { NSMutableData *newDeliveryData = [[NSMutableData alloc] initWithCapacity:totalBytes - totalBytesDelivered]; [newDeliveryData appendBytes:(char *)[m_deliveryData.get() bytes] + totalBytesDelivered length:totalBytes - totalBytesDelivered]; m_deliveryData.adoptNS(newDeliveryData); } else { [m_deliveryData.get() setLength:0]; if (m_reason != WEB_REASON_NONE) destroyStream(); } } } void WebNetscapePluginStream::deliverDataTimerFired(WebCore::Timer* timer) { deliverData(); } void WebNetscapePluginStream::deliverDataToFile(NSData *data) { if (m_fileDescriptor == -1 && !m_path) { NSString *temporaryFileMask = [NSTemporaryDirectory() stringByAppendingPathComponent:@"WebKitPlugInStreamXXXXXX"]; char *temporaryFileName = strdup([temporaryFileMask fileSystemRepresentation]); m_fileDescriptor = mkstemp(temporaryFileName); if (m_fileDescriptor == -1) { LOG_ERROR("Can't create a temporary file."); // This is not a network error, but the only error codes are "network error" and "user break". destroyStreamWithReason(NPRES_NETWORK_ERR); free(temporaryFileName); return; } m_path.adoptNS([[NSString stringWithUTF8String:temporaryFileName] retain]); free(temporaryFileName); } int dataLength = [data length]; if (!dataLength) return; int byteCount = write(m_fileDescriptor, [data bytes], dataLength); if (byteCount != dataLength) { // This happens only rarely, when we are out of disk space or have a disk I/O error. LOG_ERROR("error writing to temporary file, errno %d", errno); close(m_fileDescriptor); m_fileDescriptor = -1; // This is not a network error, but the only error codes are "network error" and "user break". destroyStreamWithReason(NPRES_NETWORK_ERR); m_path = 0; } } void WebNetscapePluginStream::didFinishLoading(NetscapePlugInStreamLoader*) { if (!m_stream.ndata) return; if (m_transferMode == NP_ASFILE || m_transferMode == NP_ASFILEONLY) { // Fake the delivery of an empty data to ensure that the file has been created deliverDataToFile([NSData data]); if (m_fileDescriptor != -1) close(m_fileDescriptor); m_fileDescriptor = -1; } destroyStreamWithReason(NPRES_DONE); } void WebNetscapePluginStream::didReceiveData(NetscapePlugInStreamLoader*, const char* bytes, int length) { NSData *data = [[NSData alloc] initWithBytesNoCopy:(void*)bytes length:length freeWhenDone:NO]; ASSERT([data length] > 0); if (m_transferMode != NP_ASFILEONLY) { if (!m_deliveryData) m_deliveryData.adoptNS([[NSMutableData alloc] initWithCapacity:[data length]]); [m_deliveryData.get() appendData:data]; deliverData(); } if (m_transferMode == NP_ASFILE || m_transferMode == NP_ASFILEONLY) deliverDataToFile(data); [data release]; } static NSString *CarbonPathFromPOSIXPath(NSString *posixPath) { // Doesn't add a trailing colon for directories; this is a problem for paths to a volume, // so this function would need to be revised if we ever wanted to call it with that. CFURLRef url = (CFURLRef)[NSURL fileURLWithPath:posixPath]; if (!url) return nil; return WebCFAutorelease(CFURLCopyFileSystemPath(url, kCFURLHFSPathStyle)); } #endif WebKit/mac/Plugins/WebNetscapePluginView.h0000644000175000017500000001705511225466207017120 0ustar leelee/* * Copyright (C) 2005, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) #import "WebBaseNetscapePluginView.h" #import "WebNetscapeContainerCheckPrivate.h" #import #import #import #import #import @class WebDataSource; @class WebFrame; @class WebNetscapePluginPackage; @class WebView; class PluginTimer; class WebNetscapePluginStream; class WebNetscapePluginEventHandler; typedef union PluginPort { #ifndef NP_NO_QUICKDRAW NP_Port qdPort; #endif NP_CGContext cgPort; } PluginPort; // Because the Adobe 7.x Acrobat plug-in has a hard coded check for a view named // "WebNetscapePluginDocumentView", this class must retain the old name in order // for the plug-in to function correctly. (rdar://problem/4699455) #define WebNetscapePluginView WebNetscapePluginDocumentView @interface WebNetscapePluginView : WebBaseNetscapePluginView { RefPtr _manualStream; #ifndef BUILDING_ON_TIGER RetainPtr _pluginLayer; #endif unsigned _dataLengthReceived; RetainPtr _error; unsigned argsCount; char **cAttributes; char **cValues; NPP plugin; NPWindow window; NPWindow lastSetWindow; PluginPort nPort; PluginPort lastSetPort; NPDrawingModel drawingModel; NPEventModel eventModel; #ifndef NP_NO_QUICKDRAW // This is only valid when drawingModel is NPDrawingModelQuickDraw GWorldPtr offscreenGWorld; #endif OwnPtr _eventHandler; BOOL inSetWindow; BOOL shouldStopSoon; uint32 currentTimerID; HashMap* timers; unsigned pluginFunctionCallDepth; int32 specifiedHeight; int32 specifiedWidth; HashSet > streams; RetainPtr _pendingFrameLoads; BOOL _isFlash; BOOL _isSilverlight; NSMutableDictionary *_containerChecksInProgress; uint32 _currentContainerCheckRequestID; } + (WebNetscapePluginView *)currentPluginView; - (id)initWithFrame:(NSRect)r pluginPackage:(WebNetscapePluginPackage *)thePluginPackage URL:(NSURL *)URL baseURL:(NSURL *)baseURL MIMEType:(NSString *)MIME attributeKeys:(NSArray *)keys attributeValues:(NSArray *)values loadManually:(BOOL)loadManually element:(PassRefPtr)element; - (NPP)plugin; - (void)disconnectStream:(WebNetscapePluginStream*)stream; // Returns the NPObject that represents the plugin interface. // The return value is expected to be retained. - (NPObject *)createPluginScriptableObject; // -willCallPlugInFunction must be called before calling any of the NPP_* functions for this view's plugin. // This is necessary to ensure that plug-ins are not destroyed while WebKit calls into them. Some plug-ins (Flash // at least) are written with the assumption that nothing they do in their plug-in functions can cause NPP_Destroy() // to be called. Unfortunately, this is not true, especially if the plug-in uses NPN_Invoke() to execute a // document.write(), which clears the document and destroys the plug-in. // See . - (void)willCallPlugInFunction; // -didCallPlugInFunction should be called after returning from a plug-in function. It should be called exactly // once for every call to -willCallPlugInFunction. // See . - (void)didCallPlugInFunction; - (void)handleMouseMoved:(NSEvent *)event; - (uint32)checkIfAllowedToLoadURL:(const char*)urlCString frame:(const char*)frameNameCString callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed, void* context))callbackFunc context:(void*)context; - (void)cancelCheckIfAllowedToLoadURL:(uint32)checkID; @end @interface WebNetscapePluginView (WebInternal) - (BOOL)sendEvent:(void*)event isDrawRect:(BOOL)eventIsDrawRect; - (NPEventModel)eventModel; - (NPError)loadRequest:(NSURLRequest *)request inTarget:(NSString *)target withNotifyData:(void *)notifyData sendNotification:(BOOL)sendNotification; - (NPError)getURLNotify:(const char *)URL target:(const char *)target notifyData:(void *)notifyData; - (NPError)getURL:(const char *)URL target:(const char *)target; - (NPError)postURLNotify:(const char *)URL target:(const char *)target len:(UInt32)len buf:(const char *)buf file:(NPBool)file notifyData:(void *)notifyData; - (NPError)postURL:(const char *)URL target:(const char *)target len:(UInt32)len buf:(const char *)buf file:(NPBool)file; - (NPError)newStream:(NPMIMEType)type target:(const char *)target stream:(NPStream**)stream; - (NPError)write:(NPStream*)stream len:(SInt32)len buffer:(void *)buffer; - (NPError)destroyStream:(NPStream*)stream reason:(NPReason)reason; - (void)status:(const char *)message; - (const char *)userAgent; - (void)invalidateRect:(NPRect *)invalidRect; - (void)invalidateRegion:(NPRegion)invalidateRegion; - (void)forceRedraw; - (NPError)getVariable:(NPNVariable)variable value:(void *)value; - (NPError)setVariable:(NPPVariable)variable value:(void *)value; - (uint32)scheduleTimerWithInterval:(uint32)interval repeat:(NPBool)repeat timerFunc:(void (*)(NPP npp, uint32 timerID))timerFunc; - (void)unscheduleTimer:(uint32)timerID; - (NPError)popUpContextMenu:(NPMenu *)menu; - (NPError)getVariable:(NPNURLVariable)variable forURL:(const char*)url value:(char**)value length:(uint32*)length; - (NPError)setVariable:(NPNURLVariable)variable forURL:(const char*)url value:(const char*)value length:(uint32)length; - (NPError)getAuthenticationInfoWithProtocol:(const char*) protocol host:(const char*)host port:(int32)port scheme:(const char*)scheme realm:(const char*)realm username:(char**)username usernameLength:(uint32*)usernameLength password:(char**)password passwordLength:(uint32*)passwordLength; - (char*)resolveURL:(const char*)url forTarget:(const char*)target; @end WKNBrowserContainerCheckFuncs *browserContainerCheckFuncs(); #endif WebKit/mac/Plugins/WebNetscapeContainerCheckPrivate.h0000644000175000017500000000552511203324471021231 0ustar leelee/* * Copyright (C) 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 WebNetscapeContainerCheckPrivate_h #define WebNetscapeContainerCheckPrivate_h #include #ifdef __cplusplus extern "C" { #endif #define WKNVBrowserContainerCheckFuncs 1701 #define WKNVBrowserContainerCheckFuncsVersion 2 #define WKNVBrowserContainerCheckFuncsVersionHasGetLocation 2 typedef uint32 (*WKN_CheckIfAllowedToLoadURLProcPtr)(NPP npp, const char* url, const char* frame, void (*callbackFunc)(NPP npp, uint32, NPBool allowed, void* context), void* context); typedef void (*WKN_CancelCheckIfAllowedToLoadURLProcPtr)(NPP npp, uint32); typedef char* (*WKN_ResolveURLProcPtr)(NPP npp, const char* url, const char* target); uint32 WKN_CheckIfAllowedToLoadURL(NPP npp, const char* url, const char* frame, void (*callbackFunc)(NPP npp, uint32, NPBool allowed, void* context), void* context); void WKN_CancelCheckIfAllowedToLoadURL(NPP npp, uint32); char* WKN_ResolveURL(NPP npp, const char* url, const char* target); typedef struct _WKNBrowserContainerCheckFuncs { uint16 size; uint16 version; WKN_CheckIfAllowedToLoadURLProcPtr checkIfAllowedToLoadURL; WKN_CancelCheckIfAllowedToLoadURLProcPtr cancelCheckIfAllowedToLoadURL; WKN_ResolveURLProcPtr resolveURL; } WKNBrowserContainerCheckFuncs; #ifdef __cplusplus } #endif #endif // WebNetscapeContainerCheckPrivate_h WebKit/mac/Plugins/WebPluginViewFactoryPrivate.h0000644000175000017500000000347511035213625020312 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 typedef enum { WebPlugInModeEmbed = 0, WebPlugInModeFull = 1 } WebPlugInMode; /*! @constant WebPlugInModeKey REQUIRED. Number with one of the values from the WebPlugInMode enum. */ extern NSString *WebPlugInModeKey; WebKit/mac/Plugins/WebNetscapePluginEventHandler.h0000644000175000017500000000576111173157003020557 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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 WebNetscapePluginEventHandler_h #define WebNetscapePluginEventHandler_h #import "WebNetscapePluginView.h" #if ENABLE(NETSCAPE_PLUGIN_API) @class NSEvent; @class WebNetscapePluginView; struct CGRect; class WebNetscapePluginEventHandler { public: static WebNetscapePluginEventHandler* create(WebNetscapePluginView*); virtual ~WebNetscapePluginEventHandler() { } virtual void drawRect(CGContextRef, const NSRect&) = 0; virtual void mouseDown(NSEvent*) = 0; virtual void mouseDragged(NSEvent*) = 0; virtual void mouseEntered(NSEvent*) = 0; virtual void mouseExited(NSEvent*) = 0; virtual void mouseMoved(NSEvent*) = 0; virtual void mouseUp(NSEvent*) = 0; virtual bool scrollWheel(NSEvent*) = 0; virtual void keyDown(NSEvent*) = 0; virtual void keyUp(NSEvent*) = 0; virtual void flagsChanged(NSEvent*) = 0; virtual void syntheticKeyDownWithCommandModifier(int keyCode, char character) = 0; virtual void focusChanged(bool hasFocus) = 0; virtual void windowFocusChanged(bool hasFocus) = 0; virtual void startTimers(bool throttleTimers) { } virtual void stopTimers() { } // Returns the platform specific window used in NPP_SetWindow virtual void* platformWindow(NSWindow*) = 0; bool currentEventIsUserGesture() const { return m_currentEventIsUserGesture; } protected: WebNetscapePluginEventHandler(WebNetscapePluginView* pluginView) : m_pluginView(pluginView) , m_currentEventIsUserGesture(false) { } WebNetscapePluginView* m_pluginView; bool m_currentEventIsUserGesture; }; #endif // ENABLE(NETSCAPE_PLUGIN_API) #endif // WebNetscapePluginEventHandler_h WebKit/mac/Plugins/WebNetscapePluginPackage.h0000644000175000017500000000527211113367335017535 0ustar leelee/* * Copyright (C) 2005, 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) #import "WebBasePluginPackage.h" #ifdef BUILDING_ON_TIGER typedef short ResFileRefNum; #endif #if defined(__ppc__) && !defined(__LP64__) #define SUPPORT_CFM #endif typedef enum { WebCFMExecutableType, WebMachOExecutableType } WebExecutableType; @interface WebNetscapePluginPackage : WebBasePluginPackage { NPPluginFuncs pluginFuncs; NPNetscapeFuncs browserFuncs; uint16 pluginSize; uint16 pluginVersion; ResFileRefNum resourceRef; NPP_ShutdownProcPtr NP_Shutdown; BOOL isLoaded; BOOL needsUnload; unsigned int instanceCount; #if USE(PLUGIN_HOST_PROCESS) cpu_type_t pluginHostArchitecture; #endif #ifdef SUPPORT_CFM BOOL isBundle; BOOL isCFM; CFragConnectionID connID; #endif } // Netscape plug-in packages must be explicitly opened and closed by each plug-in instance. // This is to protect Netscape plug-ins from being unloaded while they are in use. - (void)open; - (void)close; - (WebExecutableType)executableType; - (NPPluginFuncs *)pluginFuncs; #if USE(PLUGIN_HOST_PROCESS) - (cpu_type_t)pluginHostArchitecture; #endif @end #endif WebKit/mac/Plugins/WebNullPluginView.h0000644000175000017500000000342610712726771016272 0ustar leelee/* * Copyright (C) 2005, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @class DOMElement; @interface WebNullPluginView : NSImageView { NSError *error; DOMElement *element; } - (id)initWithFrame:(NSRect)frame error:(NSError *)error DOMElement:(DOMElement *)element; @end WebKit/mac/Plugins/WebPluginController.mm0000644000175000017500000003713111233422436017020 0ustar leelee/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebPluginController.h" #import "DOMNodeInternal.h" #import "WebDataSourceInternal.h" #import "WebFrameInternal.h" #import "WebFrameView.h" #import "WebHTMLViewPrivate.h" #import "WebKitErrorsPrivate.h" #import "WebKitLogging.h" #import "WebNSURLExtras.h" #import "WebNSViewExtras.h" #import "WebPlugin.h" #import "WebPluginContainer.h" #import "WebPluginContainerCheck.h" #import "WebPluginPackage.h" #import "WebPluginPrivate.h" #import "WebPluginViewFactory.h" #import "WebUIDelegate.h" #import "WebViewInternal.h" #import #import #import #import #import #import #import #import #import #import #import #import using namespace WebCore; using namespace HTMLNames; @interface NSView (PluginSecrets) - (void)setContainingWindow:(NSWindow *)w; @end // For compatibility only. @interface NSObject (OldPluginAPI) + (NSView *)pluginViewWithArguments:(NSDictionary *)arguments; @end @interface NSView (OldPluginAPI) - (void)pluginInitialize; - (void)pluginStart; - (void)pluginStop; - (void)pluginDestroy; @end static NSMutableSet *pluginViews = nil; @implementation WebPluginController + (NSView *)plugInViewWithArguments:(NSDictionary *)arguments fromPluginPackage:(WebPluginPackage *)pluginPackage { [pluginPackage load]; Class viewFactory = [pluginPackage viewFactory]; NSView *view = nil; if ([viewFactory respondsToSelector:@selector(plugInViewWithArguments:)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); view = [viewFactory plugInViewWithArguments:arguments]; } else if ([viewFactory respondsToSelector:@selector(pluginViewWithArguments:)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); view = [viewFactory pluginViewWithArguments:arguments]; } if (view == nil) { return nil; } if (pluginViews == nil) { pluginViews = [[NSMutableSet alloc] init]; } [pluginViews addObject:view]; return view; } + (BOOL)isPlugInView:(NSView *)view { return [pluginViews containsObject:view]; } - (id)initWithDocumentView:(NSView *)view { [super init]; _documentView = view; _views = [[NSMutableArray alloc] init]; _checksInProgress = (NSMutableSet *)CFMakeCollectable(CFSetCreateMutable(NULL, 0, NULL)); return self; } - (void)setDataSource:(WebDataSource *)dataSource { _dataSource = dataSource; } - (void)dealloc { [_views release]; [_checksInProgress release]; [super dealloc]; } - (void)startAllPlugins { if (_started) return; if ([_views count] > 0) LOG(Plugins, "starting WebKit plugins : %@", [_views description]); int i, count = [_views count]; for (i = 0; i < count; i++) { id aView = [_views objectAtIndex:i]; if ([aView respondsToSelector:@selector(webPlugInStart)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [aView webPlugInStart]; } else if ([aView respondsToSelector:@selector(pluginStart)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [aView pluginStart]; } } _started = YES; } - (void)stopAllPlugins { if (!_started) return; if ([_views count] > 0) { LOG(Plugins, "stopping WebKit plugins: %@", [_views description]); } int i, count = [_views count]; for (i = 0; i < count; i++) { id aView = [_views objectAtIndex:i]; if ([aView respondsToSelector:@selector(webPlugInStop)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [aView webPlugInStop]; } else if ([aView respondsToSelector:@selector(pluginStop)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [aView pluginStop]; } } _started = NO; } - (void)addPlugin:(NSView *)view { if (!_documentView) { LOG_ERROR("can't add a plug-in to a defunct WebPluginController"); return; } if (![_views containsObject:view]) { [_views addObject:view]; [[_documentView _webView] addPluginInstanceView:view]; BOOL oldDefersCallbacks = [[self webView] defersCallbacks]; if (!oldDefersCallbacks) [[self webView] setDefersCallbacks:YES]; LOG(Plugins, "initializing plug-in %@", view); if ([view respondsToSelector:@selector(webPlugInInitialize)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [view webPlugInInitialize]; } else if ([view respondsToSelector:@selector(pluginInitialize)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [view pluginInitialize]; } if (!oldDefersCallbacks) [[self webView] setDefersCallbacks:NO]; if (_started) { LOG(Plugins, "starting plug-in %@", view); if ([view respondsToSelector:@selector(webPlugInStart)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [view webPlugInStart]; } else if ([view respondsToSelector:@selector(pluginStart)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [view pluginStart]; } if ([view respondsToSelector:@selector(setContainingWindow:)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [view setContainingWindow:[_documentView window]]; } } } } - (void)destroyPlugin:(NSView *)view { if ([_views containsObject:view]) { if (_started) { if ([view respondsToSelector:@selector(webPlugInStop)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [view webPlugInStop]; } else if ([view respondsToSelector:@selector(pluginStop)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [view pluginStop]; } } if ([view respondsToSelector:@selector(webPlugInDestroy)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [view webPlugInDestroy]; } else if ([view respondsToSelector:@selector(pluginDestroy)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [view pluginDestroy]; } #if ENABLE(NETSCAPE_PLUGIN_API) if (Frame* frame = core([self webFrame])) frame->script()->cleanupScriptObjectsForPlugin(self); #endif [pluginViews removeObject:view]; [[_documentView _webView] removePluginInstanceView:view]; [_views removeObject:view]; } } - (void)_webPluginContainerCancelCheckIfAllowedToLoadRequest:(id)checkIdentifier { [checkIdentifier cancel]; [_checksInProgress removeObject:checkIdentifier]; } static void cancelOutstandingCheck(const void *item, void *context) { [(id)item cancel]; } - (void)_cancelOutstandingChecks { if (_checksInProgress) { CFSetApplyFunction((CFSetRef)_checksInProgress, cancelOutstandingCheck, NULL); [_checksInProgress release]; _checksInProgress = nil; } } - (void)destroyAllPlugins { [self stopAllPlugins]; if ([_views count] > 0) { LOG(Plugins, "destroying WebKit plugins: %@", [_views description]); } [self _cancelOutstandingChecks]; int i, count = [_views count]; for (i = 0; i < count; i++) { id aView = [_views objectAtIndex:i]; if ([aView respondsToSelector:@selector(webPlugInDestroy)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [aView webPlugInDestroy]; } else if ([aView respondsToSelector:@selector(pluginDestroy)]) { JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); [aView pluginDestroy]; } #if ENABLE(NETSCAPE_PLUGIN_API) if (Frame* frame = core([self webFrame])) frame->script()->cleanupScriptObjectsForPlugin(self); #endif [pluginViews removeObject:aView]; [[_documentView _webView] removePluginInstanceView:aView]; } [_views makeObjectsPerformSelector:@selector(removeFromSuperviewWithoutNeedingDisplay)]; [_views release]; _views = nil; _documentView = nil; } - (id)_webPluginContainerCheckIfAllowedToLoadRequest:(NSURLRequest *)request inFrame:(NSString *)target resultObject:(id)obj selector:(SEL)selector { WebPluginContainerCheck *check = [WebPluginContainerCheck checkWithRequest:request target:target resultObject:obj selector:selector controller:self contextInfo:nil]; [_checksInProgress addObject:check]; [check start]; return check; } - (void)webPlugInContainerLoadRequest:(NSURLRequest *)request inFrame:(NSString *)target { if (!request) { LOG_ERROR("nil URL passed"); return; } if (!_documentView) { LOG_ERROR("could not load URL %@ because plug-in has already been destroyed", request); return; } WebFrame *frame = [_dataSource webFrame]; if (!frame) { LOG_ERROR("could not load URL %@ because plug-in has already been stopped", request); return; } if (!target) { target = @"_top"; } NSString *JSString = [[request URL] _webkit_scriptIfJavaScriptURL]; if (JSString) { if ([frame findFrameNamed:target] != frame) { LOG_ERROR("JavaScript requests can only be made on the frame that contains the plug-in"); return; } [frame _stringByEvaluatingJavaScriptFromString:JSString]; } else { if (!request) { LOG_ERROR("could not load URL %@", [request URL]); return; } core(frame)->loader()->load(request, target, false); } } // For compatibility only. - (void)showURL:(NSURL *)URL inFrame:(NSString *)target { [self webPlugInContainerLoadRequest:[NSURLRequest requestWithURL:URL] inFrame:target]; } - (void)webPlugInContainerShowStatus:(NSString *)message { if (!message) { message = @""; } if (!_documentView) { LOG_ERROR("could not show status message (%@) because plug-in has already been destroyed", message); return; } WebView *v = [_dataSource _webView]; [[v _UIDelegateForwarder] webView:v setStatusText:message]; } // For compatibility only. - (void)showStatus:(NSString *)message { [self webPlugInContainerShowStatus:message]; } - (NSColor *)webPlugInContainerSelectionColor { bool primary = true; if (Frame* frame = core([self webFrame])) primary = frame->selection()->isFocusedAndActive(); return primary ? [NSColor selectedTextBackgroundColor] : [NSColor secondarySelectedControlColor]; } // For compatibility only. - (NSColor *)selectionColor { return [self webPlugInContainerSelectionColor]; } - (WebFrame *)webFrame { return [_dataSource webFrame]; } - (WebView *)webView { return [[self webFrame] webView]; } - (NSString *)URLPolicyCheckReferrer { NSURL *responseURL = [[[[self webFrame] _dataSource] response] URL]; ASSERT(responseURL); return [responseURL _web_originalDataAsString]; } - (void)pluginView:(NSView *)pluginView receivedResponse:(NSURLResponse *)response { if ([pluginView respondsToSelector:@selector(webPlugInMainResourceDidReceiveResponse:)]) [pluginView webPlugInMainResourceDidReceiveResponse:response]; else { // Cancel the load since this plug-in does its own loading. // FIXME: See for a problem with this. NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInWillHandleLoad contentURL:[response URL] pluginPageURL:nil pluginName:nil // FIXME: Get this from somewhere MIMEType:[response MIMEType]]; [_dataSource _documentLoader]->cancelMainResourceLoad(error); [error release]; } } - (void)pluginView:(NSView *)pluginView receivedData:(NSData *)data { if ([pluginView respondsToSelector:@selector(webPlugInMainResourceDidReceiveData:)]) [pluginView webPlugInMainResourceDidReceiveData:data]; } - (void)pluginView:(NSView *)pluginView receivedError:(NSError *)error { if ([pluginView respondsToSelector:@selector(webPlugInMainResourceDidFailWithError:)]) [pluginView webPlugInMainResourceDidFailWithError:error]; } - (void)pluginViewFinishedLoading:(NSView *)pluginView { if ([pluginView respondsToSelector:@selector(webPlugInMainResourceDidFinishLoading)]) [pluginView webPlugInMainResourceDidFinishLoading]; } #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) static WebCore::HTMLMediaElement* mediaProxyClient(DOMElement* element) { if (!element) { LOG_ERROR("nil element passed"); return nil; } Element* node = core(element); if (!node || (!node->hasTagName(HTMLNames::videoTag) && !node->hasTagName(HTMLNames::audioTag))) { LOG_ERROR("invalid media element passed"); return nil; } return static_cast(node); } - (void)_webPluginContainerSetMediaPlayerProxy:(WebMediaPlayerProxy *)proxy forElement:(DOMElement *)element { WebCore::HTMLMediaElement* client = mediaProxyClient(element); if (client) client->setMediaPlayerProxy(proxy); } - (void)_webPluginContainerPostMediaPlayerNotification:(int)notification forElement:(DOMElement *)element { WebCore::HTMLMediaElement* client = mediaProxyClient(element); if (client) client->deliverNotification((MediaPlayerProxyNotificationType)notification); } #endif @end WebKit/mac/Plugins/Hosted/0000755000175000017500000000000011527024244013747 5ustar leeleeWebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm0000644000175000017500000014341711261517444021770 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #import "NetscapePluginInstanceProxy.h" #import "HostedNetscapePluginStream.h" #import "NetscapePluginHostProxy.h" #import "ProxyInstance.h" #import "WebDataSourceInternal.h" #import "WebFrameInternal.h" #import "WebHostedNetscapePluginView.h" #import "WebKitNSStringExtras.h" #import "WebNSDataExtras.h" #import "WebNSURLExtras.h" #import "WebPluginRequest.h" #import "WebUIDelegate.h" #import "WebUIDelegatePrivate.h" #import "WebViewInternal.h" #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import extern "C" { #import "WebKitPluginClientServer.h" #import "WebKitPluginHost.h" } using namespace JSC; using namespace JSC::Bindings; using namespace std; using namespace WebCore; namespace WebKit { class NetscapePluginInstanceProxy::PluginRequest { public: PluginRequest(uint32_t requestID, NSURLRequest *request, NSString *frameName, bool allowPopups) : m_requestID(requestID) , m_request(request) , m_frameName(frameName) , m_allowPopups(allowPopups) { } uint32_t requestID() const { return m_requestID; } NSURLRequest *request() const { return m_request.get(); } NSString *frameName() const { return m_frameName.get(); } bool allowPopups() const { return m_allowPopups; } private: uint32_t m_requestID; RetainPtr m_request; RetainPtr m_frameName; bool m_allowPopups; }; static uint32_t pluginIDCounter; #ifndef NDEBUG static WTF::RefCountedLeakCounter netscapePluginInstanceProxyCounter("NetscapePluginInstanceProxy"); #endif NetscapePluginInstanceProxy::NetscapePluginInstanceProxy(NetscapePluginHostProxy* pluginHostProxy, WebHostedNetscapePluginView *pluginView, bool fullFramePlugin) : m_pluginHostProxy(pluginHostProxy) , m_pluginView(pluginView) , m_requestTimer(this, &NetscapePluginInstanceProxy::requestTimerFired) , m_currentURLRequestID(0) , m_renderContextID(0) , m_useSoftwareRenderer(false) , m_waitingForReply(false) , m_objectIDCounter(0) , m_urlCheckCounter(0) , m_pluginFunctionCallDepth(0) , m_shouldStopSoon(false) , m_currentRequestID(0) , m_inDestroy(false) { ASSERT(m_pluginView); if (fullFramePlugin) { // For full frame plug-ins, the first requestID will always be the one for the already // open stream. ++m_currentRequestID; } // Assign a plug-in ID. do { m_pluginID = ++pluginIDCounter; } while (pluginHostProxy->pluginInstance(m_pluginID) || !m_pluginID); pluginHostProxy->addPluginInstance(this); #ifndef NDEBUG netscapePluginInstanceProxyCounter.increment(); #endif } NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy() { ASSERT(!m_pluginHostProxy); m_pluginID = 0; deleteAllValues(m_replies); #ifndef NDEBUG netscapePluginInstanceProxyCounter.decrement(); #endif } void NetscapePluginInstanceProxy::resize(NSRect size, NSRect clipRect, bool sync) { uint32_t requestID = 0; if (sync) requestID = nextRequestID(); _WKPHResizePluginInstance(m_pluginHostProxy->port(), m_pluginID, requestID, size.origin.x, size.origin.y, size.size.width, size.size.height, clipRect.origin.x, clipRect.origin.y, clipRect.size.width, clipRect.size.height); if (sync) waitForReply(requestID); } void NetscapePluginInstanceProxy::stopAllStreams() { Vector > streamsCopy; copyValuesToVector(m_streams, streamsCopy); for (size_t i = 0; i < streamsCopy.size(); i++) streamsCopy[i]->stop(); } void NetscapePluginInstanceProxy::cleanup() { stopAllStreams(); m_requestTimer.stop(); // Clear the object map, this will cause any outstanding JS objects that the plug-in had a reference to // to go away when the next garbage collection takes place. m_objects.clear(); if (Frame* frame = core([m_pluginView webFrame])) frame->script()->cleanupScriptObjectsForPlugin(m_pluginView); ProxyInstanceSet instances; instances.swap(m_instances); // Invalidate all proxy instances. ProxyInstanceSet::const_iterator end = instances.end(); for (ProxyInstanceSet::const_iterator it = instances.begin(); it != end; ++it) (*it)->invalidate(); m_pluginView = nil; m_manualStream = 0; } void NetscapePluginInstanceProxy::invalidate() { // If the plug-in host has died, the proxy will be null. if (!m_pluginHostProxy) return; m_pluginHostProxy->removePluginInstance(this); m_pluginHostProxy = 0; } void NetscapePluginInstanceProxy::destroy() { uint32_t requestID = nextRequestID(); m_inDestroy = true; _WKPHDestroyPluginInstance(m_pluginHostProxy->port(), m_pluginID, requestID); // If the plug-in host crashes while we're waiting for a reply, the last reference to the instance proxy // will go away. Prevent this by protecting it here. RefPtr protect(this); // We don't care about the reply here - we just want to block until the plug-in instance has been torn down. waitForReply(requestID); m_inDestroy = false; cleanup(); invalidate(); } void NetscapePluginInstanceProxy::setManualStream(PassRefPtr manualStream) { ASSERT(!m_manualStream); m_manualStream = manualStream; } bool NetscapePluginInstanceProxy::cancelStreamLoad(uint32_t streamID, NPReason reason) { HostedNetscapePluginStream* stream = 0; if (m_manualStream && streamID == 1) stream = m_manualStream.get(); else stream = m_streams.get(streamID).get(); if (!stream) return false; stream->cancelLoad(reason); return true; } void NetscapePluginInstanceProxy::disconnectStream(HostedNetscapePluginStream* stream) { m_streams.remove(stream->streamID()); } void NetscapePluginInstanceProxy::pluginHostDied() { m_pluginHostProxy = 0; [m_pluginView pluginHostDied]; cleanup(); } void NetscapePluginInstanceProxy::focusChanged(bool hasFocus) { _WKPHPluginInstanceFocusChanged(m_pluginHostProxy->port(), m_pluginID, hasFocus); } void NetscapePluginInstanceProxy::windowFocusChanged(bool hasFocus) { _WKPHPluginInstanceWindowFocusChanged(m_pluginHostProxy->port(), m_pluginID, hasFocus); } void NetscapePluginInstanceProxy::windowFrameChanged(NSRect frame) { _WKPHPluginInstanceWindowFrameChanged(m_pluginHostProxy->port(), m_pluginID, frame.origin.x, frame.origin.y, frame.size.width, frame.size.height, NSMaxY([[[NSScreen screens] objectAtIndex:0] frame])); } void NetscapePluginInstanceProxy::startTimers(bool throttleTimers) { _WKPHPluginInstanceStartTimers(m_pluginHostProxy->port(), m_pluginID, throttleTimers); } void NetscapePluginInstanceProxy::mouseEvent(NSView *pluginView, NSEvent *event, NPCocoaEventType type) { NSPoint screenPoint = [[event window] convertBaseToScreen:[event locationInWindow]]; NSPoint pluginPoint = [pluginView convertPoint:[event locationInWindow] fromView:nil]; int clickCount; if (type == NPCocoaEventMouseEntered || type == NPCocoaEventMouseExited) clickCount = 0; else clickCount = [event clickCount]; _WKPHPluginInstanceMouseEvent(m_pluginHostProxy->port(), m_pluginID, [event timestamp], type, [event modifierFlags], pluginPoint.x, pluginPoint.y, screenPoint.x, screenPoint.y, NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]), [event buttonNumber], clickCount, [event deltaX], [event deltaY], [event deltaZ]); } void NetscapePluginInstanceProxy::keyEvent(NSView *pluginView, NSEvent *event, NPCocoaEventType type) { NSData *charactersData = [[event characters] dataUsingEncoding:NSUTF8StringEncoding]; NSData *charactersIgnoringModifiersData = [[event charactersIgnoringModifiers] dataUsingEncoding:NSUTF8StringEncoding]; _WKPHPluginInstanceKeyboardEvent(m_pluginHostProxy->port(), m_pluginID, [event timestamp], type, [event modifierFlags], const_cast(reinterpret_cast([charactersData bytes])), [charactersData length], const_cast(reinterpret_cast([charactersIgnoringModifiersData bytes])), [charactersIgnoringModifiersData length], [event isARepeat], [event keyCode], WKGetNSEventKeyChar(event)); } void NetscapePluginInstanceProxy::syntheticKeyDownWithCommandModifier(int keyCode, char character) { NSData *charactersData = [NSData dataWithBytes:&character length:1]; _WKPHPluginInstanceKeyboardEvent(m_pluginHostProxy->port(), m_pluginID, [NSDate timeIntervalSinceReferenceDate], NPCocoaEventKeyDown, NSCommandKeyMask, const_cast(reinterpret_cast([charactersData bytes])), [charactersData length], const_cast(reinterpret_cast([charactersData bytes])), [charactersData length], false, keyCode, character); } void NetscapePluginInstanceProxy::flagsChanged(NSEvent *event) { _WKPHPluginInstanceKeyboardEvent(m_pluginHostProxy->port(), m_pluginID, [event timestamp], NPCocoaEventFlagsChanged, [event modifierFlags], 0, 0, 0, 0, false, [event keyCode], 0); } void NetscapePluginInstanceProxy::insertText(NSString *text) { NSData *textData = [text dataUsingEncoding:NSUTF8StringEncoding]; _WKPHPluginInstanceInsertText(m_pluginHostProxy->port(), m_pluginID, const_cast(reinterpret_cast([textData bytes])), [textData length]); } bool NetscapePluginInstanceProxy::wheelEvent(NSView *pluginView, NSEvent *event) { NSPoint pluginPoint = [pluginView convertPoint:[event locationInWindow] fromView:nil]; uint32_t requestID = nextRequestID(); _WKPHPluginInstanceWheelEvent(m_pluginHostProxy->port(), m_pluginID, requestID, [event timestamp], [event modifierFlags], pluginPoint.x, pluginPoint.y, [event buttonNumber], [event deltaX], [event deltaY], [event deltaZ]); // Protect ourselves in case waiting for the reply causes us to be deleted. RefPtr protect(this); auto_ptr reply = waitForReply(requestID); if (!reply.get() || !reply->m_result) return false; return true; } void NetscapePluginInstanceProxy::print(CGContextRef context, unsigned width, unsigned height) { uint32_t requestID = nextRequestID(); _WKPHPluginInstancePrint(m_pluginHostProxy->port(), m_pluginID, requestID, width, height); auto_ptr reply = waitForReply(requestID); if (!reply.get() || !reply->m_returnValue) return; RetainPtr dataProvider(AdoptCF, CGDataProviderCreateWithCFData(reply->m_result.get())); RetainPtr colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB()); RetainPtr image(AdoptCF, CGImageCreate(width, height, 8, 32, width * 4, colorSpace.get(), kCGImageAlphaFirst, dataProvider.get(), 0, false, kCGRenderingIntentDefault)); // Flip the context and draw the image. CGContextSaveGState(context); CGContextTranslateCTM(context, 0.0, height); CGContextScaleCTM(context, 1.0, -1.0); CGContextDrawImage(context, CGRectMake(0, 0, width, height), image.get()); CGContextRestoreGState(context); } void NetscapePluginInstanceProxy::stopTimers() { _WKPHPluginInstanceStopTimers(m_pluginHostProxy->port(), m_pluginID); } void NetscapePluginInstanceProxy::status(const char* message) { RetainPtr status(AdoptCF, CFStringCreateWithCString(NULL, message, kCFStringEncodingUTF8)); if (!status) return; WebView *wv = [m_pluginView webView]; [[wv _UIDelegateForwarder] webView:wv setStatusText:(NSString *)status.get()]; } NPError NetscapePluginInstanceProxy::loadURL(const char* url, const char* target, const char* postData, uint32_t postLen, LoadURLFlags flags, uint32_t& streamID) { if (!url) return NPERR_INVALID_PARAM; NSMutableURLRequest *request = [m_pluginView requestWithURLCString:url]; if (flags & IsPost) { NSData *httpBody = nil; if (flags & PostDataIsFile) { // If we're posting a file, buf is either a file URL or a path to the file. RetainPtr bufString(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, postData, kCFStringEncodingWindowsLatin1)); if (!bufString) return NPERR_INVALID_PARAM; NSURL *fileURL = [NSURL _web_URLWithDataAsString:(NSString *)bufString.get()]; NSString *path; if ([fileURL isFileURL]) path = [fileURL path]; else path = (NSString *)bufString.get(); httpBody = [NSData dataWithContentsOfFile:[path _webkit_fixedCarbonPOSIXPath]]; if (!httpBody) return NPERR_FILE_NOT_FOUND; } else httpBody = [NSData dataWithBytes:postData length:postLen]; if (![httpBody length]) return NPERR_INVALID_PARAM; [request setHTTPMethod:@"POST"]; if (flags & AllowHeadersInPostData) { if ([httpBody _web_startsWithBlankLine]) httpBody = [httpBody subdataWithRange:NSMakeRange(1, [httpBody length] - 1)]; else { NSInteger location = [httpBody _web_locationAfterFirstBlankLine]; if (location != NSNotFound) { // If the blank line is somewhere in the middle of postData, everything before is the header. NSData *headerData = [httpBody subdataWithRange:NSMakeRange(0, location)]; NSMutableDictionary *header = [headerData _webkit_parseRFC822HeaderFields]; unsigned dataLength = [httpBody length] - location; // Sometimes plugins like to set Content-Length themselves when they post, // but CFNetwork does not like that. So we will remove the header // and instead truncate the data to the requested length. NSString *contentLength = [header objectForKey:@"Content-Length"]; if (contentLength) dataLength = min(static_cast([contentLength intValue]), dataLength); [header removeObjectForKey:@"Content-Length"]; if ([header count] > 0) [request setAllHTTPHeaderFields:header]; // Everything after the blank line is the actual content of the POST. httpBody = [httpBody subdataWithRange:NSMakeRange(location, dataLength)]; } } } if (![httpBody length]) return NPERR_INVALID_PARAM; // Plug-ins expect to receive uncached data when doing a POST (3347134). [request setCachePolicy:NSURLRequestReloadIgnoringCacheData]; [request setHTTPBody:httpBody]; } return loadRequest(request, target, flags & AllowPopups, streamID); } void NetscapePluginInstanceProxy::performRequest(PluginRequest* pluginRequest) { ASSERT(m_pluginView); NSURLRequest *request = pluginRequest->request(); NSString *frameName = pluginRequest->frameName(); WebFrame *frame = nil; NSURL *URL = [request URL]; NSString *JSString = [URL _webkit_scriptIfJavaScriptURL]; ASSERT(frameName || JSString); if (frameName) { // FIXME - need to get rid of this window creation which // bypasses normal targeted link handling frame = kit(core([m_pluginView webFrame])->loader()->findFrameForNavigation(frameName)); if (!frame) { WebView *currentWebView = [m_pluginView webView]; NSDictionary *features = [[NSDictionary alloc] init]; WebView *newWebView = [[currentWebView _UIDelegateForwarder] webView:currentWebView createWebViewWithRequest:nil windowFeatures:features]; [features release]; if (!newWebView) { _WKPHLoadURLNotify(m_pluginHostProxy->port(), m_pluginID, pluginRequest->requestID(), NPERR_GENERIC_ERROR); return; } frame = [newWebView mainFrame]; core(frame)->tree()->setName(frameName); [[newWebView _UIDelegateForwarder] webViewShow:newWebView]; } } if (JSString) { ASSERT(!frame || [m_pluginView webFrame] == frame); evaluateJavaScript(pluginRequest); } else [frame loadRequest:request]; } void NetscapePluginInstanceProxy::evaluateJavaScript(PluginRequest* pluginRequest) { NSURL *URL = [pluginRequest->request() URL]; NSString *JSString = [URL _webkit_scriptIfJavaScriptURL]; ASSERT(JSString); NSString *result = [[m_pluginView webFrame] _stringByEvaluatingJavaScriptFromString:JSString forceUserGesture:pluginRequest->allowPopups()]; // Don't continue if stringByEvaluatingJavaScriptFromString caused the plug-in to stop. if (!m_pluginHostProxy) return; if (pluginRequest->frameName() != nil) return; if ([result length] > 0) { // Don't call NPP_NewStream and other stream methods if there is no JS result to deliver. This is what Mozilla does. NSData *JSData = [result dataUsingEncoding:NSUTF8StringEncoding]; RefPtr stream = HostedNetscapePluginStream::create(this, pluginRequest->requestID(), pluginRequest->request()); RetainPtr response(AdoptNS, [[NSURLResponse alloc] initWithURL:URL MIMEType:@"text/plain" expectedContentLength:[JSData length] textEncodingName:nil]); stream->startStreamWithResponse(response.get()); stream->didReceiveData(0, static_cast([JSData bytes]), [JSData length]); stream->didFinishLoading(0); } } void NetscapePluginInstanceProxy::requestTimerFired(Timer*) { ASSERT(!m_pluginRequests.isEmpty()); ASSERT(m_pluginView); PluginRequest* request = m_pluginRequests.first(); m_pluginRequests.removeFirst(); if (!m_pluginRequests.isEmpty()) m_requestTimer.startOneShot(0); performRequest(request); delete request; } NPError NetscapePluginInstanceProxy::loadRequest(NSURLRequest *request, const char* cTarget, bool allowPopups, uint32_t& requestID) { NSURL *URL = [request URL]; if (!URL) return NPERR_INVALID_URL; // Don't allow requests to be loaded when the document loader is stopping all loaders. if ([[m_pluginView dataSource] _documentLoader]->isStopping()) return NPERR_GENERIC_ERROR; NSString *target = nil; if (cTarget) { // Find the frame given the target string. target = [NSString stringWithCString:cTarget encoding:NSISOLatin1StringEncoding]; } WebFrame *frame = [m_pluginView webFrame]; // don't let a plugin start any loads if it is no longer part of a document that is being // displayed unless the loads are in the same frame as the plugin. if ([[m_pluginView dataSource] _documentLoader] != core([m_pluginView webFrame])->loader()->activeDocumentLoader() && (!cTarget || [frame findFrameNamed:target] != frame)) { return NPERR_GENERIC_ERROR; } NSString *JSString = [URL _webkit_scriptIfJavaScriptURL]; if (JSString != nil) { if (![[[m_pluginView webView] preferences] isJavaScriptEnabled]) { // Return NPERR_GENERIC_ERROR if JS is disabled. This is what Mozilla does. return NPERR_GENERIC_ERROR; } } else { if (!FrameLoader::canLoad(URL, String(), core([m_pluginView webFrame])->document())) return NPERR_GENERIC_ERROR; } // FIXME: Handle wraparound requestID = ++m_currentURLRequestID; if (cTarget || JSString) { // Make when targetting a frame or evaluating a JS string, perform the request after a delay because we don't // want to potentially kill the plug-in inside of its URL request. if (JSString && target && [frame findFrameNamed:target] != frame) { // For security reasons, only allow JS requests to be made on the frame that contains the plug-in. return NPERR_INVALID_PARAM; } PluginRequest* pluginRequest = new PluginRequest(requestID, request, target, allowPopups); m_pluginRequests.append(pluginRequest); m_requestTimer.startOneShot(0); } else { RefPtr stream = HostedNetscapePluginStream::create(this, requestID, request); m_streams.add(requestID, stream); stream->start(); } return NPERR_NO_ERROR; } NetscapePluginInstanceProxy::Reply* NetscapePluginInstanceProxy::processRequestsAndWaitForReply(uint32_t requestID) { Reply* reply = 0; while (!(reply = m_replies.take(requestID))) { if (!m_pluginHostProxy->processRequests()) return 0; } ASSERT(reply); return reply; } uint32_t NetscapePluginInstanceProxy::idForObject(JSObject* object) { uint32_t objectID = 0; // Assign an object ID. do { objectID = ++m_objectIDCounter; } while (!m_objectIDCounter || m_objectIDCounter == static_cast(-1) || m_objects.contains(objectID)); m_objects.set(objectID, object); return objectID; } // NPRuntime support bool NetscapePluginInstanceProxy::getWindowNPObject(uint32_t& objectID) { Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; if (!frame->script()->isEnabled()) objectID = 0; else objectID = idForObject(frame->script()->windowShell()->window()); return true; } bool NetscapePluginInstanceProxy::getPluginElementNPObject(uint32_t& objectID) { Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; if (JSObject* object = frame->script()->jsObjectForPluginElement([m_pluginView element])) objectID = idForObject(object); else objectID = 0; return true; } void NetscapePluginInstanceProxy::releaseObject(uint32_t objectID) { m_objects.remove(objectID); } bool NetscapePluginInstanceProxy::evaluate(uint32_t objectID, const String& script, data_t& resultData, mach_msg_type_number_t& resultLength, bool allowPopups) { resultData = 0; resultLength = 0; if (!m_objects.contains(objectID)) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; JSLock lock(SilenceAssertionsOnly); ProtectedPtr globalObject = frame->script()->globalObject(); ExecState* exec = globalObject->globalExec(); bool oldAllowPopups = frame->script()->allowPopupsFromPlugin(); frame->script()->setAllowPopupsFromPlugin(allowPopups); globalObject->globalData()->timeoutChecker.start(); Completion completion = JSC::evaluate(exec, globalObject->globalScopeChain(), makeSource(script)); globalObject->globalData()->timeoutChecker.stop(); ComplType type = completion.complType(); frame->script()->setAllowPopupsFromPlugin(oldAllowPopups); JSValue result; if (type == Normal) result = completion.value(); if (!result) result = jsUndefined(); marshalValue(exec, result, resultData, resultLength); exec->clearException(); return true; } bool NetscapePluginInstanceProxy::invoke(uint32_t objectID, const Identifier& methodName, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength) { resultData = 0; resultLength = 0; if (m_inDestroy) return false; JSObject* object = m_objects.get(objectID); if (!object) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; ExecState* exec = frame->script()->globalObject()->globalExec(); JSLock lock(SilenceAssertionsOnly); JSValue function = object->get(exec, methodName); CallData callData; CallType callType = function.getCallData(callData); if (callType == CallTypeNone) return false; MarkedArgumentBuffer argList; demarshalValues(exec, argumentsData, argumentsLength, argList); ProtectedPtr globalObject = frame->script()->globalObject(); globalObject->globalData()->timeoutChecker.start(); JSValue value = call(exec, function, callType, callData, object, argList); globalObject->globalData()->timeoutChecker.stop(); marshalValue(exec, value, resultData, resultLength); exec->clearException(); return true; } bool NetscapePluginInstanceProxy::invokeDefault(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength) { if (m_inDestroy) return false; JSObject* object = m_objects.get(objectID); if (!object) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; ExecState* exec = frame->script()->globalObject()->globalExec(); JSLock lock(SilenceAssertionsOnly); CallData callData; CallType callType = object->getCallData(callData); if (callType == CallTypeNone) return false; MarkedArgumentBuffer argList; demarshalValues(exec, argumentsData, argumentsLength, argList); ProtectedPtr globalObject = frame->script()->globalObject(); globalObject->globalData()->timeoutChecker.start(); JSValue value = call(exec, object, callType, callData, object, argList); globalObject->globalData()->timeoutChecker.stop(); marshalValue(exec, value, resultData, resultLength); exec->clearException(); return true; } bool NetscapePluginInstanceProxy::construct(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength) { if (m_inDestroy) return false; JSObject* object = m_objects.get(objectID); if (!object) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; ExecState* exec = frame->script()->globalObject()->globalExec(); JSLock lock(SilenceAssertionsOnly); ConstructData constructData; ConstructType constructType = object->getConstructData(constructData); if (constructType == ConstructTypeNone) return false; MarkedArgumentBuffer argList; demarshalValues(exec, argumentsData, argumentsLength, argList); ProtectedPtr globalObject = frame->script()->globalObject(); globalObject->globalData()->timeoutChecker.start(); JSValue value = JSC::construct(exec, object, constructType, constructData, argList); globalObject->globalData()->timeoutChecker.stop(); marshalValue(exec, value, resultData, resultLength); exec->clearException(); return true; } bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, const Identifier& propertyName, data_t& resultData, mach_msg_type_number_t& resultLength) { if (m_inDestroy) return false; JSObject* object = m_objects.get(objectID); if (!object) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; ExecState* exec = frame->script()->globalObject()->globalExec(); JSLock lock(SilenceAssertionsOnly); JSValue value = object->get(exec, propertyName); marshalValue(exec, value, resultData, resultLength); exec->clearException(); return true; } bool NetscapePluginInstanceProxy::getProperty(uint32_t objectID, unsigned propertyName, data_t& resultData, mach_msg_type_number_t& resultLength) { JSObject* object = m_objects.get(objectID); if (!object) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; ExecState* exec = frame->script()->globalObject()->globalExec(); JSLock lock(SilenceAssertionsOnly); JSValue value = object->get(exec, propertyName); marshalValue(exec, value, resultData, resultLength); exec->clearException(); return true; } bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, const Identifier& propertyName, data_t valueData, mach_msg_type_number_t valueLength) { if (m_inDestroy) return false; JSObject* object = m_objects.get(objectID); if (!object) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; ExecState* exec = frame->script()->globalObject()->globalExec(); JSLock lock(SilenceAssertionsOnly); JSValue value = demarshalValue(exec, valueData, valueLength); PutPropertySlot slot; object->put(exec, propertyName, value, slot); exec->clearException(); return true; } bool NetscapePluginInstanceProxy::setProperty(uint32_t objectID, unsigned propertyName, data_t valueData, mach_msg_type_number_t valueLength) { if (m_inDestroy) return false; JSObject* object = m_objects.get(objectID); if (!object) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; ExecState* exec = frame->script()->globalObject()->globalExec(); JSLock lock(SilenceAssertionsOnly); JSValue value = demarshalValue(exec, valueData, valueLength); object->put(exec, propertyName, value); exec->clearException(); return true; } bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, const Identifier& propertyName) { if (m_inDestroy) return false; JSObject* object = m_objects.get(objectID); if (!object) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; ExecState* exec = frame->script()->globalObject()->globalExec(); if (!object->hasProperty(exec, propertyName)) { exec->clearException(); return false; } JSLock lock(SilenceAssertionsOnly); object->deleteProperty(exec, propertyName); exec->clearException(); return true; } bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, unsigned propertyName) { if (m_inDestroy) return false; JSObject* object = m_objects.get(objectID); if (!object) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; ExecState* exec = frame->script()->globalObject()->globalExec(); if (!object->hasProperty(exec, propertyName)) { exec->clearException(); return false; } JSLock lock(SilenceAssertionsOnly); object->deleteProperty(exec, propertyName); exec->clearException(); return true; } bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, const Identifier& propertyName) { if (m_inDestroy) return false; JSObject* object = m_objects.get(objectID); if (!object) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; ExecState* exec = frame->script()->globalObject()->globalExec(); bool result = object->hasProperty(exec, propertyName); exec->clearException(); return result; } bool NetscapePluginInstanceProxy::hasProperty(uint32_t objectID, unsigned propertyName) { if (m_inDestroy) return false; JSObject* object = m_objects.get(objectID); if (!object) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; ExecState* exec = frame->script()->globalObject()->globalExec(); bool result = object->hasProperty(exec, propertyName); exec->clearException(); return result; } bool NetscapePluginInstanceProxy::hasMethod(uint32_t objectID, const Identifier& methodName) { if (m_inDestroy) return false; JSObject* object = m_objects.get(objectID); if (!object) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; ExecState* exec = frame->script()->globalObject()->globalExec(); JSLock lock(SilenceAssertionsOnly); JSValue func = object->get(exec, methodName); exec->clearException(); return !func.isUndefined(); } bool NetscapePluginInstanceProxy::enumerate(uint32_t objectID, data_t& resultData, mach_msg_type_number_t& resultLength) { if (m_inDestroy) return false; JSObject* object = m_objects.get(objectID); if (!object) return false; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; ExecState* exec = frame->script()->globalObject()->globalExec(); JSLock lock(SilenceAssertionsOnly); PropertyNameArray propertyNames(exec); object->getPropertyNames(exec, propertyNames); RetainPtr array(AdoptNS, [[NSMutableArray alloc] init]); for (unsigned i = 0; i < propertyNames.size(); i++) { uint64_t methodName = reinterpret_cast(_NPN_GetStringIdentifier(propertyNames[i].ustring().UTF8String().c_str())); [array.get() addObject:[NSNumber numberWithLongLong:methodName]]; } NSData *data = [NSPropertyListSerialization dataFromPropertyList:array.get() format:NSPropertyListBinaryFormat_v1_0 errorDescription:0]; ASSERT(data); resultLength = [data length]; mig_allocate(reinterpret_cast(&resultData), resultLength); memcpy(resultData, [data bytes], resultLength); exec->clearException(); return true; } void NetscapePluginInstanceProxy::addValueToArray(NSMutableArray *array, ExecState* exec, JSValue value) { JSLock lock(SilenceAssertionsOnly); if (value.isString()) { [array addObject:[NSNumber numberWithInt:StringValueType]]; [array addObject:String(value.toString(exec))]; } else if (value.isNumber()) { [array addObject:[NSNumber numberWithInt:DoubleValueType]]; [array addObject:[NSNumber numberWithDouble:value.toNumber(exec)]]; } else if (value.isBoolean()) { [array addObject:[NSNumber numberWithInt:BoolValueType]]; [array addObject:[NSNumber numberWithBool:value.toBoolean(exec)]]; } else if (value.isNull()) [array addObject:[NSNumber numberWithInt:NullValueType]]; else if (value.isObject()) { JSObject* object = asObject(value); if (object->classInfo() == &RuntimeObjectImp::s_info) { RuntimeObjectImp* imp = static_cast(object); if (ProxyInstance* instance = static_cast(imp->getInternalInstance())) { [array addObject:[NSNumber numberWithInt:NPObjectValueType]]; [array addObject:[NSNumber numberWithInt:instance->objectID()]]; } } else { [array addObject:[NSNumber numberWithInt:JSObjectValueType]]; [array addObject:[NSNumber numberWithInt:idForObject(object)]]; } } else [array addObject:[NSNumber numberWithInt:VoidValueType]]; } void NetscapePluginInstanceProxy::marshalValue(ExecState* exec, JSValue value, data_t& resultData, mach_msg_type_number_t& resultLength) { RetainPtr array(AdoptNS, [[NSMutableArray alloc] init]); addValueToArray(array.get(), exec, value); RetainPtr data = [NSPropertyListSerialization dataFromPropertyList:array.get() format:NSPropertyListBinaryFormat_v1_0 errorDescription:0]; ASSERT(data); resultLength = [data.get() length]; mig_allocate(reinterpret_cast(&resultData), resultLength); memcpy(resultData, [data.get() bytes], resultLength); } RetainPtr NetscapePluginInstanceProxy::marshalValues(ExecState* exec, const ArgList& args) { RetainPtr array(AdoptNS, [[NSMutableArray alloc] init]); for (unsigned i = 0; i < args.size(); i++) addValueToArray(array.get(), exec, args.at(i)); RetainPtr data = [NSPropertyListSerialization dataFromPropertyList:array.get() format:NSPropertyListBinaryFormat_v1_0 errorDescription:0]; ASSERT(data); return data; } bool NetscapePluginInstanceProxy::demarshalValueFromArray(ExecState* exec, NSArray *array, NSUInteger& index, JSValue& result) { if (index == [array count]) return false; int type = [[array objectAtIndex:index++] intValue]; switch (type) { case VoidValueType: result = jsUndefined(); return true; case NullValueType: result = jsNull(); return true; case BoolValueType: result = jsBoolean([[array objectAtIndex:index++] boolValue]); return true; case DoubleValueType: result = jsNumber(exec, [[array objectAtIndex:index++] doubleValue]); return true; case StringValueType: { NSString *string = [array objectAtIndex:index++]; result = jsString(exec, String(string)); return true; } case JSObjectValueType: { uint32_t objectID = [[array objectAtIndex:index++] intValue]; result = m_objects.get(objectID); ASSERT(result); return true; } case NPObjectValueType: { uint32_t objectID = [[array objectAtIndex:index++] intValue]; Frame* frame = core([m_pluginView webFrame]); if (!frame) return false; if (!frame->script()->isEnabled()) return false; RefPtr rootObject = frame->script()->createRootObject(m_pluginView); if (!rootObject) return false; result = ProxyInstance::create(rootObject.release(), this, objectID)->createRuntimeObject(exec); return true; } default: ASSERT_NOT_REACHED(); return false; } } JSValue NetscapePluginInstanceProxy::demarshalValue(ExecState* exec, const char* valueData, mach_msg_type_number_t valueLength) { RetainPtr data(AdoptNS, [[NSData alloc] initWithBytesNoCopy:(void*)valueData length:valueLength freeWhenDone:NO]); RetainPtr array = [NSPropertyListSerialization propertyListFromData:data.get() mutabilityOption:NSPropertyListImmutable format:0 errorDescription:0]; NSUInteger position = 0; JSValue value; bool result = demarshalValueFromArray(exec, array.get(), position, value); ASSERT_UNUSED(result, result); return value; } void NetscapePluginInstanceProxy::demarshalValues(ExecState* exec, data_t valuesData, mach_msg_type_number_t valuesLength, MarkedArgumentBuffer& result) { RetainPtr data(AdoptNS, [[NSData alloc] initWithBytesNoCopy:valuesData length:valuesLength freeWhenDone:NO]); RetainPtr array = [NSPropertyListSerialization propertyListFromData:data.get() mutabilityOption:NSPropertyListImmutable format:0 errorDescription:0]; NSUInteger position = 0; JSValue value; while (demarshalValueFromArray(exec, array.get(), position, value)) result.append(value); } PassRefPtr NetscapePluginInstanceProxy::createBindingsInstance(PassRefPtr rootObject) { uint32_t requestID = nextRequestID(); if (_WKPHGetScriptableNPObject(m_pluginHostProxy->port(), m_pluginID, requestID) != KERN_SUCCESS) return 0; auto_ptr reply = waitForReply(requestID); if (!reply.get()) return 0; if (!reply->m_objectID) return 0; return ProxyInstance::create(rootObject, this, reply->m_objectID); } void NetscapePluginInstanceProxy::addInstance(ProxyInstance* instance) { ASSERT(!m_instances.contains(instance)); m_instances.add(instance); } void NetscapePluginInstanceProxy::removeInstance(ProxyInstance* instance) { ASSERT(m_instances.contains(instance)); m_instances.remove(instance); } void NetscapePluginInstanceProxy::willCallPluginFunction() { m_pluginFunctionCallDepth++; } void NetscapePluginInstanceProxy::didCallPluginFunction() { ASSERT(m_pluginFunctionCallDepth > 0); m_pluginFunctionCallDepth--; // If -stop was called while we were calling into a plug-in function, and we're no longer // inside a plug-in function, stop now. if (!m_pluginFunctionCallDepth && m_shouldStopSoon) { m_shouldStopSoon = false; [m_pluginView stop]; } } bool NetscapePluginInstanceProxy::shouldStop() { if (m_pluginFunctionCallDepth) { m_shouldStopSoon = true; return false; } return true; } uint32_t NetscapePluginInstanceProxy::nextRequestID() { uint32_t requestID = ++m_currentRequestID; // We don't want to return the HashMap empty/deleted "special keys" if (requestID == 0 || requestID == static_cast(-1)) return nextRequestID(); return requestID; } void NetscapePluginInstanceProxy::invalidateRect(double x, double y, double width, double height) { ASSERT(m_pluginView); [m_pluginView invalidatePluginContentRect:NSMakeRect(x, y, width, height)]; } bool NetscapePluginInstanceProxy::getCookies(data_t urlData, mach_msg_type_number_t urlLength, data_t& cookiesData, mach_msg_type_number_t& cookiesLength) { ASSERT(m_pluginView); NSURL *url = [m_pluginView URLWithCString:urlData]; if (!url) return false; if (Frame* frame = core([m_pluginView webFrame])) { String cookieString = cookies(frame->document(), url); WebCore::CString cookieStringUTF8 = cookieString.utf8(); if (cookieStringUTF8.isNull()) return false; cookiesLength = cookieStringUTF8.length(); mig_allocate(reinterpret_cast(&cookiesData), cookiesLength); memcpy(cookiesData, cookieStringUTF8.data(), cookiesLength); return true; } return false; } bool NetscapePluginInstanceProxy::setCookies(data_t urlData, mach_msg_type_number_t urlLength, data_t cookiesData, mach_msg_type_number_t cookiesLength) { ASSERT(m_pluginView); NSURL *url = [m_pluginView URLWithCString:urlData]; if (!url) return false; if (Frame* frame = core([m_pluginView webFrame])) { String cookieString = String::fromUTF8(cookiesData, cookiesLength); if (!cookieString) return false; WebCore::setCookies(frame->document(), url, cookieString); return true; } return false; } bool NetscapePluginInstanceProxy::getProxy(data_t urlData, mach_msg_type_number_t urlLength, data_t& proxyData, mach_msg_type_number_t& proxyLength) { ASSERT(m_pluginView); NSURL *url = [m_pluginView URLWithCString:urlData]; if (!url) return false; WebCore::CString proxyStringUTF8 = proxiesForURL(url); proxyLength = proxyStringUTF8.length(); mig_allocate(reinterpret_cast(&proxyData), proxyLength); memcpy(proxyData, proxyStringUTF8.data(), proxyLength); return true; } bool NetscapePluginInstanceProxy::getAuthenticationInfo(data_t protocolData, data_t hostData, uint32_t port, data_t schemeData, data_t realmData, data_t& usernameData, mach_msg_type_number_t& usernameLength, data_t& passwordData, mach_msg_type_number_t& passwordLength) { WebCore::CString username; WebCore::CString password; if (!WebKit::getAuthenticationInfo(protocolData, hostData, port, schemeData, realmData, username, password)) return false; usernameLength = username.length(); mig_allocate(reinterpret_cast(&usernameData), usernameLength); memcpy(usernameData, username.data(), usernameLength); passwordLength = password.length(); mig_allocate(reinterpret_cast(&passwordData), passwordLength); memcpy(passwordData, password.data(), passwordLength); return true; } bool NetscapePluginInstanceProxy::convertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double& destX, double& destY, NPCoordinateSpace destSpace) { ASSERT(m_pluginView); return [m_pluginView convertFromX:sourceX andY:sourceY space:sourceSpace toX:&destX andY:&destY space:destSpace]; } uint32_t NetscapePluginInstanceProxy::checkIfAllowedToLoadURL(const char* url, const char* target) { uint32_t checkID; // Assign a check ID do { checkID = ++m_urlCheckCounter; } while (m_urlChecks.contains(checkID) || !m_urlCheckCounter); NSString *frameName = target ? [NSString stringWithCString:target encoding:NSISOLatin1StringEncoding] : nil; NSNumber *contextInfo = [[NSNumber alloc] initWithUnsignedInt:checkID]; WebPluginContainerCheck *check = [WebPluginContainerCheck checkWithRequest:[m_pluginView requestWithURLCString:url] target:frameName resultObject:m_pluginView selector:@selector(_containerCheckResult:contextInfo:) controller:m_pluginView contextInfo:contextInfo]; [contextInfo release]; m_urlChecks.set(checkID, check); [check start]; return checkID; } void NetscapePluginInstanceProxy::cancelCheckIfAllowedToLoadURL(uint32_t checkID) { URLCheckMap::iterator it = m_urlChecks.find(checkID); if (it == m_urlChecks.end()) return; WebPluginContainerCheck *check = it->second.get(); [check cancel]; m_urlChecks.remove(it); } void NetscapePluginInstanceProxy::checkIfAllowedToLoadURLResult(uint32_t checkID, bool allowed) { _WKPHCheckIfAllowedToLoadURLResult(m_pluginHostProxy->port(), m_pluginID, checkID, allowed); } void NetscapePluginInstanceProxy::resolveURL(const char* url, const char* target, data_t& resolvedURLData, mach_msg_type_number_t& resolvedURLLength) { ASSERT(m_pluginView); WebCore::CString resolvedURL = [m_pluginView resolvedURLStringForURL:url target:target]; resolvedURLLength = resolvedURL.length(); mig_allocate(reinterpret_cast(&resolvedURLData), resolvedURLLength); memcpy(resolvedURLData, resolvedURL.data(), resolvedURLLength); } } // namespace WebKit #endif // USE(PLUGIN_HOST_PROCESS) WebKit/mac/Plugins/Hosted/WebKitPluginAgentReply.defs0000644000175000017500000000320311225466207021153 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #include subsystem WebKitPluginAgentReply 200; serverprefix WKPA; userprefix _WKPA; skip; // CheckInApplication simpleroutine SpawnPluginHostReply(_replyPort :mach_port_move_send_once_t; in pluginHostPort: mach_port_move_send_t); skip; // CheckInPluginHost WebKit/mac/Plugins/Hosted/WebTextInputWindowController.h0000644000175000017500000000343111150051774021757 0ustar leelee/* * Copyright (C) 2009 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #ifndef WebTextInputWindowController_h #define WebTextInputWindowController_h @class WebTextInputPanel; @interface WebTextInputWindowController : NSObject { WebTextInputPanel *_panel; } + (WebTextInputWindowController *)sharedTextInputWindowController; - (NSTextInputContext *)inputContext; - (BOOL)interpretKeyEvent:(NSEvent *)event string:(NSString **)string; @end #endif // WebTextInputWindowController_h #endif // USE(PLUGIN_HOST_PROCESS) WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm0000644000175000017500000003133111225466207021361 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #import "NetscapePluginHostManager.h" #import "NetscapePluginHostProxy.h" #import "NetscapePluginInstanceProxy.h" #import "WebLocalizableStrings.h" #import "WebKitSystemInterface.h" #import "WebNetscapePluginPackage.h" #import #import #import #import #import #import extern "C" { #import "WebKitPluginAgent.h" #import "WebKitPluginHost.h" } using namespace std; namespace WebKit { NetscapePluginHostManager& NetscapePluginHostManager::shared() { DEFINE_STATIC_LOCAL(NetscapePluginHostManager, pluginHostManager, ()); return pluginHostManager; } static const NSString *pluginHostAppName = @"WebKitPluginHost.app"; NetscapePluginHostManager::NetscapePluginHostManager() : m_pluginVendorPort(MACH_PORT_NULL) { } NetscapePluginHostManager::~NetscapePluginHostManager() { } NetscapePluginHostProxy* NetscapePluginHostManager::hostForPackage(WebNetscapePluginPackage *package) { pair result = m_pluginHosts.add(package, 0); // The package was already in the map, just return it. if (!result.second) return result.first->second; mach_port_t clientPort; if (mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &clientPort) != KERN_SUCCESS) { m_pluginHosts.remove(result.first); return 0; } mach_port_t pluginHostPort; ProcessSerialNumber pluginHostPSN; if (!spawnPluginHost(package, clientPort, pluginHostPort, pluginHostPSN)) { mach_port_destroy(mach_task_self(), clientPort); m_pluginHosts.remove(result.first); return 0; } // Since Flash NPObjects add methods dynamically, we don't want to cache when a property/method doesn't exist // on an object because it could be added later. bool shouldCacheMissingPropertiesAndMethods = ![[[package bundle] bundleIdentifier] isEqualToString:@"com.macromedia.Flash Player.plugin"]; NetscapePluginHostProxy* hostProxy = new NetscapePluginHostProxy(clientPort, pluginHostPort, pluginHostPSN, shouldCacheMissingPropertiesAndMethods); CFRetain(package); result.first->second = hostProxy; return hostProxy; } bool NetscapePluginHostManager::spawnPluginHost(WebNetscapePluginPackage *package, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN) { if (m_pluginVendorPort == MACH_PORT_NULL) { if (!initializeVendorPort()) return false; } mach_port_t renderServerPort = WKInitializeRenderServer(); if (renderServerPort == MACH_PORT_NULL) return false; NSString *pluginHostAppPath = [[NSBundle bundleWithIdentifier:@"com.apple.WebKit"] pathForAuxiliaryExecutable:pluginHostAppName]; NSString *pluginHostAppExecutablePath = [[NSBundle bundleWithPath:pluginHostAppPath] executablePath]; RetainPtr localization(AdoptCF, WKCopyCFLocalizationPreferredName(NULL)); NSDictionary *launchProperties = [[NSDictionary alloc] initWithObjectsAndKeys: pluginHostAppExecutablePath, @"pluginHostPath", [NSNumber numberWithInt:[package pluginHostArchitecture]], @"cpuType", localization.get(), @"localization", nil]; NSData *data = [NSPropertyListSerialization dataFromPropertyList:launchProperties format:NSPropertyListBinaryFormat_v1_0 errorDescription:0]; ASSERT(data); [launchProperties release]; kern_return_t kr = _WKPASpawnPluginHost(m_pluginVendorPort, reinterpret_cast(const_cast([data bytes])), [data length], &pluginHostPort); if (kr == MACH_SEND_INVALID_DEST) { // The plug-in vendor port has gone away for some reason. Try to reinitialize it. m_pluginVendorPort = MACH_PORT_NULL; if (!initializeVendorPort()) return false; // And spawn the plug-in host again. kr = _WKPASpawnPluginHost(m_pluginVendorPort, reinterpret_cast(const_cast([data bytes])), [data length], &pluginHostPort); } if (kr != KERN_SUCCESS) { // FIXME: Check for invalid dest and try to re-spawn the plug-in agent. LOG_ERROR("Failed to spawn plug-in host, error %x", kr); return false; } NSString *visibleName = [NSString stringWithFormat:UI_STRING("%@ (%@ Internet plug-in)", "visible name of the plug-in host process. The first argument is the plug-in name " "and the second argument is the application name."), [[package filename] stringByDeletingPathExtension], [[NSProcessInfo processInfo] processName]]; NSDictionary *hostProperties = [[NSDictionary alloc] initWithObjectsAndKeys: visibleName, @"visibleName", [package path], @"bundlePath", nil]; data = [NSPropertyListSerialization dataFromPropertyList:hostProperties format:NSPropertyListBinaryFormat_v1_0 errorDescription:nil]; ASSERT(data); [hostProperties release]; ProcessSerialNumber psn; GetCurrentProcess(&psn); kr = _WKPHCheckInWithPluginHost(pluginHostPort, (uint8_t*)[data bytes], [data length], clientPort, psn.highLongOfPSN, psn.lowLongOfPSN, renderServerPort, &pluginHostPSN.highLongOfPSN, &pluginHostPSN.lowLongOfPSN); if (kr != KERN_SUCCESS) { mach_port_deallocate(mach_task_self(), pluginHostPort); LOG_ERROR("Failed to check in with plug-in host, error %x", kr); return false; } return true; } bool NetscapePluginHostManager::initializeVendorPort() { ASSERT(m_pluginVendorPort == MACH_PORT_NULL); // Get the plug-in agent port. mach_port_t pluginAgentPort; if (bootstrap_look_up(bootstrap_port, "com.apple.WebKit.PluginAgent", &pluginAgentPort) != KERN_SUCCESS) { LOG_ERROR("Failed to look up the plug-in agent port"); return false; } NSData *appNameData = [[[NSProcessInfo processInfo] processName] dataUsingEncoding:NSUTF8StringEncoding]; // Tell the plug-in agent that we exist. if (_WKPACheckInApplication(pluginAgentPort, (uint8_t*)[appNameData bytes], [appNameData length], &m_pluginVendorPort) != KERN_SUCCESS) return false; // FIXME: Should we add a notification for when the vendor port dies? return true; } void NetscapePluginHostManager::pluginHostDied(NetscapePluginHostProxy* pluginHost) { PluginHostMap::iterator end = m_pluginHosts.end(); // This has O(n) complexity but the number of active plug-in hosts is very small so it shouldn't matter. for (PluginHostMap::iterator it = m_pluginHosts.begin(); it != end; ++it) { if (it->second == pluginHost) { m_pluginHosts.remove(it); return; } } } PassRefPtr NetscapePluginHostManager::instantiatePlugin(WebNetscapePluginPackage *pluginPackage, WebHostedNetscapePluginView *pluginView, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame) { NetscapePluginHostProxy* hostProxy = hostForPackage(pluginPackage); if (!hostProxy) return 0; RetainPtr properties(AdoptNS, [[NSMutableDictionary alloc] init]); if (mimeType) [properties.get() setObject:mimeType forKey:@"mimeType"]; ASSERT_ARG(userAgent, userAgent); [properties.get() setObject:userAgent forKey:@"userAgent"]; ASSERT_ARG(attributeKeys, attributeKeys); [properties.get() setObject:attributeKeys forKey:@"attributeKeys"]; ASSERT_ARG(attributeValues, attributeValues); [properties.get() setObject:attributeValues forKey:@"attributeValues"]; if (sourceURL) [properties.get() setObject:[sourceURL absoluteString] forKey:@"sourceURL"]; [properties.get() setObject:[NSNumber numberWithBool:fullFrame] forKey:@"fullFrame"]; NSData *data = [NSPropertyListSerialization dataFromPropertyList:properties.get() format:NSPropertyListBinaryFormat_v1_0 errorDescription:nil]; ASSERT(data); RefPtr instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView, fullFrame); uint32_t requestID = instance->nextRequestID(); kern_return_t kr = _WKPHInstantiatePlugin(hostProxy->port(), requestID, (uint8_t*)[data bytes], [data length], instance->pluginID()); if (kr == MACH_SEND_INVALID_DEST) { // Invalidate the instance. instance->invalidate(); // The plug-in host must have died, but we haven't received the death notification yet. pluginHostDied(hostProxy); // Try to spawn it again. hostProxy = hostForPackage(pluginPackage); // Create a new instance. instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView, fullFrame); requestID = instance->nextRequestID(); kr = _WKPHInstantiatePlugin(hostProxy->port(), requestID, (uint8_t*)[data bytes], [data length], instance->pluginID()); } auto_ptr reply = instance->waitForReply(requestID); if (!reply.get() || reply->m_resultCode != KERN_SUCCESS) { instance->cleanup(); return 0; } instance->setRenderContextID(reply->m_renderContextID); instance->setUseSoftwareRenderer(reply->m_useSoftwareRenderer); return instance.release(); } void NetscapePluginHostManager::createPropertyListFile(WebNetscapePluginPackage *package) { NSString *pluginHostAppPath = [[NSBundle bundleWithIdentifier:@"com.apple.WebKit"] pathForAuxiliaryExecutable:pluginHostAppName]; NSString *pluginHostAppExecutablePath = [[NSBundle bundleWithPath:pluginHostAppPath] executablePath]; NSString *bundlePath = [package path]; pid_t pid; posix_spawnattr_t attr; posix_spawnattr_init(&attr); // Set the architecture. size_t ocount = 0; int cpuTypes[1] = { [package pluginHostArchitecture] }; posix_spawnattr_setbinpref_np(&attr, 1, cpuTypes, &ocount); // Spawn the plug-in host and tell it to call the registration function. const char* args[] = { [pluginHostAppExecutablePath fileSystemRepresentation], "-createPluginMIMETypesPreferences", [bundlePath fileSystemRepresentation], 0 }; int result = posix_spawn(&pid, args[0], 0, &attr, const_cast(args), 0); posix_spawnattr_destroy(&attr); if (!result && pid > 0) { // Wait for the process to finish. while (waitpid(pid, 0, 0) == -1) { } } } void NetscapePluginHostManager::didCreateWindow() { // See if any of our hosts are in full-screen mode. PluginHostMap::iterator end = m_pluginHosts.end(); for (PluginHostMap::iterator it = m_pluginHosts.begin(); it != end; ++it) { NetscapePluginHostProxy* hostProxy = it->second; if (!hostProxy->isMenuBarVisible()) { // Make ourselves the front process. ProcessSerialNumber psn; GetCurrentProcess(&psn); SetFrontProcess(&psn); return; } } } } // namespace WebKit #endif // USE(PLUGIN_HOST_PROCESS) WebKit/mac/Plugins/Hosted/WebKitPluginHost.defs0000644000175000017500000002667111261517444020034 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #include subsystem WebKitPluginHost 300; serverprefix WK; userprefix _WK; routine PHCheckInWithPluginHost(pluginHostPort :mach_port_t; options :plist_bytes_t; clientPort :mach_port_make_send_t; clientPSNHigh :uint32_t; clientPSNLow :uint32_t; renderPort :mach_port_copy_send_t; out pluginHostPSNHigh :uint32_t; out pluginHostPSNLow :uint32_t); simpleroutine PHInstantiatePlugin(pluginHostPort :mach_port_t; requestID :uint32_t; options :plist_bytes_t; pluginID :uint32_t); simpleroutine PHResizePluginInstance(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; pluginX :double; pluginY :double; pluginWidth :double; pluginHeight :double; clipX :double; clipY :double; clipWidth :double; clipHeight :double); simpleroutine PHPluginInstanceFocusChanged(pluginHostPort :mach_port_t; pluginID :uint32_t; hasFocus :boolean_t); simpleroutine PHPluginInstanceWindowFocusChanged(pluginHostPort :mach_port_t; pluginID :uint32_t; hasFocus :boolean_t); simpleroutine PHPluginInstanceWindowFrameChanged(pluginHostPort :mach_port_t; pluginID :uint32_t; x :double; y :double; width :double; height :double; maxScreenY :double); simpleroutine PHPluginInstanceMouseEvent(pluginHostPort :mach_port_t; pluginID :uint32_t; timestamp :double; eventType :uint32_t; modifierFlags :uint32_t; pluginX :double; pluginY :double; screenX :double; screenY :double; maxScreenY :double; buttonNumber :int32_t; clickCount :int32_t; deltaX :double; deltaY :double; deltaZ: double); simpleroutine PHPluginInstanceKeyboardEvent(pluginHostPort :mach_port_t; pluginID :uint32_t; timestamp :double; eventType :uint32_t; modifierFlags :uint32_t; characters :data_t; charactersIgnoringModifiers :data_t; isARepeat :boolean_t; keyCode :uint16_t; keyChar :uint8_t); simpleroutine PHPluginInstanceWheelEvent(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; timestamp :double; modifierFlags :uint32_t; pluginX :double; pluginY :double; buttonNumber :int32_t; deltaX :double; deltaY :double; deltaZ: double); simpleroutine PHPluginInstanceInsertText(pluginHostPort :mach_port_t; pluginID :uint32_t; text :data_t); simpleroutine PHPluginInstanceStartTimers(pluginHostPort :mach_port_t; pluginID :uint32_t; throttleTimers :boolean_t); simpleroutine PHPluginInstanceStopTimers(pluginHostPort :mach_port_t; pluginID :uint32_t); simpleroutine PHPluginInstancePrint(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; width :uint32_t; height :uint32_t); simpleroutine PHDestroyPluginInstance(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t); simpleroutine PHCheckIfAllowedToLoadURLResult(clientPort :mach_port_t; pluginID :uint32_t; checkID :uint32_t; result :boolean_t); // Streams simpleroutine PHStartStream(pluginHostPort :mach_port_t; pluginID :uint32_t; streamID :uint32_t; responseURL :data_t; expectedContentLength :int64_t; lastModifiedTimeInterval :double; mimeType :data_t; headers :data_t); simpleroutine PHStreamDidReceiveData(pluginHostPort :mach_port_t; pluginID :uint32_t; streamID :uint32_t; data :data_t); simpleroutine PHStreamDidFinishLoading(pluginHostPort :mach_port_t; pluginID :uint32_t; streamID :uint32_t); simpleroutine PHStreamDidFail(pluginHostPort :mach_port_t; pluginID :uint32_t; streamID :uint32_t; reason :int16_t); simpleroutine PHLoadURLNotify(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; reason :int16_t); // NPRuntime simpleroutine PHGetScriptableNPObject(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t); simpleroutine PHNPObjectHasProperty(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t; propertyName :uint64_t); simpleroutine PHNPObjectHasMethod(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t; methodName :uint64_t); simpleroutine PHNPObjectInvoke(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t; invokeType :uint32_t; methodName :uint64_t; arguments :data_t); simpleroutine PHNPObjectHasInvokeDefaultMethod(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t); simpleroutine PHNPObjectHasConstructMethod(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t); simpleroutine PHNPObjectGetProperty(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t; propertyName :uint64_t); simpleroutine PHNPObjectSetProperty(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t; propertyName :uint64_t; value :data_t); simpleroutine PHNPObjectRelease(pluginHostPort :mach_port_t; pluginID :uint32_t; objectID :uint32_t); simpleroutine PHNPObjectEnumerate(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t); // Replies simpleroutine PHBooleanReply(clientPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; result :boolean_t); simpleroutine PHBooleanAndDataReply(pluginHostPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; returnValue :boolean_t; result :data_t); WebKit/mac/Plugins/Hosted/WebKitPluginClient.defs0000644000175000017500000002252111225466207020323 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #include // FIXME: Come up with a better name. subsystem WebKitPluginClient 300; serverprefix WK; userprefix _WK; simpleroutine PCStatusText(clientPort :mach_port_t; pluginID :uint32_t; text :data_t); routine PCLoadURL(clientPort :mach_port_t; pluginID :uint32_t; url :data_t; target :data_t; postData :data_t; flags: uint32_t; out resultCode :uint16_t; out requestID :uint32_t); simpleroutine PCCancelLoadURL(clientPort :mach_port_t; pluginID :uint32_t; streamID :uint32_t; reason :int16_t); simpleroutine PCInvalidateRect(clientPort :mach_port_t; pluginID :uint32_t; x :double; y :double; width :double; height :double); routine PCGetCookies(clientPort :mach_port_t; pluginID :uint32_t; url :data_t; out returnValue :boolean_t; out cookies :data_t, dealloc); routine PCSetCookies(clientPort :mach_port_t; pluginID :uint32_t; url :data_t; cookies :data_t; out returnValue :boolean_t); routine PCGetProxy(clientPort :mach_port_t; pluginID :uint32_t; url :data_t; out returnValue :boolean_t; out proxy :data_t, dealloc); routine PCGetAuthenticationInfo(clientPort :mach_port_t; pluginID :uint32_t; protocol :data_t; host :data_t; port :uint32_t; scheme :data_t; realm :data_t; out returnValue :boolean_t; out username :data_t, dealloc; out password :data_t, dealloc); routine PCConvertPoint(clientPort :mach_port_t; pluginID :uint32_t; sourceX :double; sourceY :double; sourceSpace :uint32_t; destSpace :uint32_t; out returnValue :boolean_t; out destX :double; out destY :double); // NPRuntime routine PCGetStringIdentifier(clientPort :mach_port_t; name :data_t; out identifier :uint64_t); routine PCGetIntIdentifier(clientPort :mach_port_t; value :int32_t; out identifier: uint64_t); routine PCGetWindowNPObject(clientPort :mach_port_t; pluginID :uint32_t; out objectID :uint32_t); routine PCGetPluginElementNPObject(clientPort :mach_port_t; pluginID :uint32_t; out objectID :uint32_t); routine PCReleaseObject(clientPort :mach_port_t; pluginID :uint32_t; objectID :uint32_t); simpleroutine PCEvaluate(clientPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t; script :data_t; allowPopups :boolean_t); simpleroutine PCInvoke(clientPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t; methodNameIdentifier :uint64_t; arguments :data_t); simpleroutine PCInvokeDefault(clientPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t; arguments :data_t); routine PCConstruct(clientPort :mach_port_t; pluginID :uint32_t; objectID :uint32_t; arguments :data_t; out returnValue :boolean_t; out result :data_t, dealloc); simpleroutine PCGetProperty(clientPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t; propertyNameIdentifier :uint64_t); routine PCSetProperty(clientPort :mach_port_t; pluginID :uint32_t; objectID :uint32_t; propertyNameIdentifier :uint64_t; value :data_t; out returnValue :boolean_t); routine PCRemoveProperty(clientPort :mach_port_t; pluginID :uint32_t; objectID :uint32_t; propertyNameIdentifier :uint64_t; out returnValue :boolean_t); simpleroutine PCHasProperty(clientPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t; propertyNameIdentifier :uint64_t); simpleroutine PCHasMethod(clientPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t; methodNameIdentifier :uint64_t); routine PCIdentifierInfo(clientPort :mach_port_t; identifier :uint64_t; out info :data_t, dealloc); simpleroutine PCEnumerate(clientPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t); // Misc simpleroutine PCSetMenuBarVisible(clientPort :mach_port_t; visible :boolean_t); simpleroutine PCSetModal(clientPort :mach_port_t; modal :boolean_t); routine PCCheckIfAllowedToLoadURL(clientPort :mach_port_t; pluginID :uint32_t; url :data_t; target :data_t; out checkID :uint32_t); simpleroutine PCCancelCheckIfAllowedToLoadURL(clientPort :mach_port_t; pluginID :uint32_t; checkID :uint32_t); routine PCResolveURL(clientPort :mach_port_t; pluginID :uint32_t; url :data_t; target :data_t; out resolvedURL :data_t, dealloc); // Replies simpleroutine PCInstantiatePluginReply(clientPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; result :kern_return_t; renderContextID :uint32_t; useSoftwareRenderer :boolean_t); simpleroutine PCGetScriptableNPObjectReply(clientPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; objectID :uint32_t); simpleroutine PCBooleanReply(clientPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; result :boolean_t); simpleroutine PCBooleanAndDataReply(clientPort :mach_port_t; pluginID :uint32_t; requestID :uint32_t; returnValue :boolean_t; result :data_t); WebKit/mac/Plugins/Hosted/WebTextInputWindowController.m0000644000175000017500000001137411150053265021766 0ustar leelee/* * Copyright (C) 2009 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #import "WebTextInputWindowController.h" #import @interface WebTextInputPanel : NSPanel { NSTextView *_inputTextView; } - (NSTextInputContext *)_inputContext; - (BOOL)_interpretKeyEvent:(NSEvent *)event string:(NSString **)string; @end #define inputWindowHeight 20 @implementation WebTextInputPanel - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [_inputTextView release]; [super dealloc]; } - (id)init { self = [super initWithContentRect:NSZeroRect styleMask:WKGetInputPanelWindowStyle() backing:NSBackingStoreBuffered defer:YES]; if (!self) return nil; // Set the frame size. NSRect visibleFrame = [[NSScreen mainScreen] visibleFrame]; NSRect frame = NSMakeRect(visibleFrame.origin.x, visibleFrame.origin.y, visibleFrame.size.width, inputWindowHeight); [self setFrame:frame display:NO]; _inputTextView = [[NSTextView alloc] initWithFrame:[self.contentView frame]]; _inputTextView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable | NSViewMaxXMargin | NSViewMinXMargin | NSViewMaxYMargin | NSViewMinYMargin; NSScrollView* scrollView = [[NSScrollView alloc] initWithFrame:[self.contentView frame]]; scrollView.documentView = _inputTextView; self.contentView = scrollView; [scrollView release]; [self setFloatingPanel:YES]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_keyboardInputSourceChanged:) name:NSTextInputContextKeyboardSelectionDidChangeNotification object:nil]; return self; } - (void)_keyboardInputSourceChanged:(NSNotification *)notification { [_inputTextView setString:@""]; [self orderOut:nil]; } - (BOOL)_interpretKeyEvent:(NSEvent *)event string:(NSString **)string { BOOL hadMarkedText = [_inputTextView hasMarkedText]; *string = nil; if (![[_inputTextView inputContext] handleEvent:event]) return NO; if ([_inputTextView hasMarkedText]) { // Don't show the input method window for dead keys if ([[event characters] length] > 0) [self orderFront:nil]; return YES; } if (hadMarkedText) { [self orderOut:nil]; NSString *text = [[_inputTextView textStorage] string]; if ([text length] > 0) *string = [[text copy] autorelease]; } [_inputTextView setString:@""]; return hadMarkedText; } - (NSTextInputContext *)_inputContext { return [_inputTextView inputContext]; } @end @implementation WebTextInputWindowController + (WebTextInputWindowController *)sharedTextInputWindowController { static WebTextInputWindowController *textInputWindowController; if (!textInputWindowController) textInputWindowController = [[WebTextInputWindowController alloc] init]; return textInputWindowController; } - (id)init { self = [super init]; if (!self) return nil; _panel = [[WebTextInputPanel alloc] init]; return self; } - (NSTextInputContext *)inputContext { return [_panel _inputContext]; } - (BOOL)interpretKeyEvent:(NSEvent *)event string:(NSString **)string { return [_panel _interpretKeyEvent:event string:string]; } @end #endif // USE(PLUGIN_HOST_PROCESS) WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm0000644000175000017500000011454511225466207021141 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #import "NetscapePluginHostProxy.h" #import #import #import "HostedNetscapePluginStream.h" #import "NetscapePluginHostManager.h" #import "NetscapePluginInstanceProxy.h" #import "WebFrameInternal.h" #import "WebHostedNetscapePluginView.h" #import "WebKitSystemInterface.h" #import #import #import extern "C" { #import "WebKitPluginHost.h" #import "WebKitPluginClientServer.h" } using namespace std; using namespace JSC; using namespace WebCore; @interface WebPlaceholderModalWindow : NSWindow @end @implementation WebPlaceholderModalWindow // Prevent NSApp from calling requestUserAttention: when the window is shown // modally, even if the app is inactive. See 6823049. - (BOOL)_wantsUserAttention { return NO; } @end namespace WebKit { class PluginDestroyDeferrer { public: PluginDestroyDeferrer(NetscapePluginInstanceProxy* proxy) : m_proxy(proxy) { m_proxy->willCallPluginFunction(); } ~PluginDestroyDeferrer() { m_proxy->didCallPluginFunction(); } private: RefPtr m_proxy; }; typedef HashMap PluginProxyMap; static PluginProxyMap& pluginProxyMap() { DEFINE_STATIC_LOCAL(PluginProxyMap, pluginProxyMap, ()); return pluginProxyMap; } NetscapePluginHostProxy::NetscapePluginHostProxy(mach_port_t clientPort, mach_port_t pluginHostPort, const ProcessSerialNumber& pluginHostPSN, bool shouldCacheMissingPropertiesAndMethods) : m_clientPort(clientPort) , m_portSet(MACH_PORT_NULL) , m_pluginHostPort(pluginHostPort) , m_isModal(false) , m_menuBarIsVisible(true) , m_pluginHostPSN(pluginHostPSN) , m_processingRequests(0) , m_shouldCacheMissingPropertiesAndMethods(shouldCacheMissingPropertiesAndMethods) { pluginProxyMap().add(m_clientPort, this); // FIXME: We should use libdispatch for this. CFMachPortContext context = { 0, this, 0, 0, 0 }; m_deadNameNotificationPort.adoptCF(CFMachPortCreate(0, deadNameNotificationCallback, &context, 0)); mach_port_t previous; mach_port_request_notification(mach_task_self(), pluginHostPort, MACH_NOTIFY_DEAD_NAME, 0, CFMachPortGetPort(m_deadNameNotificationPort.get()), MACH_MSG_TYPE_MAKE_SEND_ONCE, &previous); ASSERT(previous == MACH_PORT_NULL); RetainPtr deathPortSource(AdoptCF, CFMachPortCreateRunLoopSource(0, m_deadNameNotificationPort.get(), 0)); CFRunLoopAddSource(CFRunLoopGetCurrent(), deathPortSource.get(), kCFRunLoopDefaultMode); #ifdef USE_LIBDISPATCH // FIXME: Unfortunately we can't use a dispatch source here until has been resolved. m_clientPortSource = dispatch_source_mig_create(m_clientPort, WKWebKitPluginClient_subsystem.maxsize, 0, dispatch_get_main_queue(), WebKitPluginClient_server); #else m_clientPortSource.adoptCF(WKCreateMIGServerSource((mig_subsystem_t)&WKWebKitPluginClient_subsystem, m_clientPort)); CFRunLoopAddSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), kCFRunLoopDefaultMode); CFRunLoopAddSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), (CFStringRef)NSEventTrackingRunLoopMode); #endif } NetscapePluginHostProxy::~NetscapePluginHostProxy() { pluginProxyMap().remove(m_clientPort); // Free the port set if (m_portSet) { mach_port_extract_member(mach_task_self(), m_clientPort, m_portSet); mach_port_extract_member(mach_task_self(), CFMachPortGetPort(m_deadNameNotificationPort.get()), m_portSet); mach_port_destroy(mach_task_self(), m_portSet); } ASSERT(m_clientPortSource); #ifdef USE_LIBDISPATCH dispatch_release(m_clientPortSource); #else CFRunLoopSourceInvalidate(m_clientPortSource.get()); m_clientPortSource = 0; #endif } void NetscapePluginHostProxy::pluginHostDied() { PluginInstanceMap instances; m_instances.swap(instances); PluginInstanceMap::const_iterator end = instances.end(); for (PluginInstanceMap::const_iterator it = instances.begin(); it != end; ++it) it->second->pluginHostDied(); NetscapePluginHostManager::shared().pluginHostDied(this); // The plug-in crashed while its menu bar was hidden. Make sure to show it. if (!m_menuBarIsVisible) setMenuBarVisible(true); // The plug-in crashed while it had a modal dialog up. if (m_isModal) endModal(); delete this; } void NetscapePluginHostProxy::addPluginInstance(NetscapePluginInstanceProxy* instance) { ASSERT(!m_instances.contains(instance->pluginID())); m_instances.set(instance->pluginID(), instance); } void NetscapePluginHostProxy::removePluginInstance(NetscapePluginInstanceProxy* instance) { ASSERT(m_instances.get(instance->pluginID()) == instance); m_instances.remove(instance->pluginID()); } NetscapePluginInstanceProxy* NetscapePluginHostProxy::pluginInstance(uint32_t pluginID) { return m_instances.get(pluginID).get(); } void NetscapePluginHostProxy::deadNameNotificationCallback(CFMachPortRef port, void *msg, CFIndex size, void *info) { ASSERT(msg && static_cast(msg)->msgh_id == MACH_NOTIFY_DEAD_NAME); static_cast(info)->pluginHostDied(); } void NetscapePluginHostProxy::setMenuBarVisible(bool visible) { m_menuBarIsVisible = visible; [NSMenu setMenuBarVisible:visible]; if (visible) { // Make ourselves the front app ProcessSerialNumber psn; GetCurrentProcess(&psn); SetFrontProcess(&psn); } } void NetscapePluginHostProxy::applicationDidBecomeActive() { SetFrontProcess(&m_pluginHostPSN); } void NetscapePluginHostProxy::beginModal() { ASSERT(!m_placeholderWindow); ASSERT(!m_activationObserver); m_placeholderWindow.adoptNS([[WebPlaceholderModalWindow alloc] initWithContentRect:NSMakeRect(0, 0, 1, 1) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]); m_activationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationWillBecomeActiveNotification object:NSApp queue:nil usingBlock:^(NSNotification *){ applicationDidBecomeActive(); }]; // We need to be able to get the setModal(false) call from the plug-in host. CFRunLoopAddSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), (CFStringRef)NSModalPanelRunLoopMode); [NSApp runModalForWindow:m_placeholderWindow.get()]; [m_placeholderWindow.get() orderOut:nil]; m_placeholderWindow = 0; } void NetscapePluginHostProxy::endModal() { ASSERT(m_placeholderWindow); ASSERT(m_activationObserver); [[NSNotificationCenter defaultCenter] removeObserver:m_activationObserver.get()]; m_activationObserver = nil; CFRunLoopRemoveSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), (CFStringRef)NSModalPanelRunLoopMode); [NSApp stopModal]; // Make ourselves the front process. ProcessSerialNumber psn; GetCurrentProcess(&psn); SetFrontProcess(&psn); } void NetscapePluginHostProxy::setModal(bool modal) { if (modal == m_isModal) return; m_isModal = modal; if (m_isModal) beginModal(); else endModal(); } bool NetscapePluginHostProxy::processRequests() { m_processingRequests++; if (!m_portSet) { mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_PORT_SET, &m_portSet); mach_port_insert_member(mach_task_self(), m_clientPort, m_portSet); mach_port_insert_member(mach_task_self(), CFMachPortGetPort(m_deadNameNotificationPort.get()), m_portSet); } char buffer[4096]; mach_msg_header_t* msg = reinterpret_cast(buffer); kern_return_t kr = mach_msg(msg, MACH_RCV_MSG, 0, sizeof(buffer), m_portSet, 0, MACH_PORT_NULL); if (kr != KERN_SUCCESS) { LOG_ERROR("Could not receive mach message, error %x", kr); m_processingRequests--; return false; } if (msg->msgh_local_port == m_clientPort) { __ReplyUnion__WKWebKitPluginClient_subsystem reply; mach_msg_header_t* replyHeader = reinterpret_cast(&reply); if (WebKitPluginClient_server(msg, replyHeader) && replyHeader->msgh_remote_port != MACH_PORT_NULL) { kr = mach_msg(replyHeader, MACH_SEND_MSG, replyHeader->msgh_size, 0, MACH_PORT_NULL, 0, MACH_PORT_NULL); if (kr != KERN_SUCCESS) { LOG_ERROR("Could not send mach message, error %x", kr); m_processingRequests--; return false; } } m_processingRequests--; return true; } if (msg->msgh_local_port == CFMachPortGetPort(m_deadNameNotificationPort.get())) { ASSERT(msg->msgh_id == MACH_NOTIFY_DEAD_NAME); pluginHostDied(); m_processingRequests--; return false; } ASSERT_NOT_REACHED(); m_processingRequests--; return false; } } // namespace WebKit using namespace WebKit; // Helper class for deallocating data class DataDeallocator { public: DataDeallocator(data_t data, mach_msg_type_number_t dataLength) : m_data(reinterpret_cast(data)) , m_dataLength(dataLength) { } ~DataDeallocator() { if (!m_data) return; vm_deallocate(mach_task_self(), m_data, m_dataLength); } private: vm_address_t m_data; vm_size_t m_dataLength; }; // MiG callbacks kern_return_t WKPCStatusText(mach_port_t clientPort, uint32_t pluginID, data_t text, mach_msg_type_number_t textCnt) { DataDeallocator deallocator(text, textCnt); NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; instanceProxy->status(text); return KERN_SUCCESS; } kern_return_t WKPCLoadURL(mach_port_t clientPort, uint32_t pluginID, data_t url, mach_msg_type_number_t urlLength, data_t target, mach_msg_type_number_t targetLength, data_t postData, mach_msg_type_number_t postDataLength, uint32_t flags, uint16_t* outResult, uint32_t* outStreamID) { DataDeallocator urlDeallocator(url, urlLength); DataDeallocator targetDeallocator(target, targetLength); DataDeallocator postDataDeallocator(postData, postDataLength); NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; uint32_t streamID = 0; NPError result = instanceProxy->loadURL(url, target, postData, postDataLength, static_cast(flags), streamID); *outResult = result; *outStreamID = streamID; return KERN_SUCCESS; } kern_return_t WKPCCancelLoadURL(mach_port_t clientPort, uint32_t pluginID, uint32_t streamID, int16_t reason) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; if (!instanceProxy->cancelStreamLoad(streamID, reason)) return KERN_FAILURE; return KERN_SUCCESS; } kern_return_t WKPCInvalidateRect(mach_port_t clientPort, uint32_t pluginID, double x, double y, double width, double height) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_SUCCESS; if (!hostProxy->isProcessingRequests()) { if (NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID)) instanceProxy->invalidateRect(x, y, width, height); return KERN_SUCCESS; } // Defer the work CFRunLoopPerformBlock(CFRunLoopGetMain(), kCFRunLoopDefaultMode, ^{ if (NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort)) { if (NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID)) instanceProxy->invalidateRect(x, y, width, height); } }); return KERN_SUCCESS; } kern_return_t WKPCGetScriptableNPObjectReply(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; instanceProxy->setCurrentReply(requestID, new NetscapePluginInstanceProxy::GetScriptableNPObjectReply(objectID)); return KERN_SUCCESS; } kern_return_t WKPCBooleanReply(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, boolean_t result) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; instanceProxy->setCurrentReply(requestID, new NetscapePluginInstanceProxy::BooleanReply(result)); return KERN_SUCCESS; } kern_return_t WKPCBooleanAndDataReply(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, boolean_t returnValue, data_t resultData, mach_msg_type_number_t resultLength) { DataDeallocator deallocator(resultData, resultLength); NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; RetainPtr result(AdoptCF, CFDataCreate(0, reinterpret_cast(resultData), resultLength)); instanceProxy->setCurrentReply(requestID, new NetscapePluginInstanceProxy::BooleanAndDataReply(returnValue, result)); return KERN_SUCCESS; } kern_return_t WKPCInstantiatePluginReply(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, kern_return_t result, uint32_t renderContextID, boolean_t useSoftwareRenderer) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; instanceProxy->setCurrentReply(requestID, new NetscapePluginInstanceProxy::InstantiatePluginReply(result, renderContextID, useSoftwareRenderer)); return KERN_SUCCESS; } kern_return_t WKPCGetWindowNPObject(mach_port_t clientPort, uint32_t pluginID, uint32_t* outObjectID) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; uint32_t objectID; if (!instanceProxy->getWindowNPObject(objectID)) return KERN_FAILURE; *outObjectID = objectID; return KERN_SUCCESS; } kern_return_t WKPCGetPluginElementNPObject(mach_port_t clientPort, uint32_t pluginID, uint32_t* outObjectID) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; uint32_t objectID; if (!instanceProxy->getPluginElementNPObject(objectID)) return KERN_FAILURE; *outObjectID = objectID; return KERN_SUCCESS; } kern_return_t WKPCReleaseObject(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; instanceProxy->releaseObject(objectID); return KERN_SUCCESS; } kern_return_t WKPCEvaluate(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, data_t scriptData, mach_msg_type_number_t scriptLength, boolean_t allowPopups) { DataDeallocator deallocator(scriptData, scriptLength); NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) { _WKPHBooleanAndDataReply(hostProxy->port(), pluginID, requestID, false, 0, 0); return KERN_SUCCESS; } PluginDestroyDeferrer deferrer(instanceProxy); String script = String::fromUTF8WithLatin1Fallback(scriptData, scriptLength); data_t resultData = 0; mach_msg_type_number_t resultLength = 0; boolean_t returnValue = instanceProxy->evaluate(objectID, script, resultData, resultLength, allowPopups); _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength); if (resultData) mig_deallocate(reinterpret_cast(resultData), resultLength); return KERN_SUCCESS; } kern_return_t WKPCGetStringIdentifier(mach_port_t clientPort, data_t name, mach_msg_type_number_t nameCnt, uint64_t* identifier) { DataDeallocator deallocator(name, nameCnt); COMPILE_ASSERT(sizeof(*identifier) == sizeof(IdentifierRep*), identifier_sizes); *identifier = reinterpret_cast(IdentifierRep::get(name)); return KERN_SUCCESS; } kern_return_t WKPCGetIntIdentifier(mach_port_t clientPort, int32_t value, uint64_t* identifier) { COMPILE_ASSERT(sizeof(*identifier) == sizeof(NPIdentifier), identifier_sizes); *identifier = reinterpret_cast(IdentifierRep::get(value)); return KERN_SUCCESS; } static Identifier identifierFromIdentifierRep(IdentifierRep* identifier) { ASSERT(IdentifierRep::isValid(identifier)); ASSERT(identifier->isString()); const char* str = identifier->string(); return Identifier(JSDOMWindow::commonJSGlobalData(), String::fromUTF8WithLatin1Fallback(str, strlen(str))); } kern_return_t WKPCInvoke(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, uint64_t serverIdentifier, data_t argumentsData, mach_msg_type_number_t argumentsLength) { DataDeallocator deallocator(argumentsData, argumentsLength); NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) { _WKPHBooleanAndDataReply(hostProxy->port(), pluginID, requestID, false, 0, 0); return KERN_SUCCESS; } PluginDestroyDeferrer deferrer(instanceProxy); IdentifierRep* identifier = reinterpret_cast(serverIdentifier); if (!IdentifierRep::isValid(identifier)) { _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, false, 0, 0); return KERN_SUCCESS; } Identifier methodNameIdentifier = identifierFromIdentifierRep(identifier); data_t resultData = 0; mach_msg_type_number_t resultLength = 0; boolean_t returnValue = instanceProxy->invoke(objectID, methodNameIdentifier, argumentsData, argumentsLength, resultData, resultLength); _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength); if (resultData) mig_deallocate(reinterpret_cast(resultData), resultLength); return KERN_SUCCESS; } kern_return_t WKPCInvokeDefault(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength) { DataDeallocator deallocator(argumentsData, argumentsLength); NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) { _WKPHBooleanAndDataReply(hostProxy->port(), pluginID, requestID, false, 0, 0); return KERN_SUCCESS; } PluginDestroyDeferrer deferrer(instanceProxy); data_t resultData = 0; mach_msg_type_number_t resultLength = 0; boolean_t returnValue = instanceProxy->invokeDefault(objectID, argumentsData, argumentsLength, resultData, resultLength); _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength); if (resultData) mig_deallocate(reinterpret_cast(resultData), resultLength); return KERN_SUCCESS; } kern_return_t WKPCConstruct(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, boolean_t* returnValue, data_t* resultData, mach_msg_type_number_t* resultLength) { DataDeallocator deallocator(argumentsData, argumentsLength); NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; PluginDestroyDeferrer deferrer(instanceProxy); *returnValue = instanceProxy->construct(objectID, argumentsData, argumentsLength, *resultData, *resultLength); return KERN_SUCCESS; } kern_return_t WKPCGetProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, uint64_t serverIdentifier) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) { _WKPHBooleanAndDataReply(hostProxy->port(), pluginID, requestID, false, 0, 0); return KERN_SUCCESS; } IdentifierRep* identifier = reinterpret_cast(serverIdentifier); if (!IdentifierRep::isValid(identifier)) { _WKPHBooleanAndDataReply(hostProxy->port(), pluginID, requestID, false, 0, 0); return KERN_SUCCESS; } PluginDestroyDeferrer deferrer(instanceProxy); data_t resultData = 0; mach_msg_type_number_t resultLength = 0; boolean_t returnValue; if (identifier->isString()) { Identifier propertyNameIdentifier = identifierFromIdentifierRep(identifier); returnValue = instanceProxy->getProperty(objectID, propertyNameIdentifier, resultData, resultLength); } else returnValue = instanceProxy->setProperty(objectID, identifier->number(), resultData, resultLength); _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength); if (resultData) mig_deallocate(reinterpret_cast(resultData), resultLength); return KERN_SUCCESS; } kern_return_t WKPCSetProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, uint64_t serverIdentifier, data_t valueData, mach_msg_type_number_t valueLength, boolean_t* returnValue) { DataDeallocator deallocator(valueData, valueLength); NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; PluginDestroyDeferrer deferrer(instanceProxy); IdentifierRep* identifier = reinterpret_cast(serverIdentifier); if (!IdentifierRep::isValid(identifier)) *returnValue = false; if (identifier->isString()) { Identifier propertyNameIdentifier = identifierFromIdentifierRep(identifier); *returnValue = instanceProxy->setProperty(objectID, propertyNameIdentifier, valueData, valueLength); } else *returnValue = instanceProxy->setProperty(objectID, identifier->number(), valueData, valueLength); return KERN_SUCCESS; } kern_return_t WKPCRemoveProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t objectID, uint64_t serverIdentifier, boolean_t* returnValue) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; PluginDestroyDeferrer deferrer(instanceProxy); IdentifierRep* identifier = reinterpret_cast(serverIdentifier); if (!IdentifierRep::isValid(identifier)) return KERN_FAILURE; if (identifier->isString()) { Identifier propertyNameIdentifier = identifierFromIdentifierRep(identifier); *returnValue = instanceProxy->removeProperty(objectID, propertyNameIdentifier); } else *returnValue = instanceProxy->removeProperty(objectID, identifier->number()); return KERN_SUCCESS; } kern_return_t WKPCHasProperty(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, uint64_t serverIdentifier) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) { _WKPHBooleanReply(hostProxy->port(), pluginID, requestID, false); return KERN_SUCCESS; } PluginDestroyDeferrer deferrer(instanceProxy); IdentifierRep* identifier = reinterpret_cast(serverIdentifier); if (!IdentifierRep::isValid(identifier)) { _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, false); return KERN_SUCCESS; } boolean_t returnValue; if (identifier->isString()) { Identifier propertyNameIdentifier = identifierFromIdentifierRep(identifier); returnValue = instanceProxy->hasProperty(objectID, propertyNameIdentifier); } else returnValue = instanceProxy->hasProperty(objectID, identifier->number()); _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue); return KERN_SUCCESS; } kern_return_t WKPCHasMethod(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID, uint64_t serverIdentifier) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) { _WKPHBooleanReply(hostProxy->port(), pluginID, requestID, false); return KERN_SUCCESS; } PluginDestroyDeferrer deferrer(instanceProxy); IdentifierRep* identifier = reinterpret_cast(serverIdentifier); if (!IdentifierRep::isValid(identifier)) { _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, false); return KERN_SUCCESS; } Identifier methodNameIdentifier = identifierFromIdentifierRep(identifier); boolean_t returnValue = instanceProxy->hasMethod(objectID, methodNameIdentifier); _WKPHBooleanReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue); return KERN_SUCCESS; } kern_return_t WKPCIdentifierInfo(mach_port_t clientPort, uint64_t serverIdentifier, data_t* infoData, mach_msg_type_number_t* infoLength) { IdentifierRep* identifier = reinterpret_cast(serverIdentifier); if (!IdentifierRep::isValid(identifier)) return KERN_FAILURE; id info; if (identifier->isString()) { const char* str = identifier->string(); info = [NSData dataWithBytesNoCopy:(void*)str length:strlen(str) freeWhenDone:NO]; } else info = [NSNumber numberWithInt:identifier->number()]; RetainPtr data = [NSPropertyListSerialization dataFromPropertyList:info format:NSPropertyListBinaryFormat_v1_0 errorDescription:0]; ASSERT(data); *infoLength = [data.get() length]; mig_allocate(reinterpret_cast(infoData), *infoLength); memcpy(*infoData, [data.get() bytes], *infoLength); return KERN_SUCCESS; } kern_return_t WKPCEnumerate(mach_port_t clientPort, uint32_t pluginID, uint32_t requestID, uint32_t objectID) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) { _WKPHBooleanAndDataReply(hostProxy->port(), pluginID, requestID, false, 0, 0); return KERN_SUCCESS; } data_t resultData = 0; mach_msg_type_number_t resultLength = 0; boolean_t returnValue = instanceProxy->enumerate(objectID, resultData, resultLength); _WKPHBooleanAndDataReply(hostProxy->port(), instanceProxy->pluginID(), requestID, returnValue, resultData, resultLength); if (resultData) mig_deallocate(reinterpret_cast(resultData), resultLength); return KERN_SUCCESS; } kern_return_t WKPCSetMenuBarVisible(mach_port_t clientPort, boolean_t menuBarVisible) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; hostProxy->setMenuBarVisible(menuBarVisible); return KERN_SUCCESS; } kern_return_t WKPCSetModal(mach_port_t clientPort, boolean_t modal) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; hostProxy->setModal(modal); return KERN_SUCCESS; } kern_return_t WKPCGetCookies(mach_port_t clientPort, uint32_t pluginID, data_t urlData, mach_msg_type_number_t urlLength, boolean_t* returnValue, data_t* cookiesData, mach_msg_type_number_t* cookiesLength) { *cookiesData = 0; *cookiesLength = 0; DataDeallocator deallocator(urlData, urlLength); NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; *returnValue = instanceProxy->getCookies(urlData, urlLength, *cookiesData, *cookiesLength); return KERN_SUCCESS; } kern_return_t WKPCGetProxy(mach_port_t clientPort, uint32_t pluginID, data_t urlData, mach_msg_type_number_t urlLength, boolean_t* returnValue, data_t* proxyData, mach_msg_type_number_t* proxyLength) { *proxyData = 0; *proxyLength = 0; DataDeallocator deallocator(urlData, urlLength); NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; *returnValue = instanceProxy->getProxy(urlData, urlLength, *proxyData, *proxyLength); return KERN_SUCCESS; } kern_return_t WKPCSetCookies(mach_port_t clientPort, uint32_t pluginID, data_t urlData, mach_msg_type_number_t urlLength, data_t cookiesData, mach_msg_type_number_t cookiesLength, boolean_t* returnValue) { DataDeallocator urlDeallocator(urlData, urlLength); DataDeallocator cookiesDeallocator(cookiesData, cookiesLength); NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; *returnValue = instanceProxy->setCookies(urlData, urlLength, cookiesData, cookiesLength); return KERN_SUCCESS; } kern_return_t WKPCGetAuthenticationInfo(mach_port_t clientPort, uint32_t pluginID, data_t protocolData, mach_msg_type_number_t protocolLength, data_t hostData, mach_msg_type_number_t hostLength, uint32_t port, data_t schemeData, mach_msg_type_number_t schemeLength, data_t realmData, mach_msg_type_number_t realmLength, boolean_t* returnValue, data_t* usernameData, mach_msg_type_number_t *usernameLength, data_t* passwordData, mach_msg_type_number_t *passwordLength) { DataDeallocator protocolDeallocator(protocolData, protocolLength); DataDeallocator hostDeallocator(hostData, hostLength); DataDeallocator schemeDeallocator(schemeData, schemeLength); DataDeallocator realmDeallocator(realmData, realmLength); *usernameData = 0; *usernameLength = 0; *passwordData = 0; *passwordLength = 0; NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; *returnValue = instanceProxy->getAuthenticationInfo(protocolData, hostData, port, schemeData, realmData, *usernameData, *usernameLength, *passwordData, *passwordLength); return KERN_SUCCESS; } kern_return_t WKPCConvertPoint(mach_port_t clientPort, uint32_t pluginID, double sourceX, double sourceY, uint32_t sourceSpace, uint32_t destSpace, boolean_t *returnValue, double *destX, double *destY) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; *returnValue = instanceProxy->convertPoint(sourceX, sourceY, static_cast(sourceSpace), *destX, *destY, static_cast(destSpace)); return KERN_SUCCESS; } kern_return_t WKPCCheckIfAllowedToLoadURL(mach_port_t clientPort, uint32_t pluginID, data_t urlData, mach_msg_type_number_t urlLength, data_t targetData, mach_msg_type_number_t targetLength, uint32_t *checkID) { DataDeallocator urlDeallocator(urlData, urlLength); DataDeallocator targetDeallocator(targetData, targetLength); NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; *checkID = instanceProxy->checkIfAllowedToLoadURL(urlData, targetData); return KERN_SUCCESS; } kern_return_t WKPCCancelCheckIfAllowedToLoadURL(mach_port_t clientPort, uint32_t pluginID, uint32_t checkID) { NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; instanceProxy->cancelCheckIfAllowedToLoadURL(checkID); return KERN_SUCCESS; } kern_return_t WKPCResolveURL(mach_port_t clientPort, uint32_t pluginID, data_t urlData, mach_msg_type_number_t urlLength, data_t targetData, mach_msg_type_number_t targetLength, data_t *resolvedURLData, mach_msg_type_number_t *resolvedURLLength) { DataDeallocator urlDeallocator(urlData, urlLength); DataDeallocator targetDeallocator(targetData, targetLength); *resolvedURLData = 0; *resolvedURLLength = 0; NetscapePluginHostProxy* hostProxy = pluginProxyMap().get(clientPort); if (!hostProxy) return KERN_FAILURE; NetscapePluginInstanceProxy* instanceProxy = hostProxy->pluginInstance(pluginID); if (!instanceProxy) return KERN_FAILURE; instanceProxy->resolveURL(urlData, targetData, *resolvedURLData, *resolvedURLLength); return KERN_SUCCESS; } #endif // USE(PLUGIN_HOST_PROCESS) WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm0000644000175000017500000003055711261517444021701 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #import "WebHostedNetscapePluginView.h" #import "HostedNetscapePluginStream.h" #import "NetscapePluginInstanceProxy.h" #import "NetscapePluginHostManager.h" #import "NetscapePluginHostProxy.h" #import "WebTextInputWindowController.h" #import "WebFrameInternal.h" #import "WebView.h" #import "WebViewInternal.h" #import "WebUIDelegate.h" #import #import #import #import #import #import #import #import #import using namespace WebCore; using namespace WebKit; extern "C" { #include "WebKitPluginClientServer.h" #include "WebKitPluginHost.h" } @implementation WebHostedNetscapePluginView + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif WKSendUserChangeNotifications(); } - (id)initWithFrame:(NSRect)frame pluginPackage:(WebNetscapePluginPackage *)pluginPackage URL:(NSURL *)URL baseURL:(NSURL *)baseURL MIMEType:(NSString *)MIME attributeKeys:(NSArray *)keys attributeValues:(NSArray *)values loadManually:(BOOL)loadManually element:(PassRefPtr)element { self = [super initWithFrame:frame pluginPackage:pluginPackage URL:URL baseURL:baseURL MIMEType:MIME attributeKeys:keys attributeValues:values loadManually:loadManually element:element]; if (!self) return nil; return self; } - (void)handleMouseMoved:(NSEvent *)event { if (_isStarted && _proxy) _proxy->mouseEvent(self, event, NPCocoaEventMouseMoved); } - (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values { ASSERT(!_attributeKeys && !_attributeValues); _attributeKeys.adoptNS([keys copy]); _attributeValues.adoptNS([values copy]); } - (BOOL)createPlugin { ASSERT(!_proxy); NSString *userAgent = [[self webView] userAgentForURL:_baseURL.get()]; _proxy = NetscapePluginHostManager::shared().instantiatePlugin(_pluginPackage.get(), self, _MIMEType.get(), _attributeKeys.get(), _attributeValues.get(), userAgent, _sourceURL.get(), _mode == NP_FULL); if (!_proxy) return NO; if (_proxy->useSoftwareRenderer()) _softwareRenderer = WKSoftwareCARendererCreate(_proxy->renderContextID()); else { _pluginLayer = WKMakeRenderLayer(_proxy->renderContextID()); self.wantsLayer = YES; } // Update the window frame. _proxy->windowFrameChanged([[self window] frame]); return YES; } - (void)setLayer:(CALayer *)newLayer { // FIXME: This should use the same implementation as WebNetscapePluginView (and move to the base class). [super setLayer:newLayer]; if (_pluginLayer) [newLayer addSublayer:_pluginLayer.get()]; } - (void)loadStream { } - (void)updateAndSetWindow { if (!_proxy) return; // Use AppKit to convert view coordinates to NSWindow coordinates. NSRect boundsInWindow = [self convertRect:[self bounds] toView:nil]; NSRect visibleRectInWindow = [self convertRect:[self visibleRect] toView:nil]; // Flip Y to convert NSWindow coordinates to top-left-based window coordinates. float borderViewHeight = [[self currentWindow] frame].size.height; boundsInWindow.origin.y = borderViewHeight - NSMaxY(boundsInWindow); visibleRectInWindow.origin.y = borderViewHeight - NSMaxY(visibleRectInWindow); BOOL sizeChanged = !NSEqualSizes(_previousSize, boundsInWindow.size); _previousSize = boundsInWindow.size; _proxy->resize(boundsInWindow, visibleRectInWindow, sizeChanged); } - (void)windowFocusChanged:(BOOL)hasFocus { if (_proxy) _proxy->windowFocusChanged(hasFocus); } - (BOOL)shouldStop { if (!_proxy) return YES; return _proxy->shouldStop(); } - (void)destroyPlugin { if (_proxy) { if (_softwareRenderer) { WKSoftwareCARendererDestroy(_softwareRenderer); _softwareRenderer = 0; } _proxy->destroy(); _proxy = 0; } _pluginLayer = 0; } - (void)startTimers { if (_proxy) _proxy->startTimers(_isCompletelyObscured); } - (void)stopTimers { if (_proxy) _proxy->stopTimers(); } - (void)focusChanged { if (_proxy) _proxy->focusChanged(_hasFocus); } - (void)windowFrameDidChange:(NSNotification *)notification { if (_proxy && [self window]) _proxy->windowFrameChanged([[self window] frame]); } - (void)addWindowObservers { [super addWindowObservers]; ASSERT([self window]); NSWindow *window = [self window]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter addObserver:self selector:@selector(windowFrameDidChange:) name:NSWindowDidMoveNotification object:window]; [notificationCenter addObserver:self selector:@selector(windowFrameDidChange:) name:NSWindowDidResizeNotification object:window]; if (_proxy) _proxy->windowFrameChanged([window frame]); [self updateAndSetWindow]; } - (void)removeWindowObservers { [super removeWindowObservers]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter removeObserver:self name:NSWindowDidMoveNotification object:nil]; [notificationCenter removeObserver:self name:NSWindowDidResizeNotification object:nil]; } - (void)mouseDown:(NSEvent *)event { if (_isStarted && _proxy) _proxy->mouseEvent(self, event, NPCocoaEventMouseDown); } - (void)mouseUp:(NSEvent *)event { if (_isStarted && _proxy) _proxy->mouseEvent(self, event, NPCocoaEventMouseUp); } - (void)mouseDragged:(NSEvent *)event { if (_isStarted && _proxy) _proxy->mouseEvent(self, event, NPCocoaEventMouseDragged); } - (void)mouseEntered:(NSEvent *)event { if (_isStarted && _proxy) _proxy->mouseEvent(self, event, NPCocoaEventMouseEntered); } - (void)mouseExited:(NSEvent *)event { if (_isStarted && _proxy) _proxy->mouseEvent(self, event, NPCocoaEventMouseExited); } - (void)scrollWheel:(NSEvent *)event { bool processedEvent = false; if (_isStarted && _proxy) processedEvent = _proxy->wheelEvent(self, event); if (!processedEvent) [super scrollWheel:event]; } - (NSTextInputContext *)inputContext { return [[WebTextInputWindowController sharedTextInputWindowController] inputContext]; } - (void)keyDown:(NSEvent *)event { if (!_isStarted || !_proxy) return; NSString *string = nil; if ([[WebTextInputWindowController sharedTextInputWindowController] interpretKeyEvent:event string:&string]) { if (string) _proxy->insertText(string); return; } _proxy->keyEvent(self, event, NPCocoaEventKeyDown); } - (void)keyUp:(NSEvent *)event { if (_isStarted && _proxy) _proxy->keyEvent(self, event, NPCocoaEventKeyUp); } - (void)flagsChanged:(NSEvent *)event { if (_isStarted && _proxy) _proxy->flagsChanged(event); } - (void)sendModifierEventWithKeyCode:(int)keyCode character:(char)character { if (_isStarted && _proxy) _proxy->syntheticKeyDownWithCommandModifier(keyCode, character); } - (void)pluginHostDied { _pluginHostDied = YES; _pluginLayer = nil; _proxy = 0; // No need for us to be layer backed anymore self.wantsLayer = NO; [self invalidatePluginContentRect:[self bounds]]; } - (void)drawRect:(NSRect)rect { if (_proxy) { if (_softwareRenderer) { if ([NSGraphicsContext currentContextDrawingToScreen]) WKSoftwareCARendererRender(_softwareRenderer, (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], NSRectToCGRect(rect)); else _proxy->print(reinterpret_cast([[NSGraphicsContext currentContext] graphicsPort]), [self bounds].size.width, [self bounds].size.height); } return; } if (_pluginHostDied) { static NSImage *nullPlugInImage; if (!nullPlugInImage) { NSBundle *bundle = [NSBundle bundleForClass:[WebHostedNetscapePluginView class]]; nullPlugInImage = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"nullplugin" ofType:@"tiff"]]; [nullPlugInImage setFlipped:YES]; } if (!nullPlugInImage) return; NSSize imageSize = [nullPlugInImage size]; NSSize viewSize = [self bounds].size; NSPoint point = NSMakePoint((viewSize.width - imageSize.width) / 2.0, (viewSize.height - imageSize.height) / 2.0); [nullPlugInImage drawAtPoint:point fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } } - (PassRefPtr)createPluginBindingsInstance:(PassRefPtr)rootObject { if (!_proxy) return 0; return _proxy->createBindingsInstance(rootObject); } - (void)pluginView:(NSView *)pluginView receivedResponse:(NSURLResponse *)response { ASSERT(_loadManually); if (!_proxy) return; ASSERT(!_proxy->manualStream()); _proxy->setManualStream(HostedNetscapePluginStream::create(_proxy.get(), core([self webFrame])->loader())); _proxy->manualStream()->startStreamWithResponse(response); } - (void)pluginView:(NSView *)pluginView receivedData:(NSData *)data { ASSERT(_loadManually); if (!_proxy) return; if (HostedNetscapePluginStream* manualStream = _proxy->manualStream()) manualStream->didReceiveData(0, static_cast([data bytes]), [data length]); } - (void)pluginView:(NSView *)pluginView receivedError:(NSError *)error { ASSERT(_loadManually); if (!_proxy) return; if (HostedNetscapePluginStream* manualStream = _proxy->manualStream()) manualStream->didFail(0, error); } - (void)pluginViewFinishedLoading:(NSView *)pluginView { ASSERT(_loadManually); if (!_proxy) return; if (HostedNetscapePluginStream* manualStream = _proxy->manualStream()) manualStream->didFinishLoading(0); } - (void)_webPluginContainerCancelCheckIfAllowedToLoadRequest:(id)webPluginContainerCheck { ASSERT([webPluginContainerCheck isKindOfClass:[WebPluginContainerCheck class]]); id contextInfo = [webPluginContainerCheck contextInfo]; ASSERT(contextInfo && [contextInfo isKindOfClass:[NSNumber class]]); if (!_proxy) return; uint32_t checkID = [(NSNumber *)contextInfo unsignedIntValue]; _proxy->cancelCheckIfAllowedToLoadURL(checkID); } - (void)_containerCheckResult:(PolicyAction)policy contextInfo:(id)contextInfo { ASSERT([contextInfo isKindOfClass:[NSNumber class]]); if (!_proxy) return; uint32_t checkID = [(NSNumber *)contextInfo unsignedIntValue]; _proxy->checkIfAllowedToLoadURLResult(checkID, (policy == PolicyUse)); } @end #endif WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.h0000644000175000017500000000755511243171456021403 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #ifndef HostedNetscapePluginStream_h #define HostedNetscapePluginStream_h #include #include #include #include #include #include namespace WebCore { class FrameLoader; class NetscapePlugInStreamLoader; } namespace WebKit { class NetscapePluginInstanceProxy; class HostedNetscapePluginStream : public RefCounted , private WebCore::NetscapePlugInStreamLoaderClient { public: static PassRefPtr create(NetscapePluginInstanceProxy* instance, uint32_t streamID, NSURLRequest *request) { return adoptRef(new HostedNetscapePluginStream(instance, streamID, request)); } static PassRefPtr create(NetscapePluginInstanceProxy* instance, WebCore::FrameLoader* frameLoader) { return adoptRef(new HostedNetscapePluginStream(instance, frameLoader)); } ~HostedNetscapePluginStream(); uint32_t streamID() const { return m_streamID; } void startStreamWithResponse(NSURLResponse *response); void didReceiveData(WebCore::NetscapePlugInStreamLoader*, const char* bytes, int length); void didFinishLoading(WebCore::NetscapePlugInStreamLoader*); void didFail(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceError&); void start(); void stop(); void cancelLoad(NPReason reason); private: NSError *errorForReason(NPReason) const; void cancelLoad(NSError *); HostedNetscapePluginStream(NetscapePluginInstanceProxy*, uint32_t streamID, NSURLRequest *); HostedNetscapePluginStream(NetscapePluginInstanceProxy*, WebCore::FrameLoader*); void startStream(NSURL *, long long expectedContentLength, NSDate *lastModifiedDate, NSString *mimeType, NSData *headers); NSError *pluginCancelledConnectionError() const; // NetscapePlugInStreamLoaderClient methods. void didReceiveResponse(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceResponse&); bool wantsAllStreams() const; RefPtr m_instance; uint32_t m_streamID; bool m_isTerminated; RetainPtr m_request; RetainPtr m_requestURL; RetainPtr m_responseURL; RetainPtr m_mimeType; WebCore::FrameLoader* m_frameLoader; RefPtr m_loader; }; } #endif // HostedNetscapePluginStream_h #endif // USE(PLUGIN_HOST_PROCESS) WebKit/mac/Plugins/Hosted/ProxyInstance.h0000644000175000017500000000703111176675433016743 0ustar leelee/* * Copyright (C) 2009 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #ifndef ProxyInstance_h #define ProxyInstance_h #include #include #include #include "WebKitPluginHostTypes.h" namespace WebKit { class ProxyClass; class NetscapePluginInstanceProxy; class ProxyInstance : public JSC::Bindings::Instance { public: static PassRefPtr create(PassRefPtr rootObject, NetscapePluginInstanceProxy* instanceProxy, uint32_t objectID) { return adoptRef(new ProxyInstance(rootObject, instanceProxy, objectID)); } ~ProxyInstance(); JSC::Bindings::MethodList methodsNamed(const JSC::Identifier&); JSC::Bindings::Field* fieldNamed(const JSC::Identifier&); JSC::JSValue fieldValue(JSC::ExecState*, const JSC::Bindings::Field*) const; void setFieldValue(JSC::ExecState*, const JSC::Bindings::Field*, JSC::JSValue) const; void invalidate(); uint32_t objectID() const { return m_objectID; } private: ProxyInstance(PassRefPtr, NetscapePluginInstanceProxy*, uint32_t objectID); virtual JSC::Bindings::Class *getClass() const; virtual JSC::JSValue invokeMethod(JSC::ExecState*, const JSC::Bindings::MethodList&, const JSC::ArgList& args); virtual bool supportsInvokeDefaultMethod() const; virtual JSC::JSValue invokeDefaultMethod(JSC::ExecState*, const JSC::ArgList&); virtual bool supportsConstruct() const; virtual JSC::JSValue invokeConstruct(JSC::ExecState*, const JSC::ArgList&); virtual JSC::JSValue defaultValue(JSC::ExecState*, JSC::PreferredPrimitiveType) const; virtual JSC::JSValue valueOf(JSC::ExecState*) const; virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&); JSC::JSValue stringValue(JSC::ExecState*) const; JSC::JSValue numberValue(JSC::ExecState*) const; JSC::JSValue booleanValue() const; JSC::JSValue invoke(JSC::ExecState*, InvokeType, uint64_t identifier, const JSC::ArgList& args); NetscapePluginInstanceProxy* m_instanceProxy; uint32_t m_objectID; JSC::Bindings::FieldMap m_fields; JSC::Bindings::MethodMap m_methods; }; } #endif // ProxyInstance_h #endif // USE(PLUGIN_HOST_PROCESS) WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h0000644000175000017500000003023311261517444021575 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #ifndef NetscapePluginInstanceProxy_h #define NetscapePluginInstanceProxy_h #include #include #include #include #include #include #include #include #include "WebKitPluginHostTypes.h" namespace WebCore { class String; } namespace JSC { namespace Bindings { class Instance; class RootObject; } } @class WebHostedNetscapePluginView; namespace WebKit { class HostedNetscapePluginStream; class NetscapePluginHostProxy; class ProxyInstance; class NetscapePluginInstanceProxy : public RefCounted { public: static PassRefPtr create(NetscapePluginHostProxy* pluginHostProxy, WebHostedNetscapePluginView *pluginView, bool fullFramePlugin) { return adoptRef(new NetscapePluginInstanceProxy(pluginHostProxy, pluginView, fullFramePlugin)); } ~NetscapePluginInstanceProxy(); uint32_t pluginID() const { ASSERT(m_pluginID); return m_pluginID; } uint32_t renderContextID() const { return m_renderContextID; } void setRenderContextID(uint32_t renderContextID) { m_renderContextID = renderContextID; } bool useSoftwareRenderer() const { return m_useSoftwareRenderer; } void setUseSoftwareRenderer(bool useSoftwareRenderer) { m_useSoftwareRenderer = useSoftwareRenderer; } WebHostedNetscapePluginView *pluginView() const { return m_pluginView; } NetscapePluginHostProxy* hostProxy() const { return m_pluginHostProxy; } bool cancelStreamLoad(uint32_t streamID, NPReason); void disconnectStream(HostedNetscapePluginStream*); void setManualStream(PassRefPtr); HostedNetscapePluginStream* manualStream() const { return m_manualStream.get(); } void pluginHostDied(); void resize(NSRect size, NSRect clipRect, bool sync); void destroy(); void focusChanged(bool hasFocus); void windowFocusChanged(bool hasFocus); void windowFrameChanged(NSRect frame); void mouseEvent(NSView *pluginView, NSEvent *, NPCocoaEventType); void keyEvent(NSView *pluginView, NSEvent *, NPCocoaEventType); void insertText(NSString *); bool wheelEvent(NSView *pluginView, NSEvent *); void syntheticKeyDownWithCommandModifier(int keyCode, char character); void flagsChanged(NSEvent *); void print(CGContextRef, unsigned width, unsigned height); void startTimers(bool throttleTimers); void stopTimers(); void invalidateRect(double x, double y, double width, double height); // NPRuntime bool getWindowNPObject(uint32_t& objectID); bool getPluginElementNPObject(uint32_t& objectID); void releaseObject(uint32_t objectID); bool evaluate(uint32_t objectID, const WebCore::String& script, data_t& resultData, mach_msg_type_number_t& resultLength, bool allowPopups); bool invoke(uint32_t objectID, const JSC::Identifier& methodName, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength); bool invokeDefault(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength); bool construct(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength); bool enumerate(uint32_t objectID, data_t& resultData, mach_msg_type_number_t& resultLength); bool getProperty(uint32_t objectID, const JSC::Identifier& propertyName, data_t &resultData, mach_msg_type_number_t& resultLength); bool getProperty(uint32_t objectID, unsigned propertyName, data_t &resultData, mach_msg_type_number_t& resultLength); bool setProperty(uint32_t objectID, const JSC::Identifier& propertyName, data_t valueData, mach_msg_type_number_t valueLength); bool setProperty(uint32_t objectID, unsigned propertyName, data_t valueData, mach_msg_type_number_t valueLength); bool removeProperty(uint32_t objectID, const JSC::Identifier& propertyName); bool removeProperty(uint32_t objectID, unsigned propertyName); bool hasProperty(uint32_t objectID, const JSC::Identifier& propertyName); bool hasProperty(uint32_t objectID, unsigned propertyName); bool hasMethod(uint32_t objectID, const JSC::Identifier& methodName); void status(const char* message); NPError loadURL(const char* url, const char* target, const char* postData, uint32_t postDataLength, LoadURLFlags, uint32_t& requestID); bool getCookies(data_t urlData, mach_msg_type_number_t urlLength, data_t& cookiesData, mach_msg_type_number_t& cookiesLength); bool setCookies(data_t urlData, mach_msg_type_number_t urlLength, data_t cookiesData, mach_msg_type_number_t cookiesLength); bool getProxy(data_t urlData, mach_msg_type_number_t urlLength, data_t& proxyData, mach_msg_type_number_t& proxyLength); bool getAuthenticationInfo(data_t protocolData, data_t hostData, uint32_t port, data_t schemeData, data_t realmData, data_t& usernameData, mach_msg_type_number_t& usernameLength, data_t& passwordData, mach_msg_type_number_t& passwordLength); bool convertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double& destX, double& destY, NPCoordinateSpace destSpace); PassRefPtr createBindingsInstance(PassRefPtr); RetainPtr marshalValues(JSC::ExecState*, const JSC::ArgList& args); void marshalValue(JSC::ExecState*, JSC::JSValue value, data_t& resultData, mach_msg_type_number_t& resultLength); JSC::JSValue demarshalValue(JSC::ExecState*, const char* valueData, mach_msg_type_number_t valueLength); void addInstance(ProxyInstance*); void removeInstance(ProxyInstance*); void cleanup(); void invalidate(); void willCallPluginFunction(); void didCallPluginFunction(); bool shouldStop(); uint32_t nextRequestID(); uint32_t checkIfAllowedToLoadURL(const char* url, const char* target); void cancelCheckIfAllowedToLoadURL(uint32_t checkID); void checkIfAllowedToLoadURLResult(uint32_t checkID, bool allowed); void resolveURL(const char* url, const char* target, data_t& resolvedURLData, mach_msg_type_number_t& resolvedURLLength); // Reply structs struct Reply { enum Type { InstantiatePlugin, GetScriptableNPObject, BooleanAndData, Boolean }; Reply(Type type) : m_type(type) { } virtual ~Reply() { } Type m_type; }; struct InstantiatePluginReply : public Reply { static const int ReplyType = InstantiatePlugin; InstantiatePluginReply(kern_return_t resultCode, uint32_t renderContextID, boolean_t useSoftwareRenderer) : Reply(InstantiatePlugin) , m_resultCode(resultCode) , m_renderContextID(renderContextID) , m_useSoftwareRenderer(useSoftwareRenderer) { } kern_return_t m_resultCode; uint32_t m_renderContextID; boolean_t m_useSoftwareRenderer; }; struct GetScriptableNPObjectReply : public Reply { static const Reply::Type ReplyType = GetScriptableNPObject; GetScriptableNPObjectReply(uint32_t objectID) : Reply(ReplyType) , m_objectID(objectID) { } uint32_t m_objectID; }; struct BooleanReply : public Reply { static const Reply::Type ReplyType = Boolean; BooleanReply(boolean_t result) : Reply(ReplyType) , m_result(result) { } boolean_t m_result; }; struct BooleanAndDataReply : public Reply { static const Reply::Type ReplyType = BooleanAndData; BooleanAndDataReply(boolean_t returnValue, RetainPtr result) : Reply(ReplyType) , m_returnValue(returnValue) , m_result(result) { } boolean_t m_returnValue; RetainPtr m_result; }; void setCurrentReply(uint32_t requestID, Reply* reply) { ASSERT(!m_replies.contains(requestID)); m_replies.set(requestID, reply); } template std::auto_ptr waitForReply(uint32_t requestID) { m_waitingForReply = true; Reply* reply = processRequestsAndWaitForReply(requestID); if (reply) ASSERT(reply->m_type == T::ReplyType); m_waitingForReply = false; return std::auto_ptr(static_cast(reply)); } private: NetscapePluginInstanceProxy(NetscapePluginHostProxy*, WebHostedNetscapePluginView *, bool fullFramePlugin); NPError loadRequest(NSURLRequest *, const char* cTarget, bool currentEventIsUserGesture, uint32_t& streamID); class PluginRequest; void performRequest(PluginRequest*); void evaluateJavaScript(PluginRequest*); void stopAllStreams(); Reply* processRequestsAndWaitForReply(uint32_t requestID); NetscapePluginHostProxy* m_pluginHostProxy; WebHostedNetscapePluginView *m_pluginView; void requestTimerFired(WebCore::Timer*); WebCore::Timer m_requestTimer; Deque m_pluginRequests; HashMap > m_streams; uint32_t m_currentURLRequestID; uint32_t m_pluginID; uint32_t m_renderContextID; boolean_t m_useSoftwareRenderer; bool m_waitingForReply; HashMap m_replies; // NPRuntime uint32_t idForObject(JSC::JSObject*); void addValueToArray(NSMutableArray *, JSC::ExecState* exec, JSC::JSValue value); bool demarshalValueFromArray(JSC::ExecState*, NSArray *array, NSUInteger& index, JSC::JSValue& result); void demarshalValues(JSC::ExecState*, data_t valuesData, mach_msg_type_number_t valuesLength, JSC::MarkedArgumentBuffer& result); uint32_t m_objectIDCounter; typedef HashMap > ObjectMap; ObjectMap m_objects; typedef HashSet ProxyInstanceSet; ProxyInstanceSet m_instances; uint32_t m_urlCheckCounter; typedef HashMap > URLCheckMap; URLCheckMap m_urlChecks; unsigned m_pluginFunctionCallDepth; bool m_shouldStopSoon; uint32_t m_currentRequestID; bool m_inDestroy; RefPtr m_manualStream; }; } // namespace WebKit #endif // NetscapePluginInstanceProxy_h #endif // USE(PLUGIN_HOST_PROCESS) WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h0000644000175000017500000000543711225466207021207 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #ifndef NetscapePluginHostManager_h #define NetscapePluginHostManager_h #import #import @class WebHostedNetscapePluginView; @class WebNetscapePluginPackage; namespace WebKit { class NetscapePluginInstanceProxy; class NetscapePluginHostProxy; class NetscapePluginHostManager { public: static NetscapePluginHostManager& shared(); PassRefPtr instantiatePlugin(WebNetscapePluginPackage *, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame); void pluginHostDied(NetscapePluginHostProxy*); static void createPropertyListFile(WebNetscapePluginPackage *); void didCreateWindow(); private: NetscapePluginHostProxy* hostForPackage(WebNetscapePluginPackage *); NetscapePluginHostManager(); ~NetscapePluginHostManager(); bool spawnPluginHost(WebNetscapePluginPackage *, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN); bool initializeVendorPort(); mach_port_t m_pluginVendorPort; // FIXME: This should really be a HashMap of RetainPtrs, but that doesn't work right now. typedef HashMap PluginHostMap; PluginHostMap m_pluginHosts; }; } // namespace WebKit #endif // NetscapePluginHostManager_h #endif // USE(PLUGIN_HOST_PROCESS) WebKit/mac/Plugins/Hosted/WebKitPluginAgent.defs0000644000175000017500000000413111225466207020140 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #include subsystem WebKitPluginAgent 100; serverprefix WKPA; userprefix _WKPA; routine CheckInApplication(serverPort :mach_port_t; ServerAuditToken token :audit_token_t; applicationName :application_name_t; out pluginVendorPort :mach_port_make_send_t); routine SpawnPluginHost(pluginVendorPort :mach_port_t; sreplyport _replyPort :mach_port_make_send_once_t; options :plist_bytes_t; out pluginHostPort: mach_port_move_send_t); routine CheckInPluginHost(serverPort :mach_port_t; pluginHostPort :mach_port_move_send_t; ServerAuditToken token :audit_token_t); WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h0000644000175000017500000000701511225466207020750 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #ifndef NetscapePluginHostProxy_h #define NetscapePluginHostProxy_h #include #include #include #include @class WebPlaceholderModalWindow; namespace WebKit { class NetscapePluginInstanceProxy; class NetscapePluginHostProxy { public: NetscapePluginHostProxy(mach_port_t clientPort, mach_port_t pluginHostPort, const ProcessSerialNumber& pluginHostPSN, bool shouldCacheMissingPropertiesAndMethods); mach_port_t port() const { return m_pluginHostPort; } mach_port_t clientPort() const { return m_clientPort; } void addPluginInstance(NetscapePluginInstanceProxy*); void removePluginInstance(NetscapePluginInstanceProxy*); NetscapePluginInstanceProxy* pluginInstance(uint32_t pluginID); bool isMenuBarVisible() const { return m_menuBarIsVisible; } void setMenuBarVisible(bool); void setModal(bool); void applicationDidBecomeActive(); bool processRequests(); bool isProcessingRequests() const { return m_processingRequests; } bool shouldCacheMissingPropertiesAndMethods() const { return m_shouldCacheMissingPropertiesAndMethods; } private: ~NetscapePluginHostProxy(); void pluginHostDied(); void beginModal(); void endModal(); static void deadNameNotificationCallback(CFMachPortRef port, void *msg, CFIndex size, void *info); typedef HashMap > PluginInstanceMap; PluginInstanceMap m_instances; mach_port_t m_clientPort; mach_port_t m_portSet; #ifdef USE_LIBDISPATCH dispatch_source_t m_clientPortSource; #else RetainPtr m_clientPortSource; #endif mach_port_t m_pluginHostPort; RetainPtr m_deadNameNotificationPort; RetainPtr m_activationObserver; RetainPtr m_placeholderWindow; unsigned m_isModal; bool m_menuBarIsVisible; const ProcessSerialNumber m_pluginHostPSN; unsigned m_processingRequests; bool m_shouldCacheMissingPropertiesAndMethods; }; } // namespace WebKit #endif // NetscapePluginHostProxy_h #endif // USE(PLUGIN_HOST_PROCESS) WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.h0000644000175000017500000000456611225466207021520 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #import "WebBaseNetscapePluginView.h" #import "WebKitSystemInterface.h" #import namespace WebKit { class HostedNetscapePluginStream; class NetscapePluginInstanceProxy; } @interface WebHostedNetscapePluginView : WebBaseNetscapePluginView { RetainPtr _attributeKeys; RetainPtr _attributeValues; RetainPtr _pluginLayer; WKSoftwareCARendererRef _softwareRenderer; NSSize _previousSize; RefPtr _proxy; BOOL _pluginHostDied; } - (id)initWithFrame:(NSRect)r pluginPackage:(WebNetscapePluginPackage *)thePluginPackage URL:(NSURL *)URL baseURL:(NSURL *)baseURL MIMEType:(NSString *)MIME attributeKeys:(NSArray *)keys attributeValues:(NSArray *)values loadManually:(BOOL)loadManually element:(PassRefPtr)element; - (void)pluginHostDied; @end #endif // USE(PLUGIN_HOST_PROCESS) WebKit/mac/Plugins/Hosted/WebKitPluginHostTypes.defs0000644000175000017500000000303311225466207021044 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #include #include import ; type plist_bytes_t = ^array [] of uint8_t; type application_name_t = ^array [] of uint8_t; type data_t = ^array [] of char; WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm0000644000175000017500000002530111252576722021557 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #import "HostedNetscapePluginStream.h" #import "NetscapePluginHostProxy.h" #import "NetscapePluginInstanceProxy.h" #import "WebFrameInternal.h" #import "WebHostedNetscapePluginView.h" #import "WebKitErrorsPrivate.h" #import "WebKitPluginHost.h" #import "WebKitSystemInterface.h" #import "WebNSURLExtras.h" #import "WebNSURLRequestExtras.h" #import #import #import #import #import using namespace WebCore; namespace WebKit { #ifndef NDEBUG static WTF::RefCountedLeakCounter hostedNetscapePluginStreamCounter("HostedNetscapePluginStream"); #endif HostedNetscapePluginStream::HostedNetscapePluginStream(NetscapePluginInstanceProxy* instance, uint32_t streamID, NSURLRequest *request) : m_instance(instance) , m_streamID(streamID) , m_isTerminated(false) , m_request(AdoptNS, [request mutableCopy]) , m_requestURL([request URL]) , m_frameLoader(0) { if (core([instance->pluginView() webFrame])->loader()->shouldHideReferrer([request URL], core([instance->pluginView() webFrame])->loader()->outgoingReferrer())) [m_request.get() _web_setHTTPReferrer:nil]; #ifndef NDEBUG hostedNetscapePluginStreamCounter.increment(); #endif } HostedNetscapePluginStream::HostedNetscapePluginStream(NetscapePluginInstanceProxy* instance, WebCore::FrameLoader* frameLoader) : m_instance(instance) , m_streamID(1) , m_isTerminated(false) , m_frameLoader(frameLoader) { #ifndef NDEBUG hostedNetscapePluginStreamCounter.increment(); #endif } HostedNetscapePluginStream::~HostedNetscapePluginStream() { #ifndef NDEBUG hostedNetscapePluginStreamCounter.decrement(); #endif } void HostedNetscapePluginStream::startStreamWithResponse(NSURLResponse *response) { didReceiveResponse(0, response); } void HostedNetscapePluginStream::startStream(NSURL *responseURL, long long expectedContentLength, NSDate *lastModifiedDate, NSString *mimeType, NSData *headers) { m_responseURL = responseURL; m_mimeType = mimeType; char* mimeTypeUTF8 = const_cast([mimeType UTF8String]); int mimeTypeUTF8Length = mimeTypeUTF8 ? strlen (mimeTypeUTF8) + 1 : 0; const char *url = [responseURL _web_URLCString]; int urlLength = url ? strlen(url) + 1 : 0; _WKPHStartStream(m_instance->hostProxy()->port(), m_instance->pluginID(), m_streamID, const_cast(url), urlLength, expectedContentLength, [lastModifiedDate timeIntervalSince1970], mimeTypeUTF8, mimeTypeUTF8Length, const_cast(reinterpret_cast([headers bytes])), [headers length]); } void HostedNetscapePluginStream::didReceiveData(WebCore::NetscapePlugInStreamLoader*, const char* bytes, int length) { _WKPHStreamDidReceiveData(m_instance->hostProxy()->port(), m_instance->pluginID(), m_streamID, const_cast(bytes), length); } void HostedNetscapePluginStream::didFinishLoading(WebCore::NetscapePlugInStreamLoader*) { _WKPHStreamDidFinishLoading(m_instance->hostProxy()->port(), m_instance->pluginID(), m_streamID); m_instance->disconnectStream(this); } void HostedNetscapePluginStream::didReceiveResponse(NetscapePlugInStreamLoader*, const ResourceResponse& response) { NSURLResponse *r = response.nsURLResponse(); NSMutableData *theHeaders = nil; long long expectedContentLength = [r expectedContentLength]; if ([r isKindOfClass:[NSHTTPURLResponse class]]) { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)r; theHeaders = [NSMutableData dataWithCapacity:1024]; // FIXME: it would be nice to be able to get the raw HTTP header block. // This includes the HTTP version, the real status text, // all headers in their original order and including duplicates, // and all original bytes verbatim, rather than sent through Unicode translation. // Unfortunately NSHTTPURLResponse doesn't provide access at that low a level. [theHeaders appendBytes:"HTTP " length:5]; char statusStr[10]; long statusCode = [httpResponse statusCode]; snprintf(statusStr, sizeof(statusStr), "%ld", statusCode); [theHeaders appendBytes:statusStr length:strlen(statusStr)]; [theHeaders appendBytes:" OK\n" length:4]; // HACK: pass the headers through as UTF-8. // This is not the intended behavior; we're supposed to pass original bytes verbatim. // But we don't have the original bytes, we have NSStrings built by the URL loading system. // It hopefully shouldn't matter, since RFC2616/RFC822 require ASCII-only headers, // but surely someone out there is using non-ASCII characters, and hopefully UTF-8 is adequate here. // It seems better than NSASCIIStringEncoding, which will lose information if non-ASCII is used. NSDictionary *headerDict = [httpResponse allHeaderFields]; NSArray *keys = [[headerDict allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; NSEnumerator *i = [keys objectEnumerator]; NSString *k; while ((k = [i nextObject]) != nil) { NSString *v = [headerDict objectForKey:k]; [theHeaders appendData:[k dataUsingEncoding:NSUTF8StringEncoding]]; [theHeaders appendBytes:": " length:2]; [theHeaders appendData:[v dataUsingEncoding:NSUTF8StringEncoding]]; [theHeaders appendBytes:"\n" length:1]; } // If the content is encoded (most likely compressed), then don't send its length to the plugin, // which is only interested in the decoded length, not yet known at the moment. // tracks a request for -[NSURLResponse expectedContentLength] to incorporate this logic. NSString *contentEncoding = (NSString *)[[(NSHTTPURLResponse *)r allHeaderFields] objectForKey:@"Content-Encoding"]; if (contentEncoding && ![contentEncoding isEqualToString:@"identity"]) expectedContentLength = -1; [theHeaders appendBytes:"\0" length:1]; } startStream([r URL], expectedContentLength, WKGetNSURLResponseLastModifiedDate(r), [r MIMEType], theHeaders); } static NPReason reasonForError(NSError *error) { if (!error) return NPRES_DONE; if ([[error domain] isEqualToString:NSURLErrorDomain] && [error code] == NSURLErrorCancelled) return NPRES_USER_BREAK; return NPRES_NETWORK_ERR; } void HostedNetscapePluginStream::didFail(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceError& error) { if (NetscapePluginHostProxy* hostProxy = m_instance->hostProxy()) _WKPHStreamDidFail(hostProxy->port(), m_instance->pluginID(), m_streamID, reasonForError(error)); m_instance->disconnectStream(this); } bool HostedNetscapePluginStream::wantsAllStreams() const { // FIXME: Implement. return false; } void HostedNetscapePluginStream::start() { ASSERT(m_request); ASSERT(!m_frameLoader); ASSERT(!m_loader); m_loader = NetscapePlugInStreamLoader::create(core([m_instance->pluginView() webFrame]), this); m_loader->setShouldBufferData(false); m_loader->documentLoader()->addPlugInStreamLoader(m_loader.get()); m_loader->load(m_request.get()); } void HostedNetscapePluginStream::stop() { ASSERT(!m_frameLoader); if (!m_loader->isDone()) m_loader->cancel(m_loader->cancelledError()); } void HostedNetscapePluginStream::cancelLoad(NPReason reason) { cancelLoad(errorForReason(reason)); } void HostedNetscapePluginStream::cancelLoad(NSError *error) { if (m_frameLoader) { ASSERT(!m_loader); DocumentLoader* documentLoader = m_frameLoader->activeDocumentLoader(); if (documentLoader && documentLoader->isLoadingMainResource()) documentLoader->cancelMainResourceLoad(error); return; } if (!m_loader->isDone()) { // Cancelling the load will disconnect the stream so there's no need to do it explicitly. m_loader->cancel(error); } else m_instance->disconnectStream(this); } NSError *HostedNetscapePluginStream::pluginCancelledConnectionError() const { return [[[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInCancelledConnection contentURL:m_responseURL ? m_responseURL.get() : m_requestURL.get() pluginPageURL:nil pluginName:[[m_instance->pluginView() pluginPackage] name] MIMEType:m_mimeType.get()] autorelease]; } NSError *HostedNetscapePluginStream::errorForReason(NPReason reason) const { if (reason == NPRES_DONE) return nil; if (reason == NPRES_USER_BREAK) return [NSError _webKitErrorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled URL:m_responseURL ? m_responseURL.get() : m_requestURL.get()]; return pluginCancelledConnectionError(); } } // namespace WebKit #endif // USE(PLUGIN_HOST_PROCESS) WebKit/mac/Plugins/Hosted/WebKitPluginHostTypes.h0000644000175000017500000000364011225466207020356 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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 WebKitPluginHostTypes_h #define WebKitPluginHostTypes_h typedef uint8_t* plist_bytes_t; typedef uint8_t* application_name_t; typedef char* data_t; #ifndef __MigTypeCheck #define __MigTypeCheck 1 #endif enum LoadURLFlags { IsPost = 1 << 0, PostDataIsFile = 1 << 1, AllowHeadersInPostData = 1 << 2, AllowPopups = 1 << 3, }; enum InvokeType { Invoke, InvokeDefault, Construct }; enum ValueType { VoidValueType, NullValueType, BoolValueType, DoubleValueType, StringValueType, JSObjectValueType, NPObjectValueType }; #endif // WebKitPluginHostTypes_h WebKit/mac/Plugins/Hosted/ProxyInstance.mm0000644000175000017500000003441611254533351017121 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if USE(PLUGIN_HOST_PROCESS) #import "ProxyInstance.h" #import "NetscapePluginHostProxy.h" #import "NetscapePluginInstanceProxy.h" #import #import #import #import extern "C" { #import "WebKitPluginHost.h" } using namespace JSC; using namespace JSC::Bindings; using namespace std; using namespace WebCore; namespace WebKit { class ProxyClass : public JSC::Bindings::Class { private: virtual MethodList methodsNamed(const Identifier&, Instance*) const; virtual Field* fieldNamed(const Identifier&, Instance*) const; }; MethodList ProxyClass::methodsNamed(const Identifier& identifier, Instance* instance) const { return static_cast(instance)->methodsNamed(identifier); } Field* ProxyClass::fieldNamed(const Identifier& identifier, Instance* instance) const { return static_cast(instance)->fieldNamed(identifier); } static ProxyClass* proxyClass() { DEFINE_STATIC_LOCAL(ProxyClass, proxyClass, ()); return &proxyClass; } class ProxyField : public JSC::Bindings::Field { public: ProxyField(uint64_t serverIdentifier) : m_serverIdentifier(serverIdentifier) { } uint64_t serverIdentifier() const { return m_serverIdentifier; } private: virtual JSValue valueFromInstance(ExecState*, const Instance*) const; virtual void setValueToInstance(ExecState*, const Instance*, JSValue) const; uint64_t m_serverIdentifier; }; JSValue ProxyField::valueFromInstance(ExecState* exec, const Instance* instance) const { return static_cast(instance)->fieldValue(exec, this); } void ProxyField::setValueToInstance(ExecState* exec, const Instance* instance, JSValue value) const { static_cast(instance)->setFieldValue(exec, this, value); } class ProxyMethod : public JSC::Bindings::Method { public: ProxyMethod(uint64_t serverIdentifier) : m_serverIdentifier(serverIdentifier) { } uint64_t serverIdentifier() const { return m_serverIdentifier; } private: virtual int numParameters() const { return 0; } uint64_t m_serverIdentifier; }; ProxyInstance::ProxyInstance(PassRefPtr rootObject, NetscapePluginInstanceProxy* instanceProxy, uint32_t objectID) : Instance(rootObject) , m_instanceProxy(instanceProxy) , m_objectID(objectID) { m_instanceProxy->addInstance(this); } ProxyInstance::~ProxyInstance() { deleteAllValues(m_fields); deleteAllValues(m_methods); if (!m_instanceProxy) return; m_instanceProxy->removeInstance(this); invalidate(); } JSC::Bindings::Class *ProxyInstance::getClass() const { return proxyClass(); } JSValue ProxyInstance::invoke(JSC::ExecState* exec, InvokeType type, uint64_t identifier, const JSC::ArgList& args) { if (!m_instanceProxy) return jsUndefined(); RetainPtr arguments(m_instanceProxy->marshalValues(exec, args)); uint32_t requestID = m_instanceProxy->nextRequestID(); if (_WKPHNPObjectInvoke(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), requestID, m_objectID, type, identifier, (char*)[arguments.get() bytes], [arguments.get() length]) != KERN_SUCCESS) return jsUndefined(); auto_ptr reply = m_instanceProxy->waitForReply(requestID); if (!reply.get() || !reply->m_returnValue) return jsUndefined(); return m_instanceProxy->demarshalValue(exec, (char*)CFDataGetBytePtr(reply->m_result.get()), CFDataGetLength(reply->m_result.get())); } JSValue ProxyInstance::invokeMethod(ExecState* exec, const MethodList& methodList, const ArgList& args) { ASSERT(methodList.size() == 1); ProxyMethod* method = static_cast(methodList[0]); return invoke(exec, Invoke, method->serverIdentifier(), args); } bool ProxyInstance::supportsInvokeDefaultMethod() const { if (!m_instanceProxy) return false; uint32_t requestID = m_instanceProxy->nextRequestID(); if (_WKPHNPObjectHasInvokeDefaultMethod(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), requestID, m_objectID) != KERN_SUCCESS) return false; auto_ptr reply = m_instanceProxy->waitForReply(requestID); if (reply.get() && reply->m_result) return true; return false; } JSValue ProxyInstance::invokeDefaultMethod(ExecState* exec, const ArgList& args) { return invoke(exec, InvokeDefault, 0, args); } bool ProxyInstance::supportsConstruct() const { if (!m_instanceProxy) return false; uint32_t requestID = m_instanceProxy->nextRequestID(); if (_WKPHNPObjectHasConstructMethod(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), requestID, m_objectID) != KERN_SUCCESS) return false; auto_ptr reply = m_instanceProxy->waitForReply(requestID); if (reply.get() && reply->m_result) return true; return false; } JSValue ProxyInstance::invokeConstruct(ExecState* exec, const ArgList& args) { return invoke(exec, Construct, 0, args); } JSValue ProxyInstance::defaultValue(ExecState* exec, PreferredPrimitiveType hint) const { if (hint == PreferString) return stringValue(exec); if (hint == PreferNumber) return numberValue(exec); return valueOf(exec); } JSValue ProxyInstance::stringValue(ExecState* exec) const { // FIXME: Implement something sensible. return jsString(exec, ""); } JSValue ProxyInstance::numberValue(ExecState* exec) const { // FIXME: Implement something sensible. return jsNumber(exec, 0); } JSValue ProxyInstance::booleanValue() const { // FIXME: Implement something sensible. return jsBoolean(false); } JSValue ProxyInstance::valueOf(ExecState* exec) const { return stringValue(exec); } void ProxyInstance::getPropertyNames(ExecState* exec, PropertyNameArray& nameArray) { if (!m_instanceProxy) return; uint32_t requestID = m_instanceProxy->nextRequestID(); if (_WKPHNPObjectEnumerate(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), requestID, m_objectID) != KERN_SUCCESS) return; auto_ptr reply = m_instanceProxy->waitForReply(requestID); if (!reply.get() || !reply->m_returnValue) return; RetainPtr array = [NSPropertyListSerialization propertyListFromData:(NSData *)reply->m_result.get() mutabilityOption:NSPropertyListImmutable format:0 errorDescription:0]; for (NSNumber *number in array.get()) { IdentifierRep* identifier = reinterpret_cast([number longLongValue]); if (!IdentifierRep::isValid(identifier)) continue; if (identifier->isString()) { const char* str = identifier->string(); nameArray.add(Identifier(JSDOMWindow::commonJSGlobalData(), String::fromUTF8WithLatin1Fallback(str, strlen(str)))); } else nameArray.add(Identifier::from(exec, identifier->number())); } } MethodList ProxyInstance::methodsNamed(const Identifier& identifier) { if (!m_instanceProxy) return MethodList(); // If we already have an entry in the map, use it. MethodMap::iterator existingMapEntry = m_methods.find(identifier.ustring().rep()); if (existingMapEntry != m_methods.end()) { MethodList methodList; if (existingMapEntry->second) methodList.append(existingMapEntry->second); return methodList; } uint64_t methodName = reinterpret_cast(_NPN_GetStringIdentifier(identifier.ascii())); uint32_t requestID = m_instanceProxy->nextRequestID(); if (_WKPHNPObjectHasMethod(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), requestID, m_objectID, methodName) != KERN_SUCCESS) return MethodList(); auto_ptr reply = m_instanceProxy->waitForReply(requestID); if (!reply.get()) return MethodList(); if (!reply->m_result && !m_instanceProxy->hostProxy()->shouldCacheMissingPropertiesAndMethods()) return MethodList(); // Add a new entry to the map unless an entry was added while we were in waitForReply. pair mapAddResult = m_methods.add(identifier.ustring().rep(), 0); if (mapAddResult.second && reply->m_result) mapAddResult.first->second = new ProxyMethod(methodName); MethodList methodList; if (mapAddResult.first->second) methodList.append(mapAddResult.first->second); return methodList; } Field* ProxyInstance::fieldNamed(const Identifier& identifier) { if (!m_instanceProxy) return 0; // If we already have an entry in the map, use it. FieldMap::iterator existingMapEntry = m_fields.find(identifier.ustring().rep()); if (existingMapEntry != m_fields.end()) return existingMapEntry->second; uint64_t propertyName = reinterpret_cast(_NPN_GetStringIdentifier(identifier.ascii())); uint32_t requestID = m_instanceProxy->nextRequestID(); if (_WKPHNPObjectHasProperty(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), requestID, m_objectID, propertyName) != KERN_SUCCESS) return 0; auto_ptr reply = m_instanceProxy->waitForReply(requestID); if (!reply.get()) return 0; if (!reply->m_result && !m_instanceProxy->hostProxy()->shouldCacheMissingPropertiesAndMethods()) return 0; // Add a new entry to the map unless an entry was added while we were in waitForReply. pair mapAddResult = m_fields.add(identifier.ustring().rep(), 0); if (mapAddResult.second && reply->m_result) mapAddResult.first->second = new ProxyField(propertyName); return mapAddResult.first->second; } JSC::JSValue ProxyInstance::fieldValue(ExecState* exec, const Field* field) const { if (!m_instanceProxy) return jsUndefined(); uint64_t serverIdentifier = static_cast(field)->serverIdentifier(); uint32_t requestID = m_instanceProxy->nextRequestID(); if (_WKPHNPObjectGetProperty(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), requestID, m_objectID, serverIdentifier) != KERN_SUCCESS) return jsUndefined(); auto_ptr reply = m_instanceProxy->waitForReply(requestID); if (!reply.get() || !reply->m_returnValue) return jsUndefined(); return m_instanceProxy->demarshalValue(exec, (char*)CFDataGetBytePtr(reply->m_result.get()), CFDataGetLength(reply->m_result.get())); } void ProxyInstance::setFieldValue(ExecState* exec, const Field* field, JSValue value) const { if (m_instanceProxy) return; uint64_t serverIdentifier = static_cast(field)->serverIdentifier(); uint32_t requestID = m_instanceProxy->nextRequestID(); data_t valueData; mach_msg_type_number_t valueLength; m_instanceProxy->marshalValue(exec, value, valueData, valueLength); kern_return_t kr = _WKPHNPObjectSetProperty(m_instanceProxy->hostProxy()->port(), m_instanceProxy->pluginID(), requestID, m_objectID, serverIdentifier, valueData, valueLength); mig_deallocate(reinterpret_cast(valueData), valueLength); if (kr != KERN_SUCCESS) return; auto_ptr reply = m_instanceProxy->waitForReply(requestID); } void ProxyInstance::invalidate() { ASSERT(m_instanceProxy); if (NetscapePluginHostProxy* hostProxy = m_instanceProxy->hostProxy()) _WKPHNPObjectRelease(hostProxy->port(), m_instanceProxy->pluginID(), m_objectID); m_instanceProxy = 0; } } // namespace WebKit #endif // USE(PLUGIN_HOST_PROCESS) WebKit/mac/Plugins/WebPluginRequest.h0000644000175000017500000000420411115636062016137 0ustar leelee/* * Copyright (C) 2005, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) @interface WebPluginRequest : NSObject { NSURLRequest *_request; NSString *_frameName; void *_notifyData; BOOL _didStartFromUserGesture; BOOL _sendNotification; } - (id)initWithRequest:(NSURLRequest *)request frameName:(NSString *)frameName notifyData:(void *)notifyData sendNotification:(BOOL)sendNotification didStartFromUserGesture:(BOOL)currentEventIsUserGesture; - (NSURLRequest *)request; - (NSString *)frameName; - (void *)notifyData; - (BOOL)isCurrentEventUserGesture; - (BOOL)sendNotification; @end #endif // ENABLE(NETSCAPE_PLUGIN_API) WebKit/mac/Plugins/WebBaseNetscapePluginStream.h0000644000175000017500000001151011106113613020206 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) #import #import #import #import #import #import #import #import #import "WebNetscapePluginView.h" namespace WebCore { class FrameLoader; class NetscapePlugInStreamLoader; } @class WebNetscapePluginView; @class NSURLResponse; class WebNetscapePluginStream : public RefCounted , private WebCore::NetscapePlugInStreamLoaderClient { public: static PassRefPtr create(NSURLRequest *request, NPP plugin, bool sendNotification, void* notifyData) { return adoptRef(new WebNetscapePluginStream(request, plugin, sendNotification, notifyData)); } static PassRefPtr create(WebCore::FrameLoader* frameLoader) { return adoptRef(new WebNetscapePluginStream(frameLoader)); } virtual ~WebNetscapePluginStream(); NPP plugin() const { return m_plugin; } void setPlugin(NPP); static NPP ownerForStream(NPStream *); static NPReason reasonForError(NSError *); NSError *errorForReason(NPReason) const; void cancelLoadAndDestroyStreamWithError(NSError *); void setRequestURL(NSURL *requestURL) { m_requestURL = requestURL; } void start(); void stop(); void startStreamWithResponse(NSURLResponse *response); void didReceiveData(WebCore::NetscapePlugInStreamLoader*, const char* bytes, int length); void destroyStreamWithError(NSError *); void didFinishLoading(WebCore::NetscapePlugInStreamLoader*); private: void destroyStream(); void cancelLoadWithError(NSError *); void destroyStreamWithReason(NPReason); void deliverDataToFile(NSData *data); void deliverData(); void startStream(NSURL *, long long expectedContentLength, NSDate *lastModifiedDate, NSString *mimeType, NSData *headers); NSError *pluginCancelledConnectionError() const; // NetscapePlugInStreamLoaderClient methods. void didReceiveResponse(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceResponse&); void didFail(WebCore::NetscapePlugInStreamLoader*, const WebCore::ResourceError&); bool wantsAllStreams() const; RetainPtr m_deliveryData; RetainPtr m_requestURL; RetainPtr m_responseURL; RetainPtr m_mimeType; NPP m_plugin; uint16 m_transferMode; int32 m_offset; NPStream m_stream; RetainPtr m_path; int m_fileDescriptor; BOOL m_sendNotification; void *m_notifyData; char *m_headers; RetainPtr m_pluginView; NPReason m_reason; bool m_isTerminated; bool m_newStreamSuccessful; WebCore::FrameLoader* m_frameLoader; RefPtr m_loader; RetainPtr m_request; NPPluginFuncs *m_pluginFuncs; void deliverDataTimerFired(WebCore::Timer* timer); WebCore::Timer m_deliverDataTimer; WebNetscapePluginStream(WebCore::FrameLoader*); WebNetscapePluginStream(NSURLRequest *, NPP, bool sendNotification, void* notifyData); }; #endif WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm0000644000175000017500000003412411173157003022061 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__) #import "WebNetscapePluginEventHandlerCarbon.h" #import "WebNetscapePluginView.h" #import "WebKitLogging.h" #import "WebKitSystemInterface.h" // Send null events 50 times a second when active, so plug-ins like Flash get high frame rates. #define NullEventIntervalActive 0.02 #define NullEventIntervalNotActive 0.25 WebNetscapePluginEventHandlerCarbon::WebNetscapePluginEventHandlerCarbon(WebNetscapePluginView* pluginView) : WebNetscapePluginEventHandler(pluginView) , m_keyEventHandler(0) , m_suspendKeyUpEvents(false) { } static void getCarbonEvent(EventRecord* carbonEvent) { carbonEvent->what = nullEvent; carbonEvent->message = 0; carbonEvent->when = TickCount(); GetGlobalMouse(&carbonEvent->where); carbonEvent->where.h = static_cast(carbonEvent->where.h * HIGetScaleFactor()); carbonEvent->where.v = static_cast(carbonEvent->where.v * HIGetScaleFactor()); carbonEvent->modifiers = GetCurrentKeyModifiers(); if (!Button()) carbonEvent->modifiers |= btnState; } static EventModifiers modifiersForEvent(NSEvent *event) { EventModifiers modifiers; unsigned int modifierFlags = [event modifierFlags]; NSEventType eventType = [event type]; modifiers = 0; if (eventType != NSLeftMouseDown && eventType != NSRightMouseDown) modifiers |= btnState; if (modifierFlags & NSCommandKeyMask) modifiers |= cmdKey; if (modifierFlags & NSShiftKeyMask) modifiers |= shiftKey; if (modifierFlags & NSAlphaShiftKeyMask) modifiers |= alphaLock; if (modifierFlags & NSAlternateKeyMask) modifiers |= optionKey; if (modifierFlags & NSControlKeyMask || eventType == NSRightMouseDown) modifiers |= controlKey; return modifiers; } static void getCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent) { if (WKConvertNSEventToCarbonEvent(carbonEvent, cocoaEvent)) { carbonEvent->where.h = static_cast(carbonEvent->where.h * HIGetScaleFactor()); carbonEvent->where.v = static_cast(carbonEvent->where.v * HIGetScaleFactor()); return; } NSPoint where = [[cocoaEvent window] convertBaseToScreen:[cocoaEvent locationInWindow]]; carbonEvent->what = nullEvent; carbonEvent->message = 0; carbonEvent->when = (UInt32)([cocoaEvent timestamp] * 60); // seconds to ticks carbonEvent->where.h = (short)where.x; carbonEvent->where.v = (short)(NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - where.y); carbonEvent->modifiers = modifiersForEvent(cocoaEvent); } void WebNetscapePluginEventHandlerCarbon::sendNullEvent() { EventRecord event; getCarbonEvent(&event); // Plug-in should not react to cursor position when not active or when a menu is down. MenuTrackingData trackingData; OSStatus error = GetMenuTrackingData(NULL, &trackingData); // Plug-in should not react to cursor position when the actual window is not key. if (![[m_pluginView window] isKeyWindow] || (error == noErr && trackingData.menu)) { // FIXME: Does passing a v and h of -1 really prevent it from reacting to the cursor position? event.where.v = -1; event.where.h = -1; } sendEvent(&event); } void WebNetscapePluginEventHandlerCarbon::drawRect(CGContextRef, const NSRect&) { EventRecord event; getCarbonEvent(&event); event.what = updateEvt; WindowRef windowRef = (WindowRef)[[m_pluginView window] windowRef]; event.message = (unsigned long)windowRef; BOOL acceptedEvent; acceptedEvent = sendEvent(&event); LOG(PluginEvents, "NPP_HandleEvent(updateEvt): %d", acceptedEvent); } void WebNetscapePluginEventHandlerCarbon::mouseDown(NSEvent* theEvent) { EventRecord event; getCarbonEvent(&event, theEvent); event.what = ::mouseDown; BOOL acceptedEvent; acceptedEvent = sendEvent(&event); LOG(PluginEvents, "NPP_HandleEvent(mouseDown): %d pt.v=%d, pt.h=%d", acceptedEvent, event.where.v, event.where.h); } void WebNetscapePluginEventHandlerCarbon::mouseUp(NSEvent* theEvent) { EventRecord event; getCarbonEvent(&event, theEvent); event.what = ::mouseUp; BOOL acceptedEvent; acceptedEvent = sendEvent(&event); LOG(PluginEvents, "NPP_HandleEvent(mouseUp): %d pt.v=%d, pt.h=%d", acceptedEvent, event.where.v, event.where.h); } bool WebNetscapePluginEventHandlerCarbon::scrollWheel(NSEvent* theEvent) { return false; } void WebNetscapePluginEventHandlerCarbon::mouseEntered(NSEvent* theEvent) { EventRecord event; getCarbonEvent(&event, theEvent); event.what = adjustCursorEvent; BOOL acceptedEvent; acceptedEvent = sendEvent(&event); LOG(PluginEvents, "NPP_HandleEvent(mouseEntered): %d", acceptedEvent); } void WebNetscapePluginEventHandlerCarbon::mouseExited(NSEvent* theEvent) { EventRecord event; getCarbonEvent(&event, theEvent); event.what = adjustCursorEvent; BOOL acceptedEvent; acceptedEvent = sendEvent(&event); LOG(PluginEvents, "NPP_HandleEvent(mouseExited): %d", acceptedEvent); } void WebNetscapePluginEventHandlerCarbon::mouseDragged(NSEvent*) { } void WebNetscapePluginEventHandlerCarbon::mouseMoved(NSEvent*) { } void WebNetscapePluginEventHandlerCarbon::keyDown(NSEvent *theEvent) { m_suspendKeyUpEvents = true; WKSendKeyEventToTSM(theEvent); } void WebNetscapePluginEventHandlerCarbon::syntheticKeyDownWithCommandModifier(int keyCode, char character) { EventRecord event; getCarbonEvent(&event); event.what = ::keyDown; event.modifiers |= cmdKey; event.message = keyCode << 8 | character; sendEvent(&event); } static UInt32 keyMessageForEvent(NSEvent *event) { NSData *data = [[event characters] dataUsingEncoding:CFStringConvertEncodingToNSStringEncoding(CFStringGetSystemEncoding())]; if (!data) return 0; UInt8 characterCode; [data getBytes:&characterCode length:1]; UInt16 keyCode = [event keyCode]; return keyCode << 8 | characterCode; } void WebNetscapePluginEventHandlerCarbon::keyUp(NSEvent* theEvent) { WKSendKeyEventToTSM(theEvent); // TSM won't send keyUp events so we have to send them ourselves. // Only send keyUp events after we receive the TSM callback because this is what plug-in expect from OS 9. if (!m_suspendKeyUpEvents) { EventRecord event; getCarbonEvent(&event, theEvent); event.what = ::keyUp; if (event.message == 0) event.message = keyMessageForEvent(theEvent); sendEvent(&event); } } void WebNetscapePluginEventHandlerCarbon::flagsChanged(NSEvent*) { } void WebNetscapePluginEventHandlerCarbon::focusChanged(bool hasFocus) { EventRecord event; getCarbonEvent(&event); bool acceptedEvent; if (hasFocus) { event.what = getFocusEvent; acceptedEvent = sendEvent(&event); LOG(PluginEvents, "NPP_HandleEvent(getFocusEvent): %d", acceptedEvent); installKeyEventHandler(); } else { event.what = loseFocusEvent; acceptedEvent = sendEvent(&event); LOG(PluginEvents, "NPP_HandleEvent(loseFocusEvent): %d", acceptedEvent); removeKeyEventHandler(); } } void WebNetscapePluginEventHandlerCarbon::windowFocusChanged(bool hasFocus) { WindowRef windowRef = (WindowRef)[[m_pluginView window] windowRef]; SetUserFocusWindow(windowRef); EventRecord event; getCarbonEvent(&event); event.what = activateEvt; event.message = (unsigned long)windowRef; if (hasFocus) event.modifiers |= activeFlag; BOOL acceptedEvent; acceptedEvent = sendEvent(&event); LOG(PluginEvents, "NPP_HandleEvent(activateEvent): %d isActive: %d", acceptedEvent, hasFocus); } OSStatus WebNetscapePluginEventHandlerCarbon::TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void *eventHandler) { EventRef rawKeyEventRef; OSStatus status = GetEventParameter(inEvent, kEventParamTextInputSendKeyboardEvent, typeEventRef, NULL, sizeof(EventRef), NULL, &rawKeyEventRef); if (status != noErr) { LOG_ERROR("GetEventParameter failed with error: %d", status); return noErr; } // Two-pass read to allocate/extract Mac charCodes ByteCount numBytes; status = GetEventParameter(rawKeyEventRef, kEventParamKeyMacCharCodes, typeChar, NULL, 0, &numBytes, NULL); if (status != noErr) { LOG_ERROR("GetEventParameter failed with error: %d", status); return noErr; } char *buffer = (char *)malloc(numBytes); status = GetEventParameter(rawKeyEventRef, kEventParamKeyMacCharCodes, typeChar, NULL, numBytes, NULL, buffer); if (status != noErr) { LOG_ERROR("GetEventParameter failed with error: %d", status); free(buffer); return noErr; } EventRef cloneEvent = CopyEvent(rawKeyEventRef); unsigned i; for (i = 0; i < numBytes; i++) { status = SetEventParameter(cloneEvent, kEventParamKeyMacCharCodes, typeChar, 1 /* one char code */, &buffer[i]); if (status != noErr) { LOG_ERROR("SetEventParameter failed with error: %d", status); free(buffer); return noErr; } EventRecord eventRec; if (ConvertEventRefToEventRecord(cloneEvent, &eventRec)) { BOOL acceptedEvent; acceptedEvent = static_cast(eventHandler)->sendEvent(&eventRec); LOG(PluginEvents, "NPP_HandleEvent(keyDown): %d charCode:%c keyCode:%lu", acceptedEvent, (char) (eventRec.message & charCodeMask), (eventRec.message & keyCodeMask)); // We originally thought that if the plug-in didn't accept this event, // we should pass it along so that keyboard scrolling, for example, will work. // In practice, this is not a good idea, because plug-ins tend to eat the event but return false. // MacIE handles each key event twice because of this, but we will emulate the other browsers instead. } } ReleaseEvent(cloneEvent); free(buffer); return noErr; } void WebNetscapePluginEventHandlerCarbon::installKeyEventHandler() { static const EventTypeSpec sTSMEvents[] = { { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent } }; if (!m_keyEventHandler) { InstallEventHandler(GetWindowEventTarget((WindowRef)[[m_pluginView window] windowRef]), NewEventHandlerUPP(TSMEventHandler), GetEventTypeCount(sTSMEvents), sTSMEvents, this, &m_keyEventHandler); } } void WebNetscapePluginEventHandlerCarbon::removeKeyEventHandler() { if (m_keyEventHandler) { RemoveEventHandler(m_keyEventHandler); m_keyEventHandler = 0; } } void WebNetscapePluginEventHandlerCarbon::nullEventTimerFired(CFRunLoopTimerRef timerRef, void *context) { static_cast(context)->sendNullEvent(); } void WebNetscapePluginEventHandlerCarbon::startTimers(bool throttleTimers) { ASSERT(!m_nullEventTimer); CFTimeInterval interval = !throttleTimers ? NullEventIntervalActive : NullEventIntervalNotActive; CFRunLoopTimerContext context = { 0, this, NULL, NULL, NULL }; m_nullEventTimer.adoptCF(CFRunLoopTimerCreate(0, CFAbsoluteTimeGetCurrent() + interval, interval, 0, 0, nullEventTimerFired, &context)); CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_nullEventTimer.get(), kCFRunLoopDefaultMode); } void WebNetscapePluginEventHandlerCarbon::stopTimers() { if (!m_nullEventTimer) return; CFRunLoopTimerInvalidate(m_nullEventTimer.get()); m_nullEventTimer = 0; } void* WebNetscapePluginEventHandlerCarbon::platformWindow(NSWindow* window) { return [window windowRef]; } bool WebNetscapePluginEventHandlerCarbon::sendEvent(EventRecord* event) { // If at any point the user clicks or presses a key from within a plugin, set the // currentEventIsUserGesture flag to true. This is important to differentiate legitimate // window.open() calls; we still want to allow those. See rdar://problem/4010765 if (event->what == ::mouseDown || event->what == ::keyDown || event->what == ::mouseUp || event->what == ::autoKey) m_currentEventIsUserGesture = true; m_suspendKeyUpEvents = false; bool result = [m_pluginView sendEvent:event isDrawRect:event->what == updateEvt]; m_currentEventIsUserGesture = false; return result; } #endif // ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__) WebKit/mac/Plugins/WebPluginContainerCheck.h0000644000175000017500000000465111175370126017377 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @class NSURLRequest; @class NSString; @class WebFrame; @class WebView; @class WebPolicyDecisionListener; @protocol WebPluginContainerCheckController - (void)_webPluginContainerCancelCheckIfAllowedToLoadRequest:(id)checkIdentifier; - (WebFrame *)webFrame; - (WebView *)webView; @end @interface WebPluginContainerCheck : NSObject { NSURLRequest *_request; NSString *_target; id _controller; id _resultObject; SEL _resultSelector; id _contextInfo; BOOL _done; WebPolicyDecisionListener *_listener; } + (id)checkWithRequest:(NSURLRequest *)request target:(NSString *)target resultObject:(id)obj selector:(SEL)selector controller:(id )controller contextInfo:(id)/*optional*/contextInfo; - (void)start; - (void)cancel; - (id)contextInfo; @end WebKit/mac/Plugins/WebPluginContainer.h0000644000175000017500000000574210361675702016447 0ustar leelee/* * Copyright (C) 2004 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 /*! This informal protocol enables a plug-in to request that its containing application perform certain operations. */ @interface NSObject (WebPlugInContainer) /*! @method webPlugInContainerLoadRequest:inFrame: @abstract Tell the application to show a URL in a target frame @param request The request to be loaded. @param target The target frame. If the frame with the specified target is not found, a new window is opened and the main frame of the new window is named with the specified target. If nil is specified, the frame that contains the applet is targeted. */ - (void)webPlugInContainerLoadRequest:(NSURLRequest *)request inFrame:(NSString *)target; /*! @method webPlugInContainerShowStatus: @abstract Tell the application to show the specified status message. @param message The string to be shown. */ - (void)webPlugInContainerShowStatus:(NSString *)message; /*! @method webPlugInContainerSelectionColor @result Returns the color that should be used for any special drawing when plug-in is selected. */ - (NSColor *)webPlugInContainerSelectionColor; /*! @method webFrame @discussion The webFrame method allows the plug-in to access the WebFrame that contains the plug-in. This method will not be implemented by containers that are not WebKit based. @result Return the WebFrame that contains the plug-in. */ - (WebFrame *)webFrame; @end WebKit/mac/Plugins/WebBaseNetscapePluginView.h0000644000175000017500000001020011223241751017665 0ustar leelee/* * Copyright (C) 2005, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) #import #import "WebNetscapePluginPackage.h" #import "WebPluginContainerCheck.h" #import #import #import @class DOMElement; @class WebDataSource; @class WebFrame; @class WebView; namespace WebCore { class CString; class HTMLPlugInElement; } @interface WebBaseNetscapePluginView : NSView { RetainPtr _pluginPackage; WebFrame *_webFrame; int _mode; BOOL _triedAndFailedToCreatePlugin; BOOL _loadManually; BOOL _shouldFireTimers; BOOL _isStarted; BOOL _hasFocus; BOOL _isCompletelyObscured; RefPtr _element; RetainPtr _MIMEType; RetainPtr _baseURL; RetainPtr _sourceURL; NSTrackingRectTag _trackingTag; } - (id)initWithFrame:(NSRect)r pluginPackage:(WebNetscapePluginPackage *)thePluginPackage URL:(NSURL *)URL baseURL:(NSURL *)baseURL MIMEType:(NSString *)MIME attributeKeys:(NSArray *)keys attributeValues:(NSArray *)values loadManually:(BOOL)loadManually element:(PassRefPtr)element; - (WebNetscapePluginPackage *)pluginPackage; - (NSURL *)URLWithCString:(const char *)URLCString; - (NSMutableURLRequest *)requestWithURLCString:(const char *)URLCString; // Subclasses must override these. - (void)handleMouseMoved:(NSEvent *)event; - (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values; - (void)focusChanged; - (WebFrame *)webFrame; - (WebDataSource *)dataSource; - (WebView *)webView; - (NSWindow *)currentWindow; - (WebCore::HTMLPlugInElement*)element; - (void)removeTrackingRect; - (void)resetTrackingRect; - (void)stopTimers; - (void)startTimers; - (void)restartTimers; - (void)stop; - (void)addWindowObservers; - (void)removeWindowObservers; - (BOOL)convertFromX:(double)sourceX andY:(double)sourceY space:(NPCoordinateSpace)sourceSpace toX:(double *)destX andY:(double *)destY space:(NPCoordinateSpace)destSpace; - (WebCore::CString)resolvedURLStringForURL:(const char*)url target:(const char*)target; - (void)invalidatePluginContentRect:(NSRect)rect; @end namespace WebKit { #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) WebCore::CString proxiesForURL(NSURL *); #endif bool getAuthenticationInfo(const char* protocolStr, const char* hostStr, int32_t port, const char* schemeStr, const char* realmStr, WebCore::CString& username, WebCore::CString& password); } #endif WebKit/mac/Plugins/WebPluginController.h0000644000175000017500000000467611234162164016646 0ustar leelee/* * Copyright (C) 2005, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import @class WebFrame; @class WebHTMLView; @class WebPluginPackage; @class WebView; @class WebDataSource; @interface WebPluginController : NSObject { NSView *_documentView; WebDataSource *_dataSource; NSMutableArray *_views; BOOL _started; NSMutableSet *_checksInProgress; } + (NSView *)plugInViewWithArguments:(NSDictionary *)arguments fromPluginPackage:(WebPluginPackage *)plugin; + (BOOL)isPlugInView:(NSView *)view; - (id)initWithDocumentView:(NSView *)view; - (void)setDataSource:(WebDataSource *)dataSource; - (void)addPlugin:(NSView *)view; - (void)destroyPlugin:(NSView *)view; - (void)startAllPlugins; - (void)stopAllPlugins; - (void)destroyAllPlugins; - (WebFrame *)webFrame; - (WebView *)webView; - (NSString *)URLPolicyCheckReferrer; @end WebKit/mac/Plugins/WebNetscapePluginEventHandler.mm0000644000175000017500000000404311106113613020724 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) #import "WebNetscapePluginEventHandler.h" #import #import "WebNetscapePluginView.h" #import "WebNetscapePluginEventHandlerCarbon.h" #import "WebNetscapePluginEventHandlerCocoa.h" WebNetscapePluginEventHandler* WebNetscapePluginEventHandler::create(WebNetscapePluginView* pluginView) { switch ([pluginView eventModel]) { #ifndef NP_NO_CARBON case NPEventModelCarbon: return new WebNetscapePluginEventHandlerCarbon(pluginView); #endif // NP_NO_CARBON case NPEventModelCocoa: return new WebNetscapePluginEventHandlerCocoa(pluginView); default: ASSERT_NOT_REACHED(); return 0; } } #endif // ENABLE(NETSCAPE_PLUGIN_API) WebKit/mac/Plugins/WebBasePluginPackage.h0000644000175000017500000001010211001237276016625 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #if ENABLE(NETSCAPE_PLUGIN_API) #import #else typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void); #endif @class WebPluginDatabase; @protocol WebPluginManualLoader - (void)pluginView:(NSView *)pluginView receivedResponse:(NSURLResponse *)response; - (void)pluginView:(NSView *)pluginView receivedData:(NSData *)data; - (void)pluginView:(NSView *)pluginView receivedError:(NSError *)error; - (void)pluginViewFinishedLoading:(NSView *)pluginView; @end #define WebPluginExtensionsKey @"WebPluginExtensions" #define WebPluginDescriptionKey @"WebPluginDescription" #define WebPluginLocalizationNameKey @"WebPluginLocalizationName" #define WebPluginMIMETypesFilenameKey @"WebPluginMIMETypesFilename" #define WebPluginMIMETypesKey @"WebPluginMIMETypes" #define WebPluginNameKey @"WebPluginName" #define WebPluginTypeDescriptionKey @"WebPluginTypeDescription" #define WebPluginTypeEnabledKey @"WebPluginTypeEnabled" @interface WebBasePluginPackage : NSObject { NSMutableSet *pluginDatabases; NSString *name; NSString *path; NSString *pluginDescription; NSBundle *bundle; CFBundleRef cfBundle; NSDictionary *MIMEToDescription; NSDictionary *MIMEToExtensions; NSMutableDictionary *extensionToMIME; BP_CreatePluginMIMETypesPreferencesFuncPtr BP_CreatePluginMIMETypesPreferences; } + (WebBasePluginPackage *)pluginWithPath:(NSString *)pluginPath; - (id)initWithPath:(NSString *)pluginPath; - (BOOL)getPluginInfoFromPLists; - (BOOL)load; - (void)unload; - (NSString *)name; - (NSString *)path; - (NSString *)filename; - (NSString *)pluginDescription; - (NSBundle *)bundle; - (NSEnumerator *)extensionEnumerator; - (NSEnumerator *)MIMETypeEnumerator; - (NSString *)descriptionForMIMEType:(NSString *)MIMEType; - (NSString *)MIMETypeForExtension:(NSString *)extension; - (NSArray *)extensionsForMIMEType:(NSString *)MIMEType; - (void)setName:(NSString *)theName; - (void)setPath:(NSString *)thePath; - (void)setPluginDescription:(NSString *)description; - (void)setMIMEToDescriptionDictionary:(NSDictionary *)MIMEToDescriptionDictionary; - (void)setMIMEToExtensionsDictionary:(NSDictionary *)MIMEToExtensionsDictionary; - (BOOL)isQuickTimePlugIn; - (BOOL)isJavaPlugIn; - (BOOL)isNativeLibraryData:(NSData *)data; - (UInt32)versionNumber; - (void)wasAddedToPluginDatabase:(WebPluginDatabase *)database; - (void)wasRemovedFromPluginDatabase:(WebPluginDatabase *)database; @end WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.mm0000644000175000017500000000377411224532552022251 0ustar leelee/* * Copyright (C) 2009 Apple 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 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 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 "WebNetscapeContainerCheckContextInfo.h" #if ENABLE(NETSCAPE_PLUGIN_API) @implementation WebNetscapeContainerCheckContextInfo - (id)initWithCheckRequestID:(uint32)checkRequestID callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed, void* context))callbackFunc context:(void*)context { self = [super init]; if (!self) return nil; _checkRequestID = checkRequestID; _callback = callbackFunc; _context = context; return self; } - (uint32)checkRequestID { return _checkRequestID; } - (void (*)(NPP npp, uint32, NPBool, void*))callback { return _callback; } - (void*)context { return _context; } @end #endif // ENABLE(NETSCAPE_PLUGIN_API) WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.h0000644000175000017500000000575011173157003021702 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__) #ifndef WebNetscapePluginEventHandlerCarbon_h #define WebNetscapePluginEventHandlerCarbon_h #include "WebNetscapePluginEventHandler.h" #import #import class WebNetscapePluginEventHandlerCarbon : public WebNetscapePluginEventHandler { public: WebNetscapePluginEventHandlerCarbon(WebNetscapePluginView*); virtual void drawRect(CGContextRef, const NSRect&); virtual void mouseDown(NSEvent*); virtual void mouseDragged(NSEvent*); virtual void mouseEntered(NSEvent*); virtual void mouseExited(NSEvent*); virtual void mouseMoved(NSEvent*); virtual void mouseUp(NSEvent*); virtual bool scrollWheel(NSEvent*); virtual void keyDown(NSEvent*); virtual void keyUp(NSEvent*); virtual void flagsChanged(NSEvent*); virtual void syntheticKeyDownWithCommandModifier(int keyCode, char character); virtual void windowFocusChanged(bool hasFocus); virtual void focusChanged(bool hasFocus); virtual void startTimers(bool throttleTimers); virtual void stopTimers(); virtual void* platformWindow(NSWindow*); private: void sendNullEvent(); void installKeyEventHandler(); void removeKeyEventHandler(); static OSStatus TSMEventHandler(EventHandlerCallRef, EventRef, void *eventHandler); static void nullEventTimerFired(CFRunLoopTimerRef, void *context); bool sendEvent(EventRecord*); EventHandlerRef m_keyEventHandler; bool m_suspendKeyUpEvents; RetainPtr m_nullEventTimer; }; #endif // WebNetscapePluginEventHandlerCarbon_h #endif // ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__) WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm0000644000175000017500000002246211173157003021703 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) #import "WebNetscapePluginEventHandlerCocoa.h" #import "WebKitSystemInterface.h" #import "WebNetscapePluginView.h" #import #import WebNetscapePluginEventHandlerCocoa::WebNetscapePluginEventHandlerCocoa(WebNetscapePluginView* pluginView) : WebNetscapePluginEventHandler(pluginView) #ifndef __LP64__ , m_keyEventHandler(0) #endif { } static inline void initializeEvent(NPCocoaEvent* event, NPCocoaEventType type) { event->type = type; event->version = 0; } void WebNetscapePluginEventHandlerCocoa::drawRect(CGContextRef context, const NSRect& rect) { NPCocoaEvent event; initializeEvent(&event, NPCocoaEventDrawRect); event.data.draw.context = context; event.data.draw.x = rect.origin.x; event.data.draw.y = rect.origin.y; event.data.draw.width = rect.size.width; event.data.draw.height = rect.size.height; RetainPtr protect(context); sendEvent(&event); } void WebNetscapePluginEventHandlerCocoa::mouseDown(NSEvent *event) { sendMouseEvent(event, NPCocoaEventMouseDown); } void WebNetscapePluginEventHandlerCocoa::mouseDragged(NSEvent *event) { sendMouseEvent(event, NPCocoaEventMouseDragged); } void WebNetscapePluginEventHandlerCocoa::mouseEntered(NSEvent *event) { sendMouseEvent(event, NPCocoaEventMouseEntered); } void WebNetscapePluginEventHandlerCocoa::mouseExited(NSEvent *event) { sendMouseEvent(event, NPCocoaEventMouseExited); } void WebNetscapePluginEventHandlerCocoa::mouseMoved(NSEvent *event) { sendMouseEvent(event, NPCocoaEventMouseMoved); } void WebNetscapePluginEventHandlerCocoa::mouseUp(NSEvent *event) { sendMouseEvent(event, NPCocoaEventMouseUp); } bool WebNetscapePluginEventHandlerCocoa::scrollWheel(NSEvent* event) { return sendMouseEvent(event, NPCocoaEventScrollWheel); } bool WebNetscapePluginEventHandlerCocoa::sendMouseEvent(NSEvent *nsEvent, NPCocoaEventType type) { NPCocoaEvent event; NSPoint point = [m_pluginView convertPoint:[nsEvent locationInWindow] fromView:nil]; int clickCount; if (type == NPCocoaEventMouseEntered || type == NPCocoaEventMouseExited || type == NPCocoaEventScrollWheel) clickCount = 0; else clickCount = [nsEvent clickCount]; initializeEvent(&event, type); event.data.mouse.modifierFlags = [nsEvent modifierFlags]; event.data.mouse.buttonNumber = [nsEvent buttonNumber]; event.data.mouse.clickCount = clickCount; event.data.mouse.pluginX = point.x; event.data.mouse.pluginY = point.y; event.data.mouse.deltaX = [nsEvent deltaX]; event.data.mouse.deltaY = [nsEvent deltaY]; event.data.mouse.deltaZ = [nsEvent deltaZ]; return sendEvent(&event); } void WebNetscapePluginEventHandlerCocoa::keyDown(NSEvent *event) { bool retval = sendKeyEvent(event, NPCocoaEventKeyDown); #ifndef __LP64__ // If the plug-in did not handle the event, pass it on to the Input Manager. if (retval) WKSendKeyEventToTSM(event); #else UNUSED_PARAM(retval); #endif } void WebNetscapePluginEventHandlerCocoa::keyUp(NSEvent *event) { sendKeyEvent(event, NPCocoaEventKeyUp); } void WebNetscapePluginEventHandlerCocoa::flagsChanged(NSEvent *nsEvent) { NPCocoaEvent event; initializeEvent(&event, NPCocoaEventFlagsChanged); event.data.key.modifierFlags = [nsEvent modifierFlags]; event.data.key.keyCode = [nsEvent keyCode]; event.data.key.isARepeat = false; event.data.key.characters = 0; event.data.key.charactersIgnoringModifiers = 0; sendEvent(&event); } void WebNetscapePluginEventHandlerCocoa::syntheticKeyDownWithCommandModifier(int keyCode, char character) { char nullTerminatedString[] = { character, '\0' }; RetainPtr characters(AdoptNS, [[NSString alloc] initWithUTF8String:nullTerminatedString]); NPCocoaEvent event; initializeEvent(&event, NPCocoaEventKeyDown); event.data.key.modifierFlags = NSCommandKeyMask; event.data.key.keyCode = keyCode; event.data.key.isARepeat = false; event.data.key.characters = (NPNSString *)characters.get(); event.data.key.charactersIgnoringModifiers = (NPNSString *)characters.get(); sendEvent(&event); } bool WebNetscapePluginEventHandlerCocoa::sendKeyEvent(NSEvent* nsEvent, NPCocoaEventType type) { NPCocoaEvent event; initializeEvent(&event, type); event.data.key.modifierFlags = [nsEvent modifierFlags]; event.data.key.keyCode = [nsEvent keyCode]; event.data.key.isARepeat = [nsEvent isARepeat]; event.data.key.characters = (NPNSString *)[nsEvent characters]; event.data.key.charactersIgnoringModifiers = (NPNSString *)[nsEvent charactersIgnoringModifiers]; return sendEvent(&event); } void WebNetscapePluginEventHandlerCocoa::windowFocusChanged(bool hasFocus) { NPCocoaEvent event; initializeEvent(&event, NPCocoaEventWindowFocusChanged); event.data.focus.hasFocus = hasFocus; sendEvent(&event); } void WebNetscapePluginEventHandlerCocoa::focusChanged(bool hasFocus) { NPCocoaEvent event; initializeEvent(&event, NPCocoaEventFocusChanged); event.data.focus.hasFocus = hasFocus; sendEvent(&event); if (hasFocus) installKeyEventHandler(); else removeKeyEventHandler(); } void* WebNetscapePluginEventHandlerCocoa::platformWindow(NSWindow* window) { return window; } bool WebNetscapePluginEventHandlerCocoa::sendEvent(NPCocoaEvent* event) { switch (event->type) { case NPCocoaEventMouseDown: case NPCocoaEventMouseUp: case NPCocoaEventMouseDragged: case NPCocoaEventKeyDown: case NPCocoaEventKeyUp: case NPCocoaEventFlagsChanged: case NPCocoaEventScrollWheel: m_currentEventIsUserGesture = true; break; default: m_currentEventIsUserGesture = false; } bool result = [m_pluginView sendEvent:event isDrawRect:event->type == NPCocoaEventDrawRect]; m_currentEventIsUserGesture = false; return result; } #ifndef __LP64__ void WebNetscapePluginEventHandlerCocoa::installKeyEventHandler() { static const EventTypeSpec TSMEvents[] = { { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent } }; if (!m_keyEventHandler) InstallEventHandler(GetWindowEventTarget((WindowRef)[[m_pluginView window] windowRef]), NewEventHandlerUPP(TSMEventHandler), GetEventTypeCount(TSMEvents), TSMEvents, this, &m_keyEventHandler); } void WebNetscapePluginEventHandlerCocoa::removeKeyEventHandler() { if (m_keyEventHandler) { RemoveEventHandler(m_keyEventHandler); m_keyEventHandler = 0; } } OSStatus WebNetscapePluginEventHandlerCocoa::TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef event, void* eventHandler) { return static_cast(eventHandler)->handleTSMEvent(event); } OSStatus WebNetscapePluginEventHandlerCocoa::handleTSMEvent(EventRef eventRef) { ASSERT(GetEventKind(eventRef) == kEventTextInputUnicodeForKeyEvent); // Get the text buffer size. ByteCount size; OSStatus result = GetEventParameter(eventRef, kEventParamTextInputSendText, typeUnicodeText, 0, 0, &size, 0); if (result != noErr) return result; unsigned length = size / sizeof(UniChar); Vector characters(length); // Now get the actual text. result = GetEventParameter(eventRef, kEventParamTextInputSendText, typeUnicodeText, 0, size, 0, characters.data()); if (result != noErr) return result; RetainPtr text(AdoptCF, CFStringCreateWithCharacters(0, characters.data(), length)); NPCocoaEvent event; initializeEvent(&event, NPCocoaEventTextInput); event.data.text.text = (NPNSString*)text.get(); sendEvent(&event); return noErr; } #endif // __LP64__ #endif // ENABLE(NETSCAPE_PLUGIN_API) WebKit/mac/Plugins/WebPluginRequest.m0000644000175000017500000000476011115636062016153 0ustar leelee/* * Copyright (C) 2005, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) #import "WebPluginRequest.h" @implementation WebPluginRequest - (id)initWithRequest:(NSURLRequest *)request frameName:(NSString *)frameName notifyData:(void *)notifyData sendNotification:(BOOL)sendNotification didStartFromUserGesture:(BOOL)currentEventIsUserGesture { [super init]; _didStartFromUserGesture = currentEventIsUserGesture; _request = [request retain]; _frameName = [frameName retain]; _notifyData = notifyData; _sendNotification = sendNotification; return self; } - (void)dealloc { [_request release]; [_frameName release]; [super dealloc]; } - (NSURLRequest *)request { return _request; } - (NSString *)frameName { return _frameName; } - (BOOL)isCurrentEventUserGesture { return _didStartFromUserGesture; } - (BOOL)sendNotification { return _sendNotification; } - (void *)notifyData { return _notifyData; } @end #endif // ENABLE(NETSCAPE_PLUGIN_API) WebKit/mac/Plugins/WebPluginPackage.h0000644000175000017500000000335310360512352016042 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import @protocol WebPluginViewFactory; @interface WebPluginPackage : WebBasePluginPackage - (Class)viewFactory; @end WebKit/mac/Plugins/WebNetscapePluginPackage.mm0000644000175000017500000007505311225466207017725 0ustar leelee/* * Copyright (C) 2005, 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) #import "WebNetscapePluginPackage.h" #import "WebKitLogging.h" #import "WebKitNSStringExtras.h" #import "WebNSFileManagerExtras.h" #import "WebNSObjectExtras.h" #import "WebNetscapeDeprecatedFunctions.h" #import #if USE(PLUGIN_HOST_PROCESS) #import "NetscapePluginHostManager.h" using namespace WebKit; #endif #ifdef SUPPORT_CFM typedef void (* FunctionPointer)(void); typedef void (* TransitionVector)(void); static FunctionPointer functionPointerForTVector(TransitionVector); static TransitionVector tVectorForFunctionPointer(FunctionPointer); #endif #define PluginNameOrDescriptionStringNumber 126 #define MIMEDescriptionStringNumber 127 #define MIMEListStringStringNumber 128 #define RealPlayerAppIndentifier @"com.RealNetworks.RealOne Player" #define RealPlayerPluginFilename @"RealPlayer Plugin" @interface WebNetscapePluginPackage (Internal) - (void)_unloadWithShutdown:(BOOL)shutdown; @end @implementation WebNetscapePluginPackage #ifndef __LP64__ + (void)initialize { // The Shockwave plugin requires a valid file in CurApRefNum. // But it doesn't seem to matter what file it is. // If we're called inside a Cocoa application which won't have a // CurApRefNum, we set it to point to the system resource file. // Call CurResFile before testing the result of WebLMGetCurApRefNum. // If we are called before the bundle resource map has been opened // for a Carbon application (or a Cocoa app with Resource Manager // resources) we *do not* want to set CurApRefNum to point at the // system resource file. CurResFile triggers Resource Manager lazy // initialization, and will open the bundle resource map as necessary. CurResFile(); if (WebLMGetCurApRefNum() == -1) { // To get the refNum for the system resource file, we have to do // UseResFile(kSystemResFile) and then look at CurResFile(). short savedCurResFile = CurResFile(); UseResFile(kSystemResFile); WebLMSetCurApRefNum(CurResFile()); UseResFile(savedCurResFile); } } #endif - (ResFileRefNum)openResourceFile { #ifdef SUPPORT_CFM if (!isBundle) { FSRef fref; OSErr err = FSPathMakeRef((const UInt8 *)[path fileSystemRepresentation], &fref, NULL); if (err != noErr) return -1; return FSOpenResFile(&fref, fsRdPerm); } #endif return CFBundleOpenBundleResourceMap(cfBundle); } - (void)closeResourceFile:(ResFileRefNum)resRef { #ifdef SUPPORT_CFM if (!isBundle) { CloseResFile(resRef); return; } #endif CFBundleCloseBundleResourceMap(cfBundle, resRef); } - (NSString *)stringForStringListID:(SInt16)stringListID andIndex:(SInt16)index { // Get resource, and dereference the handle. Handle stringHandle = Get1Resource('STR#', stringListID); if (stringHandle == NULL) { return nil; } unsigned char *p = (unsigned char *)*stringHandle; if (!p) return nil; // Check the index against the length of the string list, then skip the length. if (index < 1 || index > *(SInt16 *)p) return nil; p += sizeof(SInt16); // Skip any strings that come before the one we are looking for. while (--index) p += 1 + *p; // Convert the one we found into an NSString. return [[[NSString alloc] initWithBytes:(p + 1) length:*p encoding:[NSString _web_encodingForResource:stringHandle]] autorelease]; } - (BOOL)getPluginInfoFromResources { SInt16 resRef = [self openResourceFile]; if (resRef == -1) return NO; UseResFile(resRef); if (ResError() != noErr) return NO; NSString *MIME, *extensionsList, *description; NSArray *extensions; unsigned i; NSMutableDictionary *MIMEToExtensionsDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *MIMEToDescriptionDictionary = [NSMutableDictionary dictionary]; for (i=1; 1; i+=2) { MIME = [[self stringForStringListID:MIMEListStringStringNumber andIndex:i] lowercaseString]; if (!MIME) break; extensionsList = [[self stringForStringListID:MIMEListStringStringNumber andIndex:i+1] lowercaseString]; if (extensionsList) { extensions = [extensionsList componentsSeparatedByString:@","]; [MIMEToExtensionsDictionary setObject:extensions forKey:MIME]; } else // DRM and WMP claim MIMEs without extensions. Use a @"" extension in this case. [MIMEToExtensionsDictionary setObject:[NSArray arrayWithObject:@""] forKey:MIME]; description = [self stringForStringListID:MIMEDescriptionStringNumber andIndex:[MIMEToExtensionsDictionary count]]; if (description) [MIMEToDescriptionDictionary setObject:description forKey:MIME]; else [MIMEToDescriptionDictionary setObject:@"" forKey:MIME]; } [self setMIMEToDescriptionDictionary:MIMEToDescriptionDictionary]; [self setMIMEToExtensionsDictionary:MIMEToExtensionsDictionary]; NSString *filename = [self filename]; description = [self stringForStringListID:PluginNameOrDescriptionStringNumber andIndex:1]; if (!description) description = filename; [self setPluginDescription:description]; NSString *theName = [self stringForStringListID:PluginNameOrDescriptionStringNumber andIndex:2]; if (!theName) theName = filename; [self setName:theName]; [self closeResourceFile:resRef]; return YES; } - (BOOL)_initWithPath:(NSString *)pluginPath { resourceRef = -1; OSType type = 0; if (bundle) { // Bundle CFBundleGetPackageInfo(cfBundle, &type, NULL); #ifdef SUPPORT_CFM isBundle = YES; #endif } else { #ifdef SUPPORT_CFM // Single-file plug-in with resource fork NSString *destinationPath = [[NSFileManager defaultManager] destinationOfSymbolicLinkAtPath:path error:0]; type = [[[NSFileManager defaultManager] attributesOfItemAtPath:destinationPath error:0] fileHFSTypeCode]; isBundle = NO; isCFM = YES; #else return NO; #endif } if (type != FOUR_CHAR_CODE('BRPL')) return NO; // Check if the executable is Mach-O or CFM. if (bundle) { NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[bundle executablePath]]; NSData *data = [executableFile readDataOfLength:512]; [executableFile closeFile]; // Check the length of the data before calling memcmp. We think this fixes 3782543. if (data == nil || [data length] < 8) return NO; BOOL hasCFMHeader = memcmp([data bytes], "Joy!peff", 8) == 0; #ifdef SUPPORT_CFM isCFM = hasCFMHeader; #else if (hasCFMHeader) return NO; #endif #if USE(PLUGIN_HOST_PROCESS) NSArray *archs = [bundle executableArchitectures]; if ([archs containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureX86_64]]) pluginHostArchitecture = CPU_TYPE_X86_64; else if ([archs containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureI386]]) pluginHostArchitecture = CPU_TYPE_X86; else return NO; #else if (![self isNativeLibraryData:data]) return NO; #endif } if (![self getPluginInfoFromPLists] && ![self getPluginInfoFromResources]) return NO; return YES; } - (id)initWithPath:(NSString *)pluginPath { if (!(self = [super initWithPath:pluginPath])) return nil; // Initializing a plugin package can cause it to be loaded. If there was an error initializing the plugin package, // ensure that it is unloaded before deallocating it (WebBasePluginPackage requires & asserts this). if (![self _initWithPath:pluginPath]) { [self _unloadWithShutdown:YES]; [self release]; return nil; } return self; } - (WebExecutableType)executableType { #ifdef SUPPORT_CFM if (isCFM) return WebCFMExecutableType; #endif return WebMachOExecutableType; } #if USE(PLUGIN_HOST_PROCESS) - (cpu_type_t)pluginHostArchitecture { return pluginHostArchitecture; } - (void)createPropertyListFile { NetscapePluginHostManager::createPropertyListFile(self); } #endif - (void)launchRealPlayer { CFURLRef appURL = NULL; OSStatus error = LSFindApplicationForInfo(kLSUnknownCreator, (CFStringRef)RealPlayerAppIndentifier, NULL, NULL, &appURL); if (!error) { LSLaunchURLSpec URLSpec; bzero(&URLSpec, sizeof(URLSpec)); URLSpec.launchFlags = kLSLaunchDefaults | kLSLaunchDontSwitch; URLSpec.appURL = appURL; LSOpenFromURLSpec(&URLSpec, NULL); CFRelease(appURL); } } - (void)_applyDjVuWorkaround { if (!cfBundle) return; if ([(NSString *)CFBundleGetIdentifier(cfBundle) isEqualToString:@"com.lizardtech.NPDjVu"]) { // The DjVu plug-in will crash copying the vtable if it's too big so we cap it to // what the plug-in expects here. // size + version + 40 function pointers. browserFuncs.size = 2 + 2 + sizeof(void *) * 40; } } - (void)unload { [self _unloadWithShutdown:YES]; } - (BOOL)_tryLoad { NP_GetEntryPointsFuncPtr NP_GetEntryPoints = NULL; NP_InitializeFuncPtr NP_Initialize = NULL; NPError npErr; #ifdef SUPPORT_CFM MainFuncPtr pluginMainFunc = NULL; #endif #if !LOG_DISABLED CFAbsoluteTime start = CFAbsoluteTimeGetCurrent(); CFAbsoluteTime currentTime; CFAbsoluteTime duration; #endif LOG(Plugins, "%f Load timing started for: %@", start, [self name]); if (isLoaded) return YES; #ifdef SUPPORT_CFM if (isBundle) { #endif if (!CFBundleLoadExecutable(cfBundle)) return NO; #if !LOG_DISABLED currentTime = CFAbsoluteTimeGetCurrent(); duration = currentTime - start; #endif LOG(Plugins, "%f CFBundleLoadExecutable took %f seconds", currentTime, duration); isLoaded = YES; #ifdef SUPPORT_CFM if (isCFM) { pluginMainFunc = (MainFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("main") ); if (!pluginMainFunc) return NO; } else { #endif NP_Initialize = (NP_InitializeFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_Initialize")); NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_GetEntryPoints")); NP_Shutdown = (NPP_ShutdownProcPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_Shutdown")); if (!NP_Initialize || !NP_GetEntryPoints || !NP_Shutdown) return NO; #ifdef SUPPORT_CFM } } else { // single CFM file FSSpec spec; FSRef fref; OSErr err; err = FSPathMakeRef((UInt8 *)[path fileSystemRepresentation], &fref, NULL); if (err != noErr) { LOG_ERROR("FSPathMakeRef failed. Error=%d", err); return NO; } err = FSGetCatalogInfo(&fref, kFSCatInfoNone, NULL, NULL, &spec, NULL); if (err != noErr) { LOG_ERROR("FSGetCatalogInfo failed. Error=%d", err); return NO; } err = WebGetDiskFragment(&spec, 0, kCFragGoesToEOF, nil, kPrivateCFragCopy, &connID, (Ptr *)&pluginMainFunc, nil); if (err != noErr) { LOG_ERROR("WebGetDiskFragment failed. Error=%d", err); return NO; } #if !LOG_DISABLED currentTime = CFAbsoluteTimeGetCurrent(); duration = currentTime - start; #endif LOG(Plugins, "%f WebGetDiskFragment took %f seconds", currentTime, duration); isLoaded = YES; pluginMainFunc = (MainFuncPtr)functionPointerForTVector((TransitionVector)pluginMainFunc); if (!pluginMainFunc) { return NO; } // NOTE: pluginMainFunc is freed after it is called. Be sure not to return before that. isCFM = YES; } #endif /* SUPPORT_CFM */ // Plugins (at least QT) require that you call UseResFile on the resource file before loading it. resourceRef = [self openResourceFile]; if (resourceRef != -1) { UseResFile(resourceRef); } // swap function tables #ifdef SUPPORT_CFM if (isCFM) { browserFuncs.version = NP_VERSION_MINOR; browserFuncs.size = sizeof(NPNetscapeFuncs); browserFuncs.geturl = (NPN_GetURLProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_GetURL); browserFuncs.posturl = (NPN_PostURLProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_PostURL); browserFuncs.requestread = (NPN_RequestReadProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_RequestRead); browserFuncs.newstream = (NPN_NewStreamProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_NewStream); browserFuncs.write = (NPN_WriteProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_Write); browserFuncs.destroystream = (NPN_DestroyStreamProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_DestroyStream); browserFuncs.status = (NPN_StatusProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_Status); browserFuncs.uagent = (NPN_UserAgentProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_UserAgent); browserFuncs.memalloc = (NPN_MemAllocProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_MemAlloc); browserFuncs.memfree = (NPN_MemFreeProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_MemFree); browserFuncs.memflush = (NPN_MemFlushProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_MemFlush); browserFuncs.reloadplugins = (NPN_ReloadPluginsProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_ReloadPlugins); browserFuncs.geturlnotify = (NPN_GetURLNotifyProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_GetURLNotify); browserFuncs.posturlnotify = (NPN_PostURLNotifyProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_PostURLNotify); browserFuncs.getvalue = (NPN_GetValueProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_GetValue); browserFuncs.setvalue = (NPN_SetValueProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_SetValue); browserFuncs.invalidaterect = (NPN_InvalidateRectProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_InvalidateRect); browserFuncs.invalidateregion = (NPN_InvalidateRegionProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_InvalidateRegion); browserFuncs.forceredraw = (NPN_ForceRedrawProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_ForceRedraw); browserFuncs.getJavaEnv = (NPN_GetJavaEnvProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_GetJavaEnv); browserFuncs.getJavaPeer = (NPN_GetJavaPeerProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_GetJavaPeer); browserFuncs.pushpopupsenabledstate = (NPN_PushPopupsEnabledStateProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_PushPopupsEnabledState); browserFuncs.poppopupsenabledstate = (NPN_PopPopupsEnabledStateProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_PopPopupsEnabledState); browserFuncs.pluginthreadasynccall = (NPN_PluginThreadAsyncCallProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_PluginThreadAsyncCall); browserFuncs.getvalueforurl = (NPN_GetValueForURLProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_GetValueForURL); browserFuncs.setvalueforurl = (NPN_SetValueForURLProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_SetValueForURL); browserFuncs.getauthenticationinfo = (NPN_GetAuthenticationInfoProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_GetAuthenticationInfo); browserFuncs.scheduletimer = (NPN_ScheduleTimerProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_ScheduleTimer); browserFuncs.unscheduletimer = (NPN_UnscheduleTimerProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_UnscheduleTimer); browserFuncs.popupcontextmenu = (NPN_PopUpContextMenuProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_PopUpContextMenu); browserFuncs.convertpoint = (NPN_ConvertPointProcPtr)tVectorForFunctionPointer((FunctionPointer)NPN_ConvertPoint); browserFuncs.releasevariantvalue = (NPN_ReleaseVariantValueProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_ReleaseVariantValue); browserFuncs.getstringidentifier = (NPN_GetStringIdentifierProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_GetStringIdentifier); browserFuncs.getstringidentifiers = (NPN_GetStringIdentifiersProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_GetStringIdentifiers); browserFuncs.getintidentifier = (NPN_GetIntIdentifierProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_GetIntIdentifier); browserFuncs.identifierisstring = (NPN_IdentifierIsStringProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_IdentifierIsString); browserFuncs.utf8fromidentifier = (NPN_UTF8FromIdentifierProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_UTF8FromIdentifier); browserFuncs.intfromidentifier = (NPN_IntFromIdentifierProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_IntFromIdentifier); browserFuncs.createobject = (NPN_CreateObjectProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_CreateObject); browserFuncs.retainobject = (NPN_RetainObjectProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_RetainObject); browserFuncs.releaseobject = (NPN_ReleaseObjectProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_ReleaseObject); browserFuncs.hasmethod = (NPN_HasMethodProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_HasProperty); browserFuncs.invoke = (NPN_InvokeProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_Invoke); browserFuncs.invokeDefault = (NPN_InvokeDefaultProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_InvokeDefault); browserFuncs.evaluate = (NPN_EvaluateProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_Evaluate); browserFuncs.hasproperty = (NPN_HasPropertyProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_HasProperty); browserFuncs.getproperty = (NPN_GetPropertyProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_GetProperty); browserFuncs.setproperty = (NPN_SetPropertyProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_SetProperty); browserFuncs.removeproperty = (NPN_RemovePropertyProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_RemoveProperty); browserFuncs.setexception = (NPN_SetExceptionProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_SetException); browserFuncs.enumerate = (NPN_EnumerateProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_Enumerate); browserFuncs.construct = (NPN_ConstructProcPtr)tVectorForFunctionPointer((FunctionPointer)_NPN_Construct); [self _applyDjVuWorkaround]; #if !LOG_DISABLED CFAbsoluteTime mainStart = CFAbsoluteTimeGetCurrent(); #endif LOG(Plugins, "%f main timing started", mainStart); NPP_ShutdownProcPtr shutdownFunction; npErr = pluginMainFunc(&browserFuncs, &pluginFuncs, &shutdownFunction); NP_Shutdown = (NPP_ShutdownProcPtr)functionPointerForTVector((TransitionVector)shutdownFunction); if (!isBundle) // Don't free pluginMainFunc if we got it from a bundle because it is owned by CFBundle in that case. free(reinterpret_cast(pluginMainFunc)); // Workaround for 3270576. The RealPlayer plug-in fails to load if its preference file is out of date. // Launch the RealPlayer application to refresh the file. if (npErr != NPERR_NO_ERROR) { if (npErr == NPERR_MODULE_LOAD_FAILED_ERROR && [[self filename] isEqualToString:RealPlayerPluginFilename]) [self launchRealPlayer]; return NO; } #if !LOG_DISABLED currentTime = CFAbsoluteTimeGetCurrent(); duration = currentTime - mainStart; #endif LOG(Plugins, "%f main took %f seconds", currentTime, duration); pluginSize = pluginFuncs.size; pluginVersion = pluginFuncs.version; LOG(Plugins, "pluginMainFunc: %d, size=%d, version=%d", npErr, pluginSize, pluginVersion); pluginFuncs.newp = (NPP_NewProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.newp); pluginFuncs.destroy = (NPP_DestroyProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.destroy); pluginFuncs.setwindow = (NPP_SetWindowProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.setwindow); pluginFuncs.newstream = (NPP_NewStreamProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.newstream); pluginFuncs.destroystream = (NPP_DestroyStreamProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.destroystream); pluginFuncs.asfile = (NPP_StreamAsFileProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.asfile); pluginFuncs.writeready = (NPP_WriteReadyProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.writeready); pluginFuncs.write = (NPP_WriteProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.write); pluginFuncs.print = (NPP_PrintProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.print); pluginFuncs.event = (NPP_HandleEventProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.event); pluginFuncs.urlnotify = (NPP_URLNotifyProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.urlnotify); pluginFuncs.getvalue = (NPP_GetValueProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.getvalue); pluginFuncs.setvalue = (NPP_SetValueProcPtr)functionPointerForTVector((TransitionVector)pluginFuncs.setvalue); // LiveConnect support pluginFuncs.javaClass = (JRIGlobalRef)functionPointerForTVector((TransitionVector)pluginFuncs.javaClass); if (pluginFuncs.javaClass) { LOG(LiveConnect, "%@: CFM entry point for NPP_GetJavaClass = %p", [self name], pluginFuncs.javaClass); } else { LOG(LiveConnect, "%@: no entry point for NPP_GetJavaClass", [self name]); } } else { #endif // no function pointer conversion necessary for Mach-O browserFuncs.version = NP_VERSION_MINOR; browserFuncs.size = sizeof(NPNetscapeFuncs); browserFuncs.geturl = NPN_GetURL; browserFuncs.posturl = NPN_PostURL; browserFuncs.requestread = NPN_RequestRead; browserFuncs.newstream = NPN_NewStream; browserFuncs.write = NPN_Write; browserFuncs.destroystream = NPN_DestroyStream; browserFuncs.status = NPN_Status; browserFuncs.uagent = NPN_UserAgent; browserFuncs.memalloc = NPN_MemAlloc; browserFuncs.memfree = NPN_MemFree; browserFuncs.memflush = NPN_MemFlush; browserFuncs.reloadplugins = NPN_ReloadPlugins; browserFuncs.geturlnotify = NPN_GetURLNotify; browserFuncs.posturlnotify = NPN_PostURLNotify; browserFuncs.getvalue = NPN_GetValue; browserFuncs.setvalue = NPN_SetValue; browserFuncs.invalidaterect = NPN_InvalidateRect; browserFuncs.invalidateregion = NPN_InvalidateRegion; browserFuncs.forceredraw = NPN_ForceRedraw; browserFuncs.getJavaEnv = NPN_GetJavaEnv; browserFuncs.getJavaPeer = NPN_GetJavaPeer; browserFuncs.pushpopupsenabledstate = NPN_PushPopupsEnabledState; browserFuncs.poppopupsenabledstate = NPN_PopPopupsEnabledState; browserFuncs.pluginthreadasynccall = NPN_PluginThreadAsyncCall; browserFuncs.getvalueforurl = NPN_GetValueForURL; browserFuncs.setvalueforurl = NPN_SetValueForURL; browserFuncs.getauthenticationinfo = NPN_GetAuthenticationInfo; browserFuncs.scheduletimer = NPN_ScheduleTimer; browserFuncs.unscheduletimer = NPN_UnscheduleTimer; browserFuncs.popupcontextmenu = NPN_PopUpContextMenu; browserFuncs.convertpoint = NPN_ConvertPoint; browserFuncs.releasevariantvalue = _NPN_ReleaseVariantValue; browserFuncs.getstringidentifier = _NPN_GetStringIdentifier; browserFuncs.getstringidentifiers = _NPN_GetStringIdentifiers; browserFuncs.getintidentifier = _NPN_GetIntIdentifier; browserFuncs.identifierisstring = _NPN_IdentifierIsString; browserFuncs.utf8fromidentifier = _NPN_UTF8FromIdentifier; browserFuncs.intfromidentifier = _NPN_IntFromIdentifier; browserFuncs.createobject = _NPN_CreateObject; browserFuncs.retainobject = _NPN_RetainObject; browserFuncs.releaseobject = _NPN_ReleaseObject; browserFuncs.hasmethod = _NPN_HasMethod; browserFuncs.invoke = _NPN_Invoke; browserFuncs.invokeDefault = _NPN_InvokeDefault; browserFuncs.evaluate = _NPN_Evaluate; browserFuncs.hasproperty = _NPN_HasProperty; browserFuncs.getproperty = _NPN_GetProperty; browserFuncs.setproperty = _NPN_SetProperty; browserFuncs.removeproperty = _NPN_RemoveProperty; browserFuncs.setexception = _NPN_SetException; browserFuncs.enumerate = _NPN_Enumerate; browserFuncs.construct = _NPN_Construct; [self _applyDjVuWorkaround]; #if !LOG_DISABLED CFAbsoluteTime initializeStart = CFAbsoluteTimeGetCurrent(); #endif LOG(Plugins, "%f NP_Initialize timing started", initializeStart); npErr = NP_Initialize(&browserFuncs); if (npErr != NPERR_NO_ERROR) return NO; #if !LOG_DISABLED currentTime = CFAbsoluteTimeGetCurrent(); duration = currentTime - initializeStart; #endif LOG(Plugins, "%f NP_Initialize took %f seconds", currentTime, duration); pluginFuncs.size = sizeof(NPPluginFuncs); npErr = NP_GetEntryPoints(&pluginFuncs); if (npErr != NPERR_NO_ERROR) return NO; pluginSize = pluginFuncs.size; pluginVersion = pluginFuncs.version; if (pluginFuncs.javaClass) LOG(LiveConnect, "%@: mach-o entry point for NPP_GetJavaClass = %p", [self name], pluginFuncs.javaClass); else LOG(LiveConnect, "%@: no entry point for NPP_GetJavaClass", [self name]); #ifdef SUPPORT_CFM } #endif #if !LOG_DISABLED currentTime = CFAbsoluteTimeGetCurrent(); duration = currentTime - start; #endif LOG(Plugins, "%f Total load time: %f seconds", currentTime, duration); return YES; } - (BOOL)load { if ([self _tryLoad]) return [super load]; [self _unloadWithShutdown:NO]; return NO; } - (NPPluginFuncs *)pluginFuncs { return &pluginFuncs; } - (void)wasRemovedFromPluginDatabase:(WebPluginDatabase *)database { [super wasRemovedFromPluginDatabase:database]; // Unload when removed from final plug-in database if ([pluginDatabases count] == 0) [self _unloadWithShutdown:YES]; } - (void)open { instanceCount++; // Handle the case where all instances close a plug-in package, but another // instance opens the package before it is unloaded (which only happens when // the plug-in database is refreshed) needsUnload = NO; if (!isLoaded) { // Should load when the first instance opens the plug-in package ASSERT(instanceCount == 1); [self load]; } } - (void)close { ASSERT(instanceCount > 0); instanceCount--; if (instanceCount == 0 && needsUnload) [self _unloadWithShutdown:YES]; } @end #ifdef SUPPORT_CFM // function pointer converters FunctionPointer functionPointerForTVector(TransitionVector tvp) { const uint32 temp[6] = {0x3D800000, 0x618C0000, 0x800C0000, 0x804C0004, 0x7C0903A6, 0x4E800420}; uint32 *newGlue = NULL; if (tvp != NULL) { newGlue = (uint32 *)malloc(sizeof(temp)); if (newGlue != NULL) { unsigned i; for (i = 0; i < 6; i++) newGlue[i] = temp[i]; newGlue[0] |= ((uintptr_t)tvp >> 16); newGlue[1] |= ((uintptr_t)tvp & 0xFFFF); MakeDataExecutable(newGlue, sizeof(temp)); } } return (FunctionPointer)newGlue; } TransitionVector tVectorForFunctionPointer(FunctionPointer fp) { FunctionPointer *newGlue = NULL; if (fp != NULL) { newGlue = (FunctionPointer *)malloc(2 * sizeof(FunctionPointer)); if (newGlue != NULL) { newGlue[0] = fp; newGlue[1] = NULL; } } return (TransitionVector)newGlue; } #endif @implementation WebNetscapePluginPackage (Internal) - (void)_unloadWithShutdown:(BOOL)shutdown { if (!isLoaded) return; LOG(Plugins, "Unloading %@...", name); // Cannot unload a plug-in package while an instance is still using it if (instanceCount > 0) { needsUnload = YES; return; } if (shutdown && NP_Shutdown) NP_Shutdown(); if (resourceRef != -1) [self closeResourceFile:resourceRef]; #ifdef SUPPORT_CFM if (!isBundle) WebCloseConnection(&connID); #endif LOG(Plugins, "Plugin Unloaded"); isLoaded = NO; } @end #endif WebKit/mac/Plugins/WebPluginsPrivate.h0000644000175000017500000000367210360512352016310 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ // WebPluginWillPresentNativeUserInterfaceNotification is sent by plugins to notify the WebKit client // application that the plugin will present a dialog or some other "native" user interface to the user. // This is currently only needed by Dashboard, which must hide itself when a plugin presents a dialog // box (4318632). extern NSString *WebPluginWillPresentNativeUserInterfaceNotification; WebKit/mac/Plugins/WebPluginViewFactory.h0000644000175000017500000000760511150764637016772 0ustar leelee/* * Copyright (C) 2004 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import /*! @constant WebPlugInBaseURLKey REQUIRED. The base URL of the document containing the plug-in's view. */ extern NSString *WebPlugInBaseURLKey; /*! @constant WebPlugInAttributesKey REQUIRED. The dictionary containing the names and values of all attributes of the HTML element associated with the plug-in AND the names and values of all parameters to be passed to the plug-in (e.g. PARAM elements within an APPLET element). In the case of a conflict between names, the attributes of an element take precedence over any PARAMs. All of the keys and values in this NSDictionary must be NSStrings. */ extern NSString *WebPlugInAttributesKey; /*! @constant WebPlugInContainer OPTIONAL. An object that conforms to the WebPlugInContainer informal protocol. This object is used for callbacks from the plug-in to the app. if this argument is nil, no callbacks will occur. */ extern NSString *WebPlugInContainerKey; /*! @constant WebPlugInContainingElementKey The DOMElement that was used to specify the plug-in. May be nil. */ extern NSString *WebPlugInContainingElementKey; /*! @constant WebPlugInShouldLoadMainResourceKey REQUIRED. NSNumber (BOOL) indicating whether the plug-in should load its own main resource (the "src" URL, in most cases). If YES, the plug-in should load its own main resource. If NO, the plug-in should use the data provided by WebKit. See -webPlugInMainResourceReceivedData: in WebPluginPrivate.h. For compatibility with older versions of WebKit, the plug-in should assume that the value for WebPlugInShouldLoadMainResourceKey is NO if it is absent from the arguments dictionary. */ extern NSString *WebPlugInShouldLoadMainResourceKey AVAILABLE_IN_WEBKIT_VERSION_4_0; /*! @protocol WebPlugInViewFactory @discussion WebPlugInViewFactory are used to create the NSView for a plug-in. The principal class of the plug-in bundle must implement this protocol. */ @protocol WebPlugInViewFactory /*! @method plugInViewWithArguments: @param arguments The arguments dictionary with the mentioned keys and objects. This method is required to implement. @result Returns an NSView object that conforms to the WebPlugIn informal protocol. */ + (NSView *)plugInViewWithArguments:(NSDictionary *)arguments; @end WebKit/mac/Plugins/WebPluginPackage.m0000644000175000017500000000725211007635031016050 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import #import NSString *WebPlugInBaseURLKey = @"WebPlugInBaseURLKey"; NSString *WebPlugInAttributesKey = @"WebPlugInAttributesKey"; NSString *WebPlugInContainerKey = @"WebPlugInContainerKey"; NSString *WebPlugInModeKey = @"WebPlugInModeKey"; NSString *WebPlugInShouldLoadMainResourceKey = @"WebPlugInShouldLoadMainResourceKey"; NSString *WebPlugInContainingElementKey = @"WebPlugInContainingElementKey"; @implementation WebPluginPackage - initWithPath:(NSString *)pluginPath { if (!(self = [super initWithPath:pluginPath])) return nil; if (bundle == nil) { [self release]; return nil; } if (![[pluginPath pathExtension] _webkit_isCaseInsensitiveEqualToString:@"webplugin"]) { UInt32 type = 0; CFBundleGetPackageInfo(cfBundle, &type, NULL); if (type != FOUR_CHAR_CODE('WBPL')) { [self release]; return nil; } } NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[bundle executablePath]]; NSData *data = [executableFile readDataOfLength:512]; [executableFile closeFile]; if (![self isNativeLibraryData:data]) { [self release]; return nil; } if (![self getPluginInfoFromPLists]) { [self release]; return nil; } return self; } - (Class)viewFactory { return [bundle principalClass]; } - (BOOL)load { #if !LOG_DISABLED CFAbsoluteTime start = CFAbsoluteTimeGetCurrent(); #endif // Load the bundle if (![bundle isLoaded]) { if (![bundle load]) return NO; } #if !LOG_DISABLED CFAbsoluteTime duration = CFAbsoluteTimeGetCurrent() - start; LOG(Plugins, "principalClass took %f seconds for: %@", duration, [self name]); #endif return [super load]; } @end @implementation NSObject (WebScripting) + (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector { return YES; } + (BOOL)isKeyExcludedFromWebScript:(const char *)name { return YES; } @end WebKit/mac/Plugins/WebBaseNetscapePluginView.mm0000644000175000017500000006611211253755357020103 0ustar leelee/* * Copyright (C) 2005, 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) #import "WebBaseNetscapePluginView.h" #import "WebFrameInternal.h" #import "WebKitLogging.h" #import "WebKitNSStringExtras.h" #import "WebKitSystemInterface.h" #import "WebPluginContainerCheck.h" #import "WebNetscapeContainerCheckContextInfo.h" #import "WebNSURLExtras.h" #import "WebNSURLRequestExtras.h" #import "WebView.h" #import "WebViewInternal.h" #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #define LoginWindowDidSwitchFromUserNotification @"WebLoginWindowDidSwitchFromUserNotification" #define LoginWindowDidSwitchToUserNotification @"WebLoginWindowDidSwitchToUserNotification" using namespace WebCore; @implementation WebBaseNetscapePluginView + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif WKSendUserChangeNotifications(); } - (id)initWithFrame:(NSRect)frame pluginPackage:(WebNetscapePluginPackage *)pluginPackage URL:(NSURL *)URL baseURL:(NSURL *)baseURL MIMEType:(NSString *)MIME attributeKeys:(NSArray *)keys attributeValues:(NSArray *)values loadManually:(BOOL)loadManually element:(PassRefPtr)element { self = [super initWithFrame:frame]; if (!self) return nil; _pluginPackage = pluginPackage; _element = element; _sourceURL.adoptNS([URL copy]); _baseURL.adoptNS([baseURL copy]); _MIMEType.adoptNS([MIME copy]); #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) // Enable "kiosk mode" when instantiating the QT plug-in inside of Dashboard. See if ([[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.dashboard.client"] && [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.apple.QuickTime Plugin.plugin"]) { RetainPtr mutableKeys(AdoptNS, [keys mutableCopy]); RetainPtr mutableValues(AdoptNS, [values mutableCopy]); [mutableKeys.get() addObject:@"kioskmode"]; [mutableValues.get() addObject:@"true"]; [self setAttributeKeys:mutableKeys.get() andValues:mutableValues.get()]; } else #endif [self setAttributeKeys:keys andValues:values]; if (loadManually) _mode = NP_FULL; else _mode = NP_EMBED; _loadManually = loadManually; return self; } - (void)dealloc { ASSERT(!_isStarted); [super dealloc]; } - (void)finalize { ASSERT_MAIN_THREAD(); ASSERT(!_isStarted); [super finalize]; } - (WebNetscapePluginPackage *)pluginPackage { return _pluginPackage.get(); } - (BOOL)isFlipped { return YES; } - (NSURL *)URLWithCString:(const char *)URLCString { if (!URLCString) return nil; CFStringRef string = CFStringCreateWithCString(kCFAllocatorDefault, URLCString, kCFStringEncodingISOLatin1); ASSERT(string); // All strings should be representable in ISO Latin 1 NSString *URLString = [(NSString *)string _web_stringByStrippingReturnCharacters]; NSURL *URL = [NSURL _web_URLWithDataAsString:URLString relativeToURL:_baseURL.get()]; CFRelease(string); if (!URL) return nil; return URL; } - (NSMutableURLRequest *)requestWithURLCString:(const char *)URLCString { NSURL *URL = [self URLWithCString:URLCString]; if (!URL) return nil; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL]; Frame* frame = core([self webFrame]); if (!frame) return nil; [request _web_setHTTPReferrer:frame->loader()->outgoingReferrer()]; return request; } // Methods that subclasses must override - (void)setAttributeKeys:(NSArray *)keys andValues:(NSArray *)values { ASSERT_NOT_REACHED(); } - (void)handleMouseMoved:(NSEvent *)event { ASSERT_NOT_REACHED(); } - (void)focusChanged { ASSERT_NOT_REACHED(); } - (void)windowFocusChanged:(BOOL)hasFocus { ASSERT_NOT_REACHED(); } - (BOOL)createPlugin { ASSERT_NOT_REACHED(); return NO; } - (void)loadStream { ASSERT_NOT_REACHED(); } - (BOOL)shouldStop { ASSERT_NOT_REACHED(); return YES; } - (void)destroyPlugin { ASSERT_NOT_REACHED(); } - (void)updateAndSetWindow { ASSERT_NOT_REACHED(); } - (void)sendModifierEventWithKeyCode:(int)keyCode character:(char)character { ASSERT_NOT_REACHED(); } - (void)removeTrackingRect { if (_trackingTag) { [self removeTrackingRect:_trackingTag]; _trackingTag = 0; // Do the following after setting trackingTag to 0 so we don't re-enter. // Balance the retain in resetTrackingRect. Use autorelease in case we hold // the last reference to the window during tear-down, to avoid crashing AppKit. [[self window] autorelease]; } } - (void)resetTrackingRect { [self removeTrackingRect]; if (_isStarted) { // Retain the window so that removeTrackingRect can work after the window is closed. [[self window] retain]; _trackingTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO]; } } - (void)stopTimers { _shouldFireTimers = NO; } - (void)startTimers { _shouldFireTimers = YES; } - (void)restartTimers { ASSERT([self window]); [self stopTimers]; if (!_isStarted || [[self window] isMiniaturized]) return; [self startTimers]; } - (NSRect)_windowClipRect { RenderObject* renderer = _element->renderer(); if (renderer && renderer->view()) { if (FrameView* frameView = renderer->view()->frameView()) return frameView->windowClipRectForLayer(renderer->enclosingLayer(), true); } return NSZeroRect; } - (NSRect)visibleRect { // WebCore may impose an additional clip (via CSS overflow or clip properties). Fetch // that clip now. return NSIntersectionRect([self convertRect:[self _windowClipRect] fromView:nil], [super visibleRect]); } - (BOOL)acceptsFirstResponder { return YES; } - (void)sendActivateEvent:(BOOL)activate { if (!_isStarted) return; [self windowFocusChanged:activate]; } - (void)setHasFocus:(BOOL)flag { if (!_isStarted) return; if (_hasFocus == flag) return; _hasFocus = flag; [self focusChanged]; } - (void)addWindowObservers { ASSERT([self window]); NSWindow *theWindow = [self window]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter addObserver:self selector:@selector(windowWillClose:) name:NSWindowWillCloseNotification object:theWindow]; [notificationCenter addObserver:self selector:@selector(windowBecameKey:) name:NSWindowDidBecomeKeyNotification object:theWindow]; [notificationCenter addObserver:self selector:@selector(windowResignedKey:) name:NSWindowDidResignKeyNotification object:theWindow]; [notificationCenter addObserver:self selector:@selector(windowDidMiniaturize:) name:NSWindowDidMiniaturizeNotification object:theWindow]; [notificationCenter addObserver:self selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:theWindow]; [notificationCenter addObserver:self selector:@selector(loginWindowDidSwitchFromUser:) name:LoginWindowDidSwitchFromUserNotification object:nil]; [notificationCenter addObserver:self selector:@selector(loginWindowDidSwitchToUser:) name:LoginWindowDidSwitchToUserNotification object:nil]; } - (void)removeWindowObservers { NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter removeObserver:self name:NSWindowWillCloseNotification object:nil]; [notificationCenter removeObserver:self name:NSWindowDidBecomeKeyNotification object:nil]; [notificationCenter removeObserver:self name:NSWindowDidResignKeyNotification object:nil]; [notificationCenter removeObserver:self name:NSWindowDidMiniaturizeNotification object:nil]; [notificationCenter removeObserver:self name:NSWindowDidDeminiaturizeNotification object:nil]; [notificationCenter removeObserver:self name:LoginWindowDidSwitchFromUserNotification object:nil]; [notificationCenter removeObserver:self name:LoginWindowDidSwitchToUserNotification object:nil]; } - (void)start { ASSERT([self currentWindow]); if (_isStarted) return; if (_triedAndFailedToCreatePlugin) return; ASSERT([self webView]); if (![[[self webView] preferences] arePlugInsEnabled]) return; Frame* frame = core([self webFrame]); if (!frame) return; Page* page = frame->page(); if (!page) return; bool wasDeferring = page->defersLoading(); if (!wasDeferring) page->setDefersLoading(true); BOOL result = [self createPlugin]; if (!wasDeferring) page->setDefersLoading(false); if (!result) { _triedAndFailedToCreatePlugin = YES; return; } _isStarted = YES; [[self webView] addPluginInstanceView:self]; if ([self currentWindow]) [self updateAndSetWindow]; if ([self window]) { [self addWindowObservers]; if ([[self window] isKeyWindow]) { [self sendActivateEvent:YES]; } [self restartTimers]; } [self resetTrackingRect]; [self loadStream]; } - (void)stop { if (![self shouldStop]) return; [self removeTrackingRect]; if (!_isStarted) return; _isStarted = NO; [[self webView] removePluginInstanceView:self]; // Stop the timers [self stopTimers]; // Stop notifications and callbacks. [self removeWindowObservers]; [self destroyPlugin]; } - (void)viewWillMoveToWindow:(NSWindow *)newWindow { // We must remove the tracking rect before we move to the new window. // Once we move to the new window, it will be too late. [self removeTrackingRect]; [self removeWindowObservers]; // Workaround for: resignFirstResponder is not sent to first responder view when it is removed from the window [self setHasFocus:NO]; if (!newWindow) { if ([[self webView] hostWindow]) { // View will be moved out of the actual window but it still has a host window. [self stopTimers]; } else { // View will have no associated windows. [self stop]; // Stop observing WebPreferencesChangedNotification -- we only need to observe this when installed in the view hierarchy. // When not in the view hierarchy, -viewWillMoveToWindow: and -viewDidMoveToWindow will start/stop the plugin as needed. [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedNotification object:nil]; } } } - (void)viewWillMoveToSuperview:(NSView *)newSuperview { if (!newSuperview) { // Stop the plug-in when it is removed from its superview. It is not sufficient to do this in -viewWillMoveToWindow:nil, because // the WebView might still has a hostWindow at that point, which prevents the plug-in from being destroyed. // There is no need to start the plug-in when moving into a superview. -viewDidMoveToWindow takes care of that. [self stop]; // Stop observing WebPreferencesChangedNotification -- we only need to observe this when installed in the view hierarchy. // When not in the view hierarchy, -viewWillMoveToWindow: and -viewDidMoveToWindow will start/stop the plugin as needed. [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedNotification object:nil]; } } - (void)viewDidMoveToWindow { [self resetTrackingRect]; if ([self window]) { // While in the view hierarchy, observe WebPreferencesChangedNotification so that we can start/stop depending // on whether plugins are enabled. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(preferencesHaveChanged:) name:WebPreferencesChangedNotification object:nil]; // View moved to an actual window. Start it if not already started. [self start]; // Starting the plug-in can result in it removing itself from the window so we need to ensure that we're still in // place before doing anything that requires a window. if ([self window]) { [self restartTimers]; [self addWindowObservers]; } } else if ([[self webView] hostWindow]) { // View moved out of an actual window, but still has a host window. // Call setWindow to explicitly "clip out" the plug-in from sight. // FIXME: It would be nice to do this where we call stopNullEvents in viewWillMoveToWindow. [self updateAndSetWindow]; } } - (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow { if (!hostWindow && ![self window]) { // View will have no associated windows. [self stop]; // Remove WebPreferencesChangedNotification observer -- we will observe once again when we move back into the window [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedNotification object:nil]; } } - (void)viewDidMoveToHostWindow { if ([[self webView] hostWindow]) { // View now has an associated window. Start it if not already started. [self start]; } } #pragma mark NOTIFICATIONS - (void)windowWillClose:(NSNotification *)notification { [self stop]; } - (void)windowBecameKey:(NSNotification *)notification { [self sendActivateEvent:YES]; [self invalidatePluginContentRect:[self bounds]]; [self restartTimers]; } - (void)windowResignedKey:(NSNotification *)notification { [self sendActivateEvent:NO]; [self invalidatePluginContentRect:[self bounds]]; [self restartTimers]; } - (void)windowDidMiniaturize:(NSNotification *)notification { [self stopTimers]; } - (void)windowDidDeminiaturize:(NSNotification *)notification { [self restartTimers]; } - (void)loginWindowDidSwitchFromUser:(NSNotification *)notification { [self stopTimers]; } -(void)loginWindowDidSwitchToUser:(NSNotification *)notification { [self restartTimers]; } - (void)preferencesHaveChanged:(NSNotification *)notification { WebPreferences *preferences = [[self webView] preferences]; BOOL arePlugInsEnabled = [preferences arePlugInsEnabled]; if ([notification object] == preferences && _isStarted != arePlugInsEnabled) { if (arePlugInsEnabled) { if ([self currentWindow]) { [self start]; } } else { [self stop]; [self invalidatePluginContentRect:[self bounds]]; } } } - (void)renewGState { [super renewGState]; // -renewGState is called whenever the view's geometry changes. It's a little hacky to override this method, but // much safer than walking up the view hierarchy and observing frame/bounds changed notifications, since you don't // have to track subsequent changes to the view hierarchy and add/remove notification observers. // NSOpenGLView uses the exact same technique to reshape its OpenGL surface. // All of the work this method does may safely be skipped if the view is not in a window. When the view // is moved back into a window, everything should be set up correctly. if (![self window]) return; [self updateAndSetWindow]; [self resetTrackingRect]; // Check to see if the plugin view is completely obscured (scrolled out of view, for example). // For performance reasons, we send null events at a lower rate to plugins which are obscured. BOOL oldIsObscured = _isCompletelyObscured; _isCompletelyObscured = NSIsEmptyRect([self visibleRect]); if (_isCompletelyObscured != oldIsObscured) [self restartTimers]; } - (BOOL)becomeFirstResponder { [self setHasFocus:YES]; return YES; } - (BOOL)resignFirstResponder { [self setHasFocus:NO]; return YES; } - (WebDataSource *)dataSource { WebFrame *webFrame = kit(_element->document()->frame()); return [webFrame _dataSource]; } - (WebFrame *)webFrame { return [[self dataSource] webFrame]; } - (WebView *)webView { return [[self webFrame] webView]; } - (NSWindow *)currentWindow { return [self window] ? [self window] : [[self webView] hostWindow]; } - (WebCore::HTMLPlugInElement*)element { return _element.get(); } - (void)cut:(id)sender { [self sendModifierEventWithKeyCode:7 character:'x']; } - (void)copy:(id)sender { [self sendModifierEventWithKeyCode:8 character:'c']; } - (void)paste:(id)sender { [self sendModifierEventWithKeyCode:9 character:'v']; } - (void)selectAll:(id)sender { [self sendModifierEventWithKeyCode:0 character:'a']; } // AppKit doesn't call mouseDown or mouseUp on right-click. Simulate control-click // mouseDown and mouseUp so plug-ins get the right-click event as they do in Carbon (3125743). - (void)rightMouseDown:(NSEvent *)theEvent { [self mouseDown:theEvent]; } - (void)rightMouseUp:(NSEvent *)theEvent { [self mouseUp:theEvent]; } - (BOOL)convertFromX:(double)sourceX andY:(double)sourceY space:(NPCoordinateSpace)sourceSpace toX:(double *)destX andY:(double *)destY space:(NPCoordinateSpace)destSpace { // Nothing to do if (sourceSpace == destSpace) return TRUE; NSPoint sourcePoint = NSMakePoint(sourceX, sourceY); NSPoint sourcePointInScreenSpace; // First convert to screen space switch (sourceSpace) { case NPCoordinateSpacePlugin: sourcePointInScreenSpace = [self convertPoint:sourcePoint toView:nil]; sourcePointInScreenSpace = [[self currentWindow] convertBaseToScreen:sourcePointInScreenSpace]; break; case NPCoordinateSpaceWindow: sourcePointInScreenSpace = [[self currentWindow] convertBaseToScreen:sourcePoint]; break; case NPCoordinateSpaceFlippedWindow: sourcePoint.y = [[self currentWindow] frame].size.height - sourcePoint.y; sourcePointInScreenSpace = [[self currentWindow] convertBaseToScreen:sourcePoint]; break; case NPCoordinateSpaceScreen: sourcePointInScreenSpace = sourcePoint; break; case NPCoordinateSpaceFlippedScreen: sourcePoint.y = [[[NSScreen screens] objectAtIndex:0] frame].size.height - sourcePoint.y; sourcePointInScreenSpace = sourcePoint; break; default: return FALSE; } NSPoint destPoint; // Then convert back to the destination space switch (destSpace) { case NPCoordinateSpacePlugin: destPoint = [[self currentWindow] convertScreenToBase:sourcePointInScreenSpace]; destPoint = [self convertPoint:destPoint fromView:nil]; break; case NPCoordinateSpaceWindow: destPoint = [[self currentWindow] convertScreenToBase:sourcePointInScreenSpace]; break; case NPCoordinateSpaceFlippedWindow: destPoint = [[self currentWindow] convertScreenToBase:sourcePointInScreenSpace]; destPoint.y = [[self currentWindow] frame].size.height - destPoint.y; break; case NPCoordinateSpaceScreen: destPoint = sourcePointInScreenSpace; break; case NPCoordinateSpaceFlippedScreen: destPoint = sourcePointInScreenSpace; destPoint.y = [[[NSScreen screens] objectAtIndex:0] frame].size.height - destPoint.y; break; default: return FALSE; } if (destX) *destX = destPoint.x; if (destY) *destY = destPoint.y; return TRUE; } - (CString)resolvedURLStringForURL:(const char*)url target:(const char*)target; { String relativeURLString = String::fromUTF8(url); if (relativeURLString.isNull()) return CString(); Frame* frame = core([self webFrame]); if (!frame) return CString(); Frame* targetFrame = frame->tree()->find(String::fromUTF8(target)); if (!targetFrame) return CString(); if (!frame->document()->securityOrigin()->canAccess(targetFrame->document()->securityOrigin())) return CString(); KURL absoluteURL = targetFrame->loader()->completeURL(relativeURLString); return absoluteURL.string().utf8(); } - (void)invalidatePluginContentRect:(NSRect)rect { if (RenderBoxModelObject *renderer = toRenderBoxModelObject(_element->renderer())) { IntRect contentRect(rect); contentRect.move(renderer->borderLeft() + renderer->paddingLeft(), renderer->borderTop() + renderer->paddingTop()); renderer->repaintRectangle(contentRect); } } @end namespace WebKit { #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) CString proxiesForURL(NSURL *url) { RetainPtr systemProxies(AdoptCF, CFNetworkCopySystemProxySettings()); if (!systemProxies) return "DIRECT"; RetainPtr proxiesForURL(AdoptCF, CFNetworkCopyProxiesForURL((CFURLRef)url, systemProxies.get())); CFIndex proxyCount = proxiesForURL ? CFArrayGetCount(proxiesForURL.get()) : 0; if (!proxyCount) return "DIRECT"; // proxiesForURL is a CFArray of CFDictionaries. Each dictionary represents a proxy. // The format of the result should be: // "PROXY host[:port]" (for HTTP proxy) or // "SOCKS host[:port]" (for SOCKS proxy) or // A combination of the above, separated by semicolon, in the order that they should be tried. String proxies; for (CFIndex i = 0; i < proxyCount; ++i) { CFDictionaryRef proxy = static_cast(CFArrayGetValueAtIndex(proxiesForURL.get(), i)); if (!proxy) continue; CFStringRef type = static_cast(CFDictionaryGetValue(proxy, kCFProxyTypeKey)); bool isHTTP = type == kCFProxyTypeHTTP || type == kCFProxyTypeHTTPS; bool isSOCKS = type == kCFProxyTypeSOCKS; // We can only report HTTP and SOCKS proxies. if (!isHTTP && !isSOCKS) continue; CFStringRef host = static_cast(CFDictionaryGetValue(proxy, kCFProxyHostNameKey)); CFNumberRef port = static_cast(CFDictionaryGetValue(proxy, kCFProxyPortNumberKey)); // If we are inserting multiple entries, add a separator if (!proxies.isEmpty()) proxies += ";"; if (isHTTP) proxies += "PROXY "; else if (isSOCKS) proxies += "SOCKS "; proxies += host; if (port) { SInt32 intPort; CFNumberGetValue(port, kCFNumberSInt32Type, &intPort); proxies += ":" + String::number(intPort); } } if (proxies.isEmpty()) return "DIRECT"; return proxies.utf8(); } #endif bool getAuthenticationInfo(const char* protocolStr, const char* hostStr, int32_t port, const char* schemeStr, const char* realmStr, CString& username, CString& password) { if (strcasecmp(protocolStr, "http") != 0 && strcasecmp(protocolStr, "https") != 0) return false; NSString *host = [NSString stringWithUTF8String:hostStr]; if (!hostStr) return false; NSString *protocol = [NSString stringWithUTF8String:protocolStr]; if (!protocol) return false; NSString *realm = [NSString stringWithUTF8String:realmStr]; if (!realm) return NPERR_GENERIC_ERROR; NSString *authenticationMethod = NSURLAuthenticationMethodDefault; if (!strcasecmp(protocolStr, "http")) { if (!strcasecmp(schemeStr, "basic")) authenticationMethod = NSURLAuthenticationMethodHTTPBasic; else if (!strcasecmp(schemeStr, "digest")) authenticationMethod = NSURLAuthenticationMethodHTTPDigest; } RetainPtr protectionSpace(AdoptNS, [[NSURLProtectionSpace alloc] initWithHost:host port:port protocol:protocol realm:realm authenticationMethod:authenticationMethod]); NSURLCredential *credential = mac(CredentialStorage::get(core(protectionSpace.get()))); if (!credential) credential = [[NSURLCredentialStorage sharedCredentialStorage] defaultCredentialForProtectionSpace:protectionSpace.get()]; if (!credential) return false; if (![credential hasPassword]) return false; username = [[credential user] UTF8String]; password = [[credential password] UTF8String]; return true; } } // namespace WebKit #endif // ENABLE(NETSCAPE_PLUGIN_API) WebKit/mac/Plugins/WebPluginContainerCheck.mm0000644000175000017500000001406011175370126017554 0ustar leelee/* * Copyright (C) 2005, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebPluginContainerCheck.h" #import "WebFrameInternal.h" #import "WebPluginContainerPrivate.h" #import "WebPluginController.h" #import "WebPolicyDelegatePrivate.h" #import "WebView.h" #import "WebViewInternal.h" #import #import #import #import #import #import #import #import using namespace WebCore; @implementation WebPluginContainerCheck - (id)initWithRequest:(NSURLRequest *)request target:(NSString *)target resultObject:(id)obj selector:(SEL)selector controller:(id )controller contextInfo:(id)contextInfo /*optional*/ { if (!(self = [super init])) return nil; _request = [request copy]; _target = [target copy]; _resultObject = [obj retain]; _resultSelector = selector; _contextInfo = [contextInfo retain]; // controller owns us so don't retain, to avoid cycle _controller = controller; return self; } + (id)checkWithRequest:(NSURLRequest *)request target:(NSString *)target resultObject:(id)obj selector:(SEL)selector controller:(id )controller contextInfo:(id)contextInfo /*optional*/ { return [[[self alloc] initWithRequest:request target:target resultObject:obj selector:selector controller:controller contextInfo:contextInfo] autorelease]; } - (void)finalize { // mandatory to complete or cancel before releasing this object ASSERT(_done); [super finalize]; } - (void)dealloc { // mandatory to complete or cancel before releasing this object ASSERT(_done); [super dealloc]; } - (void)_continueWithPolicy:(PolicyAction)policy { if (_contextInfo) ((void (*)(id, SEL, BOOL, id))objc_msgSend)(_resultObject, _resultSelector, (policy == PolicyUse), _contextInfo); else ((void (*)(id, SEL, BOOL))objc_msgSend)(_resultObject, _resultSelector, (policy == PolicyUse)); // this will call indirectly call cancel [_controller _webPluginContainerCancelCheckIfAllowedToLoadRequest:self]; } - (BOOL)_isForbiddenFileLoad { Frame* coreFrame = core([_controller webFrame]); ASSERT(coreFrame); if (!coreFrame->loader()->canLoad([_request URL], String(), coreFrame->document())) { [self _continueWithPolicy:PolicyIgnore]; return YES; } return NO; } - (NSDictionary *)_actionInformationWithURL:(NSURL *)URL { return [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:WebNavigationTypePlugInRequest], WebActionNavigationTypeKey, [NSNumber numberWithInt:0], WebActionModifierFlagsKey, URL, WebActionOriginalURLKey, nil]; } - (void)_askPolicyDelegate { WebView *webView = [_controller webView]; WebFrame *targetFrame; if ([_target length] > 0) { targetFrame = [[_controller webFrame] findFrameNamed:_target]; } else { targetFrame = [_controller webFrame]; } NSDictionary *action = [self _actionInformationWithURL:[_request URL]]; _listener = [[WebPolicyDecisionListener alloc] _initWithTarget:self action:@selector(_continueWithPolicy:)]; if (targetFrame == nil) { // would open new window [[webView _policyDelegateForwarder] webView:webView decidePolicyForNewWindowAction:action request:_request newFrameName:_target decisionListener:_listener]; } else { // would target existing frame [[webView _policyDelegateForwarder] webView:webView decidePolicyForNavigationAction:action request:_request frame:targetFrame decisionListener:_listener]; } } - (void)start { ASSERT(!_listener); ASSERT(!_done); if ([self _isForbiddenFileLoad]) return; [self _askPolicyDelegate]; } - (void)cancel { if (_done) return; [_request release]; _request = nil; [_target release]; _target = nil; [_listener _invalidate]; [_listener release]; _listener = nil; [_resultObject autorelease]; _resultObject = nil; _controller = nil; [_contextInfo release]; _contextInfo = nil; _done = YES; } - (id)contextInfo { return _contextInfo; } @end WebKit/mac/Plugins/WebPluginsPrivate.m0000644000175000017500000000327210360512352016311 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #include "WebPluginsPrivate.h" NSString *WebPluginWillPresentNativeUserInterfaceNotification = @"WebPluginWillPresentNativeUserInterface"; WebKit/mac/Plugins/WebPluginDatabase.h0000644000175000017500000000520211013144475016211 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @class WebBasePluginPackage; @class WebFrame; @interface WebPluginDatabase : NSObject { NSMutableDictionary *plugins; NSMutableSet *registeredMIMETypes; NSArray *plugInPaths; // Set of views with plugins attached NSMutableSet *pluginInstanceViews; } + (WebPluginDatabase *)sharedDatabase; + (void)closeSharedDatabase; // avoids creating the database just to close it // Plug-ins are returned in this order: New plug-in (WBPL), Mach-O Netscape, CFM Netscape - (WebBasePluginPackage *)pluginForMIMEType:(NSString *)mimeType; - (WebBasePluginPackage *)pluginForExtension:(NSString *)extension; - (BOOL)isMIMETypeRegistered:(NSString *)MIMEType; - (NSArray *)plugins; - (void)refresh; - (void)setPlugInPaths:(NSArray *)newPaths; - (void)close; - (void)addPluginInstanceView:(NSView *)view; - (void)removePluginInstanceView:(NSView *)view; - (void)removePluginInstanceViewsFor:(WebFrame *)webFrame; - (void)destroyAllPluginInstanceViews; @end @interface NSObject (WebPlugInDatabase) + (void)setAdditionalWebPlugInPaths:(NSArray *)path; @end WebKit/mac/Plugins/WebNetscapeContainerCheckContextInfo.h0000644000175000017500000000411311224532552022053 0ustar leelee/* * Copyright (C) 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebBaseNetscapePluginView.h" #if ENABLE(NETSCAPE_PLUGIN_API) @interface WebNetscapeContainerCheckContextInfo : NSObject { uint32 _checkRequestID; void (*_callback)(NPP npp, uint32, NPBool, void *); void *_context; } - (id)initWithCheckRequestID:(uint32)checkRequestID callbackFunc:(void (*)(NPP npp, uint32 checkID, NPBool allowed, void* context))callbackFunc context:(void*)context; - (uint32)checkRequestID; - (void (*)(NPP npp, uint32, NPBool, void*))callback; - (void*)context; @end #endif // ENABLE(NETSCAPE_PLUGIN_API) WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.h0000644000175000017500000000562411173157003021522 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if ENABLE(NETSCAPE_PLUGIN_API) #ifndef WebNetscapePluginEventHandlerCocoa_h #define WebNetscapePluginEventHandlerCocoa_h #include #include "WebNetscapePluginEventHandler.h" class WebNetscapePluginEventHandlerCocoa : public WebNetscapePluginEventHandler { public: WebNetscapePluginEventHandlerCocoa(WebNetscapePluginView*); virtual void drawRect(CGContextRef, const NSRect&); virtual void mouseDown(NSEvent*); virtual void mouseDragged(NSEvent*); virtual void mouseEntered(NSEvent*); virtual void mouseExited(NSEvent*); virtual void mouseMoved(NSEvent*); virtual void mouseUp(NSEvent*); virtual bool scrollWheel(NSEvent*); virtual void keyDown(NSEvent*); virtual void keyUp(NSEvent*); virtual void flagsChanged(NSEvent*); virtual void syntheticKeyDownWithCommandModifier(int keyCode, char character); virtual void windowFocusChanged(bool hasFocus); virtual void focusChanged(bool hasFocus); virtual void* platformWindow(NSWindow*); private: bool sendMouseEvent(NSEvent*, NPCocoaEventType); bool sendKeyEvent(NSEvent*, NPCocoaEventType); bool sendEvent(NPCocoaEvent*); #ifndef __LP64__ void installKeyEventHandler(); void removeKeyEventHandler(); static OSStatus TSMEventHandler(EventHandlerCallRef, EventRef, void *eventHandler); OSStatus handleTSMEvent(EventRef); EventHandlerRef m_keyEventHandler; #else inline void installKeyEventHandler() { } void removeKeyEventHandler() { } #endif }; #endif //WebNetscapePluginEventHandlerCocoa_h #endif // ENABLE(NETSCAPE_PLUGIN_API) WebKit/mac/Plugins/WebBasePluginPackage.mm0000644000175000017500000004000311153106467017017 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import #import #import #import #import #import #import #import #import #import "WebKitLogging.h" #import "WebTypesInternal.h" #import #import #import #define JavaCocoaPluginIdentifier @"com.apple.JavaPluginCocoa" #define JavaCarbonPluginIdentifier @"com.apple.JavaAppletPlugin" #define JavaCFMPluginFilename @"Java Applet Plugin Enabler" #define QuickTimeCarbonPluginIdentifier @"com.apple.QuickTime Plugin.plugin" #define QuickTimeCocoaPluginIdentifier @"com.apple.quicktime.webplugin" @interface NSArray (WebPluginExtensions) - (NSArray *)_web_lowercaseStrings; @end; @implementation WebBasePluginPackage + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif } + (WebBasePluginPackage *)pluginWithPath:(NSString *)pluginPath { WebBasePluginPackage *pluginPackage = [[WebPluginPackage alloc] initWithPath:pluginPath]; if (!pluginPackage) { #if ENABLE(NETSCAPE_PLUGIN_API) pluginPackage = [[WebNetscapePluginPackage alloc] initWithPath:pluginPath]; #else return nil; #endif } return [pluginPackage autorelease]; } + (NSString *)preferredLocalizationName { return WebCFAutorelease(WKCopyCFLocalizationPreferredName(NULL)); } - (NSString *)pathByResolvingSymlinksAndAliasesInPath:(NSString *)thePath { NSString *newPath = [thePath stringByResolvingSymlinksInPath]; FSRef fref; OSStatus err; err = FSPathMakeRef((const UInt8 *)[thePath fileSystemRepresentation], &fref, NULL); if (err != noErr) return newPath; Boolean targetIsFolder; Boolean wasAliased; err = FSResolveAliasFileWithMountFlags(&fref, TRUE, &targetIsFolder, &wasAliased, kResolveAliasFileNoUI); if (err != noErr) return newPath; if (wasAliased) { CFURLRef URL = CFURLCreateFromFSRef(kCFAllocatorDefault, &fref); newPath = [(NSURL *)URL path]; CFRelease(URL); } return newPath; } - (id)initWithPath:(NSString *)pluginPath { if (!(self = [super init])) return nil; path = [[self pathByResolvingSymlinksAndAliasesInPath:pluginPath] retain]; bundle = [[NSBundle alloc] initWithPath:path]; #ifndef __ppc__ // 32-bit PowerPC is the only platform where non-bundled CFM plugins are supported if (!bundle) { [self release]; return nil; } #endif cfBundle = CFBundleCreate(NULL, (CFURLRef)[NSURL fileURLWithPath:path]); extensionToMIME = [[NSMutableDictionary alloc] init]; return self; } - (BOOL)getPluginInfoFromBundleAndMIMEDictionary:(NSDictionary *)MIMETypes { if (!bundle) return NO; if (!MIMETypes) { MIMETypes = [bundle objectForInfoDictionaryKey:WebPluginMIMETypesKey]; if (!MIMETypes) return NO; } NSMutableDictionary *MIMEToExtensionsDictionary = [NSMutableDictionary dictionary]; NSMutableDictionary *MIMEToDescriptionDictionary = [NSMutableDictionary dictionary]; NSEnumerator *keyEnumerator = [MIMETypes keyEnumerator]; NSDictionary *MIMEDictionary; NSString *MIME, *description; NSArray *extensions; while ((MIME = [keyEnumerator nextObject]) != nil) { MIMEDictionary = [MIMETypes objectForKey:MIME]; // FIXME: Consider storing disabled MIME types. NSNumber *isEnabled = [MIMEDictionary objectForKey:WebPluginTypeEnabledKey]; if (isEnabled && [isEnabled boolValue] == NO) continue; extensions = [[MIMEDictionary objectForKey:WebPluginExtensionsKey] _web_lowercaseStrings]; if ([extensions count] == 0) extensions = [NSArray arrayWithObject:@""]; MIME = [MIME lowercaseString]; [MIMEToExtensionsDictionary setObject:extensions forKey:MIME]; description = [MIMEDictionary objectForKey:WebPluginTypeDescriptionKey]; if (!description) description = @""; [MIMEToDescriptionDictionary setObject:description forKey:MIME]; } [self setMIMEToExtensionsDictionary:MIMEToExtensionsDictionary]; [self setMIMEToDescriptionDictionary:MIMEToDescriptionDictionary]; NSString *filename = [self filename]; NSString *theName = [bundle objectForInfoDictionaryKey:WebPluginNameKey]; if (!theName) theName = filename; [self setName:theName]; description = [bundle objectForInfoDictionaryKey:WebPluginDescriptionKey]; if (!description) description = filename; [self setPluginDescription:description]; return YES; } - (void)unload { } - (void)createPropertyListFile { if ([self load] && BP_CreatePluginMIMETypesPreferences) { BP_CreatePluginMIMETypesPreferences(); [self unload]; } } - (NSDictionary *)pListForPath:(NSString *)pListPath createFile:(BOOL)createFile { if (createFile) [self createPropertyListFile]; NSDictionary *pList = nil; NSData *data = [NSData dataWithContentsOfFile:pListPath]; if (data) { pList = [NSPropertyListSerialization propertyListFromData:data mutabilityOption:NSPropertyListImmutable format:nil errorDescription:nil]; } return pList; } - (BOOL)getPluginInfoFromPLists { if (!bundle) return NO; NSDictionary *MIMETypes = nil; NSString *pListFilename = [bundle objectForInfoDictionaryKey:WebPluginMIMETypesFilenameKey]; // Check if the MIME types are claimed in a plist in the user's preferences directory. if (pListFilename) { NSString *pListPath = [NSString stringWithFormat:@"%@/Library/Preferences/%@", NSHomeDirectory(), pListFilename]; NSDictionary *pList = [self pListForPath:pListPath createFile:NO]; if (pList) { // If the plist isn't localized, have the plug-in recreate it in the preferred language. NSString *localizationName = [pList objectForKey:WebPluginLocalizationNameKey]; if (![localizationName isEqualToString:[[self class] preferredLocalizationName]]) pList = [self pListForPath:pListPath createFile:YES]; MIMETypes = [pList objectForKey:WebPluginMIMETypesKey]; } else // Plist doesn't exist, ask the plug-in to create it. MIMETypes = [[self pListForPath:pListPath createFile:YES] objectForKey:WebPluginMIMETypesKey]; } // Pass the MIME dictionary to the superclass to parse it. return [self getPluginInfoFromBundleAndMIMEDictionary:MIMETypes]; } - (BOOL)load { if (bundle && !BP_CreatePluginMIMETypesPreferences) BP_CreatePluginMIMETypesPreferences = (BP_CreatePluginMIMETypesPreferencesFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("BP_CreatePluginMIMETypesPreferences")); return YES; } - (void)dealloc { ASSERT(!pluginDatabases || [pluginDatabases count] == 0); [pluginDatabases release]; [name release]; [path release]; [pluginDescription release]; [MIMEToDescription release]; [MIMEToExtensions release]; [extensionToMIME release]; [bundle release]; if (cfBundle) CFRelease(cfBundle); [super dealloc]; } - (void)finalize { ASSERT_MAIN_THREAD(); ASSERT(!pluginDatabases || [pluginDatabases count] == 0); [pluginDatabases release]; if (cfBundle) CFRelease(cfBundle); [super finalize]; } - (NSString *)name { return name; } - (NSString *)path { return path; } - (NSString *)filename { return [path lastPathComponent]; } - (NSString *)pluginDescription { return pluginDescription; } - (NSEnumerator *)extensionEnumerator { return [extensionToMIME keyEnumerator]; } - (NSEnumerator *)MIMETypeEnumerator { return [MIMEToExtensions keyEnumerator]; } - (NSString *)descriptionForMIMEType:(NSString *)MIMEType { return [MIMEToDescription objectForKey:MIMEType]; } - (NSString *)MIMETypeForExtension:(NSString *)extension { return [extensionToMIME objectForKey:extension]; } - (NSArray *)extensionsForMIMEType:(NSString *)MIMEType { return [MIMEToExtensions objectForKey:MIMEType]; } - (NSBundle *)bundle { return bundle; } - (void)setName:(NSString *)theName { [name release]; name = [theName retain]; } - (void)setPath:(NSString *)thePath { [path release]; path = [thePath retain]; } - (void)setPluginDescription:(NSString *)description { [pluginDescription release]; pluginDescription = [description retain]; } - (void)setMIMEToDescriptionDictionary:(NSDictionary *)MIMEToDescriptionDictionary { [MIMEToDescription release]; MIMEToDescription = [MIMEToDescriptionDictionary retain]; } - (void)setMIMEToExtensionsDictionary:(NSDictionary *)MIMEToExtensionsDictionary { [MIMEToExtensions release]; MIMEToExtensions = [MIMEToExtensionsDictionary retain]; // Reverse the mapping [extensionToMIME removeAllObjects]; NSEnumerator *MIMEEnumerator = [MIMEToExtensions keyEnumerator], *extensionEnumerator; NSString *MIME, *extension; NSArray *extensions; while ((MIME = [MIMEEnumerator nextObject]) != nil) { extensions = [MIMEToExtensions objectForKey:MIME]; extensionEnumerator = [extensions objectEnumerator]; while ((extension = [extensionEnumerator nextObject]) != nil) { if (![extension isEqualToString:@""]) [extensionToMIME setObject:MIME forKey:extension]; } } } - (NSString *)description { return [NSString stringWithFormat:@"name: %@\npath: %@\nmimeTypes:\n%@\npluginDescription:%@", name, path, [MIMEToExtensions description], [MIMEToDescription description], pluginDescription]; } - (BOOL)isQuickTimePlugIn { NSString *bundleIdentifier = [[self bundle] bundleIdentifier]; return [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:QuickTimeCarbonPluginIdentifier] || [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:QuickTimeCocoaPluginIdentifier]; } - (BOOL)isJavaPlugIn { NSString *bundleIdentifier = [[self bundle] bundleIdentifier]; return [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:JavaCocoaPluginIdentifier] || [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:JavaCarbonPluginIdentifier] || [[path lastPathComponent] _webkit_isCaseInsensitiveEqualToString:JavaCFMPluginFilename]; } static inline void swapIntsInHeader(uint8_t* bytes, unsigned length) { for (unsigned i = 0; i < length; i += 4) *(uint32_t*)(bytes + i) = OSSwapInt32(*(uint32_t *)(bytes + i)); } - (BOOL)isNativeLibraryData:(NSData *)data { Vector bytes([data length]); memcpy(bytes.data(), [data bytes], bytes.size()); unsigned numArchs = 0; struct fat_arch singleArch = { 0, 0, 0, 0, 0 }; struct fat_arch* archs = 0; if (bytes.size() >= sizeof(struct mach_header_64)) { uint32_t magic = *reinterpret_cast(bytes.data()); if (magic == MH_MAGIC || magic == MH_CIGAM) { // We have a 32-bit thin binary struct mach_header* header = (struct mach_header*)bytes.data(); // Check if we need to swap the bytes if (magic == MH_CIGAM) swapIntsInHeader(bytes.data(), bytes.size()); singleArch.cputype = header->cputype; singleArch.cpusubtype = header->cpusubtype; archs = &singleArch; numArchs = 1; } else if (magic == MH_MAGIC_64 || magic == MH_CIGAM_64) { // We have a 64-bit thin binary struct mach_header_64* header = (struct mach_header_64*)bytes.data(); // Check if we need to swap the bytes if (magic == MH_CIGAM_64) swapIntsInHeader(bytes.data(), bytes.size()); singleArch.cputype = header->cputype; singleArch.cpusubtype = header->cpusubtype; archs = &singleArch; numArchs = 1; } else if (magic == FAT_MAGIC || magic == FAT_CIGAM) { // We have a fat (universal) binary // Check if we need to swap the bytes if (magic == FAT_CIGAM) swapIntsInHeader(bytes.data(), bytes.size()); archs = (struct fat_arch*)(bytes.data() + sizeof(struct fat_header)); numArchs = ((struct fat_header *)bytes.data())->nfat_arch; unsigned maxArchs = (bytes.size() - sizeof(struct fat_header)) / sizeof(struct fat_arch); if (numArchs > maxArchs) numArchs = maxArchs; } } if (!archs || !numArchs) return NO; const NXArchInfo* localArch = NXGetLocalArchInfo(); if (!localArch) return NO; cpu_type_t cputype = localArch->cputype; cpu_subtype_t cpusubtype = localArch->cpusubtype; #ifdef __x86_64__ // NXGetLocalArchInfo returns CPU_TYPE_X86 even when running in 64-bit. // See for more information. cputype = CPU_TYPE_X86_64; #endif return NXFindBestFatArch(cputype, cpusubtype, archs, numArchs) != 0; } - (UInt32)versionNumber { // CFBundleGetVersionNumber doesn't work with all possible versioning schemes, but we think for now it's good enough for us. return CFBundleGetVersionNumber(cfBundle); } - (void)wasAddedToPluginDatabase:(WebPluginDatabase *)database { if (!pluginDatabases) pluginDatabases = [[NSMutableSet alloc] init]; ASSERT(![pluginDatabases containsObject:database]); [pluginDatabases addObject:database]; } - (void)wasRemovedFromPluginDatabase:(WebPluginDatabase *)database { ASSERT(pluginDatabases); ASSERT([pluginDatabases containsObject:database]); [pluginDatabases removeObject:database]; } @end @implementation NSArray (WebPluginExtensions) - (NSArray *)_web_lowercaseStrings { NSMutableArray *lowercaseStrings = [NSMutableArray arrayWithCapacity:[self count]]; NSEnumerator *strings = [self objectEnumerator]; NSString *string; while ((string = [strings nextObject]) != nil) { if ([string isKindOfClass:[NSString class]]) [lowercaseStrings addObject:[string lowercaseString]]; } return lowercaseStrings; } @end WebKit/mac/Plugins/WebPluginPrivate.h0000644000175000017500000000313311035213625016116 0ustar leelee/* * Copyright (C) 2004 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ @interface NSObject (WebPlugInPrivate) @end WebKit/mac/Panels/0000755000175000017500000000000011527024244012322 5ustar leeleeWebKit/mac/Panels/English.lproj/0000755000175000017500000000000011527024244015040 5ustar leeleeWebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/0000755000175000017500000000000011527024244022204 5ustar leeleeWebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib0000644000175000017500000002341611167425373025367 0ustar leeleebplist00Ô X$versionT$topY$archiverX$objects† Ñ]IB.objectdata€_NSKeyedArchiver¯ä 156<=AE[cs} ~˜™¡¢¥©ª«¬°¶·»ÀÎÏÐÑÞèéêïñö÷úý  "'01:;@ADIJLQYZbcdiqr{|€…†‹˜¡¢£¤¥¦§¨±´·¸½¾ÃÄÉÑÒÙÚÞãûüý%-.56>?FGK LNOPQTUZ_dejkpqvw|‚ž¡¢¤ÀÝúûüýþÿ     L|}~€‚¨ƒå„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§ª­°U$nullß  !"#$%&'()*+,-./0VNSRootV$class]NSObjectsKeys_NSClassesValues_NSAccessibilityOidsValues]NSConnections[NSNamesKeys[NSFramework]NSClassesKeysZNSOidsKeys]NSNamesValues_NSAccessibilityConnectors]NSFontManager_NSVisibleWindows_NSObjectsValues_NSAccessibilityOidsKeysYNSNextOid\NSOidsValues€€ã€Ž€°€â€€“€€¯€±€”€à€€€’€á†Û€²Ò234[NSClassName€€_WebAuthenticationPanelÒ789:X$classesZ$classname¢:;^NSCustomObjectXNSObject_IBCocoaFrameworkÒ>?@ZNS.objects€ Ò78BC£CD;\NSMutableSetUNSSetÒ>FG€x¯HIJKLMNOPQRSTUVWXYZ€ €€4€?€E€K€M€[€]€_€e€€‚€ƒ€…€‡€‰€‹€ŒÔ\]^_ab]NSDestinationXNSSourceWNSLabel€€€ €Ødefghijklmnopqk_NSNextResponderWNSFrameVNSCellXNSvFlagsYNSEnabledXNSWindow[NSSuperview€ €€ €! € € ×dtguijqwxyzq|ZNSSubviews[NSFrameSize€ €{€l€y€ €z_{{326, 12}, {84, 32}}Ý€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“a•–—[NSCellFlags_NSAlternateContents_NSPeriodicInterval^NSButtonFlags2_NSAlternateImage_NSKeyEquivalentZNSContentsYNSSupport]NSControlView_NSPeriodicDelay\NSCellFlags2]NSButtonFlagsþ€€€€€€€ È8ÿÿÿÿ†‚@ÿVLog InÔš›œžŸ VNSSizeVNSNameXNSfFlags€#@*€\LucidaGrandeÒ78£¤¢¤;VNSFontÔš›œž§¨€€YHelveticaPQ Ò78­®¤®¯f;\NSButtonCell\NSActionCellÒ78±²¥²³´µ;XNSButtonYNSControlVNSView[NSResponderVlogIn:Ò78¸¹£¹º;_NSNibControlConnector^NSNibConnectorÔ\]^¼½¾¿€3€+€€2ÛdeÁfghi2jÂkÄÅÆÇÈpqËkÍ_NSOriginalClassNameUNSTag€ €*€€€ " € €€ _NSSecureTextField[NSTextField_{{174, 87}, {230, 22}}ÚÒ…†‡‰ÓÂÔÕÖד¾ÛpÍÝ_NSBackgroundColor_NSDrawsBackground[NSTextColorÿÿÿÿ”qþA€)€!€€€@ €&ÕßàáâãäåæçWNSColor\NSColorSpace[NSColorName]NSCatalogName€%€$€#€"VSystem_textBackgroundColorÓàëãíîWNSWhite€%B1Ò78ðߢß;Õßàáâãóåôç€%€(€'€"YtextColorÓàëãíù€%B0Ò78ûü¤ü¯f;_NSTextFieldCellÒ78þÿ¢ÿ;^NSClassSwapperØdefghijklpqk€ €€,€-$ € € _{{102, 58}, {280, 18}}Ý€‚ƒ„…†‡ˆ‰Š‹ŒŽ “½•€€€/€€.€€+H€6€7 € € _{{101, 225}, {306, 34}}ÙÒ…†‡‰ÂÔ2Ö45“$89!þ€)€9€8€€5@€<_BTo view this page, you must log in to this area on www.server.com:Õßàáâã=å>ç€%€;€:€"\controlColorÓàëãíC€%K0.66666669ÕßàáâãóåGç€%€(€=€"_controlTextColorÒ78Kϥϳ´µ;Ô\]^¼N½¿€3€@€+€2ØdefghijklTUopqk€ €€A€B € € _{{242, 12}, {84, 32}}Ý€‚ƒ„…†‡ˆ‰Š‹ŒŽ^_“N•–—€€€€D€C€€@VCancelQÔ\]^¼¾g¿€3€€F€2ÙdefghijÂk)lmÈpqkí€ €>€G€H € € _{{113, 175}, {282, 42}}ÙÒ…†‡‰ÂÔsÖ×vwgyíÝÿÿÿÿ„!þ€)€!€I€J€F@€&_uGoogle Account (https://www.google.com/)'' Certified by: VeriSign Inc. Get more information by clicking ''CertificateÔš›œ~Ÿ¨€#@&€Ô\]^¼½„€3€+€€LXrememberÔ\]^¼ˆŠ€3€N€€ZÚdeŒfghijkp’“”pqkZNSEditable[NSDragTypes€ €Y€V €W€O € € Ò>?š€¦›œžŸ €P€Q€R€S€T€U_Apple PDF pasteboard type_Apple PNG pasteboard type_NSFilenamesPboardType_1NeXT Encapsulated PostScript v1.2 pasteboard type_NeXT TIFF v4.0 pasteboard type_Apple PICT pasteboard type_{{20, 195}, {64, 64}}שª«‰¬­®¯°WNSStyleWNSAlignWNSScaleZNSAnimatesþ€XÒ78²³£³f;[NSImageCellÒ78µ¶¥¶³´µ;[NSImageViewYimageViewÔ\]^¼¾¼€3€€€\XpasswordÔ\]^¼g€3€F€€^_separateRealmLabelÔ\]^¼Æ$¿€3€`€5€2ÙdefghijÂk)ÌÍÈpqk € €>€a€b € € _{{101, 147}, {306, 20}}ÙÒ…†‡‰ÂÔ2Ö4ÕÖÆ8 9€)€9€c€d€`€<_'Your password will be sent unencrypted.Ôš›œ~ŸÝ€€ Ô\]^¼àáâ€3€m€f€€Ýäåæçèéêëìíîïkñòóô’ö÷øù ú\NSWindowView_NSWindowContentMaxSize\NSScreenRect_NSFrameAutosaveName]NSWindowTitleYNSWTFlags]NSWindowClass\NSWindowRectYNSMaxSize_NSWindowBacking_NSWindowStyleMask[NSViewClass€ €€k€|€~€px€h€g€}€i_{{93, 72}, {424, 279}}_NonBlockingPanelÒþÿYNS.string€jTViewÒ78£;_NSMutableStringXNSStringZ{inf, inf}Ò>F€x«$ÆaNྈ½g€5€`€ €@€m€€p€t€N€+€FÙdefghijÂk)Èpqkí€ €>€n€o € € _{{174, 117}, {230, 22}}ÚÒ…†‡‰ÓÂÔÕÖדàÛpíÝ€)€!€€€m €&Ødefghijk)()pqk€ €>€q€r € € _{{101, 119}, {68, 17}}ØÒ…†‡‰Ô‹Ö41“89€)€9€s€€p€€u€v € € _{{101, 89}, {68, 17}}ØÒ…†‡‰Ô‹Ö4B“89€)€9€w€€t€ƒ„€‘¯Ç:gàUkn)+Æa$máN˜½¾ˆ’Í€ €v€F€m€p€B€ €€r€7€-€`€ €o€t€5€H€f€@€€+€€N€W€bÒ23 €€]NSApplicationÒ78£J¢J;Ò>ƒ¦€‘¯¾kkkNáa$½kkàkkgkkkkˆÆ€€t€ € € €@€f€ €p€5€+€ € €m€ € €F€€ €€ € € €N€`Ò>ƒ€‘¯Ç:gàUkn)+Æa$máN˜½¾ˆ’Í€ €v€F€m€p€B€ €€r€7€-€`€ €€o€t€5€H€f€@€€+€€N€W€bÒ>ƒ߀‘¯àáâãäåæçèéêëìíîïðñòóôõö÷øù€•€–€—€˜€™€š€›€œ€€ž€Ÿ€ €¡€¢€£€¤€¥€¦€§€¨€©€ª€«€¬€­€®_Text Field Cell-1_Text Field Cell (Password:)_ƒStatic Text (Google Account (https://www.google.com/)'' Certified by: VeriSign Inc. Get more information by clicking ''Certificate)ZText Field_Static Text (Name:)_Button Cell (Cancel)\Content View_Button Cell (Log In)_Text Field Cell (Name:)_TText Field Cell (To view this page, you must log in to this area on www.server.com:)_3Button Cell (Remember this password in my keychain)_5Static Text (Your password will be sent unencrypted.)_Push Button (Log In)\File's Owner_Text Field Cell_Static Text (Password:)_PStatic Text (To view this page, you must log in to this area on www.server.com:)_‡Text Field Cell (Google Account (https://www.google.com/)'' Certified by: VeriSign Inc. Get more information by clicking ''Certificate)UPanel_Push Button (Cancel)[Application_1Check Box (Remember this password in my keychain)_Secure Text FieldZImage ViewZImage Cell_9Text Field Cell (Your password will be sent unencrypted.)Ò>ƒ€‘¡¾€Ò>ƒ€‘¡Ë€Ò>ƒ€‘¯-Ç:KgàRVUkYUZJnW)+PÆaNX$QmáMNI˜½LH¾ˆ’OSÍT€ €v€?€F€m€e€…€p€B€ €‹€ƒ€Œ€4€€‡€r€7€-€]€`€ €€M€o€t€‰€5€_€H€f€K€@€€€+€E€ €€N€W€[€€b€‚Ò>ƒN€‘¯-OPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{€³€´€µ€¶€·€¸€¹€º€»€¼€½€¾€¿€À€Á€Â€Ã€Ä€Å€Æ€Ç€È€É€Ê€Ë€Ì€Í€Î€Ï€Ð€Ñ€Ò€Ó€Ô€Õ€Ö€×€Ø€Ù€Ú€Û€Ü€Ý€Þ€ß†¯†±*†Ï"†­$#†Ê†¬†°†ª†Ç†Ù  †Ú&†® †Í†Ò( )ÿÿÿÿÿÿÿý'†Ó†³+†«†ÎÒ>F©€x Ò>ƒ¬€‘ Ò>ƒ¯€‘ Ò78±²¢²;^NSIBObjectData"'1:?DRTf17‚‰ž°ÌÚæò 5CVh‚Œ™›Ÿ¡£¥§©«­¯±³µ·¹¾ÀÉÕ×Ùòû#,?HSUV_fsy‚„­¯±³µ·¹»½¿ÁÃÅÇÉËÍÏÑÓäòû  ,>FMV`iuwy{}€ƒ…¢­¹»½¿ÂÄÆÈà!7L[n€‹•£µÂÐÕ×ÙÛÝßáãåçéî÷þ&(136CLQXikmoyz|…Ž›¨±¼ÅÏÖâéòù 13579f|‚„†ˆŠŒ’”–˜¬¸Ñú  " . 7 9 ; = ? A F G I ^ f s  ‘ “ • — ž ´ Á É Ë Í Ð Ù Þ ó õ ÷ ù û     ) ; D I X y { }  „ … ‡ ‰ ¢ × Ù Û Ý ß á ã å ç é î   + - / 8 A F \ h q x   ¢ ¤ ¦ ¨ Í Ï Ñ Ó Õ Ø Ù Û Ý ÷  ! # % ' ) + 0 2 w Œ Ž ’ ” ¡ ® ° ¼ Ñ Ó Õ × Ù ì õ      : < > @ B C E G _ ” – ˜ š œ ž   ¢ © « ¼ ¾ À Â Ä é ë í ï ñ ò ô ö5>@BDFHMOÇØÚãåöøúüþ IT`bdfgiknoqs|~‹‘“•—³Ïç<YqŽ–ž¦±¶¸½¾ÇÎÚãîú&79;=?Tegikm’”–˜š›Ÿ¹Þàâäæèê%'),=?ACEz‡ ­ÃÑÛéö&2468:<>CEGIKdw€ŠŒ‘š¡³¼ÇÐÒéëíïñóõ÷ùûýÿ$&(*,-/1Ktvxz|~¢¤¦¨ª«­¯Èéëíïñóõû "$%')Abdfhjlnxˆ—Ÿª³ºÓð(@QSUWYjlnprƒ…‡‰‹–§©«­¯¹ÊÌÎÐÒÚëíïñóù  #%')+4=?tvxz|~€‚„†ˆŠŒŽ’”–˜šœž ¢¤¦¯±³ÁÊÏØÚ!#%')+-/13579;=?AJLƒ…‡‰‹‘“•—™›Ÿ¡£¥§©«­¯±³µ·ÀÂùûýÿ   !#%')+-A_åð*A[²è 7DVpÃMSjvª¾ÉÔ )+.09;˜šœž ¢¤¦¨ª¬®°²´¶¸º¼¾ÀÂÄÆÈÊÌÎÐÒÔÖØÚÜÞàâäæèêìîðòûýZ\^`bdfhjlnprtvxz|~€‚„†ˆŠŒŽ’”–˜šœž ¢¤¦¨ª¬®°²´¹¾ÀÅÇÉËÐÒÔÖÛàâçìñöøúÿ  ').0249;=BGPRS\^_hjkty³ˆWebKit/mac/Panels/English.lproj/WebAuthenticationPanel.nib/designable.nib0000644000175000017500000014671411167425373025020 0ustar leelee 1050 9G55 670 949.34 353.00 YES YES com.apple.InterfaceBuilder.CocoaPlugin YES WebAuthenticationPanel FirstResponder NSApplication 1 2 {{93, 72}, {424, 279}} 1886912512 Log In NonBlockingPanel View 256 YES 266 {{101, 225}, {306, 34}} 1 YES 69336577 4194304 To view this page, you must log in to this area on www.server.com: LucidaGrande 1.300000e+01 1044 1 6 System controlColor 3 MC42NjY2NjY2OQA 6 System controlTextColor 3 MAA 290 {{101, 147}, {306, 20}} 2 YES 69336577 4194304 Your password will be sent unencrypted. LucidaGrande 1.100000e+01 3100 2 289 {{326, 12}, {84, 32}} YES 67239424 137887744 Log In -2038284033 1 Helvetica 1.300000e+01 16 DQ 200 25 289 {{242, 12}, {84, 32}} YES 67239424 137887744 Cancel -2038284033 1 Gw 200 25 290 {{174, 117}, {230, 22}} 3 YES -1804468671 4195328 3 YES 6 System textBackgroundColor 3 MQA 6 System textColor 290 {{174, 87}, {230, 22}} 4 YES -1804468671 4195328 4 YES 292 {{101, 119}, {68, 17}} YES 67239424 4194304 Name: 292 {{101, 89}, {68, 17}} YES 67239424 4194304 Password: 268 YES YES Apple PDF pasteboard type Apple PICT pasteboard type Apple PNG pasteboard type NSFilenamesPboardType NeXT Encapsulated PostScript v1.2 pasteboard type NeXT TIFF v4.0 pasteboard type {{20, 195}, {64, 64}} YES 130560 33554432 0 0 0 NO YES 292 {{102, 58}, {280, 18}} YES 67239424 0 Remember this password in my keychain 1211912703 2 NSSwitch 200 25 290 {{113, 175}, {282, 42}} 3 YES -2078147071 4194560 R29vZ2xlIEFjY291bnQgKGh0dHBzOi8vd3d3Lmdvb2dsZS5jb20vKScnIENlcnRpZmllZCBieTogVmVy aVNpZ24gSW5jLiBHZXQgbW9yZSBpbmZvcm1hdGlvbiBieSBjbGlja2luZyAnJ0NlcnRpZmljYXRlA LucidaGrande 1.100000e+01 16 3 {424, 279} {{0, 0}, {2560, 1578}} {3.40282e+38, 3.40282e+38} Authentication Panel YES initialFirstResponder 26 panel 27 username 28 password 29 logIn: 30 cancel: 31 mainLabel 34 smallLabel 35 nextKeyView 36 imageView 38 remember 40 nextKeyView 41 nextKeyView 42 nextKeyView 43 nextKeyView 100042 nextKeyView 100045 nextKeyView 100046 nextKeyView 100051 separateRealmLabel 100057 YES 0 YES -2 RmlsZSdzIE93bmVyA -1 First Responder -3 Application 5 YES Panel 6 YES 10 YES 11 YES 12 YES 13 YES 14 YES 15 YES 16 YES 17 YES 19 YES 39 YES 100010 100011 100012 100013 100014 100015 100016 100017 100019 100039 100047 YES 100050 YES YES -3.IBPluginDependency -3.ImportedFromIB2 10.IBPluginDependency 10.ImportedFromIB2 100010.IBPluginDependency 100011.IBPluginDependency 100012.IBPluginDependency 100013.IBPluginDependency 100014.IBPluginDependency 100015.IBPluginDependency 100016.IBPluginDependency 100017.IBPluginDependency 100019.IBPluginDependency 100039.IBPluginDependency 100047.IBPluginDependency 100047.ImportedFromIB2 100050.IBPluginDependency 11.IBPluginDependency 11.ImportedFromIB2 12.IBPluginDependency 12.ImportedFromIB2 13.IBPluginDependency 13.ImportedFromIB2 14.IBPluginDependency 14.ImportedFromIB2 15.CustomClassName 15.IBPluginDependency 15.ImportedFromIB2 16.IBPluginDependency 16.ImportedFromIB2 17.IBPluginDependency 17.ImportedFromIB2 19.IBPluginDependency 19.ImportedFromIB2 39.IBPluginDependency 39.ImportedFromIB2 5.IBEditorWindowLastContentRect 5.IBPluginDependency 5.IBViewEditorWindowController.showingLayoutRectangles 5.IBWindowTemplateEditedContentRect 5.ImportedFromIB2 5.windowTemplate.hasMaxSize 5.windowTemplate.hasMinSize 5.windowTemplate.maxSize 5.windowTemplate.minSize 6.IBPluginDependency 6.ImportedFromIB2 YES com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin NSSecureTextField com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{288, 709}, {424, 279}} com.apple.InterfaceBuilder.CocoaPlugin {{288, 709}, {424, 279}} {424, 282} {424, 282} com.apple.InterfaceBuilder.CocoaPlugin YES YES YES YES YES YES 100057 YES FirstResponder NSObject IBUserSource NSControl IBProjectSource mac/Misc/WebNSControlExtras.h NSControl NSView IBUserSource NSObject IBProjectSource mac/Misc/WebDownload.h NSObject IBProjectSource mac/Misc/WebIconDatabaseDelegate.h NSObject IBProjectSource mac/Misc/WebNSObjectExtras.h NSObject IBProjectSource mac/Plugins/WebJavaPlugIn.h NSObject IBProjectSource mac/Plugins/WebPlugin.h NSObject IBProjectSource mac/Plugins/WebPluginContainer.h NSObject IBProjectSource mac/Plugins/WebPluginContainerPrivate.h NSObject IBProjectSource mac/Plugins/WebPluginDatabase.h NSObject IBProjectSource mac/Plugins/WebPluginPrivate.h NSObject IBProjectSource mac/WebInspector/WebNodeHighlight.h NSObject IBProjectSource mac/WebView/WebEditingDelegate.h NSObject IBProjectSource mac/WebView/WebEditingDelegatePrivate.h NSObject IBProjectSource mac/WebView/WebFrameInternal.h NSObject IBProjectSource mac/WebView/WebFrameLoadDelegate.h NSObject IBProjectSource mac/WebView/WebPolicyDelegate.h NSObject IBProjectSource mac/WebView/WebPolicyDelegatePrivate.h NSObject IBProjectSource mac/WebView/WebResourceLoadDelegate.h NSObject IBProjectSource mac/WebView/WebResourceLoadDelegatePrivate.h NSObject IBProjectSource mac/WebView/WebScriptDebugDelegate.h NSObject YES YES webViewClose: webViewFocus: webViewRunModal: webViewShow: webViewUnfocus: YES WebView WebView WebView WebView WebView IBProjectSource mac/WebView/WebUIDelegate.h NSObject IBProjectSource mac/WebView/WebUIDelegatePrivate.h NSObject IBProjectSource mac/WebView/WebViewPrivate.h NSObject IBUserSource NSView IBProjectSource mac/Misc/WebNSViewExtras.h NSView NSResponder IBUserSource NSWindow IBProjectSource mac/Misc/WebNSWindowExtras.h NSWindow NSResponder IBUserSource NonBlockingPanel NSPanel IBProjectSource mac/Panels/WebAuthenticationPanel.h NonBlockingPanel NSPanel IBUserSource WebAuthenticationPanel NSObject YES YES cancel: logIn: YES id id YES YES callback imageView mainLabel panel password remember separateRealmLabel smallLabel username YES id id id id id id id id id WebView NSView YES YES alignCenter: alignJustified: alignLeft: alignRight: changeAttributes: changeColor: changeDocumentBackgroundColor: changeFont: checkSpelling: copy: copyFont: cut: delete: goBack: goForward: makeTextLarger: makeTextSmaller: makeTextStandardSize: moveToBeginningOfSentence: moveToBeginningOfSentenceAndModifySelection: moveToEndOfSentence: moveToEndOfSentenceAndModifySelection: paste: pasteAsPlainText: pasteAsRichText: pasteFont: performFindPanelAction: reload: reloadFromOrigin: selectSentence: showGuessPanel: startSpeaking: stopLoading: stopSpeaking: takeStringURLFrom: toggleContinuousSpellChecking: toggleSmartInsertDelete: YES id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id id IBProjectSource mac/WebView/WebView.h WebView YES YES _openFrameInNewWindowFromMenu: _searchWithGoogleFromMenu: _searchWithSpotlightFromMenu: YES NSMenuItem id id IBProjectSource mac/WebView/WebViewInternal.h WebView YES YES outdent: resetPageZoom: toggleGrammarChecking: zoomPageIn: zoomPageOut: YES id id id id id WebView NSView IBUserSource 0 ../../../WebKit.xcodeproj 3 WebKit/mac/Panels/WebPanelAuthenticationHandler.h0000644000175000017500000000404210360512352020362 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import @class NSURLAuthenticationChallenge; @interface WebPanelAuthenticationHandler : NSObject { NSMutableDictionary *windowToPanel; NSMutableDictionary *challengeToWindow; NSMutableDictionary *windowToChallengeQueue; } + (id)sharedHandler; - (void)startAuthentication:(NSURLAuthenticationChallenge *)challenge window:(NSWindow *)w; - (void)cancelAuthentication:(NSURLAuthenticationChallenge *)challenge; @end WebKit/mac/Panels/WebAuthenticationPanel.h0000644000175000017500000000511511167465035017101 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import @class NSURLAuthenticationChallenge; @interface WebAuthenticationPanel : NSObject { IBOutlet id mainLabel; IBOutlet id panel; IBOutlet id password; IBOutlet id smallLabel; IBOutlet id username; IBOutlet id imageView; IBOutlet id remember; IBOutlet NSTextField *separateRealmLabel; BOOL nibLoaded; BOOL usingSheet; id callback; SEL selector; NSURLAuthenticationChallenge *challenge; } -(id)initWithCallback:(id)cb selector:(SEL)sel; // Interface-related methods - (IBAction)cancel:(id)sender; - (IBAction)logIn:(id)sender; - (BOOL)loadNib; - (void)runAsModalDialogWithChallenge:(NSURLAuthenticationChallenge *)chall; - (void)runAsSheetOnWindow:(NSWindow *)window withChallenge:(NSURLAuthenticationChallenge *)chall; - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo; @end // This is in the header so it can be used from the nib file @interface NonBlockingPanel : NSPanel @end WebKit/mac/Panels/WebPanelAuthenticationHandler.m0000644000175000017500000001350311032666713020401 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import #import #import #import static NSString *WebModalDialogPretendWindow = @"WebModalDialogPretendWindow"; @implementation WebPanelAuthenticationHandler WebPanelAuthenticationHandler *sharedHandler; + (id)sharedHandler { if (sharedHandler == nil) sharedHandler = [[self alloc] init]; return sharedHandler; } -(id)init { self = [super init]; if (self != nil) { windowToPanel = [[NSMutableDictionary alloc] init]; challengeToWindow = [[NSMutableDictionary alloc] init]; windowToChallengeQueue = [[NSMutableDictionary alloc] init]; } return self; } -(void)dealloc { [windowToPanel release]; [challengeToWindow release]; [windowToChallengeQueue release]; [super dealloc]; } -(void)enqueueChallenge:(NSURLAuthenticationChallenge *)challenge forWindow:(id)window { NSMutableArray *queue = [windowToChallengeQueue objectForKey:window]; if (queue == nil) { queue = [[NSMutableArray alloc] init]; [windowToChallengeQueue _webkit_setObject:queue forUncopiedKey:window]; [queue release]; } [queue addObject:challenge]; } -(void)tryNextChallengeForWindow:(id)window { NSMutableArray *queue = [windowToChallengeQueue objectForKey:window]; if (queue == nil) { return; } NSURLAuthenticationChallenge *challenge = [[queue objectAtIndex:0] retain]; [queue removeObjectAtIndex:0]; if ([queue count] == 0) { [windowToChallengeQueue removeObjectForKey:window]; } NSURLCredential *latestCredential = [[NSURLCredentialStorage sharedCredentialStorage] defaultCredentialForProtectionSpace:[challenge protectionSpace]]; if ([latestCredential hasPassword]) { [[challenge sender] useCredential:latestCredential forAuthenticationChallenge:challenge]; [challenge release]; return; } [self startAuthentication:challenge window:(window == WebModalDialogPretendWindow ? nil : window)]; [challenge release]; } -(void)startAuthentication:(NSURLAuthenticationChallenge *)challenge window:(NSWindow *)w { id window = w ? (id)w : (id)WebModalDialogPretendWindow; if ([windowToPanel objectForKey:window] != nil) { [self enqueueChallenge:challenge forWindow:window]; return; } // In this case, we have an attached sheet that's not one of our // authentication panels, so enqueing is not an option. Just // cancel authentication instead, since this case is fairly // unlikely (how would you be loading a page if you had an error // sheet up?) if ([w attachedSheet] != nil) { [[challenge sender] cancelAuthenticationChallenge:challenge]; return; } WebAuthenticationPanel *panel = [[WebAuthenticationPanel alloc] initWithCallback:self selector:@selector(_authenticationDoneWithChallenge:result:)]; [challengeToWindow _webkit_setObject:window forUncopiedKey:challenge]; [windowToPanel _webkit_setObject:panel forUncopiedKey:window]; [panel release]; if (window == WebModalDialogPretendWindow) { [panel runAsModalDialogWithChallenge:challenge]; } else { [panel runAsSheetOnWindow:window withChallenge:challenge]; } } -(void)cancelAuthentication:(NSURLAuthenticationChallenge *)challenge { id window = [challengeToWindow objectForKey:challenge]; if (window != nil) { WebAuthenticationPanel *panel = [windowToPanel objectForKey:window]; [panel cancel:self]; } } -(void)_authenticationDoneWithChallenge:(NSURLAuthenticationChallenge *)challenge result:(NSURLCredential *)credential { id window = [challengeToWindow objectForKey:challenge]; [window retain]; if (window != nil) { [windowToPanel removeObjectForKey:window]; [challengeToWindow removeObjectForKey:challenge]; } if (credential == nil) { [[challenge sender] cancelAuthenticationChallenge:challenge]; } else { [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge]; } [self tryNextChallengeForWindow:window]; [window release]; } @end WebKit/mac/Panels/WebAuthenticationPanel.m0000644000175000017500000002703511167425373017114 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import #import #import #import #import #import #import #import #define WebAuthenticationPanelNibName @"WebAuthenticationPanel" @implementation WebAuthenticationPanel -(id)initWithCallback:(id)cb selector:(SEL)sel { self = [self init]; if (self != nil) { callback = [cb retain]; selector = sel; } return self; } - (void)dealloc { [panel release]; [callback release]; [super dealloc]; } // IB actions - (IBAction)cancel:(id)sender { // This is required because the body of this method is going to // remove all of the panel's remaining refs, which can cause a // crash later when finishing button hit tracking. So we make // sure it lives on a bit longer. [[panel retain] autorelease]; // This is required as a workaround for AppKit issue 4118422 [[self retain] autorelease]; [panel close]; if (usingSheet) { [[NSApplication sharedApplication] endSheet:panel returnCode:1]; } else { [[NSApplication sharedApplication] stopModalWithCode:1]; } } - (IBAction)logIn:(id)sender { // This is required because the body of this method is going to // remove all of the panel's remaining refs, which can cause a // crash later when finishing button hit tracking. So we make // sure it lives on a bit longer. [[panel retain] autorelease]; [panel close]; if (usingSheet) { [[NSApplication sharedApplication] endSheet:panel returnCode:0]; } else { [[NSApplication sharedApplication] stopModalWithCode:0]; } } - (BOOL)loadNib { if (!nibLoaded) { if ([NSBundle loadNibNamed:WebAuthenticationPanelNibName owner:self]) { nibLoaded = YES; [imageView setImage:[NSImage imageNamed:@"NSApplicationIcon"]]; } else { LOG_ERROR("couldn't load nib named '%@'", WebAuthenticationPanelNibName); return FALSE; } } return TRUE; } // Methods related to displaying the panel -(void)setUpForChallenge:(NSURLAuthenticationChallenge *)chall { [self loadNib]; NSURLProtectionSpace *space = [chall protectionSpace]; NSString *host; if ([space port] == 0) { host = [[space host] _web_decodeHostName]; } else { host = [NSString stringWithFormat:@"%@:%u", [[space host] _web_decodeHostName], [space port]]; } NSString *realm = [space realm]; NSString *message; // Consider the realm name to be "simple" if it does not contain any whitespace or newline characters. // If the realm name is determined to be complex, we will use a slightly different sheet layout, designed // to keep a malicious realm name from spoofing the wording in the sheet text. BOOL realmNameIsSimple = [realm rangeOfCharacterFromSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]].location == NSNotFound; if ([chall previousFailureCount] == 0) { if ([space isProxy]) { message = [NSString stringWithFormat:UI_STRING("To view this page, you must log in to the %@ proxy server %@.", "prompt string in authentication panel"), [space proxyType], host]; } else { if (realmNameIsSimple) message = [NSString stringWithFormat:UI_STRING("To view this page, you must log in to area “%@†on %@.", "prompt string in authentication panel"), realm, host]; else message = [NSString stringWithFormat:UI_STRING("To view this page, you must log in to this area on %@:", "prompt string in authentication panel"), host]; } } else { if ([space isProxy]) { message = [NSString stringWithFormat:UI_STRING("The user name or password you entered for the %@ proxy server %@ was incorrect. Make sure you’re entering them correctly, and then try again.", "prompt string in authentication panel"), [space proxyType], host]; } else { if (realmNameIsSimple) message = [NSString stringWithFormat:UI_STRING("The user name or password you entered for area “%@†on %@ was incorrect. Make sure you’re entering them correctly, and then try again.", "prompt string in authentication panel"), realm, host]; else message = [NSString stringWithFormat:UI_STRING("The user name or password you entered for this area on %@ was incorrect. Make sure you’re entering them correctly, and then try again.", "prompt string in authentication panel"), host]; } } if (![space isProxy] && !realmNameIsSimple) { [separateRealmLabel setHidden:NO]; [separateRealmLabel setStringValue:realm]; [separateRealmLabel setAutoresizingMask:NSViewMinYMargin]; [separateRealmLabel sizeToFitAndAdjustWindowHeight]; [separateRealmLabel setAutoresizingMask:NSViewMaxYMargin]; } else { // In the proxy or "simple" realm name case, we need to hide the 'separateRealmLabel' // and move the rest of the contents up appropriately to fill the space. NSRect mainLabelFrame = [mainLabel frame]; NSRect realmFrame = [separateRealmLabel frame]; NSRect smallLabelFrame = [smallLabel frame]; // Find the distance between the 'smallLabel' and the label above it, initially the 'separateRealmLabel'. // Then, find the current distance between 'smallLabel' and 'mainLabel'. The difference between // these two is how much shorter the panel needs to be after hiding the 'separateRealmLabel'. CGFloat smallLabelMargin = NSMinY(realmFrame) - NSMaxY(smallLabelFrame); CGFloat smallLabelToMainLabel = NSMinY(mainLabelFrame) - NSMaxY(smallLabelFrame); CGFloat deltaMargin = smallLabelToMainLabel - smallLabelMargin; [separateRealmLabel setHidden:YES]; NSRect windowFrame = [panel frame]; windowFrame.size.height -= deltaMargin; [panel setFrame:windowFrame display:NO]; } [mainLabel setStringValue:message]; [mainLabel sizeToFitAndAdjustWindowHeight]; if ([space receivesCredentialSecurely] || [[space protocol] _webkit_isCaseInsensitiveEqualToString:@"https"]) { [smallLabel setStringValue: UI_STRING("Your login information will be sent securely.", "message in authentication panel")]; } else { // Use this scary-sounding phrase only when using basic auth with non-https servers. In this case the password // could be sniffed by intercepting the network traffic. [smallLabel setStringValue: UI_STRING("Your password will be sent unencrypted.", "message in authentication panel")]; } if ([[chall proposedCredential] user] != nil) { [username setStringValue:[[chall proposedCredential] user]]; [panel setInitialFirstResponder:password]; } else { [username setStringValue:@""]; [password setStringValue:@""]; [panel setInitialFirstResponder:username]; } } - (void)runAsModalDialogWithChallenge:(NSURLAuthenticationChallenge *)chall { [self setUpForChallenge:chall]; usingSheet = FALSE; NSURLCredential *credential = nil; if ([[NSApplication sharedApplication] runModalForWindow:panel] == 0) { credential = [[NSURLCredential alloc] initWithUser:[username stringValue] password:[password stringValue] persistence:([remember state] == NSOnState) ? NSURLCredentialPersistencePermanent : NSURLCredentialPersistenceForSession]; } [callback performSelector:selector withObject:chall withObject:credential]; [credential release]; } - (void)runAsSheetOnWindow:(NSWindow *)window withChallenge:(NSURLAuthenticationChallenge *)chall { ASSERT(!usingSheet); [self setUpForChallenge:chall]; usingSheet = TRUE; challenge = [chall retain]; [[NSApplication sharedApplication] beginSheet:panel modalForWindow:window modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:NULL]; } - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { NSURLCredential *credential = nil; NSURLAuthenticationChallenge *chall; ASSERT(usingSheet); ASSERT(challenge != nil); if (returnCode == 0) { credential = [[NSURLCredential alloc] initWithUser:[username stringValue] password:[password stringValue] persistence:([remember state] == NSOnState) ? NSURLCredentialPersistencePermanent : NSURLCredentialPersistenceForSession]; } // We take this tricky approach to nilling out and releasing the challenge // because the callback below might remove our last ref. chall = challenge; challenge = nil; [callback performSelector:selector withObject:chall withObject:credential]; [credential release]; [chall release]; } @end @implementation NonBlockingPanel - (BOOL)_blocksActionWhenModal:(SEL)theAction { // This override of a private AppKit method allows the user to quit when a login dialog // is onscreen, which is nice in general but in particular prevents pathological cases // like 3744583 from requiring a Force Quit. // // It would be nice to allow closing the individual window as well as quitting the app when // a login sheet is up, but this _blocksActionWhenModal: mechanism doesn't support that. // This override matches those in NSOpenPanel and NSToolbarConfigPanel. if (theAction == @selector(terminate:)) { return NO; } return YES; } @end WebKit/mac/Misc/0000755000175000017500000000000011527024250011770 5ustar leeleeWebKit/mac/Misc/WebDownload.mm0000644000175000017500000002200511253521012014521 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import #import #import #import #import #import #import #import #import "WebTypesInternal.h" using namespace WebCore; @class NSURLConnectionDelegateProxy; // FIXME: The following are NSURLDownload SPI - it would be nice to not have to override them at // some point in the future @interface NSURLDownload (WebDownloadCapability) - (id)_initWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response delegate:(id)delegate proxy:(NSURLConnectionDelegateProxy *)proxy; - (id)_initWithRequest:(NSURLRequest *)request delegate:(id)delegate directory:(NSString *)directory; @end @interface WebDownloadInternal : NSObject { @public id realDelegate; } - (void)setRealDelegate:(id)rd; @end @implementation WebDownloadInternal - (void)dealloc { [realDelegate release]; [super dealloc]; } - (void)setRealDelegate:(id)rd { [rd retain]; [realDelegate release]; realDelegate = rd; } - (BOOL)respondsToSelector:(SEL)selector { if (selector == @selector(downloadDidBegin:) || selector == @selector(download:willSendRequest:redirectResponse:) || selector == @selector(download:didReceiveResponse:) || selector == @selector(download:didReceiveDataOfLength:) || selector == @selector(download:shouldDecodeSourceDataOfMIMEType:) || selector == @selector(download:decideDestinationWithSuggestedFilename:) || selector == @selector(download:didCreateDestination:) || selector == @selector(downloadDidFinish:) || selector == @selector(download:didFailWithError:) || selector == @selector(download:shouldBeginChildDownloadOfSource:delegate:) || selector == @selector(download:didBeginChildDownload:)) { return [realDelegate respondsToSelector:selector]; } return [super respondsToSelector:selector]; } - (void)downloadDidBegin:(NSURLDownload *)download { [realDelegate downloadDidBegin:download]; } - (NSURLRequest *)download:(NSURLDownload *)download willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse { return [realDelegate download:download willSendRequest:request redirectResponse:redirectResponse]; } - (void)download:(NSURLDownload *)download didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { // Try previously stored credential first. if (![challenge previousFailureCount]) { NSURLCredential *credential = mac(CredentialStorage::get(core([challenge protectionSpace]))); if (credential) { [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge]; return; } } if ([realDelegate respondsToSelector:@selector(download:didReceiveAuthenticationChallenge:)]) { [realDelegate download:download didReceiveAuthenticationChallenge:challenge]; } else { NSWindow *window = nil; if ([realDelegate respondsToSelector:@selector(downloadWindowForAuthenticationSheet:)]) { window = [realDelegate downloadWindowForAuthenticationSheet:(WebDownload *)download]; } [[WebPanelAuthenticationHandler sharedHandler] startAuthentication:challenge window:window]; } } - (void)download:(NSURLDownload *)download didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { if ([realDelegate respondsToSelector:@selector(download:didCancelAuthenticationChallenge:)]) { [realDelegate download:download didCancelAuthenticationChallenge:challenge]; } else { [[WebPanelAuthenticationHandler sharedHandler] cancelAuthentication:challenge]; } } - (void)download:(NSURLDownload *)download didReceiveResponse:(NSURLResponse *)response { [realDelegate download:download didReceiveResponse:response]; } - (void)download:(NSURLDownload *)download didReceiveDataOfLength:(NSUInteger)length { [realDelegate download:download didReceiveDataOfLength:length]; } - (BOOL)download:(NSURLDownload *)download shouldDecodeSourceDataOfMIMEType:(NSString *)encodingType { return [realDelegate download:download shouldDecodeSourceDataOfMIMEType:encodingType]; } - (void)download:(NSURLDownload *)download decideDestinationWithSuggestedFilename:(NSString *)filename { [realDelegate download:download decideDestinationWithSuggestedFilename:filename]; } - (void)download:(NSURLDownload *)download didCreateDestination:(NSString *)path { [realDelegate download:download didCreateDestination:path]; } - (void)downloadDidFinish:(NSURLDownload *)download { [realDelegate downloadDidFinish:download]; } - (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error { [realDelegate download:download didFailWithError:error]; } - (NSURLRequest *)download:(NSURLDownload *)download shouldBeginChildDownloadOfSource:(NSURLRequest *)child delegate:(id *)childDelegate { return [realDelegate download:download shouldBeginChildDownloadOfSource:child delegate:childDelegate]; } - (void)download:(NSURLDownload *)parent didBeginChildDownload:(NSURLDownload *)child { [realDelegate download:parent didBeginChildDownload:child]; } @end @implementation WebDownload - (void)_setRealDelegate:(id)delegate { if (_webInternal == nil) { _webInternal = [[WebDownloadInternal alloc] init]; [_webInternal setRealDelegate:delegate]; } else { ASSERT(_webInternal == delegate); } } - (id)init { self = [super init]; if (self != nil) { // _webInternal can be set up before init by _setRealDelegate if (_webInternal == nil) { _webInternal = [[WebDownloadInternal alloc] init]; } } return self; } - (void)dealloc { [_webInternal release]; [super dealloc]; } - (id)initWithRequest:(NSURLRequest *)request delegate:(id)delegate { [self _setRealDelegate:delegate]; return [super initWithRequest:request delegate:_webInternal]; } - (id)_initWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response delegate:(id)delegate proxy:(NSURLConnectionDelegateProxy *)proxy { [self _setRealDelegate:delegate]; return [super _initWithLoadingConnection:connection request:request response:response delegate:_webInternal proxy:proxy]; } - (id)_initWithRequest:(NSURLRequest *)request delegate:(id)delegate directory:(NSString *)directory { [self _setRealDelegate:delegate]; return [super _initWithRequest:request delegate:_webInternal directory:directory]; } - (void)connection:(NSURLConnection *)connection willStopBufferingData:(NSData *)data { // NSURLConnection calls this method even if it is not implemented. // This happens because NSURLConnection caches the results of respondsToSelector. // Those results become invalid when the delegate of NSURLConnectionDelegateProxy is changed. // This is a workaround since this problem needs to be fixed in NSURLConnectionDelegateProxy. // NSURLConnection calls unimplemented delegate method in WebDownload } @end WebKit/mac/Misc/WebCache.mm0000644000175000017500000001170511171164654014000 0ustar leelee/* * Copyright (C) 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 "WebCache.h" #import "WebPreferences.h" #import "WebSystemInterface.h" #import "WebView.h" #import "WebViewInternal.h" #import #import #import @implementation WebCache + (void)initialize { InitWebCoreSystemInterface(); } + (NSArray *)statistics { WebCore::Cache::Statistics s = WebCore::cache()->getStatistics(); return [NSArray arrayWithObjects: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:s.images.count], @"Images", [NSNumber numberWithInt:s.cssStyleSheets.count], @"CSS", #if ENABLE(XSLT) [NSNumber numberWithInt:s.xslStyleSheets.count], @"XSL", #else [NSNumber numberWithInt:0], @"XSL", #endif [NSNumber numberWithInt:s.scripts.count], @"JavaScript", nil], [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:s.images.size], @"Images", [NSNumber numberWithInt:s.cssStyleSheets.size] ,@"CSS", #if ENABLE(XSLT) [NSNumber numberWithInt:s.xslStyleSheets.size], @"XSL", #else [NSNumber numberWithInt:0], @"XSL", #endif [NSNumber numberWithInt:s.scripts.size], @"JavaScript", nil], [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:s.images.liveSize], @"Images", [NSNumber numberWithInt:s.cssStyleSheets.liveSize] ,@"CSS", #if ENABLE(XSLT) [NSNumber numberWithInt:s.xslStyleSheets.liveSize], @"XSL", #else [NSNumber numberWithInt:0], @"XSL", #endif [NSNumber numberWithInt:s.scripts.liveSize], @"JavaScript", nil], [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:s.images.decodedSize], @"Images", [NSNumber numberWithInt:s.cssStyleSheets.decodedSize] ,@"CSS", #if ENABLE(XSLT) [NSNumber numberWithInt:s.xslStyleSheets.decodedSize], @"XSL", #else [NSNumber numberWithInt:0], @"XSL", #endif [NSNumber numberWithInt:s.scripts.decodedSize], @"JavaScript", nil], [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:s.images.purgeableSize], @"Images", [NSNumber numberWithInt:s.cssStyleSheets.purgeableSize] ,@"CSS", #if ENABLE(XSLT) [NSNumber numberWithInt:s.xslStyleSheets.purgeableSize], @"XSL", #else [NSNumber numberWithInt:0], @"XSL", #endif [NSNumber numberWithInt:s.scripts.purgeableSize], @"JavaScript", nil], [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:s.images.purgedSize], @"Images", [NSNumber numberWithInt:s.cssStyleSheets.purgedSize] ,@"CSS", #if ENABLE(XSLT) [NSNumber numberWithInt:s.xslStyleSheets.purgedSize], @"XSL", #else [NSNumber numberWithInt:0], @"XSL", #endif [NSNumber numberWithInt:s.scripts.purgedSize], @"JavaScript", nil], nil]; } + (void)empty { // Toggling the cache model like this forces the cache to evict all its in-memory resources. WebCacheModel cacheModel = [WebView _cacheModel]; [WebView _setCacheModel:WebCacheModelDocumentViewer]; [WebView _setCacheModel:cacheModel]; // Empty the application cache. WebCore::cacheStorage().empty(); // Empty the Cross-Origin Preflight cache WebCore::CrossOriginPreflightResultCache::shared().empty(); } + (void)setDisabled:(BOOL)disabled { WebCore::cache()->setDisabled(disabled); } + (BOOL)isDisabled { return WebCore::cache()->disabled(); } @end WebKit/mac/Misc/WebCache.h0000644000175000017500000000273610711720573013617 0ustar leelee/* * Copyright (C) 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. */ @interface WebCache : NSObject { } + (NSArray *)statistics; + (void)empty; + (void)setDisabled:(BOOL)disabled; + (BOOL)isDisabled; @end WebKit/mac/Misc/WebNSDictionaryExtras.h0000644000175000017500000000455311140440064016337 0ustar leelee/* * Copyright (C) 2005, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @interface NSDictionary (WebNSDictionaryExtras) - (BOOL)_webkit_boolForKey:(id)key; - (int)_webkit_intForKey:(id)key; - (NSString *)_webkit_stringForKey:(id)key; // Returns nil if the value is not an NSString. - (NSArray *)_webkit_arrayForKey:(id)key; // Returns nil if the value is not an NSArray. // Searches for the full MIME type, then the prefix (e.g., "text/" for "text/html") - (id)_webkit_objectForMIMEType:(NSString *)MIMEType; @end @interface NSMutableDictionary (WebNSDictionaryExtras) - (void)_webkit_setObject:(id)object forUncopiedKey:(id)key; - (void)_webkit_setInt:(int)value forKey:(id)key; - (void)_webkit_setFloat:(float)value forKey:(id)key; - (void)_webkit_setBool:(BOOL)value forKey:(id)key; - (void)_webkit_setUnsignedLongLong:(unsigned long long)value forKey:(id)key; @end WebKit/mac/Misc/WebNSObjectExtras.h0000644000175000017500000000442311135727360015447 0ustar leelee/* * Copyright (C) 2005, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import #import // Use WebCFAutorelease to return an object made by a CoreFoundation // "create" or "copy" function as an autoreleased and garbage collected // object. CF objects need to be "made collectable" for autorelease to work // properly under GC. static inline id WebCFAutorelease(CFTypeRef obj) { if (obj) CFMakeCollectable(obj); [(id)obj autorelease]; return (id)obj; } #if !(defined(OBJC_API_VERSION) && OBJC_API_VERSION > 0) static inline IMP method_setImplementation(Method m, IMP i) { IMP oi = m->method_imp; m->method_imp = i; return oi; } #endif @interface NSObject (WebNSObjectExtras) - (id)_webkit_invokeOnMainThread; @end WebKit/mac/Misc/WebNSPasteboardExtras.mm0000644000175000017500000002532711234707432016513 0ustar leelee/* * Copyright (C) 2005, 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNSPasteboardExtras.h" #import "DOMElementInternal.h" #import "WebArchive.h" #import "WebFrameInternal.h" #import "WebHTMLViewInternal.h" #import "WebNSURLExtras.h" #import "WebResourcePrivate.h" #import "WebURLsWithTitles.h" #import "WebViewPrivate.h" #import #import #import #import #import #import #import #import #import @interface NSFilePromiseDragSource : NSObject - initWithSource:(id)draggingSource; - (void)setTypes:(NSArray *)types onPasteboard:(NSPasteboard *)pboard; @end using namespace WebCore; NSString *WebURLPboardType = @"public.url"; NSString *WebURLNamePboardType = @"public.url-name"; @implementation NSPasteboard (WebExtras) + (NSArray *)_web_writableTypesForURL { DEFINE_STATIC_LOCAL(RetainPtr, types, ([[NSArray alloc] initWithObjects: WebURLsWithTitlesPboardType, NSURLPboardType, WebURLPboardType, WebURLNamePboardType, NSStringPboardType, nil])); return types.get(); } static inline NSArray *_createWritableTypesForImageWithoutArchive() { NSMutableArray *types = [[NSMutableArray alloc] initWithObjects:NSTIFFPboardType, nil]; [types addObjectsFromArray:[NSPasteboard _web_writableTypesForURL]]; return types; } static NSArray *_writableTypesForImageWithoutArchive (void) { DEFINE_STATIC_LOCAL(RetainPtr, types, (_createWritableTypesForImageWithoutArchive())); return types.get(); } static inline NSArray *_createWritableTypesForImageWithArchive() { NSMutableArray *types = [_writableTypesForImageWithoutArchive() mutableCopy]; [types addObject:NSRTFDPboardType]; [types addObject:WebArchivePboardType]; return types; } static NSArray *_writableTypesForImageWithArchive (void) { DEFINE_STATIC_LOCAL(RetainPtr, types, (_createWritableTypesForImageWithArchive())); return types.get(); } + (NSArray *)_web_writableTypesForImageIncludingArchive:(BOOL)hasArchive { return hasArchive ? _writableTypesForImageWithArchive() : _writableTypesForImageWithoutArchive(); } + (NSArray *)_web_dragTypesForURL { return [NSArray arrayWithObjects: WebURLsWithTitlesPboardType, NSURLPboardType, WebURLPboardType, WebURLNamePboardType, NSStringPboardType, NSFilenamesPboardType, nil]; } - (NSURL *)_web_bestURL { NSArray *types = [self types]; if ([types containsObject:NSURLPboardType]) { NSURL *URLFromPasteboard = [NSURL URLFromPasteboard:self]; NSString *scheme = [URLFromPasteboard scheme]; if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]) { return [URLFromPasteboard _webkit_canonicalize]; } } if ([types containsObject:NSStringPboardType]) { NSString *URLString = [self stringForType:NSStringPboardType]; if ([URLString _webkit_looksLikeAbsoluteURL]) { NSURL *URL = [[NSURL _web_URLWithUserTypedString:URLString] _webkit_canonicalize]; if (URL) { return URL; } } } if ([types containsObject:NSFilenamesPboardType]) { NSArray *files = [self propertyListForType:NSFilenamesPboardType]; if ([files count] == 1) { NSString *file = [files objectAtIndex:0]; BOOL isDirectory; if([[NSFileManager defaultManager] fileExistsAtPath:file isDirectory:&isDirectory] && !isDirectory){ return [[NSURL fileURLWithPath:file] _webkit_canonicalize]; } } } return nil; } - (void)_web_writeURL:(NSURL *)URL andTitle:(NSString *)title types:(NSArray *)types { ASSERT(URL); if ([title length] == 0) { title = [[URL path] lastPathComponent]; if ([title length] == 0) title = [URL _web_userVisibleString]; } if ([types containsObject:NSURLPboardType]) [URL writeToPasteboard:self]; if ([types containsObject:WebURLPboardType]) [self setString:[URL _web_originalDataAsString] forType:WebURLPboardType]; if ([types containsObject:WebURLNamePboardType]) [self setString:title forType:WebURLNamePboardType]; if ([types containsObject:NSStringPboardType]) [self setString:[URL _web_userVisibleString] forType:NSStringPboardType]; if ([types containsObject:WebURLsWithTitlesPboardType]) [WebURLsWithTitles writeURLs:[NSArray arrayWithObject:URL] andTitles:[NSArray arrayWithObject:title] toPasteboard:self]; } + (int)_web_setFindPasteboardString:(NSString *)string withOwner:(id)owner { NSPasteboard *findPasteboard = [NSPasteboard pasteboardWithName:NSFindPboard]; [findPasteboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:owner]; [findPasteboard setString:string forType:NSStringPboardType]; return [findPasteboard changeCount]; } - (void)_web_writeFileWrapperAsRTFDAttachment:(NSFileWrapper *)wrapper { NSTextAttachment *attachment = [[NSTextAttachment alloc] initWithFileWrapper:wrapper]; NSAttributedString *string = [NSAttributedString attributedStringWithAttachment:attachment]; [attachment release]; NSData *RTFDData = [string RTFDFromRange:NSMakeRange(0, [string length]) documentAttributes:nil]; [self setData:RTFDData forType:NSRTFDPboardType]; } - (void)_web_writePromisedRTFDFromArchive:(WebArchive*)archive containsImage:(BOOL)containsImage { ASSERT(archive); // This image data is either the only subresource of an archive (HTML image case) // or the main resource (standalone image case). NSArray *subresources = [archive subresources]; WebResource *resource = [archive mainResource]; if (containsImage && [subresources count] > 0 && MIMETypeRegistry::isSupportedImageResourceMIMEType([[subresources objectAtIndex:0] MIMEType])) resource = (WebResource *)[subresources objectAtIndex:0]; ASSERT(resource != nil); ASSERT(!containsImage || MIMETypeRegistry::isSupportedImageResourceMIMEType([resource MIMEType])); if (!containsImage || MIMETypeRegistry::isSupportedImageResourceMIMEType([resource MIMEType])) [self _web_writeFileWrapperAsRTFDAttachment:[resource _fileWrapperRepresentation]]; } static CachedImage* imageFromElement(DOMElement *domElement) { Element* element = core(domElement); if (!element) return 0; RenderObject* renderer = element->renderer(); RenderImage* imageRenderer = toRenderImage(renderer); if (!imageRenderer->cachedImage() || imageRenderer->cachedImage()->errorOccurred()) return 0; return imageRenderer->cachedImage(); } - (void)_web_writeImage:(NSImage *)image element:(DOMElement *)element URL:(NSURL *)URL title:(NSString *)title archive:(WebArchive *)archive types:(NSArray *)types source:(WebHTMLView *)source { ASSERT(image || element); ASSERT(URL); [self _web_writeURL:URL andTitle:title types:types]; if ([types containsObject:NSTIFFPboardType]) { if (image) [self setData:[image TIFFRepresentation] forType:NSTIFFPboardType]; else if (source && element) [source setPromisedDragTIFFDataSource:imageFromElement(element)]; else if (element) [self setData:[element _imageTIFFRepresentation] forType:NSTIFFPboardType]; } if (archive) if ([types containsObject:WebArchivePboardType]) [self setData:[archive data] forType:WebArchivePboardType]; else { // We should not have declared types that we aren't going to write (4031826). ASSERT(![types containsObject:NSRTFDPboardType]); ASSERT(![types containsObject:WebArchivePboardType]); } } - (id)_web_declareAndWriteDragImageForElement:(DOMElement *)element URL:(NSURL *)URL title:(NSString *)title archive:(WebArchive *)archive source:(WebHTMLView *)source { ASSERT(self == [NSPasteboard pasteboardWithName:NSDragPboard]); NSString *extension = @""; if (RenderObject* renderer = core(element)->renderer()) { if (renderer->isImage()) { if (CachedImage* image = toRenderImage(renderer)->cachedImage()) { extension = image->image()->filenameExtension(); if (![extension length]) return 0; } } } NSMutableArray *types = [[NSMutableArray alloc] initWithObjects:NSFilesPromisePboardType, nil]; [types addObjectsFromArray:[NSPasteboard _web_writableTypesForImageIncludingArchive:(archive != nil)]]; [self declareTypes:types owner:source]; [self _web_writeImage:nil element:element URL:URL title:title archive:archive types:types source:source]; [types release]; NSArray *extensions = [[NSArray alloc] initWithObjects:extension, nil]; [self setPropertyList:extensions forType:NSFilesPromisePboardType]; [extensions release]; return source; } @end WebKit/mac/Misc/WebKitStatistics.h0000644000175000017500000000340610360512352015403 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @interface WebKitStatistics : NSObject + (int)webViewCount; + (int)frameCount; + (int)dataSourceCount; + (int)viewCount; + (int)HTMLRepresentationCount; + (int)bridgeCount; @end WebKit/mac/Misc/WebNSDictionaryExtras.m0000644000175000017500000000734011140440064016341 0ustar leelee/* * Copyright (C) 2005, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import @implementation NSDictionary (WebNSDictionaryExtras) -(NSNumber *)_webkit_numberForKey:(id)key { id object = [self objectForKey:key]; return [object isKindOfClass:[NSNumber class]] ? object : nil; } -(int)_webkit_intForKey:(NSString *)key { NSNumber *number = [self _webkit_numberForKey:key]; return number == nil ? 0 : [number intValue]; } -(NSString *)_webkit_stringForKey:(id)key { id object = [self objectForKey:key]; return [object isKindOfClass:[NSString class]] ? object : nil; } -(NSArray *)_webkit_arrayForKey:(id)key { id object = [self objectForKey:key]; return [object isKindOfClass:[NSArray class]] ? object : nil; } -(id)_webkit_objectForMIMEType:(NSString *)MIMEType { id result; NSRange slashRange; result = [self objectForKey:MIMEType]; if (result) { return result; } slashRange = [MIMEType rangeOfString:@"/"]; if (slashRange.location == NSNotFound) { return nil; } return [self objectForKey:[MIMEType substringToIndex:slashRange.location + 1]]; } - (BOOL)_webkit_boolForKey:(id)key { NSNumber *number = [self _webkit_numberForKey:key]; return number && [number boolValue]; } @end @implementation NSMutableDictionary (WebNSDictionaryExtras) -(void)_webkit_setObject:(id)object forUncopiedKey:(id)key { CFDictionarySetValue((CFMutableDictionaryRef)self, key, object); } -(void)_webkit_setInt:(int)value forKey:(id)key { NSNumber *object = [[NSNumber alloc] initWithInt:value]; [self setObject:object forKey:key]; [object release]; } -(void)_webkit_setFloat:(float)value forKey:(id)key { NSNumber *object = [[NSNumber alloc] initWithFloat:value]; [self setObject:object forKey:key]; [object release]; } -(void)_webkit_setBool:(BOOL)value forKey:(id)key { NSNumber *object = [[NSNumber alloc] initWithBool:value]; [self setObject:object forKey:key]; [object release]; } - (void)_webkit_setUnsignedLongLong:(unsigned long long)value forKey:(id)key { NSNumber *object = [[NSNumber alloc] initWithUnsignedLongLong:value]; [self setObject:object forKey:key]; [object release]; } @end WebKit/mac/Misc/WebNSURLRequestExtras.h0000644000175000017500000000372510452515431016253 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @interface NSURLRequest (WebNSURLRequestExtras) - (NSString *)_web_HTTPReferrer; - (NSString *)_web_HTTPContentType; - (BOOL)_web_isConditionalRequest; @end @interface NSMutableURLRequest (WebNSURLRequestExtras) - (void)_web_setHTTPContentType:(NSString *)contentType; - (void)_web_setHTTPReferrer:(NSString *)theReferrer; - (void)_web_setHTTPUserAgent:(NSString *)theUserAgent; @end WebKit/mac/Misc/WebStringTruncator.h0000644000175000017500000000403510360512352015750 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @class NSFont; @interface WebStringTruncator : NSObject + (NSString *)centerTruncateString:(NSString *)string toWidth:(float)maxWidth withFont:(NSFont *)font; // Default font is [NSFont menuFontOfSize:0]. + (NSString *)centerTruncateString:(NSString *)string toWidth:(float)maxWidth; + (NSString *)rightTruncateString:(NSString *)string toWidth:(float)maxWidth withFont:(NSFont *)font; + (float)widthOfString:(NSString *)string font:(NSFont *)font; @end WebKit/mac/Misc/WebKitStatistics.m0000644000175000017500000000421210766122014015406 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebKitStatistics.h" #import "WebKitStatisticsPrivate.h" int WebViewCount; int WebDataSourceCount; int WebFrameCount; int WebHTMLRepresentationCount; int WebFrameViewCount; @implementation WebKitStatistics + (int)webViewCount { return WebViewCount; } + (int)frameCount { return WebFrameCount; } + (int)dataSourceCount { return WebDataSourceCount; } + (int)viewCount { return WebFrameViewCount; } + (int)bridgeCount { // No such thing as a bridge any more. Just return 0. return 0; } + (int)HTMLRepresentationCount { return WebHTMLRepresentationCount; } @end WebKit/mac/Misc/WebDownload.h0000644000175000017500000000500610432542134014347 0ustar leelee/* * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @class WebDownloadInternal; /*! @class WebDownload @discussion A WebDownload works just like an NSURLDownload, with one extra feature: if you do not implement the authentication-related delegate methods, it will automatically prompt for authentication using the standard WebKit authentication panel, as either a sheet or window. It provides no extra methods, but does have one additional delegate method. */ @interface WebDownload : NSURLDownload { @private WebDownloadInternal *_webInternal; } @end /*! @protocol WebDownloadDelegate @discussion The WebDownloadDelegate delegate has one extra method used to choose the right window when automatically prompting with a sheet. */ @interface NSObject (WebDownloadDelegate) /*! @method downloadWindowForAuthenticationSheet: @abstract @param @result */ - (NSWindow *)downloadWindowForAuthenticationSheet:(WebDownload *)download; @end WebKit/mac/Misc/WebNSAttributedStringExtras.mm0000644000175000017500000001573211234707432017724 0ustar leelee/* * Copyright (C) 2005, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNSAttributedStringExtras.h" #import "DOMRangeInternal.h" #import "WebDataSourcePrivate.h" #import "WebFrame.h" #import "WebFrameInternal.h" #import "WebTypesInternal.h" #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import using namespace WebCore; using namespace HTMLNames; struct ListItemInfo { unsigned start; unsigned end; }; static NSFileWrapper *fileWrapperForElement(Element* e) { NSFileWrapper *wrapper = nil; BEGIN_BLOCK_OBJC_EXCEPTIONS; const AtomicString& attr = e->getAttribute(srcAttr); if (!attr.isEmpty()) { NSURL *URL = e->document()->completeURL(attr); wrapper = [[kit(e->document()->frame()) _dataSource] _fileWrapperForURL:URL]; } if (!wrapper) { RenderImage* renderer = toRenderImage(e->renderer()); if (renderer->cachedImage() && !renderer->cachedImage()->errorOccurred()) { wrapper = [[NSFileWrapper alloc] initRegularFileWithContents:(NSData *)(renderer->cachedImage()->image()->getTIFFRepresentation())]; [wrapper setPreferredFilename:@"image.tiff"]; [wrapper autorelease]; } } return wrapper; END_BLOCK_OBJC_EXCEPTIONS; return nil; } @implementation NSAttributedString (WebKitExtras) - (NSAttributedString *)_web_attributedStringByStrippingAttachmentCharacters { // This code was originally copied from NSTextView NSRange attachmentRange; NSString *originalString = [self string]; static NSString *attachmentCharString = nil; if (!attachmentCharString) { unichar chars[2]; if (!attachmentCharString) { chars[0] = NSAttachmentCharacter; chars[1] = 0; attachmentCharString = [[NSString alloc] initWithCharacters:chars length:1]; } } attachmentRange = [originalString rangeOfString:attachmentCharString]; if (attachmentRange.location != NSNotFound && attachmentRange.length > 0) { NSMutableAttributedString *newAttributedString = [[self mutableCopyWithZone:NULL] autorelease]; while (attachmentRange.location != NSNotFound && attachmentRange.length > 0) { [newAttributedString replaceCharactersInRange:attachmentRange withString:@""]; attachmentRange = [[newAttributedString string] rangeOfString:attachmentCharString]; } return newAttributedString; } return self; } + (NSAttributedString *)_web_attributedStringFromRange:(Range*)range { NSMutableAttributedString *string = [[NSMutableAttributedString alloc] init]; NSUInteger stringLength = 0; RetainPtr attrs(AdoptNS, [[NSMutableDictionary alloc] init]); for (TextIterator it(range); !it.atEnd(); it.advance()) { RefPtr currentTextRange = it.range(); ExceptionCode ec = 0; Node* startContainer = currentTextRange->startContainer(ec); Node* endContainer = currentTextRange->endContainer(ec); int startOffset = currentTextRange->startOffset(ec); int endOffset = currentTextRange->endOffset(ec); if (startContainer == endContainer && (startOffset == endOffset - 1)) { Node* node = startContainer->childNode(startOffset); if (node && node->hasTagName(imgTag)) { NSFileWrapper *fileWrapper = fileWrapperForElement(static_cast(node)); NSTextAttachment *attachment = [[NSTextAttachment alloc] initWithFileWrapper:fileWrapper]; [string appendAttributedString:[NSAttributedString attributedStringWithAttachment:attachment]]; [attachment release]; } } int currentTextLength = it.length(); if (!currentTextLength) continue; RenderObject* renderer = startContainer->renderer(); ASSERT(renderer); if (!renderer) continue; RenderStyle* style = renderer->style(); NSFont *font = style->font().primaryFont()->getNSFont(); [attrs.get() setObject:font forKey:NSFontAttributeName]; if (style->color().isValid()) [attrs.get() setObject:nsColor(style->color()) forKey:NSForegroundColorAttributeName]; else [attrs.get() removeObjectForKey:NSForegroundColorAttributeName]; if (style->backgroundColor().isValid()) [attrs.get() setObject:nsColor(style->backgroundColor()) forKey:NSBackgroundColorAttributeName]; else [attrs.get() removeObjectForKey:NSBackgroundColorAttributeName]; RetainPtr substring(AdoptNS, [[NSString alloc] initWithCharactersNoCopy:const_cast(it.characters()) length:currentTextLength freeWhenDone:NO]); [string replaceCharactersInRange:NSMakeRange(stringLength, 0) withString:substring.get()]; [string setAttributes:attrs.get() range:NSMakeRange(stringLength, currentTextLength)]; stringLength += currentTextLength; } return [string autorelease]; } @end WebKit/mac/Misc/WebNSURLRequestExtras.m0000644000175000017500000000603010512360700016242 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNSURLRequestExtras.h" #import "WebNSURLExtras.h" #define WebContentType (@"Content-Type") #define WebUserAgent (@"User-Agent") #define WebReferrer (@"Referer") @implementation NSURLRequest (WebNSURLRequestExtras) - (NSString *)_web_HTTPReferrer { return [self valueForHTTPHeaderField:WebReferrer]; } - (NSString *)_web_HTTPContentType { return [self valueForHTTPHeaderField:WebContentType]; } - (BOOL)_web_isConditionalRequest { if ([self valueForHTTPHeaderField:@"If-Match"] || [self valueForHTTPHeaderField:@"If-Modified-Since"] || [self valueForHTTPHeaderField:@"If-None-Match"] || [self valueForHTTPHeaderField:@"If-Range"] || [self valueForHTTPHeaderField:@"If-Unmodified-Since"]) return YES; return NO; } @end @implementation NSMutableURLRequest (WebNSURLRequestExtras) - (void)_web_setHTTPContentType:(NSString *)contentType { [self setValue:contentType forHTTPHeaderField:WebContentType]; } - (void)_web_setHTTPReferrer:(NSString *)referrer { // Do not set the referrer to a string that refers to a file URL. // That is a potential security hole. if ([referrer _webkit_isFileURL]) return; // Don't allow empty Referer: headers; some servers refuse them if ([referrer length] == 0) return; [self setValue:referrer forHTTPHeaderField:WebReferrer]; } - (void)_web_setHTTPUserAgent:(NSString *)userAgent { [self setValue:userAgent forHTTPHeaderField:WebUserAgent]; } @end WebKit/mac/Misc/WebIconDatabaseDelegate.h0000644000175000017500000000333610744307516016565 0ustar leelee/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ @interface NSObject (WebIconDatabaseDelegate) - (NSImage *)webIconDatabase:(WebIconDatabase *)webIconDatabase defaultIconForURL:(NSString *)URL withSize:(NSSize)size; @end WebKit/mac/Misc/WebKitVersionChecks.h0000644000175000017500000000741111244144364016025 0ustar leelee/* * Copyright (C) 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ /* Version numbers are based on the 'current library version' specified in the WebKit build rules. All of these methods return or take version numbers with each part shifted to the left 2 bytes. For example the version 1.2.3 is returned as 0x00010203 and version 200.3.5 is returned as 0x00C80305 A version of -1 is returned if the main executable did not link against WebKit (should never happen). Please use the current WebKit version number, available in WebKit/Configurations/Version.xcconfig, when adding a new version constant. */ #define WEBKIT_FIRST_VERSION_WITH_3_0_CONTEXT_MENU_TAGS 0x020A0000 // 522.0.0 #define WEBKIT_FIRST_VERSION_WITH_LOCAL_RESOURCE_SECURITY_RESTRICTION 0x020A0000 // 522.0.0 #define WEBKIT_FIRST_VERSION_WITHOUT_APERTURE_QUIRK 0x020A0000 // 522.0.0 #define WEBKIT_FIRST_VERSION_WITHOUT_QUICKBOOKS_QUIRK 0x020A0000 // 522.0.0 #define WEBKIT_FIRST_VERSION_WITH_MAIN_THREAD_EXCEPTIONS 0x020A0000 // 522.0.0 #define WEBKIT_FIRST_VERSION_WITHOUT_ADOBE_INSTALLER_QUIRK 0x020A0000 // 522.0.0 #define WEBKIT_FIRST_VERSION_WITH_INSPECT_ELEMENT_MENU_TAG 0x020A0C00 // 522.12.0 #define WEBKIT_FIRST_VERSION_WITH_CACHE_MODEL_API 0x020B0500 // 523.5.0 #define WEBKIT_FIRST_VERSION_WITHOUT_JAVASCRIPT_RETURN_QUIRK 0x020D0100 // 525.1.0 #define WEBKIT_FIRST_VERSION_WITH_IE_COMPATIBLE_KEYBOARD_EVENT_DISPATCH 0x020D0100 // 525.1.0 #define WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES 0x020E0000 // 526.0.0 #define WEBKIT_FIRST_VERSION_WITH_MORE_STRICT_LOCAL_RESOURCE_SECURITY_RESTRICTION 0x02100200 // 528.2.0 #define WEBKIT_FIRST_VERSION_WITH_RELOAD_FROM_ORIGIN 0x02100700 // 528.7.0 #define WEBKIT_FIRST_VERSION_WITHOUT_WEBVIEW_INIT_THREAD_WORKAROUND 0x02100700 // 528.7.0 #define WEBKIT_FIRST_VERSION_WITH_ROUND_TWO_MAIN_THREAD_EXCEPTIONS 0x02120400 // 530.4.0 #define WEBKIT_FIRST_VERSION_WITHOUT_BUMPERCAR_BACK_FORWARD_QUIRK 0x02120700 // 530.7.0 #define WEBKIT_FIRST_VERSION_WITHOUT_CONTENT_SNIFFING_FOR_FILE_URLS 0x02120A00 // 530.10.0 #define WEBKIT_FIRST_VERSION_WITHOUT_LINK_ELEMENT_TEXT_CSS_QUIRK 0x02130200 // 531.2.0 #ifdef __cplusplus extern "C" { #endif BOOL WebKitLinkedOnOrAfter(int version); int WebKitLinkTimeVersion(void); int WebKitRunTimeVersion(void); #ifdef __cplusplus } #endif WebKit/mac/Misc/WebIconDatabase.h0000644000175000017500000001316510670603404015124 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 // Sent whenever a site icon has changed. The object of the notification is the icon database. // The userInfo contains the site URL whose icon has changed. // It can be accessed with the key WebIconNotificationUserInfoURLKey. extern NSString *WebIconDatabaseDidAddIconNotification; extern NSString *WebIconNotificationUserInfoURLKey; extern NSString *WebIconDatabaseDirectoryDefaultsKey; extern NSString *WebIconDatabaseEnabledDefaultsKey; extern NSSize WebIconSmallSize; // 16 x 16 extern NSSize WebIconMediumSize; // 32 x 32 extern NSSize WebIconLargeSize; // 128 x 128 @class WebIconDatabasePrivate; /*! @class WebIconDatabase @discussion Features: - memory cache icons at different sizes - disk storage - icon update notification Uses: - UI elements to retrieve icons that represent site URLs. - Save icons to disk for later use. Every icon in the database has a retain count. If an icon has a retain count greater than 0, it will be written to disk for later use. If an icon's retain count equals zero it will be removed from disk. The retain count is not persistent across launches. If the WebKit client wishes to retain an icon it should retain the icon once for every launch. This is best done at initialization time before the database begins removing icons. To make sure that the database does not remove unretained icons prematurely, call delayDatabaseCleanup until all desired icons are retained. Once all are retained, call allowDatabaseCleanup. Note that an icon can be retained after the database clean-up has begun. This just has to be done before the icon is removed. Icons are removed from the database whenever new icons are added to it. Retention methods can be called for icons that are not yet in the database. */ @interface WebIconDatabase : NSObject { @private WebIconDatabasePrivate *_private; BOOL _isClosing; } /*! @method sharedIconDatabase @abstract Returns a shared instance of the icon database */ + (WebIconDatabase *)sharedIconDatabase; /*! @method iconForURL:withSize: @discussion Calls iconForURL:withSize:cache: with YES for cache. @param URL @param size */ - (NSImage *)iconForURL:(NSString *)URL withSize:(NSSize)size; /*! @method iconForURL:withSize:cache: @discussion Returns an icon for a web site URL from memory or disk. nil if none is found. Usually called by a UI element to determine if a site URL has an associated icon. Often called by the observer of WebIconChangedNotification after the notification is sent. @param URL @param size @param cache If yes, caches the returned image in memory if not already cached */ - (NSImage *)iconForURL:(NSString *)URL withSize:(NSSize)size cache:(BOOL)cache; /*! @method iconURLForURL:withSize:cache: @discussion Returns an icon URL for a web site URL from memory or disk. nil if none is found. @param URL */ - (NSString *)iconURLForURL:(NSString *)URL; /*! @method defaultIconWithSize: @param size */ - (NSImage *)defaultIconWithSize:(NSSize)size; - (NSImage *)defaultIconForURL:(NSString *)URL withSize:(NSSize)size; /*! @method retainIconForURL: @abstract Increments the retain count of the icon. @param URL */ - (void)retainIconForURL:(NSString *)URL; /*! @method releaseIconForURL: @abstract Decrements the retain count of the icon. @param URL */ - (void)releaseIconForURL:(NSString *)URL; /*! @method delayDatabaseCleanup: @discussion Only effective if called before the database begins removing icons. delayDatabaseCleanUp increments an internal counter that when 0 begins the database clean-up. The counter equals 0 at initialization. */ + (void)delayDatabaseCleanup; /*! @method allowDatabaseCleanup: @discussion Informs the database that it now can begin removing icons. allowDatabaseCleanup decrements an internal counter that when 0 begins the database clean-up. The counter equals 0 at initialization. */ + (void)allowDatabaseCleanup; - (void)setDelegate:(id)delegate; - (id)delegate; @end WebKit/mac/Misc/WebKitSystemBits.h0000644000175000017500000000340511046247054015364 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #ifdef __cplusplus extern "C" { #endif uint64_t WebMemorySize(void); unsigned long long WebVolumeFreeSize(NSString *path); int WebNumberOfCPUs(void); #ifdef __cplusplus } #endif WebKit/mac/Misc/WebNSUserDefaultsExtras.h0000644000175000017500000000326710360512352016644 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @interface NSUserDefaults (WebNSUserDefaultsExtras) + (NSString *)_webkit_preferredLanguageCode; @end WebKit/mac/Misc/WebElementDictionary.h0000644000175000017500000000357410520720460016225 0ustar leelee/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 namespace WebCore { class HitTestResult; } @interface WebElementDictionary : NSDictionary { WebCore::HitTestResult* _result; NSMutableDictionary *_cache; NSMutableSet *_nilValues; BOOL _cacheComplete; } - (id)initWithHitTestResult:(const WebCore::HitTestResult&)result; @end WebKit/mac/Misc/WebKitVersionChecks.m0000644000175000017500000000355710744307516016045 0ustar leelee/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebKitVersionChecks.h" #import BOOL WebKitLinkedOnOrAfter(int version) { return (WebKitLinkTimeVersion() >= version); } int WebKitLinkTimeVersion(void) { return NSVersionOfLinkTimeLibrary("WebKit"); } int WebKitRunTimeVersion(void) { return NSVersionOfRunTimeLibrary("WebKit"); } WebKit/mac/Misc/WebKitSystemBits.m0000644000175000017500000000577011053123327015372 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebKitSystemBits.h" #import "WebNSFileManagerExtras.h" #import #import #import #import #import #import static host_basic_info_data_t gHostBasicInfo; static pthread_once_t initControl = PTHREAD_ONCE_INIT; static void initCapabilities(void) { mach_msg_type_number_t count; kern_return_t r; mach_port_t host; /* Discover our CPU type */ host = mach_host_self(); count = HOST_BASIC_INFO_COUNT; r = host_info(host, HOST_BASIC_INFO, (host_info_t) &gHostBasicInfo, &count); mach_port_deallocate(mach_task_self(), host); if (r != KERN_SUCCESS) { LOG_ERROR("%s : host_info(%d) : %s.\n", __FUNCTION__, r, mach_error_string(r)); } } uint64_t WebMemorySize(void) { pthread_once(&initControl, initCapabilities); return gHostBasicInfo.max_mem; } int WebNumberOfCPUs(void) { static int numCPUs = 0; if (numCPUs == 0) { int mib[2]; size_t len; mib[0] = CTL_HW; mib[1] = HW_NCPU; len = sizeof(numCPUs); sysctl(mib, 2, &numCPUs, &len, NULL, 0); } return numCPUs; } unsigned long long WebVolumeFreeSize(NSString *path) { NSDictionary *fileSystemAttributesDictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:path error:NULL]; return [[fileSystemAttributesDictionary objectForKey:NSFileSystemFreeSize] unsignedLongLongValue]; } WebKit/mac/Misc/WebKit.h0000644000175000017500000000452710360512352013335 0ustar leelee/* * Copyright (C) 2003, 2004 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import WebKit/mac/Misc/WebIconFetcher.h0000644000175000017500000000272211015335302014766 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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 @class WebIconFetcherPrivate; @interface WebIconFetcher : NSObject { WebIconFetcherPrivate *_private; } - (void)cancel; @end WebKit/mac/Misc/WebNSAttributedStringExtras.h0000644000175000017500000000345210521520115017523 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ namespace WebCore { class Range; } @interface NSAttributedString (WebKitExtras) + (NSAttributedString *)_web_attributedStringFromRange:(WebCore::Range*)range; - (NSAttributedString *)_web_attributedStringByStrippingAttachmentCharacters; @end WebKit/mac/Misc/WebLocalizableStrings.h0000644000175000017500000000514010711720573016377 0ustar leelee/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if __OBJC__ @class NSBundle; #else typedef struct NSBundle NSBundle; #endif typedef struct { const char *identifier; NSBundle *bundle; } WebLocalizableStringsBundle; #ifdef __cplusplus extern "C" { #endif #if __OBJC__ NSString *WebLocalizedString(WebLocalizableStringsBundle *bundle, const char *key); #else CFStringRef WebLocalizedString(WebLocalizableStringsBundle *bundle, const char *key); #endif #ifdef __cplusplus } #endif #ifdef FRAMEWORK_NAME #define LOCALIZABLE_STRINGS_BUNDLE(F) LOCALIZABLE_STRINGS_BUNDLE_HELPER(F) #define LOCALIZABLE_STRINGS_BUNDLE_HELPER(F) F ## LocalizableStringsBundle extern WebLocalizableStringsBundle LOCALIZABLE_STRINGS_BUNDLE(FRAMEWORK_NAME); #define UI_STRING(string, comment) WebLocalizedString(&LOCALIZABLE_STRINGS_BUNDLE(FRAMEWORK_NAME), string) #define UI_STRING_KEY(string, key, comment) WebLocalizedString(&LOCALIZABLE_STRINGS_BUNDLE(FRAMEWORK_NAME), key) #else #define UI_STRING(string, comment) WebLocalizedString(0, string) #define UI_STRING_KEY(string, key, comment) WebLocalizedString(0, key) #endif WebKit/mac/Misc/WebNSPrintOperationExtras.h0000644000175000017500000000323510360512352017206 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @interface NSPrintOperation (WebKitExtras) - (float)_web_pageSetupScaleFactor; @end WebKit/mac/Misc/WebLocalizableStrings.m0000644000175000017500000000537311032666713016416 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import WebLocalizableStringsBundle WebKitLocalizableStringsBundle = { "com.apple.WebKit", 0 }; NSString *WebLocalizedString(WebLocalizableStringsBundle *stringsBundle, const char *key) { NSBundle *bundle; if (stringsBundle == NULL) { static NSBundle *mainBundle; if (mainBundle == nil) { mainBundle = [NSBundle mainBundle]; ASSERT(mainBundle); CFRetain(mainBundle); } bundle = mainBundle; } else { bundle = stringsBundle->bundle; if (bundle == nil) { bundle = [NSBundle bundleWithIdentifier:[NSString stringWithUTF8String:stringsBundle->identifier]]; ASSERT(bundle); stringsBundle->bundle = bundle; } } NSString *notFound = @"localized string not found"; CFStringRef keyString = CFStringCreateWithCStringNoCopy(NULL, key, kCFStringEncodingUTF8, kCFAllocatorNull); NSString *result = [bundle localizedStringForKey:(NSString *)keyString value:notFound table:nil]; CFRelease(keyString); ASSERT_WITH_MESSAGE(result != notFound, "could not find localizable string %s in bundle", key); return result; } WebKit/mac/Misc/WebElementDictionary.mm0000644000175000017500000001575611227726376016435 0ustar leelee/* * Copyright (C) 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebElementDictionary.h" #import "DOMNodeInternal.h" #import "WebDOMOperations.h" #import "WebFrame.h" #import "WebFrameInternal.h" #import "WebKitLogging.h" #import "WebTypesInternal.h" #import "WebView.h" #import "WebViewPrivate.h" #import #import #import #import #import #import #import using namespace WebCore; static CFMutableDictionaryRef lookupTable = NULL; static void addLookupKey(NSString *key, SEL selector) { CFDictionaryAddValue(lookupTable, key, selector); } static void cacheValueForKey(const void *key, const void *value, void *self) { // calling objectForKey will cache the value in our _cache dictionary [(WebElementDictionary *)self objectForKey:(NSString *)key]; } @implementation WebElementDictionary + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif } + (void)initializeLookupTable { if (lookupTable) return; lookupTable = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFCopyStringDictionaryKeyCallBacks, NULL); addLookupKey(WebElementDOMNodeKey, @selector(_domNode)); addLookupKey(WebElementFrameKey, @selector(_webFrame)); addLookupKey(WebElementImageAltStringKey, @selector(_altDisplayString)); addLookupKey(WebElementImageKey, @selector(_image)); addLookupKey(WebElementImageRectKey, @selector(_imageRect)); addLookupKey(WebElementImageURLKey, @selector(_absoluteImageURL)); addLookupKey(WebElementIsSelectedKey, @selector(_isSelected)); addLookupKey(WebElementSpellingToolTipKey, @selector(_spellingToolTip)); addLookupKey(WebElementTitleKey, @selector(_title)); addLookupKey(WebElementLinkURLKey, @selector(_absoluteLinkURL)); addLookupKey(WebElementLinkTargetFrameKey, @selector(_targetWebFrame)); addLookupKey(WebElementLinkTitleKey, @selector(_titleDisplayString)); addLookupKey(WebElementLinkLabelKey, @selector(_textContent)); addLookupKey(WebElementLinkIsLiveKey, @selector(_isLiveLink)); addLookupKey(WebElementIsContentEditableKey, @selector(_isContentEditable)); } - (id)initWithHitTestResult:(const HitTestResult&)result { [[self class] initializeLookupTable]; [super init]; _result = new HitTestResult(result); return self; } - (void)dealloc { if (WebCoreObjCScheduleDeallocateOnMainThread([WebElementDictionary class], self)) return; delete _result; [_cache release]; [_nilValues release]; [super dealloc]; } - (void)finalize { ASSERT_MAIN_THREAD(); delete _result; [super finalize]; } - (void)_fillCache { CFDictionaryApplyFunction(lookupTable, cacheValueForKey, self); _cacheComplete = YES; } - (NSUInteger)count { if (!_cacheComplete) [self _fillCache]; return [_cache count]; } - (NSEnumerator *)keyEnumerator { if (!_cacheComplete) [self _fillCache]; return [_cache keyEnumerator]; } - (id)objectForKey:(id)key { id value = [_cache objectForKey:key]; if (value || _cacheComplete || [_nilValues containsObject:key]) return value; SEL selector = (SEL)CFDictionaryGetValue(lookupTable, key); if (!selector) return nil; value = [self performSelector:selector]; unsigned lookupTableCount = CFDictionaryGetCount(lookupTable); if (value) { if (!_cache) _cache = [[NSMutableDictionary alloc] initWithCapacity:lookupTableCount]; [_cache setObject:value forKey:key]; } else { if (!_nilValues) _nilValues = [[NSMutableSet alloc] initWithCapacity:lookupTableCount]; [_nilValues addObject:key]; } _cacheComplete = ([_cache count] + [_nilValues count]) == lookupTableCount; return value; } - (DOMNode *)_domNode { return kit(_result->innerNonSharedNode()); } - (WebFrame *)_webFrame { return [[[self _domNode] ownerDocument] webFrame]; } // String's NSString* operator converts null Strings to empty NSStrings for compatibility // with AppKit. We need to work around that here. static NSString* NSStringOrNil(String coreString) { if (coreString.isNull()) return nil; return coreString; } - (NSString *)_altDisplayString { return NSStringOrNil(_result->altDisplayString()); } - (NSString *)_spellingToolTip { TextDirection dir; return NSStringOrNil(_result->spellingToolTip(dir)); } - (NSImage *)_image { Image* image = _result->image(); return image ? image->getNSImage() : nil; } - (NSValue *)_imageRect { IntRect rect = _result->imageRect(); return rect.isEmpty() ? nil : [NSValue valueWithRect:rect]; } - (NSURL *)_absoluteImageURL { return _result->absoluteImageURL(); } - (NSNumber *)_isSelected { return [NSNumber numberWithBool:_result->isSelected()]; } - (NSString *)_title { TextDirection dir; return NSStringOrNil(_result->title(dir)); } - (NSURL *)_absoluteLinkURL { return _result->absoluteLinkURL(); } - (WebFrame *)_targetWebFrame { return kit(_result->targetFrame()); } - (NSString *)_titleDisplayString { return NSStringOrNil(_result->titleDisplayString()); } - (NSString *)_textContent { return NSStringOrNil(_result->textContent()); } - (NSNumber *)_isLiveLink { return [NSNumber numberWithBool:_result->isLiveLink()]; } - (NSNumber *)_isContentEditable { return [NSNumber numberWithBool:_result->isContentEditable()]; } @end WebKit/mac/Misc/WebTypesInternal.h0000644000175000017500000000320311065377376015417 0ustar leelee/* * Copyright (C) 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #ifdef BUILDING_ON_TIGER typedef int NSInteger; typedef unsigned int NSUInteger; #endif WebKit/mac/Misc/WebNSFileManagerExtras.h0000644000175000017500000000544511207611164016412 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #define WEB_UREAD (00400) /* Read by owner */ #define WEB_UWRITE (00200) /* Write by owner */ #define WEB_UEXEC (00100) /* Execute/Search by owner */ @interface NSFileManager (WebNSFileManagerExtras) - (void)_webkit_backgroundRemoveFileAtPath:(NSString *)path; - (void)_webkit_backgroundRemoveLeftoverFiles:(NSString *)path; - (BOOL)_webkit_removeFileOnlyAtPath:(NSString *)path; - (void)_webkit_setMetadataURL:(NSString *)URLString referrer:(NSString *)referrer atPath:(NSString *)path; - (NSString *)_webkit_startupVolumeName; - (NSString *)_webkit_pathWithUniqueFilenameForPath:(NSString *)path; @end #ifdef BUILDING_ON_TIGER @interface NSFileManager (WebNSFileManagerTigerForwardCompatibility) - (NSArray *)contentsOfDirectoryAtPath:(NSString *)path error:(NSError **)error; - (BOOL)moveItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error; - (BOOL)removeItemAtPath:(NSString *)path error:(NSError **)error; - (NSDictionary *)attributesOfFileSystemForPath:(NSString *)path error:(NSError **)error; - (NSString *)destinationOfSymbolicLinkAtPath:(NSString *)path error:(NSError **)error; - (NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError **)error; @end #endif WebKit/mac/Misc/WebNSUserDefaultsExtras.m0000644000175000017500000001121211034054617016642 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNSUserDefaultsExtras.h" #import "WebNSObjectExtras.h" #import #import @implementation NSString (WebNSUserDefaultsPrivate) - (NSString *)_webkit_HTTPStyleLanguageCode { // Look up the language code using CFBundle. NSString *languageCode = self; NSString *preferredLanguageCode = WebCFAutorelease(WKCopyCFLocalizationPreferredName((CFStringRef)self)); if (preferredLanguageCode) languageCode = preferredLanguageCode; // Make the string lowercase. NSString *lowercaseLanguageCode = [languageCode lowercaseString]; // Turn a '_' into a '-' if it appears after a 2-letter language code. if ([lowercaseLanguageCode length] < 3 || [lowercaseLanguageCode characterAtIndex:2] != '_') { return lowercaseLanguageCode; } NSMutableString *result = [lowercaseLanguageCode mutableCopy]; [result replaceCharactersInRange:NSMakeRange(2, 1) withString:@"-"]; return [result autorelease]; } @end @implementation NSUserDefaults (WebNSUserDefaultsExtras) static NSString *preferredLanguageCode = nil; static NSLock *preferredLanguageLock = nil; static pthread_once_t preferredLanguageLockOnce = PTHREAD_ONCE_INIT; static pthread_once_t addDefaultsChangeObserverOnce = PTHREAD_ONCE_INIT; static void makeLock(void) { preferredLanguageLock = [[NSLock alloc] init]; } + (void)_webkit_ensureAndLockPreferredLanguageLock { pthread_once(&preferredLanguageLockOnce, makeLock); [preferredLanguageLock lock]; } + (void)_webkit_defaultsDidChange { [self _webkit_ensureAndLockPreferredLanguageLock]; [preferredLanguageCode release]; preferredLanguageCode = nil; [preferredLanguageLock unlock]; } static void addDefaultsChangeObserver(void) { [[NSNotificationCenter defaultCenter] addObserver:[NSUserDefaults class] selector:@selector(_webkit_defaultsDidChange) name:NSUserDefaultsDidChangeNotification object:[NSUserDefaults standardUserDefaults]]; } + (void)_webkit_addDefaultsChangeObserver { pthread_once(&addDefaultsChangeObserverOnce, addDefaultsChangeObserver); } + (NSString *)_webkit_preferredLanguageCode { // Get this outside the lock since it might block on the defaults lock, while we are inside registerDefaults:. NSUserDefaults *standardDefaults = [self standardUserDefaults]; BOOL addObserver = NO; [self _webkit_ensureAndLockPreferredLanguageLock]; if (!preferredLanguageCode) { NSArray *languages = [standardDefaults stringArrayForKey:@"AppleLanguages"]; if ([languages count] == 0) { preferredLanguageCode = [@"en" retain]; } else { preferredLanguageCode = [[[languages objectAtIndex:0] _webkit_HTTPStyleLanguageCode] copy]; } addObserver = YES; } NSString *code = [[preferredLanguageCode retain] autorelease]; [preferredLanguageLock unlock]; if (addObserver) { [self _webkit_addDefaultsChangeObserver]; } return code; } @end WebKit/mac/Misc/WebNSPrintOperationExtras.m0000644000175000017500000000341610360512352017214 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNSPrintOperationExtras.h" @implementation NSPrintOperation (WebKitExtras) - (float)_web_pageSetupScaleFactor { return [[[[self printInfo] dictionary] objectForKey:NSPrintScalingFactor] floatValue]; } @end WebKit/mac/Misc/WebNSFileManagerExtras.m0000644000175000017500000002464111207611164016416 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import #import #import #import #import #import @implementation NSFileManager (WebNSFileManagerExtras) - (BOOL)_webkit_removeFileOnlyAtPath:(NSString *)path { struct statfs buf; BOOL result = unlink([path fileSystemRepresentation]) == 0; // For mysterious reasons, MNT_DOVOLFS is the flag for "supports resource fork" if ((statfs([path fileSystemRepresentation], &buf) == 0) && !(buf.f_flags & MNT_DOVOLFS)) { NSString *lastPathComponent = [path lastPathComponent]; if ([lastPathComponent length] != 0 && ![lastPathComponent isEqualToString:@"/"]) { NSString *resourcePath = [[path stringByDeletingLastPathComponent] stringByAppendingString:[@"._" stringByAppendingString:lastPathComponent]]; if (unlink([resourcePath fileSystemRepresentation]) != 0) { result = NO; } } } return result; } - (void)_webkit_backgroundRemoveFileAtPath:(NSString *)path { NSFileManager *manager; NSString *moveToSubpath; NSString *moveToPath; int i; manager = [NSFileManager defaultManager]; i = 0; moveToSubpath = [path stringByDeletingLastPathComponent]; do { moveToPath = [NSString stringWithFormat:@"%@/.tmp%d", moveToSubpath, i]; i++; } while ([manager fileExistsAtPath:moveToPath]); if ([manager moveItemAtPath:path toPath:moveToPath error:NULL]) [NSThread detachNewThreadSelector:@selector(_performRemoveFileAtPath:) toTarget:self withObject:moveToPath]; } - (void)_webkit_backgroundRemoveLeftoverFiles:(NSString *)path { NSFileManager *manager; NSString *leftoverSubpath; NSString *leftoverPath; int i; manager = [NSFileManager defaultManager]; leftoverSubpath = [path stringByDeletingLastPathComponent]; i = 0; while (1) { leftoverPath = [NSString stringWithFormat:@"%@/.tmp%d", leftoverSubpath, i]; if (![manager fileExistsAtPath:leftoverPath]) { break; } [NSThread detachNewThreadSelector:@selector(_performRemoveFileAtPath:) toTarget:self withObject:leftoverPath]; i++; } } - (NSString *)_webkit_carbonPathForPath:(NSString *)posixPath { OSStatus error; FSRef ref, rootRef, parentRef; FSCatalogInfo info; NSMutableArray *carbonPathPieces; HFSUniStr255 nameString; // Make an FSRef. error = FSPathMakeRef((const UInt8 *)[posixPath fileSystemRepresentation], &ref, NULL); if (error != noErr) { return nil; } // Get volume refNum. error = FSGetCatalogInfo(&ref, kFSCatInfoVolume, &info, NULL, NULL, NULL); if (error != noErr) { return nil; } // Get root directory FSRef. error = FSGetVolumeInfo(info.volume, 0, NULL, kFSVolInfoNone, NULL, NULL, &rootRef); if (error != noErr) { return nil; } // Get the pieces of the path. carbonPathPieces = [NSMutableArray array]; for (;;) { error = FSGetCatalogInfo(&ref, kFSCatInfoNone, NULL, &nameString, NULL, &parentRef); if (error != noErr) { return nil; } [carbonPathPieces insertObject:[NSString stringWithCharacters:nameString.unicode length:nameString.length] atIndex:0]; if (FSCompareFSRefs(&ref, &rootRef) == noErr) { break; } ref = parentRef; } // Volume names need trailing : character. if ([carbonPathPieces count] == 1) { [carbonPathPieces addObject:@""]; } return [carbonPathPieces componentsJoinedByString:@":"]; } typedef struct MetaDataInfo { NSString *URLString; NSString *referrer; NSString *path; } MetaDataInfo; static void *setMetaData(void* context) { MetaDataInfo *info = (MetaDataInfo *)context; WKSetMetadataURL(info->URLString, info->referrer, info->path); HardRelease(info->URLString); HardRelease(info->referrer); HardRelease(info->path); free(info); return 0; } - (void)_webkit_setMetadataURL:(NSString *)URLString referrer:(NSString *)referrer atPath:(NSString *)path { ASSERT(URLString); ASSERT(path); // Spawn a background thread for WKSetMetadataURL because this function will not return until mds has // journaled the data we're're trying to set. Depending on what other I/O is going on, it can take some // time. pthread_t tid; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); MetaDataInfo *info = malloc(sizeof(MetaDataInfo)); info->URLString = HardRetainWithNSRelease([URLString copy]); info->referrer = HardRetainWithNSRelease([referrer copy]); info->path = HardRetainWithNSRelease([path copy]); pthread_create(&tid, &attr, setMetaData, info); pthread_attr_destroy(&attr); } - (NSString *)_webkit_startupVolumeName { NSString *path = [self _webkit_carbonPathForPath:@"/"]; return [path substringToIndex:[path length]-1]; } - (NSString *)_webkit_pathWithUniqueFilenameForPath:(NSString *)path { // "Fix" the filename of the path. NSString *filename = [[path lastPathComponent] _webkit_filenameByFixingIllegalCharacters]; path = [[path stringByDeletingLastPathComponent] stringByAppendingPathComponent:filename]; NSFileManager *fileManager = [NSFileManager defaultManager]; if ([fileManager fileExistsAtPath:path]) { // Don't overwrite existing file by appending "-n", "-n.ext" or "-n.ext.ext" to the filename. NSString *extensions = nil; NSString *pathWithoutExtensions; NSString *lastPathComponent = [path lastPathComponent]; NSRange periodRange = [lastPathComponent rangeOfString:@"."]; if (periodRange.location == NSNotFound) { pathWithoutExtensions = path; } else { extensions = [lastPathComponent substringFromIndex:periodRange.location + 1]; lastPathComponent = [lastPathComponent substringToIndex:periodRange.location]; pathWithoutExtensions = [[path stringByDeletingLastPathComponent] stringByAppendingPathComponent:lastPathComponent]; } NSString *pathWithAppendedNumber; unsigned i; for (i = 1; 1; i++) { pathWithAppendedNumber = [NSString stringWithFormat:@"%@-%d", pathWithoutExtensions, i]; path = [extensions length] ? [pathWithAppendedNumber stringByAppendingPathExtension:extensions] : pathWithAppendedNumber; if (![fileManager fileExistsAtPath:path]) { break; } } } return path; } @end #ifdef BUILDING_ON_TIGER @implementation NSFileManager (WebNSFileManagerTigerForwardCompatibility) - (NSArray *)contentsOfDirectoryAtPath:(NSString *)path error:(NSError **)error { // We don't report errors via the NSError* output parameter, so ensure that the caller does not expect us to do so. ASSERT_ARG(error, !error); return [self directoryContentsAtPath:path]; } - (NSString *)destinationOfSymbolicLinkAtPath:(NSString *)path error:(NSError **)error { // We don't report errors via the NSError* output parameter, so ensure that the caller does not expect us to do so. ASSERT_ARG(error, !error); return [self pathContentOfSymbolicLinkAtPath:path]; } - (NSDictionary *)attributesOfFileSystemForPath:(NSString *)path error:(NSError **)error { // We don't report errors via the NSError* output parameter, so ensure that the caller does not expect us to do so. ASSERT_ARG(error, !error); return [self fileSystemAttributesAtPath:path]; } - (NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError **)error { // We don't report errors via the NSError* output parameter, so ensure that the caller does not expect us to do so. ASSERT_ARG(error, !error); return [self fileAttributesAtPath:path traverseLink:NO]; } - (BOOL)moveItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error { // The implementation of moveItemAtPath:toPath:error: interacts with the NSFileManager's delegate. // We are not matching that behaviour at the moment, but it should not be a problem as any client // expecting that would need to call setDelegate: first which will generate a compile-time warning, // as that method is not available on Tiger. return [self movePath:srcPath toPath:dstPath handler:nil]; } - (BOOL)removeItemAtPath:(NSString *)path error:(NSError **)error { // The implementation of removeItemAtPath:error: interacts with the NSFileManager's delegate. // We are not matching that behaviour at the moment, but it should not be a problem as any client // expecting that would need to call setDelegate: first which will generate a compile-time warning, // as that method is not available on Tiger. return [self removeFileAtPath:path handler:nil]; } @end #endif WebKit/mac/Misc/WebNSControlExtras.h0000644000175000017500000000322510360512352015650 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @interface NSControl (WebExtras) - (void)sizeToFitAndAdjustWindowHeight; @end WebKit/mac/Misc/WebNSControlExtras.m0000644000175000017500000000424611004123007015650 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNSControlExtras.h" @implementation NSControl (WebExtras) - (void)sizeToFitAndAdjustWindowHeight { NSRect frame = [self frame]; NSSize bestSize = [[self cell] cellSizeForBounds:NSMakeRect(0.0f, 0.0f, frame.size.width, 10000.0f)]; float heightDelta = bestSize.height - frame.size.height; frame.size.height += heightDelta; frame.origin.y -= heightDelta; [self setFrame:frame]; NSWindow *window = [self window]; NSRect windowFrame = [window frame]; windowFrame.size.height += heightDelta * [window userSpaceScaleFactor]; [window setFrame:windowFrame display:NO]; } @end WebKit/mac/Misc/WebNSURLExtras.mm0000644000175000017500000011733311221111770015056 0ustar leelee/* * Copyright (C) 2005, 2007, 2008 Apple Inc. All rights reserved. * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) * * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNSURLExtras.h" #import "WebKitNSStringExtras.h" #import "WebLocalizableStrings.h" #import "WebNSDataExtras.h" #import "WebNSObjectExtras.h" #import "WebSystemInterface.h" #import #import #import #import #import #import #import #import using namespace WebCore; using namespace WTF; typedef void (* StringRangeApplierFunction)(NSString *string, NSRange range, void *context); // Needs to be big enough to hold an IDN-encoded name. // For host names bigger than this, we won't do IDN encoding, which is almost certainly OK. #define HOST_NAME_BUFFER_LENGTH 2048 #define URL_BYTES_BUFFER_LENGTH 2048 static pthread_once_t IDNScriptWhiteListFileRead = PTHREAD_ONCE_INIT; static uint32_t IDNScriptWhiteList[(USCRIPT_CODE_LIMIT + 31) / 32]; static inline BOOL isLookalikeCharacter(int charCode) { // FIXME: Move this code down into WebCore so it can be shared with other platforms. // This function treats the following as unsafe, lookalike characters: // any non-printable character, any character considered as whitespace that isn't already converted to a space by ICU, // and any ignorable character. // We also considered the characters in Mozilla's blacklist (http://kb.mozillazine.org/Network.IDN.blacklist_chars), // and included all of these characters that ICU can encode. if (!u_isprint(charCode) || u_isUWhiteSpace(charCode) || u_hasBinaryProperty(charCode, UCHAR_DEFAULT_IGNORABLE_CODE_POINT)) return YES; switch (charCode) { case 0x00ED: /* LATIN SMALL LETTER I WITH ACUTE */ case 0x01C3: /* LATIN LETTER RETROFLEX CLICK */ case 0x0251: /* LATIN SMALL LETTER ALPHA */ case 0x0261: /* LATIN SMALL LETTER SCRIPT G */ case 0x0337: /* COMBINING SHORT SOLIDUS OVERLAY */ case 0x0338: /* COMBINING LONG SOLIDUS OVERLAY */ case 0x05B4: /* HEBREW POINT HIRIQ */ case 0x05BC: /* HEBREW POINT DAGESH OR MAPIQ */ case 0x05C3: /* HEBREW PUNCTUATION SOF PASUQ */ case 0x05F4: /* HEBREW PUNCTUATION GERSHAYIM */ case 0x0660: /* ARABIC INDIC DIGIT ZERO */ case 0x06D4: /* ARABIC FULL STOP */ case 0x06F0: /* EXTENDED ARABIC INDIC DIGIT ZERO */ case 0x2027: /* HYPHENATION POINT */ case 0x2039: /* SINGLE LEFT-POINTING ANGLE QUOTATION MARK */ case 0x203A: /* SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */ case 0x2044: /* FRACTION SLASH */ case 0x2215: /* DIVISION SLASH */ case 0x2216: /* SET MINUS */ case 0x233F: /* APL FUNCTIONAL SYMBOL SLASH BAR */ case 0x23AE: /* INTEGRAL EXTENSION */ case 0x244A: /* OCR DOUBLE BACKSLASH */ case 0x2571: /* BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT */ case 0x2572: /* BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT */ case 0x29F8: /* BIG SOLIDUS */ case 0x29f6: /* SOLIDUS WITH OVERBAR */ case 0x2AFB: /* TRIPLE SOLIDUS BINARY RELATION */ case 0x2AFD: /* DOUBLE SOLIDUS OPERATOR */ case 0x3008: /* LEFT ANGLE BRACKET */ case 0x3014: /* LEFT TORTOISE SHELL BRACKET */ case 0x3015: /* RIGHT TORTOISE SHELL BRACKET */ case 0x3033: /* VERTICAL KANA REPEAT MARK UPPER HALF */ case 0x3035: /* VERTICAL KANA REPEAT MARK LOWER HALF */ case 0x321D: /* PARENTHESIZED KOREAN CHARACTER OJEON */ case 0x321E: /* PARENTHESIZED KOREAN CHARACTER O HU */ case 0x33DF: /* SQUARE A OVER M */ case 0xFE14: /* PRESENTATION FORM FOR VERTICAL SEMICOLON */ case 0xFE15: /* PRESENTATION FORM FOR VERTICAL EXCLAMATION MARK */ case 0xFE3F: /* PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET */ case 0xFE5D: /* SMALL LEFT TORTOISE SHELL BRACKET */ case 0xFE5E: /* SMALL RIGHT TORTOISE SHELL BRACKET */ return YES; default: return NO; } } static char hexDigit(int i) { if (i < 0 || i > 16) { LOG_ERROR("illegal hex digit"); return '0'; } int h = i; if (h >= 10) { h = h - 10 + 'A'; } else { h += '0'; } return h; } static BOOL isHexDigit(char c) { return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); } static int hexDigitValue(char c) { if (c >= '0' && c <= '9') { return c - '0'; } if (c >= 'A' && c <= 'F') { return c - 'A' + 10; } if (c >= 'a' && c <= 'f') { return c - 'a' + 10; } LOG_ERROR("illegal hex digit"); return 0; } static void applyHostNameFunctionToMailToURLString(NSString *string, StringRangeApplierFunction f, void *context) { // In a mailto: URL, host names come after a '@' character and end with a '>' or ',' or '?' character. // Skip quoted strings so that characters in them don't confuse us. // When we find a '?' character, we are past the part of the URL that contains host names. static NSCharacterSet *hostNameOrStringStartCharacters; if (hostNameOrStringStartCharacters == nil) { hostNameOrStringStartCharacters = [NSCharacterSet characterSetWithCharactersInString:@"\"@?"]; CFRetain(hostNameOrStringStartCharacters); } static NSCharacterSet *hostNameEndCharacters; if (hostNameEndCharacters == nil) { hostNameEndCharacters = [NSCharacterSet characterSetWithCharactersInString:@">,?"]; CFRetain(hostNameEndCharacters); } static NSCharacterSet *quotedStringCharacters; if (quotedStringCharacters == nil) { quotedStringCharacters = [NSCharacterSet characterSetWithCharactersInString:@"\"\\"]; CFRetain(quotedStringCharacters); } unsigned stringLength = [string length]; NSRange remaining = NSMakeRange(0, stringLength); while (1) { // Find start of host name or of quoted string. NSRange hostNameOrStringStart = [string rangeOfCharacterFromSet:hostNameOrStringStartCharacters options:0 range:remaining]; if (hostNameOrStringStart.location == NSNotFound) { return; } unichar c = [string characterAtIndex:hostNameOrStringStart.location]; remaining.location = NSMaxRange(hostNameOrStringStart); remaining.length = stringLength - remaining.location; if (c == '?') { return; } if (c == '@') { // Find end of host name. unsigned hostNameStart = remaining.location; NSRange hostNameEnd = [string rangeOfCharacterFromSet:hostNameEndCharacters options:0 range:remaining]; BOOL done; if (hostNameEnd.location == NSNotFound) { hostNameEnd.location = stringLength; done = YES; } else { remaining.location = hostNameEnd.location; remaining.length = stringLength - remaining.location; done = NO; } // Process host name range. f(string, NSMakeRange(hostNameStart, hostNameEnd.location - hostNameStart), context); if (done) { return; } } else { // Skip quoted string. ASSERT(c == '"'); while (1) { NSRange escapedCharacterOrStringEnd = [string rangeOfCharacterFromSet:quotedStringCharacters options:0 range:remaining]; if (escapedCharacterOrStringEnd.location == NSNotFound) { return; } c = [string characterAtIndex:escapedCharacterOrStringEnd.location]; remaining.location = NSMaxRange(escapedCharacterOrStringEnd); remaining.length = stringLength - remaining.location; // If we are the end of the string, then break from the string loop back to the host name loop. if (c == '"') { break; } // Skip escaped character. ASSERT(c == '\\'); if (remaining.length == 0) { return; } remaining.location += 1; remaining.length -= 1; } } } } static void applyHostNameFunctionToURLString(NSString *string, StringRangeApplierFunction f, void *context) { // Find hostnames. Too bad we can't use any real URL-parsing code to do this, // but we have to do it before doing all the %-escaping, and this is the only // code we have that parses mailto URLs anyway. // Maybe we should implement this using a character buffer instead? if ([string _webkit_hasCaseInsensitivePrefix:@"mailto:"]) { applyHostNameFunctionToMailToURLString(string, f, context); return; } // Find the host name in a hierarchical URL. // It comes after a "://" sequence, with scheme characters preceding. // If ends with the end of the string or a ":", "/", or a "?". // If there is a "@" character, the host part is just the part after the "@". NSRange separatorRange = [string rangeOfString:@"://"]; if (separatorRange.location == NSNotFound) { return; } // Check that all characters before the :// are valid scheme characters. static NSCharacterSet *nonSchemeCharacters; if (nonSchemeCharacters == nil) { nonSchemeCharacters = [[NSCharacterSet characterSetWithCharactersInString:@"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-."] invertedSet]; CFRetain(nonSchemeCharacters); } if ([string rangeOfCharacterFromSet:nonSchemeCharacters options:0 range:NSMakeRange(0, separatorRange.location)].location != NSNotFound) { return; } unsigned stringLength = [string length]; static NSCharacterSet *hostTerminators; if (hostTerminators == nil) { hostTerminators = [NSCharacterSet characterSetWithCharactersInString:@":/?#"]; CFRetain(hostTerminators); } // Start after the separator. unsigned authorityStart = NSMaxRange(separatorRange); // Find terminating character. NSRange hostNameTerminator = [string rangeOfCharacterFromSet:hostTerminators options:0 range:NSMakeRange(authorityStart, stringLength - authorityStart)]; unsigned hostNameEnd = hostNameTerminator.location == NSNotFound ? stringLength : hostNameTerminator.location; // Find "@" for the start of the host name. NSRange userInfoTerminator = [string rangeOfString:@"@" options:0 range:NSMakeRange(authorityStart, hostNameEnd - authorityStart)]; unsigned hostNameStart = userInfoTerminator.location == NSNotFound ? authorityStart : NSMaxRange(userInfoTerminator); f(string, NSMakeRange(hostNameStart, hostNameEnd - hostNameStart), context); } @implementation NSURL (WebNSURLExtras) static void collectRangesThatNeedMapping(NSString *string, NSRange range, void *context, BOOL encode) { BOOL needsMapping = encode ? [string _web_hostNameNeedsEncodingWithRange:range] : [string _web_hostNameNeedsDecodingWithRange:range]; if (!needsMapping) { return; } NSMutableArray **array = (NSMutableArray **)context; if (*array == nil) { *array = [[NSMutableArray alloc] init]; } [*array addObject:[NSValue valueWithRange:range]]; } static void collectRangesThatNeedEncoding(NSString *string, NSRange range, void *context) { return collectRangesThatNeedMapping(string, range, context, YES); } static void collectRangesThatNeedDecoding(NSString *string, NSRange range, void *context) { return collectRangesThatNeedMapping(string, range, context, NO); } static NSString *mapHostNames(NSString *string, BOOL encode) { // Generally, we want to optimize for the case where there is one host name that does not need mapping. if (encode && [string canBeConvertedToEncoding:NSASCIIStringEncoding]) return string; // Make a list of ranges that actually need mapping. NSMutableArray *hostNameRanges = nil; StringRangeApplierFunction f = encode ? collectRangesThatNeedEncoding : collectRangesThatNeedDecoding; applyHostNameFunctionToURLString(string, f, &hostNameRanges); if (hostNameRanges == nil) return string; // Do the mapping. NSMutableString *mutableCopy = [string mutableCopy]; unsigned i = [hostNameRanges count]; while (i-- != 0) { NSRange hostNameRange = [[hostNameRanges objectAtIndex:i] rangeValue]; NSString *mappedHostName = encode ? [string _web_encodeHostNameWithRange:hostNameRange] : [string _web_decodeHostNameWithRange:hostNameRange]; [mutableCopy replaceCharactersInRange:hostNameRange withString:mappedHostName]; } [hostNameRanges release]; return [mutableCopy autorelease]; } + (NSURL *)_web_URLWithUserTypedString:(NSString *)string relativeToURL:(NSURL *)URL { if (string == nil) { return nil; } string = mapHostNames([string _webkit_stringByTrimmingWhitespace], YES); NSData *userTypedData = [string dataUsingEncoding:NSUTF8StringEncoding]; ASSERT(userTypedData); const UInt8 *inBytes = static_cast([userTypedData bytes]); int inLength = [userTypedData length]; if (inLength == 0) { return [NSURL URLWithString:@""]; } char *outBytes = static_cast(malloc(inLength * 3)); // large enough to %-escape every character char *p = outBytes; int outLength = 0; int i; for (i = 0; i < inLength; i++) { UInt8 c = inBytes[i]; if (c <= 0x20 || c >= 0x7f) { *p++ = '%'; *p++ = hexDigit(c >> 4); *p++ = hexDigit(c & 0xf); outLength += 3; } else { *p++ = c; outLength++; } } NSData *data = [NSData dataWithBytesNoCopy:outBytes length:outLength]; // adopts outBytes return [self _web_URLWithData:data relativeToURL:URL]; } + (NSURL *)_web_URLWithUserTypedString:(NSString *)string { return [self _web_URLWithUserTypedString:string relativeToURL:nil]; } + (NSURL *)_web_URLWithDataAsString:(NSString *)string { if (string == nil) { return nil; } return [self _web_URLWithDataAsString:string relativeToURL:nil]; } + (NSURL *)_web_URLWithDataAsString:(NSString *)string relativeToURL:(NSURL *)baseURL { if (string == nil) { return nil; } string = [string _webkit_stringByTrimmingWhitespace]; NSData *data = [string dataUsingEncoding:NSISOLatin1StringEncoding]; return [self _web_URLWithData:data relativeToURL:baseURL]; } + (NSURL *)_web_URLWithData:(NSData *)data { return [NSURL _web_URLWithData:data relativeToURL:nil]; } + (NSURL *)_web_URLWithData:(NSData *)data relativeToURL:(NSURL *)baseURL { if (data == nil) return nil; NSURL *result = nil; size_t length = [data length]; if (length > 0) { // work around : CFURLCreateAbsoluteURLWithBytes(.., TRUE) doesn't remove non-path components. baseURL = [baseURL _webkit_URLByRemovingResourceSpecifier]; const UInt8 *bytes = static_cast([data bytes]); // NOTE: We use UTF-8 here since this encoding is used when computing strings when returning URL components // (e.g calls to NSURL -path). However, this function is not tolerant of illegal UTF-8 sequences, which // could either be a malformed string or bytes in a different encoding, like shift-jis, so we fall back // onto using ISO Latin 1 in those cases. result = WebCFAutorelease(CFURLCreateAbsoluteURLWithBytes(NULL, bytes, length, kCFStringEncodingUTF8, (CFURLRef)baseURL, YES)); if (!result) result = WebCFAutorelease(CFURLCreateAbsoluteURLWithBytes(NULL, bytes, length, kCFStringEncodingISOLatin1, (CFURLRef)baseURL, YES)); } else result = [NSURL URLWithString:@""]; return result; } - (NSData *)_web_originalData { UInt8 *buffer = (UInt8 *)malloc(URL_BYTES_BUFFER_LENGTH); CFIndex bytesFilled = CFURLGetBytes((CFURLRef)self, buffer, URL_BYTES_BUFFER_LENGTH); if (bytesFilled == -1) { CFIndex bytesToAllocate = CFURLGetBytes((CFURLRef)self, NULL, 0); buffer = (UInt8 *)realloc(buffer, bytesToAllocate); bytesFilled = CFURLGetBytes((CFURLRef)self, buffer, bytesToAllocate); ASSERT(bytesFilled == bytesToAllocate); } // buffer is adopted by the NSData NSData *data = [NSData dataWithBytesNoCopy:buffer length:bytesFilled freeWhenDone:YES]; NSURL *baseURL = (NSURL *)CFURLGetBaseURL((CFURLRef)self); if (baseURL) return [[NSURL _web_URLWithData:data relativeToURL:baseURL] _web_originalData]; return data; } - (NSString *)_web_originalDataAsString { return [[[NSString alloc] initWithData:[self _web_originalData] encoding:NSISOLatin1StringEncoding] autorelease]; } static CFStringRef createStringWithEscapedUnsafeCharacters(CFStringRef string) { CFIndex length = CFStringGetLength(string); Vector sourceBuffer(length); CFStringGetCharacters(string, CFRangeMake(0, length), sourceBuffer.data()); Vector outBuffer; CFIndex i = 0; while (i < length) { UChar32 c; U16_NEXT(sourceBuffer, i, length, c) if (isLookalikeCharacter(c)) { uint8_t utf8Buffer[4]; CFIndex offset = 0; UBool failure = false; U8_APPEND(utf8Buffer, offset, 4, c, failure) ASSERT(!failure); for (CFIndex j = 0; j < offset; ++j) { outBuffer.append('%'); outBuffer.append(hexDigit(utf8Buffer[j] >> 4)); outBuffer.append(hexDigit(utf8Buffer[j] & 0xf)); } } else { UChar utf16Buffer[2]; CFIndex offset = 0; UBool failure = false; U16_APPEND(utf16Buffer, offset, 2, c, failure) ASSERT(!failure); for (CFIndex j = 0; j < offset; ++j) outBuffer.append(utf16Buffer[j]); } } return CFStringCreateWithCharacters(NULL, outBuffer.data(), outBuffer.size()); } - (NSString *)_web_userVisibleString { NSData *data = [self _web_originalData]; const unsigned char *before = static_cast([data bytes]); int length = [data length]; bool needsHostNameDecoding = false; const unsigned char *p = before; int bufferLength = (length * 3) + 1; char *after = static_cast(malloc(bufferLength)); // large enough to %-escape every character char *q = after; int i; for (i = 0; i < length; i++) { unsigned char c = p[i]; // unescape escape sequences that indicate bytes greater than 0x7f if (c == '%' && (i + 1 < length && isHexDigit(p[i + 1])) && i + 2 < length && isHexDigit(p[i + 2])) { unsigned char u = (hexDigitValue(p[i + 1]) << 4) | hexDigitValue(p[i + 2]); if (u > 0x7f) { // unescape *q++ = u; } else { // do not unescape *q++ = p[i]; *q++ = p[i + 1]; *q++ = p[i + 2]; } i += 2; } else { *q++ = c; // Check for "xn--" in an efficient, non-case-sensitive, way. if (c == '-' && i >= 3 && !needsHostNameDecoding && (q[-4] | 0x20) == 'x' && (q[-3] | 0x20) == 'n' && q[-2] == '-') needsHostNameDecoding = true; } } *q = '\0'; // Check string to see if it can be converted to display using UTF-8 NSString *result = [NSString stringWithUTF8String:after]; if (!result) { // Could not convert to UTF-8. // Convert characters greater than 0x7f to escape sequences. // Shift current string to the end of the buffer // then we will copy back bytes to the start of the buffer // as we convert. int afterlength = q - after; char *p = after + bufferLength - afterlength - 1; memmove(p, after, afterlength + 1); // copies trailing '\0' char *q = after; while (*p) { unsigned char c = *p; if (c > 0x7f) { *q++ = '%'; *q++ = hexDigit(c >> 4); *q++ = hexDigit(c & 0xf); } else { *q++ = *p; } p++; } *q = '\0'; result = [NSString stringWithUTF8String:after]; } free(after); result = mapHostNames(result, !needsHostNameDecoding); result = [result precomposedStringWithCanonicalMapping]; return WebCFAutorelease(createStringWithEscapedUnsafeCharacters((CFStringRef)result)); } - (BOOL)_web_isEmpty { if (!CFURLGetBaseURL((CFURLRef)self)) return CFURLGetBytes((CFURLRef)self, NULL, 0) == 0; return [[self _web_originalData] length] == 0; } - (const char *)_web_URLCString { NSMutableData *data = [NSMutableData data]; [data appendData:[self _web_originalData]]; [data appendBytes:"\0" length:1]; return (const char *)[data bytes]; } - (NSURL *)_webkit_canonicalize { NSURLRequest *request = [[NSURLRequest alloc] initWithURL:self]; Class concreteClass = WKNSURLProtocolClassForRequest(request); if (!concreteClass) { [request release]; return self; } // This applies NSURL's concept of canonicalization, but not KURL's concept. It would // make sense to apply both, but when we tried that it caused a performance degradation // (see 5315926). It might make sense to apply only the KURL concept and not the NSURL // concept, but it's too risky to make that change for WebKit 3.0. NSURLRequest *newRequest = [concreteClass canonicalRequestForRequest:request]; NSURL *newURL = [newRequest URL]; NSURL *result = [[newURL retain] autorelease]; [request release]; return result; } typedef struct { NSString *scheme; NSString *user; NSString *password; NSString *host; CFIndex port; // kCFNotFound means ignore/omit NSString *path; NSString *query; NSString *fragment; } WebKitURLComponents; - (NSURL *)_webkit_URLByRemovingComponent:(CFURLComponentType)component { CFRange fragRg = CFURLGetByteRangeForComponent((CFURLRef)self, component, NULL); // Check to see if a fragment exists before decomposing the URL. if (fragRg.location == kCFNotFound) return self; UInt8 *urlBytes, buffer[2048]; CFIndex numBytes = CFURLGetBytes((CFURLRef)self, buffer, 2048); if (numBytes == -1) { numBytes = CFURLGetBytes((CFURLRef)self, NULL, 0); urlBytes = static_cast(malloc(numBytes)); CFURLGetBytes((CFURLRef)self, urlBytes, numBytes); } else urlBytes = buffer; NSURL *result = (NSURL *)CFMakeCollectable(CFURLCreateWithBytes(NULL, urlBytes, fragRg.location - 1, kCFStringEncodingUTF8, NULL)); if (!result) result = (NSURL *)CFMakeCollectable(CFURLCreateWithBytes(NULL, urlBytes, fragRg.location - 1, kCFStringEncodingISOLatin1, NULL)); if (urlBytes != buffer) free(urlBytes); return result ? [result autorelease] : self; } - (NSURL *)_webkit_URLByRemovingFragment { return [self _webkit_URLByRemovingComponent:kCFURLComponentFragment]; } - (NSURL *)_webkit_URLByRemovingResourceSpecifier { return [self _webkit_URLByRemovingComponent:kCFURLComponentResourceSpecifier]; } - (BOOL)_webkit_isJavaScriptURL { return [[self _web_originalDataAsString] _webkit_isJavaScriptURL]; } - (NSString *)_webkit_scriptIfJavaScriptURL { return [[self absoluteString] _webkit_scriptIfJavaScriptURL]; } - (BOOL)_webkit_isFileURL { return [[self _web_originalDataAsString] _webkit_isFileURL]; } - (BOOL)_webkit_isFTPDirectoryURL { return [[self _web_originalDataAsString] _webkit_isFTPDirectoryURL]; } - (BOOL)_webkit_shouldLoadAsEmptyDocument { return [[self _web_originalDataAsString] _webkit_hasCaseInsensitivePrefix:@"about:"] || [self _web_isEmpty]; } - (NSURL *)_web_URLWithLowercasedScheme { CFRange range; CFURLGetByteRangeForComponent((CFURLRef)self, kCFURLComponentScheme, &range); if (range.location == kCFNotFound) { return self; } UInt8 static_buffer[URL_BYTES_BUFFER_LENGTH]; UInt8 *buffer = static_buffer; CFIndex bytesFilled = CFURLGetBytes((CFURLRef)self, buffer, URL_BYTES_BUFFER_LENGTH); if (bytesFilled == -1) { CFIndex bytesToAllocate = CFURLGetBytes((CFURLRef)self, NULL, 0); buffer = static_cast(malloc(bytesToAllocate)); bytesFilled = CFURLGetBytes((CFURLRef)self, buffer, bytesToAllocate); ASSERT(bytesFilled == bytesToAllocate); } int i; BOOL changed = NO; for (i = 0; i < range.length; ++i) { char c = buffer[range.location + i]; char lower = toASCIILower(c); if (c != lower) { buffer[range.location + i] = lower; changed = YES; } } NSURL *result = changed ? (NSURL *)WebCFAutorelease(CFURLCreateAbsoluteURLWithBytes(NULL, buffer, bytesFilled, kCFStringEncodingUTF8, nil, YES)) : (NSURL *)self; if (buffer != static_buffer) { free(buffer); } return result; } -(BOOL)_web_hasQuestionMarkOnlyQueryString { CFRange rangeWithSeparators; CFURLGetByteRangeForComponent((CFURLRef)self, kCFURLComponentQuery, &rangeWithSeparators); if (rangeWithSeparators.location != kCFNotFound && rangeWithSeparators.length == 1) { return YES; } return NO; } -(NSData *)_web_schemeSeparatorWithoutColon { NSData *result = nil; CFRange rangeWithSeparators; CFRange range = CFURLGetByteRangeForComponent((CFURLRef)self, kCFURLComponentScheme, &rangeWithSeparators); if (rangeWithSeparators.location != kCFNotFound) { NSString *absoluteString = [self absoluteString]; NSRange separatorsRange = NSMakeRange(range.location + range.length + 1, rangeWithSeparators.length - range.length - 1); if (separatorsRange.location + separatorsRange.length <= [absoluteString length]) { NSString *slashes = [absoluteString substringWithRange:separatorsRange]; result = [slashes dataUsingEncoding:NSISOLatin1StringEncoding]; } } return result; } #define completeURL (CFURLComponentType)-1 -(NSData *)_web_dataForURLComponentType:(CFURLComponentType)componentType { static int URLComponentTypeBufferLength = 2048; UInt8 staticAllBytesBuffer[URLComponentTypeBufferLength]; UInt8 *allBytesBuffer = staticAllBytesBuffer; CFIndex bytesFilled = CFURLGetBytes((CFURLRef)self, allBytesBuffer, URLComponentTypeBufferLength); if (bytesFilled == -1) { CFIndex bytesToAllocate = CFURLGetBytes((CFURLRef)self, NULL, 0); allBytesBuffer = static_cast(malloc(bytesToAllocate)); bytesFilled = CFURLGetBytes((CFURLRef)self, allBytesBuffer, bytesToAllocate); } CFRange range; if (componentType != completeURL) { range = CFURLGetByteRangeForComponent((CFURLRef)self, componentType, NULL); if (range.location == kCFNotFound) { return nil; } } else { range.location = 0; range.length = bytesFilled; } NSData *componentData = [NSData dataWithBytes:allBytesBuffer + range.location length:range.length]; const unsigned char *bytes = static_cast([componentData bytes]); NSMutableData *resultData = [NSMutableData data]; // NOTE: add leading '?' to query strings non-zero length query strings. // NOTE: retain question-mark only query strings. if (componentType == kCFURLComponentQuery) { if (range.length > 0 || [self _web_hasQuestionMarkOnlyQueryString]) { [resultData appendBytes:"?" length:1]; } } int i; for (i = 0; i < range.length; i++) { unsigned char c = bytes[i]; if (c <= 0x20 || c >= 0x7f) { char escaped[3]; escaped[0] = '%'; escaped[1] = hexDigit(c >> 4); escaped[2] = hexDigit(c & 0xf); [resultData appendBytes:escaped length:3]; } else { char b[1]; b[0] = c; [resultData appendBytes:b length:1]; } } if (staticAllBytesBuffer != allBytesBuffer) { free(allBytesBuffer); } return resultData; } -(NSData *)_web_schemeData { return [self _web_dataForURLComponentType:kCFURLComponentScheme]; } -(NSData *)_web_hostData { NSData *result = [self _web_dataForURLComponentType:kCFURLComponentHost]; NSData *scheme = [self _web_schemeData]; // Take off localhost for file if ([scheme _web_isCaseInsensitiveEqualToCString:"file"]) { return ([result _web_isCaseInsensitiveEqualToCString:"localhost"]) ? nil : result; } return result; } - (NSString *)_web_hostString { NSData *data = [self _web_hostData]; if (!data) { data = [NSData data]; } return [[[NSString alloc] initWithData:[self _web_hostData] encoding:NSUTF8StringEncoding] autorelease]; } - (NSString *)_webkit_suggestedFilenameWithMIMEType:(NSString *)MIMEType { return suggestedFilenameWithMIMEType(self, MIMEType); } @end @implementation NSString (WebNSURLExtras) - (BOOL)_web_isUserVisibleURL { BOOL valid = YES; // get buffer char static_buffer[1024]; const char *p; BOOL success = CFStringGetCString((CFStringRef)self, static_buffer, 1023, kCFStringEncodingUTF8); if (success) { p = static_buffer; } else { p = [self UTF8String]; } int length = strlen(p); // check for characters <= 0x20 or >=0x7f, %-escape sequences of %7f, and xn--, these // are the things that will lead _web_userVisibleString to actually change things. int i; for (i = 0; i < length; i++) { unsigned char c = p[i]; // escape control characters, space, and delete if (c <= 0x20 || c == 0x7f) { valid = NO; break; } else if (c == '%' && (i + 1 < length && isHexDigit(p[i + 1])) && i + 2 < length && isHexDigit(p[i + 2])) { unsigned char u = (hexDigitValue(p[i + 1]) << 4) | hexDigitValue(p[i + 2]); if (u > 0x7f) { valid = NO; break; } i += 2; } else { // Check for "xn--" in an efficient, non-case-sensitive, way. if (c == '-' && i >= 3 && (p[i - 3] | 0x20) == 'x' && (p[i - 2] | 0x20) == 'n' && p[i - 1] == '-') { valid = NO; break; } } } return valid; } - (BOOL)_webkit_isJavaScriptURL { return [self _webkit_hasCaseInsensitivePrefix:@"javascript:"]; } - (BOOL)_webkit_isFileURL { return [self rangeOfString:@"file:" options:(NSCaseInsensitiveSearch | NSAnchoredSearch)].location != NSNotFound; } - (NSString *)_webkit_stringByReplacingValidPercentEscapes { return decodeURLEscapeSequences(self); } - (NSString *)_webkit_scriptIfJavaScriptURL { if (![self _webkit_isJavaScriptURL]) { return nil; } return [[self substringFromIndex:11] _webkit_stringByReplacingValidPercentEscapes]; } - (BOOL)_webkit_isFTPDirectoryURL { int length = [self length]; if (length < 5) { // 5 is length of "ftp:/" return NO; } unichar lastChar = [self characterAtIndex:length - 1]; return lastChar == '/' && [self _webkit_hasCaseInsensitivePrefix:@"ftp:"]; } static BOOL readIDNScriptWhiteListFile(NSString *filename) { if (!filename) { return NO; } FILE *file = fopen([filename fileSystemRepresentation], "r"); if (file == NULL) { return NO; } // Read a word at a time. // Allow comments, starting with # character to the end of the line. while (1) { // Skip a comment if present. int result = fscanf(file, " #%*[^\n\r]%*[\n\r]"); if (result == EOF) { break; } // Read a script name if present. char word[33]; result = fscanf(file, " %32[^# \t\n\r]%*[^# \t\n\r] ", word); if (result == EOF) { break; } if (result == 1) { // Got a word, map to script code and put it into the array. int32_t script = u_getPropertyValueEnum(UCHAR_SCRIPT, word); if (script >= 0 && script < USCRIPT_CODE_LIMIT) { size_t index = script / 32; uint32_t mask = 1 << (script % 32); IDNScriptWhiteList[index] |= mask; } } } fclose(file); return YES; } static void readIDNScriptWhiteList(void) { // Read white list from library. NSArray *dirs = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSAllDomainsMask, YES); int i, numDirs = [dirs count]; for (i = 0; i < numDirs; i++) { NSString *dir = [dirs objectAtIndex:i]; if (readIDNScriptWhiteListFile([dir stringByAppendingPathComponent:@"IDNScriptWhiteList.txt"])) { return; } } // Fall back on white list inside bundle. NSBundle *bundle = [NSBundle bundleWithIdentifier:@"com.apple.WebKit"]; readIDNScriptWhiteListFile([bundle pathForResource:@"IDNScriptWhiteList" ofType:@"txt"]); } static BOOL allCharactersInIDNScriptWhiteList(const UChar *buffer, int32_t length) { pthread_once(&IDNScriptWhiteListFileRead, readIDNScriptWhiteList); int32_t i = 0; while (i < length) { UChar32 c; U16_NEXT(buffer, i, length, c) UErrorCode error = U_ZERO_ERROR; UScriptCode script = uscript_getScript(c, &error); if (error != U_ZERO_ERROR) { LOG_ERROR("got ICU error while trying to look at scripts: %d", error); return NO; } if (script < 0) { LOG_ERROR("got negative number for script code from ICU: %d", script); return NO; } if (script >= USCRIPT_CODE_LIMIT) { return NO; } size_t index = script / 32; uint32_t mask = 1 << (script % 32); if (!(IDNScriptWhiteList[index] & mask)) { return NO; } if (isLookalikeCharacter(c)) return NO; } return YES; } // Return value of nil means no mapping is necessary. // If makeString is NO, then return value is either nil or self to indicate mapping is necessary. // If makeString is YES, then return value is either nil or the mapped string. - (NSString *)_web_mapHostNameWithRange:(NSRange)range encode:(BOOL)encode makeString:(BOOL)makeString { if (range.length > HOST_NAME_BUFFER_LENGTH) { return nil; } if ([self length] == 0) return nil; UChar sourceBuffer[HOST_NAME_BUFFER_LENGTH]; UChar destinationBuffer[HOST_NAME_BUFFER_LENGTH]; NSString *string = self; if (encode && [self rangeOfString:@"%" options:NSLiteralSearch range:range].location != NSNotFound) { NSString *substring = [self substringWithRange:range]; substring = WebCFAutorelease(CFURLCreateStringByReplacingPercentEscapes(NULL, (CFStringRef)substring, CFSTR(""))); if (substring != nil) { string = substring; range = NSMakeRange(0, [string length]); } } int length = range.length; [string getCharacters:sourceBuffer range:range]; UErrorCode error = U_ZERO_ERROR; int32_t numCharactersConverted = (encode ? uidna_IDNToASCII : uidna_IDNToUnicode) (sourceBuffer, length, destinationBuffer, HOST_NAME_BUFFER_LENGTH, UIDNA_ALLOW_UNASSIGNED, NULL, &error); if (error != U_ZERO_ERROR) { return nil; } if (numCharactersConverted == length && memcmp(sourceBuffer, destinationBuffer, length * sizeof(UChar)) == 0) { return nil; } if (!encode && !allCharactersInIDNScriptWhiteList(destinationBuffer, numCharactersConverted)) { return nil; } return makeString ? (NSString *)[NSString stringWithCharacters:destinationBuffer length:numCharactersConverted] : (NSString *)self; } - (BOOL)_web_hostNameNeedsDecodingWithRange:(NSRange)range { return [self _web_mapHostNameWithRange:range encode:NO makeString:NO] != nil; } - (BOOL)_web_hostNameNeedsEncodingWithRange:(NSRange)range { return [self _web_mapHostNameWithRange:range encode:YES makeString:NO] != nil; } - (NSString *)_web_decodeHostNameWithRange:(NSRange)range { return [self _web_mapHostNameWithRange:range encode:NO makeString:YES]; } - (NSString *)_web_encodeHostNameWithRange:(NSRange)range { return [self _web_mapHostNameWithRange:range encode:YES makeString:YES]; } - (NSString *)_web_decodeHostName { NSString *name = [self _web_mapHostNameWithRange:NSMakeRange(0, [self length]) encode:NO makeString:YES]; return name == nil ? self : name; } - (NSString *)_web_encodeHostName { NSString *name = [self _web_mapHostNameWithRange:NSMakeRange(0, [self length]) encode:YES makeString:YES]; return name == nil ? self : name; } -(NSRange)_webkit_rangeOfURLScheme { NSRange colon = [self rangeOfString:@":"]; if (colon.location != NSNotFound && colon.location > 0) { NSRange scheme = {0, colon.location}; static NSCharacterSet *InverseSchemeCharacterSet = nil; if (!InverseSchemeCharacterSet) { /* This stuff is very expensive. 10-15 msec on a 2x1.2GHz. If not cached it swamps everything else when adding items to the autocomplete DB. Makes me wonder if we even need to enforce the character set here. */ NSString *acceptableCharacters = @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+.-"; InverseSchemeCharacterSet = [[[NSCharacterSet characterSetWithCharactersInString:acceptableCharacters] invertedSet] retain]; } NSRange illegals = [self rangeOfCharacterFromSet:InverseSchemeCharacterSet options:0 range:scheme]; if (illegals.location == NSNotFound) return scheme; } return NSMakeRange(NSNotFound, 0); } -(BOOL)_webkit_looksLikeAbsoluteURL { // Trim whitespace because _web_URLWithString allows whitespace. return [[self _webkit_stringByTrimmingWhitespace] _webkit_rangeOfURLScheme].location != NSNotFound; } - (NSString *)_webkit_URLFragment { NSRange fragmentRange; fragmentRange = [self rangeOfString:@"#" options:NSLiteralSearch]; if (fragmentRange.location == NSNotFound) return nil; return [self substringFromIndex:fragmentRange.location + 1]; } @end WebKit/mac/Misc/WebKitNSStringExtras.mm0000644000175000017500000003154511213371321016333 0ustar leelee/* * Copyright (C) 2005, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebKitNSStringExtras.h" #import #import #import #import #import #import #import NSString *WebKitLocalCacheDefaultsKey = @"WebKitLocalCache"; static inline CGFloat webkit_CGCeiling(CGFloat value) { if (sizeof(value) == sizeof(float)) return ceilf(value); return ceil(value); } using namespace WebCore; @implementation NSString (WebKitExtras) static BOOL canUseFastRenderer(const UniChar *buffer, unsigned length) { unsigned i; for (i = 0; i < length; i++) { UCharDirection direction = u_charDirection(buffer[i]); if (direction == U_RIGHT_TO_LEFT || direction > U_OTHER_NEUTRAL) return NO; } return YES; } - (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor { // FIXME: Would be more efficient to change this to C++ and use Vector. unsigned length = [self length]; Vector buffer(length); [self getCharacters:buffer.data()]; if (canUseFastRenderer(buffer.data(), length)) { // The following is a half-assed attempt to match AppKit's rounding rules for drawAtPoint. // It's probably incorrect for high DPI. // If you change this, be sure to test all the text drawn this way in Safari, including // the status bar, bookmarks bar, tab bar, and activity window. point.y = webkit_CGCeiling(point.y); NSGraphicsContext *nsContext = [NSGraphicsContext currentContext]; CGContextRef cgContext = static_cast([nsContext graphicsPort]); GraphicsContext graphicsContext(cgContext); // Safari doesn't flip the NSGraphicsContext before calling WebKit, yet WebCore requires a flipped graphics context. BOOL flipped = [nsContext isFlipped]; if (!flipped) CGContextScaleCTM(cgContext, 1, -1); Font webCoreFont(FontPlatformData(font), ![nsContext isDrawingToScreen]); TextRun run(buffer.data(), length); run.disableRoundingHacks(); CGFloat red; CGFloat green; CGFloat blue; CGFloat alpha; [[textColor colorUsingColorSpaceName:NSDeviceRGBColorSpace] getRed:&red green:&green blue:&blue alpha:&alpha]; graphicsContext.setFillColor(makeRGBA(red * 255, green * 255, blue * 255, alpha * 255)); webCoreFont.drawText(&graphicsContext, run, FloatPoint(point.x, (flipped ? point.y : (-1 * point.y)))); if (!flipped) CGContextScaleCTM(cgContext, 1, -1); } else { // The given point is on the baseline. if ([[NSView focusView] isFlipped]) point.y -= [font ascender]; else point.y += [font descender]; [self drawAtPoint:point withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName, textColor, NSForegroundColorAttributeName, nil]]; } } - (void)_web_drawDoubledAtPoint:(NSPoint)textPoint withTopColor:(NSColor *)topColor bottomColor:(NSColor *)bottomColor font:(NSFont *)font { // turn off font smoothing so translucent text draws correctly (Radar 3118455) [NSGraphicsContext saveGraphicsState]; CGContextSetShouldSmoothFonts(static_cast([[NSGraphicsContext currentContext] graphicsPort]), false); [self _web_drawAtPoint:textPoint font:font textColor:bottomColor]; textPoint.y += 1; [self _web_drawAtPoint:textPoint font:font textColor:topColor]; [NSGraphicsContext restoreGraphicsState]; } - (float)_web_widthWithFont:(NSFont *)font { unsigned length = [self length]; Vector buffer(length); [self getCharacters:buffer.data()]; if (canUseFastRenderer(buffer.data(), length)) { Font webCoreFont(FontPlatformData(font), ![[NSGraphicsContext currentContext] isDrawingToScreen]); TextRun run(buffer.data(), length); run.disableRoundingHacks(); return webCoreFont.floatWidth(run); } return [self sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName, nil]].width; } - (NSString *)_web_stringByAbbreviatingWithTildeInPath { NSString *resolvedHomeDirectory = [NSHomeDirectory() stringByResolvingSymlinksInPath]; NSString *path; if ([self hasPrefix:resolvedHomeDirectory]) { NSString *relativePath = [self substringFromIndex:[resolvedHomeDirectory length]]; path = [NSHomeDirectory() stringByAppendingPathComponent:relativePath]; } else { path = self; } return [path stringByAbbreviatingWithTildeInPath]; } - (NSString *)_web_stringByStrippingReturnCharacters { NSMutableString *newString = [[self mutableCopy] autorelease]; [newString replaceOccurrencesOfString:@"\r" withString:@"" options:NSLiteralSearch range:NSMakeRange(0, [newString length])]; [newString replaceOccurrencesOfString:@"\n" withString:@"" options:NSLiteralSearch range:NSMakeRange(0, [newString length])]; return newString; } + (NSStringEncoding)_web_encodingForResource:(Handle)resource { return CFStringConvertEncodingToNSStringEncoding(stringEncodingForResource(resource)); } - (BOOL)_webkit_isCaseInsensitiveEqualToString:(NSString *)string { return stringIsCaseInsensitiveEqualToString(self, string); } -(BOOL)_webkit_hasCaseInsensitivePrefix:(NSString *)prefix { return [self rangeOfString:prefix options:(NSCaseInsensitiveSearch | NSAnchoredSearch)].location != NSNotFound; } -(BOOL)_webkit_hasCaseInsensitiveSuffix:(NSString *)suffix { return hasCaseInsensitiveSuffix(self, suffix); } -(BOOL)_webkit_hasCaseInsensitiveSubstring:(NSString *)substring { return hasCaseInsensitiveSubstring(self, substring); } -(NSString *)_webkit_filenameByFixingIllegalCharacters { return filenameByFixingIllegalCharacters(self); } -(NSString *)_webkit_stringByTrimmingWhitespace { NSMutableString *trimmed = [[self mutableCopy] autorelease]; CFStringTrimWhitespace((CFMutableStringRef)trimmed); return trimmed; } - (NSString *)_webkit_stringByCollapsingNonPrintingCharacters { NSMutableString *result = [NSMutableString string]; static NSCharacterSet *charactersToTurnIntoSpaces = nil; static NSCharacterSet *charactersToNotTurnIntoSpaces = nil; if (charactersToTurnIntoSpaces == nil) { NSMutableCharacterSet *set = [[NSMutableCharacterSet alloc] init]; [set addCharactersInRange:NSMakeRange(0x00, 0x21)]; [set addCharactersInRange:NSMakeRange(0x7F, 0x01)]; charactersToTurnIntoSpaces = [set copy]; [set release]; charactersToNotTurnIntoSpaces = [[charactersToTurnIntoSpaces invertedSet] retain]; } unsigned length = [self length]; unsigned position = 0; while (position != length) { NSRange nonSpace = [self rangeOfCharacterFromSet:charactersToNotTurnIntoSpaces options:0 range:NSMakeRange(position, length - position)]; if (nonSpace.location == NSNotFound) { break; } NSRange space = [self rangeOfCharacterFromSet:charactersToTurnIntoSpaces options:0 range:NSMakeRange(nonSpace.location, length - nonSpace.location)]; if (space.location == NSNotFound) { space.location = length; } if (space.location > nonSpace.location) { if (position != 0) { [result appendString:@" "]; } [result appendString:[self substringWithRange: NSMakeRange(nonSpace.location, space.location - nonSpace.location)]]; } position = space.location; } return result; } - (NSString *)_webkit_stringByCollapsingWhitespaceCharacters { NSMutableString *result = [[NSMutableString alloc] initWithCapacity:[self length]]; NSCharacterSet *spaces = [NSCharacterSet whitespaceAndNewlineCharacterSet]; static NSCharacterSet *notSpaces = nil; if (notSpaces == nil) notSpaces = [[spaces invertedSet] retain]; unsigned length = [self length]; unsigned position = 0; while (position != length) { NSRange nonSpace = [self rangeOfCharacterFromSet:notSpaces options:0 range:NSMakeRange(position, length - position)]; if (nonSpace.location == NSNotFound) break; NSRange space = [self rangeOfCharacterFromSet:spaces options:0 range:NSMakeRange(nonSpace.location, length - nonSpace.location)]; if (space.location == NSNotFound) space.location = length; if (space.location > nonSpace.location) { if (position != 0) [result appendString:@" "]; [result appendString:[self substringWithRange:NSMakeRange(nonSpace.location, space.location - nonSpace.location)]]; } position = space.location; } return [result autorelease]; } -(NSString *)_webkit_fixedCarbonPOSIXPath { NSFileManager *fileManager = [NSFileManager defaultManager]; if ([fileManager fileExistsAtPath:self]) { // Files exists, no need to fix. return self; } NSMutableArray *pathComponents = [[[self pathComponents] mutableCopy] autorelease]; NSString *volumeName = [pathComponents objectAtIndex:1]; if ([volumeName isEqualToString:@"Volumes"]) { // Path starts with "/Volumes", so the volume name is the next path component. volumeName = [pathComponents objectAtIndex:2]; // Remove "Volumes" from the path because it may incorrectly be part of the path (3163647). // We'll add it back if we have to. [pathComponents removeObjectAtIndex:1]; } if (!volumeName) { // Should only happen if self == "/", so this shouldn't happen because that always exists. return self; } if ([[fileManager _webkit_startupVolumeName] isEqualToString:volumeName]) { // Startup volume name is included in path, remove it. [pathComponents removeObjectAtIndex:1]; } else if ([[fileManager contentsOfDirectoryAtPath:@"/Volumes" error:NULL] containsObject:volumeName]) { // Path starts with other volume name, prepend "/Volumes". [pathComponents insertObject:@"Volumes" atIndex:1]; } else // It's valid. return self; NSString *path = [NSString pathWithComponents:pathComponents]; if (![fileManager fileExistsAtPath:path]) // File at canonicalized path doesn't exist, return original. return self; return path; } + (NSString *)_webkit_localCacheDirectoryWithBundleIdentifier:(NSString*)bundleIdentifier { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString *cacheDir = [defaults objectForKey:WebKitLocalCacheDefaultsKey]; if (!cacheDir || ![cacheDir isKindOfClass:[NSString class]]) { #ifdef BUILDING_ON_TIGER cacheDir = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"]; #else char cacheDirectory[MAXPATHLEN]; size_t cacheDirectoryLen = confstr(_CS_DARWIN_USER_CACHE_DIR, cacheDirectory, MAXPATHLEN); if (cacheDirectoryLen) cacheDir = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:cacheDirectory length:cacheDirectoryLen - 1]; #endif } return [cacheDir stringByAppendingPathComponent:bundleIdentifier]; } @end WebKit/mac/Misc/WebKitErrorsPrivate.h0000644000175000017500000000471210576405433016073 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #define WebKitErrorPlugInCancelledConnection 203 // FIXME: WebKitErrorPlugInWillHandleLoad is used for the cancel we do to prevent loading plugin content twice. See #define WebKitErrorPlugInWillHandleLoad 204 /*! @enum @abstract Policy errors - Pending Public API Review @constant WebKitErrorCannotUseRestrictedPort */ enum { WebKitErrorCannotUseRestrictedPort = 103, }; @interface NSError (WebKitExtras) + (NSError *)_webKitErrorWithCode:(int)code failingURL:(NSString *)URL; + (NSError *)_webKitErrorWithDomain:(NSString *)domain code:(int)code URL:(NSURL *)URL; - (id)_initWithPluginErrorCode:(int)code contentURL:(NSURL *)contentURL pluginPageURL:(NSURL *)pluginPageURL pluginName:(NSString *)pluginName MIMEType:(NSString *)MIMEType; @end WebKit/mac/Misc/WebKitErrors.h0000644000175000017500000000502410361675702014535 0ustar leelee/* * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ extern NSString *WebKitErrorDomain; extern NSString * const WebKitErrorMIMETypeKey; extern NSString * const WebKitErrorPlugInNameKey; extern NSString * const WebKitErrorPlugInPageURLStringKey; /*! @enum @abstract Policy errors @constant WebKitErrorCannotShowMIMEType @constant WebKitErrorCannotShowURL @constant WebKitErrorFrameLoadInterruptedByPolicyChange */ enum { WebKitErrorCannotShowMIMEType = 100, WebKitErrorCannotShowURL = 101, WebKitErrorFrameLoadInterruptedByPolicyChange = 102, }; /*! @enum @abstract Plug-in and java errors @constant WebKitErrorCannotFindPlugIn @constant WebKitErrorCannotLoadPlugIn @constant WebKitErrorJavaUnavailable */ enum { WebKitErrorCannotFindPlugIn = 200, WebKitErrorCannotLoadPlugIn = 201, WebKitErrorJavaUnavailable = 202, }; WebKit/mac/Misc/WebKitErrors.m0000644000175000017500000002032111220356412014524 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import #import #import #import NSString *WebKitErrorDomain = @"WebKitErrorDomain"; NSString * const WebKitErrorMIMETypeKey = @"WebKitErrorMIMETypeKey"; NSString * const WebKitErrorPlugInNameKey = @"WebKitErrorPlugInNameKey"; NSString * const WebKitErrorPlugInPageURLStringKey = @"WebKitErrorPlugInPageURLStringKey"; // Policy errors #define WebKitErrorDescriptionCannotShowMIMEType UI_STRING("Content with specified MIME type can’t be shown", "WebKitErrorCannotShowMIMEType description") #define WebKitErrorDescriptionCannotShowURL UI_STRING("The URL can’t be shown", "WebKitErrorCannotShowURL description") #define WebKitErrorDescriptionFrameLoadInterruptedByPolicyChange UI_STRING("Frame load interrupted", "WebKitErrorFrameLoadInterruptedByPolicyChange description") #define WebKitErrorDescriptionCannotUseRestrictedPort UI_STRING("Not allowed to use restricted network port", "WebKitErrorCannotUseRestrictedPort description") // Plug-in and java errors #define WebKitErrorDescriptionCannotFindPlugin UI_STRING("The plug-in can’t be found", "WebKitErrorCannotFindPlugin description") #define WebKitErrorDescriptionCannotLoadPlugin UI_STRING("The plug-in can’t be loaded", "WebKitErrorCannotLoadPlugin description") #define WebKitErrorDescriptionJavaUnavailable UI_STRING("Java is unavailable", "WebKitErrorJavaUnavailable description") #define WebKitErrorDescriptionPlugInCancelledConnection UI_STRING("Plug-in cancelled", "WebKitErrorPlugInCancelledConnection description") #define WebKitErrorDescriptionPlugInWillHandleLoad UI_STRING("Plug-in handled load", "WebKitErrorPlugInWillHandleLoad description") static pthread_once_t registerErrorsControl = PTHREAD_ONCE_INIT; static void registerErrors(void); @implementation NSError (WebKitExtras) static NSMutableDictionary *descriptions = nil; + (void)_registerWebKitErrors { pthread_once(®isterErrorsControl, registerErrors); } -(id)_webkit_initWithDomain:(NSString *)domain code:(int)code URL:(NSURL *)URL { NSDictionary *descriptionsDict; NSString *localizedDesc; NSDictionary *dict; // insert a localized string here for those folks not savvy to our category methods descriptionsDict = [descriptions objectForKey:domain]; localizedDesc = descriptionsDict ? [descriptionsDict objectForKey:[NSNumber numberWithInt:code]] : nil; dict = [NSDictionary dictionaryWithObjectsAndKeys: URL, @"NSErrorFailingURLKey", [URL absoluteString], @"NSErrorFailingURLStringKey", localizedDesc, NSLocalizedDescriptionKey, nil]; return [self initWithDomain:domain code:code userInfo:dict]; } +(id)_webkit_errorWithDomain:(NSString *)domain code:(int)code URL:(NSURL *)URL { return [[[self alloc] _webkit_initWithDomain:domain code:code URL:URL] autorelease]; } + (NSError *)_webKitErrorWithDomain:(NSString *)domain code:(int)code URL:(NSURL *)URL { [self _registerWebKitErrors]; return [self _webkit_errorWithDomain:domain code:code URL:URL]; } + (NSError *)_webKitErrorWithCode:(int)code failingURL:(NSString *)URLString { return [self _webKitErrorWithDomain:WebKitErrorDomain code:code URL:[NSURL _web_URLWithUserTypedString:URLString]]; } - (id)_initWithPluginErrorCode:(int)code contentURL:(NSURL *)contentURL pluginPageURL:(NSURL *)pluginPageURL pluginName:(NSString *)pluginName MIMEType:(NSString *)MIMEType { [[self class] _registerWebKitErrors]; NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init]; NSDictionary *descriptionsForWebKitErrorDomain = [descriptions objectForKey:WebKitErrorDomain]; NSString *localizedDescription = [descriptionsForWebKitErrorDomain objectForKey:[NSNumber numberWithInt:code]]; if (localizedDescription) [userInfo setObject:localizedDescription forKey:NSLocalizedDescriptionKey]; if (contentURL) { [userInfo setObject:contentURL forKey:@"NSErrorFailingURLKey"]; #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) [userInfo setObject:[contentURL _web_userVisibleString] forKey:NSErrorFailingURLStringKey]; #else [userInfo setObject:[contentURL _web_userVisibleString] forKey:NSURLErrorFailingURLStringErrorKey]; #endif } if (pluginPageURL) { [userInfo setObject:[pluginPageURL _web_userVisibleString] forKey:WebKitErrorPlugInPageURLStringKey]; } if (pluginName) { [userInfo setObject:pluginName forKey:WebKitErrorPlugInNameKey]; } if (MIMEType) { [userInfo setObject:MIMEType forKey:WebKitErrorMIMETypeKey]; } NSDictionary *userInfoCopy = [userInfo count] > 0 ? [[NSDictionary alloc] initWithDictionary:userInfo] : nil; [userInfo release]; NSError *error = [self initWithDomain:WebKitErrorDomain code:code userInfo:userInfoCopy]; [userInfoCopy release]; return error; } + (void)_webkit_addErrorsWithCodesAndDescriptions:(NSDictionary *)dictionary inDomain:(NSString *)domain { if (!descriptions) descriptions = [[NSMutableDictionary alloc] init]; [descriptions setObject:dictionary forKey:domain]; } static void registerErrors() { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: // Policy errors WebKitErrorDescriptionCannotShowMIMEType, [NSNumber numberWithInt: WebKitErrorCannotShowMIMEType], WebKitErrorDescriptionCannotShowURL, [NSNumber numberWithInt: WebKitErrorCannotShowURL], WebKitErrorDescriptionFrameLoadInterruptedByPolicyChange, [NSNumber numberWithInt: WebKitErrorFrameLoadInterruptedByPolicyChange], WebKitErrorDescriptionCannotUseRestrictedPort, [NSNumber numberWithInt: WebKitErrorCannotUseRestrictedPort], // Plug-in and java errors WebKitErrorDescriptionCannotFindPlugin, [NSNumber numberWithInt: WebKitErrorCannotFindPlugIn], WebKitErrorDescriptionCannotLoadPlugin, [NSNumber numberWithInt: WebKitErrorCannotLoadPlugIn], WebKitErrorDescriptionJavaUnavailable, [NSNumber numberWithInt: WebKitErrorJavaUnavailable], WebKitErrorDescriptionPlugInCancelledConnection, [NSNumber numberWithInt: WebKitErrorPlugInCancelledConnection], WebKitErrorDescriptionPlugInWillHandleLoad, [NSNumber numberWithInt: WebKitErrorPlugInWillHandleLoad], nil]; [NSError _webkit_addErrorsWithCodesAndDescriptions:dict inDomain:WebKitErrorDomain]; [pool drain]; } @end WebKit/mac/Misc/WebNSNotificationCenterExtras.h0000644000175000017500000000403210744307516020026 0ustar leelee/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNSNotificationCenterExtras.h" @interface NSNotificationCenter (WebNSNotificationCenterExtras) - (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object; - (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object userInfo:(NSDictionary *)userInfo; - (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object userInfo:(NSDictionary *)userInfo waitUntilDone:(BOOL)wait; + (void)_postNotificationName:(NSDictionary *)info; @end WebKit/mac/Misc/EmptyProtocolDefinitions.h0000644000175000017500000000350011100440715017146 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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. */ #if defined(__OBJC__) #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) #define DELEGATES_DECLARED_AS_FORMAL_PROTOCOLS 0 #else #define DELEGATES_DECLARED_AS_FORMAL_PROTOCOLS 1 #endif #if !DELEGATES_DECLARED_AS_FORMAL_PROTOCOLS #define EMPTY_PROTOCOL(NAME) \ @protocol NAME \ @end EMPTY_PROTOCOL(NSTableViewDataSource) EMPTY_PROTOCOL(NSTableViewDelegate) EMPTY_PROTOCOL(NSWindowDelegate) #undef EMPTY_PROTOCOL #endif /* !DELEGATES_DECLARED_AS_FORMAL_PROTOCOLS */ #endif /* defined(__OBJC__) */ WebKit/mac/Misc/WebNSNotificationCenterExtras.m0000644000175000017500000000562610744307516020045 0ustar leelee/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNSNotificationCenterExtras.h" @implementation NSNotificationCenter (WebNSNotificationCenterExtras) - (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object { [self postNotificationOnMainThreadWithName:name object:object userInfo:nil waitUntilDone:NO]; } - (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object userInfo:(NSDictionary *)userInfo { [self postNotificationOnMainThreadWithName:name object:object userInfo:userInfo waitUntilDone:NO]; } - (void)postNotificationOnMainThreadWithName:(NSString *)name object:(id)object userInfo:(NSDictionary *)userInfo waitUntilDone:(BOOL)wait { NSMutableDictionary *info = [[NSMutableDictionary alloc] initWithCapacity:3]; if (name) [info setObject:name forKey:@"name"]; if (object) [info setObject:object forKey:@"object"]; if (userInfo) [info setObject:userInfo forKey:@"userInfo"]; [[self class] performSelectorOnMainThread:@selector(_postNotificationName:) withObject:info waitUntilDone:wait]; } + (void)_postNotificationName:(NSDictionary *)info { NSString *name = [info objectForKey:@"name"]; id object = [info objectForKey:@"object"]; NSDictionary *userInfo = [info objectForKey:@"userInfo"]; [[self defaultCenter] postNotificationName:name object:object userInfo:userInfo]; [info release]; } @end WebKit/mac/Misc/WebStringTruncator.mm0000644000175000017500000000635711213371321016140 0ustar leelee/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebStringTruncator.h" #import "WebSystemInterface.h" #import #import #import #import #import using namespace WebCore; static NSFont *defaultMenuFont() { static NSFont *defaultMenuFont = nil; if (!defaultMenuFont) { defaultMenuFont = [NSFont menuFontOfSize:0]; CFRetain(defaultMenuFont); } return defaultMenuFont; } static Font& fontFromNSFont(NSFont *font) { static NSFont *currentFont; DEFINE_STATIC_LOCAL(Font, currentRenderer, ()); if ([font isEqual:currentFont]) return currentRenderer; if (currentFont) CFRelease(currentFont); currentFont = font; CFRetain(currentFont); FontPlatformData f(font); currentRenderer = Font(f, ![[NSGraphicsContext currentContext] isDrawingToScreen]); return currentRenderer; } @implementation WebStringTruncator + (void)initialize { InitWebCoreSystemInterface(); } + (NSString *)centerTruncateString:(NSString *)string toWidth:(float)maxWidth { return StringTruncator::centerTruncate(string, maxWidth, fontFromNSFont(defaultMenuFont())); } + (NSString *)centerTruncateString:(NSString *)string toWidth:(float)maxWidth withFont:(NSFont *)font { return StringTruncator::centerTruncate(string, maxWidth, fontFromNSFont(font)); } + (NSString *)rightTruncateString:(NSString *)string toWidth:(float)maxWidth withFont:(NSFont *)font { return StringTruncator::rightTruncate(string, maxWidth, fontFromNSFont(font)); } + (float)widthOfString:(NSString *)string font:(NSFont *)font { return StringTruncator::width(string, fontFromNSFont(font)); } @end WebKit/mac/Misc/WebNSURLExtras.h0000644000175000017500000001001611140224050014656 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @interface NSURL (WebNSURLExtras) + (NSURL *)_web_URLWithUserTypedString:(NSString *)string; + (NSURL *)_web_URLWithUserTypedString:(NSString *)string relativeToURL:(NSURL *)URL; + (NSURL *)_web_URLWithDataAsString:(NSString *)string; + (NSURL *)_web_URLWithDataAsString:(NSString *)string relativeToURL:(NSURL *)baseURL; + (NSURL *)_web_URLWithData:(NSData *)data; + (NSURL *)_web_URLWithData:(NSData *)data relativeToURL:(NSURL *)baseURL; - (NSURL *)_web_URLWithLowercasedScheme; - (NSData *)_web_originalData; - (NSString *)_web_originalDataAsString; - (const char *)_web_URLCString; - (NSData *)_web_hostData; - (NSString *)_web_hostString; - (NSString *)_web_userVisibleString; - (BOOL)_web_isEmpty; // FIXME: change these names back to _web_ when identically-named // methods are removed from Foundation - (NSURL *)_webkit_canonicalize; - (NSURL *)_webkit_URLByRemovingFragment; - (NSURL *)_webkit_URLByRemovingResourceSpecifier; - (BOOL)_webkit_isJavaScriptURL; - (BOOL)_webkit_isFileURL; - (NSString *)_webkit_scriptIfJavaScriptURL; - (BOOL)_webkit_isFTPDirectoryURL; - (BOOL)_webkit_shouldLoadAsEmptyDocument; - (NSString *)_webkit_suggestedFilenameWithMIMEType:(NSString *)MIMEType; @end @interface NSString (WebNSURLExtras) - (BOOL)_web_isUserVisibleURL; - (BOOL)_web_hostNameNeedsDecodingWithRange:(NSRange)range; // returns NO if decodeHostNameWithRange: would return nil, but more efficient - (BOOL)_web_hostNameNeedsEncodingWithRange:(NSRange)range; // returns NO if encodeHostNameWithRange: would return nil, but more efficient - (NSString *)_web_decodeHostNameWithRange:(NSRange)range; // turns funny-looking ASCII form into Unicode, returns nil if no decoding needed - (NSString *)_web_encodeHostNameWithRange:(NSRange)range; // turns Unicode into funny-looking ASCII form, returns nil if no decoding needed - (NSString *)_web_decodeHostName; // turns funny-looking ASCII form into Unicode, returns self if no decoding needed, convenient cover - (NSString *)_web_encodeHostName; // turns Unicode into funny-looking ASCII form, returns self if no decoding needed, convenient cover // FIXME: change these names back to _web_ when identically-named // methods are removed from or renamed in Foundation - (BOOL)_webkit_isJavaScriptURL; - (BOOL)_webkit_isFTPDirectoryURL; - (BOOL)_webkit_isFileURL; - (BOOL)_webkit_looksLikeAbsoluteURL; - (NSRange)_webkit_rangeOfURLScheme; - (NSString *)_webkit_URLFragment; - (NSString *)_webkit_scriptIfJavaScriptURL; @end WebKit/mac/Misc/WebNSDataExtrasPrivate.h0000644000175000017500000000324210401534421016430 0ustar leelee/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @interface NSData (WebKitExtras) -(NSString *)_webkit_guessedMIMEType; @end WebKit/mac/Misc/WebKitStatisticsPrivate.h0000644000175000017500000000330510766122014016736 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ extern int WebViewCount; extern int WebDataSourceCount; extern int WebFrameCount; extern int WebHTMLRepresentationCount; extern int WebFrameViewCount; WebKit/mac/Misc/WebDownloadInternal.h0000644000175000017500000000404010361675702016052 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @interface WebDownload (WebDownloadCreation) +(id)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)r delegate:(id)delegate proxy:(id)proxy; +(id)_downloadWithRequest:(NSURLRequest *)request delegate:(id)delegate directory:(NSString *)directory; @end WebKit/mac/Misc/WebKitNSStringExtras.h0000644000175000017500000000546411203073422016152 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 extern NSString *WebKitLocalCacheDefaultsKey; @interface NSString (WebKitExtras) - (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor; - (void)_web_drawDoubledAtPoint:(NSPoint)textPoint withTopColor:(NSColor *)topColor bottomColor:(NSColor *)bottomColor font:(NSFont *)font; - (float)_web_widthWithFont:(NSFont *)font; // Handles home directories that have symlinks in their paths. // This works around 2774250. - (NSString *)_web_stringByAbbreviatingWithTildeInPath; - (NSString *)_web_stringByStrippingReturnCharacters; + (NSStringEncoding)_web_encodingForResource:(Handle)resource; - (BOOL)_webkit_isCaseInsensitiveEqualToString:(NSString *)string; - (BOOL)_webkit_hasCaseInsensitivePrefix:(NSString *)suffix; - (BOOL)_webkit_hasCaseInsensitiveSuffix:(NSString *)suffix; - (BOOL)_webkit_hasCaseInsensitiveSubstring:(NSString *)substring; - (NSString *)_webkit_filenameByFixingIllegalCharacters; - (NSString *)_webkit_stringByTrimmingWhitespace; - (NSString *)_webkit_stringByCollapsingNonPrintingCharacters; - (NSString *)_webkit_stringByCollapsingWhitespaceCharacters; - (NSString *)_webkit_fixedCarbonPOSIXPath; + (NSString *)_webkit_localCacheDirectoryWithBundleIdentifier:(NSString*)bundleIdentifier; @end WebKit/mac/Misc/WebNSEventExtras.h0000644000175000017500000000346210360512352015314 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @interface NSEvent (WebExtras) -(BOOL)_web_isKeyEvent:(unichar)key; -(BOOL)_web_isDeleteKeyEvent; -(BOOL)_web_isEscapeKeyEvent; -(BOOL)_web_isOptionTabKeyEvent; -(BOOL)_web_isReturnOrEnterKeyEvent; -(BOOL)_web_isTabKeyEvent; @end WebKit/mac/Misc/WebIconDatabaseInternal.h0000644000175000017500000000407411130573173016621 0ustar leelee/* * Copyright (C) 2006, 2007, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebIconDatabasePrivate.h" namespace WebCore { class Image; } @interface WebIconDatabasePrivate : NSObject { @public id delegate; BOOL delegateImplementsDefaultIconForURL; NSMutableDictionary *htmlIcons; } @end @interface WebIconDatabase (WebInternal) - (void)_sendNotificationForURL:(NSString *)URL; - (void)_sendDidRemoveAllIconsNotification; - (void)_shutDownIconDatabase; - (void)_startUpIconDatabase; @end extern bool importToWebCoreFormat(); NSImage *webGetNSImage(WebCore::Image*, NSSize); WebKit/mac/Misc/WebNSPasteboardExtras.h0000644000175000017500000000732110671343620016322 0ustar leelee/* * Copyright (C) 2005, 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @class DOMElement; @class WebArchive; @class WebHTMLView; #ifdef __cplusplus extern "C" { #endif extern NSString *WebURLPboardType; extern NSString *WebURLNamePboardType; @interface NSPasteboard (WebExtras) // Returns the array of types that _web_writeURL:andTitle: handles. + (NSArray *)_web_writableTypesForURL; // Returns the array of types that _web_writeImage handles. + (NSArray *)_web_writableTypesForImageIncludingArchive:(BOOL)hasArchive; // Returns the array of drag types that _web_bestURL handles; note that the presence // of one or more of these drag types on the pasteboard is not a guarantee that // _web_bestURL will return a non-nil result. + (NSArray *)_web_dragTypesForURL; // Finds the best URL from the data on the pasteboard, giving priority to http and https URLs - (NSURL *)_web_bestURL; // Writes the URL to the pasteboard with the passed types. - (void)_web_writeURL:(NSURL *)URL andTitle:(NSString *)title types:(NSArray *)types; // Sets the text on the NSFindPboard. Returns the new changeCount for the NSFindPboard. + (int)_web_setFindPasteboardString:(NSString *)string withOwner:(id)owner; // Writes a file wrapper to the pasteboard as an RTFD attachment. // NSRTFDPboardType must be declared on the pasteboard before calling this method. - (void)_web_writeFileWrapperAsRTFDAttachment:(NSFileWrapper *)wrapper; // Writes an image, URL and other optional types to the pasteboard. - (void)_web_writeImage:(NSImage *)image element:(DOMElement*)element URL:(NSURL *)URL title:(NSString *)title archive:(WebArchive *)archive types:(NSArray *)types source:(WebHTMLView *)source; - (id)_web_declareAndWriteDragImageForElement:(DOMElement *)element URL:(NSURL *)URL title:(NSString *)title archive:(WebArchive *)archive source:(WebHTMLView *)source; - (void)_web_writePromisedRTFDFromArchive:(WebArchive*)archive containsImage:(BOOL)containsImage; @end #ifdef __cplusplus } #endif WebKit/mac/Misc/WebIconFetcherInternal.h0000644000175000017500000000324511015335302016464 0ustar leelee/* * Copyright (C) 2008 Apple 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 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 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 #import namespace WebCore { class IconFetcher; } @class WebFrame; @interface WebIconFetcher (WebInternal) + (WebIconFetcher *)_fetchApplicationIconForFrame:(WebFrame *)webFrame target:(id)target selector:(SEL)selector; @end WebKit/mac/Misc/WebNSEventExtras.m0000644000175000017500000000552110360512352015317 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @implementation NSEvent (WebExtras) -(BOOL)_web_isKeyEvent:(unichar)key { int type = [self type]; if (type != NSKeyDown && type != NSKeyUp) return NO; NSString *chars = [self charactersIgnoringModifiers]; if ([chars length] != 1) return NO; unichar c = [chars characterAtIndex:0]; if (c != key) return NO; return YES; } - (BOOL)_web_isDeleteKeyEvent { const unichar deleteKey = NSDeleteCharacter; const unichar deleteForwardKey = NSDeleteFunctionKey; return [self _web_isKeyEvent:deleteKey] || [self _web_isKeyEvent:deleteForwardKey]; } - (BOOL)_web_isEscapeKeyEvent { const unichar escapeKey = 0x001b; return [self _web_isKeyEvent:escapeKey]; } - (BOOL)_web_isOptionTabKeyEvent { return ([self modifierFlags] & NSAlternateKeyMask) && [self _web_isTabKeyEvent]; } - (BOOL)_web_isReturnOrEnterKeyEvent { const unichar enterKey = NSEnterCharacter; const unichar returnKey = NSCarriageReturnCharacter; return [self _web_isKeyEvent:enterKey] || [self _web_isKeyEvent:returnKey]; } - (BOOL)_web_isTabKeyEvent { const unichar tabKey = 0x0009; const unichar shiftTabKey = 0x0019; return [self _web_isKeyEvent:tabKey] || [self _web_isKeyEvent:shiftTabKey]; } @end WebKit/mac/Misc/OldWebAssertions.c0000644000175000017500000000361010744440405015367 0ustar leelee/* * Copyright (C) 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. */ /* These functions are not used anymore, but need to stay for binary compatibility . */ /* You should use . */ void WebReportAssertionFailure(const char *file, int line, const char *function, const char *assertion); void WebReportError(const char *file, int line, const char *function, const char *format, ...); void WebReportAssertionFailure(const char *file, int line, const char *function, const char *assertion) { } void WebReportError(const char *file, int line, const char *function, const char *format, ...) { } WebKit/mac/Misc/WebNSWindowExtras.h0000644000175000017500000000333210550716641015506 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 @interface NSWindow (WebExtras) // centers "visually", putting 1/3 of the remaining space above, and 2/3 below - (void)centerOverMainWindow; @end WebKit/mac/Misc/WebAssertions.h0000644000175000017500000000332210744307516014742 0ustar leelee/* * Copyright (C) 2007 Apple 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. */ /* This header is needed only for backwards-compatibility with internal clients * which have yet to move away from it: . */ #warning is deprecated. Please move away from this SPI as soon as is possible. #define ASSERT(...) ((void)0) #define ASSERT_NOT_REACHED(...) ((void)0) #define ASSERT_ARG(...) ((void)0) #define ERROR(...) ((void)0) WebKit/mac/Misc/WebKitLogging.h0000644000175000017500000000644311124255324014645 0ustar leelee/* * Copyright (C) 2005, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #ifndef LOG_CHANNEL_PREFIX #define LOG_CHANNEL_PREFIX WebKitLog #endif #ifdef __cplusplus extern "C" { #endif extern WTFLogChannel WebKitLogTiming; extern WTFLogChannel WebKitLogLoading; extern WTFLogChannel WebKitLogFontCache; extern WTFLogChannel WebKitLogFontSubstitution; extern WTFLogChannel WebKitLogFontSelection; extern WTFLogChannel WebKitLogDownload; extern WTFLogChannel WebKitLogDocumentLoad; extern WTFLogChannel WebKitLogPlugins; extern WTFLogChannel WebKitLogEvents; extern WTFLogChannel WebKitLogView; extern WTFLogChannel WebKitLogRedirect; extern WTFLogChannel WebKitLogPageCache; extern WTFLogChannel WebKitLogCacheSizes; extern WTFLogChannel WebKitLogFormDelegate; extern WTFLogChannel WebKitLogFileDatabaseActivity; extern WTFLogChannel WebKitLogHistory; extern WTFLogChannel WebKitLogBindings; extern WTFLogChannel WebKitLogEncoding; extern WTFLogChannel WebKitLogLiveConnect; extern WTFLogChannel WebKitLogBackForward; extern WTFLogChannel WebKitLogProgress; extern WTFLogChannel WebKitLogPluginEvents; extern WTFLogChannel WebKitLogIconDatabase; extern WTFLogChannel WebKitLogTextInput; void WebKitInitializeLoggingChannelsIfNecessary(void); // FIXME: Why is this in the "logging" header file? // Use WebCoreThreadViolationCheck instead for checks that throw an exception even in production builds. #if !defined(NDEBUG) && !defined(DISABLE_THREAD_CHECK) #define ASSERT_MAIN_THREAD() do \ if (!pthread_main_np()) { \ WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, ""); \ CRASH(); \ } \ while (0) #else #define ASSERT_MAIN_THREAD() ((void)0) #endif void ReportDiscardedDelegateException(SEL delegateSelector, id exception); #ifdef __cplusplus } #endif WebKit/mac/Misc/WebCoreStatistics.h0000644000175000017500000000577511227411261015557 0ustar leelee/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import @interface WebCoreStatistics : NSObject { } + (NSArray *)statistics; + (size_t)javaScriptObjectsCount; + (size_t)javaScriptGlobalObjectsCount; + (size_t)javaScriptProtectedObjectsCount; + (size_t)javaScriptProtectedGlobalObjectsCount; + (NSCountedSet *)javaScriptProtectedObjectTypeCounts; + (void)garbageCollectJavaScriptObjects; + (void)garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging:(BOOL)waitUntilDone; + (size_t)iconPageURLMappingCount; + (size_t)iconRetainedPageURLCount; + (size_t)iconRecordCount; + (size_t)iconsWithDataCount; + (size_t)cachedFontDataCount; + (size_t)cachedFontDataInactiveCount; + (void)purgeInactiveFontData; + (size_t)glyphPageCount; + (BOOL)shouldPrintExceptions; + (void)setShouldPrintExceptions:(BOOL)print; + (void)startIgnoringWebCoreNodeLeaks; + (void)stopIgnoringWebCoreNodeLeaks; + (NSDictionary *)memoryStatistics; + (void)returnFreeMemoryToSystem; + (int)cachedPageCount; + (int)cachedFrameCount; + (int)autoreleasedPageCount; // Deprecated, but used by older versions of Safari. + (void)emptyCache; + (void)setCacheDisabled:(BOOL)disabled; + (size_t)javaScriptNoGCAllowedObjectsCount; + (size_t)javaScriptReferencedObjectsCount; + (NSSet *)javaScriptRootObjectClasses; + (NSCountedSet *)javaScriptRootObjectTypeCounts; + (size_t)javaScriptInterpretersCount; @end @interface WebFrame (WebKitDebug) - (NSString *)renderTreeAsExternalRepresentation; @end WebKit/mac/Misc/WebIconDatabase.mm0000644000175000017500000006105211226027074015305 0ustar leelee/* * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebIconDatabaseInternal.h" #import "WebIconDatabaseClient.h" #import "WebIconDatabaseDelegate.h" #import "WebKitLogging.h" #import "WebKitNSStringExtras.h" #import "WebNSFileManagerExtras.h" #import "WebNSNotificationCenterExtras.h" #import "WebNSURLExtras.h" #import "WebPreferences.h" #import "WebTypesInternal.h" #import #import #import #import using namespace WebCore; NSString * const WebIconDatabaseVersionKey = @"WebIconDatabaseVersion"; NSString * const WebURLToIconURLKey = @"WebSiteURLToIconURLKey"; NSString *WebIconDatabaseDidAddIconNotification = @"WebIconDatabaseDidAddIconNotification"; NSString *WebIconNotificationUserInfoURLKey = @"WebIconNotificationUserInfoURLKey"; NSString *WebIconDatabaseDidRemoveAllIconsNotification = @"WebIconDatabaseDidRemoveAllIconsNotification"; NSString *WebIconDatabaseDirectoryDefaultsKey = @"WebIconDatabaseDirectoryDefaultsKey"; NSString *WebIconDatabaseImportDirectoryDefaultsKey = @"WebIconDatabaseImportDirectoryDefaultsKey"; NSString *WebIconDatabaseEnabledDefaultsKey = @"WebIconDatabaseEnabled"; NSString *WebIconDatabasePath = @"~/Library/Icons"; NSSize WebIconSmallSize = {16, 16}; NSSize WebIconMediumSize = {32, 32}; NSSize WebIconLargeSize = {128, 128}; #define UniqueFilePathSize (34) static WebIconDatabaseClient* defaultClient() { #if ENABLE(ICONDATABASE) static WebIconDatabaseClient* defaultClient = new WebIconDatabaseClient(); return defaultClient; #else return 0; #endif } @interface WebIconDatabase (WebReallyInternal) - (void)_sendNotificationForURL:(NSString *)URL; - (void)_sendDidRemoveAllIconsNotification; - (NSImage *)_iconForFileURL:(NSString *)fileURL withSize:(NSSize)size; - (void)_resetCachedWebPreferences:(NSNotification *)notification; - (NSImage *)_largestIconFromDictionary:(NSMutableDictionary *)icons; - (NSMutableDictionary *)_iconsBySplittingRepresentationsOfIcon:(NSImage *)icon; - (NSImage *)_iconFromDictionary:(NSMutableDictionary *)icons forSize:(NSSize)size cache:(BOOL)cache; - (void)_scaleIcon:(NSImage *)icon toSize:(NSSize)size; - (NSString *)_databaseDirectory; @end @implementation WebIconDatabase + (WebIconDatabase *)sharedIconDatabase { static WebIconDatabase *database = nil; if (!database) database = [[WebIconDatabase alloc] init]; return database; } - init { [super init]; WebCoreThreadViolationCheckRoundOne(); _private = [[WebIconDatabasePrivate alloc] init]; // Check the user defaults and see if the icon database should even be enabled. // Inform the bridge and, if we're disabled, bail from init right here NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; // - IconDatabase should be disabled by default NSDictionary *initialDefaults = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithBool:YES], WebIconDatabaseEnabledDefaultsKey, nil]; [defaults registerDefaults:initialDefaults]; [initialDefaults release]; BOOL enabled = [defaults boolForKey:WebIconDatabaseEnabledDefaultsKey]; iconDatabase()->setEnabled(enabled); if (enabled) [self _startUpIconDatabase]; return self; } - (NSImage *)iconForURL:(NSString *)URL withSize:(NSSize)size cache:(BOOL)cache { ASSERT_MAIN_THREAD(); ASSERT(size.width); ASSERT(size.height); if (!URL || ![self isEnabled]) return [self defaultIconForURL:URL withSize:size]; // FIXME - - Move the handling of FileURLs to WebCore and implement in ObjC++ if ([URL _webkit_isFileURL]) return [self _iconForFileURL:URL withSize:size]; if (Image* image = iconDatabase()->iconForPageURL(URL, IntSize(size))) if (NSImage *icon = webGetNSImage(image, size)) return icon; return [self defaultIconForURL:URL withSize:size]; } - (NSImage *)iconForURL:(NSString *)URL withSize:(NSSize)size { return [self iconForURL:URL withSize:size cache:YES]; } - (NSString *)iconURLForURL:(NSString *)URL { if (![self isEnabled]) return nil; ASSERT_MAIN_THREAD(); return iconDatabase()->iconURLForPageURL(URL); } - (NSImage *)defaultIconWithSize:(NSSize)size { ASSERT_MAIN_THREAD(); ASSERT(size.width); ASSERT(size.height); Image* image = iconDatabase()->defaultIcon(IntSize(size)); return image ? image->getNSImage() : nil; } - (NSImage *)defaultIconForURL:(NSString *)URL withSize:(NSSize)size { if (_private->delegateImplementsDefaultIconForURL) return [_private->delegate webIconDatabase:self defaultIconForURL:URL withSize:size]; return [self defaultIconWithSize:size]; } - (void)retainIconForURL:(NSString *)URL { ASSERT_MAIN_THREAD(); ASSERT(URL); if (![self isEnabled]) return; iconDatabase()->retainIconForPageURL(URL); } - (void)releaseIconForURL:(NSString *)pageURL { ASSERT_MAIN_THREAD(); ASSERT(pageURL); if (![self isEnabled]) return; iconDatabase()->releaseIconForPageURL(pageURL); } + (void)delayDatabaseCleanup { ASSERT_MAIN_THREAD(); IconDatabase::delayDatabaseCleanup(); } + (void)allowDatabaseCleanup { ASSERT_MAIN_THREAD(); IconDatabase::allowDatabaseCleanup(); } - (void)setDelegate:(id)delegate { _private->delegate = delegate; _private->delegateImplementsDefaultIconForURL = [delegate respondsToSelector:@selector(webIconDatabase:defaultIconForURL:withSize:)]; } - (id)delegate { return _private->delegate; } @end @implementation WebIconDatabase (WebPendingPublic) - (BOOL)isEnabled { return iconDatabase()->isEnabled(); } - (void)setEnabled:(BOOL)flag { BOOL currentlyEnabled = [self isEnabled]; if (currentlyEnabled && !flag) { iconDatabase()->setEnabled(false); [self _shutDownIconDatabase]; } else if (!currentlyEnabled && flag) { iconDatabase()->setEnabled(true); [self _startUpIconDatabase]; } } - (void)removeAllIcons { ASSERT_MAIN_THREAD(); if (![self isEnabled]) return; // Via the IconDatabaseClient interface, removeAllIcons() will send the WebIconDatabaseDidRemoveAllIconsNotification iconDatabase()->removeAllIcons(); } @end @implementation WebIconDatabase (WebPrivate) + (void)_checkIntegrityBeforeOpening { iconDatabase()->checkIntegrityBeforeOpening(); } @end @implementation WebIconDatabase (WebInternal) - (void)_sendNotificationForURL:(NSString *)URL { ASSERT(URL); NSDictionary *userInfo = [NSDictionary dictionaryWithObject:URL forKey:WebIconNotificationUserInfoURLKey]; [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:WebIconDatabaseDidAddIconNotification object:self userInfo:userInfo]; } - (void)_sendDidRemoveAllIconsNotification { [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:WebIconDatabaseDidRemoveAllIconsNotification object:self userInfo:nil]; } - (void)_startUpIconDatabase { iconDatabase()->setClient(defaultClient()); // Figure out the directory we should be using for the icon.db NSString *databaseDirectory = [self _databaseDirectory]; // Rename legacy icon database files to the new icon database name BOOL isDirectory = NO; NSString *legacyDB = [databaseDirectory stringByAppendingPathComponent:@"icon.db"]; NSFileManager *defaultManager = [NSFileManager defaultManager]; if ([defaultManager fileExistsAtPath:legacyDB isDirectory:&isDirectory] && !isDirectory) { NSString *newDB = [databaseDirectory stringByAppendingPathComponent:iconDatabase()->defaultDatabaseFilename()]; if (![defaultManager fileExistsAtPath:newDB]) rename([legacyDB fileSystemRepresentation], [newDB fileSystemRepresentation]); } // Set the private browsing pref then open the WebCore icon database iconDatabase()->setPrivateBrowsingEnabled([[WebPreferences standardPreferences] privateBrowsingEnabled]); if (!iconDatabase()->open(databaseDirectory)) LOG_ERROR("Unable to open icon database"); // Register for important notifications [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationWillTerminate:) name:NSApplicationWillTerminateNotification object:NSApp]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_resetCachedWebPreferences:) name:WebPreferencesChangedNotification object:nil]; } - (void)_shutDownIconDatabase { // Unregister for important notifications [[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationWillTerminateNotification object:NSApp]; [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedNotification object:nil]; } - (void)_applicationWillTerminate:(NSNotification *)notification { iconDatabase()->close(); } - (NSImage *)_iconForFileURL:(NSString *)file withSize:(NSSize)size { ASSERT_MAIN_THREAD(); ASSERT(size.width); ASSERT(size.height); NSWorkspace *workspace = [NSWorkspace sharedWorkspace]; NSString *path = [[NSURL _web_URLWithDataAsString:file] path]; NSString *suffix = [path pathExtension]; NSImage *icon = nil; if ([suffix _webkit_isCaseInsensitiveEqualToString:@"htm"] || [suffix _webkit_isCaseInsensitiveEqualToString:@"html"]) { if (!_private->htmlIcons) { icon = [workspace iconForFileType:@"html"]; _private->htmlIcons = [[self _iconsBySplittingRepresentationsOfIcon:icon] retain]; } icon = [self _iconFromDictionary:_private->htmlIcons forSize:size cache:YES]; } else { if (!path || ![path isAbsolutePath]) { // Return the generic icon when there is no path. icon = [workspace iconForFileType:NSFileTypeForHFSTypeCode(kGenericDocumentIcon)]; } else { icon = [workspace iconForFile:path]; } [self _scaleIcon:icon toSize:size]; } return icon; } - (void)_resetCachedWebPreferences:(NSNotification *)notification { BOOL privateBrowsingEnabledNow = [[WebPreferences standardPreferences] privateBrowsingEnabled]; iconDatabase()->setPrivateBrowsingEnabled(privateBrowsingEnabledNow); } - (NSImage *)_largestIconFromDictionary:(NSMutableDictionary *)icons { ASSERT(icons); NSEnumerator *enumerator = [icons keyEnumerator]; NSValue *currentSize, *largestSize=nil; float largestSizeArea=0; while ((currentSize = [enumerator nextObject]) != nil) { NSSize currentSizeSize = [currentSize sizeValue]; float currentSizeArea = currentSizeSize.width * currentSizeSize.height; if(!largestSizeArea || (currentSizeArea > largestSizeArea)){ largestSize = currentSize; largestSizeArea = currentSizeArea; } } return [icons objectForKey:largestSize]; } - (NSMutableDictionary *)_iconsBySplittingRepresentationsOfIcon:(NSImage *)icon { ASSERT(icon); NSMutableDictionary *icons = [NSMutableDictionary dictionary]; NSEnumerator *enumerator = [[icon representations] objectEnumerator]; NSImageRep *rep; while ((rep = [enumerator nextObject]) != nil) { NSSize size = [rep size]; NSImage *subIcon = [[NSImage alloc] initWithSize:size]; [subIcon addRepresentation:rep]; [icons setObject:subIcon forKey:[NSValue valueWithSize:size]]; [subIcon release]; } if([icons count] > 0) return icons; LOG_ERROR("icon has no representations"); return nil; } - (NSImage *)_iconFromDictionary:(NSMutableDictionary *)icons forSize:(NSSize)size cache:(BOOL)cache { ASSERT(size.width); ASSERT(size.height); NSImage *icon = [icons objectForKey:[NSValue valueWithSize:size]]; if(!icon){ icon = [[[self _largestIconFromDictionary:icons] copy] autorelease]; [self _scaleIcon:icon toSize:size]; if(cache){ [icons setObject:icon forKey:[NSValue valueWithSize:size]]; } } return icon; } - (void)_scaleIcon:(NSImage *)icon toSize:(NSSize)size { ASSERT(size.width); ASSERT(size.height); #if !LOG_DISABLED double start = CFAbsoluteTimeGetCurrent(); #endif [icon setScalesWhenResized:YES]; [icon setSize:size]; #if !LOG_DISABLED double duration = CFAbsoluteTimeGetCurrent() - start; LOG(Timing, "scaling icon took %f seconds.", duration); #endif } // This hashing String->filename algorithm came from WebFileDatabase.m and is what was used in the // WebKit Icon Database static void legacyIconDatabaseFilePathForKey(id key, char *buffer) { const char *s; UInt32 hash1; UInt32 hash2; CFIndex len; CFIndex cnt; s = [[[[key description] lowercaseString] stringByStandardizingPath] UTF8String]; len = strlen(s); // compute first hash hash1 = len; for (cnt = 0; cnt < len; cnt++) { hash1 += (hash1 << 8) + s[cnt]; } hash1 += (hash1 << (len & 31)); // compute second hash hash2 = len; for (cnt = 0; cnt < len; cnt++) { hash2 = (37 * hash2) ^ s[cnt]; } #ifdef __LP64__ snprintf(buffer, UniqueFilePathSize, "%.2u/%.2u/%.10u-%.10u.cache", ((hash1 & 0xff) >> 4), ((hash2 & 0xff) >> 4), hash1, hash2); #else snprintf(buffer, UniqueFilePathSize, "%.2lu/%.2lu/%.10lu-%.10lu.cache", ((hash1 & 0xff) >> 4), ((hash2 & 0xff) >> 4), hash1, hash2); #endif } // This method of getting an object from the filesystem is taken from the old // WebKit Icon Database static id objectFromPathForKey(NSString *databasePath, id key) { ASSERT(key); id result = nil; // Use the key->filename hashing the old WebKit IconDatabase used char uniqueKey[UniqueFilePathSize]; legacyIconDatabaseFilePathForKey(key, uniqueKey); // Get the data from this file and setup for the un-archiving NSString *filePath = [[NSString alloc] initWithFormat:@"%@/%s", databasePath, uniqueKey]; NSData *data = [[NSData alloc] initWithContentsOfFile:filePath]; NSUnarchiver *unarchiver = nil; @try { if (data) { unarchiver = [[NSUnarchiver alloc] initForReadingWithData:data]; if (unarchiver) { id fileKey = [unarchiver decodeObject]; if ([fileKey isEqual:key]) { id object = [unarchiver decodeObject]; if (object) { // Decoded objects go away when the unarchiver does, so we need to // retain this so we can return it to our caller. result = [[object retain] autorelease]; LOG(IconDatabase, "read disk cache file - %@", key); } } } } } @catch (NSException *localException) { LOG(IconDatabase, "cannot unarchive cache file - %@", key); result = nil; } [unarchiver release]; [data release]; [filePath release]; return result; } static NSData* iconDataFromPathForIconURL(NSString *databasePath, NSString *iconURLString) { ASSERT(iconURLString); ASSERT(databasePath); NSData *iconData = objectFromPathForKey(databasePath, iconURLString); if ((id)iconData == (id)[NSNull null]) return nil; return iconData; } - (NSString *)_databaseDirectory { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; // Figure out the directory we should be using for the icon.db NSString *databaseDirectory = [defaults objectForKey:WebIconDatabaseDirectoryDefaultsKey]; if (!databaseDirectory) { databaseDirectory = WebIconDatabasePath; [defaults setObject:databaseDirectory forKey:WebIconDatabaseDirectoryDefaultsKey]; } return [[databaseDirectory stringByExpandingTildeInPath] stringByStandardizingPath]; } @end @implementation WebIconDatabasePrivate @end @interface ThreadEnabler : NSObject { } + (void)enableThreading; - (void)threadEnablingSelector:(id)arg; @end @implementation ThreadEnabler - (void)threadEnablingSelector:(id)arg { return; } + (void)enableThreading { ThreadEnabler *enabler = [[ThreadEnabler alloc] init]; [NSThread detachNewThreadSelector:@selector(threadEnablingSelector:) toTarget:enabler withObject:nil]; [enabler release]; } @end bool importToWebCoreFormat() { // Since this is running on a secondary POSIX thread and Cocoa cannot be used multithreaded unless an NSThread has been detached, // make sure that happens here for all WebKit clients if (![NSThread isMultiThreaded]) [ThreadEnabler enableThreading]; ASSERT([NSThread isMultiThreaded]); #ifndef BUILDING_ON_TIGER // Tell backup software (i.e., Time Machine) to never back up the icon database, because // it's a large file that changes frequently, thus using a lot of backup disk space, and // it's unlikely that many users would be upset about it not being backed up. We do this // here because this code is only executed once for each icon database instance. We could // make this configurable on a per-client basis someday if that seemed useful. // See . // FIXME: This has nothing to do with importing from the old to the new database format and should be moved elsewhere, // especially because we might eventually delete all of this legacy importing code and we shouldn't delete this. CFStringRef databasePath = iconDatabase()->databasePath().createCFString(); if (databasePath) { CFURLRef databasePathURL = CFURLCreateWithFileSystemPath(0, databasePath, kCFURLPOSIXPathStyle, FALSE); CFRelease(databasePath); CSBackupSetItemExcluded(databasePathURL, true, true); CFRelease(databasePathURL); } #endif // Get the directory the old icon database *should* be in NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString *databaseDirectory = [defaults objectForKey:WebIconDatabaseImportDirectoryDefaultsKey]; if (!databaseDirectory) databaseDirectory = [defaults objectForKey:WebIconDatabaseDirectoryDefaultsKey]; if (!databaseDirectory) { databaseDirectory = WebIconDatabasePath; [defaults setObject:databaseDirectory forKey:WebIconDatabaseDirectoryDefaultsKey]; } databaseDirectory = [databaseDirectory stringByExpandingTildeInPath]; // With this directory, get the PageURLToIconURL map that was saved to disk NSMutableDictionary *pageURLToIconURL = objectFromPathForKey(databaseDirectory, WebURLToIconURLKey); // If the retrieved object was not a valid NSMutableDictionary, then we have no valid // icons to import if (![pageURLToIconURL isKindOfClass:[NSMutableDictionary class]]) pageURLToIconURL = nil; if (!pageURLToIconURL) { // We found no Safari-2-style icon database. Bail out immediately and do not delete everything // in whatever directory we ended up looking in! Return true so we won't bother to check again. // FIXME: We can probably delete all of the code to convert Safari-2-style icon databases now. return true; } NSEnumerator *enumerator = [pageURLToIconURL keyEnumerator]; NSString *url, *iconURL; // First, we'll iterate through the PageURL->IconURL map while ((url = [enumerator nextObject]) != nil) { iconURL = [pageURLToIconURL objectForKey:url]; if (!iconURL) continue; iconDatabase()->importIconURLForPageURL(iconURL, url); if (iconDatabase()->shouldStopThreadActivity()) return false; } // Second, we'll get a list of the unique IconURLs we have NSMutableSet *iconsOnDiskWithURLs = [NSMutableSet setWithArray:[pageURLToIconURL allValues]]; enumerator = [iconsOnDiskWithURLs objectEnumerator]; NSData *iconData; // And iterate through them, adding the icon data to the new icon database while ((url = [enumerator nextObject]) != nil) { iconData = iconDataFromPathForIconURL(databaseDirectory, url); if (iconData) iconDatabase()->importIconDataForIconURL(SharedBuffer::wrapNSData(iconData), url); else { // This really *shouldn't* happen, so it'd be good to track down why it might happen in a debug build // however, we do know how to handle it gracefully in release LOG_ERROR("%@ is marked as having an icon on disk, but we couldn't get the data for it", url); iconDatabase()->importIconDataForIconURL(0, url); } if (iconDatabase()->shouldStopThreadActivity()) return false; } // After we're done importing old style icons over to webcore icons, we delete the entire directory hierarchy // for the old icon DB (skipping the new iconDB if it is in the same directory) NSFileManager *fileManager = [NSFileManager defaultManager]; enumerator = [[fileManager contentsOfDirectoryAtPath:databaseDirectory error:NULL] objectEnumerator]; NSString *databaseFilename = iconDatabase()->defaultDatabaseFilename(); BOOL foundIconDB = NO; NSString *file; while ((file = [enumerator nextObject]) != nil) { if ([file caseInsensitiveCompare:databaseFilename] == NSOrderedSame) { foundIconDB = YES; continue; } NSString *filePath = [databaseDirectory stringByAppendingPathComponent:file]; if (![fileManager removeItemAtPath:filePath error:NULL]) LOG_ERROR("Failed to delete %@ from old icon directory", filePath); } // If the new iconDB wasn't in that directory, we can delete the directory itself if (!foundIconDB) rmdir([databaseDirectory fileSystemRepresentation]); return true; } NSImage *webGetNSImage(Image* image, NSSize size) { ASSERT_MAIN_THREAD(); ASSERT(size.width); ASSERT(size.height); // FIXME: We're doing the resize here for now because WebCore::Image doesn't yet support resizing/multiple representations // This makes it so there's effectively only one size of a particular icon in the system at a time. We should move this // to WebCore::Image at some point. if (!image) return nil; NSImage* nsImage = image->getNSImage(); if (!nsImage) return nil; if (!NSEqualSizes([nsImage size], size)) { [nsImage setScalesWhenResized:YES]; [nsImage setSize:size]; } return nsImage; } WebKit/mac/Misc/WebNSDataExtras.h0000644000175000017500000000362411120302713015075 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import "WebTypesInternal.h" #define WEB_GUESS_MIME_TYPE_PEEK_LENGTH 1024 @interface NSData (WebNSDataExtras) -(BOOL)_web_isCaseInsensitiveEqualToCString:(const char *)string; -(NSMutableDictionary *)_webkit_parseRFC822HeaderFields; - (BOOL)_web_startsWithBlankLine; - (NSInteger)_web_locationAfterFirstBlankLine; @end WebKit/mac/Misc/WebNSViewExtras.h0000644000175000017500000000645010636353124015153 0ustar leelee/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #define WebDragImageAlpha 0.75f @class DOMElement; @class WebFrameView; @class WebView; @interface NSView (WebExtras) // Returns the nearest enclosing view of the given class, or nil if none. - (NSView *)_web_superviewOfClass:(Class)viewClass; - (WebFrameView *)_web_parentWebFrameView; - (WebView *)_webView; // returns whether a drag should begin starting with mouseDownEvent; if the time // passes expiration or the mouse moves less than the hysteresis before the mouseUp event, // returns NO, else returns YES. - (BOOL)_web_dragShouldBeginFromMouseDown:(NSEvent *)mouseDownEvent withExpiration:(NSDate *)expiration xHysteresis:(float)xHysteresis yHysteresis:(float)yHysteresis; // Calls _web_dragShouldBeginFromMouseDown:withExpiration:xHysteresis:yHysteresis: with // the default values for xHysteresis and yHysteresis - (BOOL)_web_dragShouldBeginFromMouseDown:(NSEvent *)mouseDownEvent withExpiration:(NSDate *)expiration; // Convenience method. Returns NSDragOperationCopy if _web_bestURLFromPasteboard doesn't return nil. // Returns NSDragOperationNone otherwise. - (NSDragOperation)_web_dragOperationForDraggingInfo:(id )sender; // Resizes and applies alpha to image and drags it. - (void)_web_DragImageForElement:(DOMElement *)element rect:(NSRect)rect event:(NSEvent *)event pasteboard:(NSPasteboard *)pasteboard source:(id)source offset:(NSPoint *)dragImageOffset; - (BOOL)_web_firstResponderIsSelfOrDescendantView; - (NSRect)_web_convertRect:(NSRect)aRect toView:(NSView *)aView; @end WebKit/mac/Misc/WebKitLogging.m0000644000175000017500000001441711124255324014652 0ustar leelee/* * Copyright (C) 2005, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebKitLogging.h" WTFLogChannel WebKitLogTextInput = { 0x00000010, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogTiming = { 0x00000020, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogLoading = { 0x00000040, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogFontCache = { 0x00000100, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogFontSubstitution = { 0x00000200, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogDownload = { 0x00000800, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogDocumentLoad = { 0x00001000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogPlugins = { 0x00002000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogEvents = { 0x00010000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogView = { 0x00020000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogRedirect = { 0x00040000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogPageCache = { 0x00080000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogCacheSizes = { 0x00100000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogFormDelegate = { 0x00200000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogFileDatabaseActivity = { 0x00400000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogHistory = { 0x00800000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogBindings = { 0x01000000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogFontSelection = { 0x02000000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogEncoding = { 0x04000000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogLiveConnect = { 0x08000000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogBackForward = { 0x10000000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogProgress = { 0x20000000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogPluginEvents = { 0x40000000, "WebKitLogLevel", WTFLogChannelOff }; WTFLogChannel WebKitLogIconDatabase = { 0x80000000, "WebKitLogLevel", WTFLogChannelOff }; static void initializeLogChannel(WTFLogChannel *channel) { channel->state = WTFLogChannelOff; NSString *logLevelString = [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithUTF8String:channel->defaultName]]; if (logLevelString) { unsigned logLevel; if (![[NSScanner scannerWithString:logLevelString] scanHexInt:&logLevel]) NSLog(@"unable to parse hex value for %s (%@), logging is off", channel->defaultName, logLevelString); if ((logLevel & channel->mask) == channel->mask) channel->state = WTFLogChannelOn; } } void WebKitInitializeLoggingChannelsIfNecessary() { static bool haveInitializedLoggingChannels = false; if (haveInitializedLoggingChannels) return; haveInitializedLoggingChannels = true; initializeLogChannel(&WebKitLogTiming); initializeLogChannel(&WebKitLogLoading); initializeLogChannel(&WebKitLogFontCache); initializeLogChannel(&WebKitLogFontSubstitution); initializeLogChannel(&WebKitLogDownload); initializeLogChannel(&WebKitLogDocumentLoad); initializeLogChannel(&WebKitLogPlugins); initializeLogChannel(&WebKitLogEvents); initializeLogChannel(&WebKitLogView); initializeLogChannel(&WebKitLogRedirect); initializeLogChannel(&WebKitLogPageCache); initializeLogChannel(&WebKitLogCacheSizes); initializeLogChannel(&WebKitLogFormDelegate); initializeLogChannel(&WebKitLogFileDatabaseActivity); initializeLogChannel(&WebKitLogHistory); initializeLogChannel(&WebKitLogBindings); initializeLogChannel(&WebKitLogFontSelection); initializeLogChannel(&WebKitLogEncoding); initializeLogChannel(&WebKitLogLiveConnect); initializeLogChannel(&WebKitLogBackForward); initializeLogChannel(&WebKitLogProgress); initializeLogChannel(&WebKitLogPluginEvents); initializeLogChannel(&WebKitLogIconDatabase); initializeLogChannel(&WebKitLogTextInput); } void ReportDiscardedDelegateException(SEL delegateSelector, id exception) { if ([exception isKindOfClass:[NSException class]]) NSLog(@"*** WebKit discarded an uncaught exception in the %s delegate: <%@> %@", sel_getName(delegateSelector), [exception name], [exception reason]); else NSLog(@"*** WebKit discarded an uncaught exception in the %s delegate: %@", sel_getName(delegateSelector), exception); } WebKit/mac/Misc/WebIconDatabasePrivate.h0000644000175000017500000000573611130573173016465 0ustar leelee/* * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 // FIXME: Some of the following is not API and should be moved // either inside WebIconDatabase.mm, or to WebIconDatabaseInternal.h. // Sent when all icons are removed from the database. The object of the notification is // the icon database. There is no userInfo. Clients should react by removing any cached // icon images from the user interface. Clients need not and should not call // releaseIconForURL: in response to this notification. extern NSString *WebIconDatabaseDidRemoveAllIconsNotification; // Key to store the path to look for old style icons in to convert to the new icon db extern NSString *WebIconDatabaseImportDirectoryDefaultsKey; @interface WebIconDatabase (WebPendingPublic) /*! @method isEnabled @discussion Returns true if the icon database is currently enabled, or false if it is disabled. */ - (BOOL)isEnabled; /*! @method setEnabled: @discussion Enables or disables the icon database based on the flag passed in. @param flag Pass true to enable the icon database, or false to disable it. */ - (void)setEnabled:(BOOL)flag; /*! @method removeAllIcons @discussion Causes the icon database to delete all of the images that it has stored, and to send out the notification WebIconDatabaseDidRemoveAllIconsNotification. */ - (void)removeAllIcons; @end @interface WebIconDatabase (WebPrivate) + (void)_checkIntegrityBeforeOpening; @end WebKit/mac/Misc/WebNSWindowExtras.m0000644000175000017500000000424410761765653015531 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNSWindowExtras.h" @implementation NSWindow (WebExtras) - (void)centerOverMainWindow { NSRect frameToCenterOver; if ([NSApp mainWindow]) { frameToCenterOver = [[NSApp mainWindow] frame]; } else { frameToCenterOver = [[NSScreen mainScreen] visibleFrame]; } NSSize size = [self frame].size; NSPoint origin; origin.y = NSMaxY(frameToCenterOver) - (frameToCenterOver.size.height - size.height) / 3 - size.height; origin.x = frameToCenterOver.origin.x + (frameToCenterOver.size.width - size.width) / 2; [self setFrameOrigin:origin]; } @end WebKit/mac/Misc/WebNSDataExtras.m0000644000175000017500000003473611120066040015112 0ustar leelee/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 #import #import @interface NSString (WebNSDataExtrasInternal) - (NSString *)_web_capitalizeRFC822HeaderFieldName; @end @implementation NSString (WebNSDataExtrasInternal) -(NSString *)_web_capitalizeRFC822HeaderFieldName { CFStringRef name = (CFStringRef)self; NSString *result = nil; CFIndex i; CFIndex len = CFStringGetLength(name); char *charPtr = NULL; UniChar *uniCharPtr = NULL; Boolean useUniCharPtr = FALSE; Boolean shouldCapitalize = TRUE; Boolean somethingChanged = FALSE; for (i = 0; i < len; i ++) { UniChar ch = CFStringGetCharacterAtIndex(name, i); Boolean replace = FALSE; if (shouldCapitalize && ch >= 'a' && ch <= 'z') { ch = ch + 'A' - 'a'; replace = TRUE; } else if (!shouldCapitalize && ch >= 'A' && ch <= 'Z') { ch = ch + 'a' - 'A'; replace = TRUE; } if (replace) { if (!somethingChanged) { somethingChanged = TRUE; if (CFStringGetBytes(name, CFRangeMake(0, len), kCFStringEncodingISOLatin1, 0, FALSE, NULL, 0, NULL) == len) { // Can be encoded in ISOLatin1 useUniCharPtr = FALSE; charPtr = CFAllocatorAllocate(NULL, len + 1, 0); CFStringGetCString(name, charPtr, len+1, kCFStringEncodingISOLatin1); } else { useUniCharPtr = TRUE; uniCharPtr = CFAllocatorAllocate(NULL, len * sizeof(UniChar), 0); CFStringGetCharacters(name, CFRangeMake(0, len), uniCharPtr); } } if (useUniCharPtr) { uniCharPtr[i] = ch; } else { charPtr[i] = ch; } } if (ch == '-') { shouldCapitalize = TRUE; } else { shouldCapitalize = FALSE; } } if (somethingChanged) { if (useUniCharPtr) { result = (NSString *)CFMakeCollectable(CFStringCreateWithCharactersNoCopy(NULL, uniCharPtr, len, NULL)); } else { result = (NSString *)CFMakeCollectable(CFStringCreateWithCStringNoCopy(NULL, charPtr, kCFStringEncodingISOLatin1, NULL)); } } else { result = [self retain]; } return [result autorelease]; } @end @implementation NSData (WebKitExtras) -(NSString *)_webkit_guessedMIMETypeForXML { int length = [self length]; const UInt8 *bytes = [self bytes]; #define CHANNEL_TAG_LENGTH 7 const char *p = (const char *)bytes; int remaining = MIN(length, WEB_GUESS_MIME_TYPE_PEEK_LENGTH) - (CHANNEL_TAG_LENGTH - 1); BOOL foundRDF = false; while (remaining > 0) { // Look for a "<". const char *hit = memchr(p, '<', remaining); if (!hit) { break; } // We are trying to identify RSS or Atom. RSS has a top-level // element of either or . However, there are // non-RSS RDF files, so in the case of we further look // for a element. In the case of an Atom file, a // top-level element is all we need to see. Only tags // starting with , or element // right after those. if (foundRDF) { if (strncasecmp(hit, " 0) { // Look for a "<". const char *hit = memchr(p, '<', remaining); if (!hit) { break; } // If we found a "<", look for "" or "", strlen("")) == 0 || strncasecmp(hit, "", strlen("")) == 0) { return @"text/html"; } // Skip the "<" and continue. remaining -= (hit + 1) - p; p = hit + 1; } // Test for a broken server which has sent the content type as part of the content. // This code could be improved to look for other mime types. p = bytes; remaining = MIN(length, WEB_GUESS_MIME_TYPE_PEEK_LENGTH) - (TEXT_HTML_LENGTH - 1); while (remaining > 0) { // Look for a "t" or "T". const char *hit = NULL; const char *lowerhit = memchr(p, 't', remaining); const char *upperhit = memchr(p, 'T', remaining); if (!lowerhit && !upperhit) { break; } if (!lowerhit) { hit = upperhit; } else if (!upperhit) { hit = lowerhit; } else { hit = MIN(lowerhit, upperhit); } // If we found a "t/T", look for "text/html". if (strncasecmp(hit, "text/html", TEXT_HTML_LENGTH) == 0) { return @"text/html"; } // Skip the "t/T" and continue. remaining -= (hit + 1) - p; p = hit + 1; } if ((length >= VCARD_HEADER_LENGTH) && strncmp(bytes, "BEGIN:VCARD", VCARD_HEADER_LENGTH) == 0) { return @"text/vcard"; } if ((length >= VCAL_HEADER_LENGTH) && strncmp(bytes, "BEGIN:VCALENDAR", VCAL_HEADER_LENGTH) == 0) { return @"text/calendar"; } // Test for plain text. int i; for(i=0; i<length; i++){ char c = bytes[i]; if ((c < 0x20 || c > 0x7E) && (c != '\t' && c != '\r' && c != '\n')) { break; } } if (i == length) { // Didn't encounter any bad characters, looks like plain text. return @"text/plain"; } // Looks like this is a binary file. // Sniff for the JPEG magic number. if ((length >= JPEG_MAGIC_NUMBER_LENGTH) && strncmp(bytes, "\xFF\xD8\xFF\xE0", JPEG_MAGIC_NUMBER_LENGTH) == 0) { return @"image/jpeg"; } #undef JPEG_MAGIC_NUMBER_LENGTH #undef SCRIPT_TAG_LENGTH #undef TEXT_HTML_LENGTH #undef VCARD_HEADER_LENGTH #undef VCAL_HEADER_LENGTH return nil; } @end @implementation NSData (WebNSDataExtras) -(BOOL)_web_isCaseInsensitiveEqualToCString:(const char *)string { ASSERT(string); const char *bytes = [self bytes]; return strncasecmp(bytes, string, [self length]) == 0; } static const UInt8 *_findEOL(const UInt8 *bytes, CFIndex len) { // According to the HTTP specification EOL is defined as // a CRLF pair. Unfortunately, some servers will use LF // instead. Worse yet, some servers will use a combination // of both (e.g. <header>CRLFLF<body>), so findEOL needs // to be more forgiving. It will now accept CRLF, LF, or // CR. // // It returns NULL if EOL is not found or it will return // a pointer to the first terminating character. CFIndex i; for (i = 0; i < len; i++) { UInt8 c = bytes[i]; if ('\n' == c) return bytes + i; if ('\r' == c) { // Check to see if spanning buffer bounds // (CRLF is across reads). If so, wait for // next read. if (i + 1 == len) break; return bytes + i; } } return NULL; } -(NSMutableDictionary *)_webkit_parseRFC822HeaderFields { NSMutableDictionary *headerFields = [NSMutableDictionary dictionary]; const UInt8 *bytes = [self bytes]; unsigned length = [self length]; NSString *lastKey = nil; const UInt8 *eol; // Loop over lines until we're past the header, or we can't find any more end-of-lines while ((eol = _findEOL(bytes, length))) { const UInt8 *line = bytes; SInt32 lineLength = eol - bytes; // Move bytes to the character after the terminator as returned by _findEOL. bytes = eol + 1; if (('\r' == *eol) && ('\n' == *bytes)) { bytes++; // Safe since _findEOL won't return a spanning CRLF. } length -= (bytes - line); if (lineLength == 0) { // Blank line; we're at the end of the header break; } else if (*line == ' ' || *line == '\t') { // Continuation of the previous header if (!lastKey) { // malformed header; ignore it and continue continue; } else { // Merge the continuation of the previous header NSString *currentValue = [headerFields objectForKey:lastKey]; NSString *newValue = (NSString *)CFMakeCollectable(CFStringCreateWithBytes(NULL, line, lineLength, kCFStringEncodingISOLatin1, FALSE)); ASSERT(currentValue); ASSERT(newValue); NSString *mergedValue = [[NSString alloc] initWithFormat:@"%@%@", currentValue, newValue]; [headerFields setObject:(NSString *)mergedValue forKey:lastKey]; [newValue release]; [mergedValue release]; // Note: currentValue is autoreleased } } else { // Brand new header const UInt8 *colon; for (colon = line; *colon != ':' && colon != eol; colon ++) { // empty loop } if (colon == eol) { // malformed header; ignore it and continue continue; } else { lastKey = (NSString *)CFMakeCollectable(CFStringCreateWithBytes(NULL, line, colon - line, kCFStringEncodingISOLatin1, FALSE)); [lastKey autorelease]; NSString *value = [lastKey _web_capitalizeRFC822HeaderFieldName]; lastKey = value; for (colon++; colon != eol; colon++) { if (*colon != ' ' && *colon != '\t') { break; } } if (colon == eol) { value = [[NSString alloc] initWithString:@""]; [value autorelease]; } else { value = (NSString *)CFMakeCollectable(CFStringCreateWithBytes(NULL, colon, eol-colon, kCFStringEncodingISOLatin1, FALSE)); [value autorelease]; } NSString *oldValue = [headerFields objectForKey:lastKey]; if (oldValue) { NSString *newValue = [[NSString alloc] initWithFormat:@"%@, %@", oldValue, value]; value = newValue; [newValue autorelease]; } [headerFields setObject:(NSString *)value forKey:lastKey]; } } } return headerFields; } - (BOOL)_web_startsWithBlankLine { return [self length] > 0 && ((const char *)[self bytes])[0] == '\n'; } - (NSInteger)_web_locationAfterFirstBlankLine { const char *bytes = (const char *)[self bytes]; unsigned length = [self length]; unsigned i; for (i = 0; i < length - 4; i++) { // Support for Acrobat. It sends "\n\n". if (bytes[i] == '\n' && bytes[i+1] == '\n') { return i+2; } // Returns the position after 2 CRLF's or 1 CRLF if it is the first line. if (bytes[i] == '\r' && bytes[i+1] == '\n') { i += 2; if (i == 2) { return i; } else if (bytes[i] == '\n') { // Support for Director. It sends "\r\n\n" (3880387). return i+1; } else if (bytes[i] == '\r' && bytes[i+1] == '\n') { // Support for Flash. It sends "\r\n\r\n" (3758113). return i+2; } } } return NSNotFound; } @end ����������������������������������WebKit/mac/Misc/WebNSArrayExtras.h������������������������������������������������������������������0000644�0001750�0001750�00000003531�11143123361�015304� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebTypesInternal.h" #import <Cocoa/Cocoa.h> @interface NSArray (WebNSArrayExtras) -(NSNumber *)_webkit_numberAtIndex:(NSUInteger)index; -(NSString *)_webkit_stringAtIndex:(NSUInteger)index; @end @interface NSMutableArray (WebNSArrayExtras) - (void)_webkit_removeUselessMenuItemSeparators; @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Misc/WebNSViewExtras.m�������������������������������������������������������������������0000644�0001750�0001750�00000022557�10761765653�015203� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebNSViewExtras.h> #import <WebKit/DOMExtensions.h> #import <WebKit/WebDataSource.h> #import <WebKit/WebFramePrivate.h> #import <WebKit/WebFrameViewInternal.h> #import <WebKit/WebNSImageExtras.h> #import <WebKit/WebNSPasteboardExtras.h> #import <WebKit/WebNSURLExtras.h> #import <WebKit/WebView.h> #define WebDragStartHysteresisX 5.0f #define WebDragStartHysteresisY 5.0f #define WebMaxDragImageSize NSMakeSize(400.0f, 400.0f) #define WebMaxOriginalImageArea (1500.0f * 1500.0f) #define WebDragIconRightInset 7.0f #define WebDragIconBottomInset 3.0f @implementation NSView (WebExtras) - (NSView *)_web_superviewOfClass:(Class)class { NSView *view = [self superview]; while (view && ![view isKindOfClass:class]) view = [view superview]; return view; } - (WebFrameView *)_web_parentWebFrameView { return (WebFrameView *)[self _web_superviewOfClass:[WebFrameView class]]; } // FIXME: Mail is the only client of _webView, remove this method once no versions of Mail need it. - (WebView *)_webView { return (WebView *)[self _web_superviewOfClass:[WebView class]]; } /* Determine whether a mouse down should turn into a drag; started as copy of NSTableView code */ - (BOOL)_web_dragShouldBeginFromMouseDown:(NSEvent *)mouseDownEvent withExpiration:(NSDate *)expiration xHysteresis:(float)xHysteresis yHysteresis:(float)yHysteresis { NSEvent *nextEvent, *firstEvent, *dragEvent, *mouseUp; BOOL dragIt; if ([mouseDownEvent type] != NSLeftMouseDown) { return NO; } nextEvent = nil; firstEvent = nil; dragEvent = nil; mouseUp = nil; dragIt = NO; while ((nextEvent = [[self window] nextEventMatchingMask:(NSLeftMouseUpMask | NSLeftMouseDraggedMask) untilDate:expiration inMode:NSEventTrackingRunLoopMode dequeue:YES]) != nil) { if (firstEvent == nil) { firstEvent = nextEvent; } if ([nextEvent type] == NSLeftMouseDragged) { float deltax = ABS([nextEvent locationInWindow].x - [mouseDownEvent locationInWindow].x); float deltay = ABS([nextEvent locationInWindow].y - [mouseDownEvent locationInWindow].y); dragEvent = nextEvent; if (deltax >= xHysteresis) { dragIt = YES; break; } if (deltay >= yHysteresis) { dragIt = YES; break; } } else if ([nextEvent type] == NSLeftMouseUp) { mouseUp = nextEvent; break; } } // Since we've been dequeuing the events (If we don't, we'll never see the mouse up...), // we need to push some of the events back on. It makes sense to put the first and last // drag events and the mouse up if there was one. if (mouseUp != nil) { [NSApp postEvent:mouseUp atStart:YES]; } if (dragEvent != nil) { [NSApp postEvent:dragEvent atStart:YES]; } if (firstEvent != mouseUp && firstEvent != dragEvent) { [NSApp postEvent:firstEvent atStart:YES]; } return dragIt; } - (BOOL)_web_dragShouldBeginFromMouseDown:(NSEvent *)mouseDownEvent withExpiration:(NSDate *)expiration { return [self _web_dragShouldBeginFromMouseDown:mouseDownEvent withExpiration:expiration xHysteresis:WebDragStartHysteresisX yHysteresis:WebDragStartHysteresisY]; } - (NSDragOperation)_web_dragOperationForDraggingInfo:(id <NSDraggingInfo>)sender { if (![NSApp modalWindow] && ![[self window] attachedSheet] && [sender draggingSource] != self && [[sender draggingPasteboard] _web_bestURL]) { return NSDragOperationCopy; } return NSDragOperationNone; } - (void)_web_DragImageForElement:(DOMElement *)element rect:(NSRect)rect event:(NSEvent *)event pasteboard:(NSPasteboard *)pasteboard source:(id)source offset:(NSPoint *)dragImageOffset { NSPoint mouseDownPoint = [self convertPoint:[event locationInWindow] fromView:nil]; NSImage *dragImage; NSPoint origin; NSImage *image = [element image]; if (image != nil && [image size].height * [image size].width <= WebMaxOriginalImageArea) { NSSize originalSize = rect.size; origin = rect.origin; dragImage = [[image copy] autorelease]; [dragImage setScalesWhenResized:YES]; [dragImage setSize:originalSize]; [dragImage _web_scaleToMaxSize:WebMaxDragImageSize]; NSSize newSize = [dragImage size]; [dragImage _web_dissolveToFraction:WebDragImageAlpha]; // Properly orient the drag image and orient it differently if it's smaller than the original origin.x = mouseDownPoint.x - (((mouseDownPoint.x - origin.x) / originalSize.width) * newSize.width); origin.y = origin.y + originalSize.height; origin.y = mouseDownPoint.y - (((mouseDownPoint.y - origin.y) / originalSize.height) * newSize.height); } else { // FIXME: This has been broken for a while. // There's no way to get the MIME type for the image from a DOM element. // The old code used WKGetPreferredExtensionForMIMEType([image MIMEType]); NSString *extension = @""; dragImage = [[NSWorkspace sharedWorkspace] iconForFileType:extension]; NSSize offset = NSMakeSize([dragImage size].width - WebDragIconRightInset, -WebDragIconBottomInset); origin = NSMakePoint(mouseDownPoint.x - offset.width, mouseDownPoint.y - offset.height); } // This is the offset from the lower left corner of the image to the mouse location. Because we // are a flipped view the calculation of Y is inverted. if (dragImageOffset) { dragImageOffset->x = mouseDownPoint.x - origin.x; dragImageOffset->y = origin.y - mouseDownPoint.y; } // Per kwebster, offset arg is ignored [self dragImage:dragImage at:origin offset:NSZeroSize event:event pasteboard:pasteboard source:source slideBack:YES]; } - (BOOL)_web_firstResponderIsSelfOrDescendantView { NSResponder *responder = [[self window] firstResponder]; return (responder && (responder == self || ([responder isKindOfClass:[NSView class]] && [(NSView *)responder isDescendantOf:self]))); } - (NSRect)_web_convertRect:(NSRect)aRect toView:(NSView *)aView { // Converting to this view's window; let -convertRect:toView: handle it if (aView == nil) return [self convertRect:aRect toView:nil]; // This view must be in a window. Do whatever weird thing -convertRect:toView: does in this situation. NSWindow *thisWindow = [self window]; if (!thisWindow) return [self convertRect:aRect toView:aView]; // The other view must be in a window, too. NSWindow *otherWindow = [aView window]; if (!otherWindow) return [self convertRect:aRect toView:aView]; // Convert to this window's coordinates NSRect convertedRect = [self convertRect:aRect toView:nil]; // Convert to screen coordinates convertedRect.origin = [thisWindow convertBaseToScreen:convertedRect.origin]; // Convert to other window's coordinates convertedRect.origin = [otherWindow convertScreenToBase:convertedRect.origin]; // Convert to other view's coordinates convertedRect = [aView convertRect:convertedRect fromView:nil]; return convertedRect; } @end �������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Misc/WebIconFetcher.mm�������������������������������������������������������������������0000644�0001750�0001750�00000006746�11145115663�015174� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 Apple 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 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 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 "WebIconFetcher.h" #import "WebFrameInternal.h" #import "WebIconFetcherInternal.h" #import <WebCore/Frame.h> #import <WebCore/IconFetcher.h> #import <WebCore/SharedBuffer.h> #import <wtf/PassRefPtr.h> using namespace WebCore; class WebIconFetcherClient : public IconFetcherClient { public: WebIconFetcherClient(id target, SEL selector) : m_target(target) , m_selector(selector) { } virtual void finishedFetchingIcon(PassRefPtr<SharedBuffer> iconData) { RetainPtr<NSData> data; if (iconData) data = iconData->createNSData(); [m_target performSelector:m_selector withObject:m_fetcher.get() withObject:data.get()]; delete this; } void setFetcher(WebIconFetcher *fetcher) { m_fetcher = fetcher; } private: RetainPtr<WebIconFetcher> m_fetcher; id m_target; SEL m_selector; }; @implementation WebIconFetcher - (id)init { return nil; } - (void)dealloc { if (_private) reinterpret_cast<IconFetcher*>(_private)->deref(); [super dealloc]; } - (void)finalize { if (_private) reinterpret_cast<IconFetcher*>(_private)->deref(); [super finalize]; } - (void)cancel { reinterpret_cast<IconFetcher*>(_private)->cancel(); } @end @implementation WebIconFetcher (WebInternal) - (id)_initWithIconFetcher:(PassRefPtr<IconFetcher>)iconFetcher client:(WebIconFetcherClient *)client { ASSERT(iconFetcher); self = [super init]; if (!self) return nil; client->setFetcher(self); _private = reinterpret_cast<WebIconFetcherPrivate*>(iconFetcher.releaseRef()); return self; } + (WebIconFetcher *)_fetchApplicationIconForFrame:(WebFrame *)webFrame target:(id)target selector:(SEL)selector { Frame* frame = core(webFrame); WebIconFetcherClient* client = new WebIconFetcherClient(target, selector); RefPtr<IconFetcher> fetcher = IconFetcher::create(frame, client); if (!fetcher) return nil; return [[[WebIconFetcher alloc] _initWithIconFetcher:fetcher.release() client:client] autorelease]; } @end ��������������������������WebKit/mac/Misc/WebNSImageExtras.h������������������������������������������������������������������0000644�0001750�0001750�00000003471�10360512352�015255� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> @interface NSImage (WebExtras) - (void)_web_scaleToMaxSize:(NSSize)size; - (void)_web_dissolveToFraction:(float)delta; // Debug method. Saves an image and opens it in the preferred TIFF viewing application. - (void)_web_saveAndOpen; @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Misc/WebNSArrayExtras.m������������������������������������������������������������������0000644�0001750�0001750�00000005775�11142767411�015336� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNSArrayExtras.h" #import <wtf/Assertions.h> @implementation NSArray (WebNSArrayExtras) -(NSNumber *)_webkit_numberAtIndex:(NSUInteger)index { id object = [self objectAtIndex:index]; return [object isKindOfClass:[NSNumber class]] ? object : nil; } -(NSString *)_webkit_stringAtIndex:(NSUInteger)index { id object = [self objectAtIndex:index]; return [object isKindOfClass:[NSString class]] ? object : nil; } @end @implementation NSMutableArray (WebNSArrayExtras) - (void)_webkit_removeUselessMenuItemSeparators { // Starting with a mutable array of NSMenuItems, removes any separators at the start, // removes any separators at the end, and collapses any other adjacent separators to // a single separator. int index; // Start this with YES so very last item will be removed if it's a separator. BOOL removePreviousItemIfSeparator = YES; for (index = [self count] - 1; index >= 0; --index) { NSMenuItem *item = [self objectAtIndex:index]; ASSERT([item isKindOfClass:[NSMenuItem class]]); BOOL itemIsSeparator = [item isSeparatorItem]; if (itemIsSeparator && (removePreviousItemIfSeparator || index == 0)) [self removeObjectAtIndex:index]; removePreviousItemIfSeparator = itemIsSeparator; } // This could leave us with one initial separator; kill it off too if ([self count] && [[self objectAtIndex:0] isSeparatorItem]) [self removeObjectAtIndex:0]; } @end ���WebKit/mac/Misc/WebNSObjectExtras.mm����������������������������������������������������������������0000644�0001750�0001750�00000007273�11207052153�015626� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNSObjectExtras.h" #import <wtf/Assertions.h> @interface WebMainThreadInvoker : NSProxy { id target; id exception; } @end static bool returnTypeIsObject(NSInvocation *invocation) { // Could use either _C_ID or NSObjCObjectType, but it seems that neither is // both available and non-deprecated on all versions of Mac OS X we support. return strchr([[invocation methodSignature] methodReturnType], '@'); } @implementation WebMainThreadInvoker - (id)initWithTarget:(id)passedTarget { target = passedTarget; return self; } - (void)forwardInvocation:(NSInvocation *)invocation { [invocation setTarget:target]; [invocation performSelectorOnMainThread:@selector(_webkit_invokeAndHandleException:) withObject:self waitUntilDone:YES]; if (exception) { id exceptionToThrow = [exception autorelease]; exception = nil; @throw exceptionToThrow; } else if (returnTypeIsObject(invocation)) { // _webkit_invokeAndHandleException retained the return value on the main thread. // Now autorelease it on the calling thread. id returnValue; [invocation getReturnValue:&returnValue]; [returnValue autorelease]; } } - (NSMethodSignature *)methodSignatureForSelector:(SEL)selector { return [target methodSignatureForSelector:selector]; } - (void)handleException:(id)passedException { ASSERT(!exception); exception = [passedException retain]; } @end @implementation NSInvocation (WebMainThreadInvoker) - (void)_webkit_invokeAndHandleException:(WebMainThreadInvoker *)exceptionHandler { @try { [self invoke]; } @catch (id exception) { [exceptionHandler handleException:exception]; return; } if (returnTypeIsObject(self)) { // Retain the return value on the main thread. // -[WebMainThreadInvoker forwardInvocation:] will autorelease it on the calling thread. id value; [self getReturnValue:&value]; [value retain]; } } @end @implementation NSObject (WebNSObjectExtras) - (id)_webkit_invokeOnMainThread { return [[[WebMainThreadInvoker alloc] initWithTarget:self] autorelease]; } @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Misc/WebNSImageExtras.m������������������������������������������������������������������0000644�0001750�0001750�00000006500�10557755506�015300� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebNSImageExtras.h> #import <WebKit/WebKitLogging.h> @implementation NSImage (WebExtras) - (void)_web_scaleToMaxSize:(NSSize)size { float heightResizeDelta = 0.0f, widthResizeDelta = 0.0f, resizeDelta = 0.0f; NSSize originalSize = [self size]; if(originalSize.width > size.width){ widthResizeDelta = size.width / originalSize.width; resizeDelta = widthResizeDelta; } if(originalSize.height > size.height){ heightResizeDelta = size.height / originalSize.height; if((resizeDelta == 0.0) || (resizeDelta > heightResizeDelta)){ resizeDelta = heightResizeDelta; } } if(resizeDelta > 0.0){ NSSize newSize = NSMakeSize((originalSize.width * resizeDelta), (originalSize.height * resizeDelta)); [self setScalesWhenResized:YES]; [self setSize:newSize]; } } - (void)_web_dissolveToFraction:(float)delta { NSImage *dissolvedImage = [[NSImage alloc] initWithSize:[self size]]; NSPoint point = [self isFlipped] ? NSMakePoint(0, [self size].height) : NSZeroPoint; // In this case the dragging image is always correct. [dissolvedImage setFlipped:[self isFlipped]]; [dissolvedImage lockFocus]; [self dissolveToPoint:point fraction: delta]; [dissolvedImage unlockFocus]; [self lockFocus]; [dissolvedImage compositeToPoint:point operation:NSCompositeCopy]; [self unlockFocus]; [dissolvedImage release]; } - (void)_web_saveAndOpen { char path[] = "/tmp/XXXXXX.tiff"; int fd = mkstemps(path, 5); if (fd != -1) { NSData *data = [self TIFFRepresentation]; write(fd, [data bytes], [data length]); close(fd); [[NSWorkspace sharedWorkspace] openFile:[NSString stringWithUTF8String:path]]; } } @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Misc/WebCoreStatistics.mm����������������������������������������������������������������0000644�0001750�0001750�00000015165�11233422436�015736� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebCoreStatistics.h" #import "WebCache.h" #import "WebFrameInternal.h" #import <runtime/JSLock.h> #import <WebCore/Console.h> #import <WebCore/FontCache.h> #import <WebCore/Frame.h> #import <WebCore/GCController.h> #import <WebCore/GlyphPageTreeNode.h> #import <WebCore/IconDatabase.h> #import <WebCore/JSDOMWindow.h> #import <WebCore/PageCache.h> #import <WebCore/RenderTreeAsText.h> #import <WebCore/RenderView.h> using namespace JSC; using namespace WebCore; @implementation WebCoreStatistics + (NSArray *)statistics { return [WebCache statistics]; } + (size_t)javaScriptObjectsCount { JSLock lock(SilenceAssertionsOnly); return JSDOMWindow::commonJSGlobalData()->heap.objectCount(); } + (size_t)javaScriptGlobalObjectsCount { JSLock lock(SilenceAssertionsOnly); return JSDOMWindow::commonJSGlobalData()->heap.globalObjectCount(); } + (size_t)javaScriptProtectedObjectsCount { JSLock lock(SilenceAssertionsOnly); return JSDOMWindow::commonJSGlobalData()->heap.protectedObjectCount(); } + (size_t)javaScriptProtectedGlobalObjectsCount { JSLock lock(SilenceAssertionsOnly); return JSDOMWindow::commonJSGlobalData()->heap.protectedGlobalObjectCount(); } + (NSCountedSet *)javaScriptProtectedObjectTypeCounts { JSLock lock(SilenceAssertionsOnly); NSCountedSet *result = [NSCountedSet set]; OwnPtr<HashCountedSet<const char*> > counts(JSDOMWindow::commonJSGlobalData()->heap.protectedObjectTypeCounts()); HashCountedSet<const char*>::iterator end = counts->end(); for (HashCountedSet<const char*>::iterator it = counts->begin(); it != end; ++it) for (unsigned i = 0; i < it->second; ++i) [result addObject:[NSString stringWithUTF8String:it->first]]; return result; } + (void)garbageCollectJavaScriptObjects { gcController().garbageCollectNow(); } + (void)garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging:(BOOL)waitUntilDone { gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone); } + (size_t)iconPageURLMappingCount { return iconDatabase()->pageURLMappingCount(); } + (size_t)iconRetainedPageURLCount { return iconDatabase()->retainedPageURLCount(); } + (size_t)iconRecordCount { return iconDatabase()->iconRecordCount(); } + (size_t)iconsWithDataCount { return iconDatabase()->iconRecordCountWithData(); } + (size_t)cachedFontDataCount { return fontCache()->fontDataCount(); } + (size_t)cachedFontDataInactiveCount { return fontCache()->inactiveFontDataCount(); } + (void)purgeInactiveFontData { fontCache()->purgeInactiveFontData(); } + (size_t)glyphPageCount { return GlyphPageTreeNode::treeGlyphPageCount(); } + (BOOL)shouldPrintExceptions { JSLock lock(SilenceAssertionsOnly); return Console::shouldPrintExceptions(); } + (void)setShouldPrintExceptions:(BOOL)print { JSLock lock(SilenceAssertionsOnly); Console::setShouldPrintExceptions(print); } + (void)emptyCache { [WebCache empty]; } + (void)setCacheDisabled:(BOOL)disabled { [WebCache setDisabled:disabled]; } + (void)startIgnoringWebCoreNodeLeaks { WebCore::Node::startIgnoringLeaks(); } + (void)stopIgnoringWebCoreNodeLeaks { WebCore::Node::stopIgnoringLeaks(); } + (NSDictionary *)memoryStatistics { WTF::FastMallocStatistics fastMallocStatistics = WTF::fastMallocStatistics(); JSLock lock(SilenceAssertionsOnly); Heap::Statistics jsHeapStatistics = JSDOMWindow::commonJSGlobalData()->heap.statistics(); return [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:fastMallocStatistics.heapSize], @"FastMallocHeapSize", [NSNumber numberWithInt:fastMallocStatistics.freeSizeInHeap], @"FastMallocFreeSizeInHeap", [NSNumber numberWithInt:fastMallocStatistics.freeSizeInCaches], @"FastMallocFreeSizeInCaches", [NSNumber numberWithInt:fastMallocStatistics.returnedSize], @"FastMallocReturnedSize", [NSNumber numberWithInt:jsHeapStatistics.size], @"JavaScriptHeapSize", [NSNumber numberWithInt:jsHeapStatistics.free], @"JavaScriptFreeSize", nil]; } + (void)returnFreeMemoryToSystem { WTF::releaseFastMallocFreeMemory(); } + (int)cachedPageCount { return pageCache()->pageCount(); } + (int)cachedFrameCount { return pageCache()->frameCount(); } + (int)autoreleasedPageCount { return pageCache()->autoreleasedPageCount(); } // Deprecated + (size_t)javaScriptNoGCAllowedObjectsCount { return 0; } + (size_t)javaScriptReferencedObjectsCount { JSLock lock(SilenceAssertionsOnly); return JSDOMWindow::commonJSGlobalData()->heap.protectedObjectCount(); } + (NSSet *)javaScriptRootObjectClasses { return [self javaScriptRootObjectTypeCounts]; } + (size_t)javaScriptInterpretersCount { return [self javaScriptProtectedGlobalObjectsCount]; } + (NSCountedSet *)javaScriptRootObjectTypeCounts { return [self javaScriptProtectedObjectTypeCounts]; } @end @implementation WebFrame (WebKitDebug) - (NSString *)renderTreeAsExternalRepresentation { return externalRepresentation(_private->coreFrame->contentRenderer()); } @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebKit.exp�������������������������������������������������������������������������������0000644�0001750�0001750�00000006754�11251373043�013015� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.objc_class_name_WebApplicationCache .objc_class_name_WebArchive .objc_class_name_WebBackForwardList .objc_class_name_WebCache .objc_class_name_WebCoreScrollView .objc_class_name_WebCoreStatistics .objc_class_name_WebDataSource .objc_class_name_WebDatabaseManager .objc_class_name_WebDefaultPolicyDelegate .objc_class_name_WebDownload .objc_class_name_WebDynamicScrollBarsView .objc_class_name_WebFormDelegate .objc_class_name_WebFrame .objc_class_name_WebFrameView .objc_class_name_WebGeolocationMock .objc_class_name_WebHTMLRepresentation .objc_class_name_WebHTMLView .objc_class_name_WebHistory .objc_class_name_WebHistoryItem .objc_class_name_WebIconDatabase .objc_class_name_WebInspector .objc_class_name_WebJavaScriptTextInputPanel .objc_class_name_WebKeyGenerator .objc_class_name_WebKitStatistics .objc_class_name_WebPanelAuthenticationHandler .objc_class_name_WebPluginDatabase .objc_class_name_WebPreferences .objc_class_name_WebRenderNode .objc_class_name_WebResource .objc_class_name_WebScriptCallFrame .objc_class_name_WebSecurityOrigin .objc_class_name_WebStringTruncator .objc_class_name_WebTextIterator .objc_class_name_WebURLsWithTitles .objc_class_name_WebView .objc_class_name_WebWorkersPrivate _HIWebViewCreate _HIWebViewGetWebView _WebActionButtonKey _WebActionElementKey _WebActionFormKey _WebActionModifierFlagsKey _WebActionNavigationTypeKey _WebActionOriginalURLKey _WebArchivePboardType _WebConvertNSImageToCGImageRef _WebCoreScrollbarAlwaysOn _WebDatabaseDidModifyDatabaseNotification _WebDatabaseDidModifyOriginNotification _WebDatabaseDirectoryDefaultsKey _WebDatabaseDisplayNameKey _WebDatabaseExpectedSizeKey _WebDatabaseIdentifierKey _WebDatabaseUsageKey _WebElementDOMNodeKey _WebElementFrameKey _WebElementImageAltStringKey _WebElementImageKey _WebElementImageRectKey _WebElementImageURLKey _WebElementIsSelectedKey _WebElementLinkIsLiveKey _WebElementLinkLabelKey _WebElementLinkTargetFrameKey _WebElementLinkTitleKey _WebElementLinkURLKey _WebFrameCanSuspendActiveDOMObjects _WebFrameHasPlugins _WebFrameHasUnloadListener _WebFrameMainDocumentError _WebFrameUsesApplicationCache _WebFrameUsesDatabases _WebFrameUsesGeolocation _WebHistoryAllItemsRemovedNotification _WebHistoryItemChangedNotification _WebHistoryItemsAddedNotification _WebHistoryItemsDiscardedWhileLoadingNotification _WebHistoryItemsKey _WebHistoryItemsRemovedNotification _WebHistoryLoadedNotification _WebHistorySavedNotification _WebIconDatabaseDidAddIconNotification _WebIconDatabaseDidRemoveAllIconsNotification _WebIconDatabaseDirectoryDefaultsKey _WebIconDatabaseImportDirectoryDefaultsKey _WebIconLargeSize _WebIconMediumSize _WebIconNotificationUserInfoURLKey _WebIconSmallSize _WebInitForCarbon _WebKitErrorDomain _WebKitErrorMIMETypeKey _WebKitErrorPlugInNameKey _WebKitErrorPlugInPageURLStringKey _WebKitLocalCacheDefaultsKey _WebLocalizedString _WebPlugInAttributesKey _WebPlugInBaseURLKey _WebPlugInContainerKey _WebPlugInContainingElementKey _WebPlugInModeKey _WebPlugInShouldLoadMainResourceKey _WebPluginWillPresentNativeUserInterfaceNotification _WebPreferencesChangedNotification _WebReportAssertionFailure _WebReportError _WebScriptErrorDescriptionKey _WebScriptErrorDomain _WebScriptErrorLineNumberKey _WebURLNamePboardType _WebURLPboardType _WebViewDidBeginEditingNotification _WebViewDidChangeNotification _WebViewDidChangeSelectionNotification _WebViewDidChangeTypingStyleNotification _WebViewDidEndEditingNotification _WebViewProgressEstimateChangedNotification _WebViewProgressFinishedNotification _WebViewProgressStartedNotification ��������������������WebKit/mac/WebCoreSupport/��������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024245�014024� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebGeolocationMockPrivate.h�����������������������������������������������0000644�0001750�0001750�00000003004�11251373043�021235� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 <Foundation/Foundation.h> @interface WebGeolocationMock : NSObject { } + (void)setPosition:(double)latitude:(double)longitude:(double)accuracy; + (void)setError:(int)code:(NSString *)message; @end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebGeolocationPrivate.h���������������������������������������������������0000644�0001750�0001750�00000003022�11156526152�020430� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 <Foundation/Foundation.h> @class WebGeolocationPrivate; @interface WebGeolocation : NSObject { @private WebGeolocationPrivate *_private; } - (BOOL)shouldClearCache; - (void)setIsAllowed:(BOOL)allowed; @end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebGeolocationMock.mm�����������������������������������������������������0000644�0001750�0001750�00000005175�11251373043�020077� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 "WebGeolocationMockPrivate.h" #import "WebGeolocationInternal.h" #import <WebCore/GeolocationServiceMock.h> #import <WebCore/Geoposition.h> #import <WebCore/PositionError.h> #import <wtf/CurrentTime.h> using namespace WebCore; using namespace WTF; @implementation WebGeolocationMock + (void)setPosition:(double)latitude:(double)longitude:(double)accuracy { RefPtr<Coordinates> coordinates = Coordinates::create(latitude, longitude, false, 0.0, // altitude accuracy, false, 0.0, // altitudeAccuracy false, 0.0, // heading false, 0.0); // speed RefPtr<Geoposition> position = Geoposition::create(coordinates.release(), currentTime() * 1000.0); GeolocationServiceMock::setPosition(position.release()); } + (void)setError:(int)code:(NSString *)message { PositionError::ErrorCode codeEnum = static_cast<PositionError::ErrorCode>(code); RefPtr<PositionError> error = PositionError::create(codeEnum, message); GeolocationServiceMock::setError(error.release()); } @end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebChromeClient.mm��������������������������������������������������������0000644�0001750�0001750�00000066435�11254742231�017406� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebChromeClient.h" #import "DOMNodeInternal.h" #import "WebDefaultUIDelegate.h" #import "WebDelegateImplementationCaching.h" #import "WebElementDictionary.h" #import "WebFrameInternal.h" #import "WebFrameView.h" #import "WebGeolocationInternal.h" #import "WebHTMLViewInternal.h" #import "WebHistoryInternal.h" #import "WebKitPrefix.h" #import "WebKitSystemInterface.h" #import "WebNSURLRequestExtras.h" #import "WebPlugin.h" #import "WebSecurityOriginInternal.h" #import "WebUIDelegatePrivate.h" #import "WebView.h" #import "WebViewInternal.h" #import <Foundation/Foundation.h> #import <WebCore/BlockExceptions.h> #import <WebCore/Console.h> #import <WebCore/FileChooser.h> #import <WebCore/FloatRect.h> #import <WebCore/Frame.h> #import <WebCore/FrameLoadRequest.h> #import <WebCore/Geolocation.h> #import <WebCore/HitTestResult.h> #import <WebCore/IntRect.h> #import <WebCore/Page.h> #import <WebCore/PlatformScreen.h> #import <WebCore/PlatformString.h> #import <WebCore/ResourceRequest.h> #import <WebCore/ScrollView.h> #import <WebCore/Widget.h> #import <WebCore/WindowFeatures.h> #import <wtf/PassRefPtr.h> #import <wtf/Vector.h> #if USE(ACCELERATED_COMPOSITING) #import <WebCore/GraphicsLayer.h> #endif #if USE(PLUGIN_HOST_PROCESS) #import "NetscapePluginHostManager.h" #endif @interface NSView (WebNSViewDetails) - (NSView *)_findLastViewInKeyViewLoop; @end // For compatibility with old SPI. @interface NSView (WebOldWebKitPlugInDetails) - (void)setIsSelected:(BOOL)isSelected; @end @interface NSWindow (AppKitSecretsIKnowAbout) - (NSRect)_growBoxRect; @end using namespace WebCore; @interface WebOpenPanelResultListener : NSObject <WebOpenPanelResultListener> { FileChooser* _chooser; } - (id)initWithChooser:(PassRefPtr<FileChooser>)chooser; @end WebChromeClient::WebChromeClient(WebView *webView) : m_webView(webView) { } void WebChromeClient::chromeDestroyed() { delete this; } // These functions scale between window and WebView coordinates because JavaScript/DOM operations // assume that the WebView and the window share the same coordinate system. void WebChromeClient::setWindowRect(const FloatRect& rect) { NSRect windowRect = toDeviceSpace(rect, [m_webView window]); [[m_webView _UIDelegateForwarder] webView:m_webView setFrame:windowRect]; } FloatRect WebChromeClient::windowRect() { NSRect windowRect = [[m_webView _UIDelegateForwarder] webViewFrame:m_webView]; return toUserSpace(windowRect, [m_webView window]); } // FIXME: We need to add API for setting and getting this. FloatRect WebChromeClient::pageRect() { return [m_webView frame]; } float WebChromeClient::scaleFactor() { if (NSWindow *window = [m_webView window]) return [window userSpaceScaleFactor]; return [[NSScreen mainScreen] userSpaceScaleFactor]; } void WebChromeClient::focus() { [[m_webView _UIDelegateForwarder] webViewFocus:m_webView]; } void WebChromeClient::unfocus() { [[m_webView _UIDelegateForwarder] webViewUnfocus:m_webView]; } bool WebChromeClient::canTakeFocus(FocusDirection) { // There's unfortunately no way to determine if we will become first responder again // once we give it up, so we just have to guess that we won't. return true; } void WebChromeClient::takeFocus(FocusDirection direction) { if (direction == FocusDirectionForward) { // Since we're trying to move focus out of m_webView, and because // m_webView may contain subviews within it, we ask it for the next key // view of the last view in its key view loop. This makes m_webView // behave as if it had no subviews, which is the behavior we want. NSView *lastView = [m_webView _findLastViewInKeyViewLoop]; // avoid triggering assertions if the WebView is the only thing in the key loop if ([m_webView _becomingFirstResponderFromOutside] && m_webView == [lastView nextValidKeyView]) return; [[m_webView window] selectKeyViewFollowingView:lastView]; } else { // avoid triggering assertions if the WebView is the only thing in the key loop if ([m_webView _becomingFirstResponderFromOutside] && m_webView == [m_webView previousValidKeyView]) return; [[m_webView window] selectKeyViewPrecedingView:m_webView]; } } Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& features) { NSURLRequest *URLRequest = nil; if (!request.isEmpty()) URLRequest = request.resourceRequest().nsURLRequest(); id delegate = [m_webView UIDelegate]; WebView *newWebView; if ([delegate respondsToSelector:@selector(webView:createWebViewWithRequest:windowFeatures:)]) { NSNumber *x = features.xSet ? [[NSNumber alloc] initWithFloat:features.x] : nil; NSNumber *y = features.ySet ? [[NSNumber alloc] initWithFloat:features.y] : nil; NSNumber *width = features.widthSet ? [[NSNumber alloc] initWithFloat:features.width] : nil; NSNumber *height = features.heightSet ? [[NSNumber alloc] initWithFloat:features.height] : nil; NSNumber *menuBarVisible = [[NSNumber alloc] initWithBool:features.menuBarVisible]; NSNumber *statusBarVisible = [[NSNumber alloc] initWithBool:features.statusBarVisible]; NSNumber *toolBarVisible = [[NSNumber alloc] initWithBool:features.toolBarVisible]; NSNumber *scrollbarsVisible = [[NSNumber alloc] initWithBool:features.scrollbarsVisible]; NSNumber *resizable = [[NSNumber alloc] initWithBool:features.resizable]; NSNumber *fullscreen = [[NSNumber alloc] initWithBool:features.fullscreen]; NSNumber *dialog = [[NSNumber alloc] initWithBool:features.dialog]; NSMutableDictionary *dictFeatures = [[NSMutableDictionary alloc] initWithObjectsAndKeys: menuBarVisible, @"menuBarVisible", statusBarVisible, @"statusBarVisible", toolBarVisible, @"toolBarVisible", scrollbarsVisible, @"scrollbarsVisible", resizable, @"resizable", fullscreen, @"fullscreen", dialog, @"dialog", nil]; if (x) [dictFeatures setObject:x forKey:@"x"]; if (y) [dictFeatures setObject:y forKey:@"y"]; if (width) [dictFeatures setObject:width forKey:@"width"]; if (height) [dictFeatures setObject:height forKey:@"height"]; newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewWithRequest:windowFeatures:), URLRequest, dictFeatures); [dictFeatures release]; [x release]; [y release]; [width release]; [height release]; [menuBarVisible release]; [statusBarVisible release]; [toolBarVisible release]; [scrollbarsVisible release]; [resizable release]; [fullscreen release]; [dialog release]; } else if (features.dialog && [delegate respondsToSelector:@selector(webView:createWebViewModalDialogWithRequest:)]) { newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewModalDialogWithRequest:), URLRequest); } else { newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewWithRequest:), URLRequest); } #if USE(PLUGIN_HOST_PROCESS) if (newWebView) WebKit::NetscapePluginHostManager::shared().didCreateWindow(); #endif return core(newWebView); } void WebChromeClient::show() { [[m_webView _UIDelegateForwarder] webViewShow:m_webView]; } bool WebChromeClient::canRunModal() { return [[m_webView UIDelegate] respondsToSelector:@selector(webViewRunModal:)]; } void WebChromeClient::runModal() { CallUIDelegate(m_webView, @selector(webViewRunModal:)); } void WebChromeClient::setToolbarsVisible(bool b) { [[m_webView _UIDelegateForwarder] webView:m_webView setToolbarsVisible:b]; } bool WebChromeClient::toolbarsVisible() { return CallUIDelegateReturningBoolean(NO, m_webView, @selector(webViewAreToolbarsVisible:)); } void WebChromeClient::setStatusbarVisible(bool b) { [[m_webView _UIDelegateForwarder] webView:m_webView setStatusBarVisible:b]; } bool WebChromeClient::statusbarVisible() { return CallUIDelegateReturningBoolean(NO, m_webView, @selector(webViewIsStatusBarVisible:)); } void WebChromeClient::setScrollbarsVisible(bool b) { [[[m_webView mainFrame] frameView] setAllowsScrolling:b]; } bool WebChromeClient::scrollbarsVisible() { return [[[m_webView mainFrame] frameView] allowsScrolling]; } void WebChromeClient::setMenubarVisible(bool) { // The menubar is always visible in Mac OS X. return; } bool WebChromeClient::menubarVisible() { // The menubar is always visible in Mac OS X. return true; } void WebChromeClient::setResizable(bool b) { [[m_webView _UIDelegateForwarder] webView:m_webView setResizable:b]; } void WebChromeClient::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned int lineNumber, const String& sourceURL) { id delegate = [m_webView UIDelegate]; SEL selector = @selector(webView:addMessageToConsole:); if (![delegate respondsToSelector:selector]) return; NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys: (NSString *)message, @"message", [NSNumber numberWithUnsignedInt:lineNumber], @"lineNumber", (NSString *)sourceURL, @"sourceURL", NULL]; CallUIDelegate(m_webView, selector, dictionary); [dictionary release]; } bool WebChromeClient::canRunBeforeUnloadConfirmPanel() { return [[m_webView UIDelegate] respondsToSelector:@selector(webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:)]; } bool WebChromeClient::runBeforeUnloadConfirmPanel(const String& message, Frame* frame) { return CallUIDelegateReturningBoolean(true, m_webView, @selector(webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:), message, kit(frame)); } void WebChromeClient::closeWindowSoon() { // We need to remove the parent WebView from WebViewSets here, before it actually // closes, to make sure that JavaScript code that executes before it closes // can't find it. Otherwise, window.open will select a closed WebView instead of // opening a new one <rdar://problem/3572585>. // We also need to stop the load to prevent further parsing or JavaScript execution // after the window has torn down <rdar://problem/4161660>. // FIXME: This code assumes that the UI delegate will respond to a webViewClose // message by actually closing the WebView. Safari guarantees this behavior, but other apps might not. // This approach is an inherent limitation of not making a close execute immediately // after a call to window.close. [m_webView setGroupName:nil]; [m_webView stopLoading:nil]; [m_webView performSelector:@selector(_closeWindow) withObject:nil afterDelay:0.0]; } void WebChromeClient::runJavaScriptAlert(Frame* frame, const String& message) { id delegate = [m_webView UIDelegate]; SEL selector = @selector(webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:); if ([delegate respondsToSelector:selector]) { CallUIDelegate(m_webView, selector, message, kit(frame)); return; } // Call the old version of the delegate method if it is implemented. selector = @selector(webView:runJavaScriptAlertPanelWithMessage:); if ([delegate respondsToSelector:selector]) { CallUIDelegate(m_webView, selector, message); return; } } bool WebChromeClient::runJavaScriptConfirm(Frame* frame, const String& message) { id delegate = [m_webView UIDelegate]; SEL selector = @selector(webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:); if ([delegate respondsToSelector:selector]) return CallUIDelegateReturningBoolean(NO, m_webView, selector, message, kit(frame)); // Call the old version of the delegate method if it is implemented. selector = @selector(webView:runJavaScriptConfirmPanelWithMessage:); if ([delegate respondsToSelector:selector]) return CallUIDelegateReturningBoolean(NO, m_webView, selector, message); return NO; } bool WebChromeClient::runJavaScriptPrompt(Frame* frame, const String& prompt, const String& defaultText, String& result) { id delegate = [m_webView UIDelegate]; SEL selector = @selector(webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:); if ([delegate respondsToSelector:selector]) { result = (NSString *)CallUIDelegate(m_webView, selector, prompt, defaultText, kit(frame)); return !result.isNull(); } // Call the old version of the delegate method if it is implemented. selector = @selector(webView:runJavaScriptTextInputPanelWithPrompt:defaultText:); if ([delegate respondsToSelector:selector]) { result = (NSString *)CallUIDelegate(m_webView, selector, prompt, defaultText); return !result.isNull(); } result = [[WebDefaultUIDelegate sharedUIDelegate] webView:m_webView runJavaScriptTextInputPanelWithPrompt:prompt defaultText:defaultText initiatedByFrame:kit(frame)]; return !result.isNull(); } bool WebChromeClient::shouldInterruptJavaScript() { return CallUIDelegate(m_webView, @selector(webViewShouldInterruptJavaScript:)); } void WebChromeClient::setStatusbarText(const String& status) { // We want the temporaries allocated here to be released even before returning to the // event loop; see <http://bugs.webkit.org/show_bug.cgi?id=9880>. NSAutoreleasePool* localPool = [[NSAutoreleasePool alloc] init]; CallUIDelegate(m_webView, @selector(webView:setStatusText:), (NSString *)status); [localPool drain]; } bool WebChromeClient::tabsToLinks() const { return [[m_webView preferences] tabsToLinks]; } IntRect WebChromeClient::windowResizerRect() const { NSRect rect = [[m_webView window] _growBoxRect]; if ([m_webView _usesDocumentViews]) return enclosingIntRect(rect); return enclosingIntRect([m_webView convertRect:rect fromView:nil]); } void WebChromeClient::repaint(const IntRect& rect, bool contentChanged, bool immediate, bool repaintContentOnly) { if ([m_webView _usesDocumentViews]) return; if (contentChanged) [m_webView setNeedsDisplayInRect:rect]; if (immediate) { [[m_webView window] displayIfNeeded]; [[m_webView window] flushWindowIfNeeded]; } } void WebChromeClient::scroll(const IntSize&, const IntRect&, const IntRect&) { } IntPoint WebChromeClient::screenToWindow(const IntPoint& p) const { if ([m_webView _usesDocumentViews]) return p; NSPoint windowCoord = [[m_webView window] convertScreenToBase:p]; return IntPoint([m_webView convertPoint:windowCoord fromView:nil]); } IntRect WebChromeClient::windowToScreen(const IntRect& r) const { if ([m_webView _usesDocumentViews]) return r; NSRect tempRect = r; tempRect = [m_webView convertRect:tempRect toView:nil]; tempRect.origin = [[m_webView window] convertBaseToScreen:tempRect.origin]; return enclosingIntRect(tempRect); } PlatformPageClient WebChromeClient::platformPageClient() const { if ([m_webView _usesDocumentViews]) return 0; return m_webView; } void WebChromeClient::contentsSizeChanged(Frame*, const IntSize&) const { } void WebChromeClient::scrollRectIntoView(const IntRect& r, const ScrollView* scrollView) const { // FIXME: This scrolling behavior should be under the control of the embedding client (rather than something // we just do ourselves). IntRect scrollRect = r; NSView *startView = m_webView; if ([m_webView _usesDocumentViews]) { // We have to convert back to document view coordinates. // It doesn't make sense for the scrollRectIntoView API to take document view coordinates. scrollRect.move(scrollView->scrollOffset()); startView = [[[m_webView mainFrame] frameView] documentView]; } NSRect rect = scrollRect; for (NSView *view = startView; view; view = [view superview]) { if ([view isKindOfClass:[NSClipView class]]) { NSClipView *clipView = (NSClipView *)view; NSView *documentView = [clipView documentView]; [documentView scrollRectToVisible:[documentView convertRect:rect fromView:startView]]; } } } // End host window methods. void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags) { WebElementDictionary *element = [[WebElementDictionary alloc] initWithHitTestResult:result]; [m_webView _mouseDidMoveOverElement:element modifierFlags:modifierFlags]; [element release]; } void WebChromeClient::setToolTip(const String& toolTip, TextDirection) { [m_webView _setToolTip:toolTip]; } void WebChromeClient::print(Frame* frame) { WebFrame *webFrame = kit(frame); if ([[m_webView UIDelegate] respondsToSelector:@selector(webView:printFrame:)]) CallUIDelegate(m_webView, @selector(webView:printFrame:), webFrame); else if ([m_webView _usesDocumentViews]) CallUIDelegate(m_webView, @selector(webView:printFrameView:), [webFrame frameView]); } #if ENABLE(DATABASE) void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName) { BEGIN_BLOCK_OBJC_EXCEPTIONS; WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:frame->document()->securityOrigin()]; // FIXME: remove this workaround once shipping Safari has the necessary delegate implemented. if (WKAppVersionCheckLessThan(@"com.apple.Safari", -1, 3.1)) { const unsigned long long defaultQuota = 5 * 1024 * 1024; // 5 megabytes should hopefully be enough to test storage support. [webOrigin setQuota:defaultQuota]; } else CallUIDelegate(m_webView, @selector(webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:), kit(frame), webOrigin, (NSString *)databaseName); [webOrigin release]; END_BLOCK_OBJC_EXCEPTIONS; } #endif #if ENABLE(OFFLINE_WEB_APPLICATIONS) void WebChromeClient::reachedMaxAppCacheSize(int64_t spaceNeeded) { // FIXME: Free some space. } #endif void WebChromeClient::populateVisitedLinks() { BEGIN_BLOCK_OBJC_EXCEPTIONS; [[WebHistory optionalSharedHistory] _addVisitedLinksToPageGroup:[m_webView page]->group()]; END_BLOCK_OBJC_EXCEPTIONS; } #if ENABLE(DASHBOARD_SUPPORT) void WebChromeClient::dashboardRegionsChanged() { BEGIN_BLOCK_OBJC_EXCEPTIONS; NSMutableDictionary *regions = core([m_webView mainFrame])->dashboardRegionsDictionary(); [m_webView _addScrollerDashboardRegions:regions]; CallUIDelegate(m_webView, @selector(webView:dashboardRegionsChanged:), regions); END_BLOCK_OBJC_EXCEPTIONS; } #endif FloatRect WebChromeClient::customHighlightRect(Node* node, const AtomicString& type, const FloatRect& lineRect) { BEGIN_BLOCK_OBJC_EXCEPTIONS; NSView *documentView = [[kit(node->document()->frame()) frameView] documentView]; if (![documentView isKindOfClass:[WebHTMLView class]]) return NSZeroRect; WebHTMLView *webHTMLView = (WebHTMLView *)documentView; id<WebHTMLHighlighter> highlighter = [webHTMLView _highlighterForType:type]; if ([(NSObject *)highlighter respondsToSelector:@selector(highlightRectForLine:representedNode:)]) return [highlighter highlightRectForLine:lineRect representedNode:kit(node)]; return [highlighter highlightRectForLine:lineRect]; END_BLOCK_OBJC_EXCEPTIONS; return NSZeroRect; } void WebChromeClient::paintCustomHighlight(Node* node, const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect, bool behindText, bool entireLine) { BEGIN_BLOCK_OBJC_EXCEPTIONS; NSView *documentView = [[kit(node->document()->frame()) frameView] documentView]; if (![documentView isKindOfClass:[WebHTMLView class]]) return; WebHTMLView *webHTMLView = (WebHTMLView *)documentView; id<WebHTMLHighlighter> highlighter = [webHTMLView _highlighterForType:type]; if ([(NSObject *)highlighter respondsToSelector:@selector(paintHighlightForBox:onLine:behindText:entireLine:representedNode:)]) [highlighter paintHighlightForBox:boxRect onLine:lineRect behindText:behindText entireLine:entireLine representedNode:kit(node)]; else [highlighter paintHighlightForBox:boxRect onLine:lineRect behindText:behindText entireLine:entireLine]; END_BLOCK_OBJC_EXCEPTIONS; } void WebChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> chooser) { BEGIN_BLOCK_OBJC_EXCEPTIONS; BOOL allowMultipleFiles = chooser->allowsMultipleFiles(); WebOpenPanelResultListener *listener = [[WebOpenPanelResultListener alloc] initWithChooser:chooser]; id delegate = [m_webView UIDelegate]; if ([delegate respondsToSelector:@selector(webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:)]) CallUIDelegate(m_webView, @selector(webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:), listener, allowMultipleFiles); else CallUIDelegate(m_webView, @selector(webView:runOpenPanelForFileButtonWithResultListener:), listener); [listener release]; END_BLOCK_OBJC_EXCEPTIONS; } KeyboardUIMode WebChromeClient::keyboardUIMode() { BEGIN_BLOCK_OBJC_EXCEPTIONS; return [m_webView _keyboardUIMode]; END_BLOCK_OBJC_EXCEPTIONS; return KeyboardAccessDefault; } NSResponder *WebChromeClient::firstResponder() { BEGIN_BLOCK_OBJC_EXCEPTIONS; return [[m_webView _UIDelegateForwarder] webViewFirstResponder:m_webView]; END_BLOCK_OBJC_EXCEPTIONS; return nil; } void WebChromeClient::makeFirstResponder(NSResponder *responder) { BEGIN_BLOCK_OBJC_EXCEPTIONS; [m_webView _pushPerformingProgrammaticFocus]; [[m_webView _UIDelegateForwarder] webView:m_webView makeFirstResponder:responder]; [m_webView _popPerformingProgrammaticFocus]; END_BLOCK_OBJC_EXCEPTIONS; } void WebChromeClient::willPopUpMenu(NSMenu *menu) { BEGIN_BLOCK_OBJC_EXCEPTIONS; CallUIDelegate(m_webView, @selector(webView:willPopupMenu:), menu); END_BLOCK_OBJC_EXCEPTIONS; } bool WebChromeClient::shouldReplaceWithGeneratedFileForUpload(const String& path, String& generatedFilename) { NSString* filename; if (![[m_webView _UIDelegateForwarder] webView:m_webView shouldReplaceUploadFile:path usingGeneratedFilename:&filename]) return false; generatedFilename = filename; return true; } String WebChromeClient::generateReplacementFile(const String& path) { return [[m_webView _UIDelegateForwarder] webView:m_webView generateReplacementFile:path]; } void WebChromeClient::formStateDidChange(const WebCore::Node* node) { CallUIDelegate(m_webView, @selector(webView:formStateDidChangeForNode:), kit(const_cast<WebCore::Node*>(node))); } void WebChromeClient::formDidFocus(const WebCore::Node* node) { CallUIDelegate(m_webView, @selector(webView:formDidFocusNode:), kit(const_cast<WebCore::Node*>(node))); } void WebChromeClient::formDidBlur(const WebCore::Node* node) { CallUIDelegate(m_webView, @selector(webView:formDidBlurNode:), kit(const_cast<WebCore::Node*>(node))); } #if USE(ACCELERATED_COMPOSITING) void WebChromeClient::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer) { BEGIN_BLOCK_OBJC_EXCEPTIONS; NSView *documentView = [[kit(frame) frameView] documentView]; if (![documentView isKindOfClass:[WebHTMLView class]]) { // We should never be attaching when we don't have a WebHTMLView. ASSERT(!graphicsLayer); return; } WebHTMLView *webHTMLView = (WebHTMLView *)documentView; if (graphicsLayer) [webHTMLView attachRootLayer:graphicsLayer->nativeLayer()]; else [webHTMLView detachRootLayer]; END_BLOCK_OBJC_EXCEPTIONS; } void WebChromeClient::setNeedsOneShotDrawingSynchronization() { BEGIN_BLOCK_OBJC_EXCEPTIONS; [m_webView _setNeedsOneShotDrawingSynchronization:YES]; END_BLOCK_OBJC_EXCEPTIONS; } void WebChromeClient::scheduleCompositingLayerSync() { BEGIN_BLOCK_OBJC_EXCEPTIONS; [m_webView _scheduleCompositingLayerSync]; END_BLOCK_OBJC_EXCEPTIONS; } #endif void WebChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geolocation* geolocation) { BEGIN_BLOCK_OBJC_EXCEPTIONS; WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:frame->document()->securityOrigin()]; WebGeolocation *webGeolocation = [[WebGeolocation alloc] _initWithWebCoreGeolocation:geolocation]; CallUIDelegate(m_webView, @selector(webView:frame:requestGeolocationPermission:securityOrigin:), kit(frame), webGeolocation, webOrigin); [webOrigin release]; [webGeolocation release]; END_BLOCK_OBJC_EXCEPTIONS; } @implementation WebOpenPanelResultListener - (id)initWithChooser:(PassRefPtr<FileChooser>)chooser { self = [super init]; if (!self) return nil; _chooser = chooser.releaseRef(); return self; } #ifndef NDEBUG - (void)dealloc { ASSERT(!_chooser); [super dealloc]; } - (void)finalize { ASSERT(!_chooser); [super finalize]; } #endif - (void)cancel { ASSERT(_chooser); if (!_chooser) return; _chooser->deref(); _chooser = 0; } - (void)chooseFilename:(NSString *)filename { ASSERT(_chooser); if (!_chooser) return; _chooser->chooseFile(filename); _chooser->deref(); _chooser = 0; } - (void)chooseFilenames:(NSArray *)filenames { ASSERT(_chooser); if (!_chooser) return; int count = [filenames count]; Vector<String> names(count); for (int i = 0; i < count; i++) names[i] = [filenames objectAtIndex:i]; _chooser->chooseFiles(names); _chooser->deref(); _chooser = 0; } @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebDragClient.mm����������������������������������������������������������0000644�0001750�0001750�00000013740�10773311175�017041� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007, 2008 Apple 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 "WebDragClient.h" #import "WebArchive.h" #import "WebDOMOperations.h" #import "WebFrame.h" #import "WebFrameInternal.h" #import "WebHTMLViewInternal.h" #import "WebHTMLViewPrivate.h" #import "WebKitLogging.h" #import "WebNSPasteboardExtras.h" #import "WebNSURLExtras.h" #import "WebUIDelegate.h" #import "WebUIDelegatePrivate.h" #import "WebViewInternal.h" #import <WebCore/ClipboardMac.h> #import <WebCore/DragData.h> #import <WebCore/EventHandler.h> #import <WebCore/Frame.h> #import <WebCore/FrameView.h> #import <WebCore/Image.h> #import <WebCore/Page.h> using namespace WebCore; WebDragClient::WebDragClient(WebView* webView) : m_webView(webView) { } static WebHTMLView *getTopHTMLView(Frame* frame) { ASSERT(frame); ASSERT(frame->page()); return (WebHTMLView*)[[kit(frame->page()->mainFrame()) frameView] documentView]; } WebCore::DragDestinationAction WebDragClient::actionMaskForDrag(WebCore::DragData* dragData) { return (WebCore::DragDestinationAction)[[m_webView _UIDelegateForwarder] webView:m_webView dragDestinationActionMaskForDraggingInfo:dragData->platformData()]; } void WebDragClient::willPerformDragDestinationAction(WebCore::DragDestinationAction action, WebCore::DragData* dragData) { [[m_webView _UIDelegateForwarder] webView:m_webView willPerformDragDestinationAction:(WebDragDestinationAction)action forDraggingInfo:dragData->platformData()]; } WebCore::DragSourceAction WebDragClient::dragSourceActionMaskForPoint(const IntPoint& windowPoint) { NSPoint viewPoint = [m_webView convertPoint:windowPoint fromView:nil]; return (DragSourceAction)[[m_webView _UIDelegateForwarder] webView:m_webView dragSourceActionMaskForPoint:viewPoint]; } void WebDragClient::willPerformDragSourceAction(WebCore::DragSourceAction action, const WebCore::IntPoint& mouseDownPoint, WebCore::Clipboard* clipboard) { ASSERT(clipboard); [[m_webView _UIDelegateForwarder] webView:m_webView willPerformDragSourceAction:(WebDragSourceAction)action fromPoint:mouseDownPoint withPasteboard:static_cast<WebCore::ClipboardMac*>(clipboard)->pasteboard()]; } void WebDragClient::startDrag(DragImageRef dragImage, const IntPoint& at, const IntPoint& eventPos, Clipboard* clipboard, Frame* frame, bool linkDrag) { if (!frame) return; ASSERT(clipboard); RetainPtr<WebHTMLView> htmlView = (WebHTMLView*)[[kit(frame) frameView] documentView]; if (![htmlView.get() isKindOfClass:[WebHTMLView class]]) return; NSEvent *event = linkDrag ? frame->eventHandler()->currentNSEvent() : [htmlView.get() _mouseDownEvent]; WebHTMLView* topHTMLView = getTopHTMLView(frame); RetainPtr<WebHTMLView> topViewProtector = topHTMLView; [topHTMLView _stopAutoscrollTimer]; NSPasteboard *pasteboard = static_cast<ClipboardMac*>(clipboard)->pasteboard(); NSImage *dragNSImage = dragImage.get(); WebHTMLView *sourceHTMLView = htmlView.get(); id delegate = [m_webView UIDelegate]; SEL selector = @selector(webView:dragImage:at:offset:event:pasteboard:source:slideBack:forView:); if ([delegate respondsToSelector:selector]) { if ([m_webView _catchesDelegateExceptions]) { @try { [delegate webView:m_webView dragImage:dragNSImage at:at offset:NSZeroSize event:event pasteboard:pasteboard source:sourceHTMLView slideBack:YES forView:topHTMLView]; } @catch (id exception) { ReportDiscardedDelegateException(selector, exception); } } else [delegate webView:m_webView dragImage:dragNSImage at:at offset:NSZeroSize event:event pasteboard:pasteboard source:sourceHTMLView slideBack:YES forView:topHTMLView]; } else [topHTMLView dragImage:dragNSImage at:at offset:NSZeroSize event:event pasteboard:pasteboard source:sourceHTMLView slideBack:YES]; } DragImageRef WebDragClient::createDragImageForLink(KURL& url, const String& title, Frame* frame) { if (!frame) return nil; WebHTMLView *htmlView = (WebHTMLView *)[[kit(frame) frameView] documentView]; NSString *label = 0; if (!title.isEmpty()) label = title; NSURL *cocoaURL = url; return [htmlView _dragImageForURL:[cocoaURL _web_userVisibleString] withLabel:label]; } void WebDragClient::declareAndWriteDragImage(NSPasteboard* pasteboard, DOMElement* element, NSURL* URL, NSString* title, WebCore::Frame* frame) { ASSERT(pasteboard); ASSERT(element); WebHTMLView *source = getTopHTMLView(frame); WebArchive *archive = [element webArchive]; [pasteboard _web_declareAndWriteDragImageForElement:element URL:URL title:title archive:archive source:source]; } void WebDragClient::dragControllerDestroyed() { delete this; } ��������������������������������WebKit/mac/WebCoreSupport/WebJavaScriptTextInputPanel.h���������������������������������������������0000644�0001750�0001750�00000003561�10360512352�021546� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> @interface WebJavaScriptTextInputPanel : NSWindowController { IBOutlet NSTextField *prompt; IBOutlet NSTextField *textInput; } - (id)initWithPrompt:(NSString *)prompt text:(NSString *)text; - (NSString *)text; - (IBAction)pressedCancel:(id)sender; - (IBAction)pressedOK:(id)sender; @end �����������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm���������������������������������������������������0000644�0001750�0001750�00000222441�11260532745�020345� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006, 2007, 2008, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebFrameLoaderClient.h" // Terrible hack; lets us get at the WebFrame private structure. #define private public #import "WebFrame.h" #undef private #import "DOMElementInternal.h" #import "WebBackForwardList.h" #import "WebCachedFramePlatformData.h" #import "WebChromeClient.h" #import "WebDataSourceInternal.h" #import "WebDelegateImplementationCaching.h" #import "WebDocumentInternal.h" #import "WebDocumentLoaderMac.h" #import "WebDownloadInternal.h" #import "WebDynamicScrollBarsViewInternal.h" #import "WebElementDictionary.h" #import "WebFormDelegate.h" #import "WebFrameInternal.h" #import "WebFrameLoadDelegate.h" #import "WebFrameViewInternal.h" #import "WebHTMLRepresentationPrivate.h" #import "WebHTMLViewInternal.h" #import "WebHistoryItemInternal.h" #import "WebHistoryInternal.h" #import "WebIconDatabaseInternal.h" #import "WebKitErrorsPrivate.h" #import "WebKitLogging.h" #import "WebKitNSStringExtras.h" #import "WebNavigationData.h" #import "WebNSURLExtras.h" #import "WebNetscapePluginView.h" #import "WebNetscapePluginPackage.h" #import "WebNullPluginView.h" #import "WebPanelAuthenticationHandler.h" #import "WebPluginController.h" #import "WebPluginPackage.h" #import "WebPluginViewFactoryPrivate.h" #import "WebPolicyDelegate.h" #import "WebPolicyDelegatePrivate.h" #import "WebPreferences.h" #import "WebResourceLoadDelegate.h" #import "WebSecurityOriginInternal.h" #import "WebUIDelegate.h" #import "WebUIDelegatePrivate.h" #import "WebViewInternal.h" #import <WebKitSystemInterface.h> #import <WebCore/AuthenticationMac.h> #import <WebCore/BlockExceptions.h> #import <WebCore/CachedFrame.h> #import <WebCore/Chrome.h> #import <WebCore/Document.h> #import <WebCore/DocumentLoader.h> #import <WebCore/EventHandler.h> #import <WebCore/FocusController.h> #import <WebCore/FormState.h> #import <WebCore/Frame.h> #import <WebCore/FrameLoader.h> #import <WebCore/FrameLoaderTypes.h> #import <WebCore/FrameTree.h> #import <WebCore/FrameView.h> #import <WebCore/HTMLAppletElement.h> #import <WebCore/HTMLHeadElement.h> #import <WebCore/HTMLFormElement.h> #import <WebCore/HTMLFrameElement.h> #import <WebCore/HTMLFrameOwnerElement.h> #import <WebCore/HTMLNames.h> #import <WebCore/HTMLPlugInElement.h> #import <WebCore/HistoryItem.h> #import <WebCore/HitTestResult.h> #import <WebCore/IconDatabase.h> #import <WebCore/LoaderNSURLExtras.h> #import <WebCore/MIMETypeRegistry.h> #import <WebCore/MouseEvent.h> #import <WebCore/Page.h> #import <WebCore/PlatformString.h> #import <WebCore/ResourceError.h> #import <WebCore/ResourceHandle.h> #import <WebCore/ResourceLoader.h> #import <WebCore/ResourceRequest.h> #import <WebCore/ScriptController.h> #import <WebCore/ScriptString.h> #import <WebCore/SharedBuffer.h> #import <WebCore/WebCoreObjCExtras.h> #import <WebCore/Widget.h> #import <WebKit/DOMElement.h> #import <WebKit/DOMHTMLFormElement.h> #import <runtime/InitializeThreading.h> #import <wtf/PassRefPtr.h> #if ENABLE(MAC_JAVA_BRIDGE) #import "WebJavaPlugIn.h" #endif #if USE(PLUGIN_HOST_PROCESS) #import "NetscapePluginHostManager.h" #import "WebHostedNetscapePluginView.h" #endif using namespace WebCore; using namespace HTMLNames; #if ENABLE(MAC_JAVA_BRIDGE) @interface NSView (WebJavaPluginDetails) - (jobject)pollForAppletInWindow:(NSWindow *)window; @end #endif @interface NSURLDownload (WebNSURLDownloadDetails) - (void)_setOriginatingURL:(NSURL *)originatingURL; @end // For backwards compatibility with older WebKit plug-ins. NSString *WebPluginBaseURLKey = @"WebPluginBaseURL"; NSString *WebPluginAttributesKey = @"WebPluginAttributes"; NSString *WebPluginContainerKey = @"WebPluginContainer"; @interface WebFramePolicyListener : NSObject <WebPolicyDecisionListener, WebFormSubmissionListener> { Frame* m_frame; } - (id)initWithWebCoreFrame:(Frame*)frame; - (void)invalidate; @end static inline WebDataSource *dataSource(DocumentLoader* loader) { return loader ? static_cast<WebDocumentLoaderMac*>(loader)->dataSource() : nil; } // Quirk for the Apple Dictionary application. // // If a top level frame has a <script> element in its <head> for a script named MainPageJavaScript.js, // then for that frame's document, ignore changes to the scrolling attribute of frames. That script // has a bug in it where it sets the scrolling attribute on frames, and that erroneous scrolling // attribute needs to be ignored to avoid showing extra scroll bars in the window. // This quirk can be removed when Apple Dictionary is fixed (see <rdar://problem/6471058>). static void applyAppleDictionaryApplicationQuirkNonInlinePart(WebFrameLoaderClient* client, const ResourceRequest& request) { if (!request.url().isLocalFile()) return; if (!request.url().string().endsWith("MainPageJavaScript.js")) return; Frame* frame = core(client->webFrame()); if (!frame) return; if (frame->tree()->parent()) return; Document* document = frame->document(); if (!document) return; HTMLHeadElement* head = document->head(); if (!head) return; for (Node* c = head->firstChild(); c; c = c->nextSibling()) { if (c->hasTagName(scriptTag) && static_cast<Element*>(c)->getAttribute(srcAttr) == "MainPageJavaScript.js") { document->setFrameElementsShouldIgnoreScrolling(true); return; } } } static inline void applyAppleDictionaryApplicationQuirk(WebFrameLoaderClient* client, const ResourceRequest& request) { // Use a one-time-initialized global variable so we can quickly determine there's nothing to do in // all applications other than Apple Dictionary. static bool isAppleDictionary = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Dictionary"]; if (isAppleDictionary) applyAppleDictionaryApplicationQuirkNonInlinePart(client, request); } WebFrameLoaderClient::WebFrameLoaderClient(WebFrame *webFrame) : m_webFrame(webFrame) , m_policyFunction(0) { } void WebFrameLoaderClient::frameLoaderDestroyed() { [m_webFrame.get() _clearCoreFrame]; delete this; } bool WebFrameLoaderClient::hasWebView() const { return [m_webFrame.get() webView] != nil; } void WebFrameLoaderClient::makeRepresentation(DocumentLoader* loader) { [dataSource(loader) _makeRepresentation]; } bool WebFrameLoaderClient::hasHTMLView() const { if (![getWebView(m_webFrame.get()) _usesDocumentViews]) { // FIXME (Viewless): For now we just assume that all frames have an HTML view return true; } NSView <WebDocumentView> *view = [m_webFrame->_private->webFrameView documentView]; return [view isKindOfClass:[WebHTMLView class]]; } void WebFrameLoaderClient::forceLayout() { NSView <WebDocumentView> *view = [m_webFrame->_private->webFrameView documentView]; if ([view isKindOfClass:[WebHTMLView class]]) [(WebHTMLView *)view setNeedsToApplyStyles:YES]; [view setNeedsLayout:YES]; [view layout]; } void WebFrameLoaderClient::forceLayoutForNonHTML() { WebFrameView *thisView = m_webFrame->_private->webFrameView; if (!thisView) // Viewless mode. return; NSView <WebDocumentView> *thisDocumentView = [thisView documentView]; ASSERT(thisDocumentView != nil); // Tell the just loaded document to layout. This may be necessary // for non-html content that needs a layout message. if (!([[m_webFrame.get() _dataSource] _isDocumentHTML])) { [thisDocumentView setNeedsLayout:YES]; [thisDocumentView layout]; [thisDocumentView setNeedsDisplay:YES]; } } void WebFrameLoaderClient::setCopiesOnScroll() { [[[m_webFrame->_private->webFrameView _scrollView] contentView] setCopiesOnScroll:YES]; } void WebFrameLoaderClient::detachedFromParent2() { //remove any NetScape plugins that are children of this frame because they are about to be detached WebView *webView = getWebView(m_webFrame.get()); [webView removePluginInstanceViewsFor:(m_webFrame.get())]; [m_webFrame->_private->webFrameView _setWebFrame:nil]; // needed for now to be compatible w/ old behavior } void WebFrameLoaderClient::detachedFromParent3() { [m_webFrame->_private->webFrameView release]; m_webFrame->_private->webFrameView = nil; } void WebFrameLoaderClient::download(ResourceHandle* handle, const ResourceRequest& request, const ResourceRequest& initialRequest, const ResourceResponse& response) { id proxy = handle->releaseProxy(); ASSERT(proxy); WebView *webView = getWebView(m_webFrame.get()); WebDownload *download = [WebDownload _downloadWithLoadingConnection:handle->connection() request:request.nsURLRequest() response:response.nsURLResponse() delegate:[webView downloadDelegate] proxy:proxy]; setOriginalURLForDownload(download, initialRequest); } void WebFrameLoaderClient::setOriginalURLForDownload(WebDownload *download, const ResourceRequest& initialRequest) const { NSURLRequest *initialURLRequest = initialRequest.nsURLRequest(); NSURL *originalURL = nil; // If there was no referrer, don't traverse the back/forward history // since this download was initiated directly. <rdar://problem/5294691> if ([initialURLRequest valueForHTTPHeaderField:@"Referer"]) { // find the first item in the history that was originated by the user WebView *webView = getWebView(m_webFrame.get()); WebBackForwardList *history = [webView backForwardList]; int backListCount = [history backListCount]; for (int backIndex = 0; backIndex <= backListCount && !originalURL; backIndex++) { // FIXME: At one point we had code here to check a "was user gesture" flag. // Do we need to restore that logic? originalURL = [[history itemAtIndex:-backIndex] URL]; } } if (!originalURL) originalURL = [initialURLRequest URL]; if ([download respondsToSelector:@selector(_setOriginatingURL:)]) { NSString *scheme = [originalURL scheme]; NSString *host = [originalURL host]; if (scheme && host && [scheme length] && [host length]) { NSNumber *port = [originalURL port]; if (port && [port intValue] < 0) port = nil; NSString *hostOnlyURLString; if (port) hostOnlyURLString = [[NSString alloc] initWithFormat:@"%@://%@:%d", scheme, host, [port intValue]]; else hostOnlyURLString = [[NSString alloc] initWithFormat:@"%@://%@", scheme, host]; NSURL *hostOnlyURL = [[NSURL alloc] initWithString:hostOnlyURLString]; [hostOnlyURLString release]; [download _setOriginatingURL:hostOnlyURL]; [hostOnlyURL release]; } } } bool WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader* loader, const ResourceRequest& request, const ResourceResponse& response, int length) { applyAppleDictionaryApplicationQuirk(this, request); WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); if (!implementations->didLoadResourceFromMemoryCacheFunc) return false; CallResourceLoadDelegate(implementations->didLoadResourceFromMemoryCacheFunc, webView, @selector(webView:didLoadResourceFromMemoryCache:response:length:fromDataSource:), request.nsURLRequest(), response.nsURLResponse(), length, dataSource(loader)); return true; } void WebFrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString) { } void WebFrameLoaderClient::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request) { WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); id object = nil; BOOL shouldRelease = NO; if (implementations->identifierForRequestFunc) object = CallResourceLoadDelegate(implementations->identifierForRequestFunc, webView, @selector(webView:identifierForInitialRequest:fromDataSource:), request.nsURLRequest(), dataSource(loader)); else { object = [[NSObject alloc] init]; shouldRelease = YES; } [webView _addObject:object forIdentifier:identifier]; if (shouldRelease) [object release]; } void WebFrameLoaderClient::dispatchWillSendRequest(DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse) { applyAppleDictionaryApplicationQuirk(this, request); WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); if (redirectResponse.isNull()) static_cast<WebDocumentLoaderMac*>(loader)->increaseLoadCount(identifier); if (implementations->willSendRequestFunc) request = (NSURLRequest *)CallResourceLoadDelegate(implementations->willSendRequestFunc, webView, @selector(webView:resource:willSendRequest:redirectResponse:fromDataSource:), [webView _objectForIdentifier:identifier], request.nsURLRequest(), redirectResponse.nsURLResponse(), dataSource(loader)); } bool WebFrameLoaderClient::shouldUseCredentialStorage(DocumentLoader* loader, unsigned long identifier) { WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); if (implementations->shouldUseCredentialStorageFunc) { if (id resource = [webView _objectForIdentifier:identifier]) return CallResourceLoadDelegateReturningBoolean(NO, implementations->shouldUseCredentialStorageFunc, webView, @selector(webView:resource:shouldUseCredentialStorageForDataSource:), resource, dataSource(loader)); } return true; } void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader* loader, unsigned long identifier, const AuthenticationChallenge& challenge) { WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); NSURLAuthenticationChallenge *webChallenge = mac(challenge); if (implementations->didReceiveAuthenticationChallengeFunc) { if (id resource = [webView _objectForIdentifier:identifier]) { CallResourceLoadDelegate(implementations->didReceiveAuthenticationChallengeFunc, webView, @selector(webView:resource:didReceiveAuthenticationChallenge:fromDataSource:), resource, webChallenge, dataSource(loader)); return; } } NSWindow *window = [webView hostWindow] ? [webView hostWindow] : [webView window]; [[WebPanelAuthenticationHandler sharedHandler] startAuthentication:webChallenge window:window]; } void WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge(DocumentLoader* loader, unsigned long identifier, const AuthenticationChallenge&challenge) { WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); NSURLAuthenticationChallenge *webChallenge = mac(challenge); if (implementations->didCancelAuthenticationChallengeFunc) { if (id resource = [webView _objectForIdentifier:identifier]) { CallResourceLoadDelegate(implementations->didCancelAuthenticationChallengeFunc, webView, @selector(webView:resource:didCancelAuthenticationChallenge:fromDataSource:), resource, webChallenge, dataSource(loader)); return; } } [(WebPanelAuthenticationHandler *)[WebPanelAuthenticationHandler sharedHandler] cancelAuthentication:webChallenge]; } void WebFrameLoaderClient::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& response) { WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); if (implementations->didReceiveResponseFunc) { if (id resource = [webView _objectForIdentifier:identifier]) CallResourceLoadDelegate(implementations->didReceiveResponseFunc, webView, @selector(webView:resource:didReceiveResponse:fromDataSource:), resource, response.nsURLResponse(), dataSource(loader)); } } NSCachedURLResponse* WebFrameLoaderClient::willCacheResponse(DocumentLoader* loader, unsigned long identifier, NSCachedURLResponse* response) const { WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); if (implementations->willCacheResponseFunc) { if (id resource = [webView _objectForIdentifier:identifier]) return CallResourceLoadDelegate(implementations->willCacheResponseFunc, webView, @selector(webView:resource:willCacheResponse:fromDataSource:), resource, response, dataSource(loader)); } return response; } void WebFrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader* loader, unsigned long identifier, int lengthReceived) { WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); if (implementations->didReceiveContentLengthFunc) { if (id resource = [webView _objectForIdentifier:identifier]) CallResourceLoadDelegate(implementations->didReceiveContentLengthFunc, webView, @selector(webView:resource:didReceiveContentLength:fromDataSource:), resource, (NSInteger)lengthReceived, dataSource(loader)); } } void WebFrameLoaderClient::dispatchDidFinishLoading(DocumentLoader* loader, unsigned long identifier) { WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); if (implementations->didFinishLoadingFromDataSourceFunc) { if (id resource = [webView _objectForIdentifier:identifier]) CallResourceLoadDelegate(implementations->didFinishLoadingFromDataSourceFunc, webView, @selector(webView:resource:didFinishLoadingFromDataSource:), resource, dataSource(loader)); } [webView _removeObjectForIdentifier:identifier]; static_cast<WebDocumentLoaderMac*>(loader)->decreaseLoadCount(identifier); } void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError& error) { WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); if (implementations->didFailLoadingWithErrorFromDataSourceFunc) { if (id resource = [webView _objectForIdentifier:identifier]) CallResourceLoadDelegate(implementations->didFailLoadingWithErrorFromDataSourceFunc, webView, @selector(webView:resource:didFailLoadingWithError:fromDataSource:), resource, (NSError *)error, dataSource(loader)); } [webView _removeObjectForIdentifier:identifier]; static_cast<WebDocumentLoaderMac*>(loader)->decreaseLoadCount(identifier); } void WebFrameLoaderClient::dispatchDidHandleOnloadEvents() { WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didHandleOnloadEventsForFrameFunc) CallFrameLoadDelegate(implementations->didHandleOnloadEventsForFrameFunc, webView, @selector(webView:didHandleOnloadEventsForFrame:), m_webFrame.get()); } void WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad() { WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didReceiveServerRedirectForProvisionalLoadForFrameFunc) CallFrameLoadDelegate(implementations->didReceiveServerRedirectForProvisionalLoadForFrameFunc, webView, @selector(webView:didReceiveServerRedirectForProvisionalLoadForFrame:), m_webFrame.get()); } void WebFrameLoaderClient::dispatchDidCancelClientRedirect() { WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didCancelClientRedirectForFrameFunc) CallFrameLoadDelegate(implementations->didCancelClientRedirectForFrameFunc, webView, @selector(webView:didCancelClientRedirectForFrame:), m_webFrame.get()); } void WebFrameLoaderClient::dispatchWillPerformClientRedirect(const KURL& url, double delay, double fireDate) { WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->willPerformClientRedirectToURLDelayFireDateForFrameFunc) { NSURL *cocoaURL = url; CallFrameLoadDelegate(implementations->willPerformClientRedirectToURLDelayFireDateForFrameFunc, webView, @selector(webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:), cocoaURL, delay, [NSDate dateWithTimeIntervalSince1970:fireDate], m_webFrame.get()); } } void WebFrameLoaderClient::dispatchDidChangeLocationWithinPage() { WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didChangeLocationWithinPageForFrameFunc) CallFrameLoadDelegate(implementations->didChangeLocationWithinPageForFrameFunc, webView, @selector(webView:didChangeLocationWithinPageForFrame:), m_webFrame.get()); } void WebFrameLoaderClient::dispatchWillClose() { WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->willCloseFrameFunc) CallFrameLoadDelegate(implementations->willCloseFrameFunc, webView, @selector(webView:willCloseFrame:), m_webFrame.get()); } void WebFrameLoaderClient::dispatchDidReceiveIcon() { #if ENABLE(ICONDATABASE) WebView *webView = getWebView(m_webFrame.get()); ASSERT(m_webFrame == [webView mainFrame]); [webView _dispatchDidReceiveIconFromWebFrame:m_webFrame.get()]; #endif } void WebFrameLoaderClient::dispatchDidStartProvisionalLoad() { WebView *webView = getWebView(m_webFrame.get()); [webView _didStartProvisionalLoadForFrame:m_webFrame.get()]; WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didStartProvisionalLoadForFrameFunc) CallFrameLoadDelegate(implementations->didStartProvisionalLoadForFrameFunc, webView, @selector(webView:didStartProvisionalLoadForFrame:), m_webFrame.get()); } void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title) { WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didReceiveTitleForFrameFunc) CallFrameLoadDelegate(implementations->didReceiveTitleForFrameFunc, webView, @selector(webView:didReceiveTitle:forFrame:), (NSString *)title, m_webFrame.get()); } void WebFrameLoaderClient::dispatchDidCommitLoad() { // Tell the client we've committed this URL. ASSERT([m_webFrame->_private->webFrameView documentView] != nil || ![getWebView(m_webFrame.get()) _usesDocumentViews]); WebView *webView = getWebView(m_webFrame.get()); [webView _didCommitLoadForFrame:m_webFrame.get()]; WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didCommitLoadForFrameFunc) CallFrameLoadDelegate(implementations->didCommitLoadForFrameFunc, webView, @selector(webView:didCommitLoadForFrame:), m_webFrame.get()); } void WebFrameLoaderClient::dispatchDidFailProvisionalLoad(const ResourceError& error) { WebView *webView = getWebView(m_webFrame.get()); [webView _didFailProvisionalLoadWithError:error forFrame:m_webFrame.get()]; WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didFailProvisionalLoadWithErrorForFrameFunc) CallFrameLoadDelegate(implementations->didFailProvisionalLoadWithErrorForFrameFunc, webView, @selector(webView:didFailProvisionalLoadWithError:forFrame:), (NSError *)error, m_webFrame.get()); [m_webFrame->_private->internalLoadDelegate webFrame:m_webFrame.get() didFinishLoadWithError:error]; } void WebFrameLoaderClient::dispatchDidFailLoad(const ResourceError& error) { WebView *webView = getWebView(m_webFrame.get()); [webView _didFailLoadWithError:error forFrame:m_webFrame.get()]; WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didFailLoadWithErrorForFrameFunc) CallFrameLoadDelegate(implementations->didFailLoadWithErrorForFrameFunc, webView, @selector(webView:didFailLoadWithError:forFrame:), (NSError *)error, m_webFrame.get()); [m_webFrame->_private->internalLoadDelegate webFrame:m_webFrame.get() didFinishLoadWithError:error]; } void WebFrameLoaderClient::dispatchDidFinishDocumentLoad() { WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didFinishDocumentLoadForFrameFunc) CallFrameLoadDelegate(implementations->didFinishDocumentLoadForFrameFunc, webView, @selector(webView:didFinishDocumentLoadForFrame:), m_webFrame.get()); } void WebFrameLoaderClient::dispatchDidFinishLoad() { WebView *webView = getWebView(m_webFrame.get()); [webView _didFinishLoadForFrame:m_webFrame.get()]; WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didFinishLoadForFrameFunc) CallFrameLoadDelegate(implementations->didFinishLoadForFrameFunc, webView, @selector(webView:didFinishLoadForFrame:), m_webFrame.get()); [m_webFrame->_private->internalLoadDelegate webFrame:m_webFrame.get() didFinishLoadWithError:nil]; } void WebFrameLoaderClient::dispatchDidFirstLayout() { WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didFirstLayoutInFrameFunc) CallFrameLoadDelegate(implementations->didFirstLayoutInFrameFunc, webView, @selector(webView:didFirstLayoutInFrame:), m_webFrame.get()); } void WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout() { WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didFirstVisuallyNonEmptyLayoutInFrameFunc) CallFrameLoadDelegate(implementations->didFirstVisuallyNonEmptyLayoutInFrameFunc, webView, @selector(webView:didFirstVisuallyNonEmptyLayoutInFrame:), m_webFrame.get()); } Frame* WebFrameLoaderClient::dispatchCreatePage() { WebView *currentWebView = getWebView(m_webFrame.get()); NSDictionary *features = [[NSDictionary alloc] init]; WebView *newWebView = [[currentWebView _UIDelegateForwarder] webView:currentWebView createWebViewWithRequest:nil windowFeatures:features]; [features release]; #if USE(PLUGIN_HOST_PROCESS) if (newWebView) WebKit::NetscapePluginHostManager::shared().didCreateWindow(); #endif return core([newWebView mainFrame]); } void WebFrameLoaderClient::dispatchShow() { WebView *webView = getWebView(m_webFrame.get()); [[webView _UIDelegateForwarder] webViewShow:webView]; } void WebFrameLoaderClient::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const String& MIMEType, const ResourceRequest& request) { WebView *webView = getWebView(m_webFrame.get()); [[webView _policyDelegateForwarder] webView:webView decidePolicyForMIMEType:MIMEType request:request.nsURLRequest() frame:m_webFrame.get() decisionListener:setUpPolicyListener(function).get()]; } void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName) { WebView *webView = getWebView(m_webFrame.get()); [[webView _policyDelegateForwarder] webView:webView decidePolicyForNewWindowAction:actionDictionary(action, formState) request:request.nsURLRequest() newFrameName:frameName decisionListener:setUpPolicyListener(function).get()]; } void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState> formState) { WebView *webView = getWebView(m_webFrame.get()); [[webView _policyDelegateForwarder] webView:webView decidePolicyForNavigationAction:actionDictionary(action, formState) request:request.nsURLRequest() frame:m_webFrame.get() decisionListener:setUpPolicyListener(function).get()]; } void WebFrameLoaderClient::cancelPolicyCheck() { [m_policyListener.get() invalidate]; m_policyListener = nil; m_policyFunction = 0; } void WebFrameLoaderClient::dispatchUnableToImplementPolicy(const ResourceError& error) { WebView *webView = getWebView(m_webFrame.get()); [[webView _policyDelegateForwarder] webView:webView unableToImplementPolicyWithError:error frame:m_webFrame.get()]; } void WebFrameLoaderClient::dispatchWillSubmitForm(FramePolicyFunction function, PassRefPtr<FormState> formState) { id <WebFormDelegate> formDelegate = [getWebView(m_webFrame.get()) _formDelegate]; if (!formDelegate) { (core(m_webFrame.get())->loader()->*function)(PolicyUse); return; } const StringPairVector& textFieldValues = formState->textFieldValues(); size_t size = textFieldValues.size(); NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithCapacity:size]; for (size_t i = 0; i < size; ++i) [dictionary setObject:textFieldValues[i].second forKey:textFieldValues[i].first]; CallFormDelegate(getWebView(m_webFrame.get()), @selector(frame:sourceFrame:willSubmitForm:withValues:submissionListener:), m_webFrame.get(), kit(formState->sourceFrame()), kit(formState->form()), dictionary, setUpPolicyListener(function).get()); [dictionary release]; } void WebFrameLoaderClient::dispatchDidLoadMainResource(DocumentLoader* loader) { } void WebFrameLoaderClient::revertToProvisionalState(DocumentLoader* loader) { [dataSource(loader) _revertToProvisionalState]; } void WebFrameLoaderClient::setMainDocumentError(DocumentLoader* loader, const ResourceError& error) { [dataSource(loader) _setMainDocumentError:error]; } void WebFrameLoaderClient::willChangeEstimatedProgress() { [getWebView(m_webFrame.get()) _willChangeValueForKey:_WebEstimatedProgressKey]; } void WebFrameLoaderClient::didChangeEstimatedProgress() { [getWebView(m_webFrame.get()) _didChangeValueForKey:_WebEstimatedProgressKey]; } void WebFrameLoaderClient::postProgressStartedNotification() { [[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressStartedNotification object:getWebView(m_webFrame.get())]; } void WebFrameLoaderClient::postProgressEstimateChangedNotification() { [[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressEstimateChangedNotification object:getWebView(m_webFrame.get())]; } void WebFrameLoaderClient::postProgressFinishedNotification() { [[NSNotificationCenter defaultCenter] postNotificationName:WebViewProgressFinishedNotification object:getWebView(m_webFrame.get())]; } void WebFrameLoaderClient::setMainFrameDocumentReady(bool ready) { [getWebView(m_webFrame.get()) setMainFrameDocumentReady:ready]; } void WebFrameLoaderClient::startDownload(const ResourceRequest& request) { // FIXME: Should download full request. WebDownload *download = [getWebView(m_webFrame.get()) _downloadURL:request.url()]; setOriginalURLForDownload(download, request); } void WebFrameLoaderClient::willChangeTitle(DocumentLoader* loader) { // FIXME: Should do this only in main frame case, right? [getWebView(m_webFrame.get()) _willChangeValueForKey:_WebMainFrameTitleKey]; } void WebFrameLoaderClient::didChangeTitle(DocumentLoader* loader) { // FIXME: Should do this only in main frame case, right? [getWebView(m_webFrame.get()) _didChangeValueForKey:_WebMainFrameTitleKey]; } void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* data, int length) { NSData *nsData = [[NSData alloc] initWithBytesNoCopy:(void*)data length:length freeWhenDone:NO]; [dataSource(loader) _receivedData:nsData]; [nsData release]; } void WebFrameLoaderClient::finishedLoading(DocumentLoader* loader) { [dataSource(loader) _finishedLoading]; } void WebFrameLoaderClient::updateGlobalHistory() { WebView* view = getWebView(m_webFrame.get()); DocumentLoader* loader = core(m_webFrame.get())->loader()->documentLoader(); if ([view historyDelegate]) { WebHistoryDelegateImplementationCache* implementations = WebViewGetHistoryDelegateImplementations(view); if (implementations->navigatedFunc) { WebNavigationData *data = [[WebNavigationData alloc] initWithURLString:loader->urlForHistory() title:loader->title() originalRequest:loader->originalRequestCopy().nsURLRequest() response:loader->response().nsURLResponse() hasSubstituteData:loader->substituteData().isValid() clientRedirectSource:loader->clientRedirectSourceForHistory()]; CallHistoryDelegate(implementations->navigatedFunc, view, @selector(webView:didNavigateWithNavigationData:inFrame:), data, m_webFrame.get()); [data release]; } return; } [[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory() withTitle:loader->title() method:loader->originalRequestCopy().httpMethod() wasFailure:loader->urlForHistoryReflectsFailure() increaseVisitCount:!loader->clientRedirectSourceForHistory()]; // Do not increase visit count due to navigations that were not initiated by the user directly, avoiding growth from programmatic reloads. } void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks() { WebView* view = getWebView(m_webFrame.get()); WebHistoryDelegateImplementationCache* implementations = [view historyDelegate] ? WebViewGetHistoryDelegateImplementations(view) : 0; DocumentLoader* loader = core(m_webFrame.get())->loader()->documentLoader(); ASSERT(loader->unreachableURL().isEmpty()); if (!loader->clientRedirectSourceForHistory().isNull()) { if (implementations) { if (implementations->clientRedirectFunc) { CallHistoryDelegate(implementations->clientRedirectFunc, view, @selector(webView:didPerformClientRedirectFromURL:toURL:inFrame:), loader->clientRedirectSourceForHistory(), loader->clientRedirectDestinationForHistory(), m_webFrame.get()); } } else if (WebHistoryItem *item = [[WebHistory optionalSharedHistory] _itemForURLString:loader->clientRedirectSourceForHistory()]) core(item)->addRedirectURL(loader->clientRedirectDestinationForHistory()); } if (!loader->serverRedirectSourceForHistory().isNull()) { if (implementations) { if (implementations->serverRedirectFunc) { CallHistoryDelegate(implementations->serverRedirectFunc, view, @selector(webView:didPerformServerRedirectFromURL:toURL:inFrame:), loader->serverRedirectSourceForHistory(), loader->serverRedirectDestinationForHistory(), m_webFrame.get()); } } else if (WebHistoryItem *item = [[WebHistory optionalSharedHistory] _itemForURLString:loader->serverRedirectSourceForHistory()]) core(item)->addRedirectURL(loader->serverRedirectDestinationForHistory()); } } bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const { WebView* view = getWebView(m_webFrame.get()); WebHistoryItem *webItem = kit(item); return [[view _policyDelegateForwarder] webView:view shouldGoToHistoryItem:webItem]; } void WebFrameLoaderClient::didDisplayInsecureContent() { WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didDisplayInsecureContentFunc) CallFrameLoadDelegate(implementations->didDisplayInsecureContentFunc, webView, @selector(webViewDidDisplayInsecureContent:)); } void WebFrameLoaderClient::didRunInsecureContent(SecurityOrigin* origin) { RetainPtr<WebSecurityOrigin> webSecurityOrigin(AdoptNS, [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]); WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didRunInsecureContentFunc) CallFrameLoadDelegate(implementations->didRunInsecureContentFunc, webView, @selector(webView:didRunInsecureContent:), webSecurityOrigin.get()); } ResourceError WebFrameLoaderClient::cancelledError(const ResourceRequest& request) { return [NSError _webKitErrorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled URL:request.url()]; } ResourceError WebFrameLoaderClient::blockedError(const ResourceRequest& request) { return [NSError _webKitErrorWithDomain:WebKitErrorDomain code:WebKitErrorCannotUseRestrictedPort URL:request.url()]; } ResourceError WebFrameLoaderClient::cannotShowURLError(const ResourceRequest& request) { return [NSError _webKitErrorWithDomain:WebKitErrorDomain code:WebKitErrorCannotShowURL URL:request.url()]; } ResourceError WebFrameLoaderClient::interruptForPolicyChangeError(const ResourceRequest& request) { return [NSError _webKitErrorWithDomain:WebKitErrorDomain code:WebKitErrorFrameLoadInterruptedByPolicyChange URL:request.url()]; } ResourceError WebFrameLoaderClient::cannotShowMIMETypeError(const ResourceResponse& response) { return [NSError _webKitErrorWithDomain:NSURLErrorDomain code:WebKitErrorCannotShowMIMEType URL:response.url()]; } ResourceError WebFrameLoaderClient::fileDoesNotExistError(const ResourceResponse& response) { return [NSError _webKitErrorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist URL:response.url()]; } ResourceError WebFrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse& response) { NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInWillHandleLoad contentURL:response.url() pluginPageURL:nil pluginName:nil MIMEType:response.mimeType()]; return [error autorelease]; } bool WebFrameLoaderClient::shouldFallBack(const ResourceError& error) { // FIXME: Needs to check domain. // FIXME: WebKitErrorPlugInWillHandleLoad is a workaround for the cancel we do to prevent // loading plugin content twice. See <rdar://problem/4258008> return error.errorCode() != NSURLErrorCancelled && error.errorCode() != WebKitErrorPlugInWillHandleLoad; } bool WebFrameLoaderClient::canHandleRequest(const ResourceRequest& request) const { Frame* frame = core(m_webFrame.get()); Page* page = frame->page(); BOOL forMainFrame = page && page->mainFrame() == frame; return [WebView _canHandleRequest:request.nsURLRequest() forMainFrame:forMainFrame]; } bool WebFrameLoaderClient::canShowMIMEType(const String& MIMEType) const { return [WebView canShowMIMEType:MIMEType]; } bool WebFrameLoaderClient::representationExistsForURLScheme(const String& URLScheme) const { return [WebView _representationExistsForURLScheme:URLScheme]; } String WebFrameLoaderClient::generatedMIMETypeForURLScheme(const String& URLScheme) const { return [WebView _generatedMIMETypeForURLScheme:URLScheme]; } void WebFrameLoaderClient::frameLoadCompleted() { // Note: Can be called multiple times. // See WebFrameLoaderClient::provisionalLoadStarted. if ([getWebView(m_webFrame.get()) drawsBackground]) [[m_webFrame->_private->webFrameView _scrollView] setDrawsBackground:YES]; } void WebFrameLoaderClient::saveViewStateToItem(HistoryItem* item) { if (!item) return; NSView <WebDocumentView> *docView = [m_webFrame->_private->webFrameView documentView]; // we might already be detached when this is called from detachFromParent, in which // case we don't want to override real data earlier gathered with (0,0) if ([docView superview] && [docView conformsToProtocol:@protocol(_WebDocumentViewState)]) item->setViewState([(id <_WebDocumentViewState>)docView viewState]); } void WebFrameLoaderClient::restoreViewState() { HistoryItem* currentItem = core(m_webFrame.get())->loader()->currentHistoryItem(); ASSERT(currentItem); // FIXME: As the ASSERT attests, it seems we should always have a currentItem here. // One counterexample is <rdar://problem/4917290> // For now, to cover this issue in release builds, there is no technical harm to returning // early and from a user standpoint - as in the above radar - the previous page load failed // so there *is* no scroll state to restore! if (!currentItem) return; NSView <WebDocumentView> *docView = [m_webFrame->_private->webFrameView documentView]; if ([docView conformsToProtocol:@protocol(_WebDocumentViewState)]) { id state = currentItem->viewState(); if (state) { [(id <_WebDocumentViewState>)docView setViewState:state]; } } } void WebFrameLoaderClient::provisionalLoadStarted() { // Tell the scroll view not to draw a background so we can leave the contents of // the old page showing during the beginning of the loading process. // This will stay set to NO until: // 1) The load gets far enough along: WebFrameLoader::frameLoadCompleted. // 2) The window is resized: -[WebFrameView setFrameSize:]. // or 3) The view is moved out of the window: -[WebFrameView viewDidMoveToWindow]. // Please keep the comments in these four functions in agreement with each other. [[m_webFrame->_private->webFrameView _scrollView] setDrawsBackground:NO]; } void WebFrameLoaderClient::didFinishLoad() { [m_webFrame->_private->internalLoadDelegate webFrame:m_webFrame.get() didFinishLoadWithError:nil]; } void WebFrameLoaderClient::prepareForDataSourceReplacement() { if (![m_webFrame.get() _dataSource]) { ASSERT(!core(m_webFrame.get())->tree()->childCount()); return; } // Make sure that any work that is triggered by resigning first reponder can get done. // The main example where this came up is the textDidEndEditing that is sent to the // FormsDelegate (3223413). We need to do this before _detachChildren, since that will // remove the views as a side-effect of freeing the frame, at which point we can't // post the FormDelegate messages. // // Note that this can also take FirstResponder away from a child of our frameView that // is not in a child frame's view. This is OK because we are in the process // of loading new content, which will blow away all editors in this top frame, and if // a non-editor is firstReponder it will not be affected by endEditingFor:. // Potentially one day someone could write a DocView whose editors were not all // replaced by loading new content, but that does not apply currently. NSView *frameView = m_webFrame->_private->webFrameView; NSWindow *window = [frameView window]; NSResponder *firstResp = [window firstResponder]; if ([firstResp isKindOfClass:[NSView class]] && [(NSView *)firstResp isDescendantOf:frameView]) [window endEditingFor:firstResp]; } PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData) { RefPtr<WebDocumentLoaderMac> loader = WebDocumentLoaderMac::create(request, substituteData); WebDataSource *dataSource = [[WebDataSource alloc] _initWithDocumentLoader:loader.get()]; loader->setDataSource(dataSource, getWebView(m_webFrame.get())); [dataSource release]; return loader.release(); } // FIXME: <rdar://problem/4880065> - Push Global History into WebCore // Once that task is complete, this will go away void WebFrameLoaderClient::setTitle(const String& title, const KURL& URL) { NSURL* nsURL = URL; nsURL = [nsURL _webkit_canonicalize]; if(!nsURL) return; NSString *titleNSString = title; [[[WebHistory optionalSharedHistory] itemForURL:nsURL] setTitle:titleNSString]; } void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame* cachedFrame) { WebCachedFramePlatformData* webPlatformData = new WebCachedFramePlatformData([m_webFrame->_private->webFrameView documentView]); cachedFrame->setCachedFramePlatformData(webPlatformData); } void WebFrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame* cachedFrame) { WebCachedFramePlatformData* platformData = reinterpret_cast<WebCachedFramePlatformData*>(cachedFrame->cachedFramePlatformData()); NSView <WebDocumentView> *cachedView = platformData->webDocumentView(); ASSERT(cachedView != nil); ASSERT(cachedFrame->documentLoader()); [cachedView setDataSource:dataSource(cachedFrame->documentLoader())]; // clean up webkit plugin instances before WebHTMLView gets freed. WebView *webView = getWebView(m_webFrame.get()); [webView removePluginInstanceViewsFor:(m_webFrame.get())]; [m_webFrame->_private->webFrameView _setDocumentView:cachedView]; } void WebFrameLoaderClient::transitionToCommittedForNewPage() { WebView *webView = getWebView(m_webFrame.get()); WebDataSource *dataSource = [m_webFrame.get() _dataSource]; bool usesDocumentViews = [webView _usesDocumentViews]; if (usesDocumentViews) { // FIXME (Viewless): I assume we want the equivalent of this optimization for viewless mode too. bool willProduceHTMLView = [[WebFrameView class] _viewClassForMIMEType:[dataSource _responseMIMEType]] == [WebHTMLView class]; bool canSkipCreation = core(m_webFrame.get())->loader()->committingFirstRealLoad() && willProduceHTMLView; if (canSkipCreation) { [[m_webFrame->_private->webFrameView documentView] setDataSource:dataSource]; return; } // Don't suppress scrollbars before the view creation if we're making the view for a non-HTML view. if (!willProduceHTMLView) [[m_webFrame->_private->webFrameView _scrollView] setScrollBarsSuppressed:NO repaintOnUnsuppress:NO]; } // clean up webkit plugin instances before WebHTMLView gets freed. [webView removePluginInstanceViewsFor:(m_webFrame.get())]; NSView <WebDocumentView> *documentView = nil; if (usesDocumentViews) { documentView = [m_webFrame->_private->webFrameView _makeDocumentViewForDataSource:dataSource]; if (!documentView) return; } // FIXME: Could we skip some of this work for a top-level view that is not a WebHTMLView? // If we own the view, delete the old one - otherwise the render m_frame will take care of deleting the view. Frame* coreFrame = core(m_webFrame.get()); Page* page = coreFrame->page(); bool isMainFrame = coreFrame == page->mainFrame(); if (isMainFrame && coreFrame->view()) coreFrame->view()->setParentVisible(false); coreFrame->setView(0); RefPtr<FrameView> coreView; if (usesDocumentViews) coreView = FrameView::create(coreFrame); else coreView = FrameView::create(coreFrame, IntSize([webView bounds].size)); coreFrame->setView(coreView); [m_webFrame.get() _updateBackgroundAndUpdatesWhileOffscreen]; if (usesDocumentViews) [m_webFrame->_private->webFrameView _install]; if (isMainFrame) coreView->setParentVisible(true); if (usesDocumentViews) { // Call setDataSource on the document view after it has been placed in the view hierarchy. // This what we for the top-level view, so should do this for views in subframes as well. [documentView setDataSource:dataSource]; // The following is a no-op for WebHTMLRepresentation, but for custom document types // like the ones that Safari uses for bookmarks it is the only way the DocumentLoader // will get the proper title. if (DocumentLoader* documentLoader = [dataSource _documentLoader]) documentLoader->setTitle([dataSource pageTitle]); } if (HTMLFrameOwnerElement* owner = coreFrame->ownerElement()) coreFrame->view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff); // If the document view implicitly became first responder, make sure to set the focused frame properly. if (usesDocumentViews && [[documentView window] firstResponder] == documentView) { page->focusController()->setFocusedFrame(coreFrame); page->focusController()->setFocused(true); } } RetainPtr<WebFramePolicyListener> WebFrameLoaderClient::setUpPolicyListener(FramePolicyFunction function) { // FIXME: <rdar://5634381> We need to support multiple active policy listeners. [m_policyListener.get() invalidate]; WebFramePolicyListener *listener = [[WebFramePolicyListener alloc] initWithWebCoreFrame:core(m_webFrame.get())]; m_policyListener = listener; [listener release]; m_policyFunction = function; return listener; } void WebFrameLoaderClient::receivedPolicyDecison(PolicyAction action) { ASSERT(m_policyListener); ASSERT(m_policyFunction); FramePolicyFunction function = m_policyFunction; m_policyListener = nil; m_policyFunction = 0; (core(m_webFrame.get())->loader()->*function)(action); } String WebFrameLoaderClient::userAgent(const KURL& url) { WebView *webView = getWebView(m_webFrame.get()); ASSERT(webView); // We should never get here with nil for the WebView unless there is a bug somewhere else. // But if we do, it's better to return the empty string than just crashing on the spot. // Most other call sites are tolerant of nil because of Objective-C behavior, but this one // is not because the return value of _userAgentForURL is a const KURL&. if (!webView) return String(""); return [webView _userAgentForURL:url]; } static const MouseEvent* findMouseEvent(const Event* event) { for (const Event* e = event; e; e = e->underlyingEvent()) if (e->isMouseEvent()) return static_cast<const MouseEvent*>(e); return 0; } NSDictionary *WebFrameLoaderClient::actionDictionary(const NavigationAction& action, PassRefPtr<FormState> formState) const { unsigned modifierFlags = 0; const Event* event = action.event(); if (const UIEventWithKeyState* keyStateEvent = findEventWithKeyState(const_cast<Event*>(event))) { if (keyStateEvent->ctrlKey()) modifierFlags |= NSControlKeyMask; if (keyStateEvent->altKey()) modifierFlags |= NSAlternateKeyMask; if (keyStateEvent->shiftKey()) modifierFlags |= NSShiftKeyMask; if (keyStateEvent->metaKey()) modifierFlags |= NSCommandKeyMask; } NSURL *originalURL = action.url(); NSMutableDictionary *result = [NSMutableDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:action.type()], WebActionNavigationTypeKey, [NSNumber numberWithInt:modifierFlags], WebActionModifierFlagsKey, originalURL, WebActionOriginalURLKey, nil]; if (const MouseEvent* mouseEvent = findMouseEvent(event)) { WebElementDictionary *element = [[WebElementDictionary alloc] initWithHitTestResult:core(m_webFrame.get())->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation(), false)]; [result setObject:element forKey:WebActionElementKey]; [element release]; [result setObject:[NSNumber numberWithInt:mouseEvent->button()] forKey:WebActionButtonKey]; } if (formState) { ASSERT(formState->form()); [result setObject:kit(formState->form()) forKey:WebActionFormKey]; } return result; } bool WebFrameLoaderClient::canCachePage() const { // We can only cache HTML pages right now return [[[m_webFrame.get() _dataSource] representation] isKindOfClass:[WebHTMLRepresentation class]]; } PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) { BEGIN_BLOCK_OBJC_EXCEPTIONS; ASSERT(m_webFrame); WebFrameView *childView = [getWebView(m_webFrame.get()) _usesDocumentViews] ? [[WebFrameView alloc] init] : nil; RefPtr<Frame> result = [WebFrame _createSubframeWithOwnerElement:ownerElement frameName:name frameView:childView]; [childView release]; WebFrame *newFrame = kit(result.get()); if ([newFrame _dataSource]) [[newFrame _dataSource] _documentLoader]->setOverrideEncoding([[m_webFrame.get() _dataSource] _documentLoader]->overrideEncoding()); // The creation of the frame may have run arbitrary JavaScript that removed it from the page already. if (!result->page()) return 0; core(m_webFrame.get())->loader()->loadURLIntoChildFrame(url, referrer, result.get()); // The frame's onload handler may have removed it from the document. if (!result->tree()->parent()) return 0; return result.release(); END_BLOCK_OBJC_EXCEPTIONS; return 0; } ObjectContentType WebFrameLoaderClient::objectContentType(const KURL& url, const String& mimeType) { BEGIN_BLOCK_OBJC_EXCEPTIONS; // This is a quirk that ensures Tiger Mail's WebKit plug-in will load during layout // and not attach time. (5520541) static BOOL isTigerMail = WKAppVersionCheckLessThan(@"com.apple.mail", -1, 3.0); if (isTigerMail && mimeType == "application/x-apple-msg-attachment") return ObjectContentNetscapePlugin; String type = mimeType; if (type.isEmpty()) { // Try to guess the MIME type based off the extension. NSURL *URL = url; NSString *extension = [[URL path] pathExtension]; if ([extension length] > 0) { type = WKGetMIMETypeForExtension(extension); if (type.isEmpty()) { // If no MIME type is specified, use a plug-in if we have one that can handle the extension. if (WebBasePluginPackage *package = [getWebView(m_webFrame.get()) _pluginForExtension:extension]) { if ([package isKindOfClass:[WebPluginPackage class]]) return ObjectContentOtherPlugin; #if ENABLE(NETSCAPE_PLUGIN_API) else { ASSERT([package isKindOfClass:[WebNetscapePluginPackage class]]); return ObjectContentNetscapePlugin; } #endif } } } } if (type.isEmpty()) return ObjectContentFrame; // Go ahead and hope that we can display the content. if (MIMETypeRegistry::isSupportedImageMIMEType(type)) return ObjectContentImage; WebBasePluginPackage *package = [getWebView(m_webFrame.get()) _pluginForMIMEType:type]; if (package) { #if ENABLE(NETSCAPE_PLUGIN_API) if ([package isKindOfClass:[WebNetscapePluginPackage class]]) return ObjectContentNetscapePlugin; #endif ASSERT([package isKindOfClass:[WebPluginPackage class]]); return ObjectContentOtherPlugin; } if ([WebFrameView _viewClassForMIMEType:type]) return ObjectContentFrame; return ObjectContentNone; END_BLOCK_OBJC_EXCEPTIONS; return ObjectContentNone; } static NSMutableArray* kit(const Vector<String>& vector) { unsigned len = vector.size(); NSMutableArray* array = [NSMutableArray arrayWithCapacity:len]; for (unsigned x = 0; x < len; x++) [array addObject:vector[x]]; return array; } static String parameterValue(const Vector<String>& paramNames, const Vector<String>& paramValues, const String& name) { size_t size = paramNames.size(); ASSERT(size == paramValues.size()); for (size_t i = 0; i < size; ++i) { if (equalIgnoringCase(paramNames[i], name)) return paramValues[i]; } return String(); } static NSView *pluginView(WebFrame *frame, WebPluginPackage *pluginPackage, NSArray *attributeNames, NSArray *attributeValues, NSURL *baseURL, DOMElement *element, BOOL loadManually) { WebHTMLView *docView = (WebHTMLView *)[[frame frameView] documentView]; ASSERT([docView isKindOfClass:[WebHTMLView class]]); WebPluginController *pluginController = [docView _pluginController]; // Store attributes in a dictionary so they can be passed to WebPlugins. NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithObjects:attributeValues forKeys:attributeNames]; [pluginPackage load]; Class viewFactory = [pluginPackage viewFactory]; NSView *view = nil; NSDictionary *arguments = nil; if ([viewFactory respondsToSelector:@selector(plugInViewWithArguments:)]) { arguments = [NSDictionary dictionaryWithObjectsAndKeys: baseURL, WebPlugInBaseURLKey, attributes, WebPlugInAttributesKey, pluginController, WebPlugInContainerKey, [NSNumber numberWithInt:loadManually ? WebPlugInModeFull : WebPlugInModeEmbed], WebPlugInModeKey, [NSNumber numberWithBool:!loadManually], WebPlugInShouldLoadMainResourceKey, element, WebPlugInContainingElementKey, nil]; LOG(Plugins, "arguments:\n%@", arguments); } else if ([viewFactory respondsToSelector:@selector(pluginViewWithArguments:)]) { arguments = [NSDictionary dictionaryWithObjectsAndKeys: baseURL, WebPluginBaseURLKey, attributes, WebPluginAttributesKey, pluginController, WebPluginContainerKey, element, WebPlugInContainingElementKey, nil]; LOG(Plugins, "arguments:\n%@", arguments); } view = [WebPluginController plugInViewWithArguments:arguments fromPluginPackage:pluginPackage]; [attributes release]; return view; } class PluginWidget : public Widget { public: PluginWidget(NSView *view = 0) : Widget(view) { } virtual void invalidateRect(const IntRect& rect) { [platformWidget() setNeedsDisplayInRect:rect]; } }; #if ENABLE(NETSCAPE_PLUGIN_API) class NetscapePluginWidget : public PluginWidget { public: NetscapePluginWidget(WebBaseNetscapePluginView *view) : PluginWidget(view) { } virtual void handleEvent(Event*) { Frame* frame = Frame::frameForWidget(this); if (!frame) return; NSEvent* event = frame->eventHandler()->currentNSEvent(); if ([event type] == NSMouseMoved) [(WebBaseNetscapePluginView *)platformWidget() handleMouseMoved:event]; } }; #endif // ENABLE(NETSCAPE_PLUGIN_API) #if USE(PLUGIN_HOST_PROCESS) #define NETSCAPE_PLUGIN_VIEW WebHostedNetscapePluginView #else #define NETSCAPE_PLUGIN_VIEW WebNetscapePluginView #endif PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually) { BEGIN_BLOCK_OBJC_EXCEPTIONS; ASSERT(paramNames.size() == paramValues.size()); int errorCode = 0; WebView *webView = getWebView(m_webFrame.get()); SEL selector = @selector(webView:plugInViewWithArguments:); NSURL *URL = url; if ([[webView UIDelegate] respondsToSelector:selector]) { NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithObjects:kit(paramValues) forKeys:kit(paramNames)]; NSDictionary *arguments = [[NSDictionary alloc] initWithObjectsAndKeys: attributes, WebPlugInAttributesKey, [NSNumber numberWithInt:loadManually ? WebPlugInModeFull : WebPlugInModeEmbed], WebPlugInModeKey, [NSNumber numberWithBool:!loadManually], WebPlugInShouldLoadMainResourceKey, kit(element), WebPlugInContainingElementKey, URL, WebPlugInBaseURLKey, // URL might be nil, so add it last nil]; NSView *view = CallUIDelegate(webView, selector, arguments); [attributes release]; [arguments release]; if (view) return adoptRef(new PluginWidget(view)); } NSString *MIMEType; WebBasePluginPackage *pluginPackage; if (mimeType.isEmpty()) { MIMEType = nil; pluginPackage = nil; } else { MIMEType = mimeType; pluginPackage = [webView _pluginForMIMEType:mimeType]; } NSString *extension = [[URL path] pathExtension]; #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) // don't allow proxy plug-in selection by file extension if (element->hasTagName(videoTag) || element->hasTagName(audioTag)) extension = @""; #endif if (!pluginPackage && [extension length] != 0) { pluginPackage = [webView _pluginForExtension:extension]; if (pluginPackage) { NSString *newMIMEType = [pluginPackage MIMETypeForExtension:extension]; if ([newMIMEType length] != 0) MIMEType = newMIMEType; } } NSView *view = nil; Document* document = core(m_webFrame.get())->document(); NSURL *baseURL = document->baseURL(); if (pluginPackage) { if ([pluginPackage isKindOfClass:[WebPluginPackage class]]) view = pluginView(m_webFrame.get(), (WebPluginPackage *)pluginPackage, kit(paramNames), kit(paramValues), baseURL, kit(element), loadManually); #if ENABLE(NETSCAPE_PLUGIN_API) else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) { WebBaseNetscapePluginView *pluginView = [[[NETSCAPE_PLUGIN_VIEW alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height()) pluginPackage:(WebNetscapePluginPackage *)pluginPackage URL:URL baseURL:baseURL MIMEType:MIMEType attributeKeys:kit(paramNames) attributeValues:kit(paramValues) loadManually:loadManually element:element] autorelease]; return adoptRef(new NetscapePluginWidget(pluginView)); } #endif } else errorCode = WebKitErrorCannotFindPlugIn; if (!errorCode && !view) errorCode = WebKitErrorCannotLoadPlugIn; if (errorCode) { KURL pluginPageURL = document->completeURL(deprecatedParseURL(parameterValue(paramNames, paramValues, "pluginspage"))); if (!pluginPageURL.protocolInHTTPFamily()) pluginPageURL = KURL(); NSError *error = [[NSError alloc] _initWithPluginErrorCode:errorCode contentURL:URL pluginPageURL:pluginPageURL pluginName:[pluginPackage name] MIMEType:MIMEType]; WebNullPluginView *nullView = [[[WebNullPluginView alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height()) error:error DOMElement:kit(element)] autorelease]; view = nullView; [error release]; } ASSERT(view); return adoptRef(new PluginWidget(view)); END_BLOCK_OBJC_EXCEPTIONS; return 0; } void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget) { BEGIN_BLOCK_OBJC_EXCEPTIONS; WebHTMLRepresentation *representation = (WebHTMLRepresentation *)[[m_webFrame.get() _dataSource] representation]; NSView *pluginView = pluginWidget->platformWidget(); #if ENABLE(NETSCAPE_PLUGIN_API) if ([pluginView isKindOfClass:[NETSCAPE_PLUGIN_VIEW class]]) [representation _redirectDataToManualLoader:(NETSCAPE_PLUGIN_VIEW *)pluginView forPluginView:pluginView]; else { #else { #endif WebHTMLView *documentView = (WebHTMLView *)[[m_webFrame.get() frameView] documentView]; ASSERT([documentView isKindOfClass:[WebHTMLView class]]); [representation _redirectDataToManualLoader:[documentView _pluginController] forPluginView:pluginView]; } END_BLOCK_OBJC_EXCEPTIONS; } PassRefPtr<Widget> WebFrameLoaderClient::createJavaAppletWidget(const IntSize& size, HTMLAppletElement* element, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues) { #if ENABLE(MAC_JAVA_BRIDGE) BEGIN_BLOCK_OBJC_EXCEPTIONS; NSView *view = nil; NSString *MIMEType = @"application/x-java-applet"; WebView *webView = getWebView(m_webFrame.get()); WebBasePluginPackage *pluginPackage = [webView _pluginForMIMEType:MIMEType]; if (pluginPackage) { if ([pluginPackage isKindOfClass:[WebPluginPackage class]]) { // For some reason, the Java plug-in requires that we pass the dimension of the plug-in as attributes. NSMutableArray *names = kit(paramNames); NSMutableArray *values = kit(paramValues); if (parameterValue(paramNames, paramValues, "width").isNull()) { [names addObject:@"width"]; [values addObject:[NSString stringWithFormat:@"%d", size.width()]]; } if (parameterValue(paramNames, paramValues, "height").isNull()) { [names addObject:@"height"]; [values addObject:[NSString stringWithFormat:@"%d", size.height()]]; } view = pluginView(m_webFrame.get(), (WebPluginPackage *)pluginPackage, names, values, baseURL, kit(element), NO); } #if ENABLE(NETSCAPE_PLUGIN_API) else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) { view = [[[NETSCAPE_PLUGIN_VIEW alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height()) pluginPackage:(WebNetscapePluginPackage *)pluginPackage URL:nil baseURL:baseURL MIMEType:MIMEType attributeKeys:kit(paramNames) attributeValues:kit(paramValues) loadManually:NO element:element] autorelease]; } else { ASSERT_NOT_REACHED(); } #endif } if (!view) { NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorJavaUnavailable contentURL:nil pluginPageURL:nil pluginName:[pluginPackage name] MIMEType:MIMEType]; view = [[[WebNullPluginView alloc] initWithFrame:NSMakeRect(0, 0, size.width(), size.height()) error:error DOMElement:kit(element)] autorelease]; [error release]; } ASSERT(view); return adoptRef(new PluginWidget(view)); END_BLOCK_OBJC_EXCEPTIONS; return adoptRef(new PluginWidget); #else return 0; #endif // ENABLE(MAC_JAVA_BRIDGE) } String WebFrameLoaderClient::overrideMediaType() const { NSString* overrideType = [getWebView(m_webFrame.get()) mediaStyle]; if (overrideType) return overrideType; return String(); } void WebFrameLoaderClient::documentElementAvailable() { } void WebFrameLoaderClient::windowObjectCleared() { Frame *frame = core(m_webFrame.get()); ScriptController *script = frame->script(); WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didClearWindowObjectForFrameFunc) { CallFrameLoadDelegate(implementations->didClearWindowObjectForFrameFunc, webView, @selector(webView:didClearWindowObject:forFrame:), script->windowScriptObject(), m_webFrame.get()); } else if (implementations->windowScriptObjectAvailableFunc) { CallFrameLoadDelegate(implementations->windowScriptObjectAvailableFunc, webView, @selector(webView:windowScriptObjectAvailable:), script->windowScriptObject()); } if ([webView scriptDebugDelegate]) { [m_webFrame.get() _detachScriptDebugger]; [m_webFrame.get() _attachScriptDebugger]; } } void WebFrameLoaderClient::registerForIconNotification(bool listen) { #if ENABLE(ICONDATABASE) [[m_webFrame.get() webView] _registerForIconNotification:listen]; #endif } void WebFrameLoaderClient::didPerformFirstNavigation() const { WebPreferences *preferences = [[m_webFrame.get() webView] preferences]; if ([preferences automaticallyDetectsCacheModel] && [preferences cacheModel] < WebCacheModelDocumentBrowser) [preferences setCacheModel:WebCacheModelDocumentBrowser]; } #if ENABLE(MAC_JAVA_BRIDGE) jobject WebFrameLoaderClient::javaApplet(NSView* view) { if ([view respondsToSelector:@selector(webPlugInGetApplet)]) return [view webPlugInGetApplet]; // Compatibility with older versions of Java. // FIXME: Do we still need this? if ([view respondsToSelector:@selector(pollForAppletInWindow:)]) return [view pollForAppletInWindow:[[m_webFrame.get() frameView] window]]; return 0; } #endif bool WebFrameLoaderClient::shouldLoadMediaElementURL(const KURL& url) const { WebView *webView = getWebView(m_webFrame.get()); if (id policyDelegate = [webView policyDelegate]) { if ([policyDelegate respondsToSelector:@selector(webView:shouldLoadMediaURL:inFrame:)]) return [policyDelegate webView:webView shouldLoadMediaURL:url inFrame:m_webFrame.get()]; } return true; } @implementation WebFramePolicyListener + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif } - (id)initWithWebCoreFrame:(Frame*)frame { self = [self init]; if (!self) return nil; frame->ref(); m_frame = frame; return self; } - (void)invalidate { if (m_frame) { m_frame->deref(); m_frame = 0; } } - (void)dealloc { if (WebCoreObjCScheduleDeallocateOnMainThread([WebFramePolicyListener class], self)) return; if (m_frame) m_frame->deref(); [super dealloc]; } - (void)finalize { ASSERT_MAIN_THREAD(); if (m_frame) m_frame->deref(); [super finalize]; } - (void)receivedPolicyDecision:(PolicyAction)action { RefPtr<Frame> frame = adoptRef(m_frame); m_frame = 0; if (frame) static_cast<WebFrameLoaderClient*>(frame->loader()->client())->receivedPolicyDecison(action); } - (void)ignore { [self receivedPolicyDecision:PolicyIgnore]; } - (void)download { [self receivedPolicyDecision:PolicyDownload]; } - (void)use { [self receivedPolicyDecision:PolicyUse]; } - (void)continue { [self receivedPolicyDecision:PolicyUse]; } @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebEditorClient.mm��������������������������������������������������������0000644�0001750�0001750�00000076440�11212126444�017410� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebEditorClient.h" #import "DOMCSSStyleDeclarationInternal.h" #import "DOMHTMLElementInternal.h" #import "DOMHTMLInputElementInternal.h" #import "DOMHTMLTextAreaElementInternal.h" #import "DOMNodeInternal.h" #import "DOMRangeInternal.h" #import "WebArchive.h" #import "WebDataSourceInternal.h" #import "WebDelegateImplementationCaching.h" #import "WebDocument.h" #import "WebEditingDelegatePrivate.h" #import "WebFormDelegate.h" #import "WebFrameInternal.h" #import "WebHTMLView.h" #import "WebHTMLViewInternal.h" #import "WebKitLogging.h" #import "WebKitVersionChecks.h" #import "WebLocalizableStrings.h" #import "WebNSURLExtras.h" #import "WebViewInternal.h" #import <WebCore/Document.h> #import <WebCore/EditAction.h> #import <WebCore/EditCommand.h> #import <WebCore/HTMLInputElement.h> #import <WebCore/HTMLNames.h> #import <WebCore/HTMLTextAreaElement.h> #import <WebCore/KeyboardEvent.h> #import <WebCore/LegacyWebArchive.h> #import <WebCore/PlatformKeyboardEvent.h> #import <WebCore/PlatformString.h> #import <WebCore/WebCoreObjCExtras.h> #import <runtime/InitializeThreading.h> #import <wtf/PassRefPtr.h> using namespace WebCore; using namespace WTF; using namespace HTMLNames; static WebViewInsertAction kit(EditorInsertAction coreAction) { return static_cast<WebViewInsertAction>(coreAction); } #ifdef BUILDING_ON_TIGER @interface NSSpellChecker (NotYetPublicMethods) - (void)learnWord:(NSString *)word; @end #endif @interface WebEditCommand : NSObject { RefPtr<EditCommand> m_command; } + (WebEditCommand *)commandWithEditCommand:(PassRefPtr<EditCommand>)command; - (EditCommand *)command; @end @implementation WebEditCommand + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif } - (id)initWithEditCommand:(PassRefPtr<EditCommand>)command { ASSERT(command); [super init]; m_command = command; return self; } - (void)dealloc { if (WebCoreObjCScheduleDeallocateOnMainThread([WebEditCommand class], self)) return; [super dealloc]; } - (void)finalize { ASSERT_MAIN_THREAD(); [super finalize]; } + (WebEditCommand *)commandWithEditCommand:(PassRefPtr<EditCommand>)command { return [[[WebEditCommand alloc] initWithEditCommand:command] autorelease]; } - (EditCommand *)command { return m_command.get(); } @end @interface WebEditorUndoTarget : NSObject { } - (void)undoEditing:(id)arg; - (void)redoEditing:(id)arg; @end @implementation WebEditorUndoTarget - (void)undoEditing:(id)arg { ASSERT([arg isKindOfClass:[WebEditCommand class]]); [arg command]->unapply(); } - (void)redoEditing:(id)arg { ASSERT([arg isKindOfClass:[WebEditCommand class]]); [arg command]->reapply(); } @end void WebEditorClient::pageDestroyed() { delete this; } WebEditorClient::WebEditorClient(WebView *webView) : m_webView(webView) , m_undoTarget([[[WebEditorUndoTarget alloc] init] autorelease]) , m_haveUndoRedoOperations(false) { } bool WebEditorClient::isContinuousSpellCheckingEnabled() { return [m_webView isContinuousSpellCheckingEnabled]; } void WebEditorClient::toggleContinuousSpellChecking() { [m_webView toggleContinuousSpellChecking:nil]; } bool WebEditorClient::isGrammarCheckingEnabled() { #ifdef BUILDING_ON_TIGER return false; #else return [m_webView isGrammarCheckingEnabled]; #endif } void WebEditorClient::toggleGrammarChecking() { #ifndef BUILDING_ON_TIGER [m_webView toggleGrammarChecking:nil]; #endif } int WebEditorClient::spellCheckerDocumentTag() { return [m_webView spellCheckerDocumentTag]; } bool WebEditorClient::isEditable() { return [m_webView isEditable]; } bool WebEditorClient::shouldDeleteRange(Range* range) { return [[m_webView _editingDelegateForwarder] webView:m_webView shouldDeleteDOMRange:kit(range)]; } bool WebEditorClient::shouldShowDeleteInterface(HTMLElement* element) { return [[m_webView _editingDelegateForwarder] webView:m_webView shouldShowDeleteInterfaceForElement:kit(element)]; } bool WebEditorClient::smartInsertDeleteEnabled() { return [m_webView smartInsertDeleteEnabled]; } bool WebEditorClient::isSelectTrailingWhitespaceEnabled() { return [m_webView isSelectTrailingWhitespaceEnabled]; } bool WebEditorClient::shouldApplyStyle(CSSStyleDeclaration* style, Range* range) { return [[m_webView _editingDelegateForwarder] webView:m_webView shouldApplyStyle:kit(style) toElementsInDOMRange:kit(range)]; } bool WebEditorClient::shouldMoveRangeAfterDelete(Range* range, Range* rangeToBeReplaced) { return [[m_webView _editingDelegateForwarder] webView:m_webView shouldMoveRangeAfterDelete:kit(range) replacingRange:kit(rangeToBeReplaced)]; } bool WebEditorClient::shouldBeginEditing(Range* range) { return [[m_webView _editingDelegateForwarder] webView:m_webView shouldBeginEditingInDOMRange:kit(range)]; return false; } bool WebEditorClient::shouldEndEditing(Range* range) { return [[m_webView _editingDelegateForwarder] webView:m_webView shouldEndEditingInDOMRange:kit(range)]; } bool WebEditorClient::shouldInsertText(const String& text, Range* range, EditorInsertAction action) { WebView* webView = m_webView; return [[webView _editingDelegateForwarder] webView:webView shouldInsertText:text replacingDOMRange:kit(range) givenAction:kit(action)]; } bool WebEditorClient::shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity selectionAffinity, bool stillSelecting) { return [m_webView _shouldChangeSelectedDOMRange:kit(fromRange) toDOMRange:kit(toRange) affinity:kit(selectionAffinity) stillSelecting:stillSelecting]; } void WebEditorClient::didBeginEditing() { [[NSNotificationCenter defaultCenter] postNotificationName:WebViewDidBeginEditingNotification object:m_webView]; } void WebEditorClient::respondToChangedContents() { NSView <WebDocumentView> *view = [[[m_webView selectedFrame] frameView] documentView]; if ([view isKindOfClass:[WebHTMLView class]]) [(WebHTMLView *)view _updateFontPanel]; [[NSNotificationCenter defaultCenter] postNotificationName:WebViewDidChangeNotification object:m_webView]; } void WebEditorClient::respondToChangedSelection() { [m_webView _selectionChanged]; // FIXME: This quirk is needed due to <rdar://problem/5009625> - We can phase it out once Aperture can adopt the new behavior on their end if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_APERTURE_QUIRK) && [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Aperture"]) return; [[NSNotificationCenter defaultCenter] postNotificationName:WebViewDidChangeSelectionNotification object:m_webView]; } void WebEditorClient::didEndEditing() { [[NSNotificationCenter defaultCenter] postNotificationName:WebViewDidEndEditingNotification object:m_webView]; } void WebEditorClient::didWriteSelectionToPasteboard() { [[m_webView _editingDelegateForwarder] webView:m_webView didWriteSelectionToPasteboard:[NSPasteboard generalPasteboard]]; } void WebEditorClient::didSetSelectionTypesForPasteboard() { [[m_webView _editingDelegateForwarder] webView:m_webView didSetSelectionTypesForPasteboard:[NSPasteboard generalPasteboard]]; } NSString* WebEditorClient::userVisibleString(NSURL *URL) { return [URL _web_userVisibleString]; } #ifdef BUILDING_ON_TIGER NSArray* WebEditorClient::pasteboardTypesForSelection(Frame* selectedFrame) { WebFrame* frame = kit(selectedFrame); return [[[frame frameView] documentView] pasteboardTypesForSelection]; } #endif #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) void WebEditorClient::uppercaseWord() { [m_webView uppercaseWord:nil]; } void WebEditorClient::lowercaseWord() { [m_webView lowercaseWord:nil]; } void WebEditorClient::capitalizeWord() { [m_webView capitalizeWord:nil]; } void WebEditorClient::showSubstitutionsPanel(bool show) { NSPanel *spellingPanel = [[NSSpellChecker sharedSpellChecker] substitutionsPanel]; if (show) [spellingPanel orderFront:nil]; else [spellingPanel orderOut:nil]; } bool WebEditorClient::substitutionsPanelIsShowing() { return [[[NSSpellChecker sharedSpellChecker] substitutionsPanel] isVisible]; } void WebEditorClient::toggleSmartInsertDelete() { [m_webView toggleSmartInsertDelete:nil]; } bool WebEditorClient::isAutomaticQuoteSubstitutionEnabled() { return [m_webView isAutomaticQuoteSubstitutionEnabled]; } void WebEditorClient::toggleAutomaticQuoteSubstitution() { [m_webView toggleAutomaticQuoteSubstitution:nil]; } bool WebEditorClient::isAutomaticLinkDetectionEnabled() { return [m_webView isAutomaticLinkDetectionEnabled]; } void WebEditorClient::toggleAutomaticLinkDetection() { [m_webView toggleAutomaticLinkDetection:nil]; } bool WebEditorClient::isAutomaticDashSubstitutionEnabled() { return [m_webView isAutomaticDashSubstitutionEnabled]; } void WebEditorClient::toggleAutomaticDashSubstitution() { [m_webView toggleAutomaticDashSubstitution:nil]; } bool WebEditorClient::isAutomaticTextReplacementEnabled() { return [m_webView isAutomaticTextReplacementEnabled]; } void WebEditorClient::toggleAutomaticTextReplacement() { [m_webView toggleAutomaticTextReplacement:nil]; } bool WebEditorClient::isAutomaticSpellingCorrectionEnabled() { return [m_webView isAutomaticSpellingCorrectionEnabled]; } void WebEditorClient::toggleAutomaticSpellingCorrection() { [m_webView toggleAutomaticSpellingCorrection:nil]; } #endif bool WebEditorClient::shouldInsertNode(Node *node, Range* replacingRange, EditorInsertAction givenAction) { return [[m_webView _editingDelegateForwarder] webView:m_webView shouldInsertNode:kit(node) replacingDOMRange:kit(replacingRange) givenAction:(WebViewInsertAction)givenAction]; } static NSString* undoNameForEditAction(EditAction editAction) { switch (editAction) { case EditActionUnspecified: return nil; case EditActionSetColor: return UI_STRING_KEY("Set Color", "Set Color (Undo action name)", "Undo action name"); case EditActionSetBackgroundColor: return UI_STRING_KEY("Set Background Color", "Set Background Color (Undo action name)", "Undo action name"); case EditActionTurnOffKerning: return UI_STRING_KEY("Turn Off Kerning", "Turn Off Kerning (Undo action name)", "Undo action name"); case EditActionTightenKerning: return UI_STRING_KEY("Tighten Kerning", "Tighten Kerning (Undo action name)", "Undo action name"); case EditActionLoosenKerning: return UI_STRING_KEY("Loosen Kerning", "Loosen Kerning (Undo action name)", "Undo action name"); case EditActionUseStandardKerning: return UI_STRING_KEY("Use Standard Kerning", "Use Standard Kerning (Undo action name)", "Undo action name"); case EditActionTurnOffLigatures: return UI_STRING_KEY("Turn Off Ligatures", "Turn Off Ligatures (Undo action name)", "Undo action name"); case EditActionUseStandardLigatures: return UI_STRING_KEY("Use Standard Ligatures", "Use Standard Ligatures (Undo action name)", "Undo action name"); case EditActionUseAllLigatures: return UI_STRING_KEY("Use All Ligatures", "Use All Ligatures (Undo action name)", "Undo action name"); case EditActionRaiseBaseline: return UI_STRING_KEY("Raise Baseline", "Raise Baseline (Undo action name)", "Undo action name"); case EditActionLowerBaseline: return UI_STRING_KEY("Lower Baseline", "Lower Baseline (Undo action name)", "Undo action name"); case EditActionSetTraditionalCharacterShape: return UI_STRING_KEY("Set Traditional Character Shape", "Set Traditional Character Shape (Undo action name)", "Undo action name"); case EditActionSetFont: return UI_STRING_KEY("Set Font", "Set Font (Undo action name)", "Undo action name"); case EditActionChangeAttributes: return UI_STRING_KEY("Change Attributes", "Change Attributes (Undo action name)", "Undo action name"); case EditActionAlignLeft: return UI_STRING_KEY("Align Left", "Align Left (Undo action name)", "Undo action name"); case EditActionAlignRight: return UI_STRING_KEY("Align Right", "Align Right (Undo action name)", "Undo action name"); case EditActionCenter: return UI_STRING_KEY("Center", "Center (Undo action name)", "Undo action name"); case EditActionJustify: return UI_STRING_KEY("Justify", "Justify (Undo action name)", "Undo action name"); case EditActionSetWritingDirection: return UI_STRING_KEY("Set Writing Direction", "Set Writing Direction (Undo action name)", "Undo action name"); case EditActionSubscript: return UI_STRING_KEY("Subscript", "Subscript (Undo action name)", "Undo action name"); case EditActionSuperscript: return UI_STRING_KEY("Superscript", "Superscript (Undo action name)", "Undo action name"); case EditActionUnderline: return UI_STRING_KEY("Underline", "Underline (Undo action name)", "Undo action name"); case EditActionOutline: return UI_STRING_KEY("Outline", "Outline (Undo action name)", "Undo action name"); case EditActionUnscript: return UI_STRING_KEY("Unscript", "Unscript (Undo action name)", "Undo action name"); case EditActionDrag: return UI_STRING_KEY("Drag", "Drag (Undo action name)", "Undo action name"); case EditActionCut: return UI_STRING_KEY("Cut", "Cut (Undo action name)", "Undo action name"); case EditActionPaste: return UI_STRING_KEY("Paste", "Paste (Undo action name)", "Undo action name"); case EditActionPasteFont: return UI_STRING_KEY("Paste Font", "Paste Font (Undo action name)", "Undo action name"); case EditActionPasteRuler: return UI_STRING_KEY("Paste Ruler", "Paste Ruler (Undo action name)", "Undo action name"); case EditActionTyping: return UI_STRING_KEY("Typing", "Typing (Undo action name)", "Undo action name"); case EditActionCreateLink: return UI_STRING_KEY("Create Link", "Create Link (Undo action name)", "Undo action name"); case EditActionUnlink: return UI_STRING_KEY("Unlink", "Unlink (Undo action name)", "Undo action name"); case EditActionInsertList: return UI_STRING_KEY("Insert List", "Insert List (Undo action name)", "Undo action name"); case EditActionFormatBlock: return UI_STRING_KEY("Formatting", "Format Block (Undo action name)", "Undo action name"); case EditActionIndent: return UI_STRING_KEY("Indent", "Indent (Undo action name)", "Undo action name"); case EditActionOutdent: return UI_STRING_KEY("Outdent", "Outdent (Undo action name)", "Undo action name"); } return nil; } void WebEditorClient::registerCommandForUndoOrRedo(PassRefPtr<EditCommand> cmd, bool isRedo) { ASSERT(cmd); NSUndoManager *undoManager = [m_webView undoManager]; NSString *actionName = undoNameForEditAction(cmd->editingAction()); WebEditCommand *command = [WebEditCommand commandWithEditCommand:cmd]; [undoManager registerUndoWithTarget:m_undoTarget.get() selector:(isRedo ? @selector(redoEditing:) : @selector(undoEditing:)) object:command]; if (actionName) [undoManager setActionName:actionName]; m_haveUndoRedoOperations = YES; } void WebEditorClient::registerCommandForUndo(PassRefPtr<EditCommand> cmd) { registerCommandForUndoOrRedo(cmd, false); } void WebEditorClient::registerCommandForRedo(PassRefPtr<EditCommand> cmd) { registerCommandForUndoOrRedo(cmd, true); } void WebEditorClient::clearUndoRedoOperations() { if (m_haveUndoRedoOperations) { // workaround for <rdar://problem/4645507> NSUndoManager dies // with uncaught exception when undo items cleared while // groups are open NSUndoManager *undoManager = [m_webView undoManager]; int groupingLevel = [undoManager groupingLevel]; for (int i = 0; i < groupingLevel; ++i) [undoManager endUndoGrouping]; [undoManager removeAllActionsWithTarget:m_undoTarget.get()]; for (int i = 0; i < groupingLevel; ++i) [undoManager beginUndoGrouping]; m_haveUndoRedoOperations = NO; } } bool WebEditorClient::canUndo() const { return [[m_webView undoManager] canUndo]; } bool WebEditorClient::canRedo() const { return [[m_webView undoManager] canRedo]; } void WebEditorClient::undo() { if (canUndo()) [[m_webView undoManager] undo]; } void WebEditorClient::redo() { if (canRedo()) [[m_webView undoManager] redo]; } void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event) { Frame* frame = event->target()->toNode()->document()->frame(); WebHTMLView *webHTMLView = [[kit(frame) frameView] documentView]; if ([webHTMLView _interceptEditingKeyEvent:event shouldSaveCommand:NO]) event->setDefaultHandled(); } void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* event) { Frame* frame = event->target()->toNode()->document()->frame(); WebHTMLView *webHTMLView = [[kit(frame) frameView] documentView]; if ([webHTMLView _interceptEditingKeyEvent:event shouldSaveCommand:YES]) event->setDefaultHandled(); } #define FormDelegateLog(ctrl) LOG(FormDelegate, "control=%@", ctrl) void WebEditorClient::textFieldDidBeginEditing(Element* element) { if (!element->hasTagName(inputTag)) return; DOMHTMLInputElement* inputElement = kit(static_cast<HTMLInputElement*>(element)); FormDelegateLog(inputElement); CallFormDelegate(m_webView, @selector(textFieldDidBeginEditing:inFrame:), inputElement, kit(element->document()->frame())); } void WebEditorClient::textFieldDidEndEditing(Element* element) { if (!element->hasTagName(inputTag)) return; DOMHTMLInputElement* inputElement = kit(static_cast<HTMLInputElement*>(element)); FormDelegateLog(inputElement); CallFormDelegate(m_webView, @selector(textFieldDidEndEditing:inFrame:), inputElement, kit(element->document()->frame())); } void WebEditorClient::textDidChangeInTextField(Element* element) { if (!element->hasTagName(inputTag)) return; DOMHTMLInputElement* inputElement = kit(static_cast<HTMLInputElement*>(element)); FormDelegateLog(inputElement); CallFormDelegate(m_webView, @selector(textDidChangeInTextField:inFrame:), inputElement, kit(element->document()->frame())); } static SEL selectorForKeyEvent(KeyboardEvent* event) { // FIXME: This helper function is for the auto-fill code so we can pass a selector to the form delegate. // Eventually, we should move all of the auto-fill code down to WebKit and remove the need for this function by // not relying on the selector in the new implementation. // The key identifiers are from <http://www.w3.org/TR/DOM-Level-3-Events/keyset.html#KeySet-Set> String key = event->keyIdentifier(); if (key == "Up") return @selector(moveUp:); if (key == "Down") return @selector(moveDown:); if (key == "U+001B") return @selector(cancel:); if (key == "U+0009") { if (event->shiftKey()) return @selector(insertBacktab:); return @selector(insertTab:); } if (key == "Enter") return @selector(insertNewline:); return 0; } bool WebEditorClient::doTextFieldCommandFromEvent(Element* element, KeyboardEvent* event) { if (!element->hasTagName(inputTag)) return NO; DOMHTMLInputElement* inputElement = kit(static_cast<HTMLInputElement*>(element)); FormDelegateLog(inputElement); if (SEL commandSelector = selectorForKeyEvent(event)) return CallFormDelegateReturningBoolean(NO, m_webView, @selector(textField:doCommandBySelector:inFrame:), inputElement, commandSelector, kit(element->document()->frame())); return NO; } void WebEditorClient::textWillBeDeletedInTextField(Element* element) { if (!element->hasTagName(inputTag)) return; DOMHTMLInputElement* inputElement = kit(static_cast<HTMLInputElement*>(element)); FormDelegateLog(inputElement); // We're using the deleteBackward selector for all deletion operations since the autofill code treats all deletions the same way. CallFormDelegateReturningBoolean(NO, m_webView, @selector(textField:doCommandBySelector:inFrame:), inputElement, @selector(deleteBackward:), kit(element->document()->frame())); } void WebEditorClient::textDidChangeInTextArea(Element* element) { if (!element->hasTagName(textareaTag)) return; DOMHTMLTextAreaElement* textAreaElement = kit(static_cast<HTMLTextAreaElement*>(element)); FormDelegateLog(textAreaElement); CallFormDelegate(m_webView, @selector(textDidChangeInTextArea:inFrame:), textAreaElement, kit(element->document()->frame())); } void WebEditorClient::ignoreWordInSpellDocument(const String& text) { [[NSSpellChecker sharedSpellChecker] ignoreWord:text inSpellDocumentWithTag:spellCheckerDocumentTag()]; } void WebEditorClient::learnWord(const String& text) { [[NSSpellChecker sharedSpellChecker] learnWord:text]; } void WebEditorClient::checkSpellingOfString(const UChar* text, int length, int* misspellingLocation, int* misspellingLength) { NSString* textString = [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(text) length:length freeWhenDone:NO]; NSRange range = [[NSSpellChecker sharedSpellChecker] checkSpellingOfString:textString startingAt:0 language:nil wrap:NO inSpellDocumentWithTag:spellCheckerDocumentTag() wordCount:NULL]; [textString release]; if (misspellingLocation) { // WebCore expects -1 to represent "not found" if (range.location == NSNotFound) *misspellingLocation = -1; else *misspellingLocation = range.location; } if (misspellingLength) *misspellingLength = range.length; } String WebEditorClient::getAutoCorrectSuggestionForMisspelledWord(const String& inputWord) { // This method can be implemented using customized algorithms for the particular browser. // Currently, it computes an empty string. return String(); } void WebEditorClient::checkGrammarOfString(const UChar* text, int length, Vector<GrammarDetail>& details, int* badGrammarLocation, int* badGrammarLength) { #ifndef BUILDING_ON_TIGER NSArray *grammarDetails; NSString* textString = [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(text) length:length freeWhenDone:NO]; NSRange range = [[NSSpellChecker sharedSpellChecker] checkGrammarOfString:textString startingAt:0 language:nil wrap:NO inSpellDocumentWithTag:spellCheckerDocumentTag() details:&grammarDetails]; [textString release]; if (badGrammarLocation) // WebCore expects -1 to represent "not found" *badGrammarLocation = (range.location == NSNotFound) ? -1 : range.location; if (badGrammarLength) *badGrammarLength = range.length; for (NSDictionary *detail in grammarDetails) { ASSERT(detail); GrammarDetail grammarDetail; NSValue *detailRangeAsNSValue = [detail objectForKey:NSGrammarRange]; ASSERT(detailRangeAsNSValue); NSRange detailNSRange = [detailRangeAsNSValue rangeValue]; ASSERT(detailNSRange.location != NSNotFound && detailNSRange.length > 0); grammarDetail.location = detailNSRange.location; grammarDetail.length = detailNSRange.length; grammarDetail.userDescription = [detail objectForKey:NSGrammarUserDescription]; NSArray *guesses = [detail objectForKey:NSGrammarCorrections]; for (NSString *guess in guesses) grammarDetail.guesses.append(String(guess)); details.append(grammarDetail); } #endif } void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, Vector<TextCheckingResult>& results) { #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) NSString *textString = [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(text) length:length freeWhenDone:NO]; NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString range:NSMakeRange(0, [textString length]) types:(checkingTypes|NSTextCheckingTypeOrthography) options:nil inSpellDocumentWithTag:spellCheckerDocumentTag() orthography:NULL wordCount:NULL]; [textString release]; for (NSTextCheckingResult *incomingResult in incomingResults) { NSRange resultRange = [incomingResult range]; NSTextCheckingType resultType = [incomingResult resultType]; ASSERT(resultRange.location != NSNotFound && resultRange.length > 0); if (NSTextCheckingTypeSpelling == resultType && 0 != (checkingTypes & NSTextCheckingTypeSpelling)) { TextCheckingResult result; result.type = TextCheckingTypeSpelling; result.location = resultRange.location; result.length = resultRange.length; results.append(result); } else if (NSTextCheckingTypeGrammar == resultType && 0 != (checkingTypes & NSTextCheckingTypeGrammar)) { TextCheckingResult result; NSArray *details = [incomingResult grammarDetails]; result.type = TextCheckingTypeGrammar; result.location = resultRange.location; result.length = resultRange.length; for (NSDictionary *incomingDetail in details) { ASSERT(incomingDetail); GrammarDetail detail; NSValue *detailRangeAsNSValue = [incomingDetail objectForKey:NSGrammarRange]; ASSERT(detailRangeAsNSValue); NSRange detailNSRange = [detailRangeAsNSValue rangeValue]; ASSERT(detailNSRange.location != NSNotFound && detailNSRange.length > 0); detail.location = detailNSRange.location; detail.length = detailNSRange.length; detail.userDescription = [incomingDetail objectForKey:NSGrammarUserDescription]; NSArray *guesses = [incomingDetail objectForKey:NSGrammarCorrections]; for (NSString *guess in guesses) detail.guesses.append(String(guess)); result.details.append(detail); } results.append(result); } else if (NSTextCheckingTypeLink == resultType && 0 != (checkingTypes & NSTextCheckingTypeLink)) { TextCheckingResult result; result.type = TextCheckingTypeLink; result.location = resultRange.location; result.length = resultRange.length; result.replacement = [[incomingResult URL] absoluteString]; results.append(result); } else if (NSTextCheckingTypeQuote == resultType && 0 != (checkingTypes & NSTextCheckingTypeQuote)) { TextCheckingResult result; result.type = TextCheckingTypeQuote; result.location = resultRange.location; result.length = resultRange.length; result.replacement = [incomingResult replacementString]; results.append(result); } else if (NSTextCheckingTypeDash == resultType && 0 != (checkingTypes & NSTextCheckingTypeDash)) { TextCheckingResult result; result.type = TextCheckingTypeDash; result.location = resultRange.location; result.length = resultRange.length; result.replacement = [incomingResult replacementString]; results.append(result); } else if (NSTextCheckingTypeReplacement == resultType && 0 != (checkingTypes & NSTextCheckingTypeReplacement)) { TextCheckingResult result; result.type = TextCheckingTypeReplacement; result.location = resultRange.location; result.length = resultRange.length; result.replacement = [incomingResult replacementString]; results.append(result); } else if (NSTextCheckingTypeCorrection == resultType && 0 != (checkingTypes & NSTextCheckingTypeCorrection)) { TextCheckingResult result; result.type = TextCheckingTypeCorrection; result.location = resultRange.location; result.length = resultRange.length; result.replacement = [incomingResult replacementString]; results.append(result); } } #endif } void WebEditorClient::updateSpellingUIWithGrammarString(const String& badGrammarPhrase, const GrammarDetail& grammarDetail) { #ifndef BUILDING_ON_TIGER NSMutableArray* corrections = [NSMutableArray array]; for (unsigned i = 0; i < grammarDetail.guesses.size(); i++) { NSString* guess = grammarDetail.guesses[i]; [corrections addObject:guess]; } NSRange grammarRange = NSMakeRange(grammarDetail.location, grammarDetail.length); NSString* grammarUserDescription = grammarDetail.userDescription; NSMutableDictionary* grammarDetailDict = [NSDictionary dictionaryWithObjectsAndKeys:[NSValue valueWithRange:grammarRange], NSGrammarRange, grammarUserDescription, NSGrammarUserDescription, corrections, NSGrammarCorrections, nil]; [[NSSpellChecker sharedSpellChecker] updateSpellingPanelWithGrammarString:badGrammarPhrase detail:grammarDetailDict]; #endif } void WebEditorClient::updateSpellingUIWithMisspelledWord(const String& misspelledWord) { [[NSSpellChecker sharedSpellChecker] updateSpellingPanelWithMisspelledWord:misspelledWord]; } void WebEditorClient::showSpellingUI(bool show) { NSPanel *spellingPanel = [[NSSpellChecker sharedSpellChecker] spellingPanel]; if (show) [spellingPanel orderFront:nil]; else [spellingPanel orderOut:nil]; } bool WebEditorClient::spellingUIIsShowing() { return [[[NSSpellChecker sharedSpellChecker] spellingPanel] isVisible]; } void WebEditorClient::getGuessesForWord(const String& word, WTF::Vector<String>& guesses) { NSArray* stringsArray = [[NSSpellChecker sharedSpellChecker] guessesForWord:word]; unsigned count = [stringsArray count]; guesses.clear(); if (count > 0) { NSEnumerator* enumerator = [stringsArray objectEnumerator]; NSString* string; while ((string = [enumerator nextObject]) != nil) guesses.append(string); } } void WebEditorClient::setInputMethodState(bool) { } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebApplicationCache.mm����������������������������������������������������0000644�0001750�0001750�00000003151�11232275376�020212� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 "WebApplicationCache.h" #import <WebCore/ApplicationCacheStorage.h> using namespace WebCore; @implementation WebApplicationCache + (void)setMaximumSize:(unsigned long long)size { cacheStorage().empty(); cacheStorage().vacuumDatabaseFile(); cacheStorage().setMaximumSize(size); } @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h����������������������������������������������������0000644�0001750�0001750�00000025616�11250045144�020157� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebCore/FrameLoaderClient.h> #import <WebCore/Timer.h> #import <wtf/Forward.h> #import <wtf/HashMap.h> #import <wtf/RetainPtr.h> @class WebDownload; @class WebFrame; @class WebFramePolicyListener; @class WebHistoryItem; @class WebResource; namespace WebCore { class AuthenticationChallenge; class CachedFrame; class HistoryItem; class String; class ResourceLoader; class ResourceRequest; } typedef HashMap<RefPtr<WebCore::ResourceLoader>, RetainPtr<WebResource> > ResourceMap; class WebFrameLoaderClient : public WebCore::FrameLoaderClient { public: WebFrameLoaderClient(WebFrame*); WebFrame* webFrame() const { return m_webFrame.get(); } virtual void frameLoaderDestroyed(); void receivedPolicyDecison(WebCore::PolicyAction); private: virtual bool hasWebView() const; // mainly for assertions virtual void makeRepresentation(WebCore::DocumentLoader*); virtual bool hasHTMLView() const; virtual void forceLayout(); virtual void forceLayoutForNonHTML(); virtual void setCopiesOnScroll(); virtual void detachedFromParent2(); virtual void detachedFromParent3(); virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); virtual void assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader*, const WebCore::ResourceRequest&); virtual void dispatchWillSendRequest(WebCore::DocumentLoader*, unsigned long identifier, WebCore::ResourceRequest&, const WebCore::ResourceResponse& redirectResponse); virtual bool shouldUseCredentialStorage(WebCore::DocumentLoader*, unsigned long identifier); virtual void dispatchDidReceiveAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidCancelAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&); virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived); virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier); virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&); virtual NSCachedURLResponse* willCacheResponse(WebCore::DocumentLoader*, unsigned long identifier, NSCachedURLResponse*) const; virtual void dispatchDidHandleOnloadEvents(); virtual void dispatchDidReceiveServerRedirectForProvisionalLoad(); virtual void dispatchDidCancelClientRedirect(); virtual void dispatchWillPerformClientRedirect(const WebCore::KURL&, double interval, double fireDate); virtual void dispatchDidChangeLocationWithinPage(); virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); virtual void dispatchDidReceiveTitle(const WebCore::String& title); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); virtual void dispatchDidFailLoad(const WebCore::ResourceError&); virtual void dispatchDidFinishDocumentLoad(); virtual void dispatchDidFinishLoad(); virtual void dispatchDidFirstLayout(); virtual void dispatchDidFirstVisuallyNonEmptyLayout(); virtual WebCore::Frame* dispatchCreatePage(); virtual void dispatchShow(); virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, const WebCore::String& MIMEType, const WebCore::ResourceRequest&); virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>, const WebCore::String& frameName); virtual void dispatchDecidePolicyForNavigationAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>); virtual void cancelPolicyCheck(); virtual void dispatchUnableToImplementPolicy(const WebCore::ResourceError&); virtual void dispatchWillSubmitForm(WebCore::FramePolicyFunction, PassRefPtr<WebCore::FormState>); virtual void dispatchDidLoadMainResource(WebCore::DocumentLoader*); virtual void revertToProvisionalState(WebCore::DocumentLoader*); virtual void setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&); virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length); virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long identifier, const WebCore::ScriptString&); virtual void willChangeEstimatedProgress(); virtual void didChangeEstimatedProgress(); virtual void postProgressStartedNotification(); virtual void postProgressEstimateChangedNotification(); virtual void postProgressFinishedNotification(); virtual void setMainFrameDocumentReady(bool); virtual void startDownload(const WebCore::ResourceRequest&); virtual void willChangeTitle(WebCore::DocumentLoader*); virtual void didChangeTitle(WebCore::DocumentLoader*); virtual void committedLoad(WebCore::DocumentLoader*, const char*, int); virtual void finishedLoading(WebCore::DocumentLoader*); virtual void updateGlobalHistory(); virtual void updateGlobalHistoryRedirectLinks(); virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const; virtual void didDisplayInsecureContent(); virtual void didRunInsecureContent(WebCore::SecurityOrigin*); virtual WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&); virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&); virtual WebCore::ResourceError cannotShowURLError(const WebCore::ResourceRequest&); virtual WebCore::ResourceError interruptForPolicyChangeError(const WebCore::ResourceRequest&); virtual WebCore::ResourceError cannotShowMIMETypeError(const WebCore::ResourceResponse&); virtual WebCore::ResourceError fileDoesNotExistError(const WebCore::ResourceResponse&); virtual WebCore::ResourceError pluginWillHandleLoadError(const WebCore::ResourceResponse&); virtual bool shouldFallBack(const WebCore::ResourceError&); virtual WebCore::String userAgent(const WebCore::KURL&); virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedForNewPage(); virtual bool canHandleRequest(const WebCore::ResourceRequest&) const; virtual bool canShowMIMEType(const WebCore::String& MIMEType) const; virtual bool representationExistsForURLScheme(const WebCore::String& URLScheme) const; virtual WebCore::String generatedMIMETypeForURLScheme(const WebCore::String& URLScheme) const; virtual void frameLoadCompleted(); virtual void saveViewStateToItem(WebCore::HistoryItem*); virtual void restoreViewState(); virtual void provisionalLoadStarted(); virtual void didFinishLoad(); virtual void prepareForDataSourceReplacement(); virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); virtual void setTitle(const WebCore::String& title, const WebCore::KURL&); virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement*, const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WebCore::String>&, const Vector<WebCore::String>&, const WebCore::String&, bool); virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const Vector<WebCore::String>& paramNames, const Vector<WebCore::String>& paramValues); virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WebCore::String& mimeType); virtual WebCore::String overrideMediaType() const; virtual void windowObjectCleared(); virtual void documentElementAvailable(); virtual void didPerformFirstNavigation() const; virtual void registerForIconNotification(bool listen); #if ENABLE(MAC_JAVA_BRIDGE) virtual jobject javaApplet(NSView*); #endif void setOriginalURLForDownload(WebDownload *, const WebCore::ResourceRequest&) const; RetainPtr<WebFramePolicyListener> setUpPolicyListener(WebCore::FramePolicyFunction); NSDictionary *actionDictionary(const WebCore::NavigationAction&, PassRefPtr<WebCore::FormState>) const; virtual bool canCachePage() const; virtual bool shouldLoadMediaElementURL(const WebCore::KURL&) const; RetainPtr<WebFrame> m_webFrame; RetainPtr<WebFramePolicyListener> m_policyListener; WebCore::FramePolicyFunction m_policyFunction; }; ������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebChromeClient.h���������������������������������������������������������0000644�0001750�0001750�00000014777�11254742231�017226� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebCore/ChromeClient.h> #import <WebCore/FocusDirection.h> #import <wtf/Forward.h> @class WebView; class WebChromeClient : public WebCore::ChromeClient { public: WebChromeClient(WebView *webView); WebView *webView() { return m_webView; } virtual void chromeDestroyed(); virtual void setWindowRect(const WebCore::FloatRect&); virtual WebCore::FloatRect windowRect(); virtual WebCore::FloatRect pageRect(); virtual float scaleFactor(); virtual void focus(); virtual void unfocus(); virtual bool canTakeFocus(WebCore::FocusDirection); virtual void takeFocus(WebCore::FocusDirection); virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&); virtual void show(); virtual bool canRunModal(); virtual void runModal(); virtual void setToolbarsVisible(bool); virtual bool toolbarsVisible(); virtual void setStatusbarVisible(bool); virtual bool statusbarVisible(); virtual void setScrollbarsVisible(bool); virtual bool scrollbarsVisible(); virtual void setMenubarVisible(bool); virtual bool menubarVisible(); virtual void setResizable(bool); virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, WebCore::MessageLevel level, const WebCore::String& message, unsigned int lineNumber, const WebCore::String& sourceURL); virtual bool canRunBeforeUnloadConfirmPanel(); virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame); virtual void closeWindowSoon(); virtual void runJavaScriptAlert(WebCore::Frame*, const WebCore::String&); virtual bool runJavaScriptConfirm(WebCore::Frame*, const WebCore::String&); virtual bool runJavaScriptPrompt(WebCore::Frame*, const WebCore::String& message, const WebCore::String& defaultValue, WebCore::String& result); virtual bool shouldInterruptJavaScript(); virtual bool tabsToLinks() const; virtual WebCore::IntRect windowResizerRect() const; virtual void repaint(const WebCore::IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false); virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, const WebCore::IntRect& clipRect); virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const; virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const; virtual PlatformPageClient platformPageClient() const; virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const; virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const; virtual void setStatusbarText(const WebCore::String&); virtual void scrollbarsModeDidChange() const { } virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags); virtual void setToolTip(const WebCore::String&, WebCore::TextDirection); virtual void print(WebCore::Frame*); #if ENABLE(DATABASE) virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String& databaseName); #endif #if ENABLE(OFFLINE_WEB_APPLICATIONS) virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); #endif virtual void populateVisitedLinks(); #if ENABLE(DASHBOARD_SUPPORT) virtual void dashboardRegionsChanged(); #endif virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); virtual bool setCursor(WebCore::PlatformCursorHandle) { return false; } virtual WebCore::FloatRect customHighlightRect(WebCore::Node*, const WebCore::AtomicString& type, const WebCore::FloatRect& lineRect); virtual void paintCustomHighlight(WebCore::Node*, const WebCore::AtomicString& type, const WebCore::FloatRect& boxRect, const WebCore::FloatRect& lineRect, bool behindText, bool entireLine); virtual WebCore::KeyboardUIMode keyboardUIMode(); virtual NSResponder *firstResponder(); virtual void makeFirstResponder(NSResponder *); virtual void willPopUpMenu(NSMenu *); virtual bool shouldReplaceWithGeneratedFileForUpload(const WebCore::String& path, WebCore::String &generatedFilename); virtual WebCore::String generateReplacementFile(const WebCore::String& path); virtual void formStateDidChange(const WebCore::Node*); virtual void formDidFocus(const WebCore::Node*); virtual void formDidBlur(const WebCore::Node*); virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks() { return 0; } #if USE(ACCELERATED_COMPOSITING) virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*); virtual void setNeedsOneShotDrawingSynchronization(); virtual void scheduleCompositingLayerSync(); #endif virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*); private: WebView *m_webView; }; �WebKit/mac/WebCoreSupport/WebDragClient.h�����������������������������������������������������������0000644�0001750�0001750�00000004535�10744307516�016663� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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 <WebCore/DragClient.h> @class WebView; class WebDragClient : public WebCore::DragClient { public: WebDragClient(WebView*); virtual void willPerformDragDestinationAction(WebCore::DragDestinationAction, WebCore::DragData*); virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*); virtual WebCore::DragDestinationAction actionMaskForDrag(WebCore::DragData*); virtual void dragControllerDestroyed(); virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint& windowPoint); virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragPos, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag); virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL& url, const WebCore::String& label, WebCore::Frame*); virtual void declareAndWriteDragImage(NSPasteboard*, DOMElement*, NSURL*, NSString*, WebCore::Frame*); private: WebView* m_webView; }; �������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebGeolocationInternal.h��������������������������������������������������0000644�0001750�0001750�00000003054�11156526152�020577� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 "WebGeolocationPrivate.h" namespace WebCore { class Geolocation; } typedef WebCore::Geolocation WebCoreGeolocation; @interface WebGeolocation (WebInternal) - (id)_initWithWebCoreGeolocation:(WebCoreGeolocation *)geolocation; @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebCachedFramePlatformData.h����������������������������������������������0000644�0001750�0001750�00000004021�11136460103�021242� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <objc/objc-runtime.h> #import <WebCore/CachedFramePlatformData.h> #import <wtf/RetainPtr.h> class WebCachedFramePlatformData : public WebCore::CachedFramePlatformData { public: WebCachedFramePlatformData(id webDocumentView) : m_webDocumentView(webDocumentView) { } virtual void clear() { objc_msgSend(m_webDocumentView.get(), @selector(closeIfNotCurrentView)); } id webDocumentView() { return m_webDocumentView.get(); } private: RetainPtr<id> m_webDocumentView; }; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebViewFactory.mm���������������������������������������������������������0000644�0001750�0001750�00000064006�11246021455�017263� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2009 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebViewFactory.h> #import <WebKit/WebFrameInternal.h> #import <WebKit/WebViewInternal.h> #import <WebKit/WebHTMLViewInternal.h> #import <WebKit/WebLocalizableStrings.h> #import <WebKit/WebNSUserDefaultsExtras.h> #import <WebKit/WebNSObjectExtras.h> #import <WebKit/WebNSViewExtras.h> #import <WebKit/WebPluginDatabase.h> #import <WebKitSystemInterface.h> #import <wtf/Assertions.h> @interface NSMenu (WebViewFactoryAdditions) - (NSMenuItem *)addItemWithTitle:(NSString *)title action:(SEL)action tag:(int)tag; @end @implementation NSMenu (WebViewFactoryAdditions) - (NSMenuItem *)addItemWithTitle:(NSString *)title action:(SEL)action tag:(int)tag { NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:title action:action keyEquivalent:@""] autorelease]; [item setTag:tag]; [self addItem:item]; return item; } @end @implementation WebViewFactory + (void)createSharedFactory { if (![self sharedFactory]) { [[[self alloc] init] release]; } ASSERT([[self sharedFactory] isKindOfClass:self]); } - (NSArray *)pluginsInfo { return [[WebPluginDatabase sharedDatabase] plugins]; } - (void)refreshPlugins { [[WebPluginDatabase sharedDatabase] refresh]; } - (NSString *)inputElementAltText { return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value"); } - (NSString *)resetButtonDefaultLabel { return UI_STRING("Reset", "default label for Reset buttons in forms on web pages"); } - (NSString *)searchableIndexIntroduction { return UI_STRING("This is a searchable index. Enter search keywords: ", "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'"); } - (NSString *)submitButtonDefaultLabel { return UI_STRING("Submit", "default label for Submit buttons in forms on web pages"); } - (NSString *)fileButtonChooseFileLabel { return UI_STRING("Choose File", "title for file button used in HTML forms"); } - (NSString *)fileButtonNoFileSelectedLabel { return UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected"); } - (NSString *)copyImageUnknownFileLabel { return UI_STRING("unknown", "Unknown filename"); } - (NSString *)searchMenuNoRecentSearchesText { return UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed"); } - (NSString *)searchMenuRecentSearchesText { return UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title"); } - (NSString *)searchMenuClearRecentSearchesText { return UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents"); } - (NSString *)defaultLanguageCode { return [NSUserDefaults _webkit_preferredLanguageCode]; } - (NSString *)contextMenuItemTagOpenLinkInNewWindow { return UI_STRING("Open Link in New Window", "Open in New Window context menu item"); } - (NSString *)contextMenuItemTagDownloadLinkToDisk { return UI_STRING("Download Linked File", "Download Linked File context menu item"); } - (NSString *)contextMenuItemTagCopyLinkToClipboard { return UI_STRING("Copy Link", "Copy Link context menu item"); } - (NSString *)contextMenuItemTagOpenImageInNewWindow { return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item"); } - (NSString *)contextMenuItemTagDownloadImageToDisk { return UI_STRING("Download Image", "Download Image context menu item"); } - (NSString *)contextMenuItemTagCopyImageToClipboard { return UI_STRING("Copy Image", "Copy Image context menu item"); } - (NSString *)contextMenuItemTagOpenFrameInNewWindow { return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item"); } - (NSString *)contextMenuItemTagCopy { return UI_STRING("Copy", "Copy context menu item"); } - (NSString *)contextMenuItemTagGoBack { return UI_STRING("Back", "Back context menu item"); } - (NSString *)contextMenuItemTagGoForward { return UI_STRING("Forward", "Forward context menu item"); } - (NSString *)contextMenuItemTagStop { return UI_STRING("Stop", "Stop context menu item"); } - (NSString *)contextMenuItemTagReload { return UI_STRING("Reload", "Reload context menu item"); } - (NSString *)contextMenuItemTagCut { return UI_STRING("Cut", "Cut context menu item"); } - (NSString *)contextMenuItemTagPaste { return UI_STRING("Paste", "Paste context menu item"); } - (NSString *)contextMenuItemTagNoGuessesFound { return UI_STRING("No Guesses Found", "No Guesses Found context menu item"); } - (NSString *)contextMenuItemTagIgnoreSpelling { return UI_STRING("Ignore Spelling", "Ignore Spelling context menu item"); } - (NSString *)contextMenuItemTagLearnSpelling { return UI_STRING("Learn Spelling", "Learn Spelling context menu item"); } - (NSString *)contextMenuItemTagSearchInSpotlight { return UI_STRING("Search in Spotlight", "Search in Spotlight context menu item"); } - (NSString *)contextMenuItemTagSearchWeb { return UI_STRING("Search in Google", "Search in Google context menu item"); } - (NSString *)contextMenuItemTagLookUpInDictionary { return UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item"); } - (NSString *)contextMenuItemTagOpenLink { return UI_STRING("Open Link", "Open Link context menu item"); } - (NSString *)contextMenuItemTagIgnoreGrammar { return UI_STRING("Ignore Grammar", "Ignore Grammar context menu item"); } - (NSString *)contextMenuItemTagSpellingMenu { #ifndef BUILDING_ON_TIGER return UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item"); #else return UI_STRING("Spelling", "Spelling context sub-menu item"); #endif } - (NSString *)contextMenuItemTagShowSpellingPanel:(bool)show { #ifndef BUILDING_ON_TIGER if (show) return UI_STRING("Show Spelling and Grammar", "menu item title"); return UI_STRING("Hide Spelling and Grammar", "menu item title"); #else return UI_STRING("Spelling...", "menu item title"); #endif } - (NSString *)contextMenuItemTagCheckSpelling { #ifndef BUILDING_ON_TIGER return UI_STRING("Check Document Now", "Check spelling context menu item"); #else return UI_STRING("Check Spelling", "Check spelling context menu item"); #endif } - (NSString *)contextMenuItemTagCheckSpellingWhileTyping { #ifndef BUILDING_ON_TIGER return UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item"); #else return UI_STRING("Check Spelling as You Type", "Check spelling while typing context menu item"); #endif } - (NSString *)contextMenuItemTagCheckGrammarWithSpelling { return UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item"); } - (NSString *)contextMenuItemTagFontMenu { return UI_STRING("Font", "Font context sub-menu item"); } - (NSString *)contextMenuItemTagShowFonts { return UI_STRING("Show Fonts", "Show fonts context menu item"); } - (NSString *)contextMenuItemTagBold { return UI_STRING("Bold", "Bold context menu item"); } - (NSString *)contextMenuItemTagItalic { return UI_STRING("Italic", "Italic context menu item"); } - (NSString *)contextMenuItemTagUnderline { return UI_STRING("Underline", "Underline context menu item"); } - (NSString *)contextMenuItemTagOutline { return UI_STRING("Outline", "Outline context menu item"); } - (NSString *)contextMenuItemTagStyles { return UI_STRING("Styles...", "Styles context menu item"); } - (NSString *)contextMenuItemTagShowColors { return UI_STRING("Show Colors", "Show colors context menu item"); } - (NSString *)contextMenuItemTagSpeechMenu { return UI_STRING("Speech", "Speech context sub-menu item"); } - (NSString *)contextMenuItemTagStartSpeaking { return UI_STRING("Start Speaking", "Start speaking context menu item"); } - (NSString *)contextMenuItemTagStopSpeaking { return UI_STRING("Stop Speaking", "Stop speaking context menu item"); } - (NSString *)contextMenuItemTagWritingDirectionMenu { #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) return UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item"); #else return UI_STRING("Writing Direction", "Writing direction context sub-menu item"); #endif } - (NSString *)contextMenuItemTagTextDirectionMenu { return UI_STRING("Selection Direction", "Selection direction context sub-menu item"); } - (NSString *)contextMenuItemTagDefaultDirection { return UI_STRING("Default", "Default writing direction context menu item"); } - (NSString *)contextMenuItemTagLeftToRight { return UI_STRING("Left to Right", "Left to Right context menu item"); } - (NSString *)contextMenuItemTagRightToLeft { return UI_STRING("Right to Left", "Right to Left context menu item"); } - (NSString *)contextMenuItemTagCorrectSpellingAutomatically { return UI_STRING("Correct Spelling Automatically", "Correct Spelling Automatically context menu item"); } - (NSString *)contextMenuItemTagSubstitutionsMenu { return UI_STRING("Substitutions", "Substitutions context sub-menu item"); } - (NSString *)contextMenuItemTagShowSubstitutions:(bool)show { if (show) return UI_STRING("Show Substitutions", "menu item title"); return UI_STRING("Hide Substitutions", "menu item title"); } - (NSString *)contextMenuItemTagSmartCopyPaste { return UI_STRING("Smart Copy/Paste", "Smart Copy/Paste context menu item"); } - (NSString *)contextMenuItemTagSmartQuotes { return UI_STRING("Smart Quotes", "Smart Quotes context menu item"); } - (NSString *)contextMenuItemTagSmartDashes { return UI_STRING("Smart Dashes", "Smart Dashes context menu item"); } - (NSString *)contextMenuItemTagSmartLinks { return UI_STRING("Smart Links", "Smart Links context menu item"); } - (NSString *)contextMenuItemTagTextReplacement { return UI_STRING("Text Replacement", "Text Replacement context menu item"); } - (NSString *)contextMenuItemTagTransformationsMenu { return UI_STRING("Transformations", "Transformations context sub-menu item"); } - (NSString *)contextMenuItemTagMakeUpperCase { return UI_STRING("Make Upper Case", "Make Upper Case context menu item"); } - (NSString *)contextMenuItemTagMakeLowerCase { return UI_STRING("Make Lower Case", "Make Lower Case context menu item"); } - (NSString *)contextMenuItemTagCapitalize { return UI_STRING("Capitalize", "Capitalize context menu item"); } - (NSString *)contextMenuItemTagChangeBack:(NSString *)replacedString { static NSString *formatString = nil; #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) static bool lookedUpString = false; if (!lookedUpString) { formatString = [[[NSBundle bundleForClass:[NSSpellChecker class]] localizedStringForKey:@"Change Back to \\U201C%@\\U201D" value:nil table:@"MenuCommands"] retain]; lookedUpString = true; } #endif return formatString ? [NSString stringWithFormat:formatString, replacedString] : replacedString; } - (NSString *)contextMenuItemTagInspectElement { return UI_STRING("Inspect Element", "Inspect Element context menu item"); } - (BOOL)objectIsTextMarker:(id)object { return object != nil && CFGetTypeID(object) == WKGetAXTextMarkerTypeID(); } - (BOOL)objectIsTextMarkerRange:(id)object { return object != nil && CFGetTypeID(object) == WKGetAXTextMarkerRangeTypeID(); } - (WebCoreTextMarker *)textMarkerWithBytes:(const void *)bytes length:(size_t)length { return WebCFAutorelease(WKCreateAXTextMarker(bytes, length)); } - (BOOL)getBytes:(void *)bytes fromTextMarker:(WebCoreTextMarker *)textMarker length:(size_t)length { return WKGetBytesFromAXTextMarker(textMarker, bytes, length); } - (WebCoreTextMarkerRange *)textMarkerRangeWithStart:(WebCoreTextMarker *)start end:(WebCoreTextMarker *)end { ASSERT(start != nil); ASSERT(end != nil); ASSERT(CFGetTypeID(start) == WKGetAXTextMarkerTypeID()); ASSERT(CFGetTypeID(end) == WKGetAXTextMarkerTypeID()); return WebCFAutorelease(WKCreateAXTextMarkerRange(start, end)); } - (WebCoreTextMarker *)startOfTextMarkerRange:(WebCoreTextMarkerRange *)range { ASSERT(range != nil); ASSERT(CFGetTypeID(range) == WKGetAXTextMarkerRangeTypeID()); return WebCFAutorelease(WKCopyAXTextMarkerRangeStart(range)); } - (WebCoreTextMarker *)endOfTextMarkerRange:(WebCoreTextMarkerRange *)range { ASSERT(range != nil); ASSERT(CFGetTypeID(range) == WKGetAXTextMarkerRangeTypeID()); return WebCFAutorelease(WKCopyAXTextMarkerRangeEnd(range)); } - (void)accessibilityHandleFocusChanged { WKAccessibilityHandleFocusChanged(); } - (AXUIElementRef)AXUIElementForElement:(id)element { return WKCreateAXUIElementRef(element); } - (CGRect)accessibilityConvertScreenRect:(CGRect)bounds { NSArray *screens = [NSScreen screens]; if ([screens count]) { CGFloat screenHeight = NSHeight([[screens objectAtIndex:0] frame]); bounds.origin.y = (screenHeight - (bounds.origin.y + bounds.size.height)); } else bounds = CGRectZero; return bounds; } - (void)unregisterUniqueIdForUIElement:(id)element { WKUnregisterUniqueIdForElement(element); } - (NSString *)AXWebAreaText { return UI_STRING("HTML content", "accessibility role description for web area"); } - (NSString *)AXLinkText { return UI_STRING("link", "accessibility role description for link"); } - (NSString *)AXListMarkerText { return UI_STRING("list marker", "accessibility role description for list marker"); } - (NSString *)AXImageMapText { return UI_STRING("image map", "accessibility role description for image map"); } - (NSString *)AXHeadingText { return UI_STRING("heading", "accessibility role description for headings"); } - (NSString *)AXDefinitionListTermText { return UI_STRING("term", "term word of a definition"); } - (NSString *)AXDefinitionListDefinitionText { return UI_STRING("definition", "definition phrase"); } - (NSString *)AXARIAContentGroupText:(NSString *)ariaType { if ([ariaType isEqualToString:@"ARIAApplicationLog"]) return UI_STRING("log", "An ARIA accessibility group that acts as a console log."); if ([ariaType isEqualToString:@"ARIAApplicationMarquee"]) return UI_STRING("marquee", "An ARIA accessibility group that acts as a marquee."); if ([ariaType isEqualToString:@"ARIAApplicationStatus"]) return UI_STRING("application status", "An ARIA accessibility group that acts as a status update."); if ([ariaType isEqualToString:@"ARIAApplicationTimer"]) return UI_STRING("timer", "An ARIA accessibility group that acts as an updating timer."); if ([ariaType isEqualToString:@"ARIADocument"]) return UI_STRING("document", "An ARIA accessibility group that acts as a document."); if ([ariaType isEqualToString:@"ARIADocumentArticle"]) return UI_STRING("article", "An ARIA accessibility group that acts as an article."); if ([ariaType isEqualToString:@"ARIADocumentNote"]) return UI_STRING("note", "An ARIA accessibility group that acts as a note in a document."); if ([ariaType isEqualToString:@"ARIADocumentRegion"]) return UI_STRING("region", "An ARIA accessibility group that acts as a distinct region in a document."); if ([ariaType isEqualToString:@"ARIALandmarkApplication"]) return UI_STRING("application", "An ARIA accessibility group that acts as an application."); if ([ariaType isEqualToString:@"ARIALandmarkBanner"]) return UI_STRING("banner", "An ARIA accessibility group that acts as a banner."); if ([ariaType isEqualToString:@"ARIALandmarkComplementary"]) return UI_STRING("complementary", "An ARIA accessibility group that acts as a region of complementary information."); if ([ariaType isEqualToString:@"ARIALandmarkContentInfo"]) return UI_STRING("content", "An ARIA accessibility group that contains content."); if ([ariaType isEqualToString:@"ARIALandmarkMain"]) return UI_STRING("main", "An ARIA accessibility group that is the main portion of the website."); if ([ariaType isEqualToString:@"ARIALandmarkNavigation"]) return UI_STRING("navigation", "An ARIA accessibility group that contains the main navigation elements of a website."); if ([ariaType isEqualToString:@"ARIALandmarkSearch"]) return UI_STRING("search", "An ARIA accessibility group that contains a search feature of a website."); if ([ariaType isEqualToString:@"ARIAUserInterfaceTooltip"]) return UI_STRING("tooltip", "An ARIA accessibility group that acts as a tooltip."); return nil; } - (NSString *)AXButtonActionVerb { return UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility"); } - (NSString *)AXRadioButtonActionVerb { return UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility"); } - (NSString *)AXTextFieldActionVerb { return UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility"); } - (NSString *)AXCheckedCheckBoxActionVerb { return UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility"); } - (NSString *)AXUncheckedCheckBoxActionVerb { return UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility"); } - (NSString *)AXLinkActionVerb { return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility"); } - (NSString *)multipleFileUploadTextForNumberOfFiles:(unsigned)numberOfFiles { return [NSString stringWithFormat:UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles]; } - (NSString *)unknownFileSizeText { return UI_STRING("Unknown", "Unknown filesize FTP directory listing item"); } - (NSString*)imageTitleForFilename:(NSString*)filename width:(int)width height:(int)height { return [NSString stringWithFormat:UI_STRING("%@ %d×%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filename, width, height]; } - (NSString*)mediaElementLoadingStateText { return UI_STRING("Loading...", "Media controller status message when the media is loading"); } - (NSString*)mediaElementLiveBroadcastStateText { return UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast"); } - (NSString*)localizedMediaControlElementString:(NSString*)name { if ([name isEqualToString:@"AudioElement"]) return UI_STRING("audio element controller", "accessibility role description for audio element controller"); if ([name isEqualToString:@"VideoElement"]) return UI_STRING("video element controller", "accessibility role description for video element controller"); if ([name isEqualToString:@"MuteButton"]) return UI_STRING("mute", "accessibility role description for mute button"); if ([name isEqualToString:@"UnMuteButton"]) return UI_STRING("unmute", "accessibility role description for turn mute off button"); if ([name isEqualToString:@"PlayButton"]) return UI_STRING("play", "accessibility role description for play button"); if ([name isEqualToString:@"PauseButton"]) return UI_STRING("pause", "accessibility role description for pause button"); if ([name isEqualToString:@"Slider"]) return UI_STRING("movie time", "accessibility role description for timeline slider"); if ([name isEqualToString:@"SliderThumb"]) return UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb"); if ([name isEqualToString:@"RewindButton"]) return UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button"); if ([name isEqualToString:@"ReturnToRealtimeButton"]) return UI_STRING("return to realtime", "accessibility role description for return to real time button"); if ([name isEqualToString:@"CurrentTimeDisplay"]) return UI_STRING("elapsed time", "accessibility role description for elapsed time display"); if ([name isEqualToString:@"TimeRemainingDisplay"]) return UI_STRING("remaining time", "accessibility role description for time remaining display"); if ([name isEqualToString:@"StatusDisplay"]) return UI_STRING("status", "accessibility role description for movie status"); if ([name isEqualToString:@"FullscreenButton"]) return UI_STRING("fullscreen", "accessibility role description for enter fullscreen button"); if ([name isEqualToString:@"SeekForwardButton"]) return UI_STRING("fast forward", "accessibility role description for fast forward button"); if ([name isEqualToString:@"SeekBackButton"]) return UI_STRING("fast reverse", "accessibility role description for fast reverse button"); ASSERT_NOT_REACHED(); return @""; } - (NSString*)localizedMediaControlElementHelpText:(NSString*)name { if ([name isEqualToString:@"AudioElement"]) return UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller"); if ([name isEqualToString:@"VideoElement"]) return UI_STRING("video element playback controls and status display", "accessibility role description for video element controller"); if ([name isEqualToString:@"MuteButton"]) return UI_STRING("mute audio tracks", "accessibility help text for mute button"); if ([name isEqualToString:@"UnMuteButton"]) return UI_STRING("unmute audio tracks", "accessibility help text for un mute button"); if ([name isEqualToString:@"PlayButton"]) return UI_STRING("begin playback", "accessibility help text for play button"); if ([name isEqualToString:@"PauseButton"]) return UI_STRING("pause playback", "accessibility help text for pause button"); if ([name isEqualToString:@"Slider"]) return UI_STRING("movie time scrubber", "accessibility help text for timeline slider"); if ([name isEqualToString:@"SliderThumb"]) return UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb"); if ([name isEqualToString:@"RewindButton"]) return UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button"); if ([name isEqualToString:@"ReturnToRealtimeButton"]) return UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button"); if ([name isEqualToString:@"CurrentTimeDisplay"]) return UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display"); if ([name isEqualToString:@"TimeRemainingDisplay"]) return UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display"); if ([name isEqualToString:@"StatusDisplay"]) return UI_STRING("current movie status", "accessibility help text for movie status display"); if ([name isEqualToString:@"SeekBackButton"]) return UI_STRING("seek quickly back", "accessibility help text for fast rewind button"); if ([name isEqualToString:@"SeekForwardButton"]) return UI_STRING("seek quickly forward", "accessibility help text for fast forward button"); if ([name isEqualToString:@"FullscreenButton"]) return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button"); ASSERT_NOT_REACHED(); return @""; } - (NSString*)localizedMediaTimeDescription:(float)time { if (!isfinite(time)) return UI_STRING("indefinite time", "string for an indefinite movie time"); int seconds = (int)fabsf(time); int days = seconds / (60 * 60 * 24); int hours = seconds / (60 * 60); int minutes = (seconds / 60) % 60; seconds %= 60; if (days) return [NSString stringWithFormat:UI_STRING("date.format.for.days", "string for days, hours, minutes & seconds"), days, hours, minutes, seconds]; else if (hours) return [NSString stringWithFormat:UI_STRING("date.format.for.hours", "string for hours, minutes & seconds"), hours, minutes, seconds]; else if (minutes) return [NSString stringWithFormat:UI_STRING("date.format.for.minutes", "string for minutes & seconds"), minutes, seconds]; return [NSString stringWithFormat:UI_STRING("date.format.for.seconds", "string for seconds"), seconds]; } @end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebContextMenuClient.mm���������������������������������������������������0000644�0001750�0001750�00000041110�11222027651�020416� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebContextMenuClient.h" #import "WebDelegateImplementationCaching.h" #import "WebElementDictionary.h" #import "WebFrame.h" #import "WebFrameInternal.h" #import "WebHTMLView.h" #import "WebHTMLViewInternal.h" #import "WebKitVersionChecks.h" #import "WebNSPasteboardExtras.h" #import "WebUIDelegate.h" #import "WebUIDelegatePrivate.h" #import "WebView.h" #import "WebViewFactory.h" #import "WebViewInternal.h" #import <WebCore/ContextMenu.h> #import <WebCore/KURL.h> #import <WebCore/RuntimeApplicationChecks.h> #import <WebKit/DOMPrivate.h> using namespace WebCore; @interface NSApplication (AppKitSecretsIKnowAbout) - (void)speakString:(NSString *)string; @end WebContextMenuClient::WebContextMenuClient(WebView *webView) : m_webView(webView) { } void WebContextMenuClient::contextMenuDestroyed() { delete this; } static BOOL isPreVersion3Client(void) { static BOOL preVersion3Client = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_3_0_CONTEXT_MENU_TAGS); return preVersion3Client; } static BOOL isPreInspectElementTagClient(void) { static BOOL preInspectElementTagClient = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_INSPECT_ELEMENT_MENU_TAG); return preInspectElementTagClient; } static NSMutableArray *fixMenusToSendToOldClients(NSMutableArray *defaultMenuItems) { NSMutableArray *savedItems = nil; unsigned defaultItemsCount = [defaultMenuItems count]; if (isPreInspectElementTagClient() && defaultItemsCount >= 2) { NSMenuItem *secondToLastItem = [defaultMenuItems objectAtIndex:defaultItemsCount - 2]; NSMenuItem *lastItem = [defaultMenuItems objectAtIndex:defaultItemsCount - 1]; if ([secondToLastItem isSeparatorItem] && [lastItem tag] == WebMenuItemTagInspectElement) { savedItems = [NSMutableArray arrayWithCapacity:2]; [savedItems addObject:secondToLastItem]; [savedItems addObject:lastItem]; [defaultMenuItems removeObject:secondToLastItem]; [defaultMenuItems removeObject:lastItem]; defaultItemsCount -= 2; } } BOOL preVersion3Client = isPreVersion3Client(); if (!preVersion3Client) return savedItems; BOOL isMail = applicationIsAppleMail(); for (unsigned i = 0; i < defaultItemsCount; ++i) { NSMenuItem *item = [defaultMenuItems objectAtIndex:i]; int tag = [item tag]; int oldStyleTag = tag; if (preVersion3Client && isMail && tag == WebMenuItemTagOpenLink) { // Tiger Mail changes our "Open Link in New Window" item to "Open Link" // and doesn't expect us to include an "Open Link" item at all. (5011905) [defaultMenuItems removeObjectAtIndex:i]; i--; defaultItemsCount--; continue; } if (tag >= WEBMENUITEMTAG_WEBKIT_3_0_SPI_START) { // Change all editing-related SPI tags listed in WebUIDelegatePrivate.h to WebMenuItemTagOther // to match our old WebKit context menu behavior. oldStyleTag = WebMenuItemTagOther; } else { // All items are expected to have useful tags coming into this method. ASSERT(tag != WebMenuItemTagOther); // Use the pre-3.0 tags for the few items that changed tags as they moved from SPI to API. We // do this only for old clients; new Mail already expects the new symbols in this case. if (preVersion3Client) { switch (tag) { case WebMenuItemTagSearchInSpotlight: oldStyleTag = OldWebMenuItemTagSearchInSpotlight; break; case WebMenuItemTagSearchWeb: oldStyleTag = OldWebMenuItemTagSearchWeb; break; case WebMenuItemTagLookUpInDictionary: oldStyleTag = OldWebMenuItemTagLookUpInDictionary; break; default: break; } } } if (oldStyleTag != tag) [item setTag:oldStyleTag]; } return savedItems; } static void fixMenusReceivedFromOldClients(NSMutableArray *newMenuItems, NSMutableArray *savedItems) { if (savedItems) [newMenuItems addObjectsFromArray:savedItems]; BOOL preVersion3Client = isPreVersion3Client(); if (!preVersion3Client) return; // Restore the modern tags to the menu items whose tags we altered in fixMenusToSendToOldClients. unsigned newItemsCount = [newMenuItems count]; for (unsigned i = 0; i < newItemsCount; ++i) { NSMenuItem *item = [newMenuItems objectAtIndex:i]; int tag = [item tag]; int modernTag = tag; if (tag == WebMenuItemTagOther) { // Restore the specific tag for items on which we temporarily set WebMenuItemTagOther to match old behavior. NSString *title = [item title]; if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagOpenLink]]) modernTag = WebMenuItemTagOpenLink; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagIgnoreGrammar]]) modernTag = WebMenuItemTagIgnoreGrammar; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSpellingMenu]]) modernTag = WebMenuItemTagSpellingMenu; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:true]] || [title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:false]]) modernTag = WebMenuItemTagShowSpellingPanel; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCheckSpelling]]) modernTag = WebMenuItemTagCheckSpelling; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCheckSpellingWhileTyping]]) modernTag = WebMenuItemTagCheckSpellingWhileTyping; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCheckGrammarWithSpelling]]) modernTag = WebMenuItemTagCheckGrammarWithSpelling; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagFontMenu]]) modernTag = WebMenuItemTagFontMenu; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowFonts]]) modernTag = WebMenuItemTagShowFonts; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagBold]]) modernTag = WebMenuItemTagBold; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagItalic]]) modernTag = WebMenuItemTagItalic; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagUnderline]]) modernTag = WebMenuItemTagUnderline; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagOutline]]) modernTag = WebMenuItemTagOutline; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagStyles]]) modernTag = WebMenuItemTagStyles; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowColors]]) modernTag = WebMenuItemTagShowColors; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSpeechMenu]]) modernTag = WebMenuItemTagSpeechMenu; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagStartSpeaking]]) modernTag = WebMenuItemTagStartSpeaking; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagStopSpeaking]]) modernTag = WebMenuItemTagStopSpeaking; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagWritingDirectionMenu]]) modernTag = WebMenuItemTagWritingDirectionMenu; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagDefaultDirection]]) modernTag = WebMenuItemTagDefaultDirection; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagLeftToRight]]) modernTag = WebMenuItemTagLeftToRight; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagRightToLeft]]) modernTag = WebMenuItemTagRightToLeft; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCorrectSpellingAutomatically]]) modernTag = WebMenuItemTagCorrectSpellingAutomatically; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSubstitutionsMenu]]) modernTag = WebMenuItemTagSubstitutionsMenu; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSubstitutions:true]] || [title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSubstitutions:false]]) modernTag = WebMenuItemTagShowSubstitutions; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartCopyPaste]]) modernTag = WebMenuItemTagSmartCopyPaste; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartQuotes]]) modernTag = WebMenuItemTagSmartQuotes; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartDashes]]) modernTag = WebMenuItemTagSmartDashes; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartLinks]]) modernTag = WebMenuItemTagSmartLinks; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagTextReplacement]]) modernTag = WebMenuItemTagTextReplacement; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagTransformationsMenu]]) modernTag = WebMenuItemTagTransformationsMenu; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagMakeUpperCase]]) modernTag = WebMenuItemTagMakeUpperCase; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagMakeLowerCase]]) modernTag = WebMenuItemTagMakeLowerCase; else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCapitalize]]) modernTag = WebMenuItemTagCapitalize; else { // We don't expect WebMenuItemTagOther for any items other than the ones we explicitly handle. // There's nothing to prevent an app from applying this tag, but they are supposed to only // use tags in the range starting with WebMenuItemBaseApplicationTag=10000 ASSERT_NOT_REACHED(); } } else if (preVersion3Client) { // Restore the new API tag for items on which we temporarily set the old SPI tag. The old SPI tag was // needed to avoid confusing clients linked against earlier WebKits; the new API tag is needed for // WebCore to handle the menu items appropriately (without needing to know about the old SPI tags). switch (tag) { case OldWebMenuItemTagSearchInSpotlight: modernTag = WebMenuItemTagSearchInSpotlight; break; case OldWebMenuItemTagSearchWeb: modernTag = WebMenuItemTagSearchWeb; break; case OldWebMenuItemTagLookUpInDictionary: modernTag = WebMenuItemTagLookUpInDictionary; break; default: break; } } if (modernTag != tag) [item setTag:modernTag]; } } NSMutableArray* WebContextMenuClient::getCustomMenuFromDefaultItems(ContextMenu* defaultMenu) { id delegate = [m_webView UIDelegate]; SEL selector = @selector(webView:contextMenuItemsForElement:defaultMenuItems:); if (![delegate respondsToSelector:selector]) return defaultMenu->platformDescription(); NSDictionary *element = [[[WebElementDictionary alloc] initWithHitTestResult:defaultMenu->hitTestResult()] autorelease]; BOOL preVersion3Client = isPreVersion3Client(); if (preVersion3Client) { DOMNode *node = [element objectForKey:WebElementDOMNodeKey]; if ([node isKindOfClass:[DOMHTMLInputElement class]] && [(DOMHTMLInputElement *)node _isTextField]) return defaultMenu->platformDescription(); if ([node isKindOfClass:[DOMHTMLTextAreaElement class]]) return defaultMenu->platformDescription(); } NSMutableArray *defaultMenuItems = defaultMenu->platformDescription(); unsigned defaultItemsCount = [defaultMenuItems count]; for (unsigned i = 0; i < defaultItemsCount; ++i) [[defaultMenuItems objectAtIndex:i] setRepresentedObject:element]; NSMutableArray *savedItems = [fixMenusToSendToOldClients(defaultMenuItems) retain]; NSArray *delegateSuppliedItems = CallUIDelegate(m_webView, selector, element, defaultMenuItems); NSMutableArray *newMenuItems = [delegateSuppliedItems mutableCopy]; fixMenusReceivedFromOldClients(newMenuItems, savedItems); [savedItems release]; return [newMenuItems autorelease]; } void WebContextMenuClient::contextMenuItemSelected(ContextMenuItem* item, const ContextMenu* parentMenu) { id delegate = [m_webView UIDelegate]; SEL selector = @selector(webView:contextMenuItemSelected:forElement:); if ([delegate respondsToSelector:selector]) { NSDictionary *element = [[WebElementDictionary alloc] initWithHitTestResult:parentMenu->hitTestResult()]; NSMenuItem *platformItem = item->releasePlatformDescription(); CallUIDelegate(m_webView, selector, platformItem, element); [element release]; [platformItem release]; } } void WebContextMenuClient::downloadURL(const KURL& url) { [m_webView _downloadURL:url]; } void WebContextMenuClient::searchWithSpotlight() { [m_webView _searchWithSpotlightFromMenu:nil]; } void WebContextMenuClient::searchWithGoogle(const Frame*) { [m_webView _searchWithGoogleFromMenu:nil]; } void WebContextMenuClient::lookUpInDictionary(Frame* frame) { WebHTMLView* htmlView = (WebHTMLView*)[[kit(frame) frameView] documentView]; if(![htmlView isKindOfClass:[WebHTMLView class]]) return; [htmlView _lookUpInDictionaryFromMenu:nil]; } bool WebContextMenuClient::isSpeaking() { return [NSApp isSpeaking]; } void WebContextMenuClient::speak(const String& string) { [NSApp speakString:[[(NSString*)string copy] autorelease]]; } void WebContextMenuClient::stopSpeaking() { [NSApp stopSpeaking:nil]; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm��������������������������������������������������0000644�0001750�0001750�00000004761�11226027074�020500� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebIconDatabaseClient.h" #import "WebIconDatabaseInternal.h" #import <WebCore/PlatformString.h> #if ENABLE(ICONDATABASE) bool WebIconDatabaseClient::performImport() { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; bool result = importToWebCoreFormat(); [pool drain]; return result; } void WebIconDatabaseClient::dispatchDidRemoveAllIcons() { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [[WebIconDatabase sharedIconDatabase] _sendDidRemoveAllIconsNotification]; [pool drain]; } void WebIconDatabaseClient::dispatchDidAddIconForPageURL(const WebCore::String& pageURL) { // This is a quick notification that is likely to fire in a rapidly iterating loop // Therefore we let WebCore handle autorelease by draining its pool "from time to time" // instead of us doing it every iteration [[WebIconDatabase sharedIconDatabase] _sendNotificationForURL:pageURL]; } #endif // ENABLE(ICONDATABASE) ���������������WebKit/mac/WebCoreSupport/WebKeyGenerator.h���������������������������������������������������������0000644�0001750�0001750�00000003761�10360512352�017234� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ typedef enum { WebCertificateParseResultSucceeded = 0, WebCertificateParseResultFailed = 1, WebCertificateParseResultPKCS7 = 2, } WebCertificateParseResult; #ifdef __OBJC__ #import <WebCore/WebCoreKeyGenerator.h> @interface WebKeyGenerator : WebCoreKeyGenerator { NSArray *strengthMenuItemTitles; } + (void)createSharedGenerator; - (WebCertificateParseResult)addCertificatesToKeychainFromData:(NSData *)data; @end #endif ���������������WebKit/mac/WebCoreSupport/WebInspectorClient.h������������������������������������������������������0000644�0001750�0001750�00000005554�11234144465�017753� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebCore/InspectorClient.h> #import <WebCore/PlatformString.h> #import <wtf/RetainPtr.h> #ifdef __OBJC__ @class WebInspectorWindowController; @class WebView; #else class WebInspectorWindowController; class WebView; #endif class WebInspectorClient : public WebCore::InspectorClient { public: WebInspectorClient(WebView *); virtual void inspectorDestroyed(); virtual WebCore::Page* createPage(); virtual WebCore::String localizedStringsURL(); virtual WebCore::String hiddenPanels(); virtual void showWindow(); virtual void closeWindow(); virtual void attachWindow(); virtual void detachWindow(); virtual void setAttachedWindowHeight(unsigned height); virtual void highlight(WebCore::Node*); virtual void hideHighlight(); virtual void inspectedURLChanged(const WebCore::String& newURL); virtual void populateSetting(const WebCore::String& key, WebCore::InspectorController::Setting&); virtual void storeSetting(const WebCore::String& key, const WebCore::InspectorController::Setting&); virtual void removeSetting(const WebCore::String& key); virtual void inspectorWindowObjectCleared(); private: void updateWindowTitle() const; WebView *m_webView; RetainPtr<WebInspectorWindowController> m_windowController; WebCore::String m_inspectedURL; }; ����������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebViewFactory.h����������������������������������������������������������0000644�0001750�0001750�00000003276�10360512352�017100� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebCore/WebCoreViewFactory.h> @interface WebViewFactory : WebCoreViewFactory <WebCoreViewFactory> + (void)createSharedFactory; @end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebKeyGenerator.m���������������������������������������������������������0000644�0001750�0001750�00000006563�11032666713�017254� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebKeyGenerator.h> #import <WebKit/WebLocalizableStrings.h> #import <WebKitSystemInterface.h> #import <wtf/Assertions.h> @implementation WebKeyGenerator + (void)createSharedGenerator { if (![self sharedGenerator]) { [[[self alloc] init] release]; } ASSERT([[self sharedGenerator] isKindOfClass:self]); } - (void)dealloc { [strengthMenuItemTitles release]; [super dealloc]; } - (NSArray *)strengthMenuItemTitles { if (!strengthMenuItemTitles) { strengthMenuItemTitles = [[NSArray alloc] initWithObjects: UI_STRING("2048 (High Grade)", "Menu item title for KEYGEN pop-up menu"), UI_STRING("1024 (Medium Grade)", "Menu item title for KEYGEN pop-up menu"), UI_STRING("512 (Low Grade)", "Menu item title for KEYGEN pop-up menu"), nil]; } return strengthMenuItemTitles; } - (NSString *)signedPublicKeyAndChallengeStringWithStrengthIndex:(unsigned)index challenge:(NSString *)challenge pageURL:(NSURL *)pageURL { // This switch statement must always be synced with the UI strings returned by strengthMenuItemTitles. UInt32 keySize; switch (index) { case 0: keySize = 2048; break; case 1: keySize = 1024; break; case 2: keySize = 512; break; default: return nil; } NSString *keyDescription = [NSString stringWithFormat:UI_STRING("Key from %@", "name of keychain key generated by the KEYGEN tag"), [pageURL host]]; return [(NSString *)WKSignedPublicKeyAndChallengeString(keySize, (CFStringRef)challenge, (CFStringRef)keyDescription) autorelease]; } - (WebCertificateParseResult)addCertificatesToKeychainFromData:(NSData *)data { return WKAddCertificatesToKeychainFromData([data bytes], [data length]); } @end ���������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebImageRendererFactory.m�������������������������������������������������0000644�0001750�0001750�00000003751�10761765653�020725� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ // Have to leave this class with these two methods in because versions of Safari up to 3.0.4 // call the methods from the Debug menu. Once we don't need compatibility with those versions // of Safari, we can remove this. @interface WebImageRendererFactory : NSObject @end @implementation WebImageRendererFactory + (BOOL)shouldUseThreadedDecoding { return NO; } + (void)setShouldUseThreadedDecoding:(BOOL)threadedDecode { } @end �����������������������WebKit/mac/WebCoreSupport/WebSystemInterface.h������������������������������������������������������0000644�0001750�0001750�00000003225�10513311066�017734� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #ifdef __cplusplus extern "C" { #endif void InitWebCoreSystemInterface(void); #ifdef __cplusplus } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm����������������������������������������������������0000644�0001750�0001750�00000010020�11175631371�020235� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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 "WebPasteboardHelper.h" #import "WebArchive.h" #import "WebHTMLViewInternal.h" #import "WebNSPasteboardExtras.h" #import "WebNSURLExtras.h" #import <WebCore/PlatformString.h> #import <WebKit/DOMDocument.h> #import <WebKit/DOMDocumentFragment.h> #import <wtf/RetainPtr.h> #import <wtf/StdLibExtras.h> using namespace WebCore; String WebPasteboardHelper::urlFromPasteboard(const NSPasteboard* pasteboard, String* title) const { NSURL *URL = [pasteboard _web_bestURL]; if (title) { if (NSString *URLTitleString = [pasteboard stringForType:WebURLNamePboardType]) *title = URLTitleString; } return [URL _web_originalDataAsString]; } String WebPasteboardHelper::plainTextFromPasteboard(const NSPasteboard *pasteboard) const { NSArray *types = [pasteboard types]; if ([types containsObject:NSStringPboardType]) return [[pasteboard stringForType:NSStringPboardType] precomposedStringWithCanonicalMapping]; NSAttributedString *attributedString = nil; NSString *string; if ([types containsObject:NSRTFDPboardType]) attributedString = [[NSAttributedString alloc] initWithRTFD:[pasteboard dataForType:NSRTFDPboardType] documentAttributes:nil]; if (!attributedString && [types containsObject:NSRTFPboardType]) attributedString = [[NSAttributedString alloc] initWithRTF:[pasteboard dataForType:NSRTFPboardType] documentAttributes:nil]; if (attributedString) { string = [[attributedString string] precomposedStringWithCanonicalMapping]; [attributedString release]; return string; } if ([types containsObject:NSFilenamesPboardType]) { string = [[pasteboard propertyListForType:NSFilenamesPboardType] componentsJoinedByString:@"\n"]; if (string) return [string precomposedStringWithCanonicalMapping]; } NSURL *URL; if ((URL = [NSURL URLFromPasteboard:pasteboard])) { string = [URL _web_userVisibleString]; if ([string length] > 0) return string; } return String(); } DOMDocumentFragment *WebPasteboardHelper::fragmentFromPasteboard(const NSPasteboard *pasteboard) const { return [m_view _documentFragmentFromPasteboard:pasteboard]; } NSArray *WebPasteboardHelper::insertablePasteboardTypes() const { DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, types, ([[NSArray alloc] initWithObjects:WebArchivePboardType, NSHTMLPboardType, NSFilenamesPboardType, NSTIFFPboardType, NSPDFPboardType, #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) NSPICTPboardType, #endif NSURLPboardType, NSRTFDPboardType, NSRTFPboardType, NSStringPboardType, NSColorPboardType, nil])); return types.get(); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebContextMenuClient.h����������������������������������������������������0000644�0001750�0001750�00000004536�11222027651�020247� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebCore/ContextMenuClient.h> @class WebView; class WebContextMenuClient : public WebCore::ContextMenuClient { public: WebContextMenuClient(WebView *webView); virtual void contextMenuDestroyed(); virtual NSMutableArray* getCustomMenuFromDefaultItems(WebCore::ContextMenu*); virtual void contextMenuItemSelected(WebCore::ContextMenuItem*, const WebCore::ContextMenu*); virtual void downloadURL(const WebCore::KURL&); virtual void searchWithGoogle(const WebCore::Frame*); virtual void lookUpInDictionary(WebCore::Frame*); virtual bool isSpeaking(); virtual void speak(const WebCore::String&); virtual void stopSpeaking(); virtual void searchWithSpotlight(); WebView *webView() { return m_webView; } private: WebView *m_webView; }; ������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebSystemInterface.m������������������������������������������������������0000644�0001750�0001750�00000007356�11224462635�017763� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebSystemInterface.h" #import <WebCore/WebCoreSystemInterface.h> #import <WebKitSystemInterface.h> #define INIT(function) wk##function = WK##function void InitWebCoreSystemInterface(void) { static bool didInit; if (didInit) return; INIT(AdvanceDefaultButtonPulseAnimation); INIT(CGContextGetShouldSmoothFonts); INIT(CreateCustomCFReadStream); INIT(CreateNSURLConnectionDelegateProxy); INIT(DrawCapsLockIndicator); INIT(DrawBezeledTextArea); INIT(DrawBezeledTextFieldCell); INIT(DrawFocusRing); INIT(DrawMediaUIPart); INIT(DrawMediaSliderTrack); INIT(DrawTextFieldCellFocusRing); INIT(GetExtensionsForMIMEType); INIT(GetFontInLanguageForCharacter); INIT(GetFontInLanguageForRange); INIT(GetGlyphTransformedAdvances); INIT(GetMIMETypeForExtension); INIT(GetNSURLResponseLastModifiedDate); INIT(GetPreferredExtensionForMIMEType); INIT(GetWheelEventDeltas); INIT(HitTestMediaUIPart); INIT(InitializeMaximumHTTPConnectionCountPerHost); INIT(IsLatchingWheelEvent); INIT(MeasureMediaUIPart); INIT(PopupMenu); INIT(SetCGFontRenderingMode); INIT(SetDragImage); INIT(SetNSURLConnectionDefersCallbacks); INIT(SetNSURLRequestShouldContentSniff); INIT(SetPatternBaseCTM); INIT(SetPatternPhaseInUserSpace); INIT(SetUpFontCache); INIT(SignalCFReadStreamEnd); INIT(SignalCFReadStreamError); INIT(SignalCFReadStreamHasBytes); INIT(QTIncludeOnlyModernMediaFileTypes); INIT(QTMovieDataRate); INIT(QTMovieMaxTimeLoaded); INIT(QTMovieMaxTimeLoadedChangeNotification); INIT(QTMovieMaxTimeSeekable); INIT(QTMovieGetType); INIT(QTMovieViewSetDrawSynchronously); #ifndef BUILDING_ON_TIGER INIT(GetGlyphsForCharacters); #else INIT(ClearGlyphVector); INIT(ConvertCharToGlyphs); INIT(CopyFullFontName); INIT(GetATSStyleGroup); INIT(GetCGFontFromNSFont); INIT(GetFontMetrics); INIT(GetGlyphVectorFirstRecord); INIT(GetGlyphVectorNumGlyphs); INIT(GetGlyphVectorRecordSize); INIT(GetNSFontATSUFontId); INIT(InitializeGlyphVector); INIT(ReleaseStyleGroup); INIT(SupportsMultipartXMixedReplace); #endif didInit = true; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebJavaScriptTextInputPanel.m���������������������������������������������0000644�0001750�0001750�00000004663�11032666713�021567� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebJavaScriptTextInputPanel.h" #import <wtf/Assertions.h> #import <WebKit/WebNSControlExtras.h> #import <WebKit/WebNSWindowExtras.h> @implementation WebJavaScriptTextInputPanel - (id)initWithPrompt:(NSString *)p text:(NSString *)t { [self initWithWindowNibName:@"WebJavaScriptTextInputPanel"]; NSWindow *window = [self window]; // This must be done after the call to [self window], because // until then, prompt and textInput will be nil. ASSERT(prompt); ASSERT(textInput); [prompt setStringValue:p]; [textInput setStringValue:t]; [prompt sizeToFitAndAdjustWindowHeight]; [window centerOverMainWindow]; return self; } - (NSString *)text { return [textInput stringValue]; } - (IBAction)pressedCancel:(id)sender { [NSApp stopModalWithCode:NO]; } - (IBAction)pressedOK:(id)sender { [NSApp stopModalWithCode:YES]; } @end �����������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebIconDatabaseClient.h���������������������������������������������������0000644�0001750�0001750�00000003541�10744307516�020317� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebCore/IconDatabaseClient.h> namespace WebCore { class String; } class WebIconDatabaseClient : public WebCore::IconDatabaseClient { public: virtual bool performImport(); virtual void dispatchDidRemoveAllIcons(); virtual void dispatchDidAddIconForPageURL(const WebCore::String& pageURL); }; ���������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebGeolocation.mm���������������������������������������������������������0000644�0001750�0001750�00000004100�11156526152�017255� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 "WebGeolocationInternal.h" #import <WebCore/Geolocation.h> using namespace WebCore; @implementation WebGeolocation (WebInternal) - (id)_initWithWebCoreGeolocation:(WebCoreGeolocation *)geolocation { ASSERT(geolocation); self = [super init]; if (self) { geolocation->ref(); _private = reinterpret_cast<WebGeolocationPrivate*>(geolocation); } return self; } @end @implementation WebGeolocation - (BOOL)shouldClearCache { return reinterpret_cast<Geolocation*>(_private)->shouldClearCache(); } - (void)setIsAllowed:(BOOL)allowed { reinterpret_cast<Geolocation*>(_private)->setIsAllowed(allowed); } - (void)dealloc { if (_private) reinterpret_cast<Geolocation*>(_private)->deref(); [super dealloc]; } @end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebPasteboardHelper.h�����������������������������������������������������0000644�0001750�0001750�00000003665�10744307516�020076� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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 WebPasteboardHelper_h #define WebPasteboardHelper_h #import <WebCore/PasteboardHelper.h> @class WebHTMLView; class WebPasteboardHelper : public WebCore::PasteboardHelper { public: WebPasteboardHelper(WebHTMLView* view) : m_view(view) {} virtual WebCore::String urlFromPasteboard(const NSPasteboard*, WebCore::String* title) const; virtual WebCore::String plainTextFromPasteboard(const NSPasteboard*) const; virtual DOMDocumentFragment* fragmentFromPasteboard(const NSPasteboard*) const; virtual NSArray* insertablePasteboardTypes() const; private: WebHTMLView* m_view; }; #endif ���������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebInspectorClient.mm�����������������������������������������������������0000644�0001750�0001750�00000035770�11234144465�020140� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebInspectorClient.h" #import "DOMNodeInternal.h" #import "WebDelegateImplementationCaching.h" #import "WebFrameInternal.h" #import "WebFrameView.h" #import "WebInspector.h" #import "WebLocalizableStrings.h" #import "WebNodeHighlight.h" #import "WebUIDelegate.h" #import "WebViewInternal.h" #import <WebCore/InspectorController.h> #import <WebCore/Page.h> #import <WebKit/DOMExtensions.h> #import <WebKitSystemInterface.h> using namespace WebCore; static const char* const inspectorStartsAttachedName = "inspectorStartsAttached"; @interface WebInspectorWindowController : NSWindowController <NSWindowDelegate> { @private WebView *_inspectedWebView; WebView *_webView; WebNodeHighlight *_currentHighlight; BOOL _attachedToInspectedWebView; BOOL _shouldAttach; BOOL _visible; BOOL _movingWindows; } - (id)initWithInspectedWebView:(WebView *)webView; - (BOOL)inspectorVisible; - (WebView *)webView; - (void)attach; - (void)detach; - (void)setAttachedWindowHeight:(unsigned)height; - (void)highlightNode:(DOMNode *)node; - (void)hideHighlight; @end #pragma mark - WebInspectorClient::WebInspectorClient(WebView *webView) : m_webView(webView) { } void WebInspectorClient::inspectorDestroyed() { [[m_windowController.get() webView] close]; delete this; } Page* WebInspectorClient::createPage() { if (!m_windowController) m_windowController.adoptNS([[WebInspectorWindowController alloc] initWithInspectedWebView:m_webView]); return core([m_windowController.get() webView]); } String WebInspectorClient::localizedStringsURL() { NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] pathForResource:@"localizedStrings" ofType:@"js"]; if (path) return [[NSURL fileURLWithPath:path] absoluteString]; return String(); } String WebInspectorClient::hiddenPanels() { NSString *hiddenPanels = [[NSUserDefaults standardUserDefaults] stringForKey:@"WebKitInspectorHiddenPanels"]; if (hiddenPanels) return hiddenPanels; return String(); } void WebInspectorClient::showWindow() { updateWindowTitle(); [m_windowController.get() showWindow:nil]; } void WebInspectorClient::closeWindow() { [m_windowController.get() close]; } void WebInspectorClient::attachWindow() { [m_windowController.get() attach]; } void WebInspectorClient::detachWindow() { [m_windowController.get() detach]; } void WebInspectorClient::setAttachedWindowHeight(unsigned height) { [m_windowController.get() setAttachedWindowHeight:height]; } void WebInspectorClient::highlight(Node* node) { [m_windowController.get() highlightNode:kit(node)]; } void WebInspectorClient::hideHighlight() { [m_windowController.get() hideHighlight]; } void WebInspectorClient::inspectedURLChanged(const String& newURL) { m_inspectedURL = newURL; updateWindowTitle(); } void WebInspectorClient::updateWindowTitle() const { NSString *title = [NSString stringWithFormat:UI_STRING("Web Inspector — %@", "Web Inspector window title"), (NSString *)m_inspectedURL]; [[m_windowController.get() window] setTitle:title]; } void WebInspectorClient::inspectorWindowObjectCleared() { WebFrame *frame = [m_webView mainFrame]; WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(m_webView); if (implementations->didClearInspectorWindowObjectForFrameFunc) CallFrameLoadDelegate(implementations->didClearInspectorWindowObjectForFrameFunc, m_webView, @selector(webView:didClearInspectorWindowObject:forFrame:), [frame windowObject], frame); } #pragma mark - @implementation WebInspectorWindowController - (id)init { if (![super initWithWindow:nil]) return nil; // Keep preferences separate from the rest of the client, making sure we are using expected preference values. // One reason this is good is that it keeps the inspector out of history via "private browsing". WebPreferences *preferences = [[WebPreferences alloc] init]; [preferences setAutosaves:NO]; [preferences setPrivateBrowsingEnabled:YES]; [preferences setLoadsImagesAutomatically:YES]; [preferences setAuthorAndUserStylesEnabled:YES]; [preferences setJavaScriptEnabled:YES]; [preferences setAllowsAnimatedImages:YES]; [preferences setPlugInsEnabled:NO]; [preferences setJavaEnabled:NO]; [preferences setUserStyleSheetEnabled:NO]; [preferences setTabsToLinks:NO]; [preferences setMinimumFontSize:0]; [preferences setMinimumLogicalFontSize:9]; #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) [preferences setFixedFontFamily:@"Menlo"]; [preferences setDefaultFixedFontSize:11]; #else [preferences setFixedFontFamily:@"Monaco"]; [preferences setDefaultFixedFontSize:10]; #endif _webView = [[WebView alloc] init]; [_webView setPreferences:preferences]; [_webView setDrawsBackground:NO]; [_webView setProhibitsMainFrameScrolling:YES]; [_webView setUIDelegate:self]; [preferences release]; NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] pathForResource:@"inspector" ofType:@"html" inDirectory:@"inspector"]; NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL fileURLWithPath:path]]; [[_webView mainFrame] loadRequest:request]; [request release]; [self setWindowFrameAutosaveName:@"Web Inspector 2"]; return self; } - (id)initWithInspectedWebView:(WebView *)webView { if (![self init]) return nil; // Don't retain to avoid a circular reference _inspectedWebView = webView; return self; } - (void)dealloc { ASSERT(!_currentHighlight); [_webView release]; [super dealloc]; } #pragma mark - - (BOOL)inspectorVisible { return _visible; } - (WebView *)webView { return _webView; } - (NSWindow *)window { NSWindow *window = [super window]; if (window) return window; NSUInteger styleMask = (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask); #ifndef BUILDING_ON_TIGER styleMask |= NSTexturedBackgroundWindowMask; #endif window = [[NSWindow alloc] initWithContentRect:NSMakeRect(60.0, 200.0, 750.0, 650.0) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO]; [window setDelegate:self]; [window setMinSize:NSMakeSize(400.0, 400.0)]; #ifndef BUILDING_ON_TIGER [window setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge]; [window setContentBorderThickness:55. forEdge:NSMaxYEdge]; WKNSWindowMakeBottomCornersSquare(window); #endif [self setWindow:window]; [window release]; return window; } #pragma mark - - (BOOL)windowShouldClose:(id)sender { _visible = NO; [_inspectedWebView page]->inspectorController()->setWindowVisible(false); [self hideHighlight]; return YES; } - (void)close { if (!_visible) return; _visible = NO; if (!_movingWindows) [_inspectedWebView page]->inspectorController()->setWindowVisible(false); [self hideHighlight]; if (_attachedToInspectedWebView) { if ([_inspectedWebView _isClosed]) return; [_webView removeFromSuperview]; WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView]; NSRect frameViewRect = [frameView frame]; // Setting the height based on the previous height is done to work with // Safari's find banner. This assumes the previous height is the Y origin. frameViewRect.size.height += NSMinY(frameViewRect); frameViewRect.origin.y = 0.0; [frameView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; [frameView setFrame:frameViewRect]; [_inspectedWebView displayIfNeeded]; } else [super close]; } - (IBAction)showWindow:(id)sender { if (_visible) { if (!_attachedToInspectedWebView) [super showWindow:sender]; // call super so the window will be ordered front if needed return; } _visible = YES; // If no preference is set - default to an attached window InspectorController::Setting shouldAttach = [_inspectedWebView page]->inspectorController()->setting(inspectorStartsAttachedName); _shouldAttach = (shouldAttach.type() == InspectorController::Setting::BooleanType) ? shouldAttach.booleanValue() : true; if (_shouldAttach) { WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView]; [_webView removeFromSuperview]; [_inspectedWebView addSubview:_webView positioned:NSWindowBelow relativeTo:(NSView *)frameView]; [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable | NSViewMaxYMargin)]; [frameView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable | NSViewMinYMargin)]; _attachedToInspectedWebView = YES; } else { _attachedToInspectedWebView = NO; NSView *contentView = [[self window] contentView]; [_webView setFrame:[contentView frame]]; [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; [_webView removeFromSuperview]; [contentView addSubview:_webView]; [super showWindow:nil]; } [_inspectedWebView page]->inspectorController()->setWindowVisible(true, _shouldAttach); } #pragma mark - - (void)attach { if (_attachedToInspectedWebView) return; [_inspectedWebView page]->inspectorController()->setSetting(inspectorStartsAttachedName, InspectorController::Setting(true)); _movingWindows = YES; [self close]; [self showWindow:nil]; _movingWindows = NO; } - (void)detach { if (!_attachedToInspectedWebView) return; [_inspectedWebView page]->inspectorController()->setSetting(inspectorStartsAttachedName, InspectorController::Setting(false)); _movingWindows = YES; [self close]; [self showWindow:nil]; _movingWindows = NO; } - (void)setAttachedWindowHeight:(unsigned)height { if (!_attachedToInspectedWebView) return; WebFrameView *frameView = [[_inspectedWebView mainFrame] frameView]; NSRect frameViewRect = [frameView frame]; // Setting the height based on the difference is done to work with // Safari's find banner. This assumes the previous height is the Y origin. CGFloat heightDifference = (NSMinY(frameViewRect) - height); frameViewRect.size.height += heightDifference; frameViewRect.origin.y = height; [_webView setFrame:NSMakeRect(0.0, 0.0, NSWidth(frameViewRect), height)]; [frameView setFrame:frameViewRect]; } #pragma mark - - (void)highlightNode:(DOMNode *)node { // The scrollview's content view stays around between page navigations, so target it NSView *view = [[[[[_inspectedWebView mainFrame] frameView] documentView] enclosingScrollView] contentView]; if (![view window]) return; // skip the highlight if we have no window (e.g. hidden tab) if (!_currentHighlight) { _currentHighlight = [[WebNodeHighlight alloc] initWithTargetView:view inspectorController:[_inspectedWebView page]->inspectorController()]; [_currentHighlight setDelegate:self]; [_currentHighlight attach]; } else [[_currentHighlight highlightView] setNeedsDisplay:YES]; } - (void)hideHighlight { [_currentHighlight detach]; [_currentHighlight setDelegate:nil]; [_currentHighlight release]; _currentHighlight = nil; } #pragma mark - #pragma mark WebNodeHighlight delegate - (void)didAttachWebNodeHighlight:(WebNodeHighlight *)highlight { [_inspectedWebView setCurrentNodeHighlight:highlight]; } - (void)willDetachWebNodeHighlight:(WebNodeHighlight *)highlight { [_inspectedWebView setCurrentNodeHighlight:nil]; } #pragma mark - #pragma mark UI delegate - (NSUInteger)webView:(WebView *)sender dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo { return WebDragDestinationActionNone; } #pragma mark - // These methods can be used by UI elements such as menu items and toolbar buttons when the inspector is the key window. // This method is really only implemented to keep any UI elements enabled. - (void)showWebInspector:(id)sender { [[_inspectedWebView inspector] show:sender]; } - (void)showErrorConsole:(id)sender { [[_inspectedWebView inspector] showConsole:sender]; } - (void)toggleDebuggingJavaScript:(id)sender { [[_inspectedWebView inspector] toggleDebuggingJavaScript:sender]; } - (void)toggleProfilingJavaScript:(id)sender { [[_inspectedWebView inspector] toggleProfilingJavaScript:sender]; } - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item { BOOL isMenuItem = [(id)item isKindOfClass:[NSMenuItem class]]; if ([item action] == @selector(toggleDebuggingJavaScript:) && isMenuItem) { NSMenuItem *menuItem = (NSMenuItem *)item; if ([[_inspectedWebView inspector] isDebuggingJavaScript]) [menuItem setTitle:UI_STRING("Stop Debugging JavaScript", "title for Stop Debugging JavaScript menu item")]; else [menuItem setTitle:UI_STRING("Start Debugging JavaScript", "title for Start Debugging JavaScript menu item")]; } else if ([item action] == @selector(toggleProfilingJavaScript:) && isMenuItem) { NSMenuItem *menuItem = (NSMenuItem *)item; if ([[_inspectedWebView inspector] isProfilingJavaScript]) [menuItem setTitle:UI_STRING("Stop Profiling JavaScript", "title for Stop Profiling JavaScript menu item")]; else [menuItem setTitle:UI_STRING("Start Profiling JavaScript", "title for Start Profiling JavaScript menu item")]; } return YES; } @end ��������WebKit/mac/WebCoreSupport/WebEditorClient.h���������������������������������������������������������0000644�0001750�0001750�00000014531�11205340544�017220� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebCore/EditorClient.h> #import <wtf/RetainPtr.h> #import <wtf/Forward.h> #import <wtf/Vector.h> @class WebView; @class WebEditorUndoTarget; class WebEditorClient : public WebCore::EditorClient { public: WebEditorClient(WebView *); virtual void pageDestroyed(); virtual bool isGrammarCheckingEnabled(); virtual void toggleGrammarChecking(); virtual bool isContinuousSpellCheckingEnabled(); virtual void toggleContinuousSpellChecking(); virtual int spellCheckerDocumentTag(); virtual bool smartInsertDeleteEnabled(); virtual bool isSelectTrailingWhitespaceEnabled(); virtual bool isEditable(); virtual bool shouldDeleteRange(WebCore::Range*); virtual bool shouldShowDeleteInterface(WebCore::HTMLElement*); virtual bool shouldBeginEditing(WebCore::Range*); virtual bool shouldEndEditing(WebCore::Range*); virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction); virtual bool shouldInsertText(const WebCore::String&, WebCore::Range*, WebCore::EditorInsertAction); virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting); virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*); virtual bool shouldMoveRangeAfterDelete(WebCore::Range* range, WebCore::Range* rangeToBeReplaced); virtual void didBeginEditing(); virtual void didEndEditing(); virtual void didWriteSelectionToPasteboard(); virtual void didSetSelectionTypesForPasteboard(); virtual NSString* userVisibleString(NSURL*); #ifdef BUILDING_ON_TIGER virtual NSArray* pasteboardTypesForSelection(WebCore::Frame*); #endif #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) virtual void uppercaseWord(); virtual void lowercaseWord(); virtual void capitalizeWord(); virtual void showSubstitutionsPanel(bool show); virtual bool substitutionsPanelIsShowing(); virtual void toggleSmartInsertDelete(); virtual bool isAutomaticQuoteSubstitutionEnabled(); virtual void toggleAutomaticQuoteSubstitution(); virtual bool isAutomaticLinkDetectionEnabled(); virtual void toggleAutomaticLinkDetection(); virtual bool isAutomaticDashSubstitutionEnabled(); virtual void toggleAutomaticDashSubstitution(); virtual bool isAutomaticTextReplacementEnabled(); virtual void toggleAutomaticTextReplacement(); virtual bool isAutomaticSpellingCorrectionEnabled(); virtual void toggleAutomaticSpellingCorrection(); #endif virtual void respondToChangedContents(); virtual void respondToChangedSelection(); virtual void registerCommandForUndo(PassRefPtr<WebCore::EditCommand>); virtual void registerCommandForRedo(PassRefPtr<WebCore::EditCommand>); virtual void clearUndoRedoOperations(); virtual bool canUndo() const; virtual bool canRedo() const; virtual void undo(); virtual void redo(); virtual void handleKeyboardEvent(WebCore::KeyboardEvent*); virtual void handleInputMethodKeydown(WebCore::KeyboardEvent*); virtual void textFieldDidBeginEditing(WebCore::Element*); virtual void textFieldDidEndEditing(WebCore::Element*); virtual void textDidChangeInTextField(WebCore::Element*); virtual bool doTextFieldCommandFromEvent(WebCore::Element*, WebCore::KeyboardEvent*); virtual void textWillBeDeletedInTextField(WebCore::Element*); virtual void textDidChangeInTextArea(WebCore::Element*); virtual void ignoreWordInSpellDocument(const WebCore::String&); virtual void learnWord(const WebCore::String&); virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); virtual WebCore::String getAutoCorrectSuggestionForMisspelledWord(const WebCore::String&); virtual void checkGrammarOfString(const UChar*, int length, WTF::Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); virtual void checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, WTF::Vector<WebCore::TextCheckingResult>& results); virtual void updateSpellingUIWithGrammarString(const WebCore::String&, const WebCore::GrammarDetail&); virtual void updateSpellingUIWithMisspelledWord(const WebCore::String&); virtual void showSpellingUI(bool show); virtual bool spellingUIIsShowing(); virtual void getGuessesForWord(const WebCore::String&, WTF::Vector<WebCore::String>& guesses); virtual void setInputMethodState(bool enabled); private: void registerCommandForUndoOrRedo(PassRefPtr<WebCore::EditCommand>, bool isRedo); WebEditorClient(); WebView *m_webView; RetainPtr<WebEditorUndoTarget> m_undoTarget; bool m_haveUndoRedoOperations; }; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebCoreSupport/WebApplicationCache.h�����������������������������������������������������0000644�0001750�0001750�00000002674�11232275376�020041� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 <Foundation/Foundation.h> @interface WebApplicationCache: NSObject { } + (void)setMaximumSize:(unsigned long long)size; @end ��������������������������������������������������������������������WebKit/mac/ChangeLog-2006-02-09���������������������������������������������������������������������0000644�0001750�0001750�00006123342�10714225174�013721� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������2006-02-09 Tim Omernick <timo@apple.com> Reviewed by Darin Adler. <rdar://problem/4198378> Crash on a CFRelease when visiting http://www.akella.com/ * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView requestWithURLCString:]): The true source of this crash is that the URL string is sometimes not NULL-terminated, which is the Real Player plugin's fault. That has been filed as 4439591. However, we can be more bulletproof here by switching the URL string encoding from Windows Latin 1 to ISO Latin 1, so that any NULL-terminated string can be represented. (As Darin and I found out last night, Windows Latin 1 has "holes" in certain character ranges and thus cannot encode arbitrary C strings). 2006-02-09 Maciej Stachowiak <mjs@apple.com> Rubber stamped by Anders. - Moved all the default delegate classes to their own directory. * DefaultDelegates: Added. * DefaultDelegates/WebDefaultContextMenuDelegate.h: Added. * DefaultDelegates/WebDefaultContextMenuDelegate.m: Added. * DefaultDelegates/WebDefaultEditingDelegate.h: Added. * DefaultDelegates/WebDefaultEditingDelegate.m: Added. * DefaultDelegates/WebDefaultFrameLoadDelegate.h: Added. * DefaultDelegates/WebDefaultFrameLoadDelegate.m: Added. * DefaultDelegates/WebDefaultPolicyDelegate.h: Added. * DefaultDelegates/WebDefaultPolicyDelegate.m: Added. * DefaultDelegates/WebDefaultResourceLoadDelegate.h: Added. * DefaultDelegates/WebDefaultResourceLoadDelegate.m: Added. * DefaultDelegates/WebDefaultScriptDebugDelegate.h: Added. * DefaultDelegates/WebDefaultScriptDebugDelegate.m: Added. * DefaultDelegates/WebDefaultUIDelegate.h: Added. * DefaultDelegates/WebDefaultUIDelegate.m: Added. * WebKit.xcodeproj/project.pbxproj: * WebView/WebDefaultContextMenuDelegate.h: Removed. * WebView/WebDefaultContextMenuDelegate.m: Removed. * WebView/WebDefaultEditingDelegate.h: Removed. * WebView/WebDefaultEditingDelegate.m: Removed. * WebView/WebDefaultFrameLoadDelegate.h: Removed. * WebView/WebDefaultFrameLoadDelegate.m: Removed. * WebView/WebDefaultPolicyDelegate.h: Removed. * WebView/WebDefaultPolicyDelegate.m: Removed. * WebView/WebDefaultResourceLoadDelegate.h: Removed. * WebView/WebDefaultResourceLoadDelegate.m: Removed. * WebView/WebDefaultScriptDebugDelegate.h: Removed. * WebView/WebDefaultScriptDebugDelegate.m: Removed. * WebView/WebDefaultUIDelegate.h: Removed. * WebView/WebDefaultUIDelegate.m: Removed. 2006-02-08 Justin Garcia <justin.garcia@apple.com> Original patch by Graham Dennis, reviewed by me: <http://bugs.webkit.org/show_bug.cgi?id=3982> webViewDidBeginEditing, webViewDidEndEditing notification methods not called on delegate Changes made by me, reviewed by thatcher: Made _setWindowHasFocus: and _setDisplaysWithFocusAttributes: into private SPI to allow for the testing of window.onFocus, window.onBlur, caret and focus halo painting, and the focusing of content editable regions that happens as side effect of setting a selection, but only if the window has focus (7128). * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge didBeginEditing]): (-[WebFrameBridge didEndEditing]): * WebView/WebHTMLView.m: (-[WebHTMLView updateFocusState]): (-[WebHTMLView _setWindowHasFocus:]): (-[WebHTMLView _setDisplaysWithFocusAttributes:]): * WebView/WebHTMLViewPrivate.h: 2006-02-08 David Kilzer <ddkilzer@kilzer.net> Reviewed by Darin. - Fix http://bugs.webkit.org/show_bug.cgi?id=3527 Allow Safari to open postscript files in browser windows as well * WebView/WebPDFRepresentation.m: (+[WebPDFRepresentation postScriptMIMETypes]): Added. (+[WebPDFRepresentation supportedMIMETypes]): Include PostScript MIME types. (-[WebPDFRepresentation convertPostScriptDataSourceToPDF:]): Added. (-[WebPDFRepresentation finishedLoadingWithDataSource:]): Handle PostScript conversion using new convertPostScriptDataSourceToPDF method. 2006-02-07 Alexey Proskuryakov <ap@nypop.com> Reviewed by Timothy. Convert JavaScript objects to appropriate AppleScript types, instead of only strings http://bugs.webkit.org/show_bug.cgi?id=7012 Tests: fast/AppleScript/* * WebView/WebView.m: (-[WebView aeDescByEvaluatingJavaScriptFromString:]): Added. * WebView/WebViewPrivate.h: 2006-02-06 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. - fixed "remove frame, renderer and completed flag from ChildFrame, make Frame track these" http://bugs.webkit.org/show_bug.cgi?id=7125 - fixed "onload event never called for iframe element with emtpy or about:blank src" http://bugs.webkit.org/show_bug.cgi?id=3609 * WebCoreSupport/WebFrameBridge.h: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge initWithPage:webView:renderer:frameName:view:]): Pass along renderer. (-[WebFrameBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]): Pass along renderer. * WebCoreSupport/WebPageBridge.m: (-[WebPageBridge initWithMainFrameName:webView:frameView:]): Pass null for renderer. * WebView/WebView.m: * WebView/WebViewPrivate.h: 2006-02-06 John Sullivan <sullivan@apple.com> Reviewed by Maciej Stachowiak. * WebView/WebPDFView.m: (-[WebPDFView menuForEvent:]): Removed use of WKExecutableLinkedInTigerOrEarlier() by modifying backward-compatibility hack involving PDF view context menus. Now we only bother to make sure that the PDFKit- supplied context menu items are present in Safari, for the benefit of the open source folks using tip of tree WebKit but older released Safari; it's possible that some other existing WebKit apps won't show all the PDF view context menu items. 2006-02-06 Maciej Stachowiak <mjs@apple.com> Remove remaining .subproj references to fix release build. * WebKit.xcodeproj/project.pbxproj: 2006-02-06 Maciej Stachowiak <mjs@apple.com> Rubber stamped by Hyatt. - renamed subproject directories to not end with .subproj * Carbon: renamed from Carbon.subproj * DOM: renamed from DOM.subproj * History: renamed from History.subproj * Misc: renamed from Misc.subproj * Panels: renamed from Panels.subproj * Plugins: renamed from Plugins.subproj * WebCoreSupport: renamed from WebCoreSupport.subproj * WebInspector: renamed from WebInspector.subproj * WebView: renamed from WebView.subproj 2006-02-06 Maciej Stachowiak <mjs@apple.com> Ooops, I made a last-minute change to my last patch that broke the build - fixed. * WebView.subproj/WebFrame.m: (-[WebFrame _closeOldDataSources]): (-[WebFrame _detachFromParent]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _checkLoadCompleteForThisFrame]): (-[WebFrame _handledOnloadEvents]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _goToItem:withLoadType:]): (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:formState:]): (-[WebFrame _clientRedirectedTo:delay:fireDate:lockHistory:isJavaScriptFormAction:]): (-[WebFrame _clientRedirectCancelled:]): * WebView.subproj/WebFramePrivate.h: 2006-02-05 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - shuffle things around so that WebFrame no longer has a WebView backpointer, the backpointer is at the bridge level. http://bugs.webkit.org/show_bug.cgi?id=7093 * WebCoreSupport.subproj/WebFrameBridge.h: * WebCoreSupport.subproj/WebFrameBridge.m: (-[WebFrameBridge initWithPage:webView:frameName:view:]): (-[WebFrameBridge page]): (-[WebFrameBridge mainFrame]): (-[WebFrameBridge webView]): (-[WebFrameBridge createWindowWithURL:frameName:]): (-[WebFrameBridge showWindow]): (-[WebFrameBridge areToolbarsVisible]): (-[WebFrameBridge setToolbarsVisible:]): (-[WebFrameBridge isStatusbarVisible]): (-[WebFrameBridge setStatusbarVisible:]): (-[WebFrameBridge setWindowFrame:]): (-[WebFrameBridge windowFrame]): (-[WebFrameBridge setWindowContentRect:]): (-[WebFrameBridge windowContentRect]): (-[WebFrameBridge setWindowIsResizable:]): (-[WebFrameBridge windowIsResizable]): (-[WebFrameBridge firstResponder]): (-[WebFrameBridge makeFirstResponder:]): (-[WebFrameBridge closeWindowSoon]): (-[WebFrameBridge runJavaScriptAlertPanelWithMessage:]): (-[WebFrameBridge runJavaScriptConfirmPanelWithMessage:]): (-[WebFrameBridge canRunBeforeUnloadConfirmPanel]): (-[WebFrameBridge runBeforeUnloadConfirmPanelWithMessage:]): (-[WebFrameBridge runJavaScriptTextInputPanelWithPrompt:defaultText:returningText:]): (-[WebFrameBridge addMessageToConsole:]): (-[WebFrameBridge runOpenPanelForFileButtonWithResultListener:]): (-[WebFrameBridge setStatusText:]): (-[WebFrameBridge startLoadingResource:withURL:customHeaders:]): (-[WebFrameBridge startLoadingResource:withURL:customHeaders:postData:]): (-[WebFrameBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): (-[WebFrameBridge focusWindow]): (-[WebFrameBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]): (-[WebFrameBridge userAgentForURL:]): (-[WebFrameBridge _nextKeyViewOutsideWebFrameViewsWithValidityCheck:]): (-[WebFrameBridge previousKeyViewOutsideWebFrameViews]): (-[WebFrameBridge defersLoading]): (-[WebFrameBridge setDefersLoading:]): (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:]): (-[WebFrameBridge _preferences]): (-[WebFrameBridge selectWordBeforeMenuEvent]): (-[WebFrameBridge historyLength]): (-[WebFrameBridge canGoBackOrForward:]): (-[WebFrameBridge goBackOrForward:]): (-[WebFrameBridge print]): (-[WebFrameBridge pollForAppletInView:]): (-[WebFrameBridge respondToChangedContents]): (-[WebFrameBridge respondToChangedSelection]): (-[WebFrameBridge undoManager]): (-[WebFrameBridge issueCutCommand]): (-[WebFrameBridge issueCopyCommand]): (-[WebFrameBridge issuePasteCommand]): (-[WebFrameBridge issuePasteAndMatchStyleCommand]): (-[WebFrameBridge canPaste]): (-[WebFrameBridge overrideMediaType]): (-[WebFrameBridge isEditable]): (-[WebFrameBridge shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:]): (-[WebFrameBridge shouldBeginEditing:]): (-[WebFrameBridge shouldEndEditing:]): (-[WebFrameBridge windowObjectCleared]): (-[WebFrameBridge spellCheckerDocumentTag]): (-[WebFrameBridge isContinuousSpellCheckingEnabled]): (-[WebFrameBridge didFirstLayout]): (-[WebFrameBridge dashboardRegionsChanged:]): (-[WebFrameBridge createModalDialogWithURL:]): (-[WebFrameBridge canRunModal]): (-[WebFrameBridge runModal]): * WebCoreSupport.subproj/WebPageBridge.h: * WebCoreSupport.subproj/WebPageBridge.m: (-[WebPageBridge initWithMainFrameName:webView:frameView:]): (-[WebPageBridge webView]): * WebView.subproj/WebDataSource.m: (-[WebDataSource _fileWrapperForURL:]): (-[WebDataSource _webView]): (-[WebDataSource _setLoading:]): (-[WebDataSource _startLoading:]): (-[WebDataSource _setTitle:]): (-[WebDataSource _setRequest:]): (-[WebDataSource _updateIconDatabaseWithURL:]): (-[WebDataSource _defersCallbacksChanged]): (-[WebDataSource _setWebFrame:]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame _traverseNextFrameStayWithin::]): (-[WebFrame _detachFromParent]): (-[WebFrame _setDataSource:]): (-[WebFrame _loadDataSource:withLoadType:formState:]): (-[WebFrame _initWithWebFrameView:webView:bridge:]): (-[WebFrame dealloc]): (-[WebFrame finalize]): (-[WebFrame webView]): * WebView.subproj/WebFrameView.m: (-[WebFrameView _webView]): (-[WebFrameView _goBack]): (-[WebFrameView _goForward]): * WebView.subproj/WebFrameViewInternal.h: * WebView.subproj/WebView.m: (-[WebView _createFrameNamed:inParent:allowsScrolling:]): (-[WebView _commonInitializationWithFrameName:groupName:]): 2006-02-04 Darin Adler <darin@apple.com> Reviewed by Maciej. * Misc.subproj/WebCoreStatistics.h: * Misc.subproj/WebCoreStatistics.m: (+[WebCoreStatistics javaScriptRootObjectTypeCounts]): javaScriptRootObjecTypeCounts -> javaScriptRootObjectTypeCounts 2006-02-04 Maciej Stachowiak <mjs@apple.com> Reviewed by Hyatt. - change JavaScript collector statistics calls to use HashCountedSet instead of CFSet; other misc cleanup http://bugs.webkit.org/show_bug.cgi?id=7072 * Misc.subproj/WebCoreStatistics.h: * Misc.subproj/WebCoreStatistics.m: (+[WebCoreStatistics javaScriptProtectedObjectsCount]): new (+[WebCoreStatistics javaScriptRootObjecTypeCounts]): new (+[WebCoreStatistics javaScriptRootObjectClasses]): deprecated (+[WebCoreStatistics javaScriptReferencedObjectsCount]): deprecated (+[WebCoreStatistics javaScriptNoGCAllowedObjectsCount]): Just return 0. Deprecated. 2006-02-03 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - change spellchecker preflighting to happen via class methods instead of object methods. * WebView.subproj/WebView.m: (-[WebView setContinuousSpellCheckingEnabled:]): (+[WebView _preflightSpellCheckerNow:]): (+[WebView _preflightSpellChecker]): 2006-02-03 Timothy Hatcher <timothy@apple.com> Reviewed by Justin. Renamed configuration names to Debug, Release and Production. * WebKit.xcodeproj/project.pbxproj: 2006-02-02 David Hyatt <hyatt@apple.com> Fix for bug 6957, rewrite image rendering in C++ and move it to WebCore. Animation now stops lazily and just uses the CachedObject notification system to push updates so that rects no longer need to be cached (or sets of animating renderers in specific views). Reviewed by darin * Misc.subproj/WebNSPasteboardExtras.h: * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeImage:element:URL:title:archive:types:]): (-[NSPasteboard _web_declareAndWriteDragImage:element:URL:title:archive:source:]): * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragImage:element:rect:event:pasteboard:source:offset:]): * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData init]): * WebCoreSupport.subproj/WebImageRendererFactory.m: (+[WebImageRendererFactory shouldUseThreadedDecoding]): (+[WebImageRendererFactory setShouldUseThreadedDecoding:]): (-[WebImageRendererFactory setPatternPhaseForContext:inUserSpace:]): (-[WebImageRendererFactory imageDataForName:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): (-[NSArray elementAtPoint:]): * WebView.subproj/WebImageView.m: (-[WebImageView writeImageToPasteboard:types:]): (-[WebImageView elementAtPoint:]): (-[WebImageView mouseDragged:]): * WebView.subproj/WebView.m: (-[WebView _writeImageElement:withPasteboardTypes:toPasteboard:]): 2006-01-31 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - fixed <rdar://problem/4267144> REGRESSION (10.4.2): Safari pages auto-scroll too easily during drag over content [5853] There were two issues here: (1) dragging over a non-editable webview (such as a typical Safari page) should not have auto-scrolled at all; the fact that it did was an uninentional side effect of making auto-scroll work for editable webviews a la Blot. (2) the speed & hot area of the auto-scroll changed between 10.4.1 and 10.4.2. I have a fix for (1), which is the much more important issue. I'll modify the bugzilla bug to be about the remaining issue. * WebView.subproj/WebView.m: (-[WebView _autoscrollForDraggingInfo:timeDelta:]): do nothing if not editable (-[WebView _shouldAutoscrollForDraggingInfo:]): return NO if not editable 2006-01-31 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. Support for programmatic scrolling one line at a time for PDFs. (We already had support for programmatic scrolling one page at a time, and to top/end.) * WebView.subproj/WebPDFView.m: (-[WebPDFView _fakeKeyEventWithFunctionKey:]): generalized comment (-[WebPDFView scrollLineDown:]): pass a faked arrow-down key event (-[WebPDFView scrollLineUp:]): pass a faked arrow-up key event 2006-01-31 Darin Adler <darin@apple.com> Reviewed by Hyatt. * WebCoreSupport.subproj/WebFrameBridge.m: (-[WebFrameBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]): Updated for name change. 2006-01-30 Timothy Hatcher <timothy@apple.com> Reviewed by Tim O. Add -Wno-deprecated-declarations to the compile flags for WebNetscapePluginPackage.m. <rdar://problem/4427068> LMGetCurApRefNum, CloseConnection and GetDiskFragment now deprecated. When we workaround these we can remove this compile flag. * WebKit.xcodeproj/project.pbxproj: 2006-01-30 Timothy Hatcher <timothy@apple.com> Reviewed by Justin. Remove the only use of -[NSFont glyphPacking]. This method was deprecated in Tiger and always returns NSNativeShortGlyphPacking. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:]): 2006-01-28 David Hyatt <hyatt@apple.com> Clean up RenderImage, eliminating unneeded members and methods. Reviewed by darin * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer copyWithZone:]): (-[WebImageRenderer size]): (-[WebImageRenderer drawImageInRect:fromRect:compositeOperator:context:]): 2006-01-26 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. <rdar://problem/4422365> * WebView.subproj/WebHTMLView.m: (-[NSArray addSuperviewObservers]): In addition to registering for frame/bounds change notifications, call -_frameOrBoundsChanged. It will check the current size/scroll against the previous layout's size/scroll. We need to do this here to catch the case where the WebView is laid out at one size, removed from its window, resized, and inserted into another window. Our frame/bounds changed notifications will not be sent in that situation, since we only watch for changes while in the view hierarchy. I have verified that this does not cause unnecessary layouts while running the PLT. 2006-01-25 Vicki Murley <vicki@apple.com> Reviewed by Beth Dakin. - fix <rdar://problem/4351664> REGRESSION (420+): extra URL in b/f list - navigating back to previous page fails at apple.com/retail/) * WebView.subproj/WebFrame.m: (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): grab the redirect flag of the current load before calling _loadURL, which clears this flag, (-[WebFrame _transitionToCommitted:]): remove misleading comment * History.subproj/WebHistoryItem.m: (-[WebHistoryItem setURL:]): release resources in the page cache when setting the URL on a WebHistoryItem 2006-01-25 Timothy Hatcher <timothy@apple.com> Move off of -[NSFont widthOfString:] since it is now deprecated. Use the NSStringDrawing -[NSString sizeWithAttributes:] API. * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileChooserButton bestVisualFrameSizeForCharacterCount:]): 2006-01-23 Darin Adler <darin@apple.com> - fixed some small localizable strings issues * WebInspector.subproj/WebInspector.m: (-[DOMNode _nodeTypeName]): Changed so we don't have two localizable strings that are both "Document". I'm not sure we want to localize the DOM inspector UI at all, but this fixes things for now. (-[DOMNode _displayName]): Ditto. * English.lproj/Localizable.strings: Updated. * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2006-01-23 Justin Garcia <justin.garcia@apple.com> Reviewed by thatcher Turned on -O2 for B&I build. * WebKit.xcodeproj/project.pbxproj: 2006-01-22 Timothy Hatcher <timothy@apple.com> Reviewed by Anders Carlsson. Makes the Inspector's Style pane take !important into account when marking overloaded properties. * WebInspector.subproj/webInspector/inspector.js: 2006-01-21 Timothy Hatcher <timothy@apple.com> Reviewed by Anders Carlsson. Make sure shorthand properties get striked-out if all the properties they expand into are overloaded. * WebInspector.subproj/webInspector/inspector.js: 2006-01-21 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Adds computed style to the Web Inspector. Adds a "mapped style" link to the mapped attributes. * WebInspector.subproj/webInspector/inspector.css: * WebInspector.subproj/webInspector/inspector.html: * WebInspector.subproj/webInspector/inspector.js: 2006-01-20 Timothy Hatcher <timothy@apple.com> Reviewed by John, some parts by Darin. Removes the old WebDebugDOMNode code, superseded by the ObjC DOM and the Web Inspector. Since Safari 2.0 still relies on these classes for the Debug menu's "Show DOM Tree", we remove that menu item to prevent a crash. * WebKit.exp: adds WebInspector, removes WebDebugDOMNode * WebKit.xcodeproj/project.pbxproj: added the REMOVE_SAFARI_DOM_TREE_DEBUG_ITEM define so the new WebView code doesn't build in the Default config * WebView.subproj/WebDebugDOMNode.h: Removed. * WebView.subproj/WebDebugDOMNode.m: Removed. * WebView.subproj/WebView.m: (+[WebView initialize]): check if we are in Safari and IncludeDebugMenu is true then observe for NSApplicationDidFinishLaunchingNotification and call _finishedLaunching (+[WebView _finishedLaunching]): observe for NSMenuDidAddItemNotification now that the main menu is loaded and wait for the Debug menu to be added (+[WebView _removeDOMTreeMenuItem:]): when the debug menu is added remove the "Show DOM Tree" item 2006-01-20 Timothy Hatcher <timothy@apple.com> Reviewed by Hyatt. Corrects the cascade order for mapped attributes. Shows "inline stylesheet" rather than "null" for rules in <style> tags. * WebInspector.subproj/webInspector/inspector.js: 2006-01-19 Timothy Hatcher <timothy@apple.com> Reviewed by Eric. Adds inline style reporting and mapped attribute support to the Inspector Style pane. Cleans up the node attributes area with a more natural attr = "value" look. Slight optimization to only update visible scrollbars during a window resize. * WebInspector.subproj/webInspector/inspector.css: * WebInspector.subproj/webInspector/inspector.js: 2006-01-19 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=6631 Inspector window has inappropriate maximum height * WebInspector.subproj/WebInspector.m: (-[WebInspector window]): removes the maximum size constraint 2006-01-19 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. * WebKit.xcodeproj/project.pbxproj: made WebNSUserDefaultsExtras.h private (SPI) so its one method can be called from Safari, so Safari can stop calling the similar method in Foundation. 2006-01-19 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. Made _webKit_guessedMIMEType SPI so Safari can use it in order to stop using the similar SPI method in Foundation. This involved splitting it out of the file it was in, to avoid creating any other new SPI here. Poor svn diff got mighty confused in the process. * Misc.subproj/WebNSDataExtras.h: removed _webkit_guessedMIMEType from here * Misc.subproj/WebNSDataExtrasPrivate.h: Added. Contains only _webkit_guessedMIMEType. This file is private (SPI), whereas WebNSDataExtras.h is project-internal. I could have renamed WebNSDateExtras.h to WebNSDateExtrasInternal.h also, but I minimized the gratuitous change level here by not doing that. * Misc.subproj/WebNSDataExtras.m: Despite the great confusion of svn diff, all I actually did here was move _webkit_guessedMIMEType and its helper _webkit_guessedMIMETypeForXML into a new category. No lines of code were harmed while creating this patch. * WebKit.xcodeproj/project.pbxproj: updated for new file * WebView.subproj/WebView.m: Added #import for new file since WebView uses _webkit_guessedMIMEType 2006-01-19 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. * Misc.subproj/WebNSURLExtras.h: added declaration of _webkit_rangeOfURLScheme so Safari can call it as a step towards weaning Safari from Foundation SPI. 2006-01-17 Justin Garcia <justin.garcia@apple.com> Reviewed by eric Deployment builds now use -O2 * WebKit.xcodeproj/project.pbxproj: 2006-01-17 Beth Dakin <bdakin@apple.com> Reviewed by Darin. Fix for <rdar://problem/4112029> With Quartz scaling on, Safari incorrectly handles mouseover effects The location of an event in the window should be converted to the superview of the contentView to do accurate hitTesting. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _updateMouseoverWithEvent:]): Convert the point to the contentView's superview from nil. 2006-01-16 Timothy Hatcher <timothy@apple.com> Rubber stamped by Maciej. Check for a new "WebKitDeveloperExtras" default when including the "Inspect Element" context menu item. We should retire the other one eventually. * WebView.subproj/WebView.m: (-[WebView _menuForElement:defaultItems:]): 2006-01-17 Anders Carlsson <andersca@mac.com> Reviewed by Timothy Hatcher. - http://bugs.webkit.org/show_bug.cgi?id=6594 Web Inspector: finish node attributes * WebInspector.subproj/webInspector/inspector.css: * WebInspector.subproj/webInspector/inspector.html: * WebInspector.subproj/webInspector/inspector.js: Add initial support for element attributes. 2006-01-16 John Sullivan <sullivan@apple.com> Reviewed by Vicki Murley. - fixed <rdar://problem/4409288> REGRESSION (TOT): When no selection is present on page, Jump to Selection doesn't beep * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _hasInsertionPoint]): new helper method (-[NSArray validateUserInterfaceItem:]): Don't validate this menu item (or a couple of others) if the selection is a caret and the page isn't editable. In that state, there is no visible selection so this menu item doesn't make sense. I suspect this was broken by some editing-related change that makes selectionState return WebSelectionStateCaret here where it used to return WebSelectionStateNone. 2006-01-16 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. WebKit part of <rdar://problem/4211707> NPAPI ref count behavior differs with Mozilla * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView getVariable:value:]): The returned window script object is expected to be retained, as described here: <http://www.mozilla.org/projects/plugins/npruntime.html#browseraccess> 2006-01-16 Anders Carlsson <andersca@mac.com> Reviewed by Darin. * WebInspector.subproj/webInspector/inspector.js: Use defined NodeType values instead of integers. 2006-01-15 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. New DOM Inspector that lives in WebKit and is accessible from any WebView. Accessible from a contextual menu when the WebKitEnableInspectElementContextMenuItem default is true or you have a development build. Browsing the tree, serialized HTML and CSS rules work. To always enable enter the following in the Terminal (change the bundle id to affect other WebKit apps): defaults write com.apple.Safari WebKitEnableInspectElementContextMenuItem -bool true http://bugs.webkit.org/show_bug.cgi?id=6571 * English.lproj/Localizable.strings: * English.lproj/StringsNotToBeLocalized.txt: reorder of the entries * Misc.subproj/WebKitNSStringExtras.h: * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _webkit_stringByCollapsingWhitespaceCharacters]): collapses consecutive whitespace into a single space * WebCoreSupport.subproj/WebFrameBridge.m: (-[WebFrameBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:]): cleanup (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:]): call the new UI delegate method * WebInspector.subproj: Added. * WebInspector.subproj/WebInspector.h: Added. * WebInspector.subproj/WebInspector.m: Added. (+[WebInspector sharedWebInspector]): (-[WebInspector init]): (-[WebInspector initWithWebFrame:]): (-[WebInspector dealloc]): (-[WebInspector window]): (-[WebInspector windowDidLoad]): (-[WebInspector windowWillClose:]): (-[WebInspector showWindow:]): (-[WebInspector setWebFrame:]): (-[WebInspector webFrame]): (-[WebInspector setRootDOMNode:]): (-[WebInspector rootDOMNode]): (-[WebInspector setFocusedDOMNode:]): (-[WebInspector focusedDOMNode]): (-[WebInspector setSearchQuery:]): (-[WebInspector searchQuery]): (-[WebInspector searchResults]): (-[WebInspector showOptionsMenu]): (-[WebInspector selectNewRoot:]): (-[WebInspector resizeTopArea:]): (-[WebInspector treeViewScrollTo:]): (-[WebInspector treeViewOffsetTop]): (-[WebInspector treeViewScrollHeight]): (-[WebInspector traverseTreeBackward]): (-[WebInspector traverseTreeForward]): (-[WebInspector _toggleIgnoreWhitespace:]): (-[WebInspector _highlightNode:]): (-[WebInspector _nodeHighlightExpired:]): (-[WebInspector _focusRootNode:]): (-[WebInspector _revealAndSelectNodeInTree:]): (-[WebInspector _showSearchResults:]): (-[WebInspector _refreshSearch]): (-[WebInspector _update]): (-[WebInspector _updateRoot]): (-[WebInspector _updateTreeScrollbar]): (+[WebInspector isSelectorExcludedFromWebScript:]): (+[WebInspector webScriptNameForSelector:]): (+[WebInspector isKeyExcludedFromWebScript:]): (-[WebInspector handleEvent:]): (-[WebInspector webView:didFinishLoadForFrame:]): (-[WebInspector webView:plugInViewWithArguments:]): (-[WebInspector outlineView:numberOfChildrenOfItem:]): (-[WebInspector outlineView:isItemExpandable:]): (-[WebInspector outlineView:child:ofItem:]): (-[WebInspector outlineView:objectValueForTableColumn:byItem:]): (-[WebInspector outlineView:willDisplayOutlineCell:forTableColumn:item:]): (-[WebInspector outlineViewItemDidCollapse:]): (-[WebInspector outlineViewSelectionDidChange:]): (-[WebInspectorPrivate dealloc]): (-[DOMHTMLElement _addClassName:]): Helper method for the Inspector to append style classes (-[DOMHTMLElement _removeClassName:]): Helper method for the Inspector to remove style classes (-[DOMNode _contentPreview]): (-[DOMNode _isAncestorOfNode:]): (-[DOMNode _isDescendantOfNode:]): (-[DOMNode _isWhitespace]): (-[DOMNode _lengthOfChildNodesIgnoringWhitespace]): (-[DOMNode _childNodeAtIndexIgnoringWhitespace:]): (-[DOMNode _nextSiblingSkippingWhitespace]): (-[DOMNode _previousSiblingSkippingWhitespace]): (-[DOMNode _firstChildSkippingWhitespace]): (-[DOMNode _lastChildSkippingWhitespace]): (-[DOMNode _firstAncestorCommonWithNode:]): (-[DOMNode _traverseNextNodeStayingWithin:]): (-[DOMNode _traverseNextNodeSkippingWhitespaceStayingWithin:]): (-[DOMNode _traversePreviousNode]): (-[DOMNode _traversePreviousNodeSkippingWhitespace]): (-[DOMNode _nodeTypeName]): (-[DOMNode _shortDisplayName]): (-[DOMNode _displayName]): * WebInspector.subproj/WebInspectorInternal.h: Added. * WebInspector.subproj/WebInspectorOutlineView.h: Added. * WebInspector.subproj/WebInspectorOutlineView.m: Added. (-[WebInspectorOutlineView isOpaque]): (-[WebInspectorOutlineView _highlightColorForCell:]): (-[WebInspectorOutlineView _highlightRow:clipRect:]): (-[WebInspectorOutlineView drawBackgroundInClipRect:]): * WebInspector.subproj/WebInspectorPanel.h: Added. * WebInspector.subproj/WebInspectorPanel.m: Added. (-[WebInspectorPanel canBecomeKeyWindow]): (-[WebInspectorPanel canBecomeMainWindow]): (-[WebInspectorPanel moveWindow:]): (-[WebInspectorPanel resizeWindow:]): (-[WebInspectorPanel sendEvent:]): * WebInspector.subproj/WebNodeHighlight.h: Added. * WebInspector.subproj/WebNodeHighlight.m: Added. (-[WebNodeHighlight initWithBounds:andRects:forView:]): (-[WebNodeHighlight dealloc]): (-[WebNodeHighlight fractionComplete]): (-[WebNodeHighlight expire]): (-[WebNodeHighlight redraw:]): * WebInspector.subproj/WebNodeHighlightView.h: Added. * WebInspector.subproj/WebNodeHighlightView.m: Added. (-[WebNodeHighlightView roundedRect:withRadius:]): (-[WebNodeHighlightView initWithHighlight:andRects:forView:]): (-[WebNodeHighlightView dealloc]): (-[WebNodeHighlightView isOpaque]): (-[WebNodeHighlightView drawRect:]): * WebInspector.subproj/webInspector: Added. * WebInspector.subproj/webInspector/Images: Added. * WebInspector.subproj/webInspector/Images/close.png: Added. * WebInspector.subproj/webInspector/Images/closePressed.png: Added. * WebInspector.subproj/webInspector/Images/downTriangle.png: Added. * WebInspector.subproj/webInspector/Images/menu.png: Added. * WebInspector.subproj/webInspector/Images/menuPressed.png: Added. * WebInspector.subproj/webInspector/Images/popupFill.png: Added. * WebInspector.subproj/webInspector/Images/popupFillPressed.png: Added. * WebInspector.subproj/webInspector/Images/popupLeft.png: Added. * WebInspector.subproj/webInspector/Images/popupLeftPressed.png: Added. * WebInspector.subproj/webInspector/Images/popupRight.png: Added. * WebInspector.subproj/webInspector/Images/popupRightPressed.png: Added. * WebInspector.subproj/webInspector/Images/rightTriangle.png: Added. * WebInspector.subproj/webInspector/Images/scrollThumbBottom.png: Added. * WebInspector.subproj/webInspector/Images/scrollThumbMiddle.png: Added. * WebInspector.subproj/webInspector/Images/scrollThumbTop.png: Added. * WebInspector.subproj/webInspector/Images/scrollTrackBottom.png: Added. * WebInspector.subproj/webInspector/Images/scrollTrackMiddle.png: Added. * WebInspector.subproj/webInspector/Images/scrollTrackTop.png: Added. * WebInspector.subproj/webInspector/Images/squareButtonRight.png: Added. * WebInspector.subproj/webInspector/Images/squareButtonRightPressed.png: Added. * WebInspector.subproj/webInspector/Images/upTriangle.png: Added. * WebInspector.subproj/webInspector/inspector.css: Added. * WebInspector.subproj/webInspector/inspector.html: Added. * WebInspector.subproj/webInspector/inspector.js: Added. * WebKit.xcodeproj/project.pbxproj: Adds Web Inspector files * WebView.subproj/WebUIDelegatePrivate.h: new UI delegate method to supply a replacement view for plugins * WebView.subproj/WebView.m: (-[WebView _menuForElement:defaultItems:]): Add a new context menu item for inspecting (-[WebView _inspectElement:]): Context menu item target for inspecting 2006-01-14 Alexey Proskuryakov <ap@nypop.com> Reviewed by Darin. - Fix http://bugs.webkit.org/show_bug.cgi?id=6531 document.cookie="killmenothing" doesn't set the cookie * WebCoreSupport.subproj/WebCookieAdapter.m: (-[WebCookieAdapter setCookies:forURL:policyBaseURL:]): Append an '=' to the cookie string if it has none, so that +[NSHTTPCookie cookiesWithResponseHeaderFields:forURL:] can parse it. 2006-01-14 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. - added bridging infrastructure for Page class * WebCoreSupport.subproj/WebPageBridge.h: Added. * WebCoreSupport.subproj/WebPageBridge.m: Added. (-[WebPageBridge initWithMainFrameName:view:]): New class, somewhat obvious. * WebKit.xcodeproj/project.pbxproj: * WebView.subproj/WebView.m: (-[WebViewPrivate dealloc]): Don't use _mainFrameBrige, use _pageBridge (-[WebView _close]): ditto (-[WebView _commonInitializationWithFrameName:groupName:]): ditto (-[WebView mainFrame]): ditto 2006-01-12 Maciej Stachowiak <mjs@apple.com> Rubber stamped by Eric. - rename WebBridge to WebFrameBridge - also removed all tabs from WebFrameBridge.m * DOM.subproj/WebDOMOperations.m: (-[DOMNode _bridge]): (-[DOMNode webArchive]): (-[DOMRange _bridge]): (-[DOMRange webArchive]): * DOM.subproj/WebDOMOperationsPrivate.h: * English.lproj/StringsNotToBeLocalized.txt: * Misc.subproj/WebCoreStatistics.m: * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _bridge]): * Plugins.subproj/WebBaseNetscapePluginView.m: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]): * Plugins.subproj/WebPluginContainerCheck.m: (-[WebPluginContainerCheck _isForbiddenFileLoad]): * Plugins.subproj/WebPluginController.h: * Plugins.subproj/WebPluginController.m: (-[WebPluginController bridge]): * WebCoreSupport.subproj/WebBridge.h: Removed. * WebCoreSupport.subproj/WebBridge.m: Removed. * WebCoreSupport.subproj/WebFileButton.h: * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileChooserButton initWithBridge:delegate:]): * WebCoreSupport.subproj/WebFrameBridge.h: Added. * WebCoreSupport.subproj/WebFrameBridge.m: Added. (-[WebFrameBridge mainFrame]): (-[WebFrameBridge createWindowWithURL:frameName:]): (-[WebFrameBridge canTargetLoadInFrame:]): (-[WebFrameBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]): (formDelegate): (-[WebFrameBridge createModalDialogWithURL:]): * WebCoreSupport.subproj/WebSubresourceLoader.m: * WebCoreSupport.subproj/WebTextRendererFactory.m: * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory bridgeForView:]): * WebKit.xcodeproj/project.pbxproj: * WebView.subproj/WebDataSource.m: (-[WebDataSource _bridge]): (-[WebDataSource _receivedMainResourceError:complete:]): (-[WebDataSource _stringWithData:]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDebugDOMNode.m: * WebView.subproj/WebDefaultContextMenuDelegate.m: * WebView.subproj/WebFrame.m: (-[WebFrame _traverseNextFrameStayWithin::]): (Frame): (-[WebFrame _detachFromParent]): (-[WebFrame _bridge]): (-[WebFrame _initWithWebFrameView:webView:bridge:]): * WebView.subproj/WebFrameInternal.h: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFrameView.m: (-[WebFrameView webCoreBridge]): (-[WebFrameView _bridge]): * WebView.subproj/WebHTMLRepresentation.m: (+[WebHTMLRepresentation supportedMIMETypes]): (-[WebHTMLRepresentation _bridge]): (-[WebHTMLRepresentation documentSource]): * WebView.subproj/WebHTMLRepresentationPrivate.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]): (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:deletionAction:]): (-[WebHTMLView updateFocusState]): (-[NSArray validateUserInterfaceItem:]): (-[NSArray attributedString]): (-[NSArray selectedAttributedString]): (-[NSArray concludeDragForDraggingInfo:actionMask:]): (-[NSArray keyDown:]): (-[NSArray _alterCurrentSelection:direction:granularity:]): (-[NSArray _alterCurrentSelection:verticalDistance:]): (-[NSArray _expandSelectionToGranularity:]): (-[NSArray cut:]): (-[NSArray _applyStyleToSelection:withUndoAction:]): (-[NSArray _applyParagraphStyleToSelection:withUndoAction:]): (-[NSArray pasteAsPlainText:]): (-[NSArray insertNewline:]): (-[NSArray insertLineBreak:]): (-[NSArray insertParagraphSeparator:]): (-[NSArray _changeWordCaseWithSelector:]): (-[NSArray startSpeaking:]): (-[NSArray selectToMark:]): (-[NSArray swapWithMark:]): (-[NSArray transpose:]): (-[WebHTMLView characterIndexForPoint:]): (-[WebHTMLView firstRectForCharacterRange:]): (-[WebHTMLView selectedRange]): (-[WebHTMLView attributedSubstringFromRange:]): (-[WebHTMLView _selectMarkedText]): (-[WebHTMLView _selectRangeInMarkedText:]): (-[WebHTMLView setMarkedText:selectedRange:]): (-[WebHTMLView _selectionIsInsideMarkedText]): (-[WebTextCompleteController _insertMatch:]): (-[WebTextCompleteController doCompletion]): (-[WebTextCompleteController endRevertingChange:moveLeft:]): * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebImageView.m: * WebView.subproj/WebMainResourceLoader.m: * WebView.subproj/WebRenderNode.m: * WebView.subproj/WebResource.m: (-[WebResource _stringValue]): * WebView.subproj/WebScriptDebugDelegate.m: * WebView.subproj/WebTextView.m: * WebView.subproj/WebView.m: (-[WebView _createFrameNamed:inParent:allowsScrolling:]): (-[WebView _commonInitializationWithFrameName:groupName:]): (-[WebView writeSelectionWithPasteboardTypes:toPasteboard:]): (-[WebView moveDragCaretToPoint:]): (-[WebView shouldClose]): (-[WebView editableDOMRangeForPoint:]): (-[WebView setEditable:]): (-[WebView deleteSelection]): (-[WebView _bridgeForSelectedOrMainFrame]): (-[WebView _bridgeAtPoint:]): 2006-01-13 Darin Adler <darin@apple.com> - Replaced tabs with spaces in source files that had less than 10 lines with tabs. - Set allow-tabs Subversion property in source files that have more than 10 lines with tabs. 2006-01-12 John Sullivan <sullivan@apple.com> Reviewed by Tim O. - fixed <rdar://problem/4406994> REGRESSION (TOT): zooming window at cnn.com makes window fill width of screen * WebView.subproj/WebFrameView.m: (-[WebFrameView _largestChildWithScrollBars]): now skips zero-area frames, used by some evil ads 2006-01-10 John Sullivan <sullivan@apple.com> Reviewed by Tim H. - fixed <rdar://problem/4265966> PDFs continue to show a (secondary) selection when the focus moves elsewhere * WebView.subproj/WebPDFView.h: added trackedFirstResponder ivar * WebView.subproj/WebPDFView.m: (-[WebPDFView dealloc]): assert that trackedFirstResponder is nil, as it was released/cleared in viewWillMoveToWindow: (-[WebPDFView _trackFirstResponder]): If the tracked first responder was the PDFView's documentView, and the current first responder isn't, deselect all. This is equivalent to overriding resignFirstResponder in the PDFView's documentView and deselecting all there, as other web document view classes do. Also, keep track of the new first responder for next time. (-[WebPDFView viewWillMoveToWindow:]): stop observing NSWindowDidUpdateNotification on the old window (-[WebPDFView viewDidMoveToWindow]): start observing NSWindowDidUpdateNotification on the new window, with _trackFirstResponder as the callback. Ideally we'd use a notification that tells us that the first responder is changing, but there is no such notification, so we have to use this very frequent one instead. The archaic 2573089 tracks the desire to have a responder-changed notification. (-[WebPDFView becomeFirstResponder]): removed comment about this bug that's now obsolete 2006-01-11 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2006-01-09 Darin Adler <darin@apple.com> * Makefile.am: Removed. 2006-01-09 John Sullivan <sullivan@apple.com> Reviewed by Beth Dakin. - fixed <rdar://problem/4302263> CrashTracer: 504 crashes in Safari at com.apple.AppKit: NSTargetForSendAction + 1060 The problem was that back/forward/stop/reload context menu items had nil targets, and thus were relying on AppKit to start from the context menu target (the clicked-upon view) and use the responder chain to find the WebView to act as the target. In Tiger, context menus don't retain their implicit target (the clicked-upon view again), and there was a race condition where the WebHTMLView could be dealloc'ed while the menu item was being processed, eventually crashing in AppKit. The fix is to explicitly set the target of these four menu items to the WebView, since the WebView is not dealloc'ed in the loading process. This might be fixed in a future version of AppKit by making the context menu retain its implicit target until it is dismissed, but with this change it will be fixed regardless of potential AppKit changes. * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate menuItemWithTag:target:]): Added target: parameter and removed code that set the target for some menu items; now the caller is responsible for supplying the target. (-[WebDefaultUIDelegate contextMenuItemsForElement:defaultMenuItems:]): Supply target (or nil) in calls to menuItemWithTag:target:. This matches existing behavior except for Back/Forward/Stop/Reload, which used to supply no target but now supply the WebView as the target. (-[WebDefaultUIDelegate editingContextMenuItemsForElement:defaultMenuItems:]): Supply target (or nil) in calls to menuItemWithTag:target: 2006-01-09 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin. - Second cut at fixing <rdar://problem/4268278> Submitting a form in onUnload event handler causes crash in -[WebDataSource(WebPrivate) _commitIfReady:].) - Fixes http://bugs.webkit.org/show_bug.cgi?id=6331 REGRESSION: form events don't fire after back/forward navigation, due to inconsistent load state * WebView.subproj/WebDataSource.m: (-[WebDataSource _stopLoading]): (1) If there are no resource loaders to signal the WebView that we've been canceled, manufacture the signal. Otherwise, the cancel gets ignored and nobody cleans up after the load. (We signal the WebView but not the WebFrame because we don't want the WebFrame to tear down the data source. Unlike most canceled data sources, this one has valid data because it's in the back/forward cache.) (2) Update _private->stopping before returning because if the data source is in the back/forward cache it can be reused, so it needs to be in a consistent state. (We never encountered this situation before because we would always crash first.) (-[WebDataSource _commitLoadWithData:]): Move _commitIfReady call inside retain block because the commit may cause an unload event to fire, which may start a new load, deallocating the current data source. (This is the same reason the rest of the function is in the retain block.) * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): If the unload handler started a new load, return early to avoid stomping it. (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): Undo previous incorrect fix. (-[WebFrame stopLoading]): Remove misleading comment. Setting provisionalDataSource to nil is not optional but required for internal consistency. 2006-01-09 Alexey Proskuryakov <ap@nypop.com> Reviewed by Maciej. Affects many layout tests (when running with primary Russian language). - Fix http://bugs.webkit.org/show_bug.cgi?id=4759 'ex' length unit calculation (Some layout tests fail if the system primary language is Russian) * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer xHeight]): Use glyphForCharacter() instead of -[NSFont glyphWithName:]. 2006-01-07 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin, landed by ap. Test: fast/text/atsui-small-caps-punctuation-size.html - fix http://bugs.webkit.org/show_bug.cgi?id=6397 ATSUI small caps use small punctuation * WebCoreSupport.subproj/WebTextRenderer.m: (createATSULayoutParameters): Changed the characters for which size must not change from !u_isbase() to the M* categories. 2006-01-06 John Sullivan <sullivan@apple.com> Reviewed by Vicki Murley (full credit) and Tim Omernick (half credit). - fixed <rdar://problem/4401102> REGRESSION (420+): When displaying a PDF, tabbing around stops working after reaching page * WebView.subproj/WebPDFView.m: (-[WebPDFView setNextKeyView:]): Use [PDFSubview documentView] rather than PDFSubview here, since that's the view that we now hand off first-responderhood to. 2006-01-05 Tim Omernick <timo@apple.com> Reviewed by Geoff. <rdar://problem/4400804> Client-side redirect to a non-HTTP URL confuses Safari * WebView.subproj/WebFrame.m: (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): If we were waiting for a quick redirect, but the policy delegate decided to ignore it, then we need to report that the client redirect was cancelled. 2006-01-05 John Sullivan <sullivan@apple.com> * WebView.subproj/WebPDFView.m: (-[WebPDFView _fakeKeyEventWithFunctionKey:]): Just added a FIXME comment about how to clean up this minor hack in the future. 2006-01-05 John Sullivan <sullivan@apple.com> Reviewed by Tim O. - fixed these bugs: <rdar://problem/3021785> page up/down don't work on frameset pages unless you click <rdar://problem/3021788> Page Up/Down moves an unscrollable frame if you click on it first and the WebKit part of this (need new Safari too for complete fix): <rdar://problem/4378905> Page up/down don't work in PDFs when address field is focused I moved some logic down from Safari that dealt with finding the largest scrollable child frame in a frameset, and added support for standard scrolling-related selectors to WebPDFView. The latter was needed for 4378905; the former was needed due to side effects of the Safari part of the change. As long as I was doing the former, I also used that logic to fix 3021785 and 3021788. * WebView.subproj/WebFrameViewPrivate.h: new currently-private methods _hasScrollBars and _largestChildWithScrollBars * WebView.subproj/WebFrameView.m: (-[WebFrameView scrollToBeginningOfDocument:]): if we don't have scroll bars, operate on our largest child with scroll bars instead (-[WebFrameView scrollToEndOfDocument:]): ditto (-[WebFrameView _pageVertically:]): ditto (-[WebFrameView _pageHorizontally:]): ditto (-[WebFrameView _scrollLineVertically:]): ditto (-[WebFrameView _scrollLineHorizontally:]): ditto (-[WebFrameView keyDown:]): where we were bailing out if ![self allowsScrolling], also check for whether there's a child with scroll bars, and don't bail out if so (-[WebFrameView _area]): new helper method used to implement _largestChildWithScrollBars (code moved from Safari) (-[WebFrameView _hasScrollBars]): new method, just returns YES if either scroll bar is showing (code moved from Safari) (-[WebFrameView _largestChildWithScrollBars]): new method, returns the child with the largest area that is showing at least one scroll bar (code moved from Safari and tweaked a little) * WebView.subproj/WebPDFView.m: (-[WebPDFView _fakeKeyEventWithFunctionKey:]): new method, hackaround for the fact that PDFView handles key downs from standard scrolling keys but does not implement the standard responder selectors (-[WebPDFView scrollPageDown:]): use _fakeKeyEventWithFunctionKey: to get the PDFView to scroll appropriately (-[WebPDFView scrollPageUp:]): ditto (-[WebPDFView scrollToBeginningOfDocument:]): ditto (-[WebPDFView scrollToEndOfDocument:]): ditto * WebView.subproj/WebView.m: add scrollToBeginningOfDocument and scrollToEndOfDocument to the list of responder operations that we hand off appropriately to the responder chain. These two aren't defined in any header but are generated by Home and End keys and used by the text system. 2006-01-05 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin. - Fixed http://bugs.webkit.org/show_bug.cgi?id=6361 Add plugin support to DumpRenderTree * WebKit.exp: export WebPluginDatabase class, which DumpRenderTree needs to add plugins to the runtime. 2006-01-03 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - move frame management and finding code from WebKit to WebCore http://bugs.webkit.org/show_bug.cgi?id=6368 * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadPluginRequest:]): Set frame name straight on the bridge, instead of having it bubble through the view and frame. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge initWithFrameName:view:]): don't pass name to frame, we own it now; set it on ourselves directly (-[WebBridge findFrameNamed:]): removed (-[WebBridge createWindowWithURL:frameName:]): set name on bridge, not webview (-[WebBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]): (-[WebBridge runModal]): remove excess braces * WebKit.xcodeproj/project.pbxproj: * WebView.subproj/WebControllerSets.h: Removed. * WebView.subproj/WebControllerSets.m: Removed. * WebView.subproj/WebFrame.m: (-[WebFramePrivate name]): removed (-[WebFramePrivate setName:]): removed (-[WebFramePrivate dealloc]): don't release name, we no longer have one (-[WebFrame _appendChild:]): removed (-[WebFrame _removeChild:]): removed (-[WebFrame _createItem:]): removed stray space (-[WebFrame _immediateChildFrameNamed:]): Just call the bridge (-[WebFrame _setName:]): removed (-[WebFrame _detachFromParent]): remove bridge from parent note self (-[WebFrame _continueLoadRequestAfterNewWindowPolicy:frameName:formState:]): (-[WebFrame _addChild:]): Call appendChild: on bridge, not self (-[WebFrame _nextFrameWithWrap:]): just call bridge (and moved helpers there) (-[WebFrame _previousFrameWithWrap:]): just call bridge (and moved helpers there) (-[WebFrame _initWithWebFrameView:webView:bridge:]): don't take a name any more (-[WebFrame _setFrameNamespace:]): just call bridge (-[WebFrame _frameNamespace]): just call bridge (-[WebFrame _hasSelection]): remove excess braces (-[WebFrame _clearSelection]): ditto (-[WebFrame initWithName:webFrameView:webView:]): no more name (-[WebFrame name]): just call bridge (-[WebFrame findFrameNamed:]): just call bridge (and moved helpers there) (-[WebFrame parentFrame]): fixed for new style * WebView.subproj/WebFrameInternal.h: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.h: 2006-01-03 Darin Adler <darin@apple.com> Reviewed by Beth. This is a fix for <rdar://problem/3710994> HiDPI: Link underlines are still one pixel high even if the UI resolution is > 100% This fix refactors -drawLineForCharacters to make its organization more logical. It changes behavior when printing to the screen by rounding the parameters of the line (x- and y-values, width, and thickness) to integer boundaries in device space. Previously, this part of the routine just hardcoded a 1 pixel line. * WebCoreSupport.subproj/WebTextRenderer.m: (drawHorizontalLine): This just takes care of drawing the line once everything has been calculated in -drawLineForCharacters (-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]): Now takes device space into account. Calls drawHorizontalLine 2006-01-03 Maciej Stachowiak <mjs@apple.com> Reviewed by Vicki. - moved frame traversal code across from bridge, also dropped the children array * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge dealloc]): Don't release children array, that was moved down to WebCore. (-[WebBridge saveDocumentState:]): - many methods moved to WebCore. * WebView.subproj/WebFrame.m: (Frame): New convenience method to get a WebFrame * from a method that returns WebCoreBridge *. (-[WebFrame _firstChildFrame]): use Frame() (-[WebFrame _lastChildFrame]): ditto (-[WebFrame _previousSiblingFrame]): ditto (-[WebFrame _nextSiblingFrame]): ditto (-[WebFrame _traverseNextFrameStayWithin:]): ditto 2006-01-03 Anders Carlsson <andersca@mac.com> Reviewed by Darin. - Fix http://bugs.webkit.org/show_bug.cgi?id=6357 REGRESSION: iframe and target is broken * WebView.subproj/WebFrame.m: (-[WebFrame _descendantFrameNamed:sourceFrame:]): Return the correct frame. 2006-01-02 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. - moved frame traversal logic from WebFrame to WebBridge http://bugs.webkit.org/show_bug.cgi?id=6341 To do this, I had to invert the ownership so that WebBridge now owns WebFrame instead of vice versa. As a result, WebView now owns a WebBridge pointer and does not have a direct WebFrame pointer. * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge initWithFrameName:view:]): The initializer is now responsible for creating the frame, so pass it what it needs to do that. (-[WebBridge dealloc]): The bridge now owns the frame, so release it. (-[WebBridge close]): ditto (-[WebBridge firstChild]): Moved from WebFrame (-[WebBridge lastChild]): ditto (-[WebBridge childCount]): ditto (-[WebBridge previousSibling]): ditto (-[WebBridge nextSibling]): ditto (-[WebBridge isDescendantOfFrame:]): ditto (-[WebBridge traverseNextFrameStayWithin:]): ditto (-[WebBridge appendChild:]): ditto (-[WebBridge removeChild:]): ditto * WebView.subproj/WebFrame.m: (-[WebFrame _removeChild::]): Call WebBridge version (-[WebFramePrivate dealloc]): ditto (-[WebFrame _firstChildFrame]): ditto (-[WebFrame _lastChildFrame]): ditto (-[WebFrame _childFrameCount]): ditto (-[WebFrame _previousSiblingFrame]): ditto (-[WebFrame _nextSiblingFrame]): ditto (-[WebFrame _traverseNextFrameStayWithin:]): ditto (-[WebFrame _appendChild:]): ditto (-[WebFrame _removeChild:]): ditto (-[WebFrame _isDescendantOfFrame:]): ditto, (-[WebFrame _detachFromParent]): reorder a bit to avoid losing our bridge pointer before the bridge is due to release us, and don't release the bridge any more since it now owns us (-[WebFrame _initWithName:webFrameView:webView:bridge:]): new initializer, we no longer create the bridge, instead it is passed in (-[WebFrame initWithName:webFrameView:webView:]): Call the new designated initializer, but this method is no longer viable and should be deprecated. * WebView.subproj/WebFrameInternal.h: * WebView.subproj/WebView.m: WebView was changed to hold onto the WebBridge for the main frame instead of the WebFrame. (-[WebViewPrivate dealloc]): update for the fact that we hold a bridge now, not a frame. (-[WebView _close]): ditto (-[WebView _createFrameNamed:inParent:allowsScrolling:]): Create a bridge, not a frame. (-[WebView _commonInitializationWithFrameName:groupName:]): ditto. (-[WebView setDefersCallbacks:]): get mainFrame via method (-[WebView mainFrame]): Update to get the main frame properly 2005-12-30 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin, landed by ap. Test: fast/text/justified-text-rect.html - WebKit part of fix for http://bugs.webkit.org/show_bug.cgi?id=5461 Text width measured incorrectly when text-align: justify * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer selectionRectForRun:style:geometry:]): Added. (CG_drawHighlight): Use new function CG_selectionRect. (CG_selectionRect): New function to compute the selection rect. Eliminated rounding hackery that was required for keeping the highlight rect within the selection rect computed by InlineTextBox::selectionRect, since the latter uses this function now. The new selection rect is wider and matches AppKit more closely, although the right hand side is roundf()ed instead of cielf()ed for optimal caret positioning. (ATSU_drawHighlight): Use new function ATSU_selectionRect. (ATSU_selectionRect): New function to compute the selection rect. Much like CG_selectionRect. 2005-12-29 Geoffrey Garen <ggaren@apple.com> Reviewed by Eric. Manual testcase added: WebCore/manual-tests/onunload-form-submit-crash.html - Fixed <rdar://problem/4268278> Submitting a form in onUnload event handler causes crash in -[WebDataSource(WebPrivate) _commitIfReady:] The problem is that the form submission in the unload event kicks off a new load in the midst of the load that caused the unload event to fire in the first place, so the two loads stomp each other. The solution is to cancel the first load and let the unload handler's load win. (Firefox does the same.) * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): Moved call to -closeURL up the call stack to _continueLoadRequest. (See below.) This has the side-effect of always firing the unload event, even if the new datasource never becomes committed, which seems like a good thing. (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): Call -closeURL here, instead of in _transitionToCommitted, so that the unload handler can fire before we initialize any part of the load. Check provisionalDataSource for nil to discover if the unload event kicked off its own load. Cleared up some coments. (-[WebFrame _detachFromParent]): It turns out that if you close the window instead of just navigating to a new page, you get an alternate assertion failure/crash because the load kicked off by the unload event handler generates resource loader callbacks after the associated WebFrame/WebView has disappeared. The nifty solution here is just to reverse the order of calls to -stopLoading and -closeURL, thus guaranteeing that -stopLoading has the last word when you close a window. 2005-12-30 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Eric, committed by Maciej. - fix for http://bugs.webkit.org/show_bug.cgi?id=6288 HEAD build broken 12/29/2005 * WebCoreSupport.subproj/WebTextRenderer.m: (overrideLayoutOperation): Use previous character from the buffer instead of ch which may be uninitialized on the first iteration. 2005-12-29 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. - finished frame traversal cleanup http://bugs.webkit.org/show_bug.cgi?id=6293 * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge childFrames]): Removed (this was unused) * WebView.subproj/WebFrame.m: (-[WebFrame _removeChild::]): Moved to FrameTraversal category. (-[WebFrame _childFrameCount]): New frame traversal method to avoid getting the count from the array directly. (-[WebFrame _appendChild:]): Factored out the parts of addChild: that seem directly relevant to adding a child. (-[WebFrame _removeChild:]): Moved to FrameTraversal category. (-[WebFrame _detachChildren]): Don't deallocate children array because there's no particular need to. (-[WebFrame _setDataSource:]): make the assert use _childFrameCount (-[WebFrame _opened]): (-[WebFrame _checkLoadComplete]): Instead of checking all frames starting from the main frame, check this frame and all ancestors. If a resource for a frame completes, that con only possibly finish loading for that frame and its ancestors, not any other frame in the tree. (-[WebFrame _recursiveCheckLoadComplete]): Removed, no longer needed. (-[WebFrame _childFramesMatchItem:]): Get child frame count in the new approved way. (-[WebFrame _internalChildFrames]): removed (-[WebFrame _addChild:]): Use _appendChild: for most of the work. (-[WebFrame _generateFrameName]): Get child frame count in the new approved way. (-[WebFrame _stopLoadingSubframes]): Use new frame traversal mechanisms, upon further consideration there's no need to copy part of the frame tree here. (-[WebFrame findFrameNamed:]): Remove extra braces. (-[WebFrame childFrames]): Make a new array using the frame traversal methods. * WebView.subproj/WebFramePrivate.h: Remove some methods. * WebView.subproj/WebMainResourceLoader.m: (-[WebMainResourceLoader didReceiveResponse:]): Do _checkLoadComplete on the current frame not the main frame (before there was no difference and now the new version is what is desired). * WebView.subproj/WebView.m: (-[WebView _finishedLoadingResourceFromDataSource:]): Remove stray space (-[WebView _mainReceivedBytesSoFar:fromDataSource:complete:]): Remove stray spaces and update FIXME comment. (-[WebView _receivedError:fromDataSource:]): Remove stray space 2005-12-29 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - abstract frame traversal in WebFrame more http://bugs.webkit.org/show_bug.cgi?id=6283 Rewrote most of the frame traversal code in WebFrame to use DOM-style first/last/next/previous methods, to abstract access better in preparation for moving it down. As an added bonus, many formerly recursive methods are now iterative. * WebKit.xcodeproj/project.pbxproj: Use gnu99 dialect of C, so that variables can be declared in for loop initializers. - added new frame traversal methods, to avoid dealing with the children array directly: * WebView.subproj/WebFrame.m: (-[WebFrame _firstChildFrame]): New method. (-[WebFrame _lastChildFrame]): New method. (-[WebFrame _previousSiblingFrame]): New method. (-[WebFrame _nextSiblingFrame]): New method. (-[WebFrame _traverseNextFrameStayWithin:]): Like traverseNextNode() in the DOM; uses some of the previous. - apply the new methods (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]): Rewrite loop to use new traversal methods. (-[WebFrame _immediateChildFrameNamed:]): ditto, also added FIXME (-[WebFrame _setName:]): Improved comment, removed gratuitous brace (-[WebFrame _isDescendantOfFrame:]): Rewrote to chase parent pointers instead of looking in child arrays (duh) (-[WebFrame _detachChildren]): Rewrite loop to use new traversal methods, still walk backwards for now. (-[WebFrame _closeOldDataSources]): Rewrite using new traversal methods. (-[WebFrame _childFramesMatchItem:]): ditto (-[WebFrame _defersCallbacksChanged]): ditto (-[WebFrame _viewWillMoveToHostWindow:]): ditto (-[WebFrame _viewDidMoveToHostWindow]): ditto (-[WebFrame _addChild:]): don't use childFrames method (-[WebFrame _removeChild:]): Clear out the sibling pointers after unlinking from the list, not obvious if anything needs this but it seems like the right thing to do. (-[WebFrame _generateFrameName]): don't bother to nil-check children array, since calling count on nil still gives 0. (-[WebFrame _saveDocumentAndScrollState]): Rewrite to use frame traversal methods (-[WebFrame _deepLastChildFrame]): renamed from _lastChildFrame, rewrite to use child traversal methods. (-[WebFrame _nextFrameWithWrap:]): Use new frame traversal stuff (mostly just a thin wrapper on _traverseNextFrameStayWithin: (-[WebFrame _previousFrameWithWrap:]): Use new traversal functions (-[WebFrame _numPendingOrLoadingRequests:]): Rewrite loop with new tracrsal functions (-[WebFrame _reloadForPluginChanges]): ditto (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]): ditto (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]): ditto (-[WebFrame _documentViews]): ditto (-[WebFrame _updateDrawsBackground]): ditto (-[WebFrame _unmarkAllMisspellings]): ditto (-[WebFrame _atMostOneFrameHasSelection]): ditto (-[WebFrame _findFrameWithSelection]): ditto (-[WebFrame _stopLoadingSubframes]): ditto (-[WebFrame _subframeIsLoading]): ditto (-[WebFrame _descendantFrameNamed:sourceFrame:]): ditto 2005-12-29 Darin Adler <darin@apple.com> * WebView.subproj/WebFrameView.m: (-[WebFrameViewPrivate dealloc]): Removed unused "draggingTypes" instance variable. 2005-12-29 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by darin Test: fast/text/atsui-spacing-features.html - WebKit part of fix for http://bugs.webkit.org/show_bug.cgi?id=3922 Variable word/letter spacing and full justification not supported for ATSUI-rendered text * WebCoreSupport.subproj/WebTextRenderer.m: (overrideLayoutOperation): Add letter- and word-spacing and padding for justification. (createATSULayoutParameters): Compute padding per space. 2005-12-27 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Maciej, landed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=4844 Render "simple" Hebrew using the CG codepath * WebCoreSupport.subproj/WebTextRenderer.m: (shouldUseATSU): Exclude Hebrew letters and maqaf. 2005-12-25 Maciej Stachowiak <mjs@apple.com> Reviewed by Geoff - Remove WebFrame's parent frame pointer, instead rely on WebCore's parent concept http://bugs.webkit.org/show_bug.cgi?id=6241 * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge canTargetLoadInFrame:]): Use bridge parent method instead of needlessly asking for parent via WebFrame (-[WebBridge frameDetached]): Don't call _removeChild on the parent frame any more because WebFame's _detachFromParent takes care of that now. * WebView.subproj/WebFrame.m: (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]): Fix stray spaces (-[WebFrame _detachChildren]): Don't remove children as we loop any more, they can remove themselves. (-[WebFrame _detachFromParent]): Remove self from parent; don't nil out bridge until we are done with it. (-[WebFrame _transitionToCommitted:]): Remove some extra braces. (-[WebFrame _goToItem:withLoadType:]): Use parentFrame method in assert instead of parent field directly. (-[WebFrame _addChild:]): Don't poke at parent frame pointer in _private since it is not there any more. (-[WebFrame _removeChild:]): Remove extra braces and don't clear parent pointer explicitly any more. (-[WebFrame _addFramePathToString:]): Get parentFrame from method, not field. (-[WebFrame _loadDataSource:withLoadType:formState:]): Remove extra braces. (-[WebFrame _nextFrameWithWrap:]): Get parent in the proper way and clean up the coding style. (-[WebFrame _previousFrameWithWrap:]): Ditto. (-[WebFrame parentFrame]): Get parent from the bridge. 2005-12-25 Maciej Stachowiak <mjs@apple.com> Reviewed by Hyatt. - fixed REGRESSION: world leak of WebDataSource http://bugs.webkit.org/show_bug.cgi?id=6242 * WebView.subproj/WebDataSource.m: (-[WebDataSource _stopLoading]): don't retain self until after the possible early return. 2005-12-24 Maciej Stachowiak <mjs@apple.com> Reviewed by Geoff. - rearrange some code in WebDataSource so that more of the frame traversal logic is in WebFrame, in preparation for moving it down to WebBridge. http://bugs.webkit.org/show_bug.cgi?id=6239 * WebView.subproj/WebDataSource.m: (-[WebDataSource _archiveWithMarkupString:nodes:]): Assert that the data source is committed, doesn't make sense to archive otherwise. (-[WebDataSource _subframeArchivesWithCurrentState:]): New helper method. (-[WebDataSource _archiveWithCurrentState:]): Assert that the data source is committed. Use the helper. (-[WebDataSource _setWebView:]): Comment that we won't tell subframes that defers callback changed. (-[WebDataSource _startLoading]): Remove stray space. (-[WebDataSource _stopLoading]): Only handle local _stopLoading business. Cound on WebFrame to tell subframes to stop loading. Fold in _stopLoadingInternal and remove _recursiveStopLoading. (-[WebDataSource _startLoading:]): Clean up an assert slightly. (-[WebDataSource _setTitle:]): Remove stray spaces. (-[WebDataSource _defersCallbacksChanged]): Don't call subframes. WebFrame can do that. (-[WebDataSource isLoading]): Move checking of subframes down to WebFrame. (-[WebDataSource webArchive]): Return nil if the data source is not yet committed. It makes no sense to archive a provisional data source since it has no data yet. (-[WebDataSource addSubresource:]): Replace an assert with an early return, ASSERT is not an appropriate way to flag problems with the argument of a public method. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame _setLoadType:]): Remove stray space. (-[WebFrame _checkLoadCompleteForThisFrame]): Stop loading subframes manually and add a FIXME about confusingness of stopping loading here. (-[WebFrame _defersCallbacksChanged]): Tell our subframes. (-[WebFrame _addChild:]): Remove stray space. (-[WebFrame _stopLoadingSubframes]): New helper method. (-[WebFrame _subframeIsLoading]): New helper method, code moved from WebDataSource. (-[WebFrame stopLoading]): Tell subframes to stop loading. (-[WebFrame reload]): Remove extra braces. * WebView.subproj/WebFrameInternal.h: 2005-12-23 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - move more frame tree traversal code from WebView to WebFrame * WebView.subproj/WebFrame.m: (-[WebFrame _atMostOneFrameHasSelection]): Moved this debug method from WebView, renamed it and changed it to return a boolean so it is appropriate for use in assertions instead of giving its own errors. (-[WebFrame _accumulateFramesWithSelection:]): Helper for the above. (-[WebFrame _findFrameWithSelection]): Moved from WebView and renamed from _findSelectedFrame, also removed the skipping variant. (-[WebFrame _clearSelectionInOtherFrames]): Moved from WebView and changed how the logic works. Instead of clearing selection in any frame but the focus frame, it clears selection in all but this one. * WebView.subproj/WebFrameInternal.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView becomeFirstResponder]): Call _clearSelectionInOtherFrames * WebView.subproj/WebPDFView.m: (-[WebPDFView PDFViewWillClickOnLink:withURL:]): Stop getting WebFrame in needlessly roundabout way. (-[WebPDFView becomeFirstResponder]): Call _clearSelectionInOtherFrames * WebView.subproj/WebTextView.m: (-[WebTextView _webFrame]): New helper method. (-[WebTextView _elementAtWindowPoint:]): Use it. (-[WebTextView becomeFirstResponder]): Call _clearSelectionInOtherFrames (-[WebTextView resignFirstResponder]): Fix style issue (-[WebTextView clickedOnLink:atIndex:]): Use new helkper * WebView.subproj/WebView.m: (-[WebView selectedFrame]): Call to WebFrame as appropriate (-[WebView _selectedOrMainFrame]): Fix style issue * WebView.subproj/WebViewInternal.h: 2005-12-22 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. - move a few more methods from WebView to WebFrame. * WebView.subproj/WebFrame.m: (-[WebFrame _hasSelection]): Renamed from _frameIsSelected: and moved from WebView. (-[WebFrame _clearSelection]): Renamed from _deselectFrame: and moved from WebView. * WebView.subproj/WebFrameInternal.h: * WebView.subproj/WebView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): Update for renames. (-[WebView _findSelectedFrameStartingFromFrame:skippingFrame:]): Ditto. (-[WebView _debugCollectSelectedFramesIntoArray:startingFromFrame:]): Ditto. (-[WebView _selectedFrameDidChange]): 2005-12-21 Timothy Hatcher <timothy@apple.com> * WebKit.xcodeproj/project.pbxproj: Set tab width to 8, indent width to 4 and uses tabs to false per file. 2005-12-20 Alexey Proskuryakov <ap@nypop.com> Reviewed by justin <http://bugs.webkit.org/show_bug.cgi?id=4682> -[WebHTMLView firstRectForCharacterRange:] is using _selectedRange instead of the given range if no marked text * WebView.subproj/WebHTMLView.m: (-[WebHTMLView firstRectForCharacterRange:]): Handle some large unsigned values the way NSTextView does. Actually use the range passed in instead of _selectedRange, use of _selectedRange was a workaround that is no longer necessary. 2005-12-20 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. - fixed http://bugs.webkit.org/show_bug.cgi?id=6146 (REGRESSION: Bold font used for Google search result pages is too thick) This is a problem with a particular font that was installed by Microsoft Office X. Though the font and/or lower levels of font-handling code in the system are buggy, this bad symptom will occur for users of Safari and other WebKit clients who happen to have one of these bad fonts. This adds a workaround to avoid the problem. * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory fontWithFamilies:traits:size:]): When we're going to synthesize bold or italic, yet the font we looked up was apparently a match for the traits, try to look up a font that without the to-be-synthesized traits. This way, instead of applying synthetic bold over Arial Bold, we'll apply synthetic bold over Arial Regular, which is uglier than just using Arial Bold, but far less ugly than using Arial Bold with synthetic bold too. 2005-12-16 Justin Garcia <justin.garcia@apple.com> <rdar://problem/4103393> Frequent Safari crash on lexisnexus.com (khtml::Selection::xPosForVerticalArrowNavigation) <rdar://problem/4330451> CrashTracer: [REGRESSION] 2235 crashes in Safari at com.apple.WebCore: khtml::Selection::xPosForVerticalArrowNavigation const 436 Reviewed by darin WebCore will crash when a selection that starts or ends in a node that has been removed from the document is modify()d. This can occur: (1) in non-editable regions (4103393 and 4330451), (2) in editable regions (4383146) as the result of arbitrary DOM operations, and (3) in Mail (4099739) as the result of an editing operation that sets a bad ending selection. Crashes of type (1) can occur when the user uses the arrow keys to interact with a web app, or when the user tries to use command-shift-arrow to switch tabs (this is a depricated combo that will work if no one else responds to it). The easiest way to fix these crashes is to disallow editing'ish selection changes like moveDown:, selectWord:, pageDown:, etc, when the selection is in a non-editable region. Crashes of type (2) will require a more complicated fix (but occur much less often than type (1)). Crashes of type (3) must be fixed by tracking down the editing operation that sets bad selections. Added a layout-test: * editing/selection/selection-actions.html * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _canAlterCurrentSelection]): (-[WebHTMLView _alterCurrentSelection:direction:granularity:]): (-[WebHTMLView _alterCurrentSelection:verticalDistance:]): (-[WebHTMLView _expandSelectionToGranularity:]): * WebView.subproj/WebHTMLViewPrivate.h: 2005-12-20 Justin Garcia <justin.garcia@apple.com> Reviewed by mitz Fixed more uninitialized variable warnings, and removed an extra semicolon. * WebCoreSupport.subproj/WebTextRenderer.m: (overrideLayoutOperation): (createATSULayoutParameters): 2005-12-20 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - push more of frame lookup and management from WebView to WebFrame, this is in preparation for shifting this to WebCore http://bugs.webkit.org/show_bug.cgi?id=6163 * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge closeWindowSoon]): Adjust for change to WebFrameNamespaces (-[WebBridge runModal]): ditto * WebView.subproj/WebControllerSets.h: * WebView.subproj/WebControllerSets.m: (+[WebFrameNamespaces addFrame:toNamespace:]): This now operates in terms of WebFrames (expected to be the main frame) not WebViews. (+[WebFrameNamespaces framesInNamespace:]): Ditto. * WebView.subproj/WebFrame.m: (-[WebFrame _setFrameNamespace:]): Set self, not WebView. (-[WebFrame _shouldAllowAccessFrom:]): Moved this code above use to avoid prototyping the method. (-[WebFrame _descendantFrameNamed:sourceFrame:]): Ditto. (-[WebFrame _frameInAnyWindowNamed:sourceFrame:]): Copied logic over from WebView. (-[WebFrame findFrameNamed:]): Do it all here, don't call WebView. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.h: 2005-12-20 Geoffrey Garen <ggaren@apple.com> Reviewed by adele. Fixed build failure due to missing 'b's in my last checkin. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge isStatusbarVisible]): changed 'B' to 'b' (-[WebBridge setStatusbarVisible:]): ditto 2005-12-20 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin, committed by Adele. - fix deployment builds broken by the ATSUI multiple renderers patch http://bugs.webkit.org/show_bug.cgi?id=6153 * WebCoreSupport.subproj/WebTextRenderer.m: (createATSULayoutParameters): Assign initial values, which will never be used, to substituteRenderer and firstSmallCap, to avoid uninitialized variable warnings. 2005-12-20 Geoffrey Garen <ggaren@apple.com> Reviewed by John. Part of fix for <rdar://problem/4310363> JavaScript window.open: Height is 1 pixel short, and related bugs. See WebCore ChageLog. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge webView]): Added method. 2005-12-20 Eric Seidel <eseidel@apple.com> Reviewed by mjs. Development-only build fix. * WebView.subproj/WebFrame.m: (-[WebFramePrivate dealloc]): fixed typo 2005-12-20 Maciej Stachowiak <mjs@apple.com> Not reviewed. - revert accidental commit of this file. 2005-12-19 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. - Move handling of frame namespaces down to WebFrame. - Put some internal class declarations in the implementation file. * WebView.subproj/WebControllerSets.m: (+[WebFrameNamespaces addWebView:toFrameNamespace:]): (+[WebFrameNamespaces webViewsInFrameNamespace:]): * WebView.subproj/WebFrame.m: (-[WebFramePrivate dealloc]): (-[WebFrame _setFrameNamespace:]): (-[WebFrame _frameNamespace]): * WebView.subproj/WebFrameInternal.h: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebView.m: (-[WebView _close]): (-[WebView _findFrameNamed:sourceFrame:]): (-[WebView setGroupName:]): (-[WebView groupName]): * WebView.subproj/WebViewInternal.h: 2005-12-19 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin, committed by Adele. Test: fast/text/atsui-multiple-renderers.html - fix http://bugs.webkit.org/show_bug.cgi?id=6139 ATSUI code path should implement small caps, synthetic bold and oblique and correct metrics for fallback fonts * WebCoreSupport.subproj/WebTextRenderer.m: (overrideLayoutOperation): Fetch renderer info from the renderers array; add synthetic bold offset; render only synthetic bold in the synthetic bold pass. (drawGlyphs): Replaced 14 with new SYNTHETIC_OBLIQUE_ANGLE define. (initializeATSUStyle): Apply a skewing transform for synthetic oblique. (createATSUTextLayout): Merged into createATSUTextLayout. (createATSULayoutParameters): Merged in createATSUTextLayout; allocate and fill a renderers array and a character buffer for small caps and mirroring; (applyMirroringToRun): Merged into createATSULayoutParameters. (ATSU_drawHighlight): Deleted mirroring code. (ATSU_draw): Deleted mirroring code; added second pass for synthetic bold. (ATSU_pointToOffset): Deleted mirroring code. 2005-12-19 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin, committed by Adele. Test: fast/text/atsui-kerning-and-ligatures.html - fix http://bugs.webkit.org/show_bug.cgi?id=6137 Disable kerning and some ligatures in the ATSUI code path * WebCoreSupport.subproj/WebTextRenderer.m: (initializeATSUStyle): Disable kerning; disable ligatures unless the font does not contain 'a', in which case it is assumed to never be rendered by the CG code path. 2005-12-19 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin, committed by Adele. Test: fast/text/should-use-atsui.html - fix for http://bugs.webkit.org/show_bug.cgi?id=6132 Incorrect selection highlighting for ATSUI text when selected range is "CG-safe" * WebCoreSupport.subproj/WebTextRenderer.m: (shouldUseATSU): Always start scanning from 0 since drawing and highlighting also measure everything up to run->from. 2005-12-17 Maciej Stachowiak <mjs@apple.com> Rubber stamped by Eric. - remove some unused SPI headers. * DOM.subproj/WebDOMDocument.h: Removed. * DOM.subproj/WebDOMElement.h: Removed. * DOM.subproj/WebDOMNode.h: Removed. * WebKit.xcodeproj/project.pbxproj: 2005-12-17 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed and landed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=5479 Can't select text with RTL override rendered by ATSUI * WebCoreSupport.subproj/WebTextRenderer.m: (overrideLayoutOperation): Update since the layout only includes from -> to now. (-[WebTextRenderer pointToOffset:style:position:includePartialGlyphs:]): Remove reversed parameter. (CG_floatWidthForRun): Add code to handle RTL case. (addDirectionalOverride): Put the override around the entire run. (ATSU_drawHighlight): Rearrange and reuse ATSU_floatWidthForRun for more of the work. Also round. (ATSU_pointToOffset): Remove reversed parameter and run swapping. (CG_pointToOffset): Remove reversed parameter, using rtl flag in style instead. 2005-12-16 Evan Gross <evan@rainmakerinc.com> Reviewed and landed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=4680 WebHTMLView (WebNSTextInputSupport) - attributedSubstringFromRange "not yet implemented" * WebView.subproj/WebHTMLView.m: (-[WebHTMLView attributedSubstringFromRange:]): Implement by calling the same RTF conversion used when copying to the pasteboard. 2005-12-16 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed and landed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=6090 REGRESSION: Assertion failure when choosing Copy from a WebImageView's contextual menu * WebView.subproj/WebImageView.m: (-[WebImageView elementAtPoint:]): Use WebCoreElementImageRendererKey for the image renderer and WebElementImageKey for the image. 2005-12-15 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - remove _frameForView: method from WebView and replace with a direct pointer on the WebFrameView in the WebFrame * Misc.subproj/WebNSViewExtras.m: * WebView.subproj/WebFrame.m: (-[WebFrame _detachFromParent]): (-[WebFrame _loadDataSource:withLoadType:formState:]): (-[WebFrame initWithName:webFrameView:webView:]): * WebView.subproj/WebFrameView.m: (-[WebFrameView _setWebFrame:]): (-[WebFrameView webFrame]): * WebView.subproj/WebFrameViewInternal.h: * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.h: 2005-12-13 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - remove the dead _frameForDataSource: method (WebDataSource now knows its WebFrame) http://bugs.webkit.org/show_bug.cgi?id=6072 * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.h: === Safari-521~5 === 2005-12-12 Timothy Hatcher <timothy@apple.com> Reviewed by nobody, simple build fix. Fixes a couple ambiguous selector build errors when building with GCC 3.3. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase releaseIconForURL:]): * WebView.subproj/WebHTMLView.m: (-[NSView _web_layoutIfNeededRecursive:testDirtyRect:]): (-[NSArray elementAtPoint:]): 2005-12-12 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed and checked in by John Sullivan. Fix for: http://bugs.webkit.org/show_bug.cgi?id=6053 WebIconDatabase returns the Accessibility Verifier app icon instead of a generic document icon * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _iconForFileURL:withSize:]): use file type iconForFileType:NSFileTypeForHFSTypeCode(kGenericDocumentIcon) instead of '????' to get the generic document icon. 2005-12-12 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - Made protocol <WebDocumentSelection> include protocol <WebDocumentText>, for clarity. This required moving some methods from WebTextView, which conformed to <WebDocumentText>, up into superclass WebSearchableTextView, which conformed to <WebDocumentSelection>. * Misc.subproj/WebSearchableTextView.m: (-[NSString supportsTextEncoding]): moved this method (unchanged) from subclass WebTextView (-[NSString string]): ditto (-[NSString attributedString]): ditto (-[NSString selectedString]): ditto (-[NSString selectedAttributedString]): ditto (-[NSString selectAll]): ditto (-[NSString deselectAll]): ditto * WebView.subproj/WebDocumentPrivate.h: made <WebDocumentSelection> incorporate <WebDocumentText> rather than just <NSObject> * WebView.subproj/WebHTMLView.h: removed <WebDocumentText> from protocol list since it's covered by <WebDocumentSelection> * WebView.subproj/WebPDFView.h: ditto * WebView.subproj/WebTextView.h: ditto * WebView.subproj/WebTextView.m: removed the methods that were moved into WebSearchableTextView.m 2005-12-10 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - fix http://bugs.webkit.org/show_bug.cgi?id=6032 REGRESSION: Uncaught exception when image is dragged out of webpage * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): Pass the image renderer, not the NSImage. (-[WebHTMLView elementAtPoint:]): Add an NSImage to the dictionary, which now comes from WebCore with only an image renderer. * WebView.subproj/WebView.m: (-[WebView _writeImageElement:withPasteboardTypes:toPasteboard:]): Pass the image renderer, not the NSImage. 2005-12-10 Darin Adler <darin@apple.com> Was getting build failures related to "count" methods. Made Tim's build fix Leopard-only. * WebView.subproj/WebPreferencesPrivate.h: Go back to <PDFKit/PDFKit.h> on Tiger. 2005-12-09 John Sullivan <sullivan@apple.com> Reviewed by Adele Peterson. - fixed <rdar://problem/4373905> Cannot paste in Tiger Mail using TOT WebKit * WebView.subproj/WebView.m: (-[WebView _frameForCurrentSelection]): I removed this method many moons ago when restructuring the code involving frames and selection. Too bad Mail was still using it (d'oh!). In Leopard Mail has updated to use newer SPI (which should become API), but to continue to work with Mail on Tiger we need this method to be around. Now it's just a cover for the method _selectedOrMainFrame, to which it was renamed so very long ago. 2005-12-09 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. * Carbon.subproj/HIWebView.m: (UpdateCommandStatus): Don't call -performSelector:withObject: on a method that returns a BOOL; this is not guaranteed to work on all architectures. -performSelector:withObject:'s return value should only be checked if the method returns an object. 2005-12-09 Timothy Hatcher <timothy@apple.com> Reviewed by nobody, build fix. Using <PDFKit/PDFKit.h> was causing build failures for the Mail team. The comment about getting an ambiguous signature conflict anywhere the method "count" is used seems to no longer be an issue. * WebView.subproj/WebPreferencesPrivate.h: Use <Quartz/Quartz.h> 2005-12-08 John Sullivan <sullivan@apple.com> Reviewed by Tim Hatcher. Some cleanup of how selection rects are associated with NSViews. * WebView.subproj/WebDocumentPrivate.h: Added a -selectionView method to <WebDocumentSelection>, and clarified that the selectionRect is in the coordinate system of this view. * Misc.subproj/WebSearchableTextView.m: (-[WebSearchableTextView selectionView]): new method, returns self * WebView.subproj/WebHTMLView.m: (-[WebHTMLView selectionView]): new method, returns self * WebView.subproj/WebPDFView.m: (-[WebPDFView selectionRect]): translate result into coordinate system of [PDFSubview documentView] (-[WebPDFView selectionView]): new method, returns [PDFSubview documentView] 2005-12-08 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick and Dave Hyatt. - fixed these semi-legendary bugs: <rdar://problem/4032405> Inline PDF doesn't get keyboard focus like web pages do, so can't scroll with keys without clicking <rdar://problem/4265684> PDFs use secondary selection when displaying found text (4748) * WebView.subproj/WebPDFView.m: (-[WebPDFView becomeFirstResponder]): Discovered that there is indeed PDFKit API for accessing the view that becomes focused; now passes the focus down to that view. 2005-12-08 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - Added WebKit mechanism to help correctly pass the first responder into the PDF view hierarchy, in order to start addressing keyboard focus and selection highlight issues. Unfortunately this doesn't actually have any user effect yet due to problems that must be fixed in PDFKit. * WebView.subproj/WebPDFView.m: (-[WebPDFView acceptsFirstResponder]): Overridden to returns YES. Needed so NSClipView knows it's OK to pass focus down to this level. (-[WebPDFView becomeFirstResponder]): With setNextKeyView:, splices the PDF view into the focus-passing mechanism in much the same way as NSScrollView and NSClipView. (-[WebPDFView setNextKeyView:]): With becomeFirstResponder:, splices the PDF view into the focus-passing mechanism in much the same way as NSScrollView and NSClipView. (-[WebPDFView resignFirstResponder]): Removed this method because the WebPDFView itself is never first responder except transiently. 2005-12-08 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - some small changes towards frame tree refactoring Renamed WebViewSets to WebFrameNamespaces, and put the method for performing a selector on all extant WebViews to WebView itself, with a separate set tracking live WebViews. This should allow moving the storage of this info down to WebCore more easily. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge closeWindowSoon]): (-[WebBridge runModal]): * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory refreshPlugins:]): * WebView.subproj/WebControllerSets.h: * WebView.subproj/WebControllerSets.m: (+[WebFrameNamespaces addWebView:toFrameNamespace:]): (webView::if): (+[WebFrameNamespaces webViewsInFrameNamespace:]): * WebView.subproj/WebView.m: (+[WebView _makeAllWebViewsPerformSelector:]): (-[WebView _removeFromAllWebViewsSet]): (-[WebView _addToAllWebViewsSet]): (-[WebView _close]): (-[WebView _findFrameNamed:sourceFrame:]): (-[WebView _commonInitializationWithFrameName:groupName:]): (-[WebView setGroupName:]): * WebView.subproj/WebViewInternal.h: 2005-12-08 Darin Adler <darin@apple.com> Reviewed by Eric. - fixed http://bugs.webkit.org/show_bug.cgi?id=5689 add support for CSS "custom cursors" (cursor images) * WebCoreSupport.subproj/WebImageRenderer.h: Remove declaration of TIFFRepresentation and image methods since both are required by the WebCoreImageRenderer protocol now and we don't have to re-declare them. * Misc.subproj/WebNSPasteboardExtras.m: Add an import of the WebCoreImageRenderer.h file since we need to use methods inherited from that protocol. * Misc.subproj/WebNSViewExtras.m: Ditto. * WebCoreSupport.subproj/WebImageRenderer.m: Ditto. (Use and implement.) 2005-12-07 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Maciej, landed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=5878 REGRESSION (WebTextRenderer.m r1.201): pointToOffset always takes the CG code path * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer pointToOffset:style:position:reversed:includePartialGlyphs:]): Added the missing "return". 2005-12-07 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - <rdar://problem/4331488> TOT Assertion failure in -[WebHTMLView nextValidKeyView] @ home.netscape.com * WebView.subproj/WebHTMLView.m: (-[NSArray nextValidKeyView]): Removed assert that I added a while back. In this case at least, the assertion is overzealous, and I can't recreate the tortured chain of logic that led me to adding this assertion in the first place. 2005-12-06 David Harrison <harrison@apple.com> Reviewed by Darin. - fix <rdar://problem/4365308> Glendale Regression: Floating dictionary doesn't work well in Safari text areas/fields Add use of NSAccessibilityHitTest to the list of exceptions. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView hitTest:]): check for NSFlagsChanged event. 2005-12-05 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. * WebView.subproj/WebHTMLView.m: (-[NSArray validateUserInterfaceItem:]): one more tweak: moved jumpToSelection: to be validated the same way as centerSelectionInVisibleArea:, since it now calls the same code. Might not make a difference in any real code, but you never know. 2005-12-05 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. * WebView.subproj/WebHTMLView.m: (-[NSArray validateUserInterfaceItem:]): removed double handling of centerSelectionInVisibleArea 2005-12-05 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - WebKit part of fix for <rdar://problem/4365690> Find > Jump to Selection does nothing on plain-text documents (inc. source HTML) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView jumpToSelection:]): Reimplement jumpToSelection: to call centerSelectionInVisibleArea:, and added a comment explaining why jumpToSelection: exists at all. Note that centerSelectionInVisibleArea: was already implemented here; it was added as part of HTML editing implementation without us realizing that it was the API replacement for jumpToSelection:. (-[WebHTMLView validateUserInterfaceItem:]): validate centerSelectionInVisibleArea: the same way we validate jumpToSelection: (we should have done this when centerSelectionInVisibleArea: was implemented) * WebView.subproj/WebPDFView.m: (-[WebPDFView centerSelectionInVisibleArea:]): new method, same code that jumpToSelection: used to have (-[WebPDFView jumpToSelection:]): now calls centerSelectionInVisibleArea:, and there's now a comment about why it exists at all. (-[WebPDFView validateUserInterfaceItem:]): validate centerSelectionInVisibleArea: the same way we validate jumpToSelection: 2005-12-04 Tim Omernick <timo@apple.com> Reviewed by Dave Harrison, John Sullivan. <rdar://problem/4364847> REGRESSION: QuickTime movies open without controller or don't open at all (5928) I changed WebFrameView on 2005-11-29 so that it avoids creating duplicate WebPluginDocumentViews. Unfortunately, this change caused a regression due to the fact that it subtly changed when plugins are initialized. Certain plugins (e.g. QuickTime) expect to be initialized after the WebPluginDocumentView has been "committed" (inserted into the view hierarchy). My fix is to ensure that the plugin is initialized where we previously would have created that second WebPluginDocumentView -- that is, the plugin is created after the WebPluginDocumentView has been committed. * Plugins.subproj/WebPluginDocumentView.m: (-[WebPluginDocumentView setDataSource:]): Don't initialize the plugin if the WebPluginDocumentView has not been inserted into the view hierarchy. We assume here that a later call to -setDataSource: will pass this conditional, once the WebDocumentView has been committed. 2005-12-02 Justin Garcia <justin.garcia@apple.com> <rdar://problem/4345030> Denver REGRESSION (10.4.2-10.4.3): Two identical warnings on "Back" from Amazon's package tracker Before checking the navigation policy for a request, the request is compared against the last checked request. If the two are the same, no check is done. In the bug, the two requests are identical except for the boolean on NSURLRequests that tells Foundation to support multipart loads for that request. One request was the one that was used to start servicing "Back" operation, and the second was being used to start loading the page (it needed to be reloaded because it was the result of a form submission). Set the boolean on all NSURLRequests, not just one's that are about to be used to start a load. Reviewed by harrison * WebView.subproj/WebDataSource.m: (-[WebDataSource _startLoading:]): (-[WebDataSource initWithRequest:]): * WebView.subproj/WebDataSourcePrivate.h: 2005-12-01 Darin Adler <darin@apple.com> Reviewed by Vicki. - fix <rdar://problem/4349721> Regression: Hovering over menu item doesn't highlight menu item or mousing up on menu item in applet does not open URL in new window at smartmoney.com Since Java depends on doing a hit test inside it's mouse moved handling, let hit testing on Java applets go through the standard NSView code path. Since this should only happen for Java, add a global so that we can Use our own WebHTMLView hit testing when calling from _updateMouseoverWithEvent. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _hitViewForEvent:]): rename forceRealHitTest to forceNSViewHitTest (-[WebHTMLView _updateMouseoverWithEvent:]): set global variable to force a WebHTMLView-style hit test from here (-[WebHTMLView hitTest:]): perform the appropriate hit test based on global variables 2005-11-29 Andrew Wellington <proton@wiretapped.net> Reviewed by darin. Committed by eseidel. Fix for: http://bugs.webkit.org/show_bug.cgi?id=4726 Drop of multiple non-image file URLs only yields one item * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _documentFragmentWithPaths:]): 2005-11-29 Tim Omernick <timo@apple.com> Reviewed by John Sullivan, Eric Seidel <rdar://problem/4340787> Safari & Dashcode create 2 instances of the QC plug-in * WebView.subproj/WebFrameView.m: (-[WebFrameView _makeDocumentViewForDataSource:]): Instead of creating a new WebDocumentView, use the WebDataSource's representation if it is a WebDocumentView of the appropriate class. Right now, this can only happen when the loading document is a standalone WebKit plugin, because WebPluginDocumentView is both the WebDocumentView and the WebDocumentRepresentation for that kind of page load. I have verified that this does not affect other kinds of page loads; in all other cases, the representation class is distinct from the document view class. I talked with Chris Blumenberg about this change (he knows this code), and he agreed that this is the right approach. 2005-11-28 Alexey Proskuryakov <ap@nypop.com> Reviewed by Darin. Committed by Maciej. - fixed "Word completion doesn't work at end of word (unless last word)" (http://bugs.webkit.org/show_bug.cgi?id=4062) * WebView.subproj/WebHTMLView.m: (-[WebTextCompleteController doCompletion]): 2005-11-28 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. Probable fix for <rdar://problem/4356060> crash in -[WebHistoryItem _mergeAutoCompleteHints:] * History.subproj/WebHistory.m: (-[WebHistoryPrivate addItem:]): retain/release oldEntry until we're done with it, since removing it from dictionary might cause it to be dealloc'ed otherwise. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem _mergeAutoCompleteHints:]): added an assert 2005-11-26 Alexey Proskuryakov <ap@nypop.com> Reviewed by mjs. Committed by eseidel. Fix for http://bugs.webkit.org/show_bug.cgi?id=5230 "characterIndexForPoint: not yet implemented" * WebView.subproj/WebHTMLView.m: (-[WebHTMLView characterIndexForPoint:]): (-[WebHTMLView firstRectForCharacterRange:]): 2005-11-22 Darin Adler <darin@apple.com> * WebView.subproj/WebView.h: Fixed incorrect comment in public header. 2005-11-18 Vicki Murley <vicki@apple.com> Changes by Tim H, reviewed by Vicki. - call shouldClose on the bridge for the main frame * WebView.subproj/WebView.m: (-[WebView shouldClose]): 2005-11-18 Vicki Murley <vicki@apple.com> Changes by Darin, reviewed by Beth and Vicki. - fix <rdar://problem/3939265> support "before unload" event and onbeforeunload handler (supported by both IE and Mozilla) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge canRunBeforeUnloadConfirmPanel]): (-[WebBridge runBeforeUnloadConfirmPanelWithMessage:]): * WebView.subproj/WebFrame.m: (-[WebFrame _checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): * WebView.subproj/WebUIDelegatePrivate.h: * WebView.subproj/WebView.m: (-[WebView shouldClose]): * WebView.subproj/WebViewPrivate.h: 2005-11-10 Maciej Stachowiak <mjs@apple.com> Build fix, not reviewed. * Plugins.subproj/WebBaseNetscapePluginViewInternal.h: Added. 2005-11-10 Tim Omernick <timo@apple.com> Reviewed by Geoff. <rdar://problem/4237941> Dashboard needs a way to stop Netscape plug-ins from getting null events * Plugins.subproj/WebBaseNetscapePluginViewInternal.h: Added. Added WebInternal category, with -stopNullEvents and -restartNullEvents. These methods already exist on WebBaseNetscapePluginView. I am just exposing them to callers elsewhere within WebKit. * WebKit.xcodeproj/project.pbxproj: Added WebBaseNetscapePluginViewInternal.h. * WebView.subproj/WebFrame.m: (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]): Walks down the web frame hierarchy and calls -_pauseNullEventsForAllNetscapePlugins on each WebHTMLView. (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]): Same as above, but calls -_resumeNullEventsForAllNetscapePlugins. * WebView.subproj/WebFramePrivate.h: Declared -_recursive_pauseNullEventsForAllNetscapePlugins and -_recursive_pauseNullEventsForAllNetscapePlugins. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]): Checks subviews for WebBaseNetscapePluginViews, and calls -stopNullEvents on them. (-[WebHTMLView _resumeNullEventsForAllNetscapePlugins]): Same as above, but calls -restartNullEvents. * WebView.subproj/WebHTMLViewInternal.h: Declared -_pauseNullEventsForAllNetscapePlugins and -_resumeNullEventsForAllNetscapePlugins. 2005-11-07 Geoffrey Garen <ggaren@apple.com> Darin reviewed this a while back. - Fixed <rdar://problem/4161660> window.close followed by window.print in onload handler crashes Safari in KJS::ScopeChain::bottom (redmccombstoyota.com) Added a call to stopLoading inside closeWindowSoon to prevent load events from firing after a window has torn down. Manual test case: WebCore/manual-tests/window-close-during-parsing.html * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge closeWindowSoon]): 2005-11-03 Timothy Hatcher <timothy@apple.com> Reviewed by Darin and Vicki. * WebKit.xcodeproj/project.pbxproj: Change to use $(SYSTEM_LIBRARY_DIR) consistently and place $(NEXT_ROOT) in a few spots to make build-root work. 2005-11-01 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. <rdar://problem/4318632> I've added a new notification, WebPluginWillPresentNativeUserInterfaceNotification. Plugins are expected to post this notification before presenting "native UI", such as dialog boxes. A Dashboard client can observe this notification to hide the Dashboard layer when plugins present external UI. * English.lproj/StringsNotToBeLocalized.txt: Added "WebPluginWillPresentNativeUserInterface". * Plugins.subproj/WebPluginsPrivate.h: Added. * Plugins.subproj/WebPluginsPrivate.m: Added. Declare WebPluginWillPresentNativeUserInterfaceNotification. * WebKit.xcodeproj/project.pbxproj: Added WebPluginsPrivate.[hm] * WebKit.exp: Added _WebPluginWillPresentNativeUserInterfaceNotification. 2005-11-01 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. fixed deployment build by hiding local variables used only in ASSERTs on builds for which ASSERT_DISABLED is true. * History.subproj/WebHistory.m: (-[WebHistoryPrivate removeItemForURLString:]): (-[WebHistoryPrivate setLastVisitedTimeInterval:forItem:]): 2005-11-01 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - fixed <rdar://problem/4324104> Assertion failure (foundDate) in WebHistory WebFrame was updating the last visited date on a WebHistoryItem behind WebHistory's back, causing WebHistory's caches of items by date to get out of sync with reality. Changed to set the date through WebHistory rather than directly. * History.subproj/WebHistory.m: (-[WebHistoryPrivate _removeItemFromDateCaches:]): New method, extracted from removeItemForURLString. (-[WebHistoryPrivate removeItemForURLString:]): Now calls extracted method. Cleaned up white space a little. (-[WebHistoryPrivate _addItemToDateCaches:]): New method, extracted from addItem: (-[WebHistoryPrivate addItem:]): Now calls extracted method. Cleaned up white space a little. (-[WebHistoryPrivate setLastVisitedTimeInterval:forItem:]): New method, removes item from date caches, changes date, then adds item back to date caches and sends notification. (-[WebHistory setLastVisitedTimeInterval:forItem:]): New method, cover for WebHistoryPrivate version. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem _setLastVisitedTimeInterval:]): Don't send notification here; send from new WebHistory method instead. * History.subproj/WebHistoryItemPrivate.h: Added comment about avoiding incorrect use of _setLastVisitedTimeInterval: * History.subproj/WebHistoryPrivate.h: Added declarations for WebHistory and WebHistoryPrivate versions of setLastVisitedTimeInterval:forItem: * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): change history item's date via new WebHistory method rather than directly 2005-10-25 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Remove the use of a stamp file in the Frameworks symlink build phase. This lets us pass the build verification. * WebKit.xcodeproj/project.pbxproj: 2005-10-24 Darin Adler <darin@apple.com> Reviewed by Geoff. - change internal methods in WebTextRenderer to be functions in case this has any effect on speed (also makes things a bit clearer, in my opinion) * WebCoreSupport.subproj/WebTextRenderer.h: Made all fields public, which is OK since this is really a private class. Made setAlwaysUseATSU: class method public too for the same reason. * WebCoreSupport.subproj/WebTextRenderer.m: Change all methods to functions. (destroy): Function name for method free. (-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]): Removed code to first subtract lineSpacing - descent, then later add it back. (getSmallCapsRenderer): Function name for method smallCapsRenderer. (findSubstituteFont): Function name for method substituteFontForString:families:. (findSubstituteRenderer): Function name for method substituteRendererForCharacters:length:families:. (updateGlyphMapEntry): Function name for method updateGlyphEntryForCharacter:glyphID:substituteRenderer:. (extendGlyphMap): Function name for method extendCharacterToGlyphMapToInclude:. (extendWidthMap): Function name for method extendGlyphToWidthMapToInclude:. (getTextBounds): Function name for method trapezoidForRun:style:atPoint:. 2005-10-24 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin. Committed by David Harrison. http://bugs.webkit.org/show_bug.cgi?id=5415 "Left border of selection highlight leaves behind a trail" * manual-tests/drag_select_highlighting.html: Added. (this test case was added to WebCore) * WebCoreSupport.subproj/WebTextRenderer.m: (overrideLayoutOperation): (-[WebTextRenderer CG_drawHighlightForRun:style:geometry:]): (-[WebTextRenderer ATSU_drawHighlightForRun:style:geometry:]): (advanceWidthIterator): 2005-10-23 Tim Omernick <tomernick@apple.com> Reviewed by Dave Hyatt. <http://bugs.webkit.org/show_bug.cgi?id=5365> Send -webPlugInStop (or -pluginStop) and -webPluginDestroy (or -pluginDestroy) to complying plugins right when they're removed from the WebHTMLView, and also release them from the plugin controller's arrays. I think this patch makes WebKit behave more like plugins expect it to, which is the way it already behaves with Netscape plugins. I expect complying plugins to stop making noise when receiving the stop message, but QuickTime doesn't. If it's lucky, then it will be deallocated because of the release and will stop then. However, JS, for one, can retain the plugin (e.g. if you execute <javascript:document.getElementById('obj').width;> before clicking Remove OBJECT), in which case it will just keep playing. * Plugins.subproj/WebPluginController.h: * Plugins.subproj/WebPluginController.m: (-[WebPluginController destroyPlugin:]): Stop and destroy the plugin. * WebView.subproj/WebHTMLView.m: (-[NSArray willRemoveSubview:]): Destroy plugins when they are removed from the HTML view. 2005-10-23 Geoffrey Garen <ggaren@apple.com> Reviewed by Maciej. For better abstraction, made the tokenizer -- instead of the data source -- responsible for calling [WebFrame _checkLoadComplete] when the tokenizer stops. * WebView.subproj/WebDataSource.m: (-[WebDataSource _stopLoadingInternal]): 2005-10-21 Geoffrey Garen <ggaren@apple.com> Reviewed by darin. WebKit side of the fix for <rdar://problem/4184719> window.print() followed by window.close() causes world leak No test case added because I have another reviewed patch that will include a test for this bug as well as many others. Under some conditions, [WebDataSource stopLoading] did not set [WebDataSource isLoading] to false, so the didFInishLoad delegates never fired. The reason isLoading didn't become false was that the tokenizer was still running. The fix here is to move the call to [WebCoreBridge stopLoading] above the early return inside [WebDataSource stopLoading] -- since the tokenizer may still be running even if the loader is finished loading -- and then to call [WebFrame _checkLoadComplete] to give the frame a chance to fire its delegates. * WebView.subproj/WebDataSource.m: (-[WebDataSource _stopLoadingInternal]): 2005-10-21 Beth Dakin <bdakin@apple.com> Reviewed by Darin?? Fix for <rdar://problem/3853672> Malformed HTML using crashes Safari in NSFireTimer The webFrame was being deleted prematurely by a call to stop(), so we changed it so that the calls to _receivedMainResourceError and _mainReceivedError happen before the stop(), and we retain the bridge. * WebView.subproj/WebDataSource.m: (-[WebDataSource _receivedMainResourceError:complete:]): 2005-10-21 Geoffrey Garen <ggaren@apple.com> Patch by TimO, Reviewed by hyatt, tested and landed by me. Found what appears to be a misguided optimization that actually causes a measurable performance problem. A fixed-size buffer was allocated on the stack to pass into CFURLGetBytes(), presumably to avoid malloc() for URLs less than 2048 bytes. There was also a fallback which malloc()'ed a buffer in case the fixed-size buffer was too small to hold the URL's bytes. This malloc()'ed buffer was then wrapped in an NSData using +dataWithBytesNoCopy:length:, avoiding a memory copy (yay!) The problem with this approach is two-fold: 1. Regardless of how the buffer was allocated and filled, it is immediately wrapped in an NSData using +dataWithBytes:length:, which copies the input bytes. This is pretty much unavoidable; we need to get the data into a malloc()'ed buffer to return it to the caller, unless the caller provides its own storage (which would be super inconvenient). 2. The size of the fixed buffer was large enough that it fit most (if not all) URLs involved in our Page Load Test. This means the unintentionally-inefficient case was by far the most *common* case! My fix is to malloc() the buffer from the start, and then use +[NSData dataWithBytes:length:freeWhenDone:] to wrap the buffer in an NSData. This avoids a memory copy for the normal case where a URL is less than 2048 bytes, and keeps the efficient behavior for the uncommon long URL case. * Misc.subproj/WebNSURLExtras.m: (-[NSURL _web_originalData]): 2005-10-21 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed and landed by Darin. - fixed a couple regressions caused by my last check-in http://bugs.webkit.org/show_bug.cgi?id=5437 http://bugs.webkit.org/show_bug.cgi?id=5443 * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer CG_drawHighlightForRun:style:geometry:]): Compute background width correctly, by subtracting position after run from position before run. (addDirectionalOverride): Make the range include only the characters between the directional override characters, not the directional override characters themselves. (initializeWidthIterator): Correctly compute "widthToStart" based on the offset to the beginning of the run, not to the end of the run! 2005-10-19 Darin Adler <darin@apple.com> Reviewed by Maciej. - optimizations for a total of about 1% speed-up on PLT * WebCoreSupport.subproj/WebTextRenderer.h: Updated to use bool instead of BOOL, since BOOL is a signed char (which is not so efficient, at least on PPC). * WebCoreSupport.subproj/WebTextRenderer.m: (isSpace): Changed BOOL to bool and UniChar to UChar32. This actually fixes a potential bug when the passed-in character is a non-BMP character (> FFFF). (isRoundingHackCharacter): Ditto. (widthForGlyph): Merged getUncachedWidth, widthFromMap, and widthForGlyph into one function. Marked it inline. Changed to include syntheticBoldOffset in the cached widths to save an add in the cached case. Instead of the special constant UNINITIALIZED_GLYPH_WIDTH, just check for a width >= 0. This allows us to use a negative number or NAN for the uninitialized width value -- I chose NAN. (overrideLayoutOperation): Use bool instead of Boolean in one place. (-[WebTextRenderer initWithFont:]): Use lroundf instead of ROUND_TO_INT. (-[WebTextRenderer floatWidthForRun:style:]): Put the code to choose the ATSU vs. CG code path back in here, because there are no callers inside the class that need to call both. (-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]): Use bool instead of BOOL. (+[WebTextRenderer setAlwaysUseATSU:]): Ditto. (fontContainsString): Ditto. (-[WebTextRenderer computeWidthForSpace]): Ditto. Also use roundf instead of using ROUND_TO_INT. (-[WebTextRenderer setUpFont]): Use bool instead of BOOL. (drawGlyphs): Ditto. (-[WebTextRenderer CG_drawHighlightForRun:style:geometry:]): Restructure the code so it can use the new advanceWidthIterator function instead of the old widthForNextCharacter function. (-[WebTextRenderer CG_drawRun:style:geometry:]): Use malloc instead of calloc since we don't need initialization. Call CG_floatWidthForRun instead of floatWidthForRun -- no need to re-check whether to use the CG or ATSU code path. Removed code to handle a renderer of 0 since we no longer generate that in the renderers array in advanceWidthIterator. (CG_floatWidthForRun): Changed to call the new advanceWidthIterator instead of the old widthForNextCharacter. (-[WebTextRenderer extendCharacterToGlyphMapToInclude:]): Use malloc instead of calloc and explicitly initialize the one field that needs it. Fixed a potential storage leak by adding a call to WKClearGlyphVector. Initialize the renderers to self instead of to 0. (-[WebTextRenderer extendGlyphToWidthMapToInclude:]): Initialize the widths to NAN instead of UNINITIALIZED_GLYPH_WIDTH. (addDirectionalOverride): Fixed bug where the first and last character in the buffer could be uninitialized and where characters before and after the direction override could be incorrect. (-[WebTextRenderer ATSU_drawRun:style:geometry:]): Use bool instead of BOOL. (-[WebTextRenderer ATSU_pointToOffset:style:position:reversed:includePartialGlyphs:]): Ditto. (advanceWidthIteratorOneCharacter): Added new helper function for CG_pointToOffset. (-[WebTextRenderer CG_pointToOffset:style:position:reversed:includePartialGlyphs:]): Reimplemented to use advanceWidthIteratorOneCharacter instead of widthForNextCharacter. Also call CG_floatWidthForRun instead of floatWidthForRun since we don't need to reconsider whether to use CG or ATSU. (glyphForCharacter): Removed the map parameter and changed the renderer parameter to be an in-out one. Removed uneeded special case for when map is 0 and always get the renderer from the map. Also call extendCharacterToGlyphMapToInclude in here instead of making that the caller's responsibility. (initializeWidthIterator): Renamed to make the name shorter (removed "Character"). Streamlned common cases like "no padding" and removed some unneeded casts. Changed to use advanceWidthIterator to compute width fo the first part of the run. (normalizeVoicingMarks): Factored this out into a separate function, since it's not part of the common case. (advanceWidthIterator): Changed widthForNextCharacter to this, eliminating per-character function overhead for iterating past a few characters. Merged the handling of surrogate pairs and of voicing marks so that we typically only have to do one "if" to rule out both. Merged the mirroring for RTL and uppercasing for small caps into a single boolean so that we only need one "if" to rule out both. Call the new glyphForCharacter. Check for the character '\t' first since that's cheaper than looking at tabWidth. Check tabWidth for 0 first so that we don't have to convert it to floating point when not using it. Changed the special case for spaces to first check width, so that we don't bother with the rest of the code for glyphs not the same width as spaces. Fixed substitution code to call CG_floatWidthForRun -- no need to reconsider whether to use CG or ATSU. Also changed to properly get width from the result of that function. Merged the handling of letter spacing, padding, and word spacing into a single boolean so that we typically only have to do one "if" to rule out all three. Check for letterSpacing of 0 first so that we don't have to convert it to floating point when not using it. Same for padding and wordSpacing. Move the work from ceilCurrentWidth in line into this function. Assume that either we have all three pointers (widths, renderers, glyphs), or none of the three, to cut down on branches. (fillStyleWithAttributes): Use bool instead of BOOL. (shouldUseATSU): Ditto. * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _web_widthWithFont:]): Update since the floatWidthForRun method no longer takes a widths parameter. * Misc.subproj/WebStringTruncator.m: (stringWidth): Ditto. 2005-10-19 Tim Omernick <tomernick@apple.com> Reviewed by eseidel & darin. Changed some of the run measurement methods to C functions to avoid overhead associated with objc_msgSend(). * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer floatWidthForRun:style:widths:]): Updated to call new run measurement functions instead of calling ObjC methods. (-[WebTextRenderer CG_drawRun:style:geometry:]): ditto (floatWidthForRun): ditto (CG_floatWidthForRun): ditto (ATSU_floatWidthForRun): ditto (widthForNextCharacter): ditto 2005-10-14 Vicki Murley <vicki@apple.com> Changes by Mitz Pettel, reviewed by Maciej. Fix http://bugs.webkit.org/show_bug.cgi?id=5029 (Assertion failure in -[NSPasteboard(WebExtras) _web_writeImage:URL:title:archive:types:] when trying to drag an image from a site with no favicon) * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeImage:URL:title:archive:types:]): Prefer the main resource if it is an image 2005-10-12 Vicki Murley <vicki@apple.com> Reviewed by Darin. - fix <rdar://problem/4043643> iframe swallows events for overlapping elements (3449) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView hitTest:]): (-[WebHTMLView _updateMouseoverWithEvent:]): eliminate _hitViewForEvent hackery and self dependency from this function 2005-10-12 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Define WebNSInt and WebNSUInt to wrap around NSInt on Leopard and still build on Tiger Once building on Tiger isn't needed we will drop WebNSInt and use NSInt * WebView.subproj/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate webView:resource:didReceiveContentLength:fromDataSource:]): * WebView.subproj/WebFrame.m: (-[WebFrame _sendRemainingDelegateMessagesWithIdentifier:response:length:error:]): * WebView.subproj/WebLoader.m: (-[NSURLProtocol didReceiveData:lengthReceived:]): * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebUIDelegate.h: * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView _mouseDidMoveOverElement:modifierFlags:]): (-[WebView spellCheckerDocumentTag]): * WebView.subproj/WebViewInternal.h: * WebView.subproj/WebViewPrivate.h: 2005-10-12 Darin Adler <darin@apple.com> * WebView.subproj/WebPolicyDelegate.h: Fix a comment. 2005-10-11 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Test for 10.4 because of <rdar://problem/4243463> * WebView.subproj/WebHTMLView.m: (-[WebHTMLView conversationIdentifier]): 2005-10-11 Adele Peterson <adele@apple.com> Rolling out fix for http://bugs.webkit.org/show_bug.cgi?id=5195 since it caused: REGRESSION text areas draw focus ring around each glyph, no caret in text fields http://bugs.webkit.org/show_bug.cgi?id=5335 * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _propagateDirtyRectsToOpaqueAncestors]): (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]): (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): 2005-10-09 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed http://bugs.webkit.org/show_bug.cgi?id=5195 Would like API to flush rendering of pending DOM changes This was actually a Tiger regression. When AppKit added a new code path for rendering NSView, our special hack for doing layout when we draw didn't work any more. So we were able to fix this without adding any API. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _recursiveDisplayRectIgnoringOpacity:inContext:topView:]): Added. Does the same thing that other _recursiveDisplay methods do. 2005-10-08 Alexey Proskuryakov <ap@nypop.com> Reviewed by Maciej. - fixed http://bugs.webkit.org/show_bug.cgi?id=5187 UTF-8 in long text files breaks at some point * WebView.subproj/WebTextRepresentation.m: (-[WebTextRepresentation finishedLoadingWithDataSource:]): Call flushReceivedData on the WebTextView so it can decode any final bytes. * WebView.subproj/WebTextView.h: Added WebCoreTextDecoder field and flushReceivedData method. * WebView.subproj/WebTextView.m: (-[WebTextView dealloc]): Release WebCoreTextDecoder. (-[WebTextView appendReceivedData:fromDataSource:]): Create a WebCoreTextDecoder to decode the text; use the textEncodingName from the data source. Use it to decode instead of the data source's stringWithData. (-[WebTextView flushReceivedData]): Call flush on the decoder and append any last bytes to the text view. 2005-10-07 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. WebKit support for allowing clients to know which frame originated a particular JavaScript alert/dialog. * WebView.subproj/WebUIDelegatePrivate.h: New optional delegate methods for the three JavaScript alert/dialogs. These are just like the existing ones in WebUIDelegate.h except that each adds a parameter specifying the frame that the JavaScript was running in. Eventually we'll deprecate the old three methods in favor of these in the public API. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge runJavaScriptAlertPanelWithMessage:]): Call version of the delegate method that has the frame parameter if the delegate supports it. (-[WebBridge runJavaScriptConfirmPanelWithMessage:]): ditto (-[WebBridge runJavaScriptTextInputPanelWithPrompt:defaultText:returningText:]): ditto * WebView.subproj/WebDefaultUIDelegate.m: (-[WebDefaultUIDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:]): Now implements the new version of the delegate method that includes the frame parameter. (Still doesn't do anything though.) (-[WebDefaultUIDelegate webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:]): Now implements the new version of the delegate method that includes the frame parameter. (Still doesn't do anything though.) (-[WebDefaultUIDelegate webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:]): Now implements the new version of the delegate method that includes the frame parameter. Doesn't actually use the frame parameter here yet though. 2005-10-06 Darin Adler <darin@apple.com> - fixed compiling on Deployment * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:]): Put initialFont inside !LOG_DISABLED. 2005-10-06 Darin Adler <darin@apple.com> Reviewed by Eric. - tweaked formatting * WebCoreSupport.subproj/WebTextRenderer.m: Changed function names to remove underscores; fixed formatting to match our coding guidelines, other related tweaks. 2005-10-06 Darin Adler <darin@apple.com> Reviewed by Eric. - fixed regression in drawing of text in non-flipped contexts from my last check-in * WebCoreSupport.subproj/WebTextRenderer.m: (drawGlyphs): Only flip the matrix if the NSGraphicsContext is flipped. (-[WebTextRenderer _ATSU_drawRun:style:geometry:]): Use -[NSGraphicsContext isFlipped] instead of [[NSView focusView] isFlipped]. 2005-10-06 Darin Adler <darin@apple.com> Reviewed by Hyatt. - fixed <rdar://problem/3217793> Monaco bold comes out as Helvetica bold, very bad if you choose Monaco as your fixed-width font - fixed <rdar://problem/3256269> CSS1: bold/italic font styles not programmatically created if font doesn't include them (3231) also <http://bugs.webkit.org/show_bug.cgi?id=3231> * WebCoreSupport.subproj/WebTextRenderer.h: Removed public declarations of private structures that are not used in the header. Removed the separate 16-bit character map; the difference in code size is only a few bytes per page and there's no measurable performance difference by always using the 32-bit character version. Removed substitute font width maps altogether, since we now use the width map in the substitute font's renderer. Also removed a few more now-unused fields and methods. Changed initWithFont to take WebCoreFont. Changed the setAlwaysUseATSU: method to remove the underscore prefix. * WebCoreSupport.subproj/WebTextRenderer.m: (getUncachedWidth): Get font from WebCoreFont directly instead of taking a parameter, since we now use only one NSFont per WebTextRenderer. (widthFromMap): Removed NSFont parameter for same reason as above; simplified. (widthForGlyph): Ditto. (overrideLayoutOperation): Updated for change to WebCoreFont. (-[WebTextRenderer initWithFont:]): Changed to use WebCoreFont. Removed code to deal with substitute font maps. Changed lineGap computation to use floats instead of doubles. Added code to compute a synthetic bold offset. Currently this is the font size divided by 24 and then rounded up to an integer. (-[WebTextRenderer dealloc]): Updated for change to WebCoreFont and other related changes. (-[WebTextRenderer finalize]): Ditto. (-[WebTextRenderer xHeight]): Ditto. (-[WebTextRenderer drawRun:style:geometry:]): Remove small caps case here; no longer needed. Also updated as above. (-[WebTextRenderer floatWidthForRun:style:widths:]): Ditto. (-[WebTextRenderer drawHighlightForRun:style:geometry:]): Ditto. (-[WebTextRenderer pointToOffset:style:position:reversed:includePartialGlyphs:]): Ditto. (+[WebTextRenderer setAlwaysUseATSU:]): Renamed to remove underscore prefix. (-[WebTextRenderer smallCapsRenderer]): Ditto. Changed to create a renderer for the smaller sized font. (-[WebTextRenderer _substituteFontForString:families:]): Reorganized this to be more readable and to call the new rendererForAlternateFont method. (-[WebTextRenderer rendererForAlternateFont:]): Added. Used to select an alternate font taking into account bold and italic synthesis. (-[WebTextRenderer substituteRendererForCharacters:length:families:]): Renamed to remove underscore prefix. Updated to use rendererForAlternateFont. (-[WebTextRenderer _computeWidthForSpace]): Updated for name changes and to remove unnecessary parameters. (-[WebTextRenderer setUpFont]): Renamed to remove underscore prefix. Added code to get printer or screen font as specified by WebCoreFont so calers don't need to do this. (drawGlyphs): Renamed to remove underscore prefix. Added code for synthetic oblique (14 degree slant), and synthetic bold (add offset and draw text a second time). (-[WebTextRenderer _CG_drawRun:style:geometry:]): Keep an array of substitute renderers instead of fonts. Changed around the loop to reverse the run to be a single loop instead of 3. (-[WebTextRenderer floatWidthForRun:style:widths:substituteRenderers:glyphs:startPosition:numGlyphs:]): Renamed to remove the underscore prefix. (-[WebTextRenderer _CG_floatWidthForRun:style:widths:substituteRenderers:glyphs:startPosition:numGlyphs:]): Changed to use subsitute renderers rather than fonts. (-[WebTextRenderer updateGlyphEntryForCharacter:glyphID:substituteRenderer:]): Renamed to remove underscore prefix and changed to use a substitute renderer rather than a substitute NSFont. (-[WebTextRenderer extendCharacterToGlyphMapToInclude:]): Updated to work with all characters, both ones that fit into 16-bit and ones that don't. (-[WebTextRenderer _extendGlyphToWidthMapToInclude:]): Removed NSFont parameter and simplified. This fixes a bug where numberOfGlyphs was accidentally used from the main font instead of "subFont". (glyphForCharacter): Changed to use subsitute renderers instead of substitute fonts. (widthForNextCharacter): Ditto. Also removed small caps code no longer needed here and replaced it with simpler small caps code that no longer assumes glyphs match. (shouldUseATSU): Changed the code to check ranges in order to slightly reduce the number of cases and to create earlier exit for lower character codes. * WebCoreSupport.subproj/WebTextRendererFactory.h: Added caches for synthesized font and oblique variants so we can still use the NSFont as the dictionary key. Removed coalesceTextDrawing methods. Changed methods to use WebCoreFont as the parameters and results instead of NSFont. * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory clearCaches]): Clear all 8 caches. (-[WebTextRendererFactory isFontFixedPitch:]): Changed code slightly so there's only one call to the CFDictionarySetValue function. (-[WebTextRendererFactory init]): Create all 8 caches. (-[WebTextRendererFactory dealloc]): Release all 8 caches. (-[WebTextRendererFactory rendererWithFont:]): Select the appropriate cache based on 3 booleans: synthetic bold, synthetic oblique, and printer. Use WebCoreFont instead of NSFont. (-[WebTextRendererFactory fontWithFamilies:traits:size:]): Set the synthetic bold and oblique flags when returning a WebCoreFont based on requested traits that are not present in the NSFont. (acceptableChoice): Ignore the synthesizable traits when deciding if a chosen font is acceptable. (betterChoice): Rather than assuming that every font has all the desired traits, implement a rule that says a font with an unwanted trait loses out over a font that does not have an unwanted trait. This lets us chose a bold font over a non-bold font that could use synthesized bold but treat both as candidates. * WebCoreSupport.subproj/WebGlyphBuffer.h: Removed. * WebCoreSupport.subproj/WebGlyphBuffer.m: Removed. * WebKit.xcodeproj/project.pbxproj: Removed WebGlyphBuffer source files. * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _web_drawAtPoint:font:textColor:]): Update to use WebCoreFont. (-[NSString _web_widthWithFont:]): Ditto. * Misc.subproj/WebStringTruncator.m: (truncateString): Ditto. (+[WebStringTruncator widthOfString:font:]): Ditto. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): Removed text drawing coalesce method calls. * WebView.subproj/WebTextView.m: (-[WebTextView setFixedWidthFont]): Updated to use cachedFontFromFamily method, which we still have, rather than fontWithFamilies method which we don't (since it now uses WebCoreFont). * WebView.subproj/WebView.m: (+[WebView _setAlwaysUseATSU:]): Updated for name change to underlying method. 2005-10-05 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. <rdar://problem/4158439> Safari appears to hang when sending synchronous XMLHttpRequest that gets no server response No testcase - not testable w/o network. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): Set a timeout of 10. 2005-10-04 Beth Dakin <bdakin@apple.com> Reviewed by Darin Fix for <rdar://problem/4285538> TOT fix for Denver Regression: Drawing glitch in the transparent dialog's cancel/ok button in the widget manager. * WebCoreSupport.subproj/WebImageData.m: Calls WKSetPatternPhaseInUserSpace() which is a new function that lies in WebKitSystemInterface that and takes care of pattern-setting. Prevents regression that occurred with image tiling in transparency layers. (-[WebImageData tileInRect:fromPoint:context:]): 2005-10-03 Tim Omernick <tomernick@apple.com> Reviewed by John Sullivan. <rdar://problem/4281095> Denver regression: Seed: Safari HTML 4.01 <object ...> tag problem * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge determineObjectFromMIMEType:URL:]): If no view class is registered to handle the MIME type, check to see if there is a plugin registered which can handle it. This check is required because the Java plugin does not register an NSView class, so that Java files are downloaded when not embedded. Prior to this fix, -determineObjectFromMIMEType:URL: would always return ObjectElementNone for Java applets (MIME type "application/x-java-applet"), which would cause Java applets embedded in <OBJECT> elements to not be loaded. This broke on 05-03-2005, when we changed how we handle fallback content for <OBJECT> elements so that we could pass the Acid2 test. 2005-09-28 Justin Garcia <justin.garcia@apple.com> Reviewed by geoff Fixed <rdar://problem/4276596> multipart/x-mixed-replace: saved inline images appear only partially loaded Fixed <rdar://problem/4265439> progress bar should look complete even if there is some more multipart content being loaded * WebCoreSupport.subproj/WebSubresourceLoader.h: * WebCoreSupport.subproj/WebSubresourceLoader.m: (-[WebSubresourceLoader didReceiveResponse:]): Now calls signalFinish and saveResource. (-[WebSubresourceLoader signalFinish]): Added. Does the part of didFinishLoading that signals to the WebDataSource and load delegates that the load is finished. (-[WebSubresourceLoader didFinishLoading]): * WebView.subproj/WebLoader.h: * WebView.subproj/WebLoader.m: (-[NSURLProtocol signalFinish]): Similar to above (-[NSURLProtocol didFinishLoading]): 2005-09-28 Adele Peterson <adele@apple.com> Reviewed by John. Moved _downloadWithLoadingConnection and _downloadWithRequestfrom WebDownload.h to WebDownloadInternal.h * Misc.subproj/WebDownload.h: * Misc.subproj/WebDownloadInternal.h: Added. * WebKit.xcodeproj/project.pbxproj: Added WebDownloadInternal.h * WebView.subproj/WebMainResourceLoader.m: Added import of WebDownloadInternal.h * WebView.subproj/WebView.m: ditto. 2005-09-27 Adele Peterson <adele@apple.com> Reviewed by Maciej. Changed ints to size_t where appropriate. * Misc.subproj/WebCoreStatistics.h: * Misc.subproj/WebCoreStatistics.m: (+[WebCoreStatistics javaScriptObjectsCount]): (+[WebCoreStatistics javaScriptInterpretersCount]): (+[WebCoreStatistics javaScriptNoGCAllowedObjectsCount]): (+[WebCoreStatistics javaScriptReferencedObjectsCount]): * WebView.subproj/WebPreferences.m: (-[WebPreferences _pageCacheSize]): (-[WebPreferences _objectCacheSize]): * WebView.subproj/WebPreferencesPrivate.h: 2005-09-26 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - fixed <rdar://problem/4118126> Drag-and-drop text with text containing a colon causes a crash There were two problems here. One is that dragging and dropping text within the same WebTextView should have done nothing rather than try to navigate. The other is that navigating while processing the end of the drag would dealloc the drag-initiating WebTextView, leading to a crash. Fixing the former doesn't fix all cases of the latter, since dropping onto (e.g.) Safari's location field could cause a navigation during the drag. So these two issues needed to be fixed separately. * WebView.subproj/WebTextView.m: (-[WebTextView dragSelectionWithEvent:offset:slideBack:]): Before drag, retain self, and tell WebView that the drag is self-initiated. After drag, do the opposite. This is the same approach as WebImageView, but it can all be contained in one method here due to NSTextView's dragging API, which wraps up some of the drag-machinery guts. 2005-09-24 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed and landed by Darin. - fixed http://bugs.webkit.org/show_bug.cgi?id=5100 -[WebTextRenderer _ATSU_drawRun:...] does not check view flippedness * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _ATSU_drawRun:style:geometry:]): Set up a the CGContext with a matrix that flips the text if the view is not flipped. 2005-09-24 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed, tweaked a tiny bit, and landed by Darin. - fixed http://bugs.webkit.org/show_bug.cgi?id=4940 CG and ATSUI give different width to the same text * WebCoreSupport.subproj/WebTextRenderer.m: (overrideLayoutOperation): Added. ATSU callback to do the rounding. (-[WebTextRenderer _trapezoidForRun:style:atPoint:]): Use the new createATSULayoutParameters function instead of calling _createATSUTextLayoutForRun. (-[WebTextRenderer _ATSU_drawHighlightForRun:style:geometry:]): Use createATSULayoutParameters, and also compute the width in a way that works for any direction combination. (-[WebTextRenderer _ATSU_drawRun:style:geometry:]): Use createATSULayoutParameters. (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:includePartialGlyphs:]): Use createATSULayoutParameters. Also put in code that seems to work around an ATSU bug. (createATSULayoutParameters): Added. (disposeATSULayoutParameters): Added. 2005-09-24 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Dave. Landed by Darin. - fixed http://bugs.webkit.org/show_bug.cgi?id=4862 Incorrect layout of bidi overrides * WebCoreSupport.subproj/WebTextRenderer.m: (addDirectionalOverride): Renamed, and made it work in both directions. (-[WebTextRenderer _ATSU_drawHighlightForRun:style:geometry:]): Updated to call addDirectionalOverride. (-[WebTextRenderer _ATSU_drawRun:style:geometry:]): More of the same. (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:includePartialGlyphs:]): Ditto. 2005-09-24 Alexey Proskuryakov <ap@nypop.com> Tweaked, reviewed, and landed by Darin. - fixed http://bugs.webkit.org/show_bug.cgi?id=4394 Mouse clicks ignored in inline input areas * WebView.subproj/WebHTMLView.m: (-[NSArray mouseDown:]): Removed misleading comment and added code to send mouse event to input manager. (-[NSArray mouseDragged:]): Added code to send mouse event to input manager. (-[NSArray mouseUp:]): Ditto. (-[WebHTMLView _discardMarkedText]): Umnmark text before calling markedTextAbandoned: to match behavior of NSTextView (not sure why we did things in the opposite order before). (-[WebHTMLView _updateSelectionForInputManager]): Ditto. - unrelated tweak * WebView.subproj/WebView.m: (-[WebView _performTextSizingSelector:withObject:onTrackingDocs:selForNonTrackingDocs:newScaleFactor:]): Fix typecast that used ... for no good reason. 2005-09-23 Duncan Wilcox <duncan@mclink.it> Reviewed and landed by Darin. - name changes to prepare for fixing bugzilla bug 4582 * WebView.subproj/WebHTMLView.m: Changed names to match WebCore changes. 2005-09-20 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - fixed <rdar://problem/3228554> We should enforce one selection per WebView instead of per window Note that this checkin does not mean that we will always maintain a selection in a WebView when the focus is elsewhere. Instead it means that there should never be more than one frame containing a selection in a WebView, and that it's possible to maintain a selection in a WebView when the focus is elsewhere. * WebView.subproj/WebView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): removed unnecessary and somewhat confusing comment (-[WebView selectedFrame]): now calls the extracted method -_focusedFrame (-[WebView _focusedFrame]): new method, extracted from -selectedFrame; returns frame containing first responder, if any (-[WebView _findSelectedFrameStartingFromFrame:skippingFrame:]): added skippingFrame parameter, which is never returned (-[WebView _findSelectedFrameSkippingFrame:]): new method, starts from main frame and passes a frame to skip (-[WebView _findSelectedFrame]): now calls _findSelectedFrameSkippingFrame:nil (-[WebView _selectedFrameDidChange]): new method, called by WebDocumentText protocol implementors; calls -deselectAll on frame that formerly displayed a selection, if any * WebView.subproj/WebViewInternal.h: added category WebDocumentSelectionExtras, with the one method _selectedFrameDidChange * WebView.subproj/WebHTMLView.m: (-[WebHTMLView becomeFirstResponder]): call -[WebView _selectedFrameDidChange] * WebView.subproj/WebPDFView.m: (-[WebPDFView becomeFirstResponder]): call -[WebView _selectedFrameDidChange] (-[WebPDFView resignFirstResponder]): deselect all unless webview says not to; note that this doesn't work in all cases due to: <rdar://problem/4265966> PDFs continue to show a (secondary) selection when the focus moves elsewhere * WebView.subproj/WebTextView.m: (-[WebTextView becomeFirstResponder]): call -[WebView _selectedFrameDidChange] (-[WebTextView resignFirstResponder]): deselect all unless webview says not to 2005-09-20 Eric Seidel <eseidel@apple.com> Reviewed by mjs. Moved MIME type support from a hard coded list (in two places) to single lists in the corresponding *Representation classes. Also moved the list of types supported by WebCore (WebHTMLRepresentation) into WebCore. http://bugs.webkit.org/show_bug.cgi?id=5037 * WebView.subproj/WebDataSource.m: (addTypesFromClass): new inline function (+[WebDataSource _repTypesAllowImageTypeOmission:]): * WebView.subproj/WebFrameView.m: (addTypesFromClass): new inline function (+[WebFrameView _viewTypesAllowImageTypeOmission:]): * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (+[WebHTMLRepresentation supportedMIMETypes]): * WebView.subproj/WebHTMLView.m: (+[WebHTMLView supportedMIMETypes]): * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebImageRepresentation.h: * WebView.subproj/WebImageRepresentation.m: (+[WebImageRepresentation supportedMIMETypes]): * WebView.subproj/WebImageView.h: * WebView.subproj/WebImageView.m: (+[WebImageView supportedMIMETypes]): * WebView.subproj/WebPDFRepresentation.h: * WebView.subproj/WebPDFRepresentation.m: (+[WebPDFRepresentation supportedMIMETypes]): * WebView.subproj/WebPDFView.h: * WebView.subproj/WebPDFView.m: (+[WebPDFView supportedMIMETypes]): * WebView.subproj/WebTextRepresentation.h: * WebView.subproj/WebTextRepresentation.m: (+[WebTextRepresentation supportedMIMETypes]): * WebView.subproj/WebTextView.h: * WebView.subproj/WebTextView.m: (+[WebTextView supportedMIMETypes]): * WebView.subproj/WebView.m: (+[WebView _viewClass:andRepresentationClass:forMIMEType:]): (+[WebView MIMETypesShownAsHTML]): updated to match style (+[WebView setMIMETypesShownAsHTML:]): ditto 2005-09-16 John Sullivan <sullivan@apple.com> * WebView.subproj/WebImageView.m: (-[WebImageView copy:]): fixed build-breaking silly error in previous checkin 2005-09-16 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick - fixed <rdar://problem/4256557> CrashTracer: 238 crashes in Safari at com.apple.AppKit: -[NSPasteboard setData:forType:] + 188 * WebView.subproj/WebImageView.m: (-[WebImageView copy:]): declare types to pasteboard before starting to set their data (-[WebImageView writeSelectionToPasteboard:types:]): ditto 2005-09-16 Adele Peterson <adele@apple.com> Rolling out the fix for http://bugs.webkit.org/show_bug.cgi?id=4924 QPainter should use CGContext as much as possible rather than NSGraphicsContext since it caused a performance regression. 2005-09-16 Adele Peterson <adele@apple.com> Change by Darin, reviewed by me and Maciej. Fixes http://bugs.webkit.org/show_bug.cgi?id=4547 use int instead of long for 32-bit (to prepare for LP64 compiling) * Plugins.subproj/npapi.m: changed types to match those defined in npapi.h (NPN_MemAlloc): (NPN_MemFlush): (NPN_PostURLNotify): (NPN_PostURL): (NPN_Write): 2005-09-14 Justin Garcia <justin.garcia@apple.com> Reviewed by john Fixes <rdar://problem/4237479> REGRESSION (Cambridge-Denver): old QuickTime movie continues to play sound after reload We were adding the movie to the document twice after the changes were added to handle fallback content. There are some errors for which we should not render fall back content * Misc.subproj/WebKitErrorsPrivate.h: Introduced WebKitErrorPlugInWillHandleLoad to represent the cancel we do to prevent loading plugin content twice * Plugins.subproj/WebPluginDocumentView.m: (-[WebPluginDocumentView dataSourceUpdated:]): Ditto * WebView.subproj/WebDataSource.m: (-[WebDataSource _receivedMainResourceError:complete:]): Don't handleFallbackContent on WebKitErrorPlugInWillHandleLoad or on a user cancel 2005-09-14 Timothy Hatcher <thatcher@apple.com> Reviewed by Eric. * WebKit.xcodeproj/project.pbxproj: made WebDashboardRegion.h a private header 2005-09-14 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed http://bugs.webkit.org/show_bug.cgi?id=4924 QPainter should use CGContext as much as possible rather than NSGraphicsContext * WebCoreSupport.subproj/WebImageRendererFactory.m: Remove setCGCompositeOperationFromString method, no longer needed. 2005-09-13 Tim Omernick <tomernick@apple.com> Reviewed by Justin Garcia, Darin Adler. - <rdar://problem/3163393> Safari does not support Windowless mode in Flash * Plugins.subproj/WebBaseNetscapePluginView.h: Added 'isTransparent' instance variable. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): When updating a plugin in "windowless" (transparent) mode, clip drawing to the dirty region of the opaque ancestor. This means that a partially-transparent plugin, which by definition does not clear its port on redraw, will not overdraw the valid parts of its port. (-[WebBaseNetscapePluginView sendEvent:]): Disabled the "green debug background" for transparent plugins -- since they are not expected to cover their entire port every redraw, this debug code makes no sense. (-[WebBaseNetscapePluginView setVariable:value:]): Implemented -setVariable:value:, which is called from NPN_SetValue() (previously unimplemented). Right now we only handle NPPVpluginTransparentBool; if we choose to handle the other plugin variables, then we may do so here. * Plugins.subproj/WebBaseNetscapePluginViewPrivate.h: Added SPI for -[WebBaseNetscapePluginView setVariable:value]. * Plugins.subproj/npapi.m: (NPN_SetValue): Implemented this function so that plugins may set state (such as window mode). 2005-09-11 Mark Rowe <opendarwin.org@bdash.net.nz> Reviewed, tweaked, and landed by Darin. - fixed http://bugs.webkit.org/show_bug.cgi?id=4286 .Mac prefpane crashes when Safari using CVS WebKit is running * WebView.subproj/WebView.m: (-[WebView initWithFrame:frameName:groupName:]): If ENABLE_WEBKIT_UNSET_DYLD_FRAMEWORK_PATH, and WEBKIT_UNSET_DYLD_FRAMEWORK_PATH is set in the environment, then unset DYLD_FRAMEWORK_PATH. * WebKit.xcodeproj/project.pbxproj: Set ENABLE_WEBKIT_UNSET_DYLD_FRAMEWORK_PATH in configurations other than Default -- we don't want that code in production builds, but we want it in builds we do ourselves and nightly builds. 2005-09-10 Ingmar J Stein <IngmarStein@gmail.com> Reviewed and landed by Darin. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer drawImageInRect:fromRect:compositeOperator:context:]): Removed unused local variable. 2005-09-09 Tim Omernick <tomernick@apple.com> Reviewed by John Sullivan. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList removeItem:]): SPI to remove a given WebHistoryItem. * History.subproj/WebBackForwardListPrivate.h: Added. * WebKit.xcodeproj/project.pbxproj: Added WebBackForwardListPrivate.h as a private header. 2005-09-09 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. fixed http://bugs.webkit.org/show_bug.cgi?id=4070: Find in plain text won't find only occurrence if it overlaps selection * Misc.subproj/WebSearchableTextView.m: (-[NSString findString:selectedRange:options:wrap:]): in the wrap case, extend the search range far enough that text overlapping the selection (including the exact-match case) will be considered. 2005-09-08 Justin Garcia <justin.garcia@apple.com> Reviewed by darin WebKit portion of multipart/x-mixed-replace support * WebCoreSupport.subproj/WebSubresourceLoader.m: (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forDataSource:]): Subresource case: Check for Foundation level multipart support (-[WebSubresourceLoader didReceiveResponse:]): Send previously received data in a multipart section to the coreLoader (-[WebSubresourceLoader didReceiveData:lengthReceived:]): Don't send data to the coreLoader until it has been completely received * WebView.subproj/WebDataSource.m: (-[WebDataSource _startLoading:]): Main resource case: check for Foundation level multipart support (+[WebDataSource _repTypesAllowImageTypeOmission:]): Some server apps send data right after declaring content multipart/x-mixed-replace, and expect it to be treated as html (-[WebDataSource _commitIfReady:]): Don't ask the WebFrame to close its old WebDataSource when loading a multipart section, because we're going to reuse it (-[WebDataSource _receivedData:]): For non text/html multipart sections, we commit the data all at once, at the end (-[WebDataSource _doesProgressiveLoadWithMIMEType:]): Added heuristic for when to commit the load incrementally (-[WebDataSource _commitLoadWithData:]): Moved from _receivedData into its own function (-[WebDataSource _revertToProvisionalState]): (-[WebDataSource _setupForReplaceByMIMEType:]): Commits the data received for the previous multipart section if it wasn't loaded progresively, clears out the WebFrame and WebDatasource for the next multipart section * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): The very first multipart section is treated as a normal load, so that the back/forward list and history are updated. All later sections have a new load type, WebFrameLoadTypeReplace, and are treated like reloads (-[WebFrame _checkLoadCompleteForThisFrame]): Ditto (-[WebFrame _itemForRestoringDocState]): Ditto (-[WebFrame _setupForReplace]): Clears out the WebFrame for the next multipart section * WebView.subproj/WebFrameInternal.h: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFrameView.m: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): See above * WebView.subproj/WebLoader.h: * WebView.subproj/WebLoader.m: (-[NSURLProtocol clearResourceData]): (-[NSURLProtocol setSupportsMultipartContent:]): * WebView.subproj/WebMainResourceLoader.m: Straightforward (-[WebMainResourceLoader didReceiveResponse:]): 2005-09-06 Geoffrey Garen <ggaren@apple.com> - fixed build bustage from last checkin. Reviewed by haytt. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList pageCacheSize]): updated debug printf since we no longer have a variable called 'multiplier' 2005-09-06 David Hyatt <hyatt@apple.com> Reduce the # of cached pages for a back/forward list. The old cache would cache the following per tab: > 1gb memory = 16 pages per tab/window > 512mb memory = 8 pages per tab/window <= 512mb memory = 4 pages per tab/window This consumes far too much memory and is way too aggressive. The new cache sizes are as follows: >= 1gb memory = 3 pages per tab/window >= 512mb memory = 2 pages per tab/window < 512mb memory = 1 page per tab/window Reviewed by john * History.subproj/WebBackForwardList.m: (-[WebBackForwardList pageCacheSize]): * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): 2005-09-05 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - fixed http://bugs.webkit.org/show_bug.cgi?id=4846 REGRESSION: Carbon WebKit applications don't work at all * Carbon.subproj/HIWebView.m: Remove lots of unneeded declarations of private stuff. (Draw): Call WKNSWindowOverrideCGContext and WKNSWindowRestoreCGContext rather than calling a non-existent setCGContext: method on the context. 2005-09-05 John Sullivan <sullivan@apple.com> Reviewed by Dave Hyatt. - change related to <rdar://problem/4211999> Safari quits when click-drag-hold an image that is set to automatically change. * WebView.subproj/WebHTMLView.m: (-[NSArray namesOfPromisedFilesDroppedAtDestination:]): handle nil wrapper with ERROR and early return rather than ASSERT, since we now know of a way to reproduce this (written up as 4244861) 2005-09-05 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - fixed http://bugs.webkit.org/show_bug.cgi?id=4357 crash related to animated GIFs, reproducible in non-Safari WebKit application * WebCoreSupport.subproj/WebImageData.m: (removeAnimatingRendererFromView): Added. (removeFromDictionary): Added. (-[WebImageData removeAnimatingRenderer:]): Rewrote using CF functions rather than NS functions so that we never retain the views, since this can be called from a view's dealloc method. (setNeedsDisplayInAnimationRect): Added. (-[WebImageData _nextFrame:]): Rewrote as above, even though in this case it can't be called from the dealloc method. 2005-08-26 David Hyatt <hyatt@apple.com> Add support for a new scaling and tiling function so that border images from CSS3 can be implemented. Reviewed by darin * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData scaleAndTileInRect:fromRect:withHorizontalTileRule:withVerticalTileRule:context:]): * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer scaleAndTileInRect:fromRect:withHorizontalTileRule:withVerticalTileRule:context:]): (-[WebImageRenderer setAnimationRect:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView updateFocusState]): 2005-08-26 Adele Peterson <adele@apple.com> Reviewed by Beth. * WebKit.xcodeproj/project.pbxproj: Changed WebKit.Framework to WebKit.framework in UMBRELLA_FRAMEWORK. 2005-08-25 David Harrison <harrison@apple.com> Reviewed by Maciej. <rdar://problem/4227734> Denver Regression: WebCore selection bug on lines starting with tab (clownfish) The text is in a DIV styled with "white-space:pre", and uses newline characters as linebreaks. WebKit's text renderer is erroneously considering the width of the lines leading up to the tab character when calculating the width of the tab. Easily fixed by having widthForNextCharacter ignore the widthToStart when working with tabWidth. Any prior text that fits in the same line is already factored into the xpos, which is paid attention to. * WebCoreSupport.subproj/WebTextRenderer.m: (widthForNextCharacter): Ignore the widthToStart when working with tabWidth. 2005-08-23 John Sullivan <sullivan@apple.com> Reviewed by Beth Dakin. - fixed <rdar://problem/4229167> 14 leaks of WebFileButton and associated objects, seen after running webkit layout tests * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge fileButtonWithDelegate:]): this method was returning a retained object; I added an autorelease 2005-08-23 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2005-08-23 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed and landed by Darin. - fixed http://bugs.webkit.org/show_bug.cgi?id=4604 LEAK -[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:includePartialGlyphs:] leaks an ATSUTextLayout <rdar://problem/4228787> ATSUTextLayout leak in _ATSU_pointToOffset:style:position:reversed:includePartialGlyphs: (4604) * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:includePartialGlyphs:]): Added missing call to ATSUDisposeTextLayout. 2005-08-22 Geoffrey Garen <ggaren@apple.com> - fixed <rdar://problem/4227011> Debugger SPI should be removed from WebView.h API Reviewed by mjs and adele. Cut and pasted debugging SPI from WebView to WebView(WebPendingPublic) * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView setScriptDebugDelegate:]): (-[WebView scriptDebugDelegate]): * WebView.subproj/WebViewPrivate.h: 2005-08-20 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. - WebKit part of fix for <rdar://problem/3977607> ER: Safari should check framework versions at launch * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebView.m: (+[WebView _minimumRequiredSafariBuildNumber]): new method, returns the minimum build number of Safari that this WebKit is willing to work with. (The Safari version has to be new enough to check for this value in order for this to have any effect.) 2005-08-19 Justin Garcia <justin.garcia@apple.com> Reviewed by rjw The boolean justOpenedForTargetedLink is never used to determine a course of action. It was added long ago for findOrCreateFramedNamed, which has since been removed. * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame _loadDataSource:withLoadType:formState:]): * WebView.subproj/WebFramePrivate.h: 2005-08-19 Darin Adler <darin@apple.com> Reviewed by John. * English.lproj/Localizable.strings: Updated to include a new localizable string that was added a long while back. Apprently no one has run into the code using this string, because if they had, they'd have seen an assert. * English.lproj/StringsNotToBeLocalized.txt: Updated for various recent changes. 2005-08-17 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fix mysterious CGImageSource error message and possibly crash on layout tests. * WebView.subproj/WebMainResourceLoader.m: (-[WebMainResourceLoader receivedError:]): Retain the data source since it may prematurely self-destruct otherwise. (-[WebMainResourceLoader cancelWithError:]): ditto 2005-08-17 Justin Garcia <justin.garcia@apple.com> Reviewed by rjw Addresses <rdar://problem/4192534> new frame load delegate SPI needed for Dashboard Added handledOnloadEvents delegate method (private for now) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge handledOnloadEvents]): * WebView.subproj/WebDefaultFrameLoadDelegate.m: (-[WebDefaultFrameLoadDelegate webView:didHandleOnloadEventsForFrame:]): * WebView.subproj/WebFrame.m: (-[WebFrame _handledOnloadEvents]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebViewPrivate.h: 2005-08-17 John Sullivan <sullivan@apple.com> Reviewed by Geoff Garen. - fixed <rdar://problem/4219817> Particular icon database + bookmarks + history crashes Safari on launch * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase releaseIconForURL:]): Move line that might remove last reference to iconURL to the end of the block. 2005-08-16 Darin Adler <darin@apple.com> Reviewed by Trey. - improved fix for <rdar://problem/4211631>, tiled images tiled incorrectly when printing or drawing offscreen * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData tileInRect:fromPoint:context:]): Fix pattern phase origin to use the image tile origin, which is clearly right, rather than the image rectangle, which isn't right, but often is the same. 2005-08-16 Adele Peterson <adele@apple.com> Reviewed by John. - fixed <rdar://problem/4210320> URL tooltips should display a URL for elements that submit forms When the setShowsURLsInToolTips preference is set, we will display a tooltip containing the form's url when you mouse over a submit button. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _updateMouseoverWithEvent:]): 2005-08-16 Darin Adler <darin@apple.com> Reviewed by Beth Dakin. - removed Panther-only code that was not being compiled and was simply "bit-rotting" * Misc.subproj/WebFileDatabase.m: (-[WebFileDatabase _createLRUList:]): (+[WebFileDatabase _syncLoop:]): * Misc.subproj/WebKitErrors.m: (registerErrors): * Misc.subproj/WebNSObjectExtras.h: (WebCFAutorelease): * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_declareAndWriteDragImage:URL:title:archive:source:]): * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageDecodeItem.h: * WebCoreSupport.subproj/WebImageDecodeItem.m: * WebCoreSupport.subproj/WebImageDecoder.h: * WebCoreSupport.subproj/WebImageDecoder.m: (decoderThread): (startDecoderThread): * WebCoreSupport.subproj/WebKeyGeneration.cpp: Removed. * WebCoreSupport.subproj/WebKeyGeneration.h: Removed. * WebCoreSupport.subproj/WebKeyGenerator.h: * WebCoreSupport.subproj/WebTextRenderer.m: (getUncachedWidth): (_drawGlyphs): * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory getBytes:fromTextMarker:length:]): * WebKit.xcodeproj/project.pbxproj: * WebKitPrefix.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource _setPrimaryLoadComplete:]): (+[WebDataSource _repTypesAllowImageTypeOmission:]): (-[WebDataSource isLoading]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (localizedMenuTitleFromAppKit): (-[WebDefaultUIDelegate menuItemWithTag:]): (-[WebDefaultUIDelegate contextMenuItemsForElement:defaultMenuItems:]): (-[WebDefaultUIDelegate editingContextMenuItemsForElement:defaultMenuItems:]): * WebView.subproj/WebFormDataStream.m: (formCanRead): (webSetHTTPBody): * WebView.subproj/WebFrameView.m: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:chosePlainText:]): (-[WebHTMLView resourceForData:preferredFilename:]): (-[WebHTMLView _lookUpInDictionaryFromMenu:]): (-[WebHTMLView validateUserInterfaceItem:]): (-[WebHTMLView _attributeStringFromDOMRange:]): (-[WebHTMLView toggleBaseWritingDirection:]): (-[WebHTMLView changeBaseWritingDirection:]): * WebView.subproj/WebPDFRepresentation.h: * WebView.subproj/WebPDFRepresentation.m: * WebView.subproj/WebPDFView.h: * WebView.subproj/WebPDFView.m: * WebView.subproj/WebPreferences.m: (+[WebPreferences _systemCFStringEncoding]): * WebView.subproj/WebView.m: (-[WebView _commonInitializationWithFrameName:groupName:]): 2005-08-16 Darin Adler <darin@apple.com> Reviewed by Beth Dakin. - removed some unnecessary code * WebCoreSupport.subproj/WebGraphicsBridge.h: Removed pattern-phase related field and methods. * WebCoreSupport.subproj/WebGraphicsBridge.m: Ditto. * WebCoreSupport.subproj/WebImageData.m: Tweaked formatting and removed some unused code inside #if and comments. * WebCoreSupport.subproj/WebImageRenderer.h: Removed USE_CGIMAGEREF (which is always true now). * WebCoreSupport.subproj/WebImageRenderer.m: Removed old non-CGImageRef code. * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory imageRendererWithMIMEType:]): Removed non-USE_CGIMAGEREF code. (-[WebImageRendererFactory imageRendererWithData:MIMEType:]): Ditto. (-[WebImageRendererFactory imageRendererWithSize:]): Ditto. (-[WebImageRendererFactory imageRendererWithName:]): Ditto. 2005-08-15 Darin Adler <darin@apple.com> Reviewed by Beth. This is a fix for <rdar://problem/4211631> tiled images tiled incorrectly when printing or drawing offscreen. Cayenne found there was a problem when they were trying to take screen shots of widgets, and it was ultimately a problem with the way we tile images. Darin was able to fix the problem by replacing some confusing hacked code with CG calls. * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData tileInRect:fromPoint:context:]): * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebInternalImage tileInRect:fromPoint:context:]): * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawLineForMisspelling:withWidth:]): 2005-08-14 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - 1% speedup on HTML load speed iBench by avoiding icon database thrash http://bugs.webkit.org/show_bug.cgi?id=4423 * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _setIconURL:forURL:]): Be more aggressive about returning early, because updating the database does some expensive data structure copies. 2005-08-14 Duncan Wilcox <duncan@mclink.it> Reviewed and landed by Darin. WebKit part of fix for <http://bugs.webkit.org/show_bug.cgi?id=4011>: "Editing delegate selection methods not called when using mouse" Clicking on editable content would move the cursor or alter the selection without calling the appropriate editing delegate method (webView:shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:). The core of the patch is in the KHTMLPart::handleMousePressEvent* methods, the rest is glue needed to drill through all the layers. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:]): Bridge glue. * WebView.subproj/WebView.m: (-[WebView(WebViewEditingExtras) _shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:]): Final step in glue, calling editing delegate. * WebView.subproj/WebViewInternal.h: Added _shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting: private method to WebViewEditingExtras category. 2005-08-11 Beth Dakin <bdakin@apple.com> Reviewed by Vicki This is a fix for <rdar://problem/4141161> REGRESSION (Tiger): WebKit does not display in composited Carbon windows. I basically did what Troy suggests in his bug comments, and everything seems to work fine! * Carbon.subproj/HIViewAdapter.m: (-[HIViewAdapter setNeedsDisplayInRect:]): 2005-08-10 Adele Peterson <adele@apple.com> Bumping version to 420+ * Info.plist: 2005-08-08 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - fixed <rdar://problem/3996324> REGRESSION (1.2-2.0): scroll bars sometimes not updated properly (with >40 duplicate reports!) also http://bugs.webkit.org/show_bug.cgi?id=3416 * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]): Propagate dirty rects after doing a layout, since a layout can create new dirty rects. 2005-08-05 Adele Peterson <adele@apple.com> Reviewed by Darin. * WebKit.xcodeproj/project.pbxproj: Unchecked 'statics are thread safe' option. 2005-08-04 Justin Garcia <justin.garcia@apple.com> Reviewed by darin Fix for: <rdar://problem/3167884> Shockwave: 3D sprites rendered in OpenGL draw over the browser (3447) also as <http://bugs.webkit.org/show_bug.cgi?id=3447> The WindowRef created by -[NSWindow windowRef] has a QuickDraw GrafPort that covers the entire window frame (or structure region in Carbon parlance) rather then just the window content. We filed this as an NSWindow bug <rdar://problem/4201099> To work around, we modify the CGrafPort to only cover the content area before we let the plug-in draw. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView fixWindowPort]): (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): 2005-08-03 John Sullivan <sullivan@apple.com> Reviewed by Geoff Garen. - fixed <rdar://problem/3918675> Remove code to replace authentication dialog with a subclass when out of localization freeze * Panels.subproj/WebAuthenticationPanel.h: moved declaration of NonBlockingPanel here so it can be accessed by the nib * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel replacePanelWithSubclassHack]): removed this method (-[WebAuthenticationPanel loadNib]): stop calling the removed method * Panels.subproj/English.lproj/WebAuthenticationPanel.nib/classes.nib: * Panels.subproj/English.lproj/WebAuthenticationPanel.nib/info.nib: * Panels.subproj/English.lproj/WebAuthenticationPanel.nib/objects.nib: the panel in the nib now has custom class NonBlockingPanel 2005-08-03 Beth Dakin <bdakin@apple.com> Reviewed by cblu Removing calls to WKCreateUncorrectedRGBColorSpace and WKCreateUncorrectedGrayColorSpace in WebKit to patch up TOT...Eric removed them from WebCore last night. * WebCoreSupport.subproj/WebImageData.m: * WebCoreSupport.subproj/WebImageRenderer.m: (WebCGColorSpaceCreateRGB): (WebCGColorSpaceCreateGray): 2005-08-02 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. Preemptively moved some WebMenuItemTag values from SPI to API, in anticipation of approval from macosx-api-reviewers. Retitled one of them in response to API reviewers feedback: WebMenuItemSearchInGoogle -> WebMenuItemSearchWeb Note that as a side effect of this change, the actual numbers used for these WebMenuItemTags has changed from what it was in Tiger. This causes "Search in Spotlight", "Search in Google", and "Look Up in Dictionary" to not appear in Tiger Safari if running on tip of tree WebKit. * WebView.subproj/WebUIDelegatePrivate.h: removed WebMenuItemTagSearchInSpotlight, WebMenuItemTagSearchInGoogle, and WebMenuItemTagLookUpInDictionary * WebView.subproj/WebUIDelegate.h: added WebMenuItemTagSearchInSpotlight, WebMenuItemTagSearchWeb, and WebMenuItemTagLookUpInDictionary * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate menuItemWithTag:]): updated for rename (-[WebDefaultUIDelegate contextMenuItemsForElement:defaultMenuItems:]): ditto (-[WebDefaultUIDelegate editingContextMenuItemsForElement:defaultMenuItems:]): ditto 2005-08-01 Geoffrey Garen <ggaren@apple.com> -fixed <rdar://problem/3572585> window.open fails if name param = the name of a window just closed in same function Reviewed by darin. Test cases added: * manual-tests/open-after-close.html: Added. * manual-tests/resources/open-after-close-popup.html: Added. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge closeWindowSoon]): We now remove a WebView from WebViewSets when the WebView is *scheduled* to close. 2005-08-01 John Sullivan <sullivan@apple.com> * PublicHeaderChangesFromTiger.txt: added a comment about isTextField -> _isTextField 2005-08-01 John Sullivan <sullivan@apple.com> Patch by Trey Matteson <trey@usa.net> Reviewed by me. Fixed http://bugs.webkit.org/show_bug.cgi?id=4255 underlines still print too thick The real problem here is that we have code that scales a 0 width line to always be width=1.0 in device space. I'm leaving that in for the screen, but when printing a width of 0.5 looks good. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]): 2005-08-01 Eric Seidel <eseidel@apple.com> Reviewed by darin. * WebCoreSupport.subproj/WebGraphicsBridge.m: removed create*ColorSpace methods, now using CG API directly. http://bugs.webkit.org/show_bug.cgi?id=4211 2005-07-31 John Sullivan <sullivan@apple.com> Patch by Trey Matteson <trey@usa.net> Reviewed by me. Fixed http://bugs.webkit.org/show_bug.cgi?id=4014 PDF files by default load with a poor choice of sizing For now the various PDF viewing settings are sticky, stored in 2 new defaults. Since there are a number of ways these settings are changed, I made a proxy for the PDFView through which all view changing messages are sent. The proxy adds the behavior of updating the defaults upon any change. * Misc.subproj/WebNSDictionaryExtras.h: * Misc.subproj/WebNSDictionaryExtras.m: (-[NSMutableDictionary _webkit_setFloat:forKey:]): New support method. * WebView.subproj/WebPDFView.h: * WebView.subproj/WebPDFView.m: (-[WebPDFView initWithFrame:]): Create proxy for PDFView. (-[WebPDFView dealloc]): Free proxy. (-[WebPDFView _menuItemsFromPDFKitForEvent:]): For relevant context menu items, set the target to the proxy instead of the PDFView. (-[WebPDFView _readPDFDefaults]): Init PDFView with settings from defaults. (-[WebPDFView layout]): Call _readPDFDefaults, once. This turned out to be the best hook. (-[WebPDFView _makeTextSmaller:]): Change PDFView via proxy (-[WebPDFView _makeTextLarger:]): Ditto (-[WebPDFView _makeTextStandardSize:]): Ditto (-[PDFPrefUpdatingProxy initWithView:]): trivial (-[PDFPrefUpdatingProxy forwardInvocation:]): Forward the msg, then update defaults (-[PDFPrefUpdatingProxy methodSignatureForSelector:]): Simple forwarding support. * WebView.subproj/WebPreferenceKeysPrivate.h: * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): Set initial values for new PDF viewing defaults. (-[WebPreferences _integerValueForKey:]): Nuke stray comment. (-[WebPreferences _floatValueForKey:]): New simple support method. (-[WebPreferences _setFloatValue:forKey:]): Ditto. (-[WebPreferences PDFScaleFactor]): 4 accessors for new defaults (-[WebPreferences setPDFScaleFactor:]): (-[WebPreferences PDFDisplayMode]): (-[WebPreferences setPDFDisplayMode:]): * WebView.subproj/WebPreferencesPrivate.h: 2005-08-01 Justin Garcia <justin.garcia@apple.com> Patch by Trey Matteson <trey@usa.net> Reviewed by Maciej. Fixed <http://bugs.webkit.org/show_bug.cgi?id=4226> link underlines print too thickly Reinstate the fix made by sullivan on 1/11/05. There was a merge error with an mjs fix on 1/13/05. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]): 2005-07-30 Maciej Stachowiak <mjs@apple.com> Build fixes for previous change (missing includes) * WebView.subproj/WebFrame.m: * WebView.subproj/WebScriptDebugDelegate.m: 2005-07-29 Maciej Stachowiak <mjs@apple.com> Changes by Michael Kahl, reviewed by me. - fixed <rdar://problem/4164112> MASTER: JavaScript debugging support * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge windowObjectCleared]): * WebCoreSupport.subproj/WebSubresourceLoader.m: * WebKit.xcodeproj/project.pbxproj: * WebView.subproj/WebDefaultScriptDebugDelegate.h: Added. * WebView.subproj/WebDefaultScriptDebugDelegate.m: Added. (+[WebDefaultScriptDebugDelegate sharedScriptDebugDelegate]): (-[WebDefaultScriptDebugDelegate webView:didParseSource:fromURL:sourceId:forWebFrame:]): (-[WebDefaultScriptDebugDelegate webView:didEnterCallFrame:sourceId:line:forWebFrame:]): (-[WebDefaultScriptDebugDelegate webView:willExecuteStatement:sourceId:line:forWebFrame:]): (-[WebDefaultScriptDebugDelegate webView:willLeaveCallFrame:sourceId:line:forWebFrame:]): * WebView.subproj/WebFrame.m: (-[WebFramePrivate dealloc]): (-[WebFrame _attachScriptDebugger]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebScriptDebugDelegate.h: Added. * WebView.subproj/WebScriptDebugDelegate.m: Added. (-[WebScriptDebugger initWithWebFrame:]): (-[WebScriptDebugger dealloc]): (-[WebScriptDebugger globalObject]): (-[WebScriptDebugger newWrapperForFrame:]): (-[WebScriptDebugger parsedSource:fromURL:sourceId:]): (-[WebScriptDebugger enteredFrame:sourceId:line:]): (-[WebScriptDebugger hitStatement:sourceId:line:]): (-[WebScriptDebugger leavingFrame:sourceId:line:]): (-[WebScriptCallFrame _initWithFrame:]): (-[WebScriptCallFrame dealloc]): (-[WebScriptCallFrame setUserInfo:]): (-[WebScriptCallFrame userInfo]): (-[WebScriptCallFrame caller]): (-[WebScriptCallFrame scopeChain]): (-[WebScriptCallFrame functionName]): (-[WebScriptCallFrame exception]): (-[WebScriptCallFrame evaluateWebScript:]): * WebView.subproj/WebScriptDebugDelegatePrivate.h: Added. * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebViewPrivate dealloc]): (-[WebView _scriptDebugDelegateForwarder]): (-[WebView setScriptDebugDelegate:]): (-[WebView scriptDebugDelegate]): * WebView.subproj/WebViewInternal.h: * WebView.subproj/WebViewPrivate.h: 2005-07-26 Maciej Stachowiak <mjs@apple.com> Reviewed by Dave Hyatt. - fixed http://bugs.webkit.org/show_bug.cgi?id=4153 * WebView.subproj/WebFrame.m: (-[WebFrame _purgePageCache]): Find the oldest candidate for purging that is not a snapback item. 2005-07-29 David Harrison <harrison@apple.com> Reviewed by Dave Hyatt (rendering) and Maciej (editing and performance improvements). Test cases added: Existing tab-related basic editing tests were updated. More complex tests are coming soon. <rdar://problem/3792529> REGRESSION (Mail): Tabs do not work the way they did in Panther (especially useful in plain text mail) Basic strategy is to put tabs into spans with white-space:pre style, and render them with tabs stops every 8th space, where the space width and the left margin are those of the enclosing block. * WebCoreSupport.subproj/WebTextRenderer.m: (isSpace): (isRoundingHackCharacter): (getUncachedWidth): (-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]): (-[WebTextRenderer _computeWidthForSpace]): (_drawGlyphs): (-[WebTextRenderer _CG_drawHighlightForRun:style:geometry:]): (-[WebTextRenderer _CG_floatWidthForRun:style:widths:fonts:glyphs:startPosition:numGlyphs:]): (-[WebTextRenderer _extendCharacterToGlyphMapToInclude:]): (-[WebTextRenderer _CG_pointToOffset:style:position:reversed:includePartialGlyphs:]): (glyphForCharacter): (initializeCharacterWidthIterator): (ceilCurrentWidth): (widthForNextCharacter): 2005-07-29 John Sullivan <sullivan@apple.com> Reviewed by Dave Hyatt. - WebKit part of <rdar://problem/4187404> Redo form SPI so that it doesn't rely on NSViews Much of 4187404 was addressed in earlier checkins. This checkin completes the task. * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: removed viewForElement:, which was the only remaining NSView-related SPI that Safari autofill was still using. I added viewForElement a week ago as a transitional measure, so removing it won't affect any other clients. 2005-07-29 John Sullivan <sullivan@apple.com> Reviewed by Chris Blumenberg. * WebView.subproj/WebFrameView.m: (-[WebFrameView _firstResponderIsFormControl]): renamed from _firstResponderIsControl for clarity. Explicitly rejects WebHTMLView, since it's now a control. (-[WebFrameView keyDown:]): updated for renamed method. 2005-07-28 John Sullivan <sullivan@apple.com> Reviewed by Beth Dakin. - removed method -[WebHTMLRepresentation elementForView:], which was SPI used only for Safari autofill. Tip of tree Safari no longer includes any calls to this method. Also, Tiger Safari never gets around to actually calling it due to the other recent form-SPI-related changes, so removing this method doesn't break Tiger Safari running on tip of tree WebKit (though autofill continues to not work in that configuration). * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation elementForView:]): removed 2005-07-27 John Sullivan <sullivan@apple.com> Patch by Trey Matteson <trey@usa.net> Reviewed by me. Fixed http://bugs.webkit.org/show_bug.cgi?id=4169 scaling PDF view up leaves later HTML view scaled too An additional step of separating scaling of HTML and PDF. If we do a zoom and there are no docViews that track the common scaling factor, then don't change it. Thus in the common PDF case where it is the only doc view, scaling the PDF does not affect HTML pages loaded in the same window. * WebView.subproj/WebView.m: (-[WebView canMakeTextSmaller]): Pass 0 for new scaling factor, since we just querying. (-[WebView canMakeTextLarger]): Ditto. (-[WebView makeTextSmaller:]): Pass new scaling factor. (-[WebView makeTextLarger:]): Ditto. (-[WebView canMakeTextStandardSize]): Pass 0 for new scaling factor. (-[WebView makeTextStandardSize:]): Pass new scaling factor. (-[WebView _performTextSizingSelector:withObject:onTrackingDocs:selForNonTrackingDocs:newScaleFactor:]): The meat of the change is that this Swiss Army Knife also takes a new scaling factor, which it will set as the common scaling factor if it finds any doc views that are able to be scaled which track the common scaling factor. 2005-07-27 John Sullivan <sullivan@apple.com> Patch by Trey Matteson <trey@usa.net> Reviewed by me. Fixed http://bugs.webkit.org/show_bug.cgi?id=4015 PDF views should remember viewing mode, scroll position across back/forward Note this doesn't work within frames because of a PDFKit bug - see 4164 Fixed http://bugs.webkit.org/show_bug.cgi?id=4091 PDF views should keep a separate scaling factor from shared text scaling factor Basic idea #1 is that we now have a general mechanism for a WebDocView to save/restore some UI state to the WebHistoryItem. Basic idea #2 is that _WebDocumentTextSizing is expanded to allow for the case of a WebDocView keeping its own notion of a scaling factor. WebPDFView's -_tracksCommonSizeFactor has justification. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem setViewState:]): New methods to hold PList of arbitrary WebView state (-[WebHistoryItem viewState]): * History.subproj/WebHistoryItemPrivate.h: * WebKit.xcodeproj/project.pbxproj: Add Quartz to framework path so we can import PDFKit files * WebView.subproj/WebDocumentInternal.h: New methods added to _WebDocumentTextSizing. Also the _ prefix is sufficient instead of _web_WebDocumentTextSizing. Added _WebDocumentViewState protocol. * WebView.subproj/WebFrame.m: (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]): Rename of save/restore methods. (-[WebFrame _detachFromParent]): Ditto (-[WebFrame _transitionToCommitted:]): Ditto (-[WebFrame _checkLoadCompleteForThisFrame]): Ditto (-[WebFrame _loadItem:withLoadType:]): Ditto (-[WebFrame _recursiveGoToItem:fromItem:withLoadType:]): Ditto (-[WebFrame _saveViewStateToItem:]): Call doc view to retrieve view state. (-[WebFrame _restoreViewState]): Call doc view to set view state. (-[WebFrame _scrollToTop]): Nuked dead code. (-[WebFrame _textSizeMultiplierChanged]): This work now appears in WebView. (-[WebFrame _saveDocumentAndScrollState]): Same rename, one code cleanup. (-[WebFrame _accumulateDocumentViews:]): Add our docview to the array, call kids. (-[WebFrame _documentViews]): New helper to return all docviews. (-[WebFrame _didFirstLayout]): Same name change. * WebView.subproj/WebFrameInternal.h: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebHTMLView.m: Removed redundant category decl. (-[WebHTMLView _makeTextSmaller:]): Implement new protocol. (-[WebHTMLView _makeTextLarger:]): (-[WebHTMLView _makeTextStandardSize:]): (-[WebHTMLView _tracksCommonSizeFactor]): * WebView.subproj/WebPDFRepresentation.m: Tweak #imports. * WebView.subproj/WebPDFView.h: * WebView.subproj/WebPDFView.m: (-[WebPDFView _menuItemsFromPDFKitForEvent:]): No longer intercept context menu text sizing items. (-[WebPDFView setDataSource:]): No longer track the WebView's scaling factor. (-[WebPDFView scrollPoint]): Dig through PDFKit view tree to get real scroll position (-[WebPDFView setScrollPoint:]): Ditto (-[WebPDFView viewState]): Return bundle of viewing params (-[WebPDFView setViewState:]): Restore bundle of viewing params (-[WebPDFView _makeTextSmaller:]): Implement new text sizing protocol (-[WebPDFView _makeTextLarger:]): (-[WebPDFView _makeTextStandardSize:]): (-[WebPDFView _tracksCommonSizeFactor]): (-[WebPDFView _canMakeTextSmaller]): (-[WebPDFView _canMakeTextLarger]): (-[WebPDFView _canMakeTextStandardSize]): * WebView.subproj/WebTextView.m: (-[WebTextView _makeTextSmaller:]): Implement new text sizing protocol (-[WebTextView _makeTextLarger:]): (-[WebTextView _makeTextStandardSize:]): (-[WebTextView _tracksCommonSizeFactor]): * WebView.subproj/WebView.m: (-[WebView setTextSizeMultiplier:]): Calling docViews is now more complicates than just posting a notification to the frame. (-[WebView _performTextSizingSelector:withObject:onTrackingDocs:selForNonTrackingDocs:]): Workhorse that sends the text sizing method to the right doc views. (-[WebView canMakeTextSmaller]): Call workhorse. (-[WebView canMakeTextLarger]): Ditto (-[WebView makeTextSmaller:]): Ditto (-[WebView makeTextLarger:]): Ditto (-[WebView canMakeTextStandardSize]): Ditto (-[WebView makeTextStandardSize:]): Ditto 2005-07-26 Justin Garcia <justin.garcia@apple.com> Patch by Trey Matteson <trey@usa.net> Reviewed by John Sullivan. Fixed <http://bugs.webkit.org/show_bug.cgi?id=4072> Pressing back in browser misses out a page * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): When reloading the same page or refreshing the page, update the URL in the b/f item with the URL that we wind up at. Due to cookies, it might be different than the result we just got when we loaded the same page. 2005-07-26 David Hyatt <hyatt@apple.com> Make WebHTMLView inherit from NSControl instead of NSView. This change is necessary because the theme renderer for WebCore that draws controls with the Aqua appearance does so using NSCells. NSCells must be hosted within a control view in order to paint properly. The method updateCell must be overridden because it wants to repaint the whole control when the windows resigns/becomes key, and this would result in behavior that we don't want (the repainting of the whole view). We already have hooks in WebHTMLView for the window resigning/becoming key so we will do our proper control updating there instead (in a future patch). Reviewed by john * WebView.subproj/WebHTMLView.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView updateCell:]): 2005-07-26 John Sullivan <sullivan@apple.com> Reviewed by Chris Blumenberg. - more work to wean form-related SPI from NSView. All that's left (but this is a big "all") is viewForElement: and elementForView: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge textField:doCommandBySelector:]): changed signature to pass along DOMElement* rather than NSView* * WebView.subproj/WebFormDelegate.h: * WebView.subproj/WebFormDelegate.m: (-[WebFormDelegate textField:doCommandBySelector:inFrame:]): ditto 2005-07-25 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. - big hunk of weaning form-related SPI from NSView; autofill continues to work (but only on tip of tree Safari) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge textFieldDidBeginEditing:]): changed name from controlTextXXX:, now takes a DOMHTMLInputElement* (-[WebBridge textFieldDidEndEditing:]): ditto (-[WebBridge textDidChangeInTextField:]): ditto (-[WebBridge textDidChangeInTextArea:]): changed name from textDidChange:, now takes a DOMHTMLTextAreaElement* (-[WebBridge control:textShouldBeginEditing:]): removed this method as it wasn't being used by autofill, and did nothing in WebKit (-[WebBridge control:textShouldEndEditing:]): ditto (-[WebBridge textField:shouldHandleEvent:]): changed name from control:textView:shouldHandleEvent:, now takes a DOMHTMLInputElement*. The textView parameter wasn't being used, so I eliminated it. * WebView.subproj/WebFormDelegate.h: * WebView.subproj/WebFormDelegate.m: (-[WebFormDelegate textFieldDidBeginEditing:inFrame:]): (-[WebFormDelegate textFieldDidEndEditing:inFrame:]): (-[WebFormDelegate control:textShouldBeginEditing:inFrame:]): (-[WebFormDelegate control:textShouldEndEditing:inFrame:]): (-[WebFormDelegate textDidChangeInTextField:inFrame:]): (-[WebFormDelegate textDidChangeInTextArea:inFrame:]): (-[WebFormDelegate textField:shouldHandleEvent:inFrame:]): These all changed in the same way as the WebBridge methods 2005-07-25 Vicki Murley <vicki@apple.com> Reviewed by Darin. - fixed <rdar://problem/3470523> Safari's user agent should be changed to say Intel rather than PPC on Intel machines * WebView.subproj/WebView.m: add conditional #defines for "PPC" and "Intel" (-[WebView userAgentForURL:]): use this variable when constructing the user agent string 2005-07-24 Justin Garcia <justin.garcia@apple.com> Reviewed by mjs - Fixes <rdar://problem/4120535> deleteToEndOfLine: does not delete thew newline when at the end of a line Fix to match NSTextView. Delete the next character if deleteToEndOfLine fails * WebView.subproj/WebHTMLView.m: (-[WebHTMLView deleteToEndOfLine:]): 2005-07-24 Justin Garcia <justin.garcia@apple.com> Patch by Trey Matteson <trey@apple.com> Reviewed by john Fixes <http://bugs.webkit.org/show_bug.cgi?id=3953> back-forward items have wrong titles after sub-frame navigations This was caused by a mistaken data structure, where WebDataSource tried to keep a list of b/f items it was responsible for. The problem arose in the case of frames, where a subframe was loaded with new content. When this happens a fresh tree of b/f items is created, but the reference in the DataSource still pointed to the old item. Since the WebFrame does a lot of work to track the current b/f item, the easiest thing is to get rid of the DataSource's reference, and have it ask the WebFrame to set the title on the right b/f item. * WebView.subproj/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _setTitle:]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame _createItem:]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _setTitle:]): * WebView.subproj/WebFramePrivate.h: 2005-07-24 Justin Garcia <justin.garcia@apple.com> Reviewed by kevin Fixed make clean problem * Makefile.am: 2005-07-23 Justin Garcia <justin.garcia@apple.com> Patch by <opendarwin.org@mitzpettel.com> Reviewed by darin and hyatt Fixes <http://bugs.webkit.org/show_bug.cgi?id=3862> The fix for <http://bugs.webkit.org/show_bug.cgi?id=3545> enclosed each run of visually ordered hebrew with LRO and PDF control characters, but adjusted the run's to and from to include those characters, so that they would be rendered if the font includes a glyph for bidi control characters. Also adding a manual test * WebCoreSupport.subproj/WebTextRenderer.m: (reverseCharactersInRun): 2005-07-22 John Sullivan <sullivan@apple.com> Reviewed by Justin Garcia. Mail (running on tip of tree WebKit) was running into an assertion I recently added. The assertion is actually correct, catching an old bug in this code. * WebView.subproj/WebView.m: (-[WebView selectedFrame]): if the first responder is a WebFrameView, then we've found the WebFrameView we're looking for, and we shouldn't look at its superviews. 2005-07-22 John Sullivan <sullivan@apple.com> Reviewed by Chris Blumenberg. - some changes in the direction of weaning all the form-related SPI from NSView * PublicHeaderChangesFromTiger.txt: noted that the WebCore change to add -[DOMHTMLInputElement isTextField] to DOMExtensions.h is a public header change. * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation viewForElement:]): added viewForElement: as a stopgap measure. This allowed me to convert controlsInForm: to return DOMElements rather than NSViews, while keeping autocomplete working in Safari tip of tree. When I finish the SPI conversion I'll delete this method. Note that from this point on, autocomplete will not work in Tiger Safari with tip of tree WebKit (it will always fail to find anything to autocomplete) 2005-07-21 Adele Peterson <adele@apple.com> Reviewed by Darin. Changing temporary #ifndef to #if * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _checkSolidColor:]): 2005-07-21 Adele Peterson <adele@apple.com> Reviewed by Chris Blumenberg. - fixed <rdar://problem/4132797> don't register thin PPC WebKit plug-ins Merged fix for: <rdar://problem/4127100> [WebKit] 8B1016: After installing Acrobat Reader, can no longer see pdf's in Safari * Plugins.subproj/WebBasePluginPackage.h: Added isNativeLibraryData method. * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage isNativeLibraryData:]): Added isNativeLibraryData method. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage initWithPath:]): calls isNativeLibraryData to determine whether or not to register the plug-in. * Plugins.subproj/WebPluginPackage.m: (-[WebPluginPackage initWithPath:]): ditto. * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _checkSolidColor:]): added comment for #ifdef. 2005-07-21 Geoffrey Garen <ggaren@apple.com> * WebKit.pbproj/project.pbxproj: Removed. 2005-07-21 Geoffrey Garen <ggaren@apple.com> * WebKit.xcodeproj/.cvsignore: Added. 2005-07-21 Geoffrey Garen <ggaren@apple.com> * WebKit.xcodeproj/project.pbxproj: Added. 2005-07-21 Geoffrey Garen <ggaren@apple.com> * Makefile.am: 2005-07-20 John Sullivan <sullivan@apple.com> Reviewed by Vicki Murley. - removed some form-related methods that weren't being used anywhere, in preparation for weaning WebKit's WebFormDelegate protocol from NSView. * WebCoreSupport.subproj/WebBridge.m: * WebView.subproj/WebFormDelegate.h: * WebView.subproj/WebFormDelegate.m: removed these methods: -control:didFailToFormatString:errorDescription: -control:didFailToValidatePartialString:errorDescription: -control:isValidObject: 2005-07-20 Adele Peterson <adele@apple.com> Merged fix for: <rdar://problem/4125127> [WebKit] horizontal rulers don't render on Safari on web.apple.com * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _checkSolidColor:]): 2005-07-20 Adele Peterson <adele@apple.com> Merged fix for : <rdar://problem/4118278> mail divide by zero navigating messages * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _extendGlyphToWidthMapToInclude:font:]): 2005-07-20 John Sullivan <sullivan@apple.com> Reviewed by Adele Peterson. - added -[WebView selectedFrame] to SPI (pending public API), needed for 4180958 * WebView.subproj/WebView.m: (-[WebView selectedFrame]): new method, extracted from _selectedOrMainFrame (-[WebView _selectedOrMainFrame]): now calls extracted method * WebView.subproj/WebViewPrivate.h: add -selectedFrame to PendingPublic category 2005-07-19 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. - cleaned up code related to dealing with the "selected frame"; fixes radar bugs 4118830 and 4118820 * WebView.subproj/WebTextView.m: (-[WebTextView resignFirstResponder]): call deselectAll here instead of replicating its guts, just for clarity * WebView.subproj/WebViewInternal.h: eliminated category WebInternal; all of these methods were used only inside WebView.m, so I moved them into the existing category WebFileInternal that was declared and implemented in WebView.m * WebView.subproj/WebView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): updated for name changes. Also, uses new _deselectFrame: to clear the selection if the found text is in a different frame. (-[WebView pasteboardTypesForSelection]): (-[WebView writeSelectionWithPasteboardTypes:toPasteboard:]): (-[WebView setSelectedDOMRange:affinity:]): (-[WebView selectedDOMRange]): (-[WebView selectionAffinity]): (-[WebView setTypingStyle:]): (-[WebView typingStyle]): (-[WebView styleDeclarationWithText:]): (-[WebView replaceSelectionWithNode:]): (-[WebView replaceSelectionWithText:]): (-[WebView replaceSelectionWithMarkupString:]): (-[WebView replaceSelectionWithArchive:]): (-[WebView deleteSelection]): (-[WebView applyStyle:]): updated for name changes only (-[WebView _frameIsSelected:]): new method, returns YES if given frame has a non-zero-length selection (-[WebView _deselectFrame:]): new method, clears selection from given frame (-[WebView _findSelectedFrameStartingFromFrame:]): new method, recursive helper used by _findSelectedFrame (-[WebView _findSelectedFrame]): new method, finds first frame that returns YES for _frameIsSelected, or nil (-[WebView _debugCollectSelectedFramesIntoArray:startingFromFrame:]): new method, recursive helper used by _debugCheckForMultipleSelectedFrames (-[WebView _debugCheckForMultipleSelectedFrames]): new method for debugging, fires an assertion if there's more than one selected frame. (-[WebView _selectedOrMainFrame]): renamed from _frameForCurrentSelection, which was a misleading name since the returned frame does not necessarily have a selection (or even focus). Now checks for a selected but non-focused frame if the first responder is not in any frame. Also, moved in file from WebInternal category to WebFileInternal category. (-[WebView _bridgeForSelectedOrMainFrame]): renamed from _bridgeForCurrentSelection, which was a misleading name for the same reasons as _frameForCurrentSelection. Also, moved in file from WebInternal category to WebFileInternal category. (-[WebView _isLoading]): (-[WebView _frameViewAtWindowPoint:]): (-[WebView _bridgeAtPoint:]): just moved in file from WebInternal category to WebFileInternal category 2005-07-19 Darin Adler <darin@apple.com> Reviewed by Geoff Garen. - improve handling of plug-ins when the WebView or a superview is hidden with -[NSView setHidden] * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): Add "hidden" to the list of reasons to clip out all plug-in drawing. 2005-07-18 John Sullivan <sullivan@apple.com> Written by Trey Matteson <trey@usa.net> Reviewed by John Sullivan. Fixed http://bugs.webkit.org/show_bug.cgi?id=4049 scroll position not restored when going back/forward at ebay Fixed http://bugs.webkit.org/show_bug.cgi?id=4061 When going back/forward to some pages, they redraw at top before restoring scroll position The short story is that attempting to restore the scroll position at the time when the first layout finishes addresses both of these issues. An explanation of the underlying race condition is in a large comment near -_restoreScrollPosition. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge didFirstLayout]): Pass through to WebFrame. * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): Get rid of attempt to restoreScrollPosition that never did anything because the docView was always 0x0 size at that point. (-[WebFrame _opened]): Get rid of redundant call to restoreScrollPosition. The imminent call to layoutCompleted makes the same call. (-[WebFrame _didFirstLayout]): Restore the scroll position on first layout, if we're doing a b/f nav. * WebView.subproj/WebFrameInternal.h: 2005-07-18 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. - fixed these bugs: <rdar://problem/4158121> context menu in PDF view should contain the selection-based items like Copy <rdar://problem/4184691> WebPDFView should conform to the WebDocumentElement protocol <rdar://problem/4184663> "Search in Spotlight" is present but dimmed in context menu for plain-text documents * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate contextMenuItemsForElement:defaultMenuItems:]): added ASSERT and comments * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _searchWithGoogleFromMenu:]): removed this method (now handled by WebView) (-[WebHTMLView _searchWithSpotlightFromMenu:]): ditto (-[WebHTMLView validateUserInterfaceItem:]): removed validation for removed items. The validation wasn't necessary anyway, since we only put these items in the menu in the case where they should be enabled. * WebView.subproj/WebPDFView.h: now conforms to WebDocumentElement protocol (which lets [WebView elementAtPoint:] work better) * WebView.subproj/WebPDFView.m: (-[WebPDFView copy:]): added, hands off to PDFView, needed to enable Copy in context menu (-[WebPDFView _pointIsInSelection:]): new method, checks whether given point is in the selected bounds (-[WebPDFView elementAtPoint:]): add WebElementIsSelectedKey to returned element (-[WebPDFView menuForEvent:]): use actual point instead of dummy placeholder, now that we have code that pays attention to the point * WebView.subproj/WebView.m: (-[WebView _searchWithGoogleFromMenu:]): moved here from WebHTMLView so it will work for any documentView that conforms to WebDocumentText. Rewrote slightly to be non-WebHTMLView-specific. (This menu item was always enabled in Safari because Safari replaces its action, but it would not have been always enabled in other WebKit clients, though it should have been.) (-[WebView _searchWithSpotlightFromMenu:]): moved here from WebHTMLView so it will work for any documentView that conforms to WebDocumentText. Rewrote slightly to be non-WebHTMLView-specific. 2005-07-18 John Sullivan <sullivan@apple.com> Reviewed by Richard Williamson. - fixed <rdar://problem/4184366> WebPDFView should conform to the WebDocumentSelection protocol * Misc.subproj/WebNSAttributedStringExtras.h: Added. * Misc.subproj/WebNSAttributedStringExtras.m: Added. (-[NSAttributedString _web_attributedStringByStrippingAttachmentCharacters]): New category on NSAttributedString, initially contains this one method that had been in WebHTMLView. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _writeSelectionWithPasteboardTypes:toPasteboard:cachedAttributedString:]): now uses _web_attributedStringByStrippingAttachmentCharacters * WebView.subproj/WebPDFView.h: now conforms to WebDocumentSelection protocol * WebView.subproj/WebPDFView.m: (-[WebPDFView selectionRect]): new, implementation of WebDocumentSelection protocol method (-[WebPDFView pasteboardTypesForSelection]): ditto (-[WebPDFView writeSelectionWithPasteboardTypes:toPasteboard:]): ditto * WebKit.pbproj/project.pbxproj: updated for new files 2005-07-18 John Sullivan <sullivan@apple.com> Reviewed by Chris Blumenberg. - some refactoring cleanup in the selection/searching code * Misc.subproj/WebSearchableTextView.h: moved WebDocumentSelection protocol conformation to this class, was in subclass WebTextView * Misc.subproj/WebSearchableTextView.m: (-[WebSearchableTextView selectionRect]): new method (moved here from Safari) to return a single rect encompassing all selected text (-[WebSearchableTextView pasteboardTypesForSelection]): moved here from WebTextView (-[WebSearchableTextView writeSelectionWithPasteboardTypes:toPasteboard:]): ditto * WebView.subproj/WebDocumentInternal.h: moved WebDocumentSelection protocol out of here * WebView.subproj/WebDocumentPrivate.h: moved WebDocumentSelection protocol into here, added selectionRect method * WebView.subproj/WebHTMLView.m: (-[WebHTMLView selectionRect]): new method, calls existing bridge method formerly called by _selectionRect (-[WebHTMLView _selectionRect]): now calls [self selectionRect]. We can't just delete _selectionRect because it's used by Mail. * WebView.subproj/WebHTMLViewPrivate.h: removed _selectionRect since it's in WebDocumentSelection now * WebView.subproj/WebTextView.h: removed WebDocumentSelection from protocol list since it's in superclass now * WebView.subproj/WebTextView.m: removed old WebDocumentSelection methods because they are in superclass now 2005-07-15 Adele Peterson <adele@apple.com> Written by Trey Matteson <trey@usa.net> Reviewed by John Sullivan. Fixed http://bugs.webkit.org/show_bug.cgi?id=3910 - REGRESSION: Replying "Cancel" to the form repost nag leaves wrong b/f cursor * WebView.subproj/WebFrame.m: (-[WebFrame _resetBackForwardList]): new helper method (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): If the delegate bailed on the navigation, tell the main frame to reset the b/f cursor back to where it was before we started. 2005-07-15 John Sullivan <sullivan@apple.com> Written by Trey Matteson Reviewed by me. Fix for http://bugs.webkit.org/show_bug.cgi?id=4013 text find doesn't wrap in PDF files This just works once WebPDFView implements the WebDocumentText protocol, which is mostly just a matter of forwarding the methods to PDFKit appropriately. * WebView.subproj/WebPDFView.h: * WebView.subproj/WebPDFView.m: (-[WebPDFView supportsTextEncoding]): (-[WebPDFView string]): (-[WebPDFView attributedString]): (-[WebPDFView selectedString]): (-[WebPDFView selectedAttributedString]): (-[WebPDFView selectAll]): (-[WebPDFView deselectAll]): 2005-07-15 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker. - fixed <rdar://problem/4181884> Searching for text that overlaps selection works differently in PDFView than in HTMLView * WebView.subproj/WebPDFView.m: (PDFSelectionsAreEqual): new function, stand-in for nonexistent -[PDFSelection isEqual:] since calling isEqual: on two identical PDFSelections returns NO (-[WebPDFView searchFor:direction:caseSensitive:wrap:]): Make search algorithm match that in WebCore: initially search inside selection, then check for the case where the found text exactly matches the previous selection, and search from past the selection if so. The implementation is slightly more complicated than it should be due to PDFKit API limitations (about which I added FIXMEs and filed bugs) 2005-07-15 John Sullivan <sullivan@apple.com> Reviewed by Maciej Stachowiak. - fixed these bugs: <rdar://problem/4181875> Searching for text that overlaps selection works differently in WebTextView than in HTMLView <rdar://problem/3393678> Find not finding text in plain (non-HTML) if all text is selected * Misc.subproj/WebSearchableTextView.m: (-[NSString findString:selectedRange:options:wrap:]): Make search algorithm match that in WebCore: initially search inside selection, then check for the case where the found text exactly matches the previous selection, and search from past the selection if so. 2005-07-14 John Sullivan <sullivan@apple.com> Reviewed by Dave Hyatt. - WebKit part of fix for: <rdar://problem/4181227> webpages incorrectly use standard instead of secondary highlighting in certain cases * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge formControlIsResigningFirstResponder:]): Implementation of new method defined in WebCore, passes call along to WebHTMLView * WebView.subproj/WebHTMLViewInternal.h: declare _formControlIsResigningFirstResponder: so bridge can call it * WebView.subproj/WebHTMLView.m: (-[WebHTMLView updateFocusState]): just moved in file so it could be called from a different category (-[WebHTMLView _formControlIsResigningFirstResponder:]): new method, updates focus state 2005-07-14 John Sullivan <sullivan@apple.com> added missing #import to fix build * WebView.subproj/WebPDFView.m 2005-07-14 Kevin Decker <kdecker@apple.com> Reviewed by cblu Fixed: <rdar://problem/4122282> clicking a link in an PDF file opens the link with NSWorkspace without the usual security checks or WebView delegate control * WebView.subproj/WebFrame.m: (-[WebFrame _safeLoadURL:]): added * WebView.subproj/WebFrameInternal.h: * WebView.subproj/WebPDFView.m: (-[WebPDFView initWithFrame:]): (-[WebPDFView PDFViewWillClickOnLink:withURL:]): prevents evilness with a call to _safeLoadURL * WebView.subproj/WebTextView.m: (-[WebTextView clickedOnLink:atIndex:]): factored calling out to the bridge, and instead call _safeLoadURL 2005-07-14 Vicki Murley <vicki@apple.com> Reviewed by Kocienda. - WebKit part of fix for <rdar://problem/4172380> [GENENTECH] window.opener not available when child opened via target="_new" Add a setOpener function to the WebCore bridge, and call this function when opening new windows through Web Kit. * WebView.subproj/WebFrame.m: (-[WebFrame _continueLoadRequestAfterNewWindowPolicy:frameName:formState:]): 2005-07-13 Justin Garcia <justin.garcia@apple.com> Reviewed by John Rolling in changes necessary to build with newer versions of gcc 4.0 * History.subproj/WebHistoryItem.m: (-[WebHistoryItem copyWithZone:]): * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeImage:URL:title:archive:types:]): * Misc.subproj/WebNSURLExtras.m: (-[NSURL _web_URLWithLowercasedScheme]): (-[NSString _web_mapHostNameWithRange:encode:makeString:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge MIMETypeForPath:]): * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory imageRendererWithBytes:length:MIMEType:]): * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:usingPrinterFont:]): * WebView.subproj/WebFrame.m: (-[WebFrame _webDataRequestForData:MIMEType:textEncodingName:baseURL:unreachableURL:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _styleFromFontAttributes:]): * WebView.subproj/WebView.m: (-[WebView _writeImageElement:withPasteboardTypes:toPasteboard:]): (-[WebView mainFrameTitle]): 2005-07-13 John Sullivan <sullivan@apple.com> Reviewed by Maciej Stachowiak. - cleaned up Find-related experimental code that I checked in a while back * WebView.subproj/WebHTMLView.m: (-[WebHTMLView searchFor:direction:caseSensitive:wrap:]): remove variant of this method that had findInSelection flag; this method is now the same as it was on Tiger. * WebView.subproj/WebView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): ditto 2005-07-12 Geoffrey Garen <ggaren@apple.com> -rolled in patch by opendarwin.org@mitzpettel.com for http://bugs.webkit.org/show_bug.cgi?id=3435 Parentheses are backwards in Hebrew text (no bidi mirroring?) Reviewed by mjs. Layout test added to WebCore. * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _initializeATSUStyle]): (applyMirroringToRun): (-[WebTextRenderer _ATSU_drawHighlightForRun:style:geometry:]): (-[WebTextRenderer _ATSU_drawRun:style:geometry:]): (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:includePartialGlyphs:]): 2005-07-12 Ken Kocienda <kocienda@apple.com> Reviewed by Chris Blumenberg * WebCoreSupport.subproj/WebBridge.m: Removed some glue that allowed one of two unicode (TEC or ICU ) to be chosen at runtime. I just added this dual support yesterday, and while Maciej and I agreed that it was good to land in the tree in case we run into problems in the near future, we also agreed that cutting over to using ICU full time right now is probably the best way to find bugs. 2005-07-11 Ken Kocienda <kocienda@apple.com> Reviewed by Richard * WebCoreSupport.subproj/WebBridge.m: (+[WebBridge setTextConversionMethod:]): New method to support switching text conversion method. (+[WebBridge textConversionMethod]): Returns current text conversion method. 2005-07-11 Kevin Decker <kdecker@apple.com> Reviewed by cblu and mjs. Fixed: <rdar://problem/4099552> REGRESSION: Safari 1.3 Netscape API NPN_PostURL[Notify] no longer allows manual headers Most plugins (flash) send 2 CRFL's between the header and body of their POST requests, while the adboe plugin sends two LF's. This caused us to send custom headers as part of the actual POST data itself, and correspondently, would skew Content-Length. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[NSData _web_locationAfterFirstBlankLine]): Look for two LF's as well 2005-07-09 Maciej Stachowiak <mjs@apple.com> - back out my revent page cache changes, turns out they cause a major performance regression on PLT * WebView.subproj/WebFrame.m: (-[WebFrame _purgePageCache]): 2005-07-09 Maciej Stachowiak <mjs@apple.com> Reviewed by hyatt. Replace int with unsigned, to avoid going into a huge loop when back list count is 0. * WebView.subproj/WebFrame.m: (-[WebFrame _purgePageCache]): 2005-07-09 Maciej Stachowiak <mjs@apple.com> - fixed broken Development build * WebView.subproj/WebFrame.m: (-[WebFrame _purgePageCache]): 2005-07-09 Maciej Stachowiak <mjs@apple.com> Reviewed by hyatt. - fix page cache purging logic; this gets rid of a bug where the page cache would grow without bound if the oldest page cache item was the snapback item, and changed the rule a bit so page cache items farther back than the max size get purged, even if fewer than the max size are in current use. * WebView.subproj/WebFrame.m: (-[WebFrame _purgePageCache]): 2005-07-08 Geoffrey Garen <ggaren@apple.com> Rolled in patch by opendarwin.org@mitzpettel.com -fixes http://bugs.webkit.org/show_bug.cgi?id=3818 Fallback font doesn't have requested weight in ATSUI-rendered text (See WebCore Changelog for layout test) Reviewed by mjs. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _createATSUTextLayoutForRun:style:]): 2005-07-05 Adele Peterson <adele@apple.com> Rolling out changes for <rdar://problem/3792529> REGRESSION (Mail): Tabs do not work the way they did in Panther (especially useful in plain text mail) since it caused a 2% performance regression. * WebCoreSupport.subproj/WebTextRenderer.m: (isSpace): (-[WebTextRenderer _CG_drawHighlightForRun:style:geometry:]): (-[WebTextRenderer _CG_floatWidthForRun:style:widths:fonts:glyphs:startPosition:numGlyphs:]): (-[WebTextRenderer _extendCharacterToGlyphMapToInclude:]): (-[WebTextRenderer _CG_pointToOffset:style:position:reversed:includePartialGlyphs:]): (initializeCharacterWidthIterator): (widthForNextCharacter): 2005-07-05 John Sullivan <sullivan@apple.com> Reviewed by Chris Blumenberg. - fixed <rdar://problem/4158230> Zoom In/Zoom Out in PDF context menu don't update window's notion of text size * WebView.subproj/WebPDFView.m: (-[WebPDFView _menuItemsFromPDFKitForEvent:]): Redirect Actual Size, Zoom In, and Zoom Out context menu items so that they behave exactly like Make Text Standard Size, Make Text Larger, and Make Text Smaller. 2005-07-01 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. - fixed http://bugs.webkit.org/show_bug.cgi?id=3711: Displayed PDF have limited options in contextual menu This was a problem with using Tiger's version of Safari with tip of tree WebKit. * WebView.subproj/WebPDFView.m: (-[WebPDFView _anyPDFTagsFoundInMenu:]): new method, returns YES if the menu contains any items with any of the new PDF-related tags. (-[WebPDFView menuForEvent:]): If the executable was linked on Tiger or older (but it will never be older, since this code is new to Tiger), force all of the PDF-related items into the menu if none of them were there after processing by the delegate. 2005-06-30 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - fixed <http://bugs.webkit.org/show_bug.cgi?id=3774> do renaming so that loaders are called "loader", not "client" or "delegate" * Misc.subproj/WebIconLoader.h: * Plugins.subproj/WebNetscapePluginStream.h: * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]): (-[WebNetscapePluginStream start]): (-[WebNetscapePlugInStreamLoader didFinishLoading]): (-[WebNetscapePlugInStreamLoader didFailWithError:]): (-[WebNetscapePlugInStreamLoader cancelWithError:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge startLoadingResource:withURL:customHeaders:]): (-[WebBridge startLoadingResource:withURL:customHeaders:postData:]): (-[WebBridge canRunModalNow]): * WebCoreSupport.subproj/WebSubresourceClient.h: Removed. * WebCoreSupport.subproj/WebSubresourceClient.m: Removed. * WebCoreSupport.subproj/WebSubresourceLoader.h: * WebCoreSupport.subproj/WebSubresourceLoader.m: (-[WebSubresourceLoader initWithLoader:dataSource:]): (-[WebSubresourceLoader dealloc]): (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forDataSource:]): (+[WebSubresourceLoader startLoadingResource:withURL:customHeaders:referrer:forDataSource:]): (+[WebSubresourceLoader startLoadingResource:withURL:customHeaders:postData:referrer:forDataSource:]): (-[WebSubresourceLoader didReceiveResponse:]): (-[WebSubresourceLoader didReceiveData:lengthReceived:]): (-[WebSubresourceLoader didFinishLoading]): (-[WebSubresourceLoader didFailWithError:]): (-[WebSubresourceLoader cancel]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebBaseResourceHandleDelegate.h: Removed. * WebView.subproj/WebBaseResourceHandleDelegate.m: Removed. * WebView.subproj/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _setLoading:]): (-[WebDataSource _updateLoading]): (-[WebDataSource _setPrimaryLoadComplete:]): (-[WebDataSource _startLoading:]): (-[WebDataSource _addSubresourceLoader:]): (-[WebDataSource _removeSubresourceLoader:]): (-[WebDataSource _addPlugInStreamLoader:]): (-[WebDataSource _removePlugInStreamLoader:]): (-[WebDataSource _stopLoadingInternal]): (-[WebDataSource _defersCallbacksChanged]): (-[WebDataSource _stopLoadingWithError:]): (-[WebDataSource data]): (-[WebDataSource isLoading]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebLoader.h: * WebView.subproj/WebLoader.m: * WebView.subproj/WebMainResourceClient.h: Removed. * WebView.subproj/WebMainResourceClient.m: Removed. * WebView.subproj/WebMainResourceLoader.h: * WebView.subproj/WebMainResourceLoader.m: (-[WebMainResourceLoader didReceiveResponse:]): 2005-06-29 David Harrison <harrison@apple.com> Reviewed by Dave Hyatt (rendering) and Maciej (editing). Test cases added: Coming soon. Will include with next round of changes for this bug. This is the first checkin for... <rdar://problem/3792529> REGRESSION (Mail): Tabs do not work the way they did in Panther (especially useful in plain text mail) Basic strategy is to put tabs into spans with white-space:pre style, and render them with tabs stops every 8th space, where the space width and the left margin are those of the enclosing block. What's left is to switch to implement white-space:pre-wrap so that we can coalesce consecutive tabs while maintaining proper line breaking. That will keep the markup smaller. * WebCoreSupport.subproj/WebTextRenderer.m: (isSpace): (-[WebTextRenderer _CG_drawHighlightForRun:style:geometry:]): (-[WebTextRenderer _CG_floatWidthForRun:style:widths:fonts:glyphs:startPosition:numGlyphs:]): (-[WebTextRenderer _extendCharacterToGlyphMapToInclude:]): (-[WebTextRenderer _CG_pointToOffset:style:position:reversed:includePartialGlyphs:]): (initializeCharacterWidthIterator): (widthForNextCharacter): 2005-06-29 John Sullivan <sullivan@apple.com> Reviewed by Kevin. - deleted some never-used stub code * WebView.subproj/WebView.m: * WebView.subproj/WebViewInternal.h: * WebView.subproj/WebViewPrivate.h: 2005-06-27 Justin Garcia <justin.garcia@apple.com> Patch by Anders Carlsson <andersca@mac.com> Reviewed by Darin. - Fixes <http://bugs.webkit.org/show_bug.cgi?id=3489> WebView's setSelectedDOMRange doesn't not implement clearing the selection as described in the WebView documentation: <http://developer.apple.com/documentation/Cocoa/Reference/WebKit/ObjC_classic/Classes/WebView.html> * WebView.subproj/WebView.m: (-[WebView setSelectedDOMRange:affinity:]): If range is nil, call deselectText. 2005-06-24 Justin Garcia <justin.garcia@apple.com> Patch contributed by Duncan Wilcox <duncan@mclink.it> Reviewed by Darin - Fixed <http://bugs.webkit.org/show_bug.cgi?id=3535> Spelling suggestions in the context menu don't call the should* delegate methods * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _changeSpellingFromMenu:]): give delegate's webView:shouldInsertText:replacingDOMRange:givenAction: a chance to prevent replacing of selected text 2005-06-22 John Sullivan <sullivan@apple.com> Reviewed by Chris Blumenberg. - fixed <rdar://problem/3764645> please add a way to allow WebKit clients to override the WebPDFView context menu * PublicHeaderChangesFromTiger.txt: Added. New file to keep track of changes made to public headers that haven't been through API review yet. Initially lists the WebMenuItem enum tags added to WebUIDelegate.h as part of this change. * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate appendDefaultItems:toArray:]): new method, handles initial separator (-[WebDefaultUIDelegate contextMenuItemsForElement:defaultMenuItems:]): now has defaultMenuItems: parameter. Any menu items in this array are appended at the end of the standard set. (-[WebDefaultUIDelegate editingContextMenuItemsForElement:defaultMenuItems:]): ditto (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): This had a defaultMenuItems parameter before but it was always nil. Now it passes the defaultMenuItems parameter on to the two methods that construct lists (one for editing, the other for viewing). Also tweaked variable name and type for clarity. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): passes nil for new defaultItems parameter of _menuForElement: * WebView.subproj/WebImageView.m: (-[WebImageView menuForEvent:]): ditto * WebView.subproj/WebTextView.m: (-[WebTextView menuForEvent:]): ditto * WebView.subproj/WebPDFView.m: (-[WebPDFView elementAtPoint:]): new method to create the element dictionary needed for _menuForElement:defaultItems:. Only supplies the webFrame at this point. (-[WebPDFView _menuItemsFromPDFKitForEvent:]): new method to return copies of the menu items that PDFKit would include in the context menu, with WebKit tags applied (-[WebPDFView menuForEvent:]): now calls standard WebKit context menu mechanism, so clients' delegates can modify the context menu as desired. The initial set of items are the ones WebKit was already displaying for PDF context menus. * WebView.subproj/WebUIDelegate.h: added enum values for the menu items in the PDF context menu * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebView.m: (-[WebView _menuForElement:defaultItems:]): Added the defaultItems: parameter to this method, which is then passed along to WebDefaultUIDelegate. All callers pass nil except for WebPDFView, at least for now. 2005-06-22 Darin Adler <darin@apple.com> Change by Mitz Pettel. Reviewed by me. - fixed <http://bugs.webkit.org/show_bug.cgi?id=3618> RTL runs drawn by CG not reversed properly * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _CG_drawRun:style:geometry:]): Fix off-by-one mistake in order-swapping loops. 2005-06-22 Darin Adler <darin@apple.com> Change by Michael Gaiman. Reviewed by me. - fixed <http://bugs.webkit.org/show_bug.cgi?id=3436> Missing implementation of -[NSData(WebNSDateExtras) _webkit_parseRFC822HeaderFields] * Misc.subproj/WebNSDataExtras.h: Fixed name of category say NSData, not NSDate. * Misc.subproj/WebNSDataExtras.m: (-[NSData _webkit_parseRFC822HeaderFields]): Fixed method name. 2005-06-21 John Sullivan <sullivan@apple.com> Reviewed by Vicki Murley - fixed assertion failure Vicki ran into * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _forgetIconForIconURLString:]): Handle the case where there are no associated page URLs for the icon URL 2005-06-20 John Sullivan <sullivan@apple.com> Reviewed by Chris Blumenberg. - fixed <rdar://problem/4155182> icon database retain counts can be incorrect after removing all icons Replaced the concept of "future retain count per page URL" with a simpler concept of "retain count per page URL", which is maintained even after the icon is actually loaded (unlike the future retain count). The total retain count for an icon is now the sum of the retain counts per page URL along with any retain count not associated with a page URL -- this is still needed for some internal housekeeping purposes. * Misc.subproj/WebIconDatabasePrivate.h: renamed iconURLToURLs -> iconURLToPageURLs for clarity renamed URLToIconURL -> pageURLToIconURL for clarity renamed futureURLToRetainCount -> pageURLToRetainCount (there's no more "future" aspect) renamed iconURLToRetainCount -> iconURLToExtraRetainCount (it now maintains only some of the retain count) * Misc.subproj/WebIconDatabase.m: (+[WebIconDatabase sharedIconDatabase]): updated for name changes only (-[WebIconDatabase init]): ditto (-[WebIconDatabase iconForURL:withSize:cache:]): ditto (-[WebIconDatabase iconURLForURL:]): ditto (-[WebIconDatabase retainIconForURL:]): just bump the retain count in pageURLToRetainCount, instead of behaving differently based on whether an icon had been loaded for this URL; this let me delete the internal method _retainFutureIconForURL: (-[WebIconDatabase releaseIconForURL:]): decrement the retain count in pageURLToRetainCount, then handle the case where the retain count for this page has gone to zero. I deleted the internal method _releaseFutureIconForURL: formerly called here. (-[WebIconDatabase removeAllIcons]): remove all the code that dealt with retain counts; this operation no longer affects retain counts (-[WebIconDatabase _setIconURL:forURL:]): remove the code that consolidated multiple retain counts for different page URLs into a single retain count; the multiple retain counts are now maintained even after the icon is loaded (-[WebIconDatabase _clearDictionaries]): updated for name changes only (-[WebIconDatabase _loadIconDictionaries]): ditto (-[WebIconDatabase _updateFileDatabase]): ditto (-[WebIconDatabase _totalRetainCountForIconURLString:]): new method, sums the retain counts associated with specific page URLs and the extra retain count not associated with specific page URLs (-[WebIconDatabase _retainIconForIconURLString:]): updated for name changes (-[WebIconDatabase _forgetIconForIconURLString:]): no longer affects retain counts at all; this is up to callers (-[WebIconDatabase _releaseIconForIconURLString:]): this now distinguishes the case where the retain count not associated with any page URLs hits zero from the case where the total retain count hits zero, and handles both 2005-06-20 John Sullivan <sullivan@apple.com> Reviewed by Chris Blumenberg. - added support for emptying the icon database * Misc.subproj/WebIconDatabase.h: just fixed a typo * Misc.subproj/WebIconDatabasePrivate.h: added WebPendingPublic category with method removeAllIcons, and declared WebIconDatabaseDidRemoveAllIconsNotification string. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase removeAllIcons]): new method, removes all known icons from memory and disk. There's one loose end, covered by radar bug 4155182, where it's possible for the icon database's retain counts to get off after this operation. I plan to fix this next. (-[WebIconDatabase _setIconURL:forURL:]): just fixed some extra whitespace (-[WebIconDatabase _forgetIconForIconURLString:]): new method, extracted from _releaseIconForIconURLString (-[WebIconDatabase _releaseIconForIconURLString:]): now calls extracted method * WebKit.exp: added _WebIconDatabaseDidRemoveAllIconsNotification 2005-06-19 Darin Adler <darin@apple.com> Changes by Mitz Pettel Reviewed by me. - fixed <http://bugs.webkit.org/show_bug.cgi?id=3466> ATSUI text doesn't render at coordinates greater than 32K * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _ATSU_drawRun:style:geometry:]): Translate the matrix of the CGContext instead of passing the appropriate coordinates to ATSU. 2005-06-17 Richard Williamson <rjw@apple.com> Changes by Mitz Pettel Reviewed by Richard Williamson. Fixed http://bugs.webkit.org/show_bug.cgi?id=3545 * WebCoreSupport.subproj/WebTextRenderer.m: (reverseCharactersInRun): (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:includePartialGlyphs:]): 2005-06-17 John Sullivan <sullivan@apple.com> Reviewed by Chris. - fixed <rdar://problem/4151001> Reloading javascript-spawned window with no URL erases its contents * WebView.subproj/WebFrame.m: (-[WebFrame reload]): do nothing if URL is zero-length 2005-06-14 John Sullivan <sullivan@apple.com> Changes by Devin Lane. Reviewed by me. - fixed <rdar://problem/3766909> PDF viewing could use a zoom control other than the one in the context menu * WebView.subproj/WebPDFView.h: now implements protocol _web_WebDocumentTextSizing * WebView.subproj/WebPDFView.m: (-[WebPDFView _updateScalingToReflectTextSize]): new method, sets the PDF scaling from the text size multiplier (-[WebPDFView setDataSource:]): call _updateScalingToReflectTextSize (-[WebPDFView _web_textSizeMultiplierChanged]): implementation of protocol _web_WebDocumentTextSizing, calls _updateScalingToReflectTextSize 2005-06-14 John Sullivan <sullivan@apple.com> Reviewed by Dave Harrison. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _delayedEndPrintMode:]): After discussing this with Dave, I made this method both more debugger-friendly with asserts for the cases we don't think could ever happen, and more paranoid by handling these cases in deployment builds. 2005-06-14 Darin Adler <darin@apple.com> - fixed build for Xcode 2.1 * WebKit.pbproj/project.pbxproj: Use BUILT_PRODUCTS_DIR instead of SYMROOT to search for the WebKitSystemInterface.h file. We could re-jigger this again later, but for now this is consistent with both the .a file's location and where build-webkit puts the file. 2005-06-13 John Sullivan <sullivan@apple.com> Reviewed by Dave Harrison and Maciej. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _endPrintMode]): new method, extracted from identical code in beginDocument and endDocument. This method must be called once to counterbalance the code called from knowsPageRange that turns on "printing mode". (-[WebHTMLView _delayedEndPrintMode:]): new method, called from "perform after delay". Checks whether the same print operation is still underway and, if so, delays further. Otherwise calls _endPrintMode directly. (-[WebHTMLView knowsPageRange:]): after turning on "printing mode", queue up a delayed call to _delayedEndPrintMode:. If there's an early error in the print mechanism such that beginDocument is never called, this will cleanly end "printing mode" and make the webview usable again. (-[WebHTMLView beginDocument]): cancel any delayed call to _delayedEndPrintMode:. If we get this far along in printing, then we don't need the failsafe call to _delayedEndPrintMode: that was set up in knowsPageRange:. Also, call extracted method. (-[WebHTMLView endDocument]): call extracted method 2005-06-13 Maciej Stachowiak <mjs@apple.com> Reviewed by Chris Blumenberg and Adele. - better fix for <rdar://problem/4142247> REGRESSION: List to browse widgets at Apple website failed. Closing tab afterwards caused Safari crash http://bugs.webkit.org/show_bug.cgi?id=3445 With this change and the matching WebKit change we'll still stop loading the moment you click a download link, but the unload event and detaching of event handlers will not happen early any more. * WebView.subproj/WebDataSource.m: (-[WebDataSource _stopLoadingInternal]): call stopLoading on bridge instead of closeURL. * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): Revert previous attempt at fix. (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): ditto (-[WebFrame stopLoading]): ditto 2005-06-13 Chris Petersen <cpetersen@apple.com> Changes by Darin. Reviewed by me. - fixed problems building deployment due to recent init change * WebView.subproj/WebArchive.m: (-[WebArchive initWithCoder:]): Put the [super init] call and check for nil outside the exception handler. * WebView.subproj/WebResource.m: (-[WebResource initWithCoder:]): Ditto. 2005-06-12 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed <rdar://problem/4141569> REGRESSION (412+): printing fails on any page with images, and for standalone images also <http://bugs.webkit.org/show_bug.cgi?id=3318> * WebCoreSupport.subproj/WebImageData.m: Got rid of use of tabs instead of spaces throughout the file. (-[WebImageData _checkSolidColor:]): Wrap use of NSGraphicsContext with an autorelease pool. (-[WebImageData _fillSolidColorInRect:compositeOperation:context:]): Ditto. (-[WebImageData tileInRect:fromPoint:context:]): Ditto. (-[WebImageData _PDFDrawFromRect:toRect:operation:alpha:flipped:context:]): Ditto. 2005-06-12 Darin Adler <darin@apple.com> Changes by Nick Zitzmann. Reviewed by me. - fixed init methods that don't handle return values from the init methods they call * WebView.subproj/WebArchive.m: (-[WebArchive init]): Use value returned by init, check it for nil too. (-[WebArchive initWithMainResource:subresources:subframeArchives:]): Ditto. (-[WebArchive _initWithPropertyList:]): Ditto. (-[WebArchive initWithCoder:]): Ditto. * WebView.subproj/WebClipView.m: (-[WebClipView initWithFrame:]): Ditto. * WebView.subproj/WebDebugDOMNode.m: (-[WebDebugDOMNode initWithName:value:source:children:]): Ditto. * WebView.subproj/WebFrame.m: (-[WebFormState initWithForm:values:sourceFrame:]): Ditto. (-[WebFrame initWithName:webFrameView:webView:]): Ditto. * WebView.subproj/WebFrameView.m: (-[WebFrameView initWithFrame:]): Ditto. * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation init]): Ditto. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView initWithFrame:]): Ditto. (-[WebTextCompleteController initWithHTMLView:]): Ditto. * WebView.subproj/WebImageView.m: (-[WebImageView initWithFrame:]): Ditto. * WebView.subproj/WebPreferences.m: (-[WebPreferences initWithIdentifier:]): Ditto. * WebView.subproj/WebRenderNode.m: (-[WebRenderNode initWithName:position:rect:view:children:]): Ditto. * WebView.subproj/WebResource.m: (-[WebResource init]): Ditto. (-[WebResource initWithCoder:]): Ditto. * WebView.subproj/WebView.m: (-[WebViewPrivate init]): Call super init. (-[_WebSafeForwarder initWithTarget:defaultTarget:templateClass:]): Use value returned by init, check it for nil too. (-[WebView initWithFrame:]): Ditto. 2005-06-12 Maciej Stachowiak <mjs@apple.com> Reviewed by Chris Blumenberg. - fixed <rdar://problem/4142247> REGRESSION: List to browse widgets at Apple website failed. Closing tab afterwards caused Safari crash http://bugs.webkit.org/show_bug.cgi?id=3445 * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): Stop loading the non-provisional data source before swapping in the provisional. (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): Stop only the provisional load here, we would not want to stop loading if this navigation later turns into a download or is cancelled before being committed. (-[WebFrame stopLoading]): Factored a bit. (-[WebFrame _cancelProvisionalLoad]): New method to stop only provisional load, and cancel any pending policy deicions. (-[WebFrame _stopNonProvisionalLoadOnly]): New mthod that stops only the main load. 2005-06-10 John Sullivan <sullivan@apple.com> reviewed by Dave Harrison (first & second drafts) and Darin Adler (third draft) - WebKit part of fix for <rdar://problem/4145214> REGRESSION (412+): Can't drag URLs from the location bar * Misc.subproj/WebNSPasteboardExtras.m: (+[NSPasteboard initialize]): Reinstate variation of old code that uses CreatePasteboardFlavorTypeName to set up our new pasteboard types. The newfangled way didn't work. 2005-06-07 Darin Adler <darin@apple.com> Change by Mark Rowe <opendarwin.org@bdash.net.nz>. Reviewed by me. - fixed the WebKit half of build failure with spaces in the path http://bugs.webkit.org/show_bug.cgi?id=3291 * WebKit.pbproj/project.pbxproj: Quote DERIVED_FILE_DIR when it is substituted into FRAMEWORK_SEARCH_PATHS, and SYMROOT when into HEADER_SEARCH_PATHS. 2005-06-06 Darin Adler <darin@apple.com> * Info.plist: Bumped version to 412+. For some reason it was set to 312.1! 2005-06-05 Darin Adler <darin@apple.com> Reviewed by Hyatt. - fixed build that I broke with the license change (some includes of WebException were still around) * WebKit.pbproj/project.pbxproj: Removed references to WebException.h/m. * WebView.subproj/WebDataSource.m: Removed include of WebException.h. * WebView.subproj/WebHTMLView.m: Ditto. * WebView.subproj/WebView.m: Ditto. - fixed build under gcc 4.0 (some code moved here from Foundation had warnings) * Misc.subproj/WebNSDataExtras.m: (-[NSString _web_capitalizeRFC822HeaderFieldName]): Use char instead of UInt8. (-[NSData _webkit_guessedMIMEType]): Use char instead of UInt8, and take out now- unneeded type casts. 2005-06-05 Darin Adler <darin@apple.com> - added appropriate license headers to most files and updated copyright to reflect publication dates * LICENSE: Added. * <lots of files>: Added license header. * WebKit.pbproj/project.pbxproj: Removed references to NP_objc.h. * API-Issues.rtf: Removed. * Misc.subproj/WebException.h: Removed. * Misc.subproj/WebException.m: Removed. * Plugins.subproj/NP_objc.h: Removed. 2005-06-01 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - WebKit part of fix for <rdar://problem/3166090> add IE JavaScript extension window.showModalDialog * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createModalDialogWithURL:]): Added. Calls the UI delegate, falling back to the generic "create WebView" method. (-[WebBridge canRunModal]): Added. Checks the UI delegate to see if it implements runModal. (-[WebBridge canRunModalNow]): Added. Checks the "inConnectionCallback" field so we can prevent deadlock since we can't do any I/O while inside a connection callback until this aspect of NSURLConnection is changed. (-[WebBridge runModal]): Added. Sets "defersCallbacks" on all other web views in the group, then calls runModal on the UI delegate. * WebView.subproj/WebBaseResourceHandleDelegate.h: Added inConnectionCallback class method. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): Bump count and then decrement count so we can tell if we are in a callback. (-[WebBaseResourceHandleDelegate connection:didReceiveAuthenticationChallenge:]): Ditto. (-[WebBaseResourceHandleDelegate connection:didCancelAuthenticationChallenge:]): Ditto. (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): Ditto. (-[WebBaseResourceHandleDelegate connection:didReceiveData:lengthReceived:]): Ditto. (-[WebBaseResourceHandleDelegate connection:willStopBufferingData:]): Ditto. (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): Ditto. (-[WebBaseResourceHandleDelegate connection:didFailWithError:]): Ditto. (-[WebBaseResourceHandleDelegate connection:willCacheResponse:]): Ditto. (+[WebBaseResourceHandleDelegate inConnectionCallback]): Added. Return YES if count is not 0. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:]): Changed to use the method without the connection: parameter in the base class, since we no longer are overriding the connection: version. (-[WebMainResourceClient willSendRequest:redirectResponse:]): Change to override the version without the connection prefix/parameter; now only the base class overrides the actual connection delegate methods. (-[WebMainResourceClient continueAfterContentPolicy:response:]): Ditto. (-[WebMainResourceClient didReceiveResponse:]): Ditto. (-[WebMainResourceClient didReceiveData:lengthReceived:]): Ditto. (-[WebMainResourceClient didFinishLoading]): Ditto. (-[WebMainResourceClient didFailWithError:]): Ditto. (-[WebMainResourceClient loadWithRequestNow:]): Call the method without the connection parameter. * WebView.subproj/WebUIDelegatePrivate.h: Added new SPI here that WebBrowser implements. 2005-05-26 Darin Adler <darin@apple.com> Reviewed by John. - fix build failure from when I removed WebCoreUnicode * WebCoreSupport.subproj/WebTextRenderer.m: Removed import of WebUnicode.h that I missed. (-[WebTextRenderer _convertUnicodeCharacters:length:toGlyphs:]): Switch from our own macros to the ICU macros for surrogate pairs. (widthForNextCharacter): Ditto. 2005-05-26 David Harrison <harrison@apple.com> <rdar://problem/4120518> Mail: control-T in an empty message crashes mail * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge issueTransposeCommand]): New, to support transpose in JS. 2005-05-26 Darin Adler <darin@apple.com> Reviewed by Richard and Dave Harrison. - eliminate WebCoreUnicode and use ICU directly instead * Misc.subproj/WebKitNSStringExtras.m: (canUseFastRenderer): Use u_charDirection directly. * WebCoreSupport.subproj/WebTextRenderer.m: Removed import of <WebCore/WebCoreUnicode.h>. * WebView.subproj/WebHTMLView.m: (+[WebHTMLView initialize]): Removed call to WebKitInitializeUnicode. * Misc.subproj/WebUnicode.h: Removed. * Misc.subproj/WebUnicode.m: Removed. * Misc.subproj/WebUnicodeTables.m: Removed. * WebKit.pbproj/project.pbxproj: Removed files. 2005-05-24 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4097289> -[WebView elementAtPoint:] failing when WebView is nested and offset Code to determine the correct frame under the window point was converting the point incorrectly. Reviewed by Chris. * WebView.subproj/WebView.m: (-[WebView _frameViewAtWindowPoint:]): 2005-05-23 John Sullivan <sullivan@apple.com> Reviewed by Kevin. - WebKit part of <rdar://problem/4125783> WebKit needs a way to control whether textareas are resizable * WebView.subproj/WebPreferencesPrivate.h: added private-for-now getter and setter for new preference * WebView.subproj/WebPreferenceKeysPrivate.h: added private preference key controlling whether textareas are resizable * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): initial value of new preference is NO, so other clients' behavior doesn't change (-[WebPreferences textAreasAreResizable]): new getter (-[WebPreferences setTextAreasAreResizable:]): new setter * WebView.subproj/WebView.m: (-[WebView _updateWebCoreSettingsFromPreferences:]): update this new setting in WebCore * English.lproj/StringsNotToBeLocalized.txt: updated for these changes 2005-05-23 Chris Blumenberg <cblu@apple.com> Changed type for identifier parameter in WebResourceLoadDelegate-related calls to id from NSString. Reviewed by kevin. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCacheWithURL:response:data:]): (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): * WebView.subproj/WebFrame.m: (-[WebFrame _opened]): (-[WebFrame _requestFromDelegateForRequest:identifier:error:]): (-[WebFrame _sendRemainingDelegateMessagesWithIdentifier:response:length:error:]): (-[WebFrame _saveResourceAndSendRemainingDelegateMessagesWithRequest:identifier:response:data:error:]): * WebView.subproj/WebFrameInternal.h: 2005-05-20 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/4098786> sync. XMLHttpRequest works w/o AllowNetworkAccess key because load delegate is not consulted Synchronous loads did not cause the willSendRequest method on the resource load delegate to be called. This is the method that Dashboard uses to enforce AllowNetworkAccess and this must be called to avoid exploits. Reviewed by sullivan. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCacheWithURL:response:data:]): call [WebFrame _requestFromDelegateForRequest:identifier:error:] then [WebFrame _saveResourceAndSendRemainingDelegateMessagesWithRequest:identifier:response:data:error:] so synthetic resource load delegate methods are called and the data is saved as a WebResource for resources in the WebCore cache. (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): call [WebFrame _requestFromDelegateForRequest:identifier:error:], respect its result, do the load and then call [WebFrame _saveResourceAndSendRemainingDelegateMessagesWithRequest:identifier:response:data:error:] for synchronous loads * WebView.subproj/WebFrame.m: (-[WebFrame _opened]): call [WebFrame _requestFromDelegateForRequest:identifier:error:] then [WebFrame _sendRemainingDelegateMessagesWithIdentifier:response:length:error:] so synthetic resource load delegate methods are called for subresrources in the page cache (-[WebFrame _requestFromDelegateForRequest:identifier:error:]): new, was part of the removed _sendResourceLoadDelegateMessagesForURL::: This method calls identifierForInitialRequest and willSendRequest. (-[WebFrame _sendRemainingDelegateMessagesWithIdentifier:response:length:error:]): new, was part of the removed _sendResourceLoadDelegateMessagesForURL::: This method calls the remaining resource load delegate messages. (-[WebFrame _saveResourceAndSendRemainingDelegateMessagesWithRequest:identifier:response:data:error:]): new, saves the resource and calls [WebFrame _sendRemainingDelegateMessagesWithIdentifier:response:length:error:] * WebView.subproj/WebFrameInternal.h: 2005-05-17 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/4119282> clicking a link in an RTF file opens the link with NSWorkspace without the usual security checks or WebView delegate control Reviewed by mjs. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:referrer:reload:userGesture:target:triggeringEvent:form:formValues:]): pass the passed referrer to canLoadURL::: not [self referrer] (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): ditto * WebView.subproj/WebTextView.m: (-[WebTextView clickedOnLink:atIndex:]): call the loadURL bridge method so that security checks are made, command/option clicks work, policy delegate is consulted etc. 2005-05-17 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/4120255> web archives on remote servers can be viewed directly (with major security issues); should download instead Reviewed by mjs. * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): if the WebKit client has chosen to "use" a remote web archive, stop the load with an error 2005-05-16 Darin Adler <darin@apple.com> - attempt to get things building under "Saffron" development tools * WebKit.pbproj/project.pbxproj: Use BUILT_PRODUCTS_DIR instead of SYMROOT. 2005-05-13 John Sullivan <sullivan@apple.com> Reviewed by Kevin. - fixed <rdar://problem/4093306> Safari crashes if Esc key is held down during series of authentication sheets * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel cancel:]): retain and autorelease self. This is a workaround for an AppKit key-handling issue, which I wrote up as: <rdar://problem/4118422> Key-down events can be sent to a closed window if a key is kept pressed down 2005-05-12 John Sullivan <sullivan@apple.com> Reviewed by Kevin. - rolled in changes from experimental-ui-branch to support resizable textareas and find-as-you-type and confirming unsubmitted form changes. The files/functions modified are listed just below. After that are the ChangeLog comments from the branch. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge textDidChange:]): * WebView.subproj/WebFormDelegate.h: * WebView.subproj/WebFormDelegate.m: (-[WebFormDelegate textDidChange:inFrame:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView maintainsInactiveSelection]): (-[WebHTMLView searchFor:direction:caseSensitive:wrap:]): (-[WebHTMLView _searchFor:direction:caseSensitive:wrap:findInSelection:]): * WebView.subproj/WebView.m: (-[WebView _searchFor:direction:caseSensitive:wrap:findInSelection:]): (-[WebView searchFor:direction:caseSensitive:wrap:]): (-[WebView makeTextStandardSize:]): (-[WebView maintainsInactiveSelection]): * WebView.subproj/WebViewPrivate.h: 2005-04-18 John Sullivan <sullivan@apple.com> WebKit support for notifying a form delegate when a textarea's contents have changed (as opposed to a textfield, which was already handled). Reviewed by Maciej. * WebView.subproj/WebFormDelegate.h: * WebView.subproj/WebFormDelegate.m: (-[WebFormDelegate textDidChange:inFrame:]): new form delegate method * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge textDidChange:]): new method, calls through to form delegate 2005-04-11 John Sullivan <sullivan@apple.com> Fixed inability to wrap around in Find in Page * WebView.subproj/WebView.m: (-[WebView _searchFor:direction:caseSensitive:wrap:findInSelection:]): changed wrapFlag from NO to YES on two lines (copy/paste error) 2005-04-07 John Sullivan <sullivan@apple.com> WebKit support for find-as-you-type. Needed an additional parameter on a method from WebDocumentSearching protocol. Since that's a public protocol, I couldn't just add the parameter. For now I hacked it with an undeclared internal method that's discovered via respondsToSelector. Probably the right long-term approach is to deprecate the WebDocumentSearching protocol and introduce a replacement that has a more flexible set of parameters for possible future expansion. Reviewed by Dave Hyatt. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView searchFor:direction:caseSensitive:wrap:]): now calls new one-more-parameter version passing NO for new parameter to match old behavior (-[WebHTMLView _searchFor:direction:caseSensitive:wrap:findInSelection:]): new method, adds findInSelection parameter and passes it through to bridge * WebView.subproj/WebView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): now calls new one-more-parameter version passing NO for new parameter to match old behavior (-[WebView _searchFor:direction:caseSensitive:wrap:findInSelection:]): new method, adds findInSelection parameter and passes it through 2005-04-07 John Sullivan <sullivan@apple.com> WebKit support to allow clients to control whether the selection is still drawn when the first responder is elsewhere. Formerly this was hardwired to be true only when -[WebView isEditable] was true. Reviewed by Darin. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView maintainsInactiveSelection]): check [WebView maintainsInactiveSelection] rather than just [WebView isEditable] * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebView.m: (-[WebView maintainsInactiveSelection]): new method for clients to override, returns -[self isEditable] 2005-05-10 John Sullivan <sullivan@apple.com> Reviewed by Kevin. - WebKit support for <rdar://problem/3795701> Menu item/keyboard shortcut to restore text zoom to normal * WebView.subproj/WebView.m: (-[WebView validateUserInterfaceItem:]): validate makeTextStandardSize by calling canMakeTextStandardSize (-[WebView canMakeTextStandardSize]): new method, returns YES unless text size multiplier is currently 1 (-[WebView makeTextStandardSize:]): new method, sets text size multiplier to 1 * WebView.subproj/WebViewPrivate.h: add makeTextStandardSize: and canMakeTextStandardSize to pending public category 2005-05-10 John Sullivan <sullivan@apple.com> Reviewed by Chris. - fixed <rdar://problem/4067981> Mail places RTF flavor before RTFD flavor when dragging mixed image/text content. * WebView.subproj/WebHTMLView.m: (+[WebHTMLView _selectionPasteboardTypes]): put RTFD type before RTF type in array of types to declare 2005-05-09 Chris Blumenberg <cblu@apple.com> Turned assertion into error message to prevent crash when encountering this bug: <rdar://problem/4067625> connection:willCacheResponse: is called inside of [NSURLConnection initWithRequest:delegate:] * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate loadWithRequest:]): set flag to track when we're initializing the connection (-[WebBaseResourceHandleDelegate connection:willCacheResponse:]): log error 2005-05-09 Darin Adler <darin@apple.com> * Makefile.am: Don't set up PBXIntermediatesDirectory explicitly; Not needed to make builds work, spews undesirable error messages too. 2005-05-06 Darin Adler <darin@apple.com> Reviewed by Maciej. - make building multiple trees with make work better * Makefile.am: Set up Xcode build directory before invoking xcodebuild. 2005-05-04 Darin Adler <darin@apple.com> Reviewed by Dave Hyatt. - fixed layout tests * WebKit.pbproj/project.pbxproj: Set deployment target to 10.3 in the build styles. When built without a build style (by Apple B&I) we want to get the target from the environment. But when built with a build style (by Safari engineers and others), we want to use 10.3. Because our deployment target was not set, we ran into this bug: <rdar://problem/4108717> CTFontGetGlyphWithName doesn't work with some strings * Makefile.am: Took out extra parameters that make command-line building different from Xcode building. Now that this is fixed, you should not get a full rebuild if you switch from command line to Xcode or back. 2005-05-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/4078417> REGRESSION (125-412): MLB gameday page doesn't update (Flash) <rdar://problem/4072280> XMLHttpRequest calls onReadyStateChange callback with bogus status value Reviewed by john. Our WebKit-level caching of subresources "dumbed-down" information held in NSURLResponse. This caused some loads to lack response headers and thus disabling cache directives. Status codes were also not retained and this caused XMLHttpRequest to fail frequently. The fix is to have WebResource retain the NSURLResponse and to use the NSURLResponse when we decide to load from WebResources. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCacheWithURL:response:data:]): call new [WebResource _initWithData:URL:response:] * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate _canUseResourceWithResponse:]): new, checks response cache directives (-[WebBaseResourceHandleDelegate loadWithRequest:]): call _canUseResourceWithResponse: (-[WebBaseResourceHandleDelegate saveResource]): call new [WebResource _initWithData:URL:response:] * WebView.subproj/WebResource.m: (-[WebResourcePrivate dealloc]): (-[WebResource initWithData:URL:MIMEType:textEncodingName:frameName:]): call renamed _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData: (-[WebResource initWithCoder:]): decode the NSURLReponse (-[WebResource encodeWithCoder:]): encode the NSURLReponse (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]): take the NSURLReponse (-[WebResource _initWithData:URL:response:]): new (-[WebResource _initWithPropertyList:]): decode the NSURLReponse (-[WebResource _propertyListRepresentation]): encode the NSURLReponse (-[WebResource _response]): return ivar if we have one * WebView.subproj/WebResourcePrivate.h: 2005-05-03 David Hyatt <hyatt@apple.com> Fix object element support so that fallback content works. With this change Safari passes the Acid2 test. Reviewed by Maciej * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge determineObjectFromMIMEType:URL:]): * WebView.subproj/WebDataSource.m: (-[WebDataSource _receivedMainResourceError:complete:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): 2005-05-03 Darin Adler <darin@apple.com> * WebView.subproj/WebUIDelegate.h: Fixed incorrect comment. 2005-05-01 Darin Adler <darin@apple.com> - move to Xcode native targets and stop checking in generated files * WebKit.pbproj/project.pbxproj: Updated to use native targets and generate all the generated files, so we don't have to check them in any more. * Info.plist: Added. Native targets use a separate file for this. * Plugins.subproj/npapi.m: Fixed import statement to get npapi.h from <WebKit/> rather than current directory. * Makefile.am: Removed timestamp cleaning rules since we don't use it any more. * .cvsignore: Removed various timestamp files. * DOM.subproj/DOM-compat.h: Removed. * DOM.subproj/DOM.h: Removed. * DOM.subproj/DOMCSS.h: Removed. * DOM.subproj/DOMCore.h: Removed. * DOM.subproj/DOMEvents.h: Removed. * DOM.subproj/DOMExtensions.h: Removed. * DOM.subproj/DOMHTML.h: Removed. * DOM.subproj/DOMPrivate.h: Removed. * DOM.subproj/DOMRange.h: Removed. * DOM.subproj/DOMStylesheets.h: Removed. * DOM.subproj/DOMTraversal.h: Removed. * DOM.subproj/DOMViews.h: Removed. * Plugins.subproj/WebScriptObject.h: Removed. * Plugins.subproj/npapi.h: Removed. * Plugins.subproj/npruntime.h: Removed. * copy-webcore-files-to-webkit: Removed. * embed-frameworks.sh: Removed. * force-clean-timestamp: Removed. 2005-04-28 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed problems preventing us from compiling with gcc 4.0 * WebKit.pbproj/project.pbxproj: Removed -fobjc-exceptions because I can't figure out an easy way to pass it only when compiling Objective-C/C++. Removed -Wmissing-prototypes from WARNING_CPLUSPLUSFLAGS since it's now a C-only warning. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem pageCache]): Changed return type to match the declaration. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge _retrieveKeyboardUIModeFromPreferences:]): Fixed a BOOL that should have been a Boolean. * WebCoreSupport.subproj/WebTextRenderer.m: Removed redundant copy of ROUND_TO_INT, also in a WebCore header. (-[WebTextRenderer _computeWidthForSpace]): Had to add cast because of difference in type of ROUND_TO_INT vs. CEIL_TO_INT. (pathFromFont): Added a cast to convert UInt8 * to char *. * WebView.subproj/WebFrameView.m: (-[WebFrameView _setDocumentView:]): Fixed parameter type to match the declaration. (-[WebFrameView documentView]): Fixed return type to match the declaration. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): Initialized a variable to quiet an incorrect gcc 4.0 uninitialized variable warning. (-[WebHTMLView deleteToMark:]): Switched from @try style to NS_DURING style of exception handler because we can't pass -fobjc-exceptions just to Objective-C at the moment (see above). (-[WebHTMLView selectToMark:]): Ditto. (-[WebHTMLView swapWithMark:]): Ditto. 2005-04-27 John Sullivan <sullivan@apple.com> Reviewed by Dave Harrison. - fixed <rdar://problem/3547489> pop-up window blocking preference and menu item can easily get out of sync. * WebView.subproj/WebPreferences.m: (-[WebPreferences _setStringValue:forKey:]): save local value before setting value in NSUserDefaults, so clients reacting to NSUserDefaults change notification but calling back on WebPreferences API will see the updated value. (-[WebPreferences _setIntegerValue:forKey:]): ditto (-[WebPreferences _setBoolValue:forKey:]): ditto 2005-04-26 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4098713> Scripting API is incompatible with Mozilla Reviewed by Chris. * Plugins.subproj/npfunctions.h: * Plugins.subproj/npruntime.h: 2005-04-26 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3655817> please add support for mouse wheel events and the onmousewheel handler * WebView.subproj/WebHTMLView.m: (-[WebHTMLView scrollWheel:]): Call sendScrollWheelEvent: method instead of the old scrollOverflowWithScrollWheelEvent: (just a name change). 2005-04-18 Darin Adler <darin@apple.com> Reviewed by Hyatt. - fixed <rdar://problem/4092614> REGRESSION (Tiger): progressively loaded background images "scroll around" instead of just appearing * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _imageSourceOptions]): Moved a global inside this function, since it's only used here. (-[WebImageData _cacheImages:allImages:]): Fixed a sizeof that was getting the size of the wrong thing. (-[WebImageData _isSizeAvailable]): Used calloc in a more consistent way. (drawPattern): Removed an unneeded cast. (-[WebImageData tileInRect:fromPoint:context:]): Here's the actual bug fix. Don't use the image size when deciding whether the image needs to be tiled as a pattern nor when creating the pattern: in both cases, use the tile size. The old way was wrong, and the new way works perfectly. Also removed uneeded error message when the image is not yet loaded enough to create a CGImageRef for it -- it's fine to draw nothing in that case. 2005-04-14 John Sullivan <sullivan@apple.com> Reviewed by Chris. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:willCacheResponse:]): Beefed up assertion that's been bugging me and Chris to include the two troublemaking values. 2005-04-05 David Hyatt <hyatt@apple.com> Fix for 4077106, wheel scroll amount smaller in Tiger. All along wheeling should have been 4x the default line height of 10 (just as arrow keys did). Scroll arrows should have done this too for scroll views (they did already for overflow sections). This patch puts the override into the scrollview itself, and removes the multipliers in the private frame methods. Reviewed by darin * WebView.subproj/WebFrameView.m: (-[WebFrameView _verticalKeyboardScrollDistance]): (-[WebFrameView initWithFrame:]): (-[WebFrameView _horizontalKeyboardScrollDistance]): === WebKit-312.1 === 2005-03-31 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/4070729> REGRESSION (125-311, Panther-only?): Safari crashes while reloading "My eBay" page Reviewed by rjw. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate resourceData]): retain and autorelease resourceData since releaseResources (which releases resourceData) may be called before the caller of this method has an opporuntity to retain the returned data === Safari-412 === === Safari-411 === 2005-03-23 Richard Williamson <rjw@apple.com> Use Patti Yeh's hack to determine the appropriate rectangle to place the "associated word" window. If there is no marked text firstRectForCharacterRange: will use the selected range to determine the returned rectangle, ignoring the input range. This is the fix from 4029491 that I previously backed out. Reviewed by Vicki. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView firstRectForCharacterRange:]): 2005-03-23 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4062490> REGRESSION (WebKit-408): no subresources reported in Activity window after going back at hrweb.apple.com Stop collecting subresource responses after the document had loaded, not after it has been opened. Reviewed by Chris. * WebView.subproj/WebFrame.m: (-[WebFrame _setState:]): (-[WebFrame _opened]): 2005-03-21 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. <rdar://problem/4051145> The QuickTime Cocoa plug-in needs an SPI that it can call to check for URL policy * Plugins.subproj/WebPluginContainerCheck.h: Added. * Plugins.subproj/WebPluginContainerCheck.m: Added this new helper class to encapsulate an async plugin navigation check. (+[WebPluginContainerCheck checkWithRequest:target:resultObject:selector:controller:]): Convenience allocator that gives autoreleased value. (-[WebPluginContainerCheck initWithRequest:target:resultObject:selector:controller:]): Initializer. (-[WebPluginContainerCheck finalize]): Just assert that we're done, it would be bad to deallocate this object while request is still outstanding. (-[WebPluginContainerCheck dealloc]): Ditto. (-[WebPluginContainerCheck _continueWithPolicy:]): Method to continue after async policy check. (-[WebPluginContainerCheck _isDisallowedFileLoad]): Do "file: URL from remote content" check. (-[WebPluginContainerCheck _actionInformationWithURL:]): Helper to make action dictionary. (-[WebPluginContainerCheck _askPolicyDelegate]): Call policy delegate to let the app decide if this load is allowed. (-[WebPluginContainerCheck start]): Start the check. (-[WebPluginContainerCheck cancel]): Cancel a check in progress. * Plugins.subproj/WebPluginController.h: * Plugins.subproj/WebPluginController.m: (-[WebPluginController initWithDocumentView:]): Initialize new _checksInProgress field. (-[WebPluginController _webPluginContainerCancelCheckIfAllowedToLoadRequest:]): Implement this new SPI method. (-[WebPluginController _cancelOutstandingChecks]): New helper to make sure to cancel all outstanding requests when destroying all plugins. (-[WebPluginController destroyAllPlugins]): Call above helper. (-[WebPluginController _webPluginContainerCheckIfAllowedToLoadRequest:inFrame:resultObject:selector:]): Implement this new plug-in SPI method. (-[WebPluginController bridge]): New helper method. (-[WebPluginController webView]): New helper method. * WebView.subproj/WebPolicyDelegatePrivate.h: Add new navigation type WebNavigationTypePlugInRequest. * WebKit.pbproj/project.pbxproj: Add new files. * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]): Don't open externally on a plug-in request. 2005-03-23 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4053515> REGRESSION (Mail): Kotoeri input method reconversion does not work in WebViews We now use actual document NSRanges to represent both marked text ranges and selection ranges. Reviewed by Ken Kocienda. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView validAttributesForMarkedText]): (-[WebHTMLView firstRectForCharacterRange:]): (-[WebHTMLView selectedRange]): (-[WebHTMLView markedRange]): (-[WebHTMLView _selectMarkedText]): (-[WebHTMLView setMarkedText:selectedRange:]): === Safari-410 === 2005-03-22 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. === Safari-409 === 2005-03-20 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. <rdar://problem/4060020> Add stub version of security SPI for QuickTime plug-in so QuickTime team has something to compile and link against * Plugins.subproj/WebPluginContainerPrivate.h: Added. * Plugins.subproj/WebPluginController.m: (-[WebPluginController _webPluginContainerCheckIfAllowedToLoadRequest:inFrame:resultObject:selector:]): (-[WebPluginController _webPluginContainerCancelCheckIfAllowedToLoadRequest:]): * WebKit.pbproj/project.pbxproj: 2005-03-19 David Harrison <harrison@apple.com> Reviewed by Maciej. <rdar://problem/4059479> Misspelling underline does underline the whole word, could go farther to the right * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer misspellingLinePatternGapWidth]): (-[WebTextRenderer drawLineForMisspelling:withWidth:]): Consider that the last pixel in the underline dot pattern is transparent. 2005-03-19 Darin Adler <darin@apple.com> Reviewed by Maciej (a while back). - fixed <rdar://problem/4059323> local-file security check is allowing plug-in streams, but must not * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]): Roll out change I made on 3-13. That change is needed for subresource, but not for plug-in streams. For plug-in streams it's too risky, and leaves a serious security hole open. 2005-03-19 Darin Adler <darin@apple.com> Reviewed by Ken and John. - fixed <rdar://problem/4059123> REGRESSION (402-403): deleteWordForward: and deleteWordBackward: start deleting single characters after the first delete * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): Fixed backwards logic in here and added missing check. Set action to one of the two typing actions only if isTypingAction is YES. 2005-03-19 David Harrison <harrison@apple.com> Reviewed by me (written by Patti Yeh). <rdar://problem/4029491> <TCIM> CangJie: the candidate window appears at the top left hand corner during typing in Mail and iChat * WebView.subproj/WebHTMLView.m: (-[WebHTMLView firstRectForCharacterRange:]): Use selected range if there is no marked range. === Safari-408 === 2005-03-18 David Harrison <harrison@apple.com> Reviewed by Darin. <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch * WebView.subproj/WebFrameView.m: (-[WebFrameView webCoreBridge]): New to conform to WebCoreBridgeHolder protocol. 2005-03-18 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4057004> Data from XMLHTTPRequest is never dealloced WebDataSource keeps an array of all the NSURLResponses associated with the load for a page. This is used to playback delegate messages when loading from the page cache. However, after the document has completed it's initial load, we continue to keep track of responses. So, this has the consequence of keeping all the responses for a page around for the life of the page. NSURLResponses are now very heavy. They indirectly reference the resource data (via the download assessment dictionary). This fix will keep references to responses around for those resources loaded during initial page load, but not after that point. Reviewed by Ken. * WebView.subproj/WebDataSource.m: (-[WebDataSource _addResponse:]): (-[WebDataSource _stopRecordingResponses]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame _opened]): 2005-03-18 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/4053729> Copy/paste of page with frames into Blot or Mail does nothing and loses insertion point * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _selectedArchive]): Wrap frameset documents in an iframe, so they can be pasted into existing documents which will have a body or frameset of their own. === Safari-407 === 2005-03-17 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4055562> REGRESSION (Tiger): Safari doesn't draw progressively-loaded JPEGs (www.theregister.co.uk, www.titantalk.com) Anothe side effect of lazy loading of image meta data. We now don't cache image size until size meta data is actually available. Reviewed by Darin. * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData size]): 2005-03-16 David Harrison <harrison@apple.com> Reviewed by Maciej. <rdar://problem/4048506> Deleting from beginning of editable div deletes other document elements Also changed WebCore. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _shouldDeleteRange:]): Added call to new bridge method canDeleteRange. 2005-03-16 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/4042935> undo doesn't work properly during inline input * WebView.subproj/WebHTMLView.m: (-[WebHTMLView setMarkedText:selectedRange:]): Call new -[WebCoreBridge replaceMarkedTextWithText:] instead of -[WebCoreBridge replaceSelectionWithText:selectReplacement:smartReplace:]. The former call was just added in order to provide a better mapping of international text input onto the typing command/undo design. 2005-03-15 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4040321> Exception: Someone's trying to encode a WebDataRequestParameters instance If client mutates request use new Foundation SPI to address remove applewebdata properties from request. Reviewed by Ken Kocienda. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate willSendRequest:redirectResponse:]): * WebView.subproj/WebDataProtocol.h: * WebView.subproj/WebDataProtocol.m: (+[NSURLRequest _webDataRequestPropertyKey]): 2005-03-15 Ken Kocienda <kocienda@apple.com> Reviewed by Vicki Fox for this bug: <rdar://problem/4052642> Each delete keystroke is in its own undo group; not included in undo group with other typing Calling -[WebCore setSelectedDOMRange:range affinity:] had the result of "closing" any active set of typing keystrokes grouped together in a single undo operation. My change on 27 Jan to route delete keystrokes through _deleteRange:killRing:... made this feature regress. Previous to that change, the backwards delete key went through separate code that is no longer in the tree that did not set the selection in the way it is done now. The solution is to add an extra argument to the set-selection call. The WebCoreBridge now offers this method: -[WebCore setSelectedDOMRange:range affinity:closeTyping:]. Now, callers must indicate whether setting the selection will act to close typing or not. The code changes below all add this new argument with the appropriate value for closeTyping. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:deletionAction:]): Passes NO for closeTyping when deletionAction is deleteKeyAction or forwardDeleteKeyAction; YES when deleteSelectionAction. (-[WebHTMLView _expandSelectionToGranularity:]): Passes YES for closeTyping. (-[WebHTMLView selectToMark:]): Passes YES for closeTyping. (-[WebHTMLView swapWithMark:]): Passes YES for closeTyping. (-[WebHTMLView transpose:]): Passes YES for closeTyping. (-[WebHTMLView _selectMarkedText]): Passes NO for closeTyping. (-[WebHTMLView _selectRangeInMarkedText:]): Passes NO for closeTyping. * WebView.subproj/WebView.m: (-[WebView setSelectedDOMRange:affinity:]): Passes YES for closeTyping. 2005-03-14 Richard Williamson <rjw@apple.com> Fix <rdar://problem/4051389> 8A413: gifs animating too fast Reviewed by Maciej. Match Mozilla's policy for minimum frame duration, which is somewhat odd: <= 0.01 sec use .1 sec, otherwise use specified duration. * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _frameDurationAt:]): 2005-03-14 Darin Adler <darin@apple.com> Reviewed by Harrison. - fixed <rdar://problem/4049776> Seed: Mail: Disable spellcheck leaves red artifacts * WebView.subproj/WebFrameInternal.h: Added _unmarkAllMisspellings. * WebView.subproj/WebFrame.m: (-[WebFrame _unmarkAllMisspellings]): Added. Calls unmarkAllMisspellings on the bridge and self and all subframes. * WebView.subproj/WebView.m: (-[WebView setContinuousSpellCheckingEnabled:]): Call _unmarkAllMisspellings on the main frame when turning continuous spell checking off. 2005-03-14 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4027928> Tiger_8A394:Acrobat crashes while tried to remove the subscription errors by clicking on "Would you like to remove the subscription" from Tracker details view pane The Acrobat application triggers loads of new documents in it's policy delegate. This ultimately causes the WebHTMLView to be released before their event handlers have returned. To bullet proof against this case we retain/release self before passing the event on for further handling. Reviewed by Maciej. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _updateMouseoverWithEvent:]): (-[WebHTMLView scrollWheel:]): (-[WebHTMLView mouseDown:]): (-[WebHTMLView mouseDragged:]): (-[WebHTMLView mouseUp:]): (-[WebHTMLView keyDown:]): (-[WebHTMLView keyUp:]): (-[WebHTMLView performKeyEquivalent:]): 2005-03-14 Vicki Murley <vicki@apple.com> - roll out the fix for 4040321, since it is still pending CCC review. 2005-03-10 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4040321> Exception: Someone's trying to encode a WebDataRequestParameters instance Reviewed by Darin. If a delegate returns a mutated applewebdata: request in it's willSendRequest: method, we don't load using the WebDataRequest. Instead we do a normal load. Unfortunately, if the request they return is mutated *copy* of the applewebdata: request it will hold the applewebdata: special properties. These properties will be encoded into the cache. They should not be. So, to fix, we sanitize the request, by removing the special properties from the request. Note that we had to dig into the private guts of NSURLRequest because there is no public mechanism to remove properties from a request, see 4046775. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate willSendRequest:redirectResponse:]): * WebView.subproj/WebDataProtocol.h: * WebView.subproj/WebDataProtocol.m: (-[NSURLRequest _webDataRequestExternalRequest]): (-[NSURLRequest _webDataRequestSanitize]): === Safari-406 === 2005-03-13 Darin Adler <darin@apple.com> Reviewed by Ken and Maciej. - fixed <rdar://problem/4049040> REGRESSION (403-405): security check prevents user stylesheet from loading (Dictionary.app doesn't work at all!) * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]): Allow plug-in subresource streams to load with any URL, ignoring the "canLoadURL" method's restriction (only file URLs can load other file URLs), which now applies only to main resources, like web pages in frames or object tags and plug-in main resources. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge startLoadingResource:withURL:customHeaders:]): Allow subresources to load with any URL, as above. This allows things like images, stylesheets, and JavaScript to be loaded without the "canLoadURL" method's restriction. (-[WebBridge startLoadingResource:withURL:customHeaders:postData:]): Ditto. (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): Ditto. 2005-03-10 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4040321> Exception: Someone's trying to encode a WebDataRequestParameters instance Reviewed by Darin. If a delegate returns a mutated applewebdata: request in it's willSendRequest: method, we don't load using the WebDataRequest. Instead we do a normal load. Unfortunately, if the request they return is mutated *copy* of the applewebdata: request it will hold the applewebdata: special properties. These properties will be encoded into the cache. They should not be. So, to fix, we sanitize the request, by removing the special properties from the request. Note that we had to dig into the private guts of NSURLRequest because there is no public mechanism to remove properties from a request, see 4046775. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate willSendRequest:redirectResponse:]): * WebView.subproj/WebDataProtocol.h: * WebView.subproj/WebDataProtocol.m: (-[NSURLRequest _webDataRequestExternalRequest]): (-[NSURLRequest _webDataRequestSanitize]): === Safari-405 === 2005-03-10 Maciej Stachowiak <mjs@apple.com> Reviewed by Vicki. <rdar://problem/4046510> REGRESSION (TOT): All Flash and Shockwave plugin-based web content missing * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]): 2005-03-10 John Sullivan <sullivan@apple.com> Reviewed by Vicki. - fixed <rdar://problem/4045843> Going back/forward to error page hits assertion in -[WebDataSource(WebPrivate) _setData:] * WebView.subproj/WebDataSource.m: (-[WebDataSource _setData:]): Removed bogus assertion 2005-03-09 Deborah Goldsmith <goldsmit@apple.com> Reviewed by Darin. - fixed <rdar://problem/3997044> default encoding for non-Latin incorrect * WebKit/WebView.subproj/WebPreferences.m: (+[WebPreferences _systemCFStringEncoding]): Call __CFStringGetUserDefaultEncoding to get region, and TECGetWebTextEncodings to get the first encoding to determine the default encoding. 2005-03-09 Darin Adler <darin@apple.com> Reviewed by Richard. - fixed <rdar://problem/4034175> REGRESSION (Mail): Can't use any font with style Light/Condensed/Semibold/Extrabold, etc * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _styleFromFontAttributes:]): Use a constant instead of hard-coded weight for clarity. (-[WebHTMLView _originalFontA]): Ditto. (-[WebHTMLView _originalFontB]): Ditto. (-[WebHTMLView _addToStyle:fontA:fontB:]): Add code to detect the case where the family name is not good enough to specify the font precisely. In that case, use the Postscript font name instead. Also change variable names so it's easier to understand the method. 2005-03-06 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. <rdar://problem/4005575> Arbitrary file disclosure vulnerability due to ability to load local html from remote content * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView requestWithURLCString:]): * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView didStart]): * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): (-[WebBridge startLoadingResource:withURL:customHeaders:]): (-[WebBridge startLoadingResource:withURL:customHeaders:postData:]): (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): (-[WebBridge loadURL:referrer:reload:userGesture:target:triggeringEvent:form:formValues:]): (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]): (-[WebBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:]): * WebView.subproj/WebFrame.m: (-[WebFrame _loadURL:referrer:intoChild:]): * WebView.subproj/WebFramePrivate.h: 2005-03-09 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4032938> Safari: text layout for MS P Gothic font is corrupted The AppKit and ATS reports that MS P Gothic is fixed pitch. It is not! This is another case of "fixed pitch" being wrong. I've coalesced all the special cases into our isFontFixedPitch:, and used a dictionary to improve speed. No performance regression. Reviewed by Maciej. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _computeWidthForSpace]): * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory clearCaches]): (-[WebTextRendererFactory isFontFixedPitch:]): 2005-03-09 Darin Adler <darin@apple.com> Reviewed by Maciej. <rdar://problem/4040388> REGRESSION (172-173): nonrepro crash in -[NSString(WebNSURLExtras) _web_isUserVisibleURL] * Misc.subproj/WebNSURLExtras.m: (-[NSString _web_isUserVisibleURL]): Fixed some pointer expressions that didn't include the index in the expression. (readIDNScriptWhiteListFile): Removed NSLog statements in here since we decided they aren't useful and they will write some messages on Tiger. 2005-03-09 Darin Adler <darin@apple.com> * DOM.subproj/DOMPrivate.h: Checked in file copied from WebCore. 2005-03-08 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4036949> many JPEG images fail to incremental-load due to change in ImageIO JPEG header parsing (to be fixed in WebKit) Fixed <rdar://problem/4042570> Need to check image properties for presence of width/height properties ImageIO-55 changed how image properties are created. They are now created incrementally. So we need "re-get" the image properties if the properties we care about (width/height) aren't in the property dictionary. Reviewed by John. * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData init]): (-[WebImageData fileProperties]): (-[WebImageData propertiesAtIndex:]): (-[WebImageData _isSizeAvailable]): (-[WebImageData incrementalLoadWithBytes:length:complete:callback:]): (-[WebImageData size]): 2005-03-08 John Sullivan <sullivan@apple.com> A couple of tweaks to the previous patch, from Darin's review. * Misc.subproj/WebNSPasteboardExtras.m: (_writableTypesForImageWithoutArchive): remove unnecessary _web prefix (_writableTypesForImageWithArchive): ditto (+[NSPasteboard _web_writableTypesForImageIncludingArchive:]): use mutableCopy rather than initWithArray:, and adjust for name changes 2005-03-08 John Sullivan <sullivan@apple.com> Reviewed by Ken. - fixed <rdar://problem/4031826> REGRESSION (Mail): standalone images from Safari can't be pasted into Mail (WebKit part of fix) We were always declaring webarchive-related pasteboard types, even in the standalone image cases where we had no webarchive. Unfortunately, the WebView pasteboard-related API doesn't prevent this kind of thing from happening, because the code that declares the types isn't guaranteed to be anywhere near the code that writes the pasteboard data. After this fix, I discovered that pasting standalone images into Mail still doesn't work right, but the remaining issues seem to be entirely in Mail. I wrote up 4041671 to cover these. * Misc.subproj/WebNSPasteboardExtras.h: (+[NSPasteboard _web_writableTypesForImageIncludingArchive:]): Added boolean parameter; clients must specify whether or not there's an archive involved, because the array of types is different if there is. * Misc.subproj/WebNSPasteboardExtras.m: (_web_writableTypesForImageWithoutArchive): new static function, constructs (once) and returns the array of types for images that don't have archives (_web_writableTypesForImageWithArchive): new static function, constructs (once) and returns the array of types for images that do have archives (+[NSPasteboard _web_writableTypesForImageIncludingArchive:]): added boolean parameter, now calls one of the two new static functions (-[NSPasteboard _web_writeImage:URL:title:archive:types:]): added asserts that we aren't declaring the archive types if we don't have archive data (-[NSPasteboard _web_declareAndWriteDragImage:URL:title:archive:source:]): updated to pass parameter to _web_writableTypesForImageIncludingArchive: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate copyImageToClipboard:]): updated to pass parameter to _web_writableTypesForImageIncludingArchive: * WebView.subproj/WebImageView.m: (-[WebImageView copy:]): updated to pass parameter to _web_writableTypesForImageIncludingArchive: * WebView.subproj/WebView.m: (-[WebView pasteboardTypesForElement:]): updated to pass parameter to _web_writableTypesForImageIncludingArchive: 2005-03-07 Richard Williamson <rjw@apple.com> More bullet proofing for <rdar://problem/4038304> CrashTracer: ....9 crashes at com.apple.WebKit: -[WebTextRenderer initWithFont:usingPrinterFont:] + 840 Protect against removal of Times and Times New Roman from system. If these fonts are removed attempt to get system font instead of FATAL_ALWAYS. Reviewed by John. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:usingPrinterFont:]): === Safari-403 === 2005-03-06 Darin Adler <darin@apple.com> - fixed obvious mistake in IDN script code (luckily it hasn't been in a submission yet!) * Misc.subproj/WebNSURLExtras.m: (readIDNScriptWhiteListFile): Use "index" to index into the array, not "script", which is the script number, not the 32-bit-word index. 2005-03-05 Kevin Decker <kdecker@apple.com> Reviewed by Darin. Fixed: <rdar://problem/4038529> Infinite progress bar loading webcams and other sites that use multipart/x-mixed-replace The previous patch I landed prevented us from loading multipart/x-mixed-replace but did not always update the progress bar accordingly. This stops websites from having seemingly infinite progress in the browser UI. * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient didReceiveResponse:]): If this is "multipart/x-mixed-replace", remove the WebBaseResourceHandleDelegate client from the datasource's subresource array, otherwise -[WebDataSource isLoading] incorrectly returns YES. Also it's possible at this point in time we're done loading now (loaded everything else except for the multipart/x-mixed-replace content) so go ahead and check to see if in fact we're complete. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient connection:didReceiveResponse:]): ditto 2005-03-05 Richard Williamson <rjw@apple.com> Fixed panther build problem. Shouldn't include changes for 3968753 on panther. Reviewed by John. * WebView.subproj/WebView.m: (-[WebView _commonInitializationWithFrameName:groupName:]): 2005-03-05 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/4034603> REGRESSION (185-188): RadarWeb can't send enclosures anymore * WebView.subproj/WebFormDataStream.m: (closeCurrentStream): Release currentData when closing the stream. (advanceCurrentStream): Set up and retain currentData when the current stream is reading that data, so the data won't be released while in use. (formCreate): Initialize currentData to NULL. - fixed <rdar://problem/4037562> Tiger8A402: Help Viewer crashed when viewing help for iChat (infinite recursion in WebView) * WebView.subproj/WebView.m: (-[WebView _responderValidateUserInterfaceItem:]): Check for the case where we ourselves are the responder. This avoids an infinite loop. The actual code to perform operations avoids this with a global variable, but this lighter weight solution is sufficient here because validate operations don't call through to the next responder. 2005-03-04 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3968753> REGRESSION: Poor performance with differing multiple animated GIFs (was fast in Panther) Disable coalesced updates (in CG). This restores the panther behavior. Reviewed by David Harrison. * WebView.subproj/WebView.m: (-[WebView _commonInitializationWithFrameName:groupName:]): 2005-03-04 Adele Amchan <adele@apple.com> Reviewed by Darin. * English.lproj/StringsNotToBeLocalized.txt: added new strings "text/x-vcf" and "text/x-csv" to the list 2005-03-04 Adele Amchan <adele@apple.com> Reviewed by Chris. Fix for <rdar://problem/4032982> Sun iPlanet app: not able to import AddressBook CSV format addresses properly Fix for <rdar://problem/4032985> Sun iPlanet app: not able to import vCard format addresses properly * WebView.subproj/WebTextView.m: (+[WebTextView unsupportedTextMIMETypes]): added "text/x-csv" and "text/x-vcf" to the list of MIME types that our text view doesn't handle 2005-03-04 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/4036817> REGRESSION: ctrl-y broken when a line + carriage return cut * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:deletionAction:]): Merged _handleKillRing behavior into this function, since there's now a more-complicated way the startNewKillRingSequence boolean needs to be handled. Set the startNewKillRingSequence boolean after the entire process so changing the selection before and during the editing dosn't clear it. Also change "isTypingAction" parameter to "deletionAction" so we can handle forward delete with this method. (-[WebHTMLView _deleteSelection]): Pass deleteSelectionAction for action rather than NO for isTypingAction, which is the way to say the same thing using the new parameter. (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): Refactor to use the _deleteRange method above. Also calls _shouldDeleteRange: for the pre-existing selection case; not doing that before was a bug. (-[WebHTMLView deleteToMark:]): Pass deleteSelectionAction for action rather than NO for isTypingAction, which is the way to say the same thing using the new parameter. 2005-03-04 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/4020413> REGRESSION (Mail): can't use fonts with names that start with "#" in Mail (Korean fonts) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _styleFromFontAttributes:]): Quote font name when calling setFontFamily. (-[WebHTMLView _addToStyle:fontA:fontB:]): Ditto. 2005-03-04 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3965666> IDN spoofing vulnerability caused by Unicode characters that look like ASCII characters * Misc.subproj/WebNSURLExtras.m: (readIDNScriptWhiteListFile): Added. Reads file and parses script names. (readIDNScriptWhiteList): Added. Calls readIDNScriptWhiteList on each of the white list locations in succession. (allCharactersInIDNScriptWhiteList): Renamed from containsPossibleLatinLookalikes and changed sense. Now calls readIDNScriptWhiteList first time, and then uses the read-in list to check the scripts. (-[NSString _web_mapHostNameWithRange:encode:makeString:]): Call allCharactersInIDNScriptWhiteList instead of containsPossibleLatinLookalikes. * Resources/IDNScriptWhiteList.txt: Added. * WebKit.pbproj/project.pbxproj: Added IDNScriptWhiteList.txt file. * Misc.subproj/WebKitLocalizableStrings.m: Removed. This is simply unused. * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2005-03-04 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3937667> REGRESSION (Mail): Zooming a window from titlebar button doesn't paint newly-exposed portions of window * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): Re-set-up the visRect if the bounds changes due to layout. === Safari-402 === 2005-03-03 Jens Alfke <jens@apple.com> Reviewed by rjw. <rdar://problem/3991818> REGRESSION: Images scale while loading The code could crop an image when not all the scanlines were available yet, and it could crop when only a sub-rect of the image was to be drawn; but if it had to do both at once, it got the coordinates wrong. Fixed that. * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData incrementalLoadWithBytes:length:complete:callback:]): 2005-03-01 David Hyatt <hyatt@apple.com> Fix for 3841186, scrollbar shows up disabled when it should not appear at all. Make sure updateScrollers is never allowed to be re-entrant from any call point by moving the guard inside the function itself. Reviewed by John Sullivan * WebView.subproj/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): (-[WebDynamicScrollBarsView reflectScrolledClipView:]): 2005-03-02 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/4029010> Expose method to retrieve drag image for WebView's selection Reviewed by sullivan. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): call _selectionDraggingImage (-[WebHTMLView _selectionDraggingImage]): new SPI for Mail, factored from previous method (-[WebHTMLView _selectionDraggingRect]): new SPI for Mail * WebView.subproj/WebHTMLViewPrivate.h: 2005-03-02 John Sullivan <sullivan@apple.com> Reviewed by Adele. - fixed <rdar://problem/4023337> Safari stops loading any page (-[NSCFDictionary setObject:forKey:]: attempt to insert nil key) It is very likely that the exception being hit is caused by the same problem as WebFoundation bug 4018486. This change makes the code robust against this kind of problem regardless. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate saveResource]): Don't call addSubresource if newly-created resource is nil (but do assert on debug builds). Also assert that originalURL and MIMEType are not nil. * WebView.subproj/WebDataSource.m: (-[WebDataSource addSubresource:]): Don't add nil subresource to dictionary, but do assert on debug builds. === Safari-401 === 2005-03-01 John Sullivan <sullivan@apple.com> Reviewed by Darin. - fixed <rdar://problem/3987482> Format>Style>Italic is not enabled when a compose window is empty (works in Blot) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView becomeFirstResponder]): call _updateFontPanel here so NSFontManager knows the right font for the menu items and the font panel 2005-03-01 David Harrison <harrison@apple.com> Reviewed by Chris. <rdar://problem/3915560> Mail would like an SPI to enable "smart" text paste/drop * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _smartDeleteRangeForProposedRange:]): (-[WebHTMLView _smartInsertForString:replacingRange:beforeString:afterString:]): New. 2005-02-28 John Sullivan <sullivan@apple.com> Reviewed by Ken. - WebKit part of fix for <rdar://problem/4023490> REGRESSION (125-185): Tabbing through links on frameset page gets stuck at end (tivofaq.com) This tab-to-links stuff has been in shaky condition ever since AppKit futzed with tabbing behavior in Tiger to add support for including the toolbar in the key loop. I made some changes months ago to compensate for that, but some cases, such as this one, still weren't fixed. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge _nextKeyViewOutsideWebFrameViewsWithValidityCheck:]): new bottleneck method, extracted from nextKeyViewOutsideWebFrameViews; handles nextKeyView or nextValidKeyView depending on parameter. (-[WebBridge nextKeyViewOutsideWebFrameViews]): now calls extracted method (-[WebBridge nextValidKeyViewOutsideWebFrameViews]): new method, calls new bottleneck method * WebView.subproj/WebHTMLView.m: (-[WebHTMLView nextValidKeyView]): when we're stuck at the end of a nextKeyView chain inside a nexted frame, use nextValidKeyViewOutsideWebFrameViews. Make sure we don't end up looking inside the web frame views while doing this. 2005-02-25 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/4025088> window onblur and onfocus don't fire when text field has focus * WebView.subproj/WebHTMLView.m: (-[WebHTMLView updateFocusState]): Renamed from updateFocusDisplay. Added call to setWindowHasFocus: method. (-[WebHTMLView viewDidMoveToWindow]): Call method by new name. (-[WebHTMLView windowDidBecomeKey:]): Ditto. (-[WebHTMLView windowDidResignKey:]): Ditto. (-[WebHTMLView becomeFirstResponder]): Ditto. (-[WebHTMLView resignFirstResponder]): Ditto. === Safari-400 === 2005-02-25 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4000962> 8A375: Help Viewer displays voiced sound and semi-voiced characters strangely (characters don't seem to be composed) Added special case for voiced marks. Reviewed by John. * WebCoreSupport.subproj/WebTextRenderer.m: (widthForNextCharacter): 2005-02-25 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/4019823> Seed: Control-Y doesn't work * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): Call _handleKillRing after setting the selection, since it uses the selection to get the text. (-[WebHTMLView _insertText:selectInsertedText:]): Check for empty string to avoid an assertion on the other side of the bridge when you yank the empty string. 2005-02-24 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly. If directionality is specified use that as initial directionality, rather than neutral directionality. Reviewed by Hyatt. * WebCoreSupport.subproj/WebTextRenderer.m: (widthForNextCharacter): 2005-02-24 Adele Amchan <adele@apple.com> Reviewed by Chris. Fix for <rdar://problem/4023393> Safari crashed in khtml::RenderObject::repaintAfterLayoutIfNeeded(QRect const&, QRect const&) We were crashing after hitting PageDown when viewing a pdf because WebKit was calling over to WebCore to scroll overflow areas. Since this only needs to be done if we're dealing with a WebHTMLView, I added a wrapper function to check the documentView before calling over to WebCore. * WebView.subproj/WebFrameView.m: (-[WebFrameView _scrollOverflowInDirection:granularity:]): added wrapper function that checks if documentView is a WebHTMLView (-[WebFrameView scrollToBeginningOfDocument:]): uses new wrapper function now (-[WebFrameView scrollToEndOfDocument:]): uses new wrapper function now (-[WebFrameView _pageVertically:]): uses new wrapper function now (-[WebFrameView _pageHorizontally:]): uses new wrapper function now (-[WebFrameView _scrollLineVertically:]): uses new wrapper function now (-[WebFrameView _scrollLineHorizontally:]): uses new wrapper function now 2005-02-24 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3985889> REGRESSION (125-180): setting <img> src to GIF that already animated does not animate; just shows final frame Reviewed by Hyatt. * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData resetAnimation]): * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer resetAnimation]): (-[WebInternalImage resetAnimation]): (-[WebImageRenderer drawImageInRect:fromRect:compositeOperator:context:]): 2005-02-24 Kevin Decker <kdecker@apple.com> Reviewed by John. Fixed <rdar://problem/3962401> Don't load multipart/x-mixed-replace content to prevent memory leak Since we're not going to fix <rdar://problem/3087535> for Tiger, we should not load multipart/x-mixed-replace content. Pages with such content contain what is essentially an infinite load and therefore may leak. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient connection:didReceiveResponse:]): Disabled loading of multipart/x-mixed-replace content until we fully implement server side push. * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient didReceiveResponse:]): Ditto. Same exact thing for sub resources. 2005-02-23 John Sullivan <sullivan@apple.com> Reviewed by Ken. - fixed <rdar://problem/4021370> REGRESSION (Tiger): WebKit part of fix for shift-tab on tivofaq doing the wrong thing * WebView.subproj/WebFrameView.m: (-[WebFrameView becomeFirstResponder]): If our previousValidKeyView is nil or self (same as nil modulo AppKit oddness), look out of the box and get the previousValidKeyView of our webview. 2005-02-23 Darin Adler <darin@apple.com> Reviewed by Hyatt. - fixed <rdar://problem/4010196> REGRESSION (125-186+): 8-character timestamps in gmail wrap to 2 lines (width:8ex; font-size:80%) * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer xHeight]): Return the maximum of the "x" height and width. Comment in the code explains why in more detail. 2005-02-22 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3937203> when a div adds a scrollbar (overflow:auto) we do not get regions Compare regions after automatice scroll regions have been added. Reviewed by Maciej. * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge dealloc]): (-[WebBridge _compareDashboardRegions:]): (-[WebBridge dashboardRegionsChanged:]): 2005-02-22 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4012463> Dashboard widgets don't work with authenticating proxies Added new SPI for dashboard that just calls default delegate behavior. Reviewed by Maciej. * WebView.subproj/WebView.m: (-[WebView handleAuthenticationForResource:challenge:fromDataSource:]): * WebView.subproj/WebViewPrivate.h: 2005-02-22 Chris Blumenberg <cblu@apple.com> Reviewed by mjs. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge issuePasteAndMatchStyleCommand]): support for new "PasteAndMatchStyle" exec command === Safari-188 === 2005-02-21 David Harrison <harrison@apple.com> Reviewed by Darin. <rdar://problem/3943090> REGRESSION (Mail): Spelling underline incompletely erased following certain steps * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer misspellingLineThickness]): (-[WebTextRenderer misspellingLinePatternWidth]): Replaced #defines with these methods, so others can get the same info. (-[WebTextRenderer drawLineForMisspelling:withWidth:]): Keep underline within originally specified bounds. 2005-02-21 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/4016358> don't ever display IDN URLs with characters from "possible Latin look-alike" scripts * Misc.subproj/WebNSURLExtras.m: (containsPossibleLatinLookalikes): Added. (-[NSString _web_mapHostNameWithRange:encode:makeString:]): Call containsPossibleLatinLookalikes, and if true, don't decode the host name. 2005-02-19 Kevin Decker <kdecker@apple.com> Reviewed by Chris. Fixed <rdar://problem/4010765> Flash player can be used to arbitrarily open popup windows without user permission Our window.open() policy is to refuse the <script>window.open(...)</script> case and allow the inline the <a href="javascript:window.open('foo')> case. Clever advertisers at some point realized that by executing their Javascript through the Flash plugin, Safari would always treat their code as the inline case, and thus, they were able to work around our popup blocker. * Plugins.subproj/WebBaseNetscapePluginView.h: Addded currentEventIsUserGesture boolean ivar. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendEvent:]): If at any point the user clicks or presses a key from within a plugin, set the currentEventIsUserGesture flag to true. This is important to differentiate legitimate window.open() calls originating from plugins; we still want to allow those. (-[WebBaseNetscapePluginView initWithFrame:]): In our asynchronous load, pass along currentEventIsUserGesture to the PluginRequest. (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): Inform WebCore if this was a user originated gesture when calling executeScript(). (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): (-[WebPluginRequest initWithRequest:frameName:notifyData:sendNotification:didStartFromUserGesture:]): (-[WebPluginRequest isCurrentEventUserGesture]): Added. 2005-02-18 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3945271> REGRESSION (Mail): pasted plain text should pick up typing style instead of being unstyled Reviewed by kocienda. * WebView.subproj/WebDataSource.m: (-[WebDataSource _replaceSelectionWithArchive:selectReplacement:]): pass NO for matchStyle to replaceSelection * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:chosePlainText:]): return new chosePlainText parameter (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]): pass chosePlainText for matchStyle to replaceSelection (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): ditto 2005-02-17 Richard Williamson <rjw@apple.com> Removed code that should not have been checked in from last patch. * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory isFontFixedPitch:]): 2005-02-17 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead Fixed w/o introducing a performance regression. Reviewed by Vicki (and earlier by Dave Harrison). * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _computeWidthForSpace]): (widthForNextCharacter): * WebCoreSupport.subproj/WebTextRendererFactory.h: * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[NSFont _web_isFakeFixedPitch]): (-[WebTextRendererFactory isFontFixedPitch:]): (-[WebTextRendererFactory fontWithFamily:traits:size:]): 2005-02-17 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3959304> PDF in img tag is not rendered correctly anymore We were incorrectly adding image position when flipping coordinates. Reviewed by David Harrison. * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _PDFDrawFromRect:toRect:operation:alpha:flipped:context:]): 2005-02-17 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4007262> Seed: Flight tracker scrolling moves to the left Added SPI for dashboard to disable wheel scrolling of the WebClipView. Reviewed by Ken. * ChangeLog: * WebView.subproj/WebClipView.m: (-[WebClipView _focusRingVisibleRect]): (-[WebClipView scrollWheel:]): * WebView.subproj/WebView.m: (-[WebViewPrivate init]): (-[WebView drawRect:]): (-[WebView _dashboardBehavior:]): * WebView.subproj/WebViewInternal.h: * WebView.subproj/WebViewPrivate.h: === Safari-187 === 2005-02-17 Vicki Murley <vicki@apple.com> - roll out this change, since it causes a 1.5% performance regression 2005-02-15 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead Lie about Osaka-Mono. Treat it as fixed pitch, even though, strictly speaking it isn't. (Similar to what we do with Courier New.) Reviewed by David Harrison. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _computeWidthForSpace]): * WebCoreSupport.subproj/WebTextRendererFactory.h: * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[NSFont _web_isFakeFixedPitch]): (-[WebTextRendererFactory isFontFixedPitch:]): (-[WebTextRendererFactory fontWithFamily:traits:size:]): 2005-02-17 John Sullivan <sullivan@apple.com> Reviewed by Ken. - fixed <rdar://problem/3997185> The Web view on .Mac Prefs caused System Prefs to lockup (resolved by re-boot only) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge nextKeyViewOutsideWebFrameViews]): Don't allow recursion here; assert on debug build, return nil on deployment. I couldn't get my machine into a state to repro this problem (and neither could the originator), but it's obvious from the stack crawl that this method was recursing when it shouldn't have. 2005-02-16 John Sullivan <sullivan@apple.com> Written by Darin, reviewed by me. - WebKit part of fix for <rdar://problem/4007384> FILTER: Bookmark of RSS with Japanese search word & multiple RSS pages loses filter * DOM.subproj/DOMPrivate.h: updated this file, which is a copy of the WebCore version 2005-02-16 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3966973> Tiger 8A357: Binary Compatiblity: frequent Webstractor.app crashes [WebImageData _nextFrame] Webstractor.app was playing tricks to create thumbnails of pages. This caused the 'focusView' to be incorrect during animated GIF frame rendering. Reviewed by Chris. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer _startOrContinueAnimationIfNecessary]): 2005-02-16 Vicki Murley <vicki@apple.com> Reviewed by me, code change by Darin. - fixed the build on Panther * WebView.subproj/WebFormDataStream.m: (webSetHTTPBody): Added a Panther-specific code path that just loads all the data into one big NSData object. This means that bug 3686434 won't be fixed on SUPanWheat; we'll still load the file into memory before sending it to the server on Panther. 2005-02-15 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3998368> Tiger8A376: WebTextRenderer assertion failure in Safari while browsing news.bbc.co.uk Removed use of FATAL_ALWAYS from getUncachedWidth(). It's unclear why we would trigger the FATAL_ALWAYS. In the past we've seen the message triggered because of corrupt fonts. Anyway, in this particular case, we will now return 0 for the character width, rather than exiting. Reviewed by David Harrison. * WebCoreSupport.subproj/WebTextRenderer.m: (getUncachedWidth): 2005-02-15 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead Lie about Osaka-Mono. Treat it as fixed pitch, even though, strictly speaking it isn't. (Similar to what we do with Courier New.) Reviewed by David Harrison. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _computeWidthForSpace]): * WebCoreSupport.subproj/WebTextRendererFactory.h: * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[NSFont _web_isFakeFixedPitch]): (-[WebTextRendererFactory isFontFixedPitch:]): (-[WebTextRendererFactory fontWithFamily:traits:size:]): 2005-02-14 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3686434> Safari uses too much RAM on file upload, leading to malloc errors and crashes (HP printers) * WebView.subproj/WebFormDataStream.h: Added webSetHTTPBody, which creates and connects an appropriate stream to an NSMutableURLRequest. * WebView.subproj/WebFormDataStream.m: Added implementation here. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): Use webSetHTTPBody. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:customHeaders:postData:referrer:forDataSource:]): Use webSetHTTPBody. * WebView.subproj/WebFrame.m: (-[WebFrame _loadItem:withLoadType:]): Use webSetHTTPBody. (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): Ditto. * English.lproj/StringsNotToBeLocalized.txt: Updated for this change and other recent changes. 2005-02-11 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4002505> 8A378: Endlessly animating gif's on http://www.entropy.ch If animated images had no loop count property we were incorrectly looping forver. Note, that in the course of fixing this bug I found that ImageIO is incorrectly NOT reporting the loop count for a whole class of animated GIFs. Reviewed by Ken Kocienda. * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _repetitionCount]): === Safari-186 === 2005-02-11 Vicki Murley <vicki@apple.com> Reviewed by Darin. - fix deployment build on Panther * WebView.subproj/WebHTMLView.m: (-[WebHTMLView changeBaseWritingDirection:]): ifdef out NSWritingDirectionNatural (-[WebHTMLView toggleBaseWritingDirection:]): fix a spacing issue 2005-02-10 David Harrison <harrison@apple.com> Reviewed by Richard. <rdar://problem/3991652> REGRESSION (Mail): Deleting entire line in reply deletes extra blank line and moves insertion point * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:isTypingAction:]): (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): (-[WebHTMLView selectToMark:]): (-[WebHTMLView swapWithMark:]): (-[WebHTMLView transpose:]): (-[WebHTMLView _selectMarkedText]): (-[WebHTMLView _selectRangeInMarkedText:]): Adopt new default affinity of NSSelectionAffinityDownstream as of <rdar://problem/3937447>. 2005-02-10 Darin Adler <darin@apple.com> Reviewed by Harrison. - fixed <rdar://problem/4002084> Setting ResourceLoadDelegate to nil can cause a crash * WebView.subproj/WebView.m: (-[WebView _cacheResourceLoadDelegateImplementations]): Set booleans to either YES or NO, rather than setting them only in the YES case. 2005-02-10 Darin Adler <darin@apple.com> Reviewed by Harrison. - fixed <rdar://problem/3991225> Format->Style->Underline menu item does not get checked when selected text is underlined * WebView.subproj/WebHTMLView.m: (-[WebHTMLView validateUserInterfaceItem:]): Added tons of additional cases in here for all the "action" style methods in this class that don't always want to be valid. For the ones where state makes sense, added the state-checking code too for the menu item case. (-[WebHTMLView ignoreSpelling:]): Removed unnecessary "editable text only" check since this command would work fine on a non-editable selection. (-[WebHTMLView swapWithMark:]): Ditto. (-[WebHTMLView changeBaseWritingDirection:]): Added. Like toggle, but based on the sender's tag. 2005-02-08 Darin Adler <darin@apple.com> "Reviewed" by Richard (he told me the file was obsolete). - got rid of an obsolete file * Plugins.subproj/npsap.h: Removed. * copy-webcore-files-to-webkit: Removed npsap.h. 2005-02-09 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/4000073> non-screen font error on www.worldofwarcraft.com Reviewed by John Sullivan. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _smallCapsFont]): === Safari-185 === 2005-02-07 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3993354> Safari claims to put RTFD on the pasteboard, but doesn't, in some cases Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _stripAttachmentCharactersFromAttributedString:]): moved (-[WebHTMLView _writeSelectionWithPasteboardTypes:toPasteboard:cachedAttributedString:]): take cachedAttributedString parameter in case the attributed string was gotten already (-[WebHTMLView _writeSelectionToPasteboard:]): omit RTFD from the types list when there are no attachments 2005-02-07 David Harrison <harrison@apple.com> Reviewed by Ken. <rdar://problem/3990693> REGRESSION (8A373): ctrl-k now deletes just one character instead of line * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): Set the selection so that deleteKeyPressedWithSmartDelete knows what to delete. 2005-02-06 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed <rdar://problem/3963166> PDFView SPI print method is being deprecated, moving to PDFDocument; please update WebKit * WebView.subproj/WebPDFView.m: (-[WebPDFView printOperationWithPrintInfo:]): Target the document instead of the view. * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes and also moved one translation to be a file-specific item rather than a file-independent one. 2005-02-05 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3991974> REGRESSION: www.jabra.com world location screen does not work Reviewed by hyatt. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:]): use the baseURL from the bridge rather than from the response 2005-02-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3802781> rtf->html pasteboard conversion using xhtml Reviewed by kocienda. * WebView.subproj/WebHTMLView.m: (+[WebHTMLView _excludedElementsForAttributedStringConversion]): new (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:]): call _excludedElementsForAttributedStringConversion 2005-02-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3832973> copy text from PowerPoint, paste into Blot (or presumably Mail) and get a single missing image icon Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:]): prefer RTF and RTFD over images just as NSTextView does 2005-02-03 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3555137> REGRESSION (125-173): Flash animation can erase parts of chrome (bookmarks bar & tab bar) convertRect:toView: returns incorrect results inside of viewWillMoveToWindow: with a nil window. Workaround this by catching this case. Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView superviewsHaveSuperviews]): new (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): clip out the plug-in view when superviewsHaveSuperviews returns NO 2005-02-03 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3893513> Sun iPlanet app: when saving to a file it brings up a window with the thing to be saved instead Reviewed by adele. * WebView.subproj/WebTextView.m: (+[WebTextView unsupportedTextMIMETypes]): added "text/ldif" to the list of MIME types that our text view doesn't handle === Safari-183 === 2005-02-03 Chris Blumenberg <cblu@apple.com> * English.lproj/StringsNotToBeLocalized.txt: updated 2005-02-03 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3989611> Evite style "add vCalendar to calendar" do not work Reviewed by adele. * WebView.subproj/WebTextView.m: (+[WebTextView unsupportedTextMIMETypes]): added "text/x-vcalendar" to the list of MIME types our text view doesn't handle 2005-02-03 Vicki Murley <vicki@apple.com> Reviewed by Darin. - fix deployment build breakage on Panther * WebView.subproj/WebHTMLView.m: (-[WebHTMLView toggleBaseWritingDirection:]): 2005-02-02 John Sullivan <sullivan@apple.com> Reviewed by Chris. - WebKit part of fix for <rdar://problem/3980651> REGRESSION (125-180): Huge number of pages printed from certain page, iFrame involved This also fixes the problems with printing from GMail, yay! * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]): Don't adjust margins for header/footer here, because this is called for each subframe. (-[WebHTMLView knowsPageRange:]): Do adjust margins for header/footer here (analogous to WebTextView and WebImageView). Also, round the page height to an integer here (noticed in passing). 2005-02-02 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3986546> Cut, delete, and paste menu items are active when a image is opened in window Reviewed by john. * WebView.subproj/WebView.m: (-[WebView _responderValidateUserInterfaceItem:]): new, has the responder validate the item (-[WebView validateUserInterfaceItem:]): call VALIDATE for each repsonder selector using FOR_EACH_RESPONDER_SELECTOR macro (-[WebView _performResponderOperation:with:]): call factored out method _responderForResponderOperations (-[WebView _responderForResponderOperations]): new, code from _performResponderOperation:with: 2005-02-02 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView) Reviewed by rjw. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge selectWordBeforeMenuEvent]): new * WebView.subproj/WebView.m: (-[WebView _selectWordBeforeMenuEvent]): new SPI (-[WebView _setSelectWordBeforeMenuEvent:]): new SPI * WebView.subproj/WebViewInternal.h: * WebView.subproj/WebViewPrivate.h: 2005-02-02 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3986013> Assertion failure going back after page load error (no apparent problem in nondebug build) Reviewed by rjw. * WebView.subproj/WebDataSource.m: (-[WebDataSource _setPrimaryLoadComplete:]): don't set the data source data when the main client is nil 2005-02-02 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3823109> WebKit should support -toggleBaseWritingDirection: (bidi editing support) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _applyParagraphStyleToSelection:withUndoAction:]): New function that calls through to new feature that allows callers to force all properties in a style to be applied as block styles. (-[WebHTMLView _alignSelectionUsingCSSValue:withUndoAction:]): Removed FIXME comment for something that has been fixed. (-[WebHTMLView toggleBaseWritingDirection:]): Implemented. 2005-02-01 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3977727> WebKit should use new SPI to support faster GIF rendering Note: This REQUIRES build >= 3A362 when building on Tiger. Reviewed by John. * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _imageSourceOptions]): === Safari-182 === 2005-02-01 Richard Williamson <rjw@apple.com> Added new SPI for <rdar://problem/3967063> need spi on WebView to turn of lcd text for Dashboard Reviewed by Chris. * WebCoreSupport.subproj/WebTextRenderer.m: (_drawGlyphs): * WebView.subproj/WebView.m: (-[WebView drawRect:]): (-[WebView _dashboardBehavior:]): (+[WebView _setShouldUseFontSmoothing:]): (+[WebView _shouldUseFontSmoothing]): * WebView.subproj/WebViewInternal.h: * WebView.subproj/WebViewPrivate.h: 2005-01-31 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3949806> REGRESSION: Source window fails to refresh correctly on reload The data method was being called on WebDataSource before the data was set. This fix makes WebDataSource set the data before releasing the main client instead of waiting for the main client to set it when it is dealloced. Reviewed by darin. * WebView.subproj/WebDataSource.m: (-[WebDataSource _setData:]): moved within file (-[WebDataSource _setPrimaryLoadComplete:]): call _setData: with the data from the main client before letting go of the main client * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient releaseResources]): removed call to _setData: since the data source may need the data before releaseResources is called 2005-01-31 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3946285> Seed: Safari crashed by selecting all at internet-moebel.com Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _hitViewForEvent:]): new, factored hit test hack to this method (-[WebHTMLView _updateMouseoverWithEvent:): call _hitViewForEvent: (-[WebHTMLView acceptsFirstMouse:]): call _setMouseDownEvent: and _isSelectionEvent: on the hit HTMLView or else when it's asked to drag it will assert (-[WebHTMLView shouldDelayWindowOrderingForEvent:]): ditto 2005-01-31 David Harrison <harrison@apple.com> Reviewed by Darin. <rdar://problem/3961239> AX Setting AXFocused on AXScrollArea of AXWebArea will cause keyboard selection change * WebView.subproj/WebHTMLView.m: (-[WebHTMLView maintainsInactiveSelection]): Keep the selection when the new first respomder is our own scrollview, in both editable and non-editaqble content. 2005-01-31 Jens Alfke <jens@apple.com> Reviewed by John. - Fixed <rdar://problem/3903199> REGRESSION: Large background patterns slide around while loading * WebCoreSupport.subproj/WebImageData.m: (drawPattern): (-[WebImageData tileInRect:fromPoint:context:]): 2005-01-30 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3965265> Safari displays HTML as source when default encoding is Hebrew (due to direction overrides added by encoding converter) * WebView.subproj/WebPreferencesPrivate.h: Added _systemCFStringEncoding, and changed _setInitialDefaultTextEncodingToSystemEncoding to be a class method. * WebView.subproj/WebPreferences.m: (+[WebPreferences _systemCFStringEncoding]): Added. New SPI to be used by Safari. Broken out of _setInitialDefaultTextEncodingToSystemEncoding, but also added cases for MacArabic and MacHebrew. (+[WebPreferences _setInitialDefaultTextEncodingToSystemEncoding]): Refactor to use _systemCFStringEncoding. 2005-01-28 Jens Alfke <jens@apple.com> Reviewed by Richard. <rdar://problem/3727680> printing some page with WebKit generates a PDF with a 1x1 image with soft mask (causes Acrobat to hang during print spooling) Detect 1x1 images, extract and cache color of single pixel, reduce draw and tile operations to a color fill (or to a no-op if the pixel is clear.) * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _invalidateImages]): (-[WebImageData _checkSolidColor:]): (-[WebImageData _cacheImages:allImages:]): (-[WebImageData _fillSolidColorInRect:compositeOperation:context:]): (-[WebImageData tileInRect:fromPoint:context:]): 2005-01-28 David Harrison <harrison@apple.com> Reviewed by Darin. <rdar://problem/3584942> AX: Safari Accessibility parent-child mismatch Use AppKit SPI _accessibilityParentForSubview to return KWQAccObject parent of AppKit AX object. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _accessibilityParentForSubview:]): New. 2005-01-28 Chris Blumenberg <cblu@apple.com> WebKit side of: <rdar://problem/3951283> can view pages from the back/forward cache that should be disallowed by Parental Controls Reviewed by john. * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate webView:shouldGoToHistoryItem:]): new private delegate method * WebView.subproj/WebFrame.m: (-[WebFrame _goToItem:withLoadType:]): call new delegate method * WebView.subproj/WebPolicyDelegatePrivate.h: 2005-01-26 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin, Hyatt and Ken. <rdar://problem/3790449> REGRESSION (Mail): underline behavior is flaky because of how CSS handles text-decoration * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _styleFromFontAttributes:]): Use new -khtml-text-decorations-in-effect property (-[WebHTMLView _styleForAttributeChange:]): likewise (-[WebHTMLView underline:]): likewise 2005-01-27 Ken Kocienda <kocienda@apple.com> Reviewed by Maciej * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _handleKillRing:prepend:]): New helper function. Code factored out from _deleteRange:killRing:prepend:smartDeleteOK:isTypingAction:. (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:isTypingAction:]): No longer takes unused preflight argument. Now takes new isTypingAction argument. Uses isTypingAction to determine which flavor of delete command to call. (-[WebHTMLView _deleteSelection]): No longer passes unused preflight argument. Now passes new isTypingAction argument. (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): Rearranged code to call correct flavor of delete command, based on whether typing should be preserved. Some other cleanups. (-[WebHTMLView deleteForward:]): Add _isEditable check. (-[WebHTMLView deleteBackward:]): Now calls _deleteWithDirection instead of having unique behavior different from forward delete. (-[WebHTMLView deleteWordForward:]): Add new isTypingAction flag to _deleteWithDirection call. (-[WebHTMLView deleteWordBackward:]): Ditto. (-[WebHTMLView deleteToBeginningOfLine:]): Ditto. (-[WebHTMLView deleteToEndOfLine:]): Ditto. (-[WebHTMLView deleteToBeginningOfParagraph:]): Ditto. (-[WebHTMLView deleteToEndOfParagraph:]): Ditto. (-[WebHTMLView deleteToMark:]): Ditto. === Safari-181 === 2005-01-27 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3973272> REGRESSION: Safari uses QT plugin to display PNG images Reviewed by john. * Plugins.subproj/WebBasePluginPackage.m: use renamed QT bundle ID 2005-01-26 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3829517> WebView still draws white when setDrawsBackground set to NO and no content loaded yet * WebView.subproj/WebFrameView.m: (-[WebFrameView drawRect:]): Check drawsBackground, and don't draw the white "no document" background if it's NO. This fixes things for frames with no document. * WebView.subproj/WebImageView.m: (-[WebImageView drawRect:]): Same as above. This fixes things for frames with just an image. * WebView.subproj/WebFrame.m: (-[WebFrame _updateDrawsBackground]): Call setDrawsBackground: on the document view if it implements it. This fixes things for frames with plain text. 2005-01-25 John Sullivan <sullivan@apple.com> Reviewed by Chris. - WebKit part of fix for: <rdar://problem/3970670> Text context menu in WebKit needs "Look Up in Dictionary" item * WebView.subproj/WebDefaultContextMenuDelegate.m: (localizedMenuTitleFromAppKit): return English string in the case where AppKit bundle is found but doesn't contain the expected string. This case will be hit by people testing with an older AppKit. (-[WebDefaultUIDelegate menuItemWithTag:]): create Look Up in Dictionary item (-[WebDefaultUIDelegate contextMenuItemsForElement:]): add Look Up in Dictionary item and separator (-[WebDefaultUIDelegate editingContextMenuItemsForElement:]): ditto * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): new method, handles bringing up the Dictionary window. Includes FIXMEs for a couple of the known loose ends. (-[WebHTMLView validateUserInterfaceItem:]): handle Look Up in Dictionary item like the other new items * WebView.subproj/WebUIDelegatePrivate.h: added SPI constant for Look Up in Dictionary menu item 2005-01-24 Maciej Stachowiak <mjs@apple.com> Fixed Panther build (missing ifdef) * WebView.subproj/WebDefaultContextMenuDelegate.m: 2005-01-24 John Sullivan <sullivan@apple.com> Reviewed by Darin. - WebKit part of fix for <rdar://problem/3960231> Text context menu in WebKit needs Spotlight and Google items * WebView.subproj/WebDefaultContextMenuDelegate.m: (localizedMenuTitleFromAppKit): new function, gets localized string from AppKit so we can avoid adding localized strings to WebKit at this late date in Tiger. Returns the non-localized English string if we can't find the localized string in AppKit. (-[WebDefaultUIDelegate menuItemWithTag:]): handle the two new menu items by tag name (-[WebDefaultUIDelegate contextMenuItemsForElement:]): add menu items for Search in Google and Search in Spotlight to selected-text menu item for the noneditable case (-[WebDefaultUIDelegate editingContextMenuItemsForElement:]): add menu items for Search in Google and Search in Spotlight to selected-text menu item for the editable case * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _searchWithGoogleFromMenu:]): implement this menu item action method, using same method name and implementation as NSTextView (-[WebHTMLView _searchWithSpotlightFromMenu:]): implement this menu item action method, using same basic implementation as NSTextView (-[WebHTMLView validateUserInterfaceItem:]): validate new menu items * WebView.subproj/WebUIDelegatePrivate.h: define new tags for new menu items * English.lproj/StringsNotToBeLocalized.txt: updated for these changes 2005-01-24 Darin Adler <darin@apple.com> * WebView.subproj/WebDataSource.m: (+[WebDataSource _repTypesAllowImageTypeOmission:]): Do the same check as for view types, so the representation types are consistent. 2005-01-24 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3791158> REGRESSION (Mail): copyFont: and pasteFont: copy and paste only the NSFont, not other attributes * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _styleFromFontAttributes:]): Added the last few loose ends here: strikethrough and underline. - fixed <rdar://problem/3967393> add a user default that lets you turn off WebKit PDF support * WebView.subproj/WebFrameView.m: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): Leave the PDF-handling classes out of the dictionary if the secret default is set. * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2005-01-20 Darin Adler <darin@apple.com> Reviewed by Kristin Forster. - fixed <rdar://problem/3964972> update _initWithCGSEvent:eventRef: call in mouse moved workaround (breaks cursors in Carbon WebKit applications) * Carbon.subproj/HIWebView.m: (MouseMoved): Instead of munging the event record's window number directly before calling _initWithCGSEvent, on Tiger we call _eventRelativeToWindow on the event after creating it. Also added a check so that with Macromedia Contribute's workaround in place we don't do anything at all to the event. Tested with both Contribute and CarbonWeb. * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2005-01-20 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3815672> REGRESSION (Mail): Japanese text cannot be made bold The AppKit's font substitution API doesn't match font traits! It only find fonts that contain the appropriate glyphs. This patch attempts to find the best variation within a family. Reviewed by Maciej. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _substituteFontForString:families:]): === Safari-180 === 2005-01-20 Ken Kocienda <kocienda@apple.com> Reviewed by John Fix for this bug: <rdar://problem/3786659> REGRESSION (Mail): editable WebViews don't work with "size up" and "size down" NSFontManager changes * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _addToStyle:fontA:fontB:]): This is the WebKit side of the fix. Replaced unimplemented code blocks with FIXME's in them for make bigger and make smaller with real working code. 2005-01-19 David Hyatt <hyatt@apple.com> Fix for 3513067, spaces being lost when RTL text is rendered. Make sure not to allow hangers or spaces in the margin. Reviewed by john * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _createATSUTextLayoutForRun:style:]): 2005-01-19 Darin Adler <darin@apple.com> Reviewed by vicki - fixed <rdar://problem/3962559> stopAnimationsInView leaks after cvs-base * WebCoreSupport.subproj/WebImageData.m: (+[WebImageData stopAnimationsInView:]): add a release 2005-01-19 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3961809> plug-in code attempts to load empty URL Reviewed by john. * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView didStart]): don't start load if URL is empty 2005-01-17 Darin Adler <darin@apple.com> * DOM.subproj/DOMPrivate.h: Check in generated file. 2005-01-17 Darin Adler <darin@apple.com> Reviewed by John and Richard. - fixed <rdar://problem/3907453> printing a multi-page PDF document from Safari doesn't produce correct output * WebView.subproj/WebFrameViewPrivate.h: Added. * WebView.subproj/WebFrameView.m: (-[WebFrameView canPrintHeadersAndFooters]): Added. Returnes NO for documents that can't print headers or footers, and delegates to the document view to answer the question. Defaults to NO, since only a view that actively does the work is compatible with our header and footer code. (-[WebFrameView printOperationWithPrintInfo:]): Added. Returns an NSPrintOperation set up for printing. The reason we return this rather than an NSView is that in the PDFView case, the print info is changed around before creating the NSPrintOperation, and also the PDFKit SPI works this way. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView canPrintHeadersAndFooters]): Added. Returns YES. * WebView.subproj/WebImageView.m: (-[WebImageView canPrintHeadersAndFooters]): Ditto. * WebView.subproj/WebTextView.m: (-[WebTextView canPrintHeadersAndFooters]): Ditto. * WebView.subproj/WebPDFView.m: (-[WebPDFView canPrintHeadersAndFooters]): Added. Returns NO. (-[WebPDFView printOperationWithPrintInfo:]): Added. Calls getPrintOperationForPrintInfo: autoRotate:YES on the PDFView. * WebKit.pbproj/project.pbxproj: Added WebFrameViewPrivate.h as a new private header. 2005-01-13 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3932107> Safari does not load QT Cocoa plug-in if the WebPluginMIMETypes key is not in the info.plist Fixing this bug required that we allow WebKit plug-ins (as well as Netscape plug-ins) support BP_CreatePluginMIMETypesPreferences which allows plug-ins create an auxiliary MIME types file. Reviewed by adele. * Plugins.subproj/WebBasePluginPackage.h: * Plugins.subproj/WebBasePluginPackage.m: (+[WebBasePluginPackage preferredLocalizationName]): moved from WebNetscapePluginPackage (-[WebBasePluginPackage pListForPath:createFile:]): ditto (-[WebBasePluginPackage getPluginInfoFromPLists]): ditto (-[WebBasePluginPackage isLoaded]): return isLoaded ivar (-[WebBasePluginPackage load]): if loaded, get BP_CreatePluginMIMETypesPreferences symbol * Plugins.subproj/WebNetscapePluginPackage.h: * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): call super when done so BP_CreatePluginMIMETypesPreferences can be initialized * Plugins.subproj/WebPluginPackage.m: (-[WebPluginPackage initWithPath:]): call getPluginInfoFromPLists (-[WebPluginPackage load]): call super when done so BP_CreatePluginMIMETypesPreferences can be initialized 2005-01-13 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3952809> WebJavaPlugIn.h comments need method name corrected (webPlugInCallJava) Reviewed by Maciej. * Plugins.subproj/WebJavaPlugIn.h: === Safari-179 === 2005-01-13 Vicki Murley <vicki@apple.com> Reviewed by Adele. - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005 * WebKit.pbproj/project.pbxproj: bump "2004" to "2005" 2005-01-13 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3951911> REGRESSION: Animated GIF images with loop counts no longer update Draw last image after animation loop terminates. (We were drawing the image at index+1, which doesn't exist!) Reviewed by Darin. * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _nextFrame:]): 2005-01-13 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3952084> REGRESSION: Links at projectseven.com now draw and update incorrectly during hover Turn off use of new CGContextStrokeLineSegments API. We should turn back on when 3952944 is fixed. Reviewed by Darin. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]): 2005-01-13 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3937663> repro assertion failure and crash dragging image that has PDF source Reviewed by adele. * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragImage:rect:event:pasteboard:source:offset:]): if [WebImageRenderer image] returns nil, fallback to code that uses a file icon as the drag image * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory supportedMIMETypes]): removed code that omits PDF and PostScript from the list since this omission is only needed in WebImageView * WebView.subproj/WebImageView.m: (+[WebImageView supportedImageMIMETypes]): added code that omits PDF and PostScript since we don't want WebImageView to render these types 2005-01-10 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. <rdar://problem/3758033> REGRESSION (Mail): Support attributes in marked text (International input) * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]): Changed to support underline thickness. Also added a bit of a hack here to move thickness 2 underlines down by .5 pixels, since the rendering engine can't give a fractional pixel offset. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView validAttributesForMarkedText]): Support underline, underline color and marked clause attributes. Others that NSText supports are unimplemented for now. (-[WebHTMLView firstRectForCharacterRange:]): Remove needless logging. (-[WebHTMLView unmarkText]): Updated for new WebCore SPI. (-[WebHTMLView _extractAttributes:ranges:fromAttributedString:]): New method to pull the attributes and ranges out of an attributed string. (-[WebHTMLView setMarkedText:selectedRange:]): Extract attributes and pass to WebCore. (-[WebHTMLView insertText:]): Add comment noting that we don't really handle attributed strings here. 2005-01-12 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed <rdar://problem/3848257> WebView will draw more than AppKit asks it to, so views behind won't redraw enough (transparent WebView) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _propagateDirtyRectsToOpaqueAncestors]): As recommended by Troy Stephens, do the layouts here in this call, since it's before propagating the dirty rects to our ancestors. This fixes the bug, but we only do it if the WebView is not opaque, because otherwise we can optimize by only doing layouts you really need, and doing them later on is safe because we know we don't need to draw any of the views behind us. (-[WebHTMLView _layoutIfNeeded]): Added. Factored out from the method below. (-[WebHTMLView _web_layoutIfNeededRecursive]): Added. Like the other "layout if needed" call, but unconditional. (-[WebHTMLView _web_layoutIfNeededRecursive:testDirtyRect:]): Factored out the guts into the _layoutIfNeeded method above. Otherwise unchanged. (-[NSView _web_layoutIfNeededRecursive]): Added. * WebView.subproj/WebFrame.m: (-[WebFrame _updateDrawsBackground]): Call setDrawsBackground:NO on the scroll view when changing the frame to no longer be in "draws background" mode. This is needed because the frame manages the "draws background" mode of the scroll view. It won't have any effect if you call setDrawsBackground:NO before starting to use a WebView, but without it calling setDrawsBackground:NO later won't have an immediate effect (easily visible in Safari). This was hidden before because the HTML view was filling with transparent color, which blew away the fill that was done by NSScrollView. - fixed <rdar://problem/3921129> reproducible crash at www.funnychristmas.com in CFSet manipulation in WebImageData * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _imageSourceOptions]): Changed types so we don't need a cast. (+[WebImageData stopAnimationsInView:]): Instead of building a set of sets, by putting in the sets with addObject, build a single set using unionSet, and then iterate the objects instead of having to iterate the sets and then the objects in each set. The old code ended up sharing the sets with the live code, when the whole idea was to gather all the renderers because the process of stopping modifies the active sets. 2005-01-12 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3926825> Safari ignores GIF loop count Get loop count from file properties, not image properties. Reviewed by Ken Kocienda. * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _commonTermination]): (-[WebImageData fileProperties]): (-[WebImageData _floatProperty:type:at:]): (-[WebImageData _floatFileProperty:type:]): (-[WebImageData _repetitionCount]): 2005-01-11 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3934749> assertion failure in WebBaseNetscapePluginView loading movie Reviewed by john. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView start]): call canStart before asserting about the webView 2005-01-11 John Sullivan <sullivan@apple.com> Reviewed by Darin. - fixed <rdar://problem/3446838> REGRESSION (Mail): text decorations don't print (e.g. <strike>, underline) * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawLineForCharacters:yOffset:withWidth:withColor:]): This bottleneck routine for drawing a line was setting the linewidth to 0 when the graphics context was not drawing to the screen. Thus, no lines. Now links are underlined when printing from Safari (as well as Mail). 2005-01-11 Richard Williamson <rjw@apple.com> Fixed 3949145. CG has a much faster API for drawing lines. Switched over to that new API (CGContextStrokeLineSegments). Reviewed by John Sullivan. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawLineForCharacters:yOffset:withWidth:withColor:]): 2005-01-10 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3948862> REGRESSION: missing images when RTFD is pasted into editable WebView This problem occurred because we were creating image elements before creating corresponding image resources. The fix is to have AppKit call us back to create the resources before it creates the elements. Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:]): don't deal with subresources since that's now done by the following method (-[WebHTMLView resourceForData:preferredFilename:]): new handler method called by AppKit === Safari-178 === 2005-01-06 David Harrison <harrison@apple.com> Reviewed by Dave Hyatt <rdar://problem/3588548> AX: tabbing does not work correctly with the screen reader and a focused link; need AXFocusedUIElement to work. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView accessibilityFocusedUIElement]): Implement this so that AppKit can use it from NSAccessibilityHandleFocusChanged. 2005-01-05 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3936865> REGRESSION: canvas.drawImage no longer scales properly Reviewed by john. * WebCoreSupport.subproj/WebImageData.m: use the height of the inRect instead of the fromRect when setting the origin of the context 2005-01-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3928329> WebKit should pass nil for "language" to checkSpellingOfString: Reviewed by kocienda. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _isSelectionMisspelled]): pass nil not @"" for language 2004-12-21 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. <rdar://problem/3888931> frame naming allows malicious site to bring up a window when you click on a link in another Implement a security check on name frame visbility. This is the same rule as mozilla. You can only target frames by name if you are in the same window, have the same domain as the frame or an ancestor, or if it's a top level window have the same domain as the opener. * WebView.subproj/WebFrame.m: (-[WebFrame _shouldAllowAccessFrom:]): (-[WebFrame _descendantFrameNamed:sourceFrame:]): (-[WebFrame findFrameNamed:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebView.m: (-[WebView _findFrameInThisWindowNamed:sourceFrame:]): (-[WebView _findFrameNamed:sourceFrame:]): * WebView.subproj/WebViewPrivate.h: === Safari-177 === === Safari-176 === 2004-12-20 Richard Williamson <rjw@apple.com> Add call to new API. ImageIO deprecated some older (although quite new!) API. This caused us to fail to build on 337 or later. Developers wanting to build on older versions of Tiger must define USE_DEPRECATED_IMAGESOURCE_API in WebImageData.m. Reviewed by Vicki. * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData propertiesAtIndex:]): 2004-12-20 Richard Williamson <rjw@apple.com> Don't call Tiger SPI on Panther. Reviewed by Vicki. * WebCoreSupport.subproj/WebTextRendererFactory.m: (+[WebTextRendererFactory createSharedFactory]): 2004-12-20 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3884448> WebKit should turn on CG local font cache Enable mutli-tier font caching. We should see a performance boost with this change. Reviewed by Chris. * WebCoreSupport.subproj/WebTextRendererFactory.m: (+[WebTextRendererFactory createSharedFactory]): 2004-12-20 Richard Williamson <rjw@apple.com> Fix image decoding to separately decode image meta data from actual image bits. I incorrectly consolidated decode of meta data and image bits resulting in a huge performance regression. Double size of WebCore cache on lower end machines. On the PLT run on machines with 256MB of memory, too many images were being evicted, causing a re-decode on the PLT. Upping the lower limit of the cache size ensure that no images are evicted (this goes hand-in-hand with the change to the minimum object size from 32K to 40K). Reviewed by Ken. * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (+[WebImageData initialize]): (-[WebImageData _commonTermination]): (-[WebImageData _invalidateImages]): (-[WebImageData _invalidateImageProperties]): (-[WebImageData imageAtIndex:]): (-[WebImageData propertiesAtIndex:]): (-[WebImageData _cacheImages:allImages:]): (-[WebImageData decodeData:isComplete:callback:]): (-[WebImageData incrementalLoadWithBytes:length:complete:callback:]): * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): 2004-12-20 Richard Williamson <rjw@apple.com> Fixed build problem caused by change to ImageIO API. Reviewed by Adele. * WebCoreSupport.subproj/WebImageData.m: 2004-12-19 Darin Adler <darin@apple.com> Reviewed by Kevin. - some garbage collection fixes * Misc.subproj/WebNSObjectExtras.h: (WebCFAutorelease): Replaced the old WebNSRetainCFRelease with this much-easier-to-understand function cribbed from what David Harrison did in WebCore. * Misc.subproj/WebKitNSStringExtras.m: (+[NSString _web_encodingForResource:]): Use CFRelease here to get rid of an unnecessary use of WebNSRetainCFRelease. * Misc.subproj/WebNSURLExtras.m: (+[NSURL _web_URLWithData:relativeToURL:]): Use WebCFAutorelease instead of WebNSRetainCFRelease and autorelease. (-[NSURL _web_URLWithLowercasedScheme]): Ditto. (-[NSString _web_mapHostNameWithRange:encode:makeString:]): Use WebCFAutorelease here; the old code would not work correctly under GC. * Plugins.subproj/WebNetscapePluginPackage.m: (+[WebNetscapePluginPackage preferredLocalizationName]): Use WebCFAutorelease here; the old code would not work correctly under GC. 2004-12-18 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3766915> PDF content needs search to work Reviewed by kevin, john. * WebView.subproj/WebPDFView.m: (-[WebPDFView searchFor:direction:caseSensitive:wrap:]): implemented (-[WebPDFView takeFindStringFromSelection:]): new (-[WebPDFView jumpToSelection:]): new (-[WebPDFView validateUserInterfaceItem:]): new 2004-12-17 Richard Williamson <rjw@apple.com> Make image decoding as lazy as possible for non threaded case; in some cases can avoid unnecessary decoding work. Reviewed by Chris. * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData imageAtIndex:]): (-[WebImageData propertiesAtIndex:]): (-[WebImageData incrementalLoadWithBytes:length:complete:callback:]): 2004-12-16 John Sullivan <sullivan@apple.com> Reviewed by Chris. One of the assertions from my previous checkin fired, so I made this code more robust. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge _preferences]): new helper method, returns global preferences if webView is nil, otherwise returns webView's preferences (-[WebBridge getObjectCacheSize]): use new helper method, remove now-unnecessary assert (-[WebBridge _retrieveKeyboardUIModeFromPreferences:]): ditto 2004-12-16 John Sullivan <sullivan@apple.com> Reviewed by Darin. - fixed <rdar://problem/3913523> Mail needs SPI for adding tooltips to links - cleaned up some calls to +[WebPreferences standardPreferences] that should have been using -[WebView preferences] This adds a (currently SPI-only) new feature that shows the URL of the link under the mouse in a toolTip. I tested this in Safari, but we're adding this feature for Mail, and Safari won't use it (unless of course you know the magic defaults command) * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView start]): use -[WebView preferences] instead of +[WebPreferences standardPreferences] * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge getObjectCacheSize]): ditto (-[WebBridge _retrieveKeyboardUIModeFromPreferences:]): ditto * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate willCacheResponse:]): ditto * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): ditto (-[WebFrame _loadItem:withLoadType:]): ditto * WebView.subproj/WebHTMLViewInternal.h: private struct now keeps ivar for cached value of showsURLsInToolTips so it doesn't have look it up in preferences a zillion times * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _updateMouseoverWithEvent:]): if private->showsURLsInToolTips is true, set the toolTip from the URL. Fall back to showing the title attribute in case some element has a title attribute but no URL. (-[WebHTMLView _mayStartDragAtEventLocation:]): use -[WebView preferences] instead of +[WebPreferences standardPreferences] (-[WebHTMLView _resetCachedWebPreferences:]): get a fresh value for private->showsURLsInToolTips (-[WebHTMLView initWithFrame:]): call _resetCachedWebPreferences the first time, and listen for WebPreferencesChanged notifications (-[WebHTMLView _handleStyleKeyEquivalent:]): use -[WebView preferences] instead of +[WebPreferences standardPreferences] * WebView.subproj/WebPreferenceKeysPrivate.h: added WebKitShowsURLsInToolTipsPreferenceKey * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): initialize WebKitShowsURLsInToolTipsPreferenceKey to 0 (-[WebPreferences showsURLsInToolTips]): return WebKitShowsURLsInToolTipsPreferenceKey value (-[WebPreferences setShowsURLsInToolTips:]): set WebKitShowsURLsInToolTipsPreferenceKey value * WebView.subproj/WebPreferencesPrivate.h: add declarations for showsURLsInToolTips and setter * WebView.subproj/WebTextView.m: (-[WebTextView _preferences]): new helper method that gets preferences from webView if there is a webView, otherwise gets global preferences (-[WebTextView setFixedWidthFont]): use new helper method rather than always using global preferences (-[WebTextView initWithFrame:]): observe WebPreferencesChangedNotification instead of unnecessarily general NSUserDefaultsChangedNotification 2004-12-14 John Sullivan <sullivan@apple.com> Reviewed by Ken. - rest of WebKit fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu, no specific action names I only know of one loose end currently, which I wrote up as <rdar://problem/3920971> Edit menu says "Undo Change Attributes" when it should say "Undo Set Color", from font panel * WebView.subproj/WebHTMLView.m: (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): use WebUndoActionSetColor when dragging color swatch (-[WebHTMLView _applyStyleToSelection:withUndoAction:]): new WebUndoAction parameter, passed across bridge (-[WebHTMLView _toggleBold]): use WebUndoActionSetFont (-[WebHTMLView _toggleItalic]): use WebUndoActionSetFont (-[WebHTMLView pasteFont:]): use WebUndoActionPasteFont (-[WebHTMLView changeFont:]): use WebUndoActionSetFont (-[WebHTMLView changeAttributes:]): use WebUndoActionChangeAttributes (-[WebHTMLView _undoActionFromColorPanelWithSelector:]): new method, returns WebUndoActionSetBackgroundColor or WebUndoActionSetColor (-[WebHTMLView _changeCSSColorUsingSelector:inRange:]): now calls _undoActionFromColorPanelWithSelector (-[WebHTMLView changeColor:]): use WebUndoActionSetColor (-[WebHTMLView _alignSelectionUsingCSSValue:withUndoAction:]): new WebUndoAction parameter, passed through (-[WebHTMLView alignCenter:]): use WebUndoActionCenter (-[WebHTMLView alignJustified:]): use WebUndoActionJustify (-[WebHTMLView alignLeft:]): use WebUndoActionAlignLeft (-[WebHTMLView alignRight:]): use WebUndoActionAlignRight (-[WebHTMLView subscript:]): use WebUndoActionAlignSubscript (-[WebHTMLView superscript:]): use WebUndoActionAlignSuperscript (-[WebHTMLView unscript:]): use WebUndoActionAlignUnscript (-[WebHTMLView underline:]): use WebUndoActionAlignUnderline * WebView.subproj/WebView.m: (-[WebView setTypingStyle:]): pass WebUndoActionUnspecified through as new parameter since we don't have any more specific info (-[WebView applyStyle:]): ditto 2004-12-14 Richard Williamson <rjw@apple.com> Helper method to get URL of plugin view. Reviewed by Chris. * Misc.subproj/WebNSViewExtras.m: (-[NSView _webViewURL]): 2004-12-14 Vicki Murley <vicki@apple.com> Reviewed by rjw. <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments * Plugins.subproj/WebPlugin.h: changed instances of "WebScriptMethods" to "WebScripting" in this file as well, as requested in the bug report 2004-12-13 Maciej Stachowiak <mjs@apple.com> Reviewed by John. <rdar://problem/3912488> Mail throws an exception after backspacing "away" inline input * WebView.subproj/WebHTMLView.m: (-[WebHTMLView setMarkedText:selectedRange:]): Don't try to set a selection if we end up with no marked text, since that case fails and is unnecessary. 2004-12-14 John Sullivan <sullivan@apple.com> Reviewed by Ken. - WebKit part of plumbing of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu, no specific action names * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge nameForUndoAction:]): renamed from setUndoActionNamePlaceholder, replaced arbitrary integers with enum values, and handled new "unspecified" case as a fallback 2004-12-13 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running) Reviewed by John. * Plugins.subproj/WebJavaPlugIn.h: 2004-12-13 John Sullivan <sullivan@apple.com> Reviewed by Maciej. - fixed <rdar://problem/3744583> Safari can not quit when a webpage has a login sheet that can't be cancelled. The proper fix for this would be to change the class of the NSPanel in the nib file. But since this would require a localization change, I did a run-time hack instead. I'll file a bug about fixing this when we're out of localization freeze. * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel replacePanelWithSubclassHack]): new method, creates a new panel that is identical to the original one except that it's our subclass, and moves all the subviews of the original panel into the new one. (-[WebAuthenticationPanel loadNib]): call replacePanelWithSubclassHack (-[NonBlockingPanel _blocksActionWhenModal:]): only method of new NSPanel subclass; overrides this SPI to allow the user to quit when one of these panels/sheets is on-screen 2004-12-10 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3898708> REGRESSION (8A314-8A317): World Clock's short hand not displayed (ImageIO problem with PDF?) Fixed <rdar://problem/3914012> use CG directly for pdf images not ImageIO Create a PDF document and draw that instead of using ImageIO to create a rasterized image. Reviewed by Maciej. * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData setIsPDF:]): (-[WebImageData isPDF]): (-[WebImageData dealloc]): (-[WebImageData decodeData:isComplete:callback:]): (-[WebImageData incrementalLoadWithBytes:length:complete:callback:]): (-[WebImageData size]): (-[WebImageData animate]): (-[WebImageData _createPDFWithData:]): (-[WebImageData _PDFDocumentRef]): (-[WebImageData _PDFDrawInContext:]): (-[WebImageData _PDFDrawFromRect:toRect:operation:alpha:flipped:context:]): * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer size]): (-[WebImageRenderer incrementalLoadWithBytes:length:complete:callback:]): (-[WebImageRenderer drawImageInRect:fromRect:compositeOperator:context:]): (_createImageRef): 2004-12-10 John Sullivan <sullivan@apple.com> Reviewed by Ken. - fixed <rdar://problem/3855127> Error while printing w/o sheet, then window is left in a bad state, if there's no default printer set * WebView.subproj/WebHTMLView.m: (-[WebHTMLView beginDocument]): Our implementation of knowsPageRange puts the WebHTMLView into a special "printing mode". We must exit the "printing mode" to return to normal behavior. This is normally done in endDocument. However, it turns out that if there's an exception in [super beginDocument], then endDocument will not be called (lame-o AppKit API). So, we handle that case by catching the exception and exiting the "printing mode" in beginDocument when it occurs. 2004-12-09 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3905789> Burn Disc image vibrates rapidly Restrict our support for animated images to GIF. We used to use presence of more than one image in a resource to determine if an image should be animated. This caused us to animate icns! If we ever support any other animated image formats we'll have to extend. Reviewed by Hyatt. * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData shouldAnimate]): * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer _startOrContinueAnimationIfNecessary]): 2004-12-09 Richard Williamson <rjw@apple.com> Make WebPluginDatabase.h private (Dashboard needs SPI). * WebKit.pbproj/project.pbxproj: === Safari-175 === 2004-12-09 Chris Blumenberg <cblu@apple.com> Workaround for this exception being raised during download: [WebDownload connection:willStopBufferingData:]: selector not recognized Reviewed by john. * Misc.subproj/WebDownload.m: (-[WebDownload connection:willStopBufferingData:]): implement this method so no exception is raised. It is a bug in Foundation that this method is being called, but it's too late to fix Foundation since it has already been submitted this week. This workaround will prevent any problems from affecting users. 2004-12-08 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3911719> REGRESSION: Images no longer scale vertically Account for scaling correctly when taking into account progressively loaded images. Also added implementation of repetition count for animated GIF images. Also replaced strings with new constants from CFImageProperties.h Also fixed possible problem with -(NSSize)size implementation, relevant to Panther only. Reviewed by Chris. * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _floatProperty:type:at:]): (-[WebImageData _frameDurationAt:]): (-[WebImageData _repetitionCount]): * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer size]): 2004-12-08 Chris Blumenberg <cblu@apple.com> Removed NPN wrappers since these no longer need to be defined to make the QT plug-in work since 3828925 has been fixed. Reviewed by john. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): use under-bar symbols since non-under-bar wrappers have been removed * Plugins.subproj/npapi.m: removed NPN wrappers * WebKit.exp: removed symbols 2004-12-08 Ken Kocienda <kocienda@apple.com> Reviewed by Darin * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): Work around for this bug: <rdar://problem/3908282> REGRESSION (Mail): No drag image dragging selected text in Blot and Mail The reason for the workaround is that this method is called explicitly from the code to generate a drag image, and at that time, getRectsBeingDrawn:count: will return a zero count. This code change uses the passed-in rect when the count is zero. 2004-12-07 Administrator <cblu@apple.com> Support for fix for: <rdar://problem/3734309> Safari doesn't open folders in title bar menu with non-Roman names using Cmd+click Reviewed by john. * Misc.subproj/WebNSURLExtras.h: * Misc.subproj/WebNSURLExtras.m: (+[NSURL _web_URLWithUserTypedString:relativeToURL:]): renamed to take relativeToURL parameter (+[NSURL _web_URLWithUserTypedString:]): call _web_URLWithUserTypedString:relativeToURL: with nil for URL 2004-12-07 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3905564> REGRESSION (Tiger); in History menu, pixel size appears but is wrong for standalone images in Safari. Reviewed by Chris. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer size]): 2004-12-07 Richard Williamson <rjw@apple.com> Support threaded image decoding on machines w/ >= 2 CPUs. Reviewed by Maciej and Chris. * Misc.subproj/WebKitSystemBits.h: * Misc.subproj/WebKitSystemBits.m: (WebSystemMainMemory): (WebNumberOfCPUs): * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (+[WebImageData initialize]): (-[WebImageData init]): (-[WebImageData _commonTermination]): (-[WebImageData dealloc]): (-[WebImageData _invalidateImages]): (-[WebImageData _imageSourceOptions]): (-[WebImageData imageAtIndex:]): (-[WebImageData propertiesAtIndex:]): (-[WebImageData _createImages]): (-[WebImageData decodeData:isComplete:callback:]): (-[WebImageData incrementalLoadWithBytes:length:complete:callback:]): (drawPattern): (-[WebImageData tileInRect:fromPoint:context:]): (-[WebImageData isNull]): (-[WebImageData size]): (-[WebImageData _frameDurationAt:]): (-[WebImageData _frameDuration]): (+[WebImageData stopAnimationsInView:]): (-[WebImageData addAnimatingRenderer:inView:]): (-[WebImageData removeAnimatingRenderer:]): * WebCoreSupport.subproj/WebImageDecodeItem.h: Added. * WebCoreSupport.subproj/WebImageDecodeItem.m: Added. (+[WebImageDecodeItem decodeItemWithImage:data:isComplete:callback:]): (-[WebImageDecodeItem initWithImage:data:isComplete:callback:]): (-[WebImageDecodeItem finalize]): (-[WebImageDecodeItem dealloc]): * WebCoreSupport.subproj/WebImageDecoder.h: Added. * WebCoreSupport.subproj/WebImageDecoder.m: Added. (decoderNotifications): (+[WebImageDecoder initialize]): (+[WebImageDecoder notifyMainThread]): (+[WebImageDecoder sharedDecoder]): (+[WebImageDecoder performDecodeWithImage:data:isComplete:callback:]): (+[WebImageDecoder imageDecodesPending]): (+[WebImageDecoder decodeComplete:status:]): (-[WebImageDecoder init]): (-[WebImageDecoder dealloc]): (-[WebImageDecoder finalize]): (-[WebImageDecoder removeItem]): (-[WebImageDecoder addItem:]): (-[WebImageDecoder decodeItem:]): (decoderThread): (startDecoderThread): * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer initWithData:MIMEType:]): (-[WebImageRenderer initWithContentsOfFile:]): (-[WebImageRenderer incrementalLoadWithBytes:length:complete:callback:]): (-[WebInternalImage incrementalLoadWithBytes:length:complete:callback:]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation receivedData:withDataSource:]): (-[WebImageRepresentation receivedError:withDataSource:]): (-[WebImageRepresentation finishedLoadingWithDataSource:]): 2004-12-07 Chris Blumenberg <cblu@apple.com> Fix for performance regression. Reviewed by kevin. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCacheWithURL:response:data:]): construct the WebResource without copying the data 2004-12-07 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3909243> REGRESSION: large standalone images stop loading part way through Reviewed by kevin. * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient addData:]): call super so it buffers the data 2004-12-06 Richard Williamson <rjw@apple.com> Use the AppKit's font rendering mode. This fixes 3905347, but we still need to track down and resolve why metrics have changed for Courier. This may be caused by changes in AppKit for 3902394. Reviewed by John. * WebCoreSupport.subproj/WebTextRenderer.m: (_AppkitGetCGRenderingMode): (getUncachedWidth): (_drawGlyphs): 2004-12-06 Chris Blumenberg <cblu@apple.com> Forgot to commit copied header. * DOM.subproj/DOMPrivate.h: 2004-12-06 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3907381> NSURLConnection and WebKit buffer 2 copies of incoming data Reviewed by darin. * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (+[WebBaseResourceHandleDelegate initialize]): cache check to see if Foundation supports access to its buffered data (-[WebBaseResourceHandleDelegate addData:]): don't buffer data if Foundation is buffering it for us (-[WebBaseResourceHandleDelegate saveResource]): when creating a WebResource, pass NO for copyData since we know it won't be mutated (-[WebBaseResourceHandleDelegate resourceData]): return the buffered data from the connection if it supports it (-[WebBaseResourceHandleDelegate willStopBufferingData:]): make a mutable copy of the data from NSURLConnection so we can continue buffering (-[WebBaseResourceHandleDelegate willCacheResponse:]): removed optimization that used the cached response data to save the resource since that is obsolete by this change (-[WebBaseResourceHandleDelegate connection:willStopBufferingData:]): new callback from NSURLConnection, informs us that NSURLConnection has given up buffering * WebView.subproj/WebDataSource.m: (-[WebDataSource _receivedData:]): removed buffering code since that's done by NSURLConnection and the main client (-[WebDataSource _setData:]): removed unnecessary cast since the resourceData ivar is now an NSData instead of NSMutableData (-[WebDataSource data]): return resourceData ivar, else return the resourceData from the main client * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient releaseResources]): store resourceData on the data source so it can continue to have data after the main client has gone away (-[WebMainResourceClient connection:didReceiveData:lengthReceived:]):don't call [dataSource data] just to get the length of data received since [dataSource data] can now cause data to be copied (-[WebMainResourceClient connectionDidFinishLoading:]): ditto * WebView.subproj/WebResource.m: (-[WebResource initWithData:URL:MIMEType:textEncodingName:frameName:]): call following method with YES for copyData (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:copyData:]): new initializer, allows caller to choose whether or not the data is copied * WebView.subproj/WebResourcePrivate.h: 2004-12-06 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3903749> REGRESSION (8A321): WebKit gets incorrect glyph metrics due to change in how AppKit uses CGFont Use CGFontRef direction when both getting font metrics and drawing glyphs, instead on depending on [NSFont set]. Reviewed by John. * WebCoreSupport.subproj/WebTextRenderer.m: (getUncachedWidth): (_drawGlyphs): 2004-12-06 Ken Kocienda <kocienda@apple.com> Reviewed by Harrison Fix for this bug: <rdar://problem/3906930> Hitting return key in editable content inserts br elements instead of blocks * WebView.subproj/WebHTMLView.m: (-[WebHTMLView insertNewline:]): One-line change to call insert-block rather than insert-br method on bridge. 2004-12-04 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3846079> assertion failure in WebHTMLView(WebPrivate) removeTrackingRect at boots.com - fixed <rdar://problem/3857737> REGRESSION (165-166): clicking in a text field that's scrolled to the right causes it to scroll all the way left - fixed <rdar://problem/3861952> REGRESSION (165-166): selection is cleared when you start to scroll a frame * WebView.subproj/WebHTMLViewInternal.h: Added handlingMouseDown flag. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _addTrackingRect:owner:userData:assumeInside:useTrackingNum:]): Allow passing in a tracking number of 0, which means no existing tracking number. (-[WebHTMLView _addTrackingRects:owner:userDataList:assumeInsideList:trackingNums:count:]): Ditto. (-[WebHTMLView removeTrackingRect:]): Allow removing a tracking number of 0, which is a no-op. (-[WebHTMLView _removeTrackingRects:count:]): Ditto. (-[WebHTMLView acceptsFirstResponder]): Changed check to use handlingMouseDown flag instead of mouseDownEvent field since that field is set up too early in the mouse down event handling process. (-[WebHTMLView mouseDown:]): Added code to set handlingMouseDown flag. - fixed part of <rdar://problem/3829808> Safari crashes when adding a DOM node that was removed from an XMLHTTP request result * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): Changed code around so that it won't try to create a WebResource when the load fails. - moved next/previous links into private structure with the rest of WebFrame fields (We have a rule against putting new fields into obejcts that are part of our public API.) * WebView.subproj/WebFrame.h: Remove _nextSibling and _previousSibling. * WebView.subproj/WebFramePrivate.h: Added nextSibling and previousSibling fields to private class. * WebView.subproj/WebFrame.m: Got rid of some tabs in this file. (-[WebFrame _addChild:]): Changed code to use fields inside _private. (-[WebFrame _removeChild:]): Ditto. (-[WebFrame _nextFrameWithWrap:]): Ditto. (-[WebFrame _previousFrameWithWrap:]): Ditto. 2004-12-04 Chris Blumenberg <cblu@apple.com> New fixes for: <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br) <rdar://problem/3903173> REGRESSION (172-TOT): assertion failure and crash in slotAllData logging into hotmail account <rdar://problem/3902749> REGRESSION (Tiger): missing image symbol does not appear Reviewed by darin, rjw, kocienda. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCacheWithURL:response:data:]): (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient didFinishLoading]): * WebView.subproj/WebFrame.m: (-[WebFrame _opened]): (-[WebFrame _internalLoadDelegate]): (-[WebFrame _sendResourceLoadDelegateMessagesForURL:response:length:]): * WebView.subproj/WebFrameInternal.h: 2004-12-04 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed remaining bit of <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _styleFromFontAttributes:]): When translating from an attribute dictionary to a CSS declaration, treat missing values according to the defaults defined in <AppKit/NSAttributedString.h>. Before the code was treating them as "no change", which is incorrect. * English.lproj/StringsNotToBeLocalized.txt: Add a string from the above change. === Safari-173 === 2004-12-03 Ken Kocienda <kocienda@apple.com> Reviewed by me Roll out some recent changes by Chris that caused a performance regression. Fix is in hand, but it is a little risky this close to a submission. So, we have decided to roll back the change with the regression and roll in the new code after we submit. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCacheWithURL:response:size:]): (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient didFinishLoading]): * WebView.subproj/WebFrame.m: (-[WebFrame _opened]): (-[WebFrame _internalLoadDelegate]): * WebView.subproj/WebFrameInternal.h: 2004-12-02 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3841332> REGRESSION (125.9-167u): repro crash in -[KWQPageState invalidate] involving .Mac images Ensure that the document is cleared when leaving a non-HTML page. This ensures that the b/f cache won't incorrectly trash the previous state when restoring. Reviewed by John. * WebView.subproj/WebFrame.m: (-[WebFrame _setState:]): 2004-12-02 Ken Kocienda <kocienda@apple.com> Reviewed by Richard <rdar://problem/3748323> Problem with -[WebView editableDOMRangeForPoint:] (-isFlipped not taken into account?) <rdar://problem/3852590> REGRESSION (Mail): Dropped content appears in wrong place if Mail message is scrolled down When implementing drag and drop, moveDragCaretToPoint: and editableDOMRangeForPoint: are used in concert to track the mouse and determine a drop location, respectively. However, moveDragCaretToPoint: did a conversion of the passed-in point to the document view's coordinate space, whereas editableDOMRangeForPoint: did not. Now it does. Note that I will need to coordinate with Grant to have him roll out some code in Mail that attempts to work around this problem (unsuccessfully), and actually manages to block the real fix (which needs to be in WebKit). * WebView.subproj/WebView.m: (-[WebView editableDOMRangeForPoint:]): Convert the passed-in point to the document view's coordinate space. 2004-12-02 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3895810> FATAL ERROR: <WebTextRenderer: 0x9328a20> unable to initialize with font "Times-Roman 16.00 pt. S .... We have a hack to replace Times with Times New Roman if we fail to setup Times. If we then fail to setup Times New Roman we don't attempt to further fallback to the system font. Added that additional fallback. Reviewed by Ken. * WebCoreSupport.subproj/WebTextRenderer.m: (+[WebTextRenderer webFallbackFontFamily]): (-[WebTextRenderer initWithFont:usingPrinterFont:]): 2004-12-02 Richard Williamson <rjw@apple.com> Fixed build problem on Tiger8A821. Private macro and function we were using have been deprecated, Reviewed by Vicki. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:usingPrinterFont:]): 2004-12-01 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3879870> Flash Player unable to stop data stream from continuing to download by returning -1 from NPP_Write Also improved and cleaned-up the plug-in stream termination code. Reviewed by john. * Plugins.subproj/WebBaseNetscapePluginStream.h: * Plugins.subproj/WebBaseNetscapePluginStream.m: (+[WebBaseNetscapePluginStream reasonForError:]): return NPRES_DONE for a nil error (-[WebBaseNetscapePluginStream _pluginCancelledConnectionError]): new, factored out from other methods (-[WebBaseNetscapePluginStream errorForReason:]): new (-[WebBaseNetscapePluginStream dealloc]): release MIME type (-[WebBaseNetscapePluginStream setMIMEType:]): new (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:]): call setMIMEType so we can use it in _pluginCancelledConnectionError, call renamed methods (-[WebBaseNetscapePluginStream _destroyStream]): prepended underscore, replaced some early returns with asserts as the callers are now smarter (-[WebBaseNetscapePluginStream _destroyStreamWithReason:]): prepended underscore, only call _destroyStream if there is an error or if the load is complete and there is no more data to be streamed (-[WebBaseNetscapePluginStream cancelLoadWithError:]): new, overridden by subclasses to cancel the actual NSURLConnection (-[WebBaseNetscapePluginStream destroyStreamWithError:]): new, calls _destroyStreamWithReason (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): call renamed methods (-[WebBaseNetscapePluginStream _deliverData]): prepended underscore, call cancelLoadAndDestroyStreamWithError if NPP_Write returns a negative number * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView destroyStream:reason:]): call cancelLoadAndDestroyStreamWithError * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedError:withDataSource:]): call destroyStreamWithError (-[WebNetscapePluginRepresentation cancelLoadWithError:]): new, override method, tell the data source to stop loading * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream cancelLoadWithError:]): new, override method, tell the loader to stop (-[WebNetscapePluginStream stop]): call cancelLoadAndDestroyStreamWithError (-[WebNetscapePluginConnectionDelegate isDone]): new (-[WebNetscapePluginConnectionDelegate didReceiveResponse:]): call cancelLoadAndDestroyStreamWithError (-[WebNetscapePluginConnectionDelegate didFailWithError:]): call destroyStreamWithError 2004-12-01 Kevin Decker <kdecker@apple.com> Reviewed by Harrison. Fixed: <rdar://problem/3228878> potential performance problem in finding in large framesets Got rid of O(N^2) conditions in _nextSibling and _previousSibling of where we were looking up self in the parent array of frames. * WebView.subproj/WebFrame.h: Added two new pointers, one for the previous kid and one for the next kid * WebView.subproj/WebFrame.m: (-[WebFrame _addChild:]): Updates the previous frame and the next frame after this child (-[WebFrame _removeChild:]): ditto (-[WebFrame _nextSibling]): just return the pointer now (-[WebFrame _previousSibling]): ditto 2004-11-30 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3685766> WebDataSource is missing subresources when they use cached WebCore data <rdar://problem/3722434> REGRESSION?: Assertion failure trying to drag image in iframe (itapema.sc.gov.br) Reviewed by darin. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCacheWithURL:response:data:]): renamed to pass all data for the resource, moved delegate code to new method (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): call renamed method * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient didFinishLoading]): call renamed method * WebView.subproj/WebFrame.m: (-[WebFrame _opened]): call _sendResourceLoadDelegateMessagesForURL:response:length:, not objectLoadedFromCacheWithURL:response:data: (-[WebFrame _internalLoadDelegate]): (-[WebFrame _sendResourceLoadDelegateMessagesForURL:response:length:]): moved from objectLoadedFromCacheWithURL:response:data: * WebView.subproj/WebFrameInternal.h: 2004-11-29 Darin Adler <darin@apple.com> Reviewed by John. - worked around bug in Panther where NSScroller calls _destinationFloatValueForScroller: on superview without first checking if it's implemented * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _destinationFloatValueForScroller:]): Implemented. Calls floatValue on the scroller. * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2004-11-23 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3890944> disable icon database for Dashboard Reviewed by kevin. * Misc.subproj/WebIconDatabase.h: * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase init]): don't create dictionaries if disabled (-[WebIconDatabase iconForURL:withSize:cache:]): return default icon if disabled (-[WebIconDatabase iconURLForURL:]): return nil if disabled (-[WebIconDatabase retainIconForURL:]): return if disabled (-[WebIconDatabase releaseIconForURL:]): ditto (-[WebIconDatabase delayDatabaseCleanup]): ditto (-[WebIconDatabase allowDatabaseCleanup]): ditto (-[WebIconDatabase _isEnabled]): new (-[WebIconDatabase _setIcon:forIconURL:]): assert if called when disabled, moved to own category implementation (-[WebIconDatabase _setHaveNoIconForIconURL:]): ditto (-[WebIconDatabase _setIconURL:forURL:]): ditto (-[WebIconDatabase _createFileDatabase]): tweak (-[WebIconDatabase _applicationWillTerminate:]): moved out of public code * Misc.subproj/WebIconDatabasePrivate.h: * Misc.subproj/WebIconLoader.m: * WebView.subproj/WebDataSource.m: (-[WebDataSource _updateIconDatabaseWithURL:]): assert if called when icon DB is disabled (-[WebDataSource _loadIcon]): don't load icon if icon DB is disabled 2004-11-22 David Hyatt <hyatt@apple.com> Make sure the WebCore cache grows at 512mb and at 1024mb exactly. Reviewed by mjs * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge getObjectCacheSize]): 2004-11-22 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3891737> WebPreferences do not work if they are set before set on the WebView John found this problem and suggested the fix. Reviewed by John Louch. * WebView.subproj/WebView.m: (-[WebView setPreferences:]): 2004-11-22 Ken Kocienda <kocienda@apple.com> Reviewed by Harrison * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge canPaste]): Call WebView _canPaste. * WebView.subproj/WebView.m: (-[WebView _canPaste]): Try to forward to document view's implementation. Only WebHTMLView answers right now. Returns NO otherwise. * WebView.subproj/WebViewInternal.h: Add _canPaste method to WebView. 2004-11-22 Maciej Stachowiak <mjs@apple.com> Back out the window closing fix, it seems to be causing crashes. * WebView.subproj/WebFrame.m: (-[WebFrame _detachFromParent]): 2004-11-20 Maciej Stachowiak <mjs@apple.com> Reviewed by John. <rdar://problem/3710101> _web_userVisibleString makes URL autocomplete roughly 2x slower * Misc.subproj/WebNSURLExtras.h: * Misc.subproj/WebNSURLExtras.m: (-[NSString _web_isUserVisibleURL]): New SPI to check if a URL string is already in user-visible form (i.e. converting it to an NSURL and then back via _web_userVisibleString would not change anything). 2004-11-19 Maciej Stachowiak <mjs@apple.com> Reviewed by John. <rdar://problem/3190977> closing window with many tabs in it can be quite slow * WebView.subproj/WebFrame.m: (-[WebFrame _detachFromParent]): autorelease bridge instead of releasing it, to make window and tab closing more responsive - this way the deallocation happens after the windoow or tab appears to close. === Safari-172 === 2004-11-19 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3880387> REGRESSION: www.shockplay.com site gives "Unexpected server response" Reviewed by mjs. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[NSData _web_locationAfterFirstBlankLine]): support both formats ("\r\n\n" and "\r\n\r\n") for separating header data from body data because Shockwave still sends the prior format 2004-11-19 Ken Kocienda <kocienda@apple.com> Reviewed by Harrison Fix for this bug: <rdar://problem/3655241> setTypingStyle: does not set the real typing style, and typingStyle does not return it * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge respondToChangedContents]): No longer call through to WebKit to set the typing style. The call was part of the misguided use of the setTypingStyle: and typingStyle as a cache of what was stored on the WebCore side. (-[WebBridge respondToChangedSelection]): Ditto. * WebView.subproj/WebView.m: (-[WebViewPrivate dealloc]): Object no longer has typingStyle ivar. (-[WebView setTypingStyle:]): Call over the bridge to set typing style. (-[WebView typingStyle]): Call over the bridge to retrieve typing style. * WebView.subproj/WebViewInternal.h: Object no longer has typingStyle ivar. 2004-11-18 John Sullivan <sullivan@apple.com> Reviewed by Darin. - fixed <rdar://problem/3886042> should save history file as binary XML so serialization, parsing, reading and writing is faster * History.subproj/WebHistory.m: (-[WebHistoryPrivate _saveHistoryGuts:URL:error:]): convert dictionary to binary data before saving 2004-11-18 Chris Blumenberg <cblu@apple.com> * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation currentForm]): removed stray ";" 2004-11-18 Chris Blumenberg <cblu@apple.com> Fixed development build failure. * Misc.subproj/WebIconDatabase.m: (+[WebIconDatabase sharedIconDatabase]): call LOG not Log 2004-11-18 Chris Blumenberg <cblu@apple.com> <rdar://problem/3885708> save memory in icon DB by not using NSSets when holding 1 object Reviewed by sullivan. * Misc.subproj/WebIconDatabase.m: (+[WebIconDatabase sharedIconDatabase]): added timing code (-[WebIconDatabase _clearDictionaries]): new (-[WebIconDatabase _loadIconDictionaries]): call _clearDictionaries in 2 places before we bail, use _web_setObjectUsingSetIfNecessary:forKey: when adding site URLs to the iconURLToURLs dictionary (-[WebIconDatabase _updateFileDatabase]): fixed comment (-[WebIconDatabase _setIconURL:forURL:]): use _web_setObjectUsingSetIfNecessary:forKey: when adding site URLs to the iconURLToURLs dictionary (-[WebIconDatabase _releaseIconForIconURLString:]): handle NSString objects retured from iconURLToURLs (-[NSMutableDictionary _web_setObjectUsingSetIfNecessary:forKey:]): new, puts a set on the dictionary when there are 2 or more object for s key 2004-11-17 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3885073> REGRESSION: Tab images at top of news.com.com replicated and squished Correctly account for scaled image size and clipping. Reviewed by Maciej. * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer drawImageInRect:fromRect:compositeOperator:context:]): 2004-11-17 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. <rdar://problem/3885076> Don't make IDN calls for all-ascii URLs to save about 3 pages at Safari startup. * Misc.subproj/WebNSURLExtras.m: (mapHostNames): If encoding and not decoding, then bail early if the URL is all ascii. (-[NSString _web_mapHostNameWithRange:encode:makeString:]): Remove earlier special-case check for localhost, no longer needed. 2004-11-17 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3863601> Legacy font cache code in [WebTextRendererFactory createSharedFactory] may be unnecesary and added call to SPI for <rdar://problem/3884448> WebKit should turn on CG local font cache currently disabled until a Tiger build shows up with the SPI. Reviewed by David Harrison. * WebCoreSupport.subproj/WebTextRendererFactory.m: (+[WebTextRendererFactory createSharedFactory]): 2004-11-17 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3882212> REGRESSION: Images clipped instead of scaled Fixed <rdar://problem/3884088> Crash terminating image load Also added code to turn off color correction for images created via CGImageSources. This code is currently disabled because CG can't change the color space of images loaded progressively. Further, according to Dave Hayward, CG will no longer attempt to color correct images that don't have embedded profiles as of Tiger 8A306. Reviewed by Chris. * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _commonTermination]): (-[WebImageData dealloc]): (-[WebImageData _invalidateImageProperties]): (-[WebImageData imageAtIndex:]): (-[WebImageData incrementalLoadWithBytes:length:complete:]): (-[WebImageData propertiesAtIndex:]): 2004-11-16 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3882034> REGRESSION: Context menu incorrect for PDF content Reviewed by darin. * WebView.subproj/WebPDFView.m: (-[WebPDFView hitTest:]): return self if the current event is a context menu event (-[WebPDFView menuForEvent:]): use the PDFView subview 2004-11-15 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3880410> save 5 dirty pages by soft-linking against PDFKit framework Reviewed by john. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebPDFRepresentation.m: (+[WebPDFRepresentation PDFDocumentClass]): new (-[WebPDFRepresentation finishedLoadingWithDataSource:]): use PDFDocumentClass * WebView.subproj/WebPDFView.h: * WebView.subproj/WebPDFView.m: (+[WebPDFView PDFKitBundle]): new (+[WebPDFView PDFViewClass]): new (-[WebPDFView initWithFrame:]): create a PDFView subview (-[WebPDFView dealloc]): release the PDFView subview (-[WebPDFView PDFSubview]): new 2004-11-15 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3879891> WebKit should link against PDFKit instead of Quartz Reviewed by darin. * WebKit.pbproj/project.pbxproj: link against PDFKit if it is present instead of Quartz.framework 2004-11-15 Richard Williamson <rjw@apple.com> Fixed missing retain of image property data. Reviewed by John. * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData dealloc]): (-[WebImageData _invalidateImages]): (-[WebImageData imageAtIndex:]): (-[WebImageData propertiesAtIndex:]): (-[WebImageData _frameDuration]): 2004-11-15 Richard Williamson <rjw@apple.com> Cache image properties and frame durations. Create NSImage and TIFF representations from CGImage, lazily, as needed for dragging and element info dictionary. Reviewed by John. * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData dealloc]): (-[WebImageData size]): (-[WebImageData propertiesAtIndex:]): (-[WebImageData _frameDurationAt:]): (-[WebImageData _frameDuration]): * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer dealloc]): (-[WebImageRenderer TIFFRepresentation]): (-[WebImageRenderer image]): 2004-11-14 Maciej Stachowiak <mjs@apple.com> Reviewed by John. <rdar://problem/3879226> WebKit needlessly uses extra memory to store icon refcounts as NSNumbers * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase init]): (-[WebIconDatabase _setIconURL:forURL:]): (-[WebIconDatabase _retainIconForIconURLString:]): (-[WebIconDatabase _releaseIconForIconURLString:]): (-[WebIconDatabase _retainFutureIconForURL:]): (-[WebIconDatabase _releaseFutureIconForURL:]): * Misc.subproj/WebIconDatabasePrivate.h: 2004-11-15 John Sullivan <sullivan@apple.com> Reviewed by Ken. - fixed <rdar://problem/3879513> leak in [WebArchive _propertyListRepresentation] copying HTML to pasteboard * WebView.subproj/WebArchive.m: (-[WebArchive _propertyListRepresentation]): the array holding the subresources was not released after use, oops! 2004-11-12 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3874577> Opening restricted (parental) content in new window/tab reveals Safari's "Resources" folder Reviewed by john. * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate openFrameInNewWindow:]): use the unreachable URL if there is one === Safari-171 === 2004-11-11 Richard Williamson <rjw@apple.com> Report actual size (not partial size) but use partial size when drawing. Reviewed by Maciej. * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData size]): 2004-11-11 Darin Adler <darin@apple.com> Reviewed by John. - added _wasFirstResponderAtMouseDownTime method to bridge so we can fix <rdar://problem/3846152> REGRESSION (125-166): can't drag text out of <input type=text> fields with a subsequent change to WebCore. * WebCoreSupport.subproj/WebBridge.m: (wasFirstResponderAtMouseDownTime:): Added. Calls _wasFirstResponderAtMouseDownTime on the WebHTMLView. (_getPreSmartSet): Move global inside the function, add (void) for cleanliness. (_getPostSmartSet): Ditto. * WebView.subproj/WebHTMLView.m: (-[WebHTMLViewPrivate dealloc]): Release firstResponderAtMouseDownTime. (-[WebHTMLView _setMouseDownEvent:]): Early exit if event is not changing. Set firstResponderAtMouseDownTime to the first responder. (-[WebHTMLView mouseDown:]): Release firstResponderAtMouseDownTime after handling the mouseDown event. (-[WebHTMLView _wasFirstResponderAtMouseDownTime:]): Added. Uses the firstResponderAtMouseDownTime field. * WebView.subproj/WebHTMLViewInternal.h: Added firstResponderAtMouseDownTime field and _wasFirstResponderAtMouseDownTime method. * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2004-11-11 Richard Williamson <rjw@apple.com> Reviewed by Chris. Work-around to minimize impact of 3876764. Cache frame durations after first call. So we'll still leak 1K for each animated image, but that's better than 1K each time the frame is drawn! * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData _frameDuration]): Simplified animation cleanup code. Fixed leak due to incorrect key passed to CFDictionaryRemoveValue. (+[WebImageData stopAnimationsInView:]): (-[WebImageData addAnimatingRenderer:inView:]): (-[WebImageData removeAnimatingRenderer:]): (-[WebImageData _stopAnimation]): 2004-11-11 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed <rdar://problem/3605906> Flash scrolled off the top and bottom cause CPU spin when combined with something dirty on the visible part of the page * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): Work around AppKit bug by using rectangles from getRectsBeingDrawn:count: instead of using the passed-in rectangle. 2004-11-11 Richard Williamson <rjw@apple.com> Work-arounds to make new ImageIO code work correctly. Still disabled for now. Requires at least Tiger 300. Testing does show a 3% improvement in PLT tests! That's huge! Reviewed by John. * WebCoreSupport.subproj/WebImageData.m: (-[WebImageData imageAtIndex:]): (-[WebImageData incrementalLoadWithBytes:length:complete:]): (-[WebImageData isNull]): 2004-11-10 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3396872> ICONS: icon DB inconsistencies can cause slowness during startup, idle and quit Reviewed by john. * Misc.subproj/WebFileDatabase.m: (-[WebFileDatabase objectForKey:]): added logging code * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase init]): use alloc, init rather than autorelease, retain (-[WebIconDatabase _loadIconDictionaries]): use 1 object for mapping icon URLs to site URLs and vice versa rather than 3. This avoids inconsistencies and is faster. (-[WebIconDatabase _updateFileDatabase]): write 1 object out 2004-11-09 David Hyatt <hyatt@apple.com> Fix for 3873234, Safari UI is unresponsive when parsing multiple HTML docs and 3873233, Safari hangs when loading large local files. Reviewed by mjs * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge tokenizerProcessedData]): * WebView.subproj/WebDataSource.m: (-[WebDataSource _receivedMainResourceError:complete:]): (-[WebDataSource isLoading]): 2004-11-09 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3870964> 8A300: Safari not recognizing a PDF link (it displays raw data) Add "text/pdf" as an acceptable PDF MIME type. Reviewed by Chris. * WebView.subproj/WebDataSource.m: (+[WebDataSource _repTypesAllowImageTypeOmission:]): * WebView.subproj/WebFrameView.m: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): 2004-11-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3783904> Return key behavior is confusingly different between popup menus and autofill menus Reviewed by john. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge control:textView:shouldHandleEvent:]): new * WebView.subproj/WebFormDelegate.h: * WebView.subproj/WebFormDelegate.m: (-[WebFormDelegate control:textView:shouldHandleEvent:inFrame:]): new 2004-11-05 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3854218> Safari is sometimes really slow because of increased null events to plug-ins * Plugins.subproj/WebBaseNetscapePluginView.m: reverted null event interval to 0.02 2004-11-05 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3838413> REGRESSION (Mail): "Smart" word paste adds spaces before/after special characters Reviewed by rjw. * WebCoreSupport.subproj/WebBridge.m: (_getPreSmartSet): copied from AppKit (_getPostSmartSet): ditto (-[WebBridge isCharacterSmartReplaceExempt:isPreviousCharacter:]): new 2004-11-05 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3810702> _checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector: ASSERTS when reentered from Xcode's man page viewer Reviewed by Maciej (a long time ago). * WebView.subproj/WebFrame.m: (-[WebFrame _loadDataSource:withLoadType:formState:]): Fixed <rdar://problem/3845307> WebKit needs to export _HIWebViewRegisterClass so HIWebViews can work in Carbon nib files As suggested in the bug, the fix is to actually call HIWebViewRegisterClass in WebKitInitForCarbon, rather than exporting the symbol. Reviewed by Chris. * Carbon.subproj/CarbonUtils.m: (WebInitForCarbon): * Carbon.subproj/HIWebView.m: * WebKit.pbproj/project.pbxproj: === Safari-170 === 2004-11-05 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed <rdar://problem/3857151> Assertion failure in "trackingRectOwner" while moving mouse over Slashdot.org page * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _addTrackingRect:owner:userData:assumeInside:useTrackingNum:]): Changed to no longer call addTrackingRect to do the work for consistency with the new method below. Not too much copied and pasted code. (-[WebHTMLView _addTrackingRects:owner:userDataList:assumeInsideList:trackingNums:count:]): Added an override for this new method in Tiger. No harm in implementing it on Panther, although it won't be called. (-[WebHTMLView _removeTrackingRects:count:]): Ditto. 2004-11-04 David Hyatt <hyatt@apple.com> Make sure the dominant line direction is properly set for RTL runs so that spaces will reverse. Change xHeight to measure the ascent of the x glyph, since the xHeight metrics appear to be totally bogus in both CG and AppKit. Reviewed by darin * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer xHeight]): (-[WebTextRenderer _createATSUTextLayoutForRun:style:]): (-[WebTextRenderer _trapezoidForRun:style:atPoint:]): (-[WebTextRenderer _ATSU_drawHighlightForRun:style:geometry:]): (-[WebTextRenderer _ATSU_drawRun:style:geometry:]): (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:includePartialGlyphs:]): 2004-11-02 Maciej Stachowiak <mjs@apple.com> Reviewed by Dave Hyatt (when I originally coded it). Redid WebKit part of fix for: <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView firstRectForCharacterRange:]): Call the appropriate new bridge method, and translate to screen coordinates. 2004-11-02 John Sullivan <sullivan@apple.com> Reviewed by Hyatt. - [NSFont menuFontOfSize:], called from WebStringTruncator, was taking > 9% of the time creating a very large bookmarks menu, so I cached this one NSFont object. * Misc.subproj/WebStringTruncator.m: (defaultMenuFont): new function, caches the font used when no font is specified (+[WebStringTruncator centerTruncateString:toWidth:]): call new function 2004-11-02 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt WebCore now implements a command to insert a block in response to typing a return key, and some names were improved in the course of this work. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView insertNewline:]): Now calls insertLineBreak on bridge object. (-[WebHTMLView insertLineBreak:]): New method. (-[WebHTMLView insertParagraphSeparator:]): Now implemented. * WebView.subproj/WebView.m: === Safari-169 === 2004-10-29 Chris Blumenberg <cblu@apple.com> * WebKit.exp: added _WebPlugInModeKey, forgot to add it earlier 2004-10-29 Darin Adler <darin@apple.com> - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments * Plugins.subproj/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug report to match the contents of the file. 2004-10-27 Ken Kocienda <kocienda@apple.com> Reviewed by Chris Added new SPI for Mail so it can get the behavior it needs when the user hits the return key with the selection in quoted content. * WebView.subproj/WebView.m * WebView.subproj/WebViewPrivate.h 2004-10-26 Chris Blumenberg <cblu@apple.com> Fixed exception that Darin encountered in Mail. Reviewed by darin. * Plugins.subproj/WebPluginController.m: (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]): if the plug-in returns a nil view, return nil 2004-10-25 Chris Blumenberg <cblu@apple.com> Darin made an internal notification have the Web prefix. Reviewed by me. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView addWindowObservers]): (-[WebBaseNetscapePluginView removeWindowObservers]): (ConsoleConnectionChangeNotifyProc): 2004-10-25 John Sullivan <sullivan@apple.com> Reviewed by Chris. - Cleanup from fix for <rdar://problem/3851676> bookmarks should not hold onto a WebHistoryItem object; eliminated notificationsSuppressed mechanism, which was used only by WebBookmark * History.subproj/WebHistoryItem.m: removed notificationsSuppressed ivar from private data object (-[WebHistoryItem setAlternateTitle:]): remove notificationsSuppressed guard (-[WebHistoryItem setURLString:]): ditto (-[WebHistoryItem setOriginalURLString:]): ditto (-[WebHistoryItem setTitle:]): ditto (-[WebHistoryItem _setLastVisitedTimeInterval:]): ditto (-[WebHistoryItem setNotificationsSuppressed:]): removed this method (-[WebHistoryItem notificationsSuppressed]): ditto * History.subproj/WebHistoryItemPrivate.h: removed notificationsSuppressed and setNotificationsSuppressed 2004-10-22 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3851491> installedPlugins being called for a page without plugins Reviewed by mjs. * WebView.subproj/WebFrameView.m: (+[WebFrameView _canShowMIMETypeAsHTML:]): call _viewTypesAllowImageTypeOmission instead of using ivar since the ivar is nil until _viewTypesAllowImageTypeOmission is called, this was causing [WebView canShowMIMEType:] to check plug-ins === Safari-168 === 2004-10-22 Ken Kocienda <kocienda@apple.com> Reviewed by me * WebKit.pbproj/project.pbxproj: Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags. 2004-10-21 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3847994> REGRESSION: reproducible exception in WebImageRenderer releasePatternColor; afterwards get crash or no more browsing * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebInternalImage createRendererIfNeeded]): Replaced retainOrCopyIfNeeded with this. This returns nil if a copied renderer isn't needed, and returns a new renderer if a copy is. The old version was sometimes returning a WebInternalImage and other times a WebImageRenderer. (-[WebImageRenderer retainOrCopyIfNeeded]): Returns the result of createRendererIfNeeded or retains self and returns self. 2004-10-20 Darin Adler <darin@apple.com> Reviewed by Dave. - fixed <rdar://problem/3470715> Pattern cache can get huge with use of css background-image in Safari * WebCoreSupport.subproj/WebImageRenderer.h: Change WebImageRenderer to be a subclass of NSObject rather than NSImage and contain a pointer to a WebInternalImage. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebInternalImage releasePatternColor]): Added. Releases patternColor. (-[WebImageRenderer initWithMIMEType:]): Added. Makes WebInternalImage and then self. (-[WebImageRenderer initWithData:MIMEType:]): Ditto. (-[WebImageRenderer initWithContentsOfFile:]): Ditto. (-[WebImageRenderer dealloc]): Added. Calls releasePatternColor and then releases WebInternalImage. (-[WebImageRenderer image]): Added. Returns pointer to image. (-[WebImageRenderer MIMEType]): Added. Calls through to image. (-[WebImageRenderer TIFFRepresentation]): Ditto. (-[WebImageRenderer frameCount]): Ditto. (-[WebImageRenderer setOriginalData:]): Added. Sets image data pointer. (+[WebImageRenderer stopAnimationsInView:]): Added. Calls through to image. (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): Ditto. (-[WebImageRenderer size]): Ditto. (-[WebImageRenderer resize:]): Ditto. (-[WebImageRenderer drawImageInRect:fromRect:]): Ditto. (-[WebImageRenderer drawImageInRect:fromRect:compositeOperator:context:]): Ditto. (-[WebImageRenderer stopAnimation]): Ditto. (-[WebImageRenderer tileInRect:fromPoint:context:]): Ditto. (-[WebImageRenderer isNull]): Ditto. (-[WebImageRenderer retainOrCopyIfNeeded]): Ditto. (-[WebImageRenderer increaseUseCount]): Ditto. (-[WebImageRenderer decreaseUseCount]): Ditto. (-[WebImageRenderer flushRasterCache]): Ditto. (-[WebImageRenderer imageRef]): Ditto. (-[WebImageRenderer copyWithZone:]): Ditto. * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragImage:rect:event:pasteboard:source:offset:]): Update for slight changes to WebImageRenderer API. * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory imageRendererWithMIMEType:]): Ditto. (-[WebImageRendererFactory imageRendererWithData:MIMEType:]): Ditto. (-[WebImageRendererFactory imageRendererWithSize:]): Ditto. (-[WebImageRendererFactory imageRendererWithName:]): Ditto. * WebView.subproj/WebImageView.m: (-[WebImageView image]): Ditto. 2004-10-20 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3846943> REGRESSION: JNLP files are rendered instead of downloaded Reviewed by john. * Plugins.subproj/WebBasePluginPackage.h: * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage isJavaPlugIn]): new * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase refresh]): don't register the Java plug-in for a document view since Java file should be downloaded when not embedded. 2004-10-20 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3842030> WebKit needs to pass the mode (NP_FULL, NP_EMBED, etc) when calling plugInViewWithArguments <rdar://problem/3792852> Safari is loading the new QuickTime Cocoa plugin on Panther Reviewed by darin. * Plugins.subproj/WebPluginDocumentView.m: (-[WebPluginDocumentView setDataSource:]): pass "full" as the mode * Plugins.subproj/WebPluginPackage.m: (-[WebPluginPackage initWithPath:]): load plug-in with the "webplugin" extension * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:]): pass "embed" as the mode * WebKit.pbproj/project.pbxproj: 2004-10-19 Vicki Murley <vicki@apple.com> - bump WebKit version to 167.1, so that we can do a quick dot submission for <rdar://problem/3843951> * WebKit.pbproj/project.pbxproj: 2004-10-19 Darin Adler <darin@apple.com> Change suggested by Maciej during code review. * WebCoreSupport.subproj/WebTextRenderer.m: Changed rounding hack table to be const so it can be in shared instead of private memory, and doesn't require an initialization function. (+[WebTextRenderer initialize]): Removed initialization. 2004-10-19 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed <rdar://problem/3838934> Safari stops loading pages after rangeOfCharacterFromSet nil argument exception - fixed <rdar://problem/3843951> REGRESSION (166-167): Safari crashes in widthForNextCharacter (belkin.com, at startup for others) - fixed <rdar://problem/3841049> REGRESSION (109-110): control characters render as square boxes * WebCoreSupport.subproj/WebTextRenderer.m: (isSpace): Merged in isAlternateSpace, never used. (setupRoundingHackCharacterTable): Fixed size of table, was 1 entry too short. Got rid of unneeded call to bzero, since globals start out zeroed automatically. (isRoundingHackCharacter): Fixed backwards logic causing the crash in widthForNextCharacter. Also removed explicit compare with 1; check for non-zero is just fine. (fontContainsString): Change code so we'll just skip the font if the covered character set returns nil rather than throwing an exception like the old version did. This should make bug 3838934 go away, although perhaps covering up the underlying problem. (-[WebTextRenderer _convertCharacters:length:toGlyphs:]): Removed unused skipControlCharacters: parameter and also the unnecessary code to copy the buffer to change newline characters and non-break spaces to spaces. (-[WebTextRenderer _convertUnicodeCharacters:length:toGlyphs:]): Removed unused local. (-[WebTextRenderer _extendCharacterToGlyphMapToInclude:]): Added code to set up special cases for control characters, \n and non-break spaces. (-[WebTextRenderer _createATSUTextLayoutForRun:]): Added comment about the cases this code does not handle that are handled by the CG case. (widthForNextCharacter): Call isSpace instead of checking specifically for the space character here. The old code would not handle cases with '\n' coming across from WebCore properly. 2004-10-18 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3840916> GC: -[WebNetscapePluginPackage initWithPath:] leaks an NSURL Reviewed by kevin. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage initWithPath:]): use executablePath on NSBundle instead of CFBundleCopyExecutableURL 2004-10-18 Chris Blumenberg <cblu@apple.com> * DOM.subproj/DOMPrivate.h: change to copied header that was never committed 2004-10-18 John Sullivan <sullivan@apple.com> Reviewed by Ken. - fixed <rdar://problem/3810183> Make WebHTMLView respect return value of webView:doCommandBySelector: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView doCommandBySelector:]): only do default action if delegate returns NO; this works with Mail as of Tiger 8A275. === Safari-167 === 2004-10-14 Ken Kocienda <kocienda@apple.com> Reviewed by John Final fix for these bugs: <rdar://problem/3806306> HTML editing puts spaces at start of line <rdar://problem/3814252> HTML editing groups space with word causing wrapping This change sets some new CSS properties that have been added to WebCore to enable whitespace-handling and line-breaking features that make WebView work more like a text editor. * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): Turn on special editing CSS properties when loading an HTML document into a WebView that is editable. * WebView.subproj/WebView.m: (-[WebView setEditable:]): Add and remove special editing CSS properties in current document being displayed. 2004-10-14 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3823026> making isRoundingHackCharacter use -O3 and an 8-bit lookup-table will speed "XBS" test up by 3% (actually < 1%) Careful testing shows a small performance gain on very large text files. I saw large variations in timings, but taking the lowest PLT timing with and without this change showed a 0.9% gain. Note the cvs-base showed no improvement. The improvement was for the large page attached to the bug. Reviewed by Ken. * WebCoreSupport.subproj/WebTextRenderer.m: (setupRoundingHackCharacterTable): (isRoundingHackCharacter): (+[WebTextRenderer initialize]): 2004-10-14 Ken Kocienda <kocienda@apple.com> Reviewed by me Fix build breakage. These three functions need to return the values from their calls to WebCGColorSpaceCreateXXX. * WebCoreSupport.subproj/WebGraphicsBridge.m: (-[WebGraphicsBridge createRGBColorSpace]) (-[WebGraphicsBridge createGrayColorSpace]) (-[WebGraphicsBridge createCMYKColorSpace]) 2004-10-13 Richard Williamson <rjw@apple.com> Addressed concerns in <rdar://problem/3803117> RESP: High complexity in icu uidna_IDNToASCII called by [NSString(WebNSURLExtras) _web_mapHostNameWithRange:encode:makeString:] In practice I saw NO improvement in performance. Although, special-case tests could possibly show improvement. Anyway, the changes don't hurt performance. Reviewed by Maciej. * Misc.subproj/WebNSURLExtras.m: (-[NSString _web_mapHostNameWithRange:encode:makeString:]): 2004-10-13 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. <rdar://problem/3824626> Change to do colormatching for DeviceRGB colorspace causes ~11% Safari slowdown - I fixed this by turning off all colormatching for WebKit content. We might turn it back on later. For now, it's possible to turn it on temporarily by defining COLORMATCH_EVERYTHING. * WebCoreSupport.subproj/WebGraphicsBridge.m: (-[WebGraphicsBridge setFocusRingStyle:radius:color:]): (-[WebGraphicsBridge additionalPatternPhase]): (-[WebGraphicsBridge createRGBColorSpace]): (-[WebGraphicsBridge createGrayColorSpace]): (-[WebGraphicsBridge createCMYKColorSpace]): * WebCoreSupport.subproj/WebImageData.m: * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer _adjustSizeToPixelDimensions]): (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): (-[WebImageRenderer _adjustColorSpace]): (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): (-[WebImageRenderer tileInRect:fromPoint:context:]): (_createImageRef): (WebCGColorSpaceCreateRGB): (WebCGColorSpaceCreateGray): (WebCGColorSpaceCreateCMYK): * WebKitPrefix.h: 2004-10-13 Richard Williamson <rjw@apple.com> Don't fill background with transparency unless debug flag is enabled. Reviewed by Hyatt. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): 2004-10-12 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3829705> Need to remove filling w/ transparency when not drawing backgroundy. Reviewed by Ken. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _transparentBackground]): (-[WebHTMLView _setTransparentBackground:]): (-[WebHTMLView drawRect:]): * WebView.subproj/WebHTMLViewInternal.h: * WebView.subproj/WebHTMLViewPrivate.h: 2004-10-11 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3802039> 8A259: Can't use Grab services to grab selection from screen Reviewed by john. * WebView.subproj/WebHTMLView.m: (+[WebHTMLView initialize]): register service "return types" which are types that can be inserted into a WebView (-[WebHTMLView writeSelectionToPasteboard:types:]): service protocol method, be sure to only write specified types (-[WebHTMLView readSelectionFromPasteboard:]): new, service protocol method, insert types (-[WebHTMLView validRequestorForSendType:returnType:]): moved, handle return types 2004-10-11 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3834130> nil-object-in-dictionary exception seen in -[WebView _elementAtWindowPoint:] * WebView.subproj/WebView.m: (-[WebView _elementAtWindowPoint:]): Added a check for nil frame. 2004-10-11 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3834166> <input type=file> sends onchange even when the same file is chosen twice * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileButton chooseFilename:]): Do nothing if filename is the same as before. 2004-10-11 Ken Kocienda <kocienda@apple.com> Reviewed by Darin * WebView.subproj/WebHTMLView.m: (-[WebTextCompleteController doCompletion]): bridge call to get caret rect at a node now takes an affinity: caretRectAtNode:offset:affinity:. 2004-10-10 Ken Kocienda <kocienda@apple.com> Reviewed by Chris Fix for this bug: <rdar://problem/3814236> REGRESSION (Mail): Can't set the color of text in Mail compose window using drag/drag from color panel * WebView.subproj/WebHTMLView.m: (+[WebHTMLView _insertablePasteboardTypes]): Add NSColorPboardType to list. (-[WebHTMLView _isNSColorDrag:]): New helper. Determines if drag is an NSColor drag. (-[WebHTMLView draggingUpdatedWithDraggingInfo:actionMask:]): Add a case for NSColor drags, else do what we did before. (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): Add a case for NSColor drags, which creates a CSS style containing color info and calls the bridge to apply the style. Otherwise, do what we did before. 2004-10-11 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed <rdar://problem/3833848> REGRESSION (133-134): each keydown event is getting sent multiple times * WebView.subproj/WebHTMLView.m: (-[WebHTMLView performKeyEquivalent:]): Don't send an event through WebCore if it has already been through once. 2004-10-10 John Sullivan <sullivan@apple.com> Reviewed by Ken. - fixed <rdar://problem/3777253> Crash in redirect mechanism trying to display error page for bad scheme * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient connection:willSendRequest:redirectResponse:]): add retain/autorelease to the request returned from call to super. In this case, the return value was being dealloc'ed before being returned. 2004-10-09 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3625352> up and down arrow and page up/down keys don't work to scroll overflow:auto/scroll/overlay areas <rdar://problem/3397658> scroll wheel does not work to scroll overflow:auto/scroll/overlay areas (RSS) Reviewed by hyatt. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream initWithRequestURL:pluginPointer:notifyData:sendNotification:]): fixed typo in comment * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]): ditto * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFrameView.m: (-[WebFrameView _bridge]): new (-[WebFrameView scrollToBeginningOfDocument:]): call the bridge to scroll, if that fails, scroll the document view (-[WebFrameView scrollToEndOfDocument:]): ditto (-[WebFrameView _pageVertically:]): ditto (-[WebFrameView _pageHorizontally:]): ditto (-[WebFrameView _scrollLineVertically:]): ditto (-[WebFrameView _scrollLineHorizontally:]): ditto * WebView.subproj/WebHTMLView.m: (-[WebHTMLView scrollWheel:]): call the bridge to scroll, if that fails, pass to next responder === Safari-166 === 2004-10-05 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3827002> assertion failure in WebBaseNetscapePluginStream on abc.go.com Reviewed by rjw. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream initWithRequestURL:pluginPointer:notifyData:sendNotification:]): avoid assertion failure in dealloc by temporarily setting isTerminated to YES in case we are released in this method * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]): ditto 2004-10-05 John Sullivan <sullivan@apple.com> * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:]): initialize "arguments" var to nil to satisfy compiler on deployment build. 2004-10-05 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3825442> first click lost for Dashboard Allow dashboard to force acceptsFirstMouse: Reviewed by Chris. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView acceptsFirstMouse:]): * WebView.subproj/WebView.m: (-[WebView _dashboardBehavior:]): * WebView.subproj/WebViewInternal.h: * WebView.subproj/WebViewPrivate.h: * WebCoreSupport.subproj/WebImageRenderer.h: Comment change only 2004-10-05 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3760920> Need to record plugin view instances Reviewed by rjw. * Plugins.subproj/WebPluginController.h: * Plugins.subproj/WebPluginController.m: (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]): new, creates plug-in view and adds it to global list (+[WebPluginController isPlugInView:]): new, checks if the plug-in view is in the global list (-[WebPluginController destroyAllPlugins]): remove the plug-in from the global list * Plugins.subproj/WebPluginDocumentView.m: (-[WebPluginDocumentView setDataSource:]): call [WebPluginController plugInViewWithArguments:fromPluginPackage:] * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:]): ditto * WebView.subproj/WebFrame.m: (-[WebFrame _reloadForPluginChanges]): call [WebPluginController isPlugInView:] * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addSubview:]): ditto 2004-10-05 David Hyatt <hyatt@apple.com> Fix to make selection more like NSTextView. All gap painting is now done by WebCore, so WebKit no longer needs to try to fill gaps around text. Reviewed by kocienda * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _CG_drawHighlightForRun:style:geometry:]): (-[WebTextRenderer _ATSU_drawHighlightForRun:style:geometry:]): 2004-10-05 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3577255> custom file icon shows up upside down in <input type=file> * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileButton setFilename:]): Added a call to setFlipped that fixes the problem, even though I don't know why. 2004-10-04 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _selectionStartFontAttributesAsRTF]): Changed to call new bridge method named fontAttributesForSelectionStart, deleted the method this used to use, and renamed this to have the word "start" in it. (-[WebHTMLView copyFont:]): Updated for name change. * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2004-10-04 Chris Blumenberg <cblu@apple.com> * WebView.subproj/WebFrameInternal.h: removed constant declarations that I committed by mistake 2004-10-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3798948> NPP_URLNotify is not called if plug-in calls NPN_*URLNotfy Fixed a number of FIXME's related to notifying plug-ins of loaded pages. Reviewed by rjw. * Plugins.subproj/WebBaseNetscapePluginStream.h: - replaced URL ivar with requestURL and responseURL ivars since we need to pass both to plug-ins - added sendNotification boolean. Relying on notifyData not being NULL was not information to know whether to call NPP_URLNotify or not. - added isTerminated boolean because determining whether or not stream.ndata is NULL is not enough to know if the stream has been cancelled. * Plugins.subproj/WebBaseNetscapePluginStream.m: (+[WebBaseNetscapePluginStream reasonForError:]): new, factored out from receivedError: (-[WebBaseNetscapePluginStream initWithRequestURL:pluginPointer:notifyData:sendNotification:]): new (-[WebBaseNetscapePluginStream dealloc]): release new ivars (-[WebBaseNetscapePluginStream finalize]): added assert (-[WebBaseNetscapePluginStream setRequestURL:]): new (-[WebBaseNetscapePluginStream setResponseURL:]): new (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:]): renamed, use responseURL as it basically did before (-[WebBaseNetscapePluginStream startStreamWithResponse:]): call renamed method (-[WebBaseNetscapePluginStream destroyStream]): - do nothing if terminated - call NPP_StreamAsFile and NPP_DestroyStream if stream.ndata is not NULL - call NPP_URLNotify if sendNotification is YES regardless of value of notifyData (-[WebBaseNetscapePluginStream receivedError:]): call reasonForError (-[WebBaseNetscapePluginStream deliverData]): use renamed ivar * Plugins.subproj/WebBaseNetscapePluginView.h: - added observingFrameLoadNotification boolean - renamed dictionary ivar to pendingFrameLoads which has WebFrame keys and WebPluginRequest values * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView addFrameLoadObserver]): new (-[WebBaseNetscapePluginView removeFrameLoadObserver]): new (-[WebBaseNetscapePluginView stop]): call removeFrameLoadObserver (-[WebBaseNetscapePluginView initWithFrame:]): use renamed pendingFrameLoads ivar (-[WebBaseNetscapePluginView dealloc]): ditto (-[WebBaseNetscapePluginView requestWithURLCString:]): set referrer on the request just as IE does (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): - call NPP_URLNotify depending of value of sendNotification - call new init method on WebBaseNetscapePluginStream rather then setting variables individually (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]): new, calls NPP_URLNotify at the right time with the right value (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithError:]): new, delegate method called from WebFrame (-[WebBaseNetscapePluginView loadPluginRequest:]): call addFrameLoadObserver (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): take new sendNotification parameter and pass it (-[WebBaseNetscapePluginView getURLNotify:target:notifyData:]): pass YES for sendNotification (-[WebBaseNetscapePluginView getURL:target:]): pass NO for sendNotification (-[WebBaseNetscapePluginView _postURL:target:len:buf:file:notifyData:sendNotification:allowHeaders:]): take new sendNotification parameter and pass it (-[WebBaseNetscapePluginView postURLNotify:target:len:buf:file:notifyData:]): pass YES for sendNotification (-[WebBaseNetscapePluginView postURL:target:len:buf:file:]): pass NO for sendNotification (-[WebPluginRequest initWithRequest:frameName:notifyData:sendNotification:]): take new sendNotification parameter (-[WebPluginRequest sendNotification]): new * Plugins.subproj/WebBaseNetscapePluginViewPrivate.h: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView didStart]): set referrer on the request just as IE does * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedData:withDataSource:]): set the request URL on the stream * Plugins.subproj/WebNetscapePluginStream.h: * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]): take new sendNotification parameter and pass it (-[WebNetscapePluginStream dealloc]): use renamed ivar (-[WebNetscapePluginStream start]): ditto * WebView.subproj/WebFrame.m: (-[WebFrame _setState:]): removed notification posting code. This was only used by WebBaseNetscapePluginView and it was the wrong notification to send. (-[WebFrame _checkLoadCompleteForThisFrame]): call internal load delegate to tell it that the load has finished (-[WebFrame _loadItem:withLoadType:]): ditto (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:formState:]): ditto (-[WebFrame _setInternalLoadDelegate:]): new (-[WebFrame _internalLoadDelegate]): new * WebView.subproj/WebFrameInternal.h: * WebView.subproj/WebFramePrivate.h: 2004-10-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3758113> REGRESSION: Macromedia ColdFusion page doesn't show main content After bumping up our plug-in version, Flash now sends 2 CRLF's between the headers and body of their POST request. Our code was not prepared for this. Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[NSData _web_locationAfterFirstBlankLine]): looks for 2 CRLF's, not for 2 LF's 2004-10-04 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed a potential storage leak when we turn on CGImageRef image rendering * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer dealloc]): Fix potential storage leak by adding [super dealloc], but leak was not real yet because the code is commented out. - make paste style work with color as part of fix to <rdar://problem/3814237> REGRESSION (Mail): Copy/paste style does not set color in Mail compose window * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _selectionFontAttributes]): Change structure so it's easy to add more attributes. For now I haven't added any yet. (-[WebHTMLView _colorAsString:]): Moved this earlier in the file. (-[WebHTMLView _shadowAsString:]): Ditto. (-[WebHTMLView _styleFromFontAttributes:]): Add background color, foreground color, and text shadow. 2004-09-30 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass Also changed dashboard regions dictionary to use "control" for scroller region label, instead of "scroller, per request from ouch. Reviewed by Chris. * Plugins.subproj/npruntime.h: * WebView.subproj/WebView.m: (-[WebView _addScrollerDashboardRegions:from:]): 2004-09-30 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3498680> switching back and forth between tabs stops calling anything in a plug-in Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendEvent:]): call setWindowIfNecessary because the window may have changed (-[WebBaseNetscapePluginView updateAndSetWindow]): new (-[WebBaseNetscapePluginView setWindowIfNecessary]): was setWindow, this method now just sets the window (-[WebBaseNetscapePluginView start]): call updateAndSetWindow (-[WebBaseNetscapePluginView viewDidMoveToWindow]): ditto (-[WebBaseNetscapePluginView viewHasMoved:]): ditto 2004-09-30 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3498668> switching out of tab doesn't send loseFocusEvent to plug-in Reviewed by rjw. * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView setHasFocus:]): new, sends events to plug-in (-[WebBaseNetscapePluginView becomeFirstResponder]): call setHasFocus (-[WebBaseNetscapePluginView resignFirstResponder]): ditto (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): ditto 2004-09-30 Chris Blumenberg <cblu@apple.com> Fixed: Assertion failure when loading standalone netscape plug-in content. Document loads of WebKit plug-in content should be cancelled since the plug-in does its own loading. Reviewed by john. * Misc.subproj/WebKitErrors.m: removed deprecated method * Misc.subproj/WebKitErrorsPrivate.h: * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): fixed the assertion statement * Plugins.subproj/WebPluginDocumentView.h: * Plugins.subproj/WebPluginDocumentView.m: (-[WebPluginDocumentView dealloc]): remove retained plug-in (-[WebPluginDocumentView setDataSource:]): retain the plug-in, cancel the laod 2004-09-29 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3763832> Safari-155: Non-Embeded movies fail to open in Cocoa QT plug-in <rdar://problem/3820517> "*** -[WebPluginPackage NPP_New]: selector not recognized [self = 0x5552c10]" Reviewed by rjw. * History.subproj/WebHistoryItem.m: * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_firstResponderCausesFocusDisplay]): (-[NSView _webView]): (-[NSView _frame]): (-[NSView _bridge]): (-[NSView _dataSource]): * Plugins.subproj/WebBasePluginPackage.h: * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage hash]): (-[WebBasePluginPackage isQuickTimePlugIn]): * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebNetscapePluginRepresentation.m: * Plugins.subproj/WebPluginController.h: * Plugins.subproj/WebPluginController.m: (-[WebPluginController initWithDocumentView:]): (-[WebPluginController addPlugin:]): (-[WebPluginController destroyAllPlugins]): (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]): (-[WebPluginController webPlugInContainerShowStatus:]): (-[WebPluginController webPlugInContainerSelectionColor]): (-[WebPluginController webFrame]): * Plugins.subproj/WebPluginDatabase.h: * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): (-[WebPluginDatabase refresh]): (WebPluginDocumentView::while): * Plugins.subproj/WebPluginDocumentView.h: Added. * Plugins.subproj/WebPluginDocumentView.m: Added. (-[WebPluginDocumentView initWithFrame:]): (-[WebPluginDocumentView dealloc]): (-[WebPluginDocumentView drawRect:]): (-[WebPluginDocumentView setDataSource:]): (-[WebPluginDocumentView setNeedsLayout:]): (-[WebPluginDocumentView layout]): (-[WebPluginDocumentView currentWindow]): (-[WebPluginDocumentView viewWillMoveToWindow:]): (-[WebPluginDocumentView viewDidMoveToWindow]): (-[WebPluginDocumentView viewWillMoveToHostWindow:]): (-[WebPluginDocumentView viewDidMoveToHostWindow]): (-[WebPluginDocumentView receivedData:withDataSource:]): (-[WebPluginDocumentView receivedError:withDataSource:]): (-[WebPluginDocumentView finishedLoadingWithDataSource:]): (-[WebPluginDocumentView canProvideDocumentSource]): (-[WebPluginDocumentView documentSource]): (-[WebPluginDocumentView title]): * Plugins.subproj/npapi.m: (NPN_ReleaseVariantValue): (NPN_GetStringIdentifier): (NPN_GetStringIdentifiers): (NPN_GetIntIdentifier): (NPN_IdentifierIsString): (NPN_UTF8FromIdentifier): (NPN_IntFromIdentifier): (NPN_CreateObject): (NPN_RetainObject): (NPN_ReleaseObject): (NPN_Invoke): (NPN_InvokeDefault): (NPN_Evaluate): (NPN_GetProperty): (NPN_SetProperty): (NPN_RemoveProperty): (NPN_HasProperty): (NPN_HasMethod): (NPN_SetException): (NPN_Call): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge frameRequiredForMIMEType:URL:]): * WebCoreSupport.subproj/WebViewFactory.m: * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDebugDOMNode.m: * WebView.subproj/WebDocumentInternal.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView initWithFrame:]): * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebImageRepresentation.h: * WebView.subproj/WebRenderNode.m: * WebView.subproj/WebView.m: 2004-09-29 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3779998> bringing window to front or sending to back does not send focus/blur events to JavaScript window object The fix has two parts, 1) make onblur and onfocus work for windows, and 2), allow the dashboard to override WebKit's special key/non-key behaviors. Reviewed by Maciej. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView restartNullEvents]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addMouseMovedObserver]): (-[WebHTMLView removeMouseMovedObserver]): * WebView.subproj/WebView.m: (-[WebView _dashboardBehavior:]): * WebView.subproj/WebViewInternal.h: * WebView.subproj/WebViewPrivate.h: 2004-09-29 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - consolidated OS version checks into prefix header * Misc.subproj/WebFileDatabase.m: (-[WebFileDatabase _createLRUList:]): (+[WebFileDatabase _syncLoop:]): * Misc.subproj/WebKitErrors.m: (registerErrors): * Misc.subproj/WebNSObjectExtras.h: (WebNSRetainCFRelease): * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_declareAndWriteDragImage:URL:title:archive:source:]): * Misc.subproj/WebUnicode.m: (_unicodeDirection): * WebCoreSupport.subproj/WebImageData.h: * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebKeyGenerator.h: * WebCoreSupport.subproj/WebNewKeyGeneration.c: * WebKitPrefix.h: * WebView.subproj/WebDataSource.m: (+[WebDataSource _repTypesAllowImageTypeOmission:]): (-[WebDataSource isLoading]): * WebView.subproj/WebFrameView.m: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): * WebView.subproj/WebHTMLView.m: * WebView.subproj/WebPDFRepresentation.h: * WebView.subproj/WebPDFRepresentation.m: * WebView.subproj/WebPDFView.h: * WebView.subproj/WebPDFView.m: 2004-09-29 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt Fix for this bug: <rdar://problem/3818296> REGRESSION (Mail): centerSelectionInVisibleArea does not work correctly * WebView.subproj/WebHTMLView.m: (-[WebHTMLView centerSelectionInVisibleArea:]): Now calls new centerSelectionInVisibleArea bridge function instead of ensureCaretVisible. Now handles caret selections and range selections correctly. 2004-09-28 Chris Blumenberg <cblu@apple.com> Added timing code so that Doug can time RTF conversion. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView writeSelectionWithPasteboardTypes:toPasteboard:]): (-[WebHTMLView _attributeStringFromDOMRange:]): 2004-09-28 Richard Williamson <rjw@apple.com> <rdar://problem/3817421> add getter for dashboard regions (debugging) <rdar://problem/3817417> NSScrollView need autoregions for dashboard Also KWQScrollBars Reviewed by Hyatt. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge dashboardRegionsChanged:]): * WebView.subproj/WebView.m: (-[WebView _setInitiatedDrag:]): (-[WebView _addScrollerDashboardRegions:from:]): (-[WebView _addScrollerDashboardRegions:]): (-[WebView _dashboardRegions]): * WebView.subproj/WebViewPrivate.h: 2004-09-27 John Sullivan <sullivan@apple.com> - fixed <rdar://problem/3814705> 8A266: Safari authentication dialog "remember password" text should match Mail * Panels.subproj/English.lproj/WebAuthenticationPanel.nib: changed "Remember this password" to "Remember this password in my keychain"; this will need to go through CCC for this week's build. 2004-09-27 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3594754> change null event interval from 20 ms to 10 ms to match speed on Windows Reviewed by John. * Plugins.subproj/WebBaseNetscapePluginView.m: 2004-09-27 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3502138> text files don't remember scroll position when going back or reloading Reviewed by john. * WebView.subproj/WebTextView.m: (-[WebTextView layout]): implemented, call sizeToFit, without this scrollPoint: won't work 2004-09-27 John Sullivan <sullivan@apple.com> Reviewed by Ken. - WebKit part of fix for <rdar://problem/3734466> ER: Support standard editing keystrokes like Cmd-B while editing rich text * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _toggleBold]): new method, toggles font-weight from "bold" to "normal" (-[WebHTMLView _toggleItalic]): new method, toggles font-style from "italic" to "normal" (-[WebHTMLView _handleStyleKeyEquivalent:]): new method, if the new preference is set and we're in an editable state, check for standard key equivalents for toggling styles (just command-B and command-I for now). (-[WebHTMLView performKeyEquivalent:]): Moved in file, now calls _handleStyleKeyEquivalent: * WebView.subproj/WebPreferenceKeysPrivate.h: new preference key WebKitRespectStandardStyleKeyEquivalentsPreferenceKey * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): initial value of WebKitRespectStandardStyleKeyEquivalentsPreferenceKey is NO (maybe we'll change our minds about this, but this is more guaranteed to be backward-compatible) (-[WebPreferences respectStandardStyleKeyEquivalents]): read WebKitRespectStandardStyleKeyEquivalentsPreferenceKey (-[WebPreferences setRespectStandardStyleKeyEquivalents:]): write WebKitRespectStandardStyleKeyEquivalentsPreferenceKey * WebView.subproj/WebPreferencesPrivate.h: declare getter and setter * English.lproj/StringsNotToBeLocalized.txt: updated for these and other recent changes 2004-09-27 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3806649> assertion failure after control-click of webcam Reviewed by john. * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate contextMenuItemsForElement:]): don't provide "Copy Image" if the image is not fully loaded 2004-09-27 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3814810> REGRESSION (125-164): Exception adding nil to dictionary in dragging code Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _setMouseDownEvent:]): new (-[WebHTMLView acceptsFirstMouse:]): call _setMouseDownEvent (-[WebHTMLView shouldDelayWindowOrderingForEvent:]): ditto (-[WebHTMLView mouseDown:]): ditto (-[WebHTMLView _delegateDragSourceActionMask]): removed temp fix, assert that the mouse event is not nil 2004-09-27 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Added WebDashboardRegion.h as a private header. 2004-09-24 Chris Blumenberg <cblu@apple.com> Reviewed by rjw. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _selectedArchive]): added timing code for copying markup === Safari-165 === 2004-09-24 Chris Blumenberg <cblu@apple.com> Temp fix for: <rdar://problem/3814810> REGRESSION (125-164): Exception adding nil to dictionary in dragging code Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _delegateDragSourceActionMask]): return none if the mouse down event is nil 2004-09-24 Ken Kocienda <kocienda@apple.com> Reviewed by John Fix for this bug: <rdar://problem/3813917> REGRESSION (125-163): The font panel will change the font of any web page We were doing a laughably bad job at preventing edits in documents that were not editable. This change fixes the specific case of the bug mentioned above, and makes an attempt to fix similar bugs by checking for whether the view is in editing mode before making edits. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _canEdit]): Renamed from _canType. Used in many more places in the code now. (-[WebHTMLView _isMoveDrag]): Change around code to make the meaning more clear. This one was actually performing a correct check before. (-[WebHTMLView keyDown:]): Renamed _canType to _canEdit. (-[WebHTMLView paste:]): Don't beep if can't paste. This matches AppKit. Any paste-related beeps will come from failure to handle key equivalent. Menu validation will kick in to dim menu. (-[WebHTMLView _applyStyleToSelection:]): Bail if !_canEdit. (-[WebHTMLView pasteAsPlainText:]): Ditto. (-[WebHTMLView _alignSelectionUsingCSSValue:]): Ditto. (-[WebHTMLView insertNewline:]): Ditto. (-[WebHTMLView insertParagraphSeparator:]): Ditto. (-[WebHTMLView _changeWordCaseWithSelector:]): Ditto. (-[WebHTMLView _deleteWithDirection:granularity:killRing:]): Ditto. (-[WebHTMLView complete:]): Ditto. (-[WebHTMLView _changeSpellingToWord:]): Ditto. Some code rearranging to eliminate bridge local variable. (-[WebHTMLView ignoreSpelling:]): Ditto. (-[WebHTMLView yank:]): Bail if !_canEdit. (-[WebHTMLView yankAndSelect:]): Ditto. (-[WebHTMLView deleteToMark:]): Ditto. (-[WebHTMLView swapWithMark:]): Ditto. (-[WebHTMLView transpose:]): Ditto. (-[WebHTMLView _updateFontPanel]): Ditto. Some code rearranging to eliminate bridge local variable. (-[WebHTMLView setMarkedText:selectedRange:]): Bail if !_canEdit. (-[WebHTMLView _insertText:selectInsertedText:]): Ditto. Some code rearranging to eliminate bridge local variable. * WebView.subproj/WebHTMLViewPrivate.h: Renamed _canType to _canEdit. 2004-09-24 Ken Kocienda <kocienda@apple.com> Reviewed by me * WebCoreSupport.subproj/WebDashboardRegion.h: Check in file copied from WebCore. 2004-09-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. <rdar://problem/3685235> REGRESSION (Mail): links are not properly editable * WebView.subproj/WebDefaultUIDelegate.m: By default, don't allow link dragging if the element under the mouse pointer is editable. This way, you can drag-select starting inside a link. 2004-09-23 John Sullivan <sullivan@apple.com> Reviewed by Chris. - WebKit part of fix for <rdar://problem/3415264> Default encoding should initially be set to current system encoding * WebView.subproj/WebPreferences.m: (-[WebPreferences _setInitialDefaultTextEncodingToSystemEncoding]): new SPI that sets the initial value of the default text encoding to be the system encoding, with a special-case conversion of MacRoman->Latin1. This is not done automatically for WebKit clients for fear of breaking them. * WebView.subproj/WebPreferencesPrivate.h: declare new SPI 2004-09-23 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed <rdar://problem/3811584> REGRESSION (85-125): iframe.document undefined in function called from button onclick; works from img onclick The fix is to not let "defers callbacks" have any effect on loading "about:blank". I also had to fix one bug in WebCore that could then be reproduced by going to "about:blank" while using a button. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient connection:didReceiveResponse:]): Loosen asserts to allow this callback for the specific case of "about:blank" even if the defers callbacks flag is true. (-[WebMainResourceClient connectionDidFinishLoading:]): Ditto. (-[WebMainResourceClient loadWithRequestNow:]): Added NSURLRequest return value. Loosened asserts as above. Changed code to return a new request if we get a new request back that is not empty when the defers callbacks flag is true. (-[WebMainResourceClient loadWithRequest:]): If the defers callbacks flag is set, but the URL is one that gives us an empty document, then do the work right away, don't defer it. 2004-09-23 Darin Adler <darin@apple.com> - fixed B&I builds by checking in generated file * WebCoreSupport.subproj/WebDashboardRegion.h: Added. 2004-09-22 Richard Williamson <rjw@apple.com> Pass dashboard regions to UI delegate. Reviewed by Hyatt. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge dashboardRegionsChanged:]): * WebView.subproj/WebUIDelegatePrivate.h: * copy-webcore-files-to-webkit: 2004-09-22 Chris Blumenberg <cblu@apple.com> Fixed build that I just broke. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): 2004-09-22 Chris Blumenberg <cblu@apple.com> <rdar://problem/3812091> REGRESSION (Mail): double-clicked word is not smart inserted on drag Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): pass value for smartMove 2004-09-22 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3667301> Frequent crashes in Mail when viewing HTML messages (CFURLGetByteRangeForComponent) <rdar://problem/3810354> WebResourceLoadDelegate can't refuse requests by returning nil; code asserts/crashes instead Reviewed by rjw. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withRequest:customHeaders:referrer:forDataSource:]): removed broken code that handled loadWithRequest returning NO * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate loadWithRequest:]): if nil is returned from the client for willSendRequest, report the cancelled error and return 2004-09-22 Ken Kocienda <kocienda@apple.com> Reviewed by Darin * WebView.subproj/WebFrameView.m: (-[WebFrameView _webcore_effectiveFirstResponder]): New function to yield the correct responder to check for firstResponder-ness before calling makeFirstResonder. This helps to prevent unwanted firstResponder switching. * WebView.subproj/WebView.m: (-[WebView _webcore_effectiveFirstResponder]): Ditto. 2004-09-21 Chris Blumenberg <cblu@apple.com Fixed: <rdar://problem/3735071> REGRESSION (Mail): WebCore Editing must do smart paste <rdar://problem/3799163> REGRESSION (Mail): Deleting a word doesn't delete whitespace Reviewed by darin. * WebView.subproj/WebDataSource.m: (-[WebDataSource _replaceSelectionWithArchive:selectReplacement:]): pass NO for smartReplace * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]): pass parameter for smartReplace using _canSmartReplaceWithPasteboard (-[WebHTMLView _changeSpellingFromMenu:]): pass NO for smartReplace (-[WebHTMLView pasteboardTypesForSelection]): include WebSmartPastePboardType when _canSmartCopyOrDelete return YES (-[WebHTMLView writeSelectionWithPasteboardTypes:toPasteboard:]): ditto (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): pass parameter for smartReplace using _canSmartReplaceWithPasteboard (-[WebHTMLView delete:]): call _deleteSelection (-[WebHTMLView cut:]): don't call delegate twice, call _deleteRange to delete (-[WebHTMLView pasteAsPlainText:]): pass parameter for smartReplace using _canSmartReplaceWithPasteboard (-[WebHTMLView _changeWordCaseWithSelector:]): pass NO for smartReplace (-[WebHTMLView deleteBackward:]): call _deleteSelection when there is a selected range (-[WebHTMLView _changeSpellingToWord:]): pass NO for smartReplace (-[WebHTMLView deleteToMark:]): pass NO for smartDeleteOK (-[WebHTMLView transpose:]): pass NO for smartReplace (-[WebHTMLView _shouldDeleteRange:]): moved (-[WebHTMLView _deleteRange:preflight:killRing:prepend:smartDeleteOK:]): moved, handle smartDelete (-[WebHTMLView _deleteWithDirection:granularity:killRing:]): moved (-[WebHTMLView _deleteSelection]): new (-[WebHTMLView _canSmartReplaceWithPasteboard]): new (-[WebHTMLView _canSmartCopyOrDelete]): new (-[WebHTMLView setMarkedText:selectedRange:]): pass NO for smartReplace (-[WebHTMLView _discardMarkedText]): call _deleteSelection (-[WebTextCompleteController _insertMatch:]): pass NO for smartReplace (-[WebTextCompleteController endRevertingChange:moveLeft:]): pass NO for smartReplace * WebView.subproj/WebHTMLViewInternal.h: * WebView.subproj/WebView.m: (-[WebView _commonInitializationWithFrameName:groupName:]): set smartInsertDeleteEnabled to YES (-[WebView replaceSelectionWithNode:]): pass NO for smartReplace (-[WebView replaceSelectionWithText:]): pass NO for smartReplace (-[WebView replaceSelectionWithMarkupString:]): pass NO for smartReplace (-[WebView deleteSelection]): call _deleteSelection on WebHTMLView 2004-09-21 John Sullivan <sullivan@apple.com> Reviewed by Darin. - WebKit part of fix for <rdar://problem/3618274> REGRESSION (125-135): Option-tab doesn't always work as expected * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge _retrieveKeyboardUIModeFromPreferences:]): Don't set WebCoreKeyboardAccessFull when setting WebCoreKeyboardAccessTabsToLinks after all; these need to be tested independently to get the option-tab behavior correct. 2004-09-21 John Sullivan <sullivan@apple.com> * WebView.subproj/WebHTMLView.m: (-[WebHTMLView doCommandBySelector:]): Commented out part of previous change; it breaks Mail editing until Mail fixes bug 3810158. 2004-09-21 John Sullivan <sullivan@apple.com> Reviewed by Ken. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView doCommandBySelector:]): Fix build failure from previous checkin, d'oh! Didn't set up webview variable. 2004-09-21 John Sullivan <sullivan@apple.com> Reviewed by Ken. - fixed <rdar://problem/3809477> WebHTMLView needs to pass doCommandBySelector through delegate * WebView.subproj/WebHTMLView.m: (-[WebHTMLView doCommandBySelector:]): Call through to editing delegate. If editing delegate returns YES, don't call super. * WebView.subproj/WebDefaultEditingDelegate.m: (-[WebDefaultEditingDelegate webView:doCommandBySelector:]): default implementation (which was never called) was returning YES, but it should return NO to signal that it didn't handle the selector. 2004-09-21 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3647229> Safari does not play inline Windows Media Content on some sites (miggy.net and ministryofsound.com) Reviewed by john. * Plugins.subproj/WebBaseNetscapePluginView.m: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:MIMEType:attributeKeys:attributeValues:]): set the plug-in before calling setting the attributes, so we can avoid passing certain attributes to the WMP plug-in that cause it to crash 2004-09-20 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3781290> REGRESSION (Mail): Crash in ReplaceSelectionCommandImpl attaching file to new message Reviewed by kocienda. * WebView.subproj/WebView.m: (-[WebView setEditable:]): call updateSelectionFromEmpty on the bridge if there is no selection 2004-09-20 Chris Blumenberg <cblu@apple.com> Changes to implement renamed bridge methods. Reviewed by darin. * ChangeLog: * DOM.subproj/WebDOMOperations.m: (-[DOMDocument URLWithAttributeString:]): call renamed bridge method * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:]): take 2 parameter arrays rather than 1 which will have to be parsed (-[WebBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:]): ditto 2004-09-20 Darin Adler <darin@apple.com> Reviewed by Chris. * WebView.subproj/WebFramePrivate.h: Added back. * WebView.subproj/WebFrameViewPrivate.h: Removed. 2004-09-20 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed <rdar://problem/3655360> REGRESSION (Mail): Ctrl-V emacs key binding, -pageDown: method, unimplemented (and pageUp, and selection-modifying versions) - fixed <rdar://problem/3792138> REGRESSION (Mail): Spell checker doesn't check current selected word * WebView.subproj/WebFrameViewInternal.h: Moved WebFrameViewPrivate inside the WebFrameView.m file. Removed a bunch of methods that don't need to be seen in other files, and added _verticalPageScrollDistance. * WebView.subproj/WebFrameViewPrivate.h: Removed. Renamed to WebFrameViewInternal.h. * WebView.subproj/WebFrameView.m: (-[WebFrameView _verticalKeyboardScrollDistance]): Move in the file because of internal vs. private. (-[WebFrameView _shouldDrawBorder]): Ditto. (-[WebFrameView _tile]): Ditto. (-[WebFrameView _verticalPageScrollDistance]): Added. Separate method so it can be called by the code to implement pageDown:. (-[WebFrameView _drawBorder]): Move in the file because of internal vs. private. (-[WebFrameView _goBack]): Ditto. (-[WebFrameView _goForward]): Ditto. (-[WebFrameView _scrollVerticallyBy:]): Ditto. (-[WebFrameView _scrollHorizontallyBy:]): Ditto. (-[WebFrameView _horizontalKeyboardScrollDistance]): Ditto. (-[WebFrameView _horizontalPageScrollDistance]): Added. Separate method for consistency with vertical method above. (-[WebFrameView _pageVertically:]): Moved and changed to use _verticalPageScrollDistance. (-[WebFrameView _pageHorizontally:]): Moved and changed to use _horizontalPageScrollDistance. (-[WebFrameView _scrollLineVertically:]): Move in the file because of internal vs. private. (-[WebFrameView _scrollLineHorizontally:]): Ditto. (-[WebFrameView scrollPageUp:]): Ditto. (-[WebFrameView scrollPageDown:]): Ditto. (-[WebFrameView scrollLineUp:]): Ditto. (-[WebFrameView scrollLineDown:]): Ditto. (-[WebFrameView _firstResponderIsControl]): Ditto. (-[WebFrameView keyDown:]): Changed to eliminate _pageLeft, _lineLeft, _pageRight, and _lineRight. * WebView.subproj/WebDataSource.m: Use WebFrameView.h instead of WebFrameViewPrivate.h. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _alterCurrentSelection:verticalDistance:]): Added. (-[WebHTMLView moveToBeginningOfDocument:]): Use WebSelectToDocumentBoundary. (-[WebHTMLView moveToBeginningOfDocumentAndModifySelection:]): Ditto. (-[WebHTMLView moveToEndOfDocument:]): Ditto. (-[WebHTMLView moveToEndOfDocumentAndModifySelection:]): Ditto. (-[WebHTMLView moveParagraphBackwardAndModifySelection:]): Added. (-[WebHTMLView moveParagraphForwardAndModifySelection:]): Added. (-[WebHTMLView pageUp:]): Added. (-[WebHTMLView pageDown:]): Added. (-[WebHTMLView pageUpAndModifySelection:]): Added. (-[WebHTMLView pageDownAndModifySelection:]): Added. (-[WebHTMLView showGuessPanel:]): Changed to call advanceToNextMisspellingStartingJustBeforeSelection. This fixes the problem with spell checking. * WebView.subproj/WebImageView.m: (-[WebImageView webView]): Changed to use _web_parentWebView. (-[WebImageView menuForEvent:]): Changed to use [self webView]. (-[WebImageView mouseDown:]): Ditto. (-[WebImageView mouseDragged:]): Ditto. (-[WebImageView draggedImage:endedAt:operation:]): Ditto. * WebView.subproj/WebTextView.m: (-[WebTextView _textSizeMultiplierFromWebView]): Changed to use _web_parentWebView. (-[WebTextView menuForEvent:]): Ditto. (-[WebTextView drawPageBorderWithSize:]): Ditto. (-[WebTextView knowsPageRange:]): Ditto. * Plugins.subproj/WebPluginDatabase.m: Updated filename of WebFrameViewInternal.h. * WebCoreSupport.subproj/WebBridge.m: Ditto. * WebKit.pbproj/project.pbxproj: Ditto. * WebView.subproj/WebFrame.m: Ditto. * WebView.subproj/WebView.m: Ditto. * Misc.subproj/WebNSViewExtras.m: Ditto. 2004-09-20 Darin Adler <darin@apple.com> Reviewed by Ken. - added helper method _web_parentWebView so fewer files need to get at WebFrame private methods * Misc.subproj/WebNSViewExtras.h: Added _web_parentWebView. * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_parentWebView]): Added. === Safari-164 === 2004-09-17 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3805757> don't unnecessarily put RTFD on the pasteboard <rdar://problem/3805756> strip attachments before generating RTF Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView writeSelectionWithPasteboardTypes:toPasteboard:]): only put RTFD on the pasteboard if it has attachments, strip attachments when writing RTF 2004-09-16 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3804648> 8A262: Safari crashed in -[WebView(WebPrivate) _editingDelegateForwarder] inside QuickTime Cocoa Plug-in during WebView deallocation * WebView.subproj/WebView.m: (-[WebView _editingDelegateForwarder]): Check _private for nil before dereferencing it. 2004-09-16 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3779150> REGRESSION: images not copied when copying HTML in Safari and pasting into TextEdit Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView writeSelectionWithPasteboardTypes:toPasteboard:]): use RTFDFromRange:: for RTFD * WebView.subproj/WebHTMLViewPrivate.h: 2004-09-15 Darin Adler <darin@apple.com> Reviewed by John. - fixed assertion I saw using the font panel * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _colorAsString:]): Convert color space before trying to get R, G, and B components. 2004-09-15 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3802232> REGRESSION (Mail): WebCore Editing must do smart copy Reviewed by kocienda. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _writeSelectionToPasteboard:]): call instance method not class method to get pasteboard types since the types depends on the current selection granularity (-[WebHTMLView pasteboardTypesForSelection]): if the selection granularity is "word" include the smart pasteboard type (-[WebHTMLView writeSelectionWithPasteboardTypes:toPasteboard:]): put nil on the pasteboard for smart copy 2004-09-14 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed <rdar://problem/3788894> REGRESSION (Mail): ctrl-t emacs key binding does not work (transpose) - fixed <rdar://problem/3798946> REGRESSION (Mail): Cursor does not disappear when typing * WebView.subproj/WebHTMLView.m: (-[WebHTMLView keyDown:]): Hide cursor by calling setHiddenUntilMouseMoves:YES. (-[WebHTMLView transpose:]): Added. 2004-09-14 Richard Williamson <rjw@apple.com> 1. Add class parameter to object allocation function. This is somewhat redundant, given that the allocation function is in the class function vector, but people wanted to use the same allocation function for different classes. 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector. 3. Add support for a default function on an object. This is a feature that ActiveX supports, and will allow JavaScript code to be written that will look exactly the same for both ActiveX plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and 'Objective-C' bindings. There bugs are covered by <rdar://problem/3776343> Support for default functions in the JavaScript bindings <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke <rdar://problem/3674754> Need to implement latest npruntime.h Reviewed by John. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): * Plugins.subproj/WebScriptObject.h: * Plugins.subproj/npfunctions.h: * Plugins.subproj/npruntime.h: 2004-09-13 Richard Williamson <rjw@apple.com> D'oh. How many times can I screw up a simple fix! * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:usingPrinterFont:]): 2004-09-13 Richard Williamson <rjw@apple.com> Fixed snafu from 3782533 checkin. Reviewed by John. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:usingPrinterFont:]): 2004-09-12 Chris Blumenberg <cblu@apple.com> Support for: <rdar://problem/3794790> drop rate or time remaining from download status when window is too small to fit it Reviewed by john. * Misc.subproj/WebStringTruncator.h: * Misc.subproj/WebStringTruncator.m: (+[WebStringTruncator widthOfString:font:]): new 2004-09-10 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3782533> CrashTracer: .1459 crashes at com.apple.WebKit: -[WebTextRenderer initWithFont:usingPrinterFont:] + 0x138 We were explicitly failing when we encountered deprecated fonts. (Those with unsupported glyph packings). Deprecated fonts should only appear on a system that have stuff migrated from OS 9. Ugh, thats probably why we've never seen the problem here. Reviewed by John. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:usingPrinterFont:]): 2004-09-10 John Sullivan <sullivan@apple.com> Reviewed by Chris. - added _isFrameSet as a private method, so it can be used in WebBrowser. This is needed to merge the fix for 3123987 to SUPanNavy. * WebView.subproj/WebFrame.m: (-[WebFrame _isFrameSet]): new method * WebView.subproj/WebFramePrivate.h: declare new method 2004-09-09 Chris Blumenberg <cblu@apple.com> Support for: <rdar://problem/3795485> debug menu item to enable RSS animation on first layout Reviewed by rjw. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge didFirstLayout]): new * WebView.subproj/WebDefaultFrameLoadDelegate.m: (-[WebDefaultFrameLoadDelegate webView:didFirstLayoutInFrame:]): new * WebView.subproj/WebViewPrivate.h: 2004-09-09 Richard Williamson <rjw@apple.com> Alternate implementation of image rendering. Use CGImageRefs instead of NSImages. Mostly works, but currently disabled because of issues w/ CG. Reviewed by Chris. * ChangeLog: * WebCoreSupport.subproj/WebImageData.h: Added. * WebCoreSupport.subproj/WebImageData.m: Added. (-[WebImageData _commonTermination]): (-[WebImageData dealloc]): (-[WebImageData finalize]): (-[WebImageData copyWithZone:]): (-[WebImageData numberOfImages]): (-[WebImageData currentFrame]): (-[WebImageData _invalidateImages]): (-[WebImageData imageAtIndex:]): (-[WebImageData incrementalLoadWithBytes:length:complete:]): (drawPattern): (-[WebImageData tileInRect:fromPoint:context:]): (-[WebImageData isNull]): (-[WebImageData size]): (-[WebImageData _frameDuration]): (-[WebImageData _repetitionCount]): (-[WebImageData isAnimationFinished]): (+[WebImageData stopAnimationsInView:]): (-[WebImageData addAnimatingRenderer:inView:]): (-[WebImageData removeAnimatingRenderer:]): (-[WebImageData _stopAnimation]): (-[WebImageData _nextFrame:]): (-[WebImageData animate]): * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer initWithMIMEType:]): (-[WebImageRenderer initWithData:MIMEType:]): (-[WebImageRenderer initWithContentsOfFile:]): (-[WebImageRenderer dealloc]): (-[WebImageRenderer copyWithZone:]): (-[WebImageRenderer retainOrCopyIfNeeded]): (-[WebImageRenderer resize:]): (-[WebImageRenderer size]): (-[WebImageRenderer MIMEType]): (-[WebImageRenderer frameCount]): (-[WebImageRenderer isNull]): (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): (-[WebImageRenderer drawImageInRect:fromRect:]): (-[WebImageRenderer drawImageInRect:fromRect:compositeOperator:context:]): (-[WebImageRenderer tileInRect:fromPoint:context:]): (-[WebImageRenderer _startOrContinueAnimationIfNecessary]): (+[WebImageRenderer stopAnimationsInView:]): (-[WebImageRenderer stopAnimation]): (-[WebImageRenderer targetAnimationRect]): (-[WebImageRenderer increaseUseCount]): (-[WebImageRenderer decreaseUseCount]): (-[WebImageRenderer flushRasterCache]): (-[WebImageRenderer imageRef]): (-[WebImageRenderer TIFFRepresentation]): (-[WebImageRenderer image]): * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory imageRendererWithMIMEType:]): (-[WebImageRendererFactory imageRendererWithData:MIMEType:]): (-[WebImageRendererFactory imageRendererWithSize:]): (-[WebImageRendererFactory imageRendererWithName:]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebImageView.m: (-[WebImageView image]): === Safari-163 === 2004-09-09 Maciej Stachowiak <mjs@apple.com> - rolled out last two changes, they seem to cause a performance regression * WebView.subproj/WebHTMLView.m: (-[WebHTMLView firstRectForCharacterRange:]): 2004-09-09 Maciej Stachowiak <mjs@apple.com> - fixed build * WebView.subproj/WebHTMLView.m: (-[WebHTMLView firstRectForCharacterRange:]): 2004-09-08 Maciej Stachowiak <mjs@apple.com> Reviewed by Dave. WebKit part of fix for: <rdar://problem/3759187> REGRESSION (Mail): implement firstRectForCharacterRange: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView firstRectForCharacterRange:]): Call the appropriate new bridge method, and translate to screen coordinates. 2004-09-09 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed <rdar://problem/3790526> mark-related methods not implemented (needed for people with them in their key bindings files) * WebKit.pbproj/project.pbxproj: Update MACOSX_DEPLOYMENT_TARGET to 10.3 and add -fobjc-exceptions so we can use new exceptions. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView setMark:]): Added. (unionDOMRanges): Added. (-[WebHTMLView deleteToMark:]): Added. (-[WebHTMLView selectToMark:]): Added. (-[WebHTMLView swapWithMark:]): Added. (-[WebHTMLView markedRange]): Updated for change to bridge method names. (-[WebHTMLView hasMarkedText]): Ditto. (-[WebHTMLView unmarkText]): Ditto. (-[WebHTMLView _selectMarkedText]): Ditto. (-[WebHTMLView _selectRangeInMarkedText:]): Ditto. (-[WebHTMLView setMarkedText:selectedRange:]): Ditto. (-[WebHTMLView _insertText:selectInsertedText:]): Removed check for empty string. An empty string should not be filtered out here. We need to allow inserting an empty string. (-[WebHTMLView _selectionIsInsideMarkedText]): Updated for change to bridge method names. (-[WebHTMLView _updateSelectionForInputManager]): Ditto. * WebView.subproj/WebView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): Changed to use selectionDOMRange instead of selectionStart. * WebView.subproj/WebHTMLRepresentation.h: Removed unused setSelectionFrom method. * WebView.subproj/WebHTMLRepresentation.m: Ditto. 2004-09-08 John Sullivan <sullivan@apple.com> Reviewed by Darin. - fixed the localization aspect of: <rdar://problem/3790011> undoable operations all say "Undo" in the menu, no specific action names We now have all the strings ready for localization; we just don't actually use them yet. * English.lproj/Localizable.strings: updated for this change * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setUndoActionNamePlaceholder]): added this placeholder method whose purpose is to hold localizable strings for all the Undo action names that NSTextView uses. Later we will use some or all of these, but we can do that part after the localization freeze. 2004-09-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3778785> REGRESSION (Mail): copying from MS word and pasting into editable region leaves internal clipboard data Reviewed by kocienda. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:]): ignore Microsoft's header meta data 2004-09-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3792893> WebBaseResourceHandleDelegate always returns cached data for subresource loads Reviewed by rjw. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate _canUseResourceForRequest:]): new (-[WebBaseResourceHandleDelegate loadWithRequest:]): call _canUseResourceForRequest: 2004-09-08 Chris Blumenberg <cblu@apple.com> Forgot to add this in previous check-in. * English.lproj/WebViewEditingContextMenu.nib: Added. 2004-09-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3791240> WebKit uses the NSTextViewContextMenu nib from inside AppKit Reviewed by john. * English.lproj/StringsNotToBeLocalized.txt: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate editingContextMenuItemsForElement:]): use our copy of the nib 2004-09-07 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2004-09-07 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3790143> exception raised when dragging a URL with 2-byte characters (checked in with last check-in) 2004-09-07 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3080103> Need to pass cmd-modified keys to plug-ins <rdar://problem/3751509> can't use safari edit menu to copy and paste with Vantage Learning's My Access Reviewed by john. * Plugins.subproj/WebBaseNetscapePluginView.m: fake up command-key events for cut, copy, paste and select all so these menu items work for plug-ins (-[WebBaseNetscapePluginView sendModifierEventWithKeyCode:character:]): (-[WebBaseNetscapePluginView cut:]): (-[WebBaseNetscapePluginView copy:]): (-[WebBaseNetscapePluginView paste:]): (-[WebBaseNetscapePluginView selectAll:]): 2004-09-07 Darin Adler <darin@apple.com> - fixed deployment build * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _deleteWithDirection:granularity:killRing:]): Initialize prepend variable. 2004-09-06 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3696542> REGRESSION (Mail): Editable WebKit doesn't support underline yet (in the iChat profile window, at least) - fixed <rdar://problem/3780249> REGRESSION (Mail): copy style/paste style doesn't work in HTML editing in Mail - fixed <rdar://problem/3788857> REGRESSION (Mail): Home and End keys don't work in message composer - fixed <rdar://problem/3788884> REGRESSION (Mail): ctrl-d emacs key binding does not work (delete forward) - fixed <rdar://problem/3788890> REGRESSION (Mail): ctrl-k emacs key binding does not work (delete to end of paragraph) - fixed <rdar://problem/3788899> REGRESSION (Mail): ctrl-y emacs key binding does not work (yank) - fixed <rdar://problem/3788901> REGRESSION (Mail): ctrl-o emacs key binding does not work (insert newline in front of insertion point) - fixed <rdar://problem/3788908> REGRESSION (Mail): ctrl-left-arrow emacs key binding does not work (move to beginning of line) - fixed <rdar://problem/3788913> REGRESSION (Mail): ctrl-right-arrow emacs key binding does not work (move to end of line) - implemented a first cut at other attribute changes from Text Panel besides underline (bugs?) - dealt with a couple of FIXMEs in WebHTMLView.m - updated list of not-yet-implemented methods in WebHTMLView.m - fixed many deletion operations to call the correct editing delegate methods * WebView.subproj/WebFrameViewPrivate.h: Remove _scrollToTopLeft and _scrollToBottomLeft. No one was calling them anyway, so they should really have been marked internal and not private. * WebView.subproj/WebFrameView.m: (-[WebFrameView scrollToBeginningOfDocument:]): Renamed _scrollToTopLeft to this, so the home key would start working with the key bindings machinery. (-[WebFrameView scrollToEndOfDocument:]): Same thing, for end key. (-[WebFrameView keyDown:]): Update for name changes, and also make sure we don't try to grab control-arrow keys here (probably not necessary, but good anyway). * WebView.subproj/WebHTMLViewInternal.h: Added keyDownEvent field, and startNewKillRingSequence and nextResponderDisabledOnce flags. * WebView.subproj/WebHTMLView.m: Rearrange declarations at the top of the file so that external things are up with the #import directives and things inside this file are declared below. (-[WebHTMLView _shouldReplaceSelectionWithText:givenAction:]): Ditto. (-[WebHTMLView _calculatePrintHeight]): Moved up into the "internal to file" category. (-[WebHTMLView _updateTextSizeMultiplier]): Ditto. (-[WebHTMLView _selectedRange]): Added. (-[WebHTMLView _openLinkFromMenu:]): Left this method lying around even though I deleted the other APPKIT_CODE_FOR_REFERENCE in case this shows up in the context menu we are now sharing with the AppKit. Chris will look at this later, and he can delete it then. (+[WebHTMLView initialize]): Call _NSInitializeKillRing. (-[WebHTMLView _documentRange]): Added. (-[WebHTMLView string]): Call the bridge to get the plain text rather than making an attributed string and then getting the text from there. (-[WebHTMLView becomeFirstResponder]): Set startNewKillRingSequence flag, so that new deletions will create a new kill ring entry. (-[WebHTMLView moveToBeginningOfDocument:]): Use backward direction instead of left direction. (-[WebHTMLView moveToBeginningOfDocumentAndModifySelection:]): Ditto. (-[WebHTMLView moveToBeginningOfLine:]): Ditto. (-[WebHTMLView moveToBeginningOfLineAndModifySelection:]): Ditto. (-[WebHTMLView moveToBeginningOfParagraph:]): Ditto, also use WebSelectToParagraphBoundary. (-[WebHTMLView moveToBeginningOfParagraphAndModifySelection:]): Ditto. (-[WebHTMLView moveToEndOfDocument:]): Use forward direction instead of right direction. (-[WebHTMLView moveToEndOfDocumentAndModifySelection:]): Ditto. (-[WebHTMLView moveToEndOfLine:]): Ditto. (-[WebHTMLView moveToEndOfLineAndModifySelection:]): Ditto. (-[WebHTMLView moveToEndOfParagraph:]): Ditto, also use WebSelectToParagraphBoundary. (-[WebHTMLView moveToEndOfParagraphAndModifySelection:]): Ditto. (-[WebHTMLView _shouldDeleteRange:]): Added. (-[WebHTMLView _deleteRange:preflight:killRing:prepend:]): Added. (-[WebHTMLView delete:]): Changed to call new _deleteRange method. (-[WebHTMLView cut:]): Changed to preflight property and call new _deleteRange method. (-[WebHTMLView _selectionFontAttributes]): Added. (-[WebHTMLView _selectionFontAttributesAsRTF]): Added. (-[WebHTMLView _fontAttributesFromFontPasteboard]): Added. (-[WebHTMLView _emptyStyle]): Added. (-[WebHTMLView _styleFromFontAttributes:]): Added. (-[WebHTMLView _applyStyleToSelection:]): Added. (-[WebHTMLView copyFont:]): Implemented. (-[WebHTMLView pasteFont:]): Implemented. (-[WebHTMLView _originalFontA]): Added. (-[WebHTMLView _originalFontB]): Added. (-[WebHTMLView _addToStyle:fontA:fontB:]): Added. Has code from the method that figures out what the font manager is doing for changeFont:, now needed for changeAttribute: too. (-[WebHTMLView _styleFromFontManagerOperation]): Renamed and now calls shared methods. (-[WebHTMLView changeFont:]): Call shared method, still does the same thing. (-[WebHTMLView _colorAsString:]): Added. Has code from the method we were using with the color panel before. (-[WebHTMLView _shadowAsString:]): Added. (-[WebHTMLView _styleForAttributeChange:]): Added. (-[WebHTMLView changeAttributes:]): Implemented. (-[WebHTMLView _styleFromColorPanelWithSelector:]): Renamed and now calls shared methods. (-[WebHTMLView _changeCSSColorUsingSelector:inRange:]): Call method by new name. (-[WebHTMLView changeDocumentBackgroundColor:]): Call method by new name. (-[WebHTMLView changeColor:]): Changed around a bit; still doesn't work yet. (-[WebHTMLView _alignSelectionUsingCSSValue:]): Call shared methods. (-[WebHTMLView indent:]): Removed, since NSTextView doesn't implement this method. Added to list of methods to possibly implement later in the file. (-[WebHTMLView insertTab:]): Call insertText: to save code and so we get WebViewInsertActionTyped instead of WebViewInsertActionPasted. (-[WebHTMLView changeCaseOfLetter:]): Removed, since NSTextView doesn't implement this method. Added to list of methods to possibly implement later in the file. (-[WebHTMLView _deleteWithDirection:granularity:killRing:]): Added. (-[WebHTMLView deleteForward:]): Implemented. This makes Control-D work. (-[WebHTMLView deleteBackwardByDecomposingPreviousCharacter:]): Implemented by just calling deleteBackward for now; probably better than doing nothing. (-[WebHTMLView deleteWordForward:]): Changed to call new _delete method above. Fixes things so that we delete the selection if there is one, get the appropriate delegate calls, handle the kill ring properly, and don't do any selection if we can't delete. (-[WebHTMLView deleteWordBackward:]): Ditto. (-[WebHTMLView deleteToBeginningOfLine:]): Ditto. (-[WebHTMLView deleteToEndOfLine:]): Ditto. (-[WebHTMLView deleteToBeginningOfParagraph:]): Ditto. (-[WebHTMLView deleteToEndOfParagraph:]): Ditto. Added additional behavior needed since this is bound to Control-K, so it's not really just delete to end of paragraph. (-[WebHTMLView insertNewlineIgnoringFieldEditor:]): Added. Calls insertNewline:. (-[WebHTMLView insertTabIgnoringFieldEditor:]): Added. Calls insertTab:. (-[WebHTMLView subscript:]): Added. (-[WebHTMLView superscript:]): Added. (-[WebHTMLView unscript:]): Added. (-[WebHTMLView underline:]): Added. (-[WebHTMLView yank:]): Added. (-[WebHTMLView yankAndSelect:]): Added. Calls _insertText. (-[WebHTMLView _arrowKeyDownEventSelectorIfPreprocessing:]): Added. Part of workaround for control-arrow key trouble. (-[WebHTMLView respondsToSelector:]): Added. More of workaround. (-[WebHTMLView nextResponder:]): Added. More of workaround. (-[WebHTMLView _selectionChanged]): Set startNewKillRingSequence flag, so that new deletions will create a new kill ring entry. (-[WebHTMLView _updateFontPanel]): Remove a bunch of code here that wasn't working very well because it walked a DOM range incorrectly, and instead use the new method that does all the right stuff on the other side of the bridge. (-[WebHTMLView _insertText:selectInsertedText:]): Added new helper method for use by both insertText and yankAndSelect, with most of the guts of insertText and one additional parameter. (-[WebHTMLView insertText:]): Call the new _insertText. * WebView.subproj/WebView.m: Use macros to make the forwarding from WebView more terse. Updated the list to include a few methods it didn't before. 2004-09-06 John Sullivan <sullivan@apple.com> Reviewed by Darin. - put preference keys in a private header file so Safari can use them for Managed Preferences * WebView.subproj/WebPreferenceKeysPrivate.h: new Private header file, includes the #defines for NSUserDefaults preference keys * WebView.subproj/WebPreferences.m: moved the preference key #defines out of here; now imports WebPreferenceKeysPrivate.h * WebKit.pbproj/project.pbxproj: updated for new file 2004-09-03 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3782543> CrashTracer: ...87 crashes at com.apple.WebKit: -[WebNetscapePluginPackage initWithPath:] + 0x18c Reviewed by john. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage initWithPath:]): make sure the file is at least 8 bytes long before calling memcmp 2004-09-03 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3788328> assertion failure when moving an image <rdar://problem/3783628> REGRESSION (Mail): when I try to reorder an image, the image is duplicated * DOM.subproj/WebDOMOperations.m: (-[DOMDocument _createRangeWithNode:]): new, convenience (-[DOMDocument _documentRange]): use _ createRangeWithNode: * DOM.subproj/WebDOMOperationsPrivate.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): set the selection to the image when starting the drag. This allows "move selection" to work and this matches NSText's behavior === Safari-162 === 2004-09-02 Richard Williamson <rjw@apple.com> Support for patterns in <canvas>. (These changes attempt to create a CGImageRef from a WebImageRenderer that is used by the pattern drawing function.) Reviewed by Hyatt. * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer dealloc]): (-[WebImageRenderer finalize]): (-[WebImageRenderer imageRef]): (_createImageRef): * WebView.subproj/WebPDFView.h: * WebView.subproj/WebPDFView.m: 2004-09-01 Chris Blumenberg <cblu@apple.com> Fixed deployment build failure. * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate menuItemWithTag:]): 2004-08-31 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3699498> Context menu for editable WebViews should provide items like Cut and Paste <rdar://problem/3781535> REGRESSION (Mail): no context menu after ctrl-clicking a misspelled word Reviewed by kocienda. * English.lproj/Localizable.strings: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate menuItemWithTag:]): updated to handle new menu items (-[WebDefaultUIDelegate contextMenuItemsForElement:]): renamed from webView:contextMenuItemsForElement:defaultMenuItems: (-[WebDefaultUIDelegate editingContextMenuItemsForElement:]): new (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): moved, now call contextMenuItemsForElement: or editingContextMenuItemsForElement: * WebView.subproj/WebDefaultUIDelegate.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _isSelectionMisspelled]): new (-[WebHTMLView _guessesForMisspelledSelection]): new (-[WebHTMLView _changeSpellingFromMenu:]): new (-[WebHTMLView _ignoreSpellingFromMenu:]): new (-[WebHTMLView _learnSpellingFromMenu:]): new * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebUIDelegate.h: 2004-08-31 Darin Adler <darin@apple.com> - fixed B&I build failure * WebView.subproj/WebHTMLView.m: (-[WebTextCompleteController _buildUI]): Work around unwanted warning by adding a cast. 2004-08-27 Maciej Stachowiak <mjs@apple.com> Reviewed by John. <rdar://problem/3778314> REGRESSION: Can't proceed to survey questions on Lominger's Apple website Because we will stop parsing when there is a pending redirection, avoid setting one if no navigation would actually take place because the number of steps is out of range. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge canGoBackOrForward:]): 2004-08-30 Darin Adler <darin@apple.com> Reviewed by John. - part of fix for <rdar://problem/3637519> REGRESSION (125-128): unrepro crash in QListBox::sizeForNumberOfLines at istweb.apple.com * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory clearCaches]): Call [super clearCaches]. 2004-08-30 Darin Adler <darin@apple.com> Reviewed by Chris. - did work to prepare for uploading files incrementally when submitting forms * History.subproj/WebHistoryItem.m: (-[WebHistoryItem _setFormInfoFromRequest:]): Use NSArray instead of NSData for form data. (-[WebHistoryItem formData]): Ditto. * History.subproj/WebHistoryItemPrivate.h: Ditto. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge startLoadingResource:withURL:customHeaders:postData:]): Ditto. (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): Ditto. (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): Ditto. * WebCoreSupport.subproj/WebSubresourceClient.h: Ditto. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:customHeaders:postData:referrer:forDataSource:]): Ditto. * WebView.subproj/WebFrame.m: (-[WebFrame _loadItem:withLoadType:]): Ditto. (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): Ditto. * WebView.subproj/WebFramePrivate.h: Ditto. * WebView.subproj/WebFormDataStream.h: Added. * WebView.subproj/WebFormDataStream.m: (-[WebFormDataStream initWithFormDataArray:]): Placeholder; not done yet. (-[WebFormDataStream formDataArray]): Ditto. * WebKit.pbproj/project.pbxproj: Added WebFormDataStream files. 2004-08-30 John Sullivan <sullivan@apple.com> Reviewed by Ken. - WebKit part of fix for <rdar://problem/3607720> myFrame.print() prints the window but should only print the frame * WebView.subproj/WebUIDelegatePrivate.h: declare new delegate method that includes which frame to print * WebView.subproj/WebDefaultUIDelegate.m: (-[WebDefaultUIDelegate webView:printFrameView:]): implement default (no-op) version of new delegate method * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge print]): call new delegate method if available, otherwise call old delegate method, for backward compatibility. 2004-08-27 Maciej Stachowiak <mjs@apple.com> Reviewed by John. Checked in by Ken Ken comments: It looks like Maciej forgot to land this when he checked in the WebCore portion of this change. <rdar://problem/3778314> REGRESSION: Can't proceed to survey questions on Lominger's Apple website Because we will stop parsing when there is a pending redirection, avoid setting one if no navigation would actually take place because the number of steps is out of range. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge canGoBackOrForward:]): 2004-08-27 Ken Kocienda <kocienda@apple.com> Reviewed by Chris Fix for this bug: <rdar://problem/3756997> WebKit aggressive in making pasted text into a URL, even when it's not much like a URL * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:]): Don't try so hard to coerce data on the pasteboard into a URL, and do not make an anchor with an href for any URLs that are explicitly present on the pasteboard. Also, move URL pasteboard type check beneath the RTF checks. === Safari-161 === 2004-08-26 Chris Blumenberg <cblu@apple.com> Fixed build failure on Panther. Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:]): ifdef'd out call to AppKit SPI (-[WebHTMLView _attributeStringFromDOMRange:]): ditto 2004-08-26 Chris Blumenberg <cblu@apple.com> Tweak to last check-in. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:]): 2004-08-26 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3546412> support for pasting and drag and dropping of RTF and RTFD to editable WebViews <rdar://problem/3745345> use AppKit for converting from DOM to RTF Reviewed by rjw. * DOM.subproj/WebDOMOperations.m: (-[DOMDocument _documentRange]): new * DOM.subproj/WebDOMOperationsPrivate.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:]): call AppKit SPI to get a document fragment from an attributed string (-[WebHTMLView string]): added a FIXME (-[WebHTMLView _attributeStringFromDOMRange:]): new, calls AppKit SPI that creates an attributed string from a DOM Range (-[WebHTMLView attributedString]): call _attributeStringFromDOMRange:, fallback to old code if it returns nil (-[WebHTMLView selectedAttributedString]): ditto 2004-08-26 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3774178> Plugin hooks for selected state aren't being called Reviewed by darin. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setIsSelected:forView:]): don't forget colons in method names 2004-08-26 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3768439> can't click in WebView in Carbon WebKit apps (GetEventPlatformEventRecord returns false) Reviewed by rjw. * Carbon.subproj/HIWebView.m: (Click): use WebGetEventPlatformEventRecord not GetEventPlatformEventRecord (MouseUp): ditto (MouseMoved): ditto (MouseDragged): ditto (MouseWheelMoved): ditto (WindowHandler): ditto (HIWebViewEventHandler): ditto (UpdateObserver): ditto (WebGetEventPlatformEventRecord): Call GetEventPlatformEventRecord, if that fails fallback to the current event. This is code Eric Schlegel to me to use. 2004-08-24 Chris Blumenberg <cblu@apple.com> Fixed with help from Trey: <rdar://problem/3764856> REGRESSION !25-154): Safari accepts mouse clicks (follows links) when not key Reviewed by rjw. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _isSelectionEvent:]): brought back from CVS (-[WebHTMLView acceptsFirstMouse:]): only call eventMayStartDrag if _isSelectionEvent returns YES since we only want to allow selection dragging on the first mouse down (-[WebHTMLView shouldDelayWindowOrderingForEvent:]): ditto 2004-08-24 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt Improved the checks used to see if certain operations can be done based on the state of the selection and whether the selection is editable. I added some helpers and improved some others to assist in making these determinations. This helps to fix this bug: <rdar://problem/3764987> Crash after adding newline to quoted text Since some editing methods expect the the selection to be in a certain state in order to work, these checks help obviate crashes like 3764987. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _writeSelectionToPasteboard:]): _haveSelection name changed to _hasSelection. (-[WebHTMLView _canCopy]): Checks to see if state is appropriate to perform this operation. (-[WebHTMLView _canCut]): Ditto. Function added. (-[WebHTMLView _canDelete]): Ditto. Function refined. (-[WebHTMLView _canPaste]): Ditto. Function refined. (-[WebHTMLView _canType]): Ditto. Function added. (-[WebHTMLView _hasSelection]): Name changed from _haveSelection. (-[WebHTMLView _hasSelectionOrInsertionPoint]): Added. (-[WebHTMLView _isEditable]): Added. (-[WebHTMLView takeFindStringFromSelection:]): _haveSelection name changed to _hasSelection. (-[WebHTMLView validateUserInterfaceItem:]): Ditto (-[WebHTMLView validRequestorForSendType:returnType:]): Ditto (-[WebHTMLView keyDown:]): (-[WebHTMLView copy:]): Uses new _canCopy check. (-[WebHTMLView cut:]): Uses new _canCut check. (-[WebHTMLView delete:]): Now uses _canDelete check. (-[WebHTMLView paste:]): Now uses _canPaste check. (-[WebHTMLView _updateFontPanel]): _haveSelection name changed to _hasSelection. * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebView.m: (-[WebView writeSelectionWithPasteboardTypes:toPasteboard:]): Use selectionState check to determine whether or not operation can be done. 2004-08-24 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3770469> Some PDFs open with line of previous page above PDF view Set height resize flags on WebPDFView. Reviewed by Chris. * WebView.subproj/WebPDFView.m: (-[WebPDFView initWithFrame:]): 2004-08-24 David Hyatt <hyatt@apple.com> Add Atom and RSS MIME types to set of supported XML types. Reviewed by rjw * WebView.subproj/WebDataSource.m: (+[WebDataSource _repTypesAllowImageTypeOmission:]): * WebView.subproj/WebFrameView.m: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): 2004-08-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Kevin. - remove annoying ERROR spew and replace with comment * WebView.subproj/WebHTMLView.m: (-[WebHTMLView validAttributesForMarkedText]): 2004-08-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. - a bit of code cleanup * WebView.subproj/WebDataSource.m: (-[WebDataSource _stringWithData:]): Call textEncodingName instead of copying it's code. (-[WebDataSource textEncodingName]): Tweak formatting. 2004-08-23 Chris Blumenberg <cblu@apple.com> Fixed build. * WebKit.pbproj/project.pbxproj: make sure we're doing -f on a file, not a directory 2004-08-23 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3674867> use new Security framework SPI's to reenable cert acquisition Reviewed by john. * WebCoreSupport.subproj/WebKeyGeneration.cpp: * WebCoreSupport.subproj/WebKeyGeneration.h: * WebCoreSupport.subproj/WebKeyGenerator.h: * WebCoreSupport.subproj/WebKeyGenerator.m: (-[WebKeyGenerator signedPublicKeyAndChallengeStringWithStrengthIndex:challenge:pageURL:]): re-enabled cert code, call Panther version on Panther, Tiger version on Tiger (-[WebKeyGenerator addCertificatesToKeychainFromData:]): ditto * WebCoreSupport.subproj/WebNewKeyGeneration.c: Added. (gnrAddContextAttribute): (gnrGetSubjPubKey): (gnrNullAlgParams): (gnrSign): (gnrFreeCssmData): (nssArraySize): (signedPublicKeyAndChallengeString): (addCertificateToKeychainFromData): (addCertificatesToKeychainFromData): * WebCoreSupport.subproj/WebNewKeyGeneration.h: Added. * WebKit.pbproj/project.pbxproj: 2004-08-20 David Hyatt <hyatt@apple.com> Fix the directionality of the unicode hyphen so that on Panther it now matches Tiger. Reviewed by darin * Misc.subproj/WebUnicode.m: (_unicodeDirection): 2004-08-20 Richard Williamson <rjw@apple.com> Implemented new JNI abstraction. We no longer invoke Java methods directly with JNI, rather we call into the plugin. This allows the plugin to dispatch the call to the appropriate VM thread. This change should (will?) fix a whole class of threading related problems with the Java VM. Reviewed by Hyatt. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge getAppletInView:]): 2004-08-20 Trey Matteson <trey@apple.com> 3655407 - Editing: -complete: method unimplemented (WebKit editing API) This feature is mostly implemented. The only loose ends I know of are: 3769654 - text insertions done via complete: should preserve case of full replacement string 3769652 - positioning of complete: popup window wrong for right-to-left languages Reviewed by John * WebView.subproj/WebHTMLView.m: (-[WebHTMLViewPrivate dealloc]): Free new object. (-[WebHTMLView menuForEvent:]): Bail on completion session. (-[WebHTMLView windowDidResignKey:]): Ditto. (-[WebHTMLView windowWillClose:]): Ditto. (-[WebHTMLView mouseDown:]): Ditto. (-[WebHTMLView resignFirstResponder]): Ditto. (-[WebHTMLView keyDown:]): Bail on completion session if WebCore takes the event. Give the CompleteController a crack at the key event. (-[WebHTMLView _expandSelectionToGranularity:]): Adopt method rename (-[WebHTMLView complete:]): Make CompleteController, tell it to do its thing. (-[WebHTMLView checkSpelling:]): Add ERROR(). (-[WebHTMLView showGuessPanel:]): Add ERROR(). (-[WebHTMLView _changeSpellingToWord:]): Add ERROR(). (-[WebHTMLView ignoreSpelling:]): Add ERROR(). (-[WebTextCompleteController initWithHTMLView:]): (-[WebTextCompleteController dealloc]): (-[WebTextCompleteController _insertMatch:]): Stick the new string into the doc. (-[WebTextCompleteController _buildUI]): Make popup window. (-[WebTextCompleteController _placePopupWindow:]): Position popup window. (-[WebTextCompleteController doCompletion]): Lookup matches, display window. (-[WebTextCompleteController endRevertingChange:moveLeft:]): Bail on complete: session. (-[WebTextCompleteController filterKeyDown:]): Process keys while popup is up. (-[WebTextCompleteController _reflectSelection]): Handle choice in popup. (-[WebTextCompleteController tableAction:]): Handle double click in popup (-[WebTextCompleteController numberOfRowsInTableView:]): Fill table with matches. (-[WebTextCompleteController tableView:objectValueForTableColumn:row:]): Ditto. (-[WebTextCompleteController tableViewSelectionDidChange:]): Handle selection change. * WebView.subproj/WebHTMLViewInternal.h: 2004-08-20 John Sullivan <sullivan@apple.com> * English.lproj/StringsNotToBeLocalized.txt: checked this in; the only difference is that the strings were out of order. 2004-08-19 Richard Williamson <rjw@apple.com> Continue to call old pollForAppletInView: in Tiger until we get an plugin that supports the new API. Reviewed by Chris. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge getAppletInView:]): * WebKit.pbproj/project.pbxproj: === Safari-158 === 2004-08-19 Chris Blumenberg <cblu@apple.com> Fixed typo in comment. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _updateFileDatabase]): 2004-08-19 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3566336> CrashTracer: .2403 crashes at com.apple.WebKit: -[WebFileDatabase performSetObject:forKey:] + 0x94 Reviewed by trey. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _updateFileDatabase]): pass WebFileDatabase copies of the mutable dictionaries or else they may be accessed on a separate thread as the main thread is modifying them 2004-08-18 Richard Williamson <rjw@apple.com> Replace horrible pollForAppletInView: with new webPlugInGetApplet. The details of how the applet instance is provided now belong to the Java team. Yeh. Reviewed by Chris. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge getAppletInView:]): 2004-08-17 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3759093> Need PDF context menu: "Open in Preview" or other external app Added support for "Open with ..." in PDF view. Reviewed by Chris and Trey. * ChangeLog: * English.lproj/Localizable.strings: * English.lproj/StringsNotToBeLocalized.txt: * WebView.subproj/WebPDFView.h: * WebView.subproj/WebPDFView.m: (-[WebPDFView initWithFrame:]): (-[WebPDFView dealloc]): (applicationInfoForMIMEType): (-[WebPDFView path]): (-[WebPDFView menuForEvent:]): (-[WebPDFView setDataSource:]): (-[WebPDFView layout]): (-[WebPDFView viewDidMoveToHostWindow]): (-[WebPDFView openWithFinder:]): 2004-08-17 Richard Williamson <rjw@apple.com> JNI needs both the jmethodID and return type. Changed API to pass both. Reviewed by Chris. * Plugins.subproj/WebJavaPlugIn.h: 2004-08-17 Trey Matteson <trey@apple.com> 3764147 - failure of subframe to load leaves links in parent doc broken Reviewed by Maciej. * WebView.subproj/WebDataSource.m: (-[WebDataSource _receivedMainResourceError:complete:]): Need to call [bridge end] in the case of an error, so WC can clean up. === Safari-157 === 2004-08-15 Richard Williamson <rjw@apple.com> More changes to np headers. Reviewed by Darin. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): * Plugins.subproj/npapi.h: * Plugins.subproj/npfunctions.h: * Plugins.subproj/npruntime.h: 2004-08-13 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed <rdar://problem/3760924> Carbon path passed in NPP_StreamAsFile must be in local character set, not UTF-8 * Plugins.subproj/WebBaseNetscapePluginStream.m: (CarbonPathFromPOSIXPath): Added. New function that uses the path pieces from an FSSpec. This has many advantages; the big one that fixes the bug is that it gives the mangled names that work even for files that have names that can't otherwise be encoded in Carbon-style path names. I didn't write this from scratch: I started with the method in Foundation and just changed it to use FSSpec. (-[WebBaseNetscapePluginStream destroyStream]): Remove code that used NSString and just call CarbonPathFromPOSIXPath instead. * Plugins.subproj/npapi.h: The Revision tag wanted to touch this file. I think we are going to have some trouble with this; I'd like to take that out. * English.lproj/StringsNotToBeLocalized.txt: Updated. 2004-08-12 Trey Matteson <trey@apple.com> 3761329 - query result links all dead in ingrammicro.com (sometimes) 3761328 - links in some docs dead when doc is loaded from WebArchive Nasty problem. It turns out that these result pages are a parent frame with two child frames. One of the child frames is a 1 or 2 byte text document. When the text child is the last doc to complete, because we use a Text rep instead of an HTMLRep, it turns out we never send [bridge end] from WebKit. That mistake results in checkCompleted not being called enough in the part, and we never realize the load is done. WebCore does not allow redirects to happen until the entire load is complete, and the links on this results page are actually little pieces of JS that set location to a generated URL. Since redirects are not allowed these links all silently fail to do anything, and the doc never achieves a completed state where they will work. Solution is to make sure we always call [bridge end] from the DataSource instead of only the HTML rep doing it. Reviewed by Richard and Darin. * WebView.subproj/WebDataSource.m: (-[WebDataSource _finishedLoading]): Call [bridge end] here for all kinds of docs. * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): Don't call is just for HTMLReps. 2004-08-12 Richard Williamson <rjw@apple.com> Bring npruntime.h and friends closer to compliance with latest spec. Reviewed by Maciej. * Plugins.subproj/npapi.h: * Plugins.subproj/npfunctions.h: * Plugins.subproj/npruntime.h: (_NPString::): (_NPString::_NPVariant::): * copy-webcore-files-to-webkit: 2004-08-12 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3761097> should be able to option-drag selection so HTML can be copied within a page Reviewed by rjw. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _isMoveDrag]): new, take into account the option key (-[WebHTMLView draggingUpdatedWithDraggingInfo:actionMask:]): call _isMoveDrag (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): call _isMoveDrag 2004-08-12 Richard Williamson <rjw@apple.com> Quick fix for 3760903. The real fix is described in 3760920. Needed by Java plugin guys so they can be unblocked for feature freeze. Reviewed by Chris. * WebView.subproj/WebFrame.m: (-[WebFrame _reloadForPluginChanges]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addSubview:]): 2004-08-12 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3760898> error pages in subframes attempt to load appledata URLs when reloaded Reviewed by darin. * WebView.subproj/WebFrame.m: (-[WebFrame _createItem:]): when setting the original URL of the history item, use the unreachable URL === Safari-156 === 2004-08-11 Adele Amchan <adele@apple.com> Reviewed by me, bug fix by Darin. - fixed <rdar://problem/3736477> Pages don't load if hard drive is named with non-ASCII Symbol * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]): Use UTF8String instead of cString to convert the MIME type to a C string. Safer, since it can't ever fail due to encoding problems even though this string should always be ASCII. (-[WebBaseNetscapePluginStream destroyStream]): Use stringWithUTF8String to convert the path name to an NSString, since stringWithCString is deprecated (doesn't really matter since the path is always all ASCII). Fix the bug by calling fileSystemRepresentation on the NSString to turn it into a C string form. Even though the POSIX path can't have any non-ASCII characters in it, the Carbon path can, so we need to use this instead of cString which can fail depending on characters and encoding. 2004-08-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. WebKit part of: - made basic marked text highlighting work to complete basic level of <rdar://problem/3704359> input method support not yet implemented for HTML editing * WebView.subproj/WebHTMLView.m: (-[WebHTMLView markedRange]): Use new bridge calls instead of internal marked range storage. (-[WebHTMLView hasMarkedText]): Likewise. (-[WebHTMLView unmarkText]): Likewise. (-[WebHTMLView _selectMarkedText]): Likewise. (-[WebHTMLView _selectRangeInMarkedText:]): Likewise. (-[WebHTMLView _selectionIsInsideMarkedText]): Likewise. (-[WebHTMLView _updateSelectionForInputManager]): Likewise. (-[WebHTMLView setMarkedText:selectedRange:]): Use direct bridge call instead of private _selectMarkedDOMRange: method, which would now be trivial. * WebView.subproj/WebHTMLViewInternal.h: Remove unneeded 2004-08-10 Darin Adler <darin@apple.com> Reviewed by Ken. - change name of WebMakeCollectable to WebNSRetainCFRelease so it fits into the "NS and CF retain counts are separate" mental model, rather than the "think about how garbage collection works" one * Misc.subproj/WebKitNSStringExtras.m: (+[NSString _web_encodingForResource:]): Rename. * Misc.subproj/WebNSObjectExtras.h: (WebNSRetainCFRelease): Ditto. * Misc.subproj/WebNSURLExtras.m: (+[NSURL _web_URLWithData:relativeToURL:]): Ditto. (-[NSURL _web_URLWithLowercasedScheme]): Ditto. 2004-08-09 Trey Matteson <trey@apple.com> 3756599 - REGRESSION: hit assertion in KWQPageState invalidate By inspection I found a flaw in the recently added logic, although I have no steps to repro. My theoretical explanation is that we would get two errors and go through _receivedMainResourceError: twice, which would cause the pageState to be invalidated twice, which is the only way I can see to hit the assert. Reviewed by Darin * WebView.subproj/WebFrame.m: (-[WebFrame _receivedMainResourceError:]): Clear the pageState out of the history item after it's been invalidated by WebCore. 2004-08-09 Richard Williamson <rjw@apple.com> Inspired by Trey we have a much better approach for conditionally linking Quart.framework. Instead of multiple targets we use `` to invoke some inline script to extend COMMON_LDFLAGS as necessary. Thanks Trey! Reviewed by Trey. * WebKit.pbproj/project.pbxproj: 2004-08-09 Trey Matteson <trey@apple.com> Hookup UI for "Continuous Spelling" menu item. Reviewed by Richard. * WebView.subproj/WebView.m: (-[WebView validateUserInterfaceItem:]): Enable and check the menu item to reflect our state. (-[WebView toggleContinuousSpellChecking:]): Change type to IBAction, just cosmetic. * WebView.subproj/WebViewPrivate.h: 2004-08-08 Trey Matteson <trey@apple.com> 3745023 - Safari crashes trying to access anchor while downloading I bet this is behind a few other crashers as well. In this bug the start of the download leaves a KWQPageState hanging around, and when that is freed it damages the part and view. If you're still using that page, you're dead. The fix is to properly invalidate the PageState when we receive an error before reaching WebFrameCommitted state. Normally this happens when a page is reheated from the PageState, but in this case we never manage to leave the page to begin with, although we've already created the PageState. Other errors besides the synthetic one download generates would have caused similar crashing. Another example would be clicking on a second link before the load caused by clicking on the first link reached committed state. Reviewed by Richard * WebView.subproj/WebDataSource.m: (-[WebDataSource _receivedMainResourceError:complete:]): Let the frame do the main work (since it has access to the pageCache state). Also renamed to make it clear that this is about an error for the main resource. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame _receivedMainResourceError:]): Let WC know about the failure, as the DataSource used to, but now pass the pageCache state along too. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:]): Call renamed method. (-[WebMainResourceClient cancelWithError:]): Ditto. 2004-08-08 Vicki Murley <vicki@apple.com> Reviewed by vicki (changes by rjw) - make "weak" linking with Quartz work with buildit * WebKit.pbproj/project.pbxproj: 2004-08-06 Ken Kocienda <kocienda@apple.com> Reviewed by Maciej Finish off spellchecking support to HTML editing. Includes work to enable continuous spellchecking. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge isContinuousSpellCheckingEnabled]): Simple bridge method. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawLineForMisspelling:withWidth:]): New method to add AppKit-style misspelling underline. === Safari-155 === 2004-08-05 Darin Adler <darin@apple.com> * WebView.subproj/WebHTMLView.m: Added a list of methods that NSTextView implements that we don't. All inside #if 0. 2004-08-05 Chris Blumenberg <cblu@apple.com> Fixed unnecessary import of NSURLFileTypeMappings. * WebView.subproj/WebMainResourceClient.m: 2004-08-05 Richard Williamson <rjw@apple.com> Make builds conditionally include -framework Quartz. Reviewed by Chris. * WebKit.pbproj/project.pbxproj: 2004-08-04 Darin Adler <darin@apple.com> - fixed broken Deployment build * Carbon.subproj/HIWebView.m: (Click): Remove code that checks err variable before setting it. 2004-08-03 Richard Williamson <rjw@apple.com> First cut at dirt simple PDF support. This feature depends on Quartz.framework (parent of PDFKit), which only exists on Tiger. So, we "weak" link against Quartz. We do very basic PDF rendering. Coming up are support for "Find..." and linearized PDF (incremental). Linearized PDF support will require API changes in PDFKit. No UI is added to Safari, yet. Reviewed by John. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDataSource.m: (+[WebDataSource _repTypesAllowImageTypeOmission:]): * WebView.subproj/WebFrameView.m: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): * WebView.subproj/WebPDFRepresentation.h: Added. * WebView.subproj/WebPDFRepresentation.m: Added. (-[WebPDFRepresentation finishedLoadingWithDataSource:]): (-[WebPDFRepresentation canProvideDocumentSource]): (-[WebPDFRepresentation documentSource]): (-[WebPDFRepresentation title]): * WebView.subproj/WebPDFView.h: Added. * WebView.subproj/WebPDFView.m: Added. (-[WebPDFView initWithFrame:]): (-[WebPDFView setDataSource:]): (-[WebPDFView dataSourceUpdated:]): (-[WebPDFView setNeedsLayout:]): (-[WebPDFView layout]): (-[WebPDFView viewWillMoveToHostWindow:]): (-[WebPDFView viewDidMoveToHostWindow]): Copied fix from Jaguar carbon/cocoa work. Reviewed by Darin (Jaguar version) * Carbon.subproj/CarbonWindowAdapter.h: * Carbon.subproj/CarbonWindowAdapter.m: (-[CarbonWindowAdapter relinquishFocus]): * Carbon.subproj/HIWebView.m: (Click): (OwningWindowChanged): (WindowHandler): 2004-08-03 David Hyatt <hyatt@apple.com> Add the text/xsl MIME type as one that can be displayed. Reviewed by john * WebView.subproj/WebDataSource.m: (+[WebDataSource _repTypesAllowImageTypeOmission:]): * WebView.subproj/WebFrameView.m: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): 2004-08-03 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. - implemented enough of the NSTextInput protocol and added the proper calls to NSInputManager to allow input methods to work. However, the text is not marked yet. * WebView.subproj/WebHTMLViewInternal.h: Added new fields to track marked range. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView markedRange]): Implemented (-[WebHTMLView conversationIdentifier]): Implemented (-[WebHTMLView hasMarkedText]): Implemented (-[WebHTMLView unmarkText]): Implemented (-[WebHTMLView setMarkedText:selectedRange:]): Implemented - does not yet handle attributes in attributed strings (-[WebHTMLView insertText:]): Modified to handle replacing or abandoning the marked text when set. (-[WebHTMLView _selectMarkedText]): new helper method, self-explanatory (-[WebHTMLView _setMarkedDOMRange:]): hitto. (-[WebHTMLView _selectRangeInMarkedText:]): ditto (-[WebHTMLView _discardMarkedText]): ditto (-[WebHTMLView _selectionIsInsideMarkedText]): ditto (-[WebHTMLView _updateSelectionForInputManager]): ditto - did a bit of refactoring while I was in here. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _shouldReplaceSelectionWithText:givenAction:]): added this new helper method to simplify the common case of calling the shouldInsertText: delegate (-[WebHTMLView pasteAsPlainText:]): use it (-[WebHTMLView insertTab:]): ditto (-[WebHTMLView insertNewline:]): ditto (-[WebHTMLView _changeWordCaseWithSelector:]): ditto (-[WebHTMLView _changeSpellingToWord:]): ditto (-[WebHTMLView _selectionChanged]): ditto 2004-08-03 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3572737> Images not resizing at www.bmx-test.com (spoof nofix) Reviewed by darin. * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory supportedMIMETypes]): hard code image/pjpeg to the list of image mime types that we can handle 2004-08-03 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed <rdar://problem/3740937> ER: A way to turn a DOMRange into text (equivalent of -innerText) * DOM.subproj/DOMPrivate.h: Added. * WebKit.pbproj/project.pbxproj: Added DOMPrivate.h. * copy-webcore-files-to-webkit: Added DOMPrivate.h. 2004-08-02 John Sullivan <sullivan@apple.com> Reviewed by Darin. WebKit part of fix for <rdar://problem/3631868> NSToolbar adoption: Tab key should cycle around toolbar and page content * WebView.subproj/WebHTMLView.m: removed overrides of nextKeyView and previousKeyView (-[WebHTMLView nextValidKeyView]): call super only if we can't move the focus within the frame hierarchy (-[WebHTMLView previousValidKeyView]): ditto * WebView.subproj/WebHTMLViewInternal.h: removed nextKeyViewAccessShouldMoveFocus ivar 2004-08-02 Ken Kocienda <kocienda@apple.com> Reviewed by John Update name of firstResponderIsSelfOrDescendantView, adding _web_ prefix to this SPI call. Do some work to make caret blinking in newly-created editable WebView's that are similar in structure to Blot more "automatic". * Misc.subproj/WebNSViewExtras.h: Change name of firstResponderIsSelfOrDescendantView. Add _web_ prefix. * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_firstResponderIsSelfOrDescendantView]): Name change. (-[NSView _web_firstResponderCausesFocusDisplay]): Adds an additional check for whether the view's is first responder. This helps to make the focus setting in viewDidMoveToWindow work right. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView updateFocusDisplay]): Use _web_firstResponderCausesFocusDisplay now instead of firstResponderIsSelfOrDescendantView. (-[WebHTMLView viewDidMoveToWindow]): Schedule call to updateFocusDisplay for the next crank of the run loop. The reason is that placing the caret in the just-installed view requires the HTML/XML document to be available on the WebCore side, but it is not at the time this code is running. However, it will be there on the next crank of the run loop. Doing this helps to make a blinking caret appear in a new, empty window "automatic". (-[WebHTMLView performKeyEquivalent:]): _web_firstResponderIsSelfOrDescendantView name change. * WebView.subproj/WebView.m: (-[WebView _performResponderOperation:with:]): _web_firstResponderIsSelfOrDescendantView name change. 2004-07-29 Maciej Stachowiak <mjs@apple.com> Reviewed by John. Added stubbed-out versions of all the NSTextInput protocol methods, and put comments in places where we will need to call the input manager to make input methods work 100%. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge respondToChangedSelection]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDown:]): (-[WebHTMLView mouseDragged:]): (-[WebHTMLView mouseUp:]): (-[WebHTMLView _interceptEditingKeyEvent:]): (-[WebHTMLView keyDown:]): (-[WebHTMLView _selectionChanged]): (-[WebHTMLView _delegateDragSourceActionMask]): (-[WebHTMLView validAttributesForMarkedText]): (-[WebHTMLView characterIndexForPoint:]): (-[WebHTMLView firstRectForCharacterRange:]): (-[WebHTMLView selectedRange]): (-[WebHTMLView markedRange]): (-[WebHTMLView attributedSubstringFromRange:]): (-[WebHTMLView conversationIdentifier]): (-[WebHTMLView hasMarkedText]): (-[WebHTMLView unmarkText]): (-[WebHTMLView setMarkedText:selectedRange:]): (-[WebHTMLView doCommandBySelector:]): (-[WebHTMLView insertText:]): * WebView.subproj/WebHTMLViewInternal.h: * WebView.subproj/WebView.m: === Safari-154 === 2004-07-29 Darin Adler <darin@apple.com> Reviewed by Ken. - fill in some unimplemented methods * WebView.subproj/WebHTMLView.m: (-[WebHTMLView moveToBeginningOfDocument:]): Implement, using new document granularity. (-[WebHTMLView moveToBeginningOfDocumentAndModifySelection:]): Ditto. (-[WebHTMLView moveToBeginningOfParagraph:]): Implement, even though the underlying WebCore code is not yet implemented. (-[WebHTMLView moveToBeginningOfParagraphAndModifySelection:]): Ditto. (-[WebHTMLView moveToEndOfDocument:]): More of the same. (-[WebHTMLView moveToEndOfDocumentAndModifySelection:]): Ditto. (-[WebHTMLView moveToEndOfParagraph:]): More of the same. (-[WebHTMLView moveToEndOfParagraphAndModifySelection:]): Ditto. (-[WebHTMLView pageDown:]): Added comment describing desired behavior. (-[WebHTMLView pageUp:]): Ditto. (-[WebHTMLView copyFont:]): Ditto. (-[WebHTMLView pasteFont:]): Ditto. (-[WebHTMLView changeAttributes:]): Ditto. (-[WebHTMLView indent:]): Ditto. 2004-07-28 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3737864> Can not download image from web by using drag and drop Reviewed by john. * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_declareAndWriteDragImage:URL:title:archive:source:]): On Tiger, to use NSFilesPromisePboardType with other pasteboard types, set the file types of the promise on the pasteboard as a property list instead of mucking with the NSFilePromiseDragSource class 2004-07-28 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - avoid triggering an assertion when using dead keys (like option-e) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView insertText:]): Don't pass zero-length strings to WebCore. Dead-key input seems to insert empty strings as a side effect. 2004-07-28 Trey Matteson <trey@apple.com> Spellchecking, Part I. Basic spellcheck is working. Spelling panel is hooked up. At this point, no special marking of misspellings, no grammar check, no context menu integration, no "check continually" mode. Reviewed by Ken. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge spellCheckerDocumentTag]): Typical bridge glue. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView validateUserInterfaceItem:]): Validate various spelling actions. (-[WebHTMLView checkSpelling:]): Call WC for real work, update panel. (-[WebHTMLView showGuessPanel:]): Show panel, call WC for real work. (-[WebHTMLView _changeSpellingToWord:]): Apply correction to our doc. (-[WebHTMLView changeSpelling:]): Simple pass through to above method. (-[WebHTMLView ignoreSpelling:]): Tell checker to ignore the word. * WebView.subproj/WebView.m: (-[WebView _close]): Call AK's closeSpellDocumentWithTag: for proper cleanup. 2004-07-27 John Sullivan <sullivan@apple.com> Reviewed by Trey. WebKit part of fix for <rdar://problem/3622268> Reload failed pages when a network problem is corrected, inc. using Network Diagnostics * WebView.subproj/WebFrame.m: (-[WebFrame reload]): This method did not handle unreachableURLs at all. The reason Safari's Reload did work with unreachableURLs was that Safari does "reloadObeyingLocationField" which never actually calls -[WebFrame reload]. Fixed by creating a fresh request for the previously-unreachable URL. 2004-07-26 Richard Williamson <rjw@apple.com> Fixed 3739737. When setting the focus to a NSView, set the focus carbon focus to kControlIndicatorPart. kControlIndicatorPart is a placeholder value for use to indicate that Cocoa has the focus. Reviewed by Ken. * Carbon.subproj/CarbonWindowAdapter.m: (-[CarbonWindowAdapter makeFirstResponder:]): * Carbon.subproj/HIWebView.m: (Click): (SetFocusPart): 2004-07-26 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3689734> dragging to an editable WebView does not scroll document Reviewed by rjw. * WebView.subproj/WebView.m: (-[WebView documentViewAtWindowPoint:]): new, factored from draggingDocumentViewAtWindowPoint: (-[WebView _draggingDocumentViewAtWindowPoint:]): call documentViewAtWindowPoint: (-[WebView _autoscrollForDraggingInfo:timeDelta:]): forward call to the document view (-[WebView _shouldAutoscrollForDraggingInfo:]): ditto === Safari-153 === 2004-07-23 Ken Kocienda <kocienda@apple.com> Reviewed by Trey Fix for this bug: <rdar://problem/3738920> Caret blinks in inactive window As part of the fix, I cleaned up the way we handle special drawing that needs to be done in the HTML view that is first responder in the key window (e.g the drawing of text selection highlight and caret blinking). * WebView.subproj/WebHTMLView.m: (-[WebHTMLView updateFocusDisplay]): New method that centralizes the changes we need to make when the first responder-ness of the view or key-ness of the window changes. (-[WebHTMLView viewDidMoveToWindow]): Call new updateFocusDisplay helper. (-[WebHTMLView windowDidBecomeKey:]): Ditto. (-[WebHTMLView windowDidResignKey:]): Ditto. (-[WebHTMLView becomeFirstResponder]): Ditto. (-[WebHTMLView resignFirstResponder]): Ditto. 2004-07-22 Darin Adler <darin@apple.com> * Plugins.subproj/npruntime.h: Update with new version from newer JavaScriptCore. 2004-07-21 Ken Kocienda <kocienda@apple.com> Reviewed by Trey * WebCoreSupport.subproj/WebBridge.m: Remove interceptEditingKeyEvent bridge call over. This method of handling editing key events is now obsolete. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView performKeyEquivalent:]): Send key event over to the DOM if this view is or contains the first responder. This now happens unconditionally. (-[WebHTMLView keyDown:]): Send key event to the DOM, then see if the web view wants to interpret it an an editing key event. This is the new place to intercept key events for editing. 2004-07-21 Ken Kocienda <kocienda@apple.com> Reviewed by John Add implementations for these methods. Formerly, they logged an error. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView moveToBeginningOfLine:]): (-[WebHTMLView moveToBeginningOfLineAndModifySelection:]): (-[WebHTMLView moveToEndOfLine:]): (-[WebHTMLView moveToEndOfLineAndModifySelection:]): 2004-07-21 Ken Kocienda <kocienda@apple.com> Reviewed by John Added some more handlers for standard Cocoa key bindings. These are "secrets" of NSText, meaning they are not public API, but we choose to mimic. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView moveToBeginningOfDocumentAndModifySelection:]): (-[WebHTMLView moveToBeginningOfLineAndModifySelection:]): (-[WebHTMLView moveToBeginningOfParagraphAndModifySelection:]): (-[WebHTMLView moveToEndOfDocumentAndModifySelection:]): (-[WebHTMLView moveToEndOfLineAndModifySelection:]): (-[WebHTMLView moveToEndOfParagraph:]): (-[WebHTMLView moveToEndOfParagraphAndModifySelection:]): * WebView.subproj/WebView.h: Add these declarations to the comment in the header listing the responder-like methods we support. * WebView.subproj/WebView.m: (-[WebView moveToBeginningOfParagraphAndModifySelection:]): (-[WebView moveToEndOfParagraphAndModifySelection:]): (-[WebView moveToBeginningOfLineAndModifySelection:]): (-[WebView moveToEndOfLineAndModifySelection:]): (-[WebView moveToBeginningOfDocumentAndModifySelection:]): (-[WebView moveToEndOfDocumentAndModifySelection:]): 2004-07-20 Ken Kocienda <kocienda@apple.com> Reviewed by Richard * Misc.subproj/WebNSEventExtras.h: Added helper that returns whether a key event has a binding in the key binding manager. * Misc.subproj/WebNSEventExtras.m: (-[NSEvent _web_keyBindingManagerHasBinding]): New helper mentioned above. * Plugins.subproj/npruntime.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView performKeyEquivalent:]): Add a check of whether the key event has a binding in the key binding manager. This works around the fact that NSResponder's interpretKeyEvents does not return a value telling whether or not the key was handled. This now makes it possible for us to trap modified key events we know we can handle (like those command-key + arrow events used for text navigation), while letting all others pass. 2004-07-20 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3580589> REGRESSION (1.1-1.2): can't open a new window for an image that has not loaded <rdar://problem/3612691> Missing image icons (blue ?) lack context menu Reviewed by john. * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): if there is no image, but there is an image URL, provide image context menu items besides "Copy Image" * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): don't drag an image with an actual image (-[WebHTMLView _mayStartDragAtEventLocation:]): ditto 2004-07-20 Maciej Stachowiak <mjs@apple.com> Reviewed by Chris. <rdar://problem/3721690> REGRESSION (125.7-148u) clicking on links at macosx.apple.com/Builds does not load new page in frame * Plugins.subproj/npruntime.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge canTargetLoadInFrame:]): Don't apply the restrictions to frames that are in the same window (Mozilla does this too). 2004-07-20 Richard Williamson <rjw@apple.com> Fix for 3728558. Fixed the key event handling in the carbon/cocoa integration code. This does not fix the arrow keys not working on initial focus problem also mentioned in the bug. Bumped the version of the NP function structures. Reviewed by John. * Carbon.subproj/CarbonUtils.m: (WebInitForCarbon): (PoolCleaner): * Carbon.subproj/HIWebView.m: (OwningWindowChanged): (WindowHandler): * Plugins.subproj/npapi.h: 2004-07-20 Trey Matteson <trey@apple.com> 3733698 REGRESSION: sometimes dragging photos on homepage.mac.com leads to an assertion Relax an assertion, as we ran into a valid case where it's not true. Reviewed by Chris. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): Removing this assert allows for the oddball case of a drag gesture that starts on one element, but then the element is no longer there when the drag is about to start. 2004-07-20 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt Fix for this bug: <rdar://problem/3707505> HTMLCompose: blinking cursor in both an address text field and the message body * WebView.subproj/WebHTMLView.m: (-[WebHTMLView setCaretVisible:]): New helper. Calls over bridge to do the work. (-[WebHTMLView windowDidBecomeKey:]): This function cannot just assume that self is first responder (and do things like adjusting text background color and restoring focus rings). First-responder-ness needs to be checked first. Now it is. (-[WebHTMLView windowDidResignKey:]): Ditto. (-[WebHTMLView becomeFirstResponder]): Call new helper to make caret visible. (-[WebHTMLView resignFirstResponder]): Call new helper to make caret invisible. 2004-07-12 Richard Williamson <rjw@apple.com> Fixed 3721917. The RealPlayer plugin doesn't support the new NPPVpluginScriptableNPObject variable passed to NPP_GetValue and incorrectly returns NPERR_NO_ERROR. We interpret this to the mean the variable has been set. The variable has not been set and will consequently be uninitialized. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView pluginScriptableObject]): 2004-07-19 Ken Kocienda <kocienda@apple.com> Reviewed by Richard Fix for this bug: <rdar://problem/3707504> HTMLCompose: key events are stolen by Web(HTML)View * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView firstResponderIsSelfOrDescendantView]): New helper to (-[WebHTMLView performKeyEquivalent:]): Do not pass key events through to the editing key handler unless the WebHTMLView is first responder or contains the first responder. This prevents the "stealing" of key events mentioned in the bug. * WebView.subproj/WebView.m: (-[WebView _performResponderOperation:with:]): Uses the new firstResponderIsSelfOrDescendantView helper. The code I replaced used the same logic as the new helper. === Safari-152 === 2004-07-12 Maciej Stachowiak <mjs@apple.com> Reviewed by Kevin. <rdar://problem/3673988>: (REGRESSION(141-144): connection assertion failure at http://traffic.511.org/sfgate) * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): Don't check connection consistency if this load got cancelled while finishing, because in this case we have cleared the connection field already. This can happen when a redirect fires from an onload handler. 2004-07-12 Maciej Stachowiak <mjs@apple.com> Reviewed by John. <rdar://problem/3632570>: (REGRESSION: SocialText.net wiki keeps asking for auth, even though pages load) * Misc.subproj/WebIconLoader.m: (-[WebIconLoader didReceiveAuthenticationChallenge:]): Ignore the challenge - we don't want an auth panel for favicons. (-[WebIconLoader didCancelAuthenticationChallenge:]): Ignore cancel, since we are ignoring the challenge. 2004-07-09 Chris Blumenberg <cblu@apple.com> Allowed my change for 3715785 to compile on Jaguar. Reviewed by kocienda. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge canTargetLoadInFrame:]): don't use the DOM API since it doesn't exist on Jaguar, instead call the new domain method on the bridge 2004-07-09 Ken Kocienda <kocienda@apple.com> Reviewed by John * Plugins.subproj/npruntime.h: Updated license to lawyer-approved joint Apple-Mozilla BSD-style license. 2004-07-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3720728> REGRESSION (125.8-146): Crash moving mouse over plugin at manray-photo.com Reviewed by john. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView pluginScriptableObject]): don't call NPP_GetValue unless the plug-in implements it 2004-07-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3706296> VIP: ifilm.com crashing reproducibly with Safari Reviewed by kocienda. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage launchRealPlayer]): don't release a NULL appURL 2004-07-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3650140> reproducible assertion failure going to plugin page with JavaScript disabled Reviewed by john. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): don't call NPP_NewStream and other stream methods if there is no JS result to deliver. This is what Mozilla does. (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): Return NPERR_GENERIC_ERROR if JS is disabled. This is what Mozilla does. === Safari-151 === 2004-07-07 Trey Matteson <trey@apple.com> 3719051 - Safari doesn't update form inputs when a page was refreshed by javascript window.location ... and at least 5 other cases in Radar Very similar problem to the Harvard PIN bug. We need to be sure to not carry any state over when we are processing a client redirect, which reuses the same WebHistoryItem. Reviewed by John. * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): Comment (-[WebFrame _opened]): Clear form and scroll state on client redirect. 2004-07-06 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3715785> multiple frame injection vulnerability reported by Secunia, affects almost all browsers Reviewed by john, trey, kocienda. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge canTargetLoadInFrame:]): new method, return YES if the requesting frame is local, the target frame is an entire window or if the domain of the parent of the targeted frame equals this domain (-[WebBridge loadURL:referrer:reload:userGesture:target:triggeringEvent:form:formValues:]): call canTargetLoadInFrame: to make sure we can load the request (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): ditto 2004-07-06 John Sullivan <sullivan@apple.com> Reviewed by Trey. - fixed <rdar://problem/3717147> folder icon used for error page in back/forward menu when iTunes is not installed * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): When displaying the error page for an unreachable URL, leave the requested URL in the WebHistoryItem; don't clobber it with a bogus one that represents the error page. This not only avoids the wrong-icon problem, but should also help in cases where an unreachable URL becomes reachable later on. 2004-07-06 Trey Matteson <trey@apple.com> 3716053 - www.theage.com.au has extra back/forward items due to ads The real change was in WebKit. Here was are just renaming a method and folding all the WebFrameLoadTypeOnLoadEvent uses to be WebFrameLoadTypeInternal, since there was never any difference anyway. Reviewed by Richard * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:referrer:reload:userGesture:target:triggeringEvent:form:formValues:]): rename part of the method. * WebView.subproj/WebFrame.m: Nuke WebFrameLoadTypeOnLoadEvent. (-[WebFrame _transitionToCommitted:]): (-[WebFrame _checkLoadCompleteForThisFrame]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _itemForRestoringDocState]): * WebView.subproj/WebFramePrivate.h: 2004-07-06 Ken Kocienda <kocienda@apple.com> Reviewed by Trey Only register the editing delegate for those notifications for which it implements the callbacks. * WebView.subproj/WebView.m: (-[WebView registerForEditingDelegateNotification:selector:]): (-[WebView setEditingDelegate:]): 2004-07-06 Trey Matteson <trey@apple.com> 3294652 - Failed drag of links doesn't slide back The only reason for this is that because of some hacks, we lie to AK about the drag image offset, which means we slide back to slightly the wrong place. But it's very minor, so we should just fix it. Reviewed by Ken. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): Ask for slideback. 2004-07-02 Darin Adler <darin@apple.com> Reviewed by Dave. - fixed problem where tabsToLinks and privateBrowsingEnabled did not work with non- standard WebPreferences objects * WebView.subproj/WebPreferences.m: (-[WebPreferences _valueForKey:]): New helper. (-[WebPreferences _stringValueForKey:]): Use _valueForKey. (-[WebPreferences _integerValueForKey:]): Use _valueForKey. (-[WebPreferences _boolValueForKey:]): Use _valueForKey. (-[WebPreferences tabsToLinks]): Use _boolValueForKey; this is the bug fix. (-[WebPreferences privateBrowsingEnabled]): Ditto. (+[WebPreferences _setIBCreatorID:]): Use copy instead of retain for keeping an NSString. 2004-07-01 Trey Matteson <trey@apple.com> 3556159 - Crashes in -[WebFrame(WebPrivate) _transitionToCommitted:] at www.mastercardbusiness.com We know from the line number of the crash that it is due to [self parentFrame]==nil. Looking at the HTML and that of the related bugs, they do special stuff with onload handlers. It is no longer repro, presumably because the includes JS files changed, as the bugs only included the top level HTML. I suspect that the problem is that the WebFrameLoadTypeOnLoadEvent case was added, and in some weird sequence specific to MasterCard, they hit a case where we would be in WebFrameLoadTypeOnLoadEvent mode but not have a parent frame. So we guard in the code against hitting a nil parentFrame, and log an error just in case this ever crops up again and we can learn more about it. Reviewed by Richard. * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): Guard against nil parentFrame. 2004-07-01 John Sullivan <sullivan@apple.com> Reviewed by Trey. - fixed these bugs: <rdar://problem/3709110> REGRESSION (Tiger): Pressing Tab key to move focus onto links skips every other link <rdar://problem/3692576> focus ring is in odd place after clicking RSS button with "Tab to links" enabled WebHTMLView has some trickery by which we advance the focused link when nextKeyView or previousKeyView is called within nextValidKeyView or previousValidKeyView. This broke in Tiger because AppKit now (sometimes at least) calls nextKeyView more than once within nextValidKeyView. Fixed 3709110 by making sure we only advance the focus once within a call to nextValidKeyView or previousValidKeyView. Also, this same trickery didn't work right with hidden views. Fixed 3692576 by checking whether the view is hidden and bypassing the focus-moving trickery in that case. * WebView.subproj/WebHTMLViewInternal.h: renamed inNextValidKeyView -> nextKeyViewAccessShouldMoveFocus * WebView.subproj/WebHTMLView.m: (-[WebHTMLView nextKeyView]): now clears nextKeyViewAccessShouldMoveFocus (-[WebHTMLView previousKeyView]): ditto (-[WebHTMLView nextValidKeyView]): now doesn't set focus-moving trigger ivar if view is hidden or has hidden ancestor (-[WebHTMLView previousValidKeyView]): ditto 2004-06-30 Trey Matteson <trey@apple.com> Dragging within a web view should be allowed to start when the window isn't key. A few months ago, Chris made this work, but it relied on the fact that all dragging was done in WebKit. When WebCore got involved in dragging, it was broken. Now we have a new scheme that gets it working again that properly involves WebCore. The general idea is that when AK asks us whether to accept the first mouse and do "delayed window ordering", we must consult WC to see if we might start a drag. In addition, instead of these drags in non-active windows being started as a special case in WK, they go through the normal WK-WC drag machinery. Finally to work in frames we have to drill to the deepest hit view in acceptsFirstMouse, because previous hacks to hitTest make the top-most WebHTMLView field all events for its view tree (which leads to it fielding all acceptFirstMouse messages too). Reviewed by John. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge mayStartDragAtEventLocation:]): Glue change for new arg type. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): firstMouseDownEvent ivar is no longer needed. (-[WebHTMLView _mayStartDragAtEventLocation:]): Receives a location instead of a drag event, since we need to do this work when we have no drag event. This means the check of the delay for text dragging is moved down to WebCore. (-[WebHTMLView acceptsFirstMouse:]): Respond based on whether we might do a drag. This includes drilling to the deepest view the event hits, whereas we used to only respond considering the topmost WebHTMLView. (-[WebHTMLView shouldDelayWindowOrderingForEvent:]): Ditto. (-[WebHTMLView mouseDown:]): Get rid of special case where some activating mouseDown events weren't sent to WC. We need to go through the whole pipeline now to get a drag started properly. (-[WebHTMLView mouseDragged:]): Ditto, let WC start the drag. (-[WebHTMLView mouseUp:]): firstMouseDownEvent ivar is no longer needed. * WebView.subproj/WebHTMLViewInternal.h: * WebView.subproj/WebHTMLViewPrivate.h: 2004-06-25 Trey Matteson <trey@apple.com> Added new utility method. Reviewed by John. * WebView.subproj/WebFrame.m: (-[WebFrame _isDescendantOfFrame:]): New code. * WebView.subproj/WebFramePrivate.h: 2004-06-24 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3710313>: CGContext not zeroed when WebImageRenderer is copied The context ivar of WebImageRenderer wasn't being nil when the object was copied. Reviewed by Darin. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer copyWithZone:]): (-[WebImageRenderer dealloc]): (-[WebImageRenderer drawImageInRect:fromRect:compositeOperator:context:]): 2004-06-24 Trey Matteson <trey@apple.com> 3672725 - Assertion failure in URLCompletion code with particular set of bookmarks Problem was caused by a URL with unescaped unicodes getting into the Bookmarks file, presumably from import from IE. We now test for this case and convert the data on the way in as if it were user-entered. Reviewed by John and Darin. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem initFromDictionaryRepresentation:]): 2004-06-24 Trey Matteson <trey@apple.com> 3704950 drag image in DB ConfigBar has horizontal graphics turd WebCore JavaScript When we generate a drag image (or a selection image too, for that matter) we translate the CTM using a CG call. Later, WebImageRenderer adjusts the pattern phase based on the CTM of the focused view, which doesn't include our translate. So we must inform WebKit about the additional phase adjustment. Reviewed by Richard * WebCoreSupport.subproj/WebGraphicsBridge.h: * WebCoreSupport.subproj/WebGraphicsBridge.m: (-[WebGraphicsBridge setAdditionalPatternPhase:]): New trivial setter. (-[WebGraphicsBridge additionalPatternPhase]): ...and getter. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer tileInRect:fromPoint:context:]): Take any additional phase adjustment into account when setting phase. 2004-06-24 Trey Matteson <trey@apple.com> 3693420 - onbeforecut and onbeforepaste need real implementaion Reviewed by Chris. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView validateUserInterfaceItem:]): Check with WebCore to see if cut, copy, paste should be enabled. 2004-06-24 John Sullivan <sullivan@apple.com> Reviewed by Darin. - fixed <rdar://problem/3706792> 8A161: Choosing text encoding for error page opens finder window!? * WebView.subproj/WebFrame.m: (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]): take unreachableURL into account 2004-06-23 Richard Williamson <rjw@apple.com> Implemented changes for latest npruntime.h. Made npruntime.h public. Reviewed by Chris. * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView pluginScriptableObject]): (-[WebBaseNetscapePluginView forceRedraw]): (-[WebBaseNetscapePluginView getVariable:value:]): * Plugins.subproj/WebBaseNetscapePluginViewPrivate.h: * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): * Plugins.subproj/npapi.h: * Plugins.subproj/npapi.m: (NPN_GetValue): * Plugins.subproj/npfunctions.h: * Plugins.subproj/npruntime.h: * WebKit.pbproj/project.pbxproj: 2004-06-21 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2004-06-21 Chris Blumenberg <cblu@apple.com> Made WebKitErrorDescriptionPlugInCancelledConnection have its own description string (Not for software update branch) Reviewed by john. * English.lproj/Localizable.strings: * Misc.subproj/WebKitErrors.m: 2004-06-21 Chris Blumenberg <cblu@apple.com> Made WebKitErrorDescriptionPlugInCancelledConnection properly reuse an already localized string to avoid loc changes. Reviewed by john. * ChangeLog: * Misc.subproj/WebKitErrors.m: 2004-06-21 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3701269> change in error handling behavior from 10.3.3 to 10.3.4 breaks unreleased Adobe PDF plug-in Reviewed by john. * Misc.subproj/WebKitErrors.m: (registerErrors): register string for WebKitErrorPlugInCancelledConnection * Misc.subproj/WebKitErrorsPrivate.h: * Plugins.subproj/WebBaseNetscapePluginStream.h: * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]): use renamed WEB_REASON_PLUGIN_CANCELLED constant (-[WebBaseNetscapePluginStream destroyStream]): ditto * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation cancelWithReason:]): if the reason is WEB_REASON_PLUGIN_CANCELLED, cancel the load with WebKitErrorPlugInCancelledConnection * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream cancelWithReason:]): ditto === Safari-146 === 2004-06-17 Richard Williamson <rjw@apple.com> Changed private headers to be pubic for npapi.h and npfunctions.h. That API was approved but never marked as public in the project file. This change does not make npruntime.h public, which contains the not yet approved changes for script-ability of netscape plugins. Unfortunately, that API will not be public for WWDC. Reviewed by Chris. * WebKit.pbproj/project.pbxproj: 2004-06-17 Trey Matteson <trey@apple.com> 3698514 - coordinates in ondragstart and ondrag events are wrong This part fixes the ondrag coords. I thought Cocoa passed us the mouse location in draggedImage:movedTo:, but no, it's the position of the dragged image. WebCore needs the mouse location, so to calc that we must save away the offset of the mouse relative to the image when we kick off the drag. Reviewed by Maciej. * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragImage:rect:event:pasteboard:source:offset:]): Add the ability to return the offset of the cursor wrt to the drag image, since this routine generates its own drag image and positions it. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): Calc the offset of the cursor wrt to the drag image in the myriad of ways that we kick off the drag. (-[WebHTMLView draggedImage:movedTo:]): Adjust the location by the offset we save when we kicked off the drag. (-[WebHTMLView draggedImage:endedAt:operation:]): Ditto. * WebView.subproj/WebHTMLViewInternal.h: * WebView.subproj/WebImageView.m: (-[WebImageView mouseDragged:]): Pass nil for new arg, we don't care. 2004-06-16 David Hyatt <hyatt@apple.com> In order to support truncation in Emerson, enhance pointToOffset so that it needn't include partial character glyphs (the left half of a glyph). Reviewed by mjs * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer pointToOffset:style:position:reversed:includePartialGlyphs:]): (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:includePartialGlyphs:]): (-[WebTextRenderer _CG_pointToOffset:style:position:reversed:includePartialGlyphs:]): === Safari-145 === 2004-06-16 Darin Adler <darin@apple.com> - fixed <rdar://problem/3696081> REGRESSION: <WebKit/CarbonUtils.h> doesn't build any more Reviewed by Trey. * Carbon.subproj/CarbonUtils.h: Fixed include. Need to include <ApplicationServices/ApplicationServices.h> to get CGImageRef; can't include an individual header. 2004-06-15 Richard Williamson <rjw@apple.com> Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous Flip the policy for exposing Objective-C methods and properties. Reviewed by Trey. * Plugins.subproj/WebPluginPackage.m: (+[NSObject isSelectorExcludedFromWebScript:]): Just return YES. (+[NSObject isKeyExcludedFromWebScript:]): Just return YES. 2004-06-15 Trey Matteson <trey@apple.com> 3639321 - Harvard PIN authentication ends up sending PIN as clear text with POST action When going back/forward to an item, if we went there originally via a POST, we ask the user about rePOSTing, and if they say yes, we resend the POST. This rePOST case is triggered by the form data that we saved on the b/f item. In the case of this bug, the overall navigation was accomplished by a POST, then a redirect, causing a GET. When a load of type redirect achieves the Committed stage, we replace the current URL in the b/f item with the new URL (instead of adding a new item to the b/f list). The bug is that at the same time we should also update the form data in the b/f item to match that of the new request. I think this will normally mean nil'ing it out, unless there's some way for the result of the redirect to be another POST. The security leak occurred because we did not clear the form data on the item, so when going back or forward to the page, we would go into the rePOSTing code, even though we eventually reached that page via a GET (caused by the redirect). So we would do a POST to the redirect URL containing the private data sent in the original POST. Reviewed by mjs and rjw. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem _setFormInfoFromRequest:]): New method, just wraps 3 old set methods. (-[WebHistoryItem formData]): Diff being dumb, no change. (-[WebHistoryItem formContentType]): Ditto (-[WebHistoryItem formReferrer]): Ditto * History.subproj/WebHistoryItemPrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame _createItem:]): Call new WebHistoryItem method - no change in real behavior (-[WebFrame _transitionToCommitted:]): Clear out the form data at the key time, to fix the bug. 2004-06-15 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3695724> WebKit plug-ins should only have to implement plugInViewWithArguments: Reviewed by rjw. * ChangeLog: * Plugins.subproj/WebPluginViewFactory.h: mention that plugInViewWithArguments is required * WebView.subproj/WebFrame.m: (-[WebFrame _reloadForPluginChanges]): check for plugInViewWithArguments: not webPlugInInitialize * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addSubview:]): ditto 2004-06-15 Trey Matteson <trey@apple.com> 3695240 - pasting plain text with newlines in it turns them into spaces Easy fix, we just need to consume the incoming data as text instead of markup. Reviewed by John and Darin. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:]): 2004-06-15 Darin Adler <darin@apple.com> - fixed crash introduced by my earlier change * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageContext dealloc]): Set _cgsContext to 0 before calling super as before. (-[WebImageContext finalize]): Ditto. 2004-06-14 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed some things for GC that Patrick missed, or that happened after the branch * Carbon.subproj/HIWebView.m: (HIWebViewConstructor): Use CFRetain instead of retain. (HIWebViewDestructor): Use CFRelease instead of release. * Misc.subproj/WebFileDatabase.m: (-[WebFileDatabase initWithPath:]): Use release instead of dealloc. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageContext finalize]): Had [super dealloc] here by mistake; change to [super finalize]. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer finalize]): Added. * WebView.subproj/WebDebugDOMNode.m: (-[WebDebugDOMNode initWithWebFrameView:]): Use release instead of dealloc. * WebView.subproj/WebRenderNode.m: (-[WebRenderNode initWithWebFrameView:]): Use release instead of dealloc. 2004-06-15 Trey Matteson <trey@apple.com> Fix ASSERT/crash we get sometimes when dragging link images. Turns out there was an uninitialized variable for the image size, so at random we would try to create huge images that could not be focused. Reviewed by Maciej and Darin. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _dragImageForLinkElement:]): Trivial fix to not use += with uninited variable. 2004-06-14 Darin Adler <darin@apple.com> Reviewed by me, code changes by Patrick Beard. - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled) * WebKit.pbproj/project.pbxproj: Added WebNSObjectExtras.h. * Misc.subproj/WebNSObjectExtras.h: Added. Includes WebMakeCollectable, a cover for CFMakeCollectable that returns type id, for less casting, and works on Panther as well as Tiger. Also declares finalize in NSObject so we can call super without warnings on Panther. * Carbon.subproj/CarbonWindowAdapter.m: Fixed header and includes a bit. (-[CarbonWindowAdapter finalize]): Added. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList dealloc]): Got count outside loop. (-[WebBackForwardList finalize]): Added. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem finalize]): Added. * Misc.subproj/WebFileDatabase.m: (-[WebFileDatabase _createLRUList:]): Use release on Panther, drain on Tiger. (+[WebFileDatabase _syncLoop:]): Ditto. (-[WebFileDatabase dealloc]): Removed, since we never deallocate objects of this class, and the method was untested. * Misc.subproj/WebKitErrors.m: (registerErrors): Use release on Panther, drain on Tiger. * Misc.subproj/WebKitNSStringExtras.m: (+[NSString _web_encodingForResource:]): Use WebMakeCollectable. Also fixed indenting. * Misc.subproj/WebNSURLExtras.m: (+[NSURL _web_URLWithData:relativeToURL:]): Use WebMakeCollectable. (-[NSURL _web_URLWithLowercasedScheme]): Use WebMakeCollectable. (-[NSString _web_mapHostNameWithRange:encode:makeString:]): Change code to use CFRelease to balance CFURLCreateStringByReplacingPercentEscapes CFString creation, not release. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream finalize]): Added. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView freeAttributeKeysAndValues]): Added. Shared code for dealloc and finalize. (-[WebBaseNetscapePluginView dealloc]): Call freeAttributeKeysAndValues. (-[WebBaseNetscapePluginView finalize]): Added. (-[WebBaseNetscapePluginView requestWithURLCString:]): Changed so that CFString objects are released with CFRelease, not release. (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): Fixed storage leak in error case. Made sure CFString object is released with CFRelease, not release. (-[WebBaseNetscapePluginView _postURLNotify:target:len:buf:file:notifyData:allowHeaders:]): Another CFString that needed to a CFRelease, not a release. (-[WebBaseNetscapePluginView status:]): Ditto. * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage pathByResolvingSymlinksAndAliasesInPath:]): Changed code to CFRelease a CFURLRef, instead of release. (-[WebBasePluginPackage finalize]): Added. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge fini]): Added. Shared code for dealloc and finalize. (-[WebBridge dealloc]): Call fini. (-[WebBridge finalize]): Added. * WebCoreSupport.subproj/WebGlyphBuffer.m: (-[WebGlyphBuffer finalize]): Added. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageContext initWithBounds:context:]): Use CGContextRetain to avoid cast. (-[WebImageContext dealloc]): Tweaked. (-[WebImageContext finalize]): Added. (-[WebImageRenderer finalize]): Added. (-[WebPDFDocument finalize]): Added. * WebView.subproj/WebDataProtocol.m: (+[NSURL _web_uniqueWebDataURL]): Changed so that CFString object is released with CFRelease, not release. * WebView.subproj/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): Took non-release work out of here. (-[WebDataSource dealloc]): Moved it here. (-[WebDataSource finalize]): Added. (-[WebDataSource isLoading]): Use release on Panther, drain on Tiger. * WebView.subproj/WebFrame.m: (-[WebFramePrivate dealloc]): Took non-release work out of here. (-[WebFrame dealloc]): Moved it here. (-[WebFrame finalize]): Added. * WebView.subproj/WebFrameView.m: (-[WebFrameView finalize]): Added. * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation finalize]): Added. * WebView.subproj/WebHTMLView.m: (-[WebHTMLViewPrivate dealloc]): Moved non-release work out of here. (-[WebHTMLView dealloc]): Moved it here. (-[WebHTMLView finalize]): Added. * WebView.subproj/WebImageView.m: (-[WebImageView finalize]): Added. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient finalize]): Added. * WebView.subproj/WebTextView.m: (-[WebTextView finalize]): Added. * WebView.subproj/WebView.m: (-[WebView finalize]): Added. 2004-06-14 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3693202> WebView.h header unnecessarily lists NSResponder methods it overrides * WebView.subproj/WebView.h: NSResponder overrides now gathered in a comment section. 2004-06-13 Trey Matteson <trey@apple.com> Support for DHTML cut/copy/paste. Reviewed by Chris * WebView.subproj/WebHTMLView.m: (-[WebHTMLView copy:]): Give DHTML first crack at executing the command. (-[WebHTMLView cut:]): Ditto (-[WebHTMLView paste:]): Ditto 2004-06-14 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3674456> make new drag & drop API compatible with DHTML dragging Reviewed by trey. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): tweak * WebView.subproj/WebUIDelegate.h: removed old, added new methods * WebView.subproj/WebUIDelegatePrivate.h: moved new methods to public header * WebView.subproj/WebView.h: removed old, added new methods * WebView.subproj/WebView.m: moved methods around (-[WebView moveDragCaretToPoint:]): moved (-[WebView removeDragCaret]): moved (-[WebView _bridgeAtPoint:]): moved (-[WebView editableDOMRangeForPoint:]): moved * WebView.subproj/WebViewInternal.h: add new internal method * WebView.subproj/WebViewPrivate.h: moved new methods to public header 2004-06-14 Trey Matteson <trey@apple.com> Use a different hack, as recommended by Kristin, to force the drag manager to exit a modal event wait it is in. The hack is required to update the drag image on the fly. Instead of posting a CG event we post at the AppKit level. Reviewed by Louch * WebCoreSupport.subproj/WebGraphicsBridge.m: (-[WebGraphicsBridge setDraggingImage:at:]): 2004-06-14 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3692668> REGRESSION: delay when images and links <rdar://problem/3692675> links should drag when dragging images that are links when drag source action is WebDragSourceActionLink Reviewed by trey. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _mayStartDragWithMouseDragged:]): cleaned up, only use selection delay for selections, allow links to be dragged when image dragging is disabled 2004-06-12 Trey Matteson <trey@apple.com> Small rearrangement to support dynamic changing of the drag image during DHTML dragging. Reviewed by John * WebCoreSupport.subproj/WebBridge.m: Bridge glue moved to WebGraphicsBridge. * WebCoreSupport.subproj/WebGraphicsBridge.m: (FlipImageSpec): Code moved from WebHTMLView.m. (-[WebGraphicsBridge setDraggingImage:at:]): Ditto. Plus, we've added a gross event posting hack to force CG drag manager to update the display when we set the drag image. * WebView.subproj/WebHTMLView.m: Code moved to WebGraphicsBridge. * WebView.subproj/WebHTMLViewPrivate.h: 2004-06-11 Chris Blumenberg <cblu@apple.com> Implemented the remainder of the drag & drop API. Reviewed by trey. * Misc.subproj/WebNSPasteboardExtras.h: * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_declareAndWriteDragImage:URL:title:archive:source:]): new * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragImage:rect:event:pasteboard:source:]): simplified, this method now just creates a drag image and starts the drag * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge allowDHTMLDrag:UADrag:]): now calls _delegateDragSourceActionMask on WebHTMLView to interact with the delegate * WebView.subproj/WebDefaultUIDelegate.m: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): call new delegate method, cleaned-up a little (-[WebHTMLView draggingUpdatedWithDraggingInfo:actionMask:]): call drag caret methods on WebView instead of WebBridge so WebView can make sure only 1 HTML view has a drag cursor (-[WebHTMLView draggingCancelledWithDraggingInfo:]): ditto (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): ditto (-[WebHTMLView _delegateDragSourceActionMask]): new, gets drag source action mask from delegate * WebView.subproj/WebHTMLViewInternal.h: * WebView.subproj/WebImageView.h: * WebView.subproj/WebImageView.m: (-[WebImageView mouseDown:]): get the drag source action mask from the delegate (-[WebImageView mouseDragged:]): inform the delegate of the drag * WebView.subproj/WebView.m: (-[WebViewPrivate dealloc]): assert that dragCursorBridge is nil (-[WebView _close]): release dragCursorBridge (-[WebView _bridgeAtPoint:]): new (-[WebView editableDOMRangeForPoint:]): new API (-[WebView moveDragCaretToPoint:]): new API (-[WebView removeDragCaret]): new API (-[WebView _frameViewAtWindowPoint:]): moved so this can be called internally * WebView.subproj/WebViewInternal.h: * WebView.subproj/WebViewPrivate.h: 2004-07-10 Trey Matteson <trey@apple.com> Prep work for latest delegate API for dragging. In addition, I also straightened out all the cases of DHTML setting a drag image or setting pasteboard data, and how that would override WebKit's default behavior (which follows how WinIE does things). Reviewed by Chris. * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragImage:archive:rect:URL:title:event:dragImage:dragLocation:writePasteboard:]): New args to allow WebCore override of dragImage and pasteboard data. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge allowDHTMLDrag:UADrag:]): New method to return the drag action info to WC. (-[WebBridge startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): Pass along new args. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): Allow WebCore to override drag image and pasteboard data for any type of drag. (-[WebHTMLView mouseDragged:]): Pass NO for new args. * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebImageView.m: (-[WebImageView mouseDragged:]): Pass NO/nil for new args. === Safari-144 === 2004-06-10 Kevin Decker <kdecker@apple.com> Reviewed by John. * WebView.subproj/WebResource.m: (-[WebResource description]): -added per request of cblu (-[WebResource _response]): -added this method to the header (-[WebResource _stringValue]): - gives the string value of the NSData representation * WebView.subproj/WebResourcePrivate.h: 2004-06-10 Darin Adler <darin@apple.com> Reviewed by Ken. * WebCoreSupport.subproj/WebBridge.m: Removed undo-related methods. (-[WebBridge undoManager]): Added. * WebKit.pbproj/.cvsignore: Updated for new Xcode files. 2004-06-09 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3672088>: "Editable WebViews should maintain a selection even when they're not firstResponder" Add some code to determine whether a WebHTMLView should maintain an inactive selection when the view is not first responder. Traditionally, these views have not maintained such selections, clearing them when the view was not first responder. However, for appls embedding this view as an editing widget, it is desirable to act more like an NSTextView. For now, however, the view only acts in this way when the web view is set to be editable with -[WebView setEditable:YES]. This will maintain traditional behavior for WebKit clients dating back to before this change, and will likely be a decent switch for the long term, since clients to ste the web view to be editable probably want it to act like a "regular" Cocoa view in terms of its selection behavior. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView updateTextBackgroundColor]): Add code to tell whether the view is resigning first responder, and if it is, use the inactive text background color. (-[WebHTMLView maintainsInactiveSelection]): New helper which does checks to see if the new selection behavior should be used, or whether we should continue with traditional WebKit behavior. (-[WebHTMLView resignFirstResponder]): Call new maintainsInactiveSelection helper. If true, do not clear the selection. * WebView.subproj/WebHTMLViewInternal.h: Add resigningFirstResponder flag. 2004-06-09 Chris Blumenberg <cblu@apple.com> Implemented drag destination portion of the new drag & drop API. Reviewed by trey. * WebView.subproj/WebDefaultUIDelegate.m: (-[WebDefaultUIDelegate webView:dragDestinationActionMaskForDraggingInfo:]): new delegate implementation (-[WebDefaultUIDelegate webView:willPerformDragDestinationAction:forDraggingInfo:]): ditto * WebView.subproj/WebDocumentInternal.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView draggingUpdatedWithDraggingInfo:actionMask:]): handle the action mask (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): ditto * WebView.subproj/WebUIDelegate.h: * WebView.subproj/WebUIDelegatePrivate.h: * WebView.subproj/WebView.m: (-[WebView _dragOperationForDraggingInfo:]): call new delegate methods (-[WebView performDragOperation:]): ditto * WebView.subproj/WebViewInternal.h: * WebView.subproj/WebViewPrivate.h: 2004-06-09 Richard Williamson <rjw@apple.com> Implemented PDF rendering for the drawImage() function in Context2D. This allows PDF files to be drawn in scaled or rotated context without rasterization artifacts. The PDF image is currently NOT cached. Caching can/will be added as an optimization. The hooks are already in place to flush the cache as necessary. Reviewed by John. * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer dealloc]): (-[WebImageRenderer _needsRasterFlush]): (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): (-[WebImageRenderer _PDFDocumentRef]): (-[WebImageRenderer _PDFDraw]): (-[WebImageRenderer _PDFDrawFromRect:toRect:operation:alpha:flipped:]): (-[WebImageRenderer MIMEType]): (ReleasePDFDocumentData): (-[WebPDFDocument initWithData:]): (-[WebPDFDocument dealloc]): (-[WebPDFDocument documentRef]): (-[WebPDFDocument mediaBox]): (-[WebPDFDocument bounds]): (-[WebPDFDocument adjustCTM:]): (-[WebPDFDocument setCurrentPage:]): (-[WebPDFDocument currentPage]): (-[WebPDFDocument pageCount]): Added back check for old plugin API. * WebView.subproj/WebFrame.m: (-[WebFrame _reloadForPluginChanges]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addSubview:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge frameRequiredForMIMEType:URL:]): 2004-06-08 Trey Matteson <trey@apple.com> In DHTML dragging there is no notion of registering for types, so we'd like to just pass all types down to WebCore. It turns out that the per-type registration doesn't matter as far as the underlying drag service is concerned, so Cocoa is already getting called for any type. We just hack and override a private method to ensure we accept any type. Reviewed by Chris. * WebView.subproj/WebView.m: (-[WebView _hitTest:dragTypes:]): We accept any drag type if it is within our view, without overriding a subview's decision. 2004-06-08 Trey Matteson <trey@apple.com> A DHTML drag source can now change the dragging image during the drag. Currently it may only be set to a static image. Reviewed by John * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setDraggingImage:at:]): Typical bridge glue. * WebView.subproj/WebHTMLView.m: (FlipImageSpec): New utility, copied from AppKit. (-[WebHTMLView _setDraggingImage:at:]): Mostly copied from AppKit. Sets the drag image using CG API. * WebView.subproj/WebHTMLViewPrivate.h: 2004-06-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3640423>: (REGRESSION: can't paste text copied from web page into Excel (due to HTML on the pasteboard?)) Reviewed by darin. * WebView.subproj/WebHTMLView.m: (+[WebHTMLView _selectionPasteboardTypes]): don't include NSHTMLPboardType (-[WebHTMLView _selectedArchive]): removed markup string parameter (_selectionPasteboardTypes::if): don't put NSHTMLPboardType on the pasteboard * WebView.subproj/WebHTMLViewPrivate.h: 2004-06-07 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed <rdar://problem/3676761>: (REGRESSION: Text Bigger/Smaller commands are always disabled in TOT) * WebView.subproj/WebHTMLView.m: Add @interface declaration for WebTextSizing category on WebHTMLView. This must have gotten lost somewhere along the way. 2004-06-05 Trey Matteson <trey@apple.com> WebKit no longer causes an endless stream of dragexit events to occur at the DHTML level when hovering over an element that is not accepting the drag. Reviewed by Chris * WebView.subproj/WebView.m: (-[WebView _dragOperationForDraggingInfo:]): If the potential target refuses the item, don't turn around and immediately tell it to cancel the drag, which is what leads to the exit event happening at the DOM level. If the target just refused the drag, it should not have anything it needs to cancel. 2004-06-03 Trey Matteson <trey@apple.com> DHTML dragging uses the Cocoa NSDragOperation on both the source and dest ends. Most of the real work is in WebCore. Reviewed by rjw * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge startDraggingImage:at:operation:event:]): Pass the drag op along. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:]): Remember drag op from WC. (-[WebHTMLView mouseDragged:]): Pass None for the op (alternate code path that will be going away). (-[WebHTMLView draggingSourceOperationMaskForLocal:]): Use the WC drag op. * WebView.subproj/WebHTMLViewInternal.h: * WebView.subproj/WebHTMLViewPrivate.h: === Safari-143 === 2004-06-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3674921>: (can't drag an image from Desktop to Blot document) Reviewed by mjs. * WebView.subproj/WebDataSource.m: (-[WebDataSource _imageElementWithImageResource:]): factored out from _documentFragmentWithImageResource: (-[WebDataSource _documentFragmentWithImageResource:]): call _imageElementWithImageResource: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _imageExistsAtPaths:]): new (-[WebHTMLView _documentFragmentWithPaths:]): new (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:]): handle NSFilenamesPboardType (+[WebHTMLView _insertablePasteboardTypes]): include NSFilenamesPboardType (-[WebHTMLView _canProcessDragWithDraggingInfo:]): check for NSFilenamesPboardType and check that the files are images 2004-06-04 Richard Williamson <rjw@apple.com> Fixed crasher from last checkin. Reviewed by Ken. * Plugins.subproj/WebPluginDatabase.m: (+[WebPluginDatabase setAdditionalWebPlugInPaths:]): (pluginLocations): 2004-06-03 Richard Williamson <rjw@apple.com> Add SPI to allow setting of plugin load path. Reviewed by Hyatt. * Plugins.subproj/WebPluginDatabase.h: * Plugins.subproj/WebPluginDatabase.m: (+[WebPluginDatabase setAdditionalWebPlugInPaths:]): (pluginLocations): 2004-06-03 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed <rdar://problem/3677038>: (Need SPI to get URL of favicon for a site) * Misc.subproj/WebIconDatabase.h: Add iconURLForURL: method. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase iconURLForURL:]): Added. 2004-06-02 Ken Kocienda <kocienda@apple.com> Reviewed by John Fix for these bugs: <rdar://problem/3675806>: "Make API name change for -webViewShouldBeginEditing:inDOMRange:" <rdar://problem/3675809>: "Make API name change for -webViewShouldEndEditing:inDOMRange:" New names are -webView:shouldBeginEditingInDOMRange: and -webView:shouldEndEditingInDOMRange:, respectively. * WebView.subproj/WebDefaultEditingDelegate.m: (-[WebDefaultEditingDelegate webView:shouldBeginEditingInDOMRange:]): (-[WebDefaultEditingDelegate webView:shouldEndEditingInDOMRange:]): * WebView.subproj/WebEditingDelegate.h: * WebView.subproj/WebView.m: (-[WebView _shouldBeginEditingInDOMRange:]): (-[WebView _shouldEndEditingInDOMRange:]): 2004-06-02 Richard Williamson <rjw@apple.com> conformsToProtocol:@protocol(WebPlugin) becomes respondsToSelector:@selector(webPlugInInitialize) because protocol was changed to an informal protocol. Reviewed by Kevin. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge frameRequiredForMIMEType:URL:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addSubview:]): 2004-06-01 Trey Matteson <trey@apple.com> First cut at source side of DHTML dragging. Most of the work is in WebCore. Reviewed by hyatt. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge startDraggingImage:at:event:]): Added image and loc args for when WC tells WK to start a drag. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:event:]): New image and loc args coming from WebCore. Hysteresis is moved to WC. (-[WebHTMLView mouseDragged:]): Call new _startDragging method. (-[WebHTMLView draggedImage:movedTo:]): Pass event to WC. (-[WebHTMLView draggedImage:endedAt:operation:]): Pass event to WC. (-[WebHTMLView mouseUp:]): Reset firstMouseDownEvent. Fixes bug where we would occasionally short-circuit WC event handling due to aliasing problem with this event. * WebView.subproj/WebHTMLViewPrivate.h: 2004-06-02 Darin Adler <darin@apple.com> Reviewed by John. - fixed problem with timing of delegate callbacks in the back/forward cache case * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): Move code to indicate page is done loading in the back/forward cache case from here ... (-[WebFrame _opened]): ... to here. 2004-06-01 Richard Williamson <rjw@apple.com> Fixed deployment build warning. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): 2004-06-01 Richard Williamson <rjw@apple.com> Added support for drawImage and drawImageFromRect to <CANVAS> Added support for composite attribute to <CANVAS> Reviewed by Trey. * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageContext initWithBounds:context:]): (-[WebImageContext dealloc]): (-[WebImageContext saveGraphicsState]): (-[WebImageContext restoreGraphicsState]): (-[WebImageContext isDrawingToScreen]): (-[WebImageContext focusStack]): (-[WebImageContext setFocusStack:]): (-[WebImageContext bounds]): (-[WebImageContext isFlipped]): (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): (-[WebImageRenderer dealloc]): (-[WebImageRenderer _beginRedirectContext:]): (-[WebImageRenderer _endRedirectContext:]): (-[WebImageRenderer _needsRasterFlush]): (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): (-[WebImageRenderer drawImageInRect:fromRect:]): (-[WebImageRenderer flushRasterCache]): (-[WebImageRenderer drawImageInRect:fromRect:compositeOperator:context:]): (-[WebImageRenderer tileInRect:fromPoint:context:]): * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory imageRendererWithMIMEType:]): (-[WebImageRendererFactory imageRendererWithName:]): (-[WebImageRendererFactory CGCompositeOperationInContext:]): (-[WebImageRendererFactory setCGCompositeOperation:inContext:]): (-[WebImageRendererFactory setCGCompositeOperationFromString:inContext:]): 2004-06-01 John Sullivan <sullivan@apple.com> Reviewed by Trey. Work on text-align API. Marked these bugs fixed: <rdar://problem/3655380>: (Editing: -alignCenter: method unimplemented (WebKit editing API)) <rdar://problem/3655381>: (Editing: -alignJustified: method unimplemented (WebKit editing API)) <rdar://problem/3655383>: (Editing: -alignLeft: method unimplemented (WebKit editing API)) <rdar://problem/3655384>: (Editing: -alignRight: method unimplemented (WebKit editing API)) in favor of opening this bug: <rdar://problem/3675191>: (Editing: -alignLeft: and friends mostly implemented but not yet working (WebKit editing API)) * English.lproj/StringsNotToBeLocalized.txt: updated for these changes * WebView.subproj/WebHTMLView.m: (-[WebHTMLView changeDocumentBackgroundColor:]): added a FIXME about why this is still not quite right (-[WebHTMLView _alignSelectionUsingCSSValue:]): new method, bottleneck for the various values (-[WebHTMLView alignCenter:]): call _alignSelectionUsingCSSValue:@"center" (-[WebHTMLView alignJustified:]): call _alignSelectionUsingCSSValue:@"justify" (-[WebHTMLView alignLeft:]): call _alignSelectionUsingCSSValue:@"left" (-[WebHTMLView alignRight:]): call _alignSelectionUsingCSSValue:@"right" 2004-06-01 John Sullivan <sullivan@apple.com> Reviewed by Ken. - fixed <rdar://problem/3655378>: (Editing: -changeDocumentBackgroundColor:  method unimplemented (WebKit editing API)) - made startSpeaking: actually work; previous implementation raised a DOMException * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _changeCSSColorUsingSelector:inRange:]): added range parameter (-[WebHTMLView _entireDOMRange]): new convenience method (-[WebHTMLView changeDocumentBackgroundColor:]): now affects entire document, not just selected range, a la NSTextView (-[WebHTMLView changeColor:]): now passes in a range to _changeCSSColorUsingSelector:inRange: (-[WebHTMLView startSpeaking:]): now uses _entireDOMRange 2004-06-01 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3661505>: (REGRESSION (Safari-140) can't drag standalone images more than once) Reviewed by john. * WebView.subproj/WebImageView.m: (-[WebImageView mouseDown:]): set ignoringMouseDraggedEvents to NO. This line of code was deleted somehow. 2004-06-01 John Sullivan <sullivan@apple.com> Reviewed by Darin. - fixed <rdar://problem/3657003>: (HTML Editing: Color panel doesn't work) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _colorPanelColorAsStyleUsingSelector:]): new method, returns a DOMCSSStyleDeclaration * (-[WebHTMLView _changeCSSColorUsingSelector:]): new method, sets a color-related style attribute on the selection (-[WebHTMLView changeDocumentBackgroundColor:]): call _changeCSSColorUsingSelector: with @selector(setBackgroundColor:) (-[WebHTMLView changeColor:]): call _changeCSSColorUsingSelector: with @selector(setColor:); also added comments explaining why changeDocumentBackgroundColor: will never actually be called until an AppKit code-incest mess is straighted out. 2004-06-01 Ken Kocienda <kocienda@apple.com> Reviewed by Darin * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _fontManagerOperationAsStyle]): Fixed typo in family-name code that caused family names to match when they should not. 2004-06-01 Chris Blumenberg <cblu@apple.com> Made paste and drop ask the delegate before making any replacements. Reviewed by kocienda. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]): renamed, now calls _shouldInsertFragment:replacingDOMRange:givenAction: (-[WebHTMLView _shouldInsertFragment:replacingDOMRange:givenAction:]): new, asks delegate (-[WebHTMLView concludeDragForDraggingInfo:]): now calls _shouldInsertFragment:replacingDOMRange:givenAction: (-[WebHTMLView paste:]): call renamed _pasteWithPasteboard:allowPlainText: (-[WebHTMLView pasteAsRichText:]): ditto 2004-05-28 Darin Adler <darin@apple.com> Reviewed by Maciej. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _fontManagerOperationAsStyle]): First cut at figuring out what operation the font manager is doing without digging into its private data structures. 2004-05-28 Darin Adler <darin@apple.com> Reviewed by Ken. - various editing-related improvements - fixed <rdar://problem/3655366>: (Editing: -selectParagraph: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655367>: (Editing: -selectLine: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655369>: (Editing: -selectWord: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655392>: (Editing: -uppercaseWord: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655393>: (Editing: -lowercaseWord: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655394>: (Editing: -capitalizeWord: method unimplemented (WebKit editing API)) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _alterCurrentSelection:direction:granularity:]): Removed the call to ensureCaretVisible. This is now handled on the other side of the bridge. (-[WebHTMLView moveDown:]): Changed to use WebSelectByLine granularity instead of WebSelectDown direction. (-[WebHTMLView moveDownAndModifySelection:]): Ditto. (-[WebHTMLView moveUp:]): Ditto. (-[WebHTMLView moveUpAndModifySelection:]): Ditto. (-[WebHTMLView _expandSelectionToGranularity:]): Added. (-[WebHTMLView selectParagraph:]): Implemented by calling _expandSelectionToGranularity. (-[WebHTMLView selectLine:]): Ditto. (-[WebHTMLView selectWord:]): Ditto. (-[WebHTMLView _fontManagerOperationAsStyle]): Added. Placeholder for the job of figuring out what style change to make based on NSFontManager. (-[WebHTMLView changeFont:]): Implemented, but not really tested because guts are still missing due to lack of above method. (-[WebHTMLView insertTab:]): Removed the call to ensureCaretVisible. (-[WebHTMLView insertNewline:]): Removed the call to ensureCaretVisible. (-[WebHTMLView insertParagraphSeparator:]): Made this insert a newline for now. (-[WebHTMLView _changeWordCaseWithSelector:]): Added. (-[WebHTMLView uppercaseWord:]): Implemented by calling _changeWordCaseWithSelector. (-[WebHTMLView lowercaseWord:]): Ditto. (-[WebHTMLView capitalizeWord:]): Ditto. (-[WebHTMLView deleteBackward:]): Removed the call to ensureCaretVisible. (-[WebHTMLView checkSpelling:]): Put a pile of AppKit code in here as a placeholder. (-[WebHTMLView startSpeaking:]): Use the new stringForRange: method instead of outerText. That way we can handle cases where the entire document is selected. (-[WebHTMLView insertText:]): Removed the call to ensureCaretVisible. 2004-05-28 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3672129>: (selection deselects when clicking editable WebView in background window) Fixed this problem by using NSTextView's approach of only allowing dragging on first mouse down. Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView acceptsFirstMouse:]): store the first mouse down (-[WebHTMLView mouseDown:]): Don't tell WebCore about the first mouse down event since only dragging can occur on the first mouse down. (-[WebHTMLView mouseDragged:]): Don't tell WebCore about the drags that occur after the first mouse down since only dragging can occur after the first mouse down. * WebView.subproj/WebHTMLViewInternal.h: 2004-05-28 Darin Adler <darin@apple.com> * WebView.subproj/WebView.m: At Ken's suggestion, for better efficiency and safety, use _cmd rather than explicit selector names in the forwarding methods. 2004-05-28 Darin Adler <darin@apple.com> Reviewed by Ken. - implemented a few more editing operations, moved code from WebView to WebHTMLView * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge respondToChangedContents]): Call _updateFontPanel on the WebHTMLView, not the WebView. (-[WebBridge respondToChangedSelection]): Ditto. * WebView.subproj/WebHTMLView.m: Moved WebElementOrTextFilter class here from WebView and gave it a prefix so it won't conflict with developers' class names. (-[WebHTMLView _updateFontPanel]): Moved here from WebView. * WebView.subproj/WebView.m: (-[WebView toggleSmartInsertDelete:]): Added. (-[WebView toggleContinuousSpellChecking:]): Added. (-[WebView isContinuousGrammarCheckingEnabled]): Added. (-[WebView setContinuousGrammarCheckingEnabled:]): Added. (-[WebView toggleContinuousGrammarChecking:]): Added. (-[WebView setSmartInsertDeleteEnabled:]): Implemented. We have the flag now, although we still don't actually have smart insert and delete implemented. (-[WebView smartInsertDeleteEnabled]): Ditto. (-[WebView setContinuousSpellCheckingEnabled:]): Implemented. (-[WebView isContinuousSpellCheckingEnabled]): Implemented. (-[WebView spellCheckerDocumentTag]): Implemented. (-[WebView _preflightSpellCheckerNow:]): Added. (-[WebView _preflightSpellChecker]): Added. (-[WebView _continuousCheckingAllowed]): Added. * WebView.subproj/WebHTMLViewInternal.h: Added. We'll things here from WebHTMLViewPrivate so they are internal to the framework, rather than SPI. * WebKit.pbproj/project.pbxproj: Added WebHTMLViewInternal.h. * WebView.subproj/WebHTMLViewPrivate.h: Moved WebHTMLViewPrivate into the internal header. Despite its name, it's internal, not SPI. * WebView.subproj/WebViewPrivate.h: Moved WebViewPrivate into the internal header. Despite its name, it's internal, not SPI. Added a number of new operations which should be public API. We'll have to figure out what to do about API review and the WWDC deadline. * WebView.subproj/WebViewInternal.h: Removed _updateFontPanel method. * English.lproj/StringsNotToBeLocalized.txt: Update. 2004-05-27 Ken Kocienda <kocienda@apple.com> Reviewed by John The font panel now updates correctly, reflecting the current selection. There may still be some bugs and corner cases to handle, but this will work for a general implementation of the feature. * WebView.subproj/WebView.m: (+[ElementOrTextFilter filter]): Added. This filter will accept DOM elements and text nodes and skip everything else. This filter is used when walking a selection to determine the fonts in use. (-[ElementOrTextFilter acceptNode:]): DOM node filter implementation method. (-[WebView _fontFromStyle]): Removed, in lieu of new fontForCurrentPosition call on the bridge. (-[WebView _updateFontPanel]): Reworked to use a TreeWalker instead of a NodeIterator. This was done since the iterator must be rooted at the document root, but start iterating at the start of the selection. TreeWalker's setCurrentNode allows this to be done. 2004-05-27 Kevin Decker <kdecker@apple.com> * Plugins.subproj/WebScriptObject.h: 2004-05-27 Kevin Decker <kdecker@apple.com> Reviewed by Ken. - error messages (eg. from JavaScriptCore) sent to the bridge now get delievered to a new delegate method. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge addMessageToConsole:]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebUIDelegatePrivate.h: === Safari-142 === 2004-05-27 Trey Matteson <trey@apple.com> First cut at DHTML dragging, destination side. Dragging text, files and URLs onto elements works. Type conversion from NSPasteboard to MIME types is hardwired. No JS access yet to modifier keys, or operations mask. Reviewed by Chris. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView draggingUpdatedWithDraggingInfo:]): Call DHTML dragging via bridge. (-[WebHTMLView draggingCancelledWithDraggingInfo:]): Ditto. (-[WebHTMLView concludeDragForDraggingInfo:]): Ditto. * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebView.m: (-[WebView _setWebKitDragRespondsToDragging:]): New SPI for finer grained control than the delegate currently has. (-[WebView _webKitDragRespondsToDragging]): Ditto. (-[WebView _commonInitializationWithFrameName:groupName:]): Init new flag. (-[WebView _dragOperationForDraggingInfo:]): Comment. * WebView.subproj/WebViewPrivate.h: 2004-05-27 Darin Adler <darin@apple.com> * WebView.subproj/WebFrameView.m: (-[WebFrameView _scrollVerticallyBy:]): Added comment. 2004-05-27 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed <rdar://problem/3667948>: (REGRESSION: Page Down key goes down two pages when smooth scrolling is on) * WebView.subproj/WebFrameView.m: (-[WebFrameView _scrollVerticallyBy:]): Added return value to indicate if any scrolling was done. This requires using secret AppKit methods; the public methods don't have a return value. (-[WebFrameView _pageVertically:]): Added return value to indicate if any scrolling was done. (-[WebFrameView scrollPageUp:]): Base call through to next responder on whether any scrolling was done, using return value, rather than looking at new scroll position. This was the cause of the bug, since with smooth scrolling no scrolling has happened yet when the function returns. (-[WebFrameView scrollPageDown:]): Ditto. - removed temporary DOMDocument method from WebView * WebView.subproj/WebView.m: (-[WebView computedStyleForElement:pseudoElement:]): Call getComputedStyle on the document that owns the element rather than on the document that currently contains the selection. (-[WebView _updateFontPanel]): Get the document from the DOM range rather than using the DOMDocument method. (-[WebView styleDeclarationWithText:]): Change this method to not use the DOMDocument method, but do the same job with inline code. * WebView.subproj/WebViewPrivate.h: Moved a recently-added category that is not SPI out of here. * WebView.subproj/WebViewInternal.h: Moved the category in here. And removed the DOMDocument method from it. - other changes * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. * copy-webcore-files-to-webkit: Change tabs to spaces. Quiet the script down by making it no longer echo each command or print messages about what it's doing by default. 2004-05-27 Darin Adler <darin@apple.com> Reviewed by Maciej. - moved to new symlink technique for embedding frameworks * WebKit.pbproj/project.pbxproj: Get rid of embed-frameworks build step because we don't need it any more. 2004-05-27 Darin Adler <darin@apple.com> - fixed Deployment build * WebView.subproj/WebView.m: (-[WebView concludeDragOperation:]): Got rid of ASSERT-only local variable. 2004-05-26 Maciej Stachowiak <mjs@apple.com> Reviewed by Dave. - fix further problems with Emerson feed: redirection for RSS feeds This is done by removing removing the calls to defer callbacks while waiting for [... Maciej stopped typing here ...] * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterNavigationPolicy:formState:]): (-[WebMainResourceClient connection:willSendRequest:redirectResponse:]): (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient checkContentPolicyForResponse:]): 2004-05-26 Chris Blumenberg <cblu@apple.com> Added and implemented proposed dragging API changes. These changes are necessary to make JS dragging work properly. Reviewed by trey. * WebView.subproj/WebDefaultUIDelegate.m: (-[WebDefaultUIDelegate webView:shouldDetermineDragOperationForDraggingInfo:dragOperation:]): instead of calling back to the WebView to get the default drag operation, return YES. Return NO in order to return a custom drag operation. Removed element parameter since another new API provides a way to get that. (-[WebDefaultUIDelegate webView:shouldProcessDragWithDraggingInfo:]): Removed element parameter since another new API provides a way to get that. * WebView.subproj/WebDocumentInternal.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView draggingUpdatedWithDraggingInfo:]): now returns a drag operation (-[WebHTMLView draggingCancelledWithDraggingInfo:]): moved * WebView.subproj/WebUIDelegatePrivate.h: * WebView.subproj/WebView.m: (-[WebView elementAtPoint:]): new proposed API (-[WebView dragOperationForDraggingInfo:]): removed code from this API that should be removed (-[WebView _dragOperationForDraggingInfo:]): call new API (-[WebView concludeDragOperation:]): call new API 2004-05-26 Darin Adler <darin@apple.com> Reviewed by John. - moved HTML editing operations from WebView to WebHTMLView, leaving only forwarding machinery at the WebView level - fixed <rdar://problem/3655412>: (Editing: -startSpeaking: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655414>: (Editing: -stopSpeaking: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655375>: (Editing: -pasteAsRichText: method unimplemented (WebKit editing API)) * WebView.subproj/WebView.h: Added missing declaration of selectionAffinity. I think this omission was an editorial mistake. * WebView.subproj/WebView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): Use _frameForCurrentSelection directly, since it no longer returns nil. (-[WebView pasteboardTypesForSelection]): Use _frameForCurrentSelection instead of going through the bridge. (-[WebView _frameForCurrentSelection]): Renamed from _currentFrame and changed to return main frame rather than nil when called on WebView that has no current selection. (-[WebView _bridgeForCurrentSelection]): Moved in file. (-[WebView _updateFontPanel]): Removed the one call to _currentSelectionIsEditable here, since it was the only one left in this file. Eventually this code will move to WebHTMLView. (-[WebView _performResponderOperation:with:]): Name change. * WebView.subproj/WebDataSource.m: (-[WebDataSource _documentFragmentWithImageResource:]): Build document fragment using DOM instead of composing HTML text. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:]): Added allowPlainText boolean, moved method into new location in file so it can be in the right category, changed link pasting to use DOM instead of composing HTML text. (-[WebHTMLView _replaceSelectionWithPasteboard:selectReplacement:allowPlainText:]): Added allowPlainText boolean, moved method into new location in file so it can be in the right category. (-[WebHTMLView concludeDragForDraggingInfo:]): Pass YES for allowPlainText. (-[WebHTMLView keyDown:]): Set keyDownEvent field for use by workaround below. (-[WebHTMLView centerSelectionInVisibleArea:]): Moved here from WebView. (-[WebHTMLView _alterCurrentSelection:direction:granularity:]): Ditto. (-[WebHTMLView moveBackward:]): Ditto. (-[WebHTMLView moveBackwardAndModifySelection:]): Ditto. (-[WebHTMLView moveDown:]): Ditto. (-[WebHTMLView moveDownAndModifySelection:]): Ditto. (-[WebHTMLView moveForward:]): Ditto. (-[WebHTMLView moveForwardAndModifySelection:]): Ditto. (-[WebHTMLView moveLeft:]): Ditto. (-[WebHTMLView moveLeftAndModifySelection:]): Ditto. (-[WebHTMLView moveRight:]): Ditto. (-[WebHTMLView moveRightAndModifySelection:]): Ditto. (-[WebHTMLView moveToBeginningOfDocument:]): Ditto. (-[WebHTMLView moveToBeginningOfLine:]): Ditto. (-[WebHTMLView moveToBeginningOfParagraph:]): Ditto. (-[WebHTMLView moveToEndOfDocument:]): Ditto. (-[WebHTMLView moveToEndOfLine:]): Ditto. (-[WebHTMLView moveToEndOfParagraph:]): Ditto. (-[WebHTMLView moveUp:]): Ditto. (-[WebHTMLView moveUpAndModifySelection:]): Ditto. (-[WebHTMLView moveWordBackward:]): Ditto. (-[WebHTMLView moveWordBackwardAndModifySelection:]): Ditto. (-[WebHTMLView moveWordForward:]): Ditto. (-[WebHTMLView moveWordForwardAndModifySelection:]): Ditto. (-[WebHTMLView moveWordLeft:]): Ditto. (-[WebHTMLView moveWordLeftAndModifySelection:]): Ditto. (-[WebHTMLView moveWordRight:]): Ditto. (-[WebHTMLView moveWordRightAndModifySelection:]): Ditto. (-[WebHTMLView pageDown:]): Ditto. (-[WebHTMLView pageUp:]): Ditto. (-[WebHTMLView selectParagraph:]): Ditto. (-[WebHTMLView selectLine:]): Ditto. (-[WebHTMLView selectWord:]): Ditto. (-[WebHTMLView copy:]): Moved down in file so it's in the right category. (-[WebHTMLView cut:]): Ditto. (-[WebHTMLView delete:]): Ditto. (-[WebHTMLView paste:]): Ditto. (-[WebHTMLView copyFont:]): Moved here from WebView. (-[WebHTMLView pasteFont:]): Ditto. (-[WebHTMLView pasteAsPlainText:]): Ditto. (-[WebHTMLView pasteAsRichText:]): Implemented this by calling the paste code with allowPlainText:NO; believe it or not, that's what this means in NSTextView. (-[WebHTMLView changeFont:]): Moved here from WebView. (-[WebHTMLView changeAttributes:]): Ditto. (-[WebHTMLView changeDocumentBackgroundColor:]): Ditto. (-[WebHTMLView changeColor:]): Ditto. (-[WebHTMLView alignCenter:]): Ditto. (-[WebHTMLView alignJustified:]): Ditto. (-[WebHTMLView alignLeft:]): Ditto. (-[WebHTMLView alignRight:]): Ditto. (-[WebHTMLView indent:]): Ditto. (-[WebHTMLView insertTab:]): Moved here from WebView, also call insertText rather than replaceSelectionWithText so it's undoable like a typed character. (-[WebHTMLView insertBacktab:]): Moved here from WebView. (-[WebHTMLView insertNewline:]): Moved here from WebView, also call insertText rather than replaceSelectionWithText so it's undoable like a typed character. (-[WebHTMLView insertParagraphSeparator:]): Moved here from WebView. (-[WebHTMLView changeCaseOfLetter:]): Ditto. (-[WebHTMLView uppercaseWord:]): Ditto. (-[WebHTMLView lowercaseWord:]): Ditto. (-[WebHTMLView capitalizeWord:]): Ditto. (-[WebHTMLView deleteForward:]): Ditto. (-[WebHTMLView deleteBackward:]): Ditto. (-[WebHTMLView deleteBackwardByDecomposingPreviousCharacter:]): Ditto. (-[WebHTMLView deleteWordForward:]): Ditto. (-[WebHTMLView deleteWordBackward:]): Ditto. (-[WebHTMLView deleteToBeginningOfLine:]): Ditto. (-[WebHTMLView deleteToEndOfLine:]): Ditto. (-[WebHTMLView deleteToBeginningOfParagraph:]): Ditto. (-[WebHTMLView deleteToEndOfParagraph:]): Ditto. (-[WebHTMLView complete:]): Ditto. (-[WebHTMLView checkSpelling:]): Ditto. (-[WebHTMLView showGuessPanel:]): Ditto. (-[WebHTMLView performFindPanelAction:]): Ditto. (-[WebHTMLView startSpeaking:]): Implemented this. (-[WebHTMLView stopSpeaking:]): Implemented this. (-[WebHTMLView insertText:]): Moved here from WebView. * WebView.subproj/WebHTMLViewPrivate.h: Removed declarations of methods that are neither SPI nor needed outside WebHTMLView.m. * WebView.subproj/WebViewInternal.h: Removed _currentFrame, and added _frameForCurrentSelection and _bridgeForCurrentSelection. 2004-05-25 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. <rdar://problem/3652498>: new sniffing support is crashing * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient checkContentPolicyForResponse:]): Retain listener around call, in case delegate does something that ends up invalidating it, like navigating to a new URL. 2004-05-25 Chris Blumenberg <cblu@apple.com> Fixed regression where undoing typing would undo character-by-character. Reviewed by kocienda. * WebView.subproj/WebView.m: (-[WebView insertText:]): call insertText: rather than replaceSelectionWithText:: since text insertion via insertText: is coalesced and this is the behavior we want here 2004-05-25 Ken Kocienda <kocienda@apple.com> Reviewed by John Change postDidChangeSelectionNotification and postDidChangeNotification tp respondToChangedSelection and respondToChangedContents, respectively, to account for the fact that we do work in these calls other than post a notification. The need to clear the typing style on both kinds of changes inspired the name change. Add in support to set and access typing style. We don't do anything with it yet except store and return it. Using the typing style is still to come. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge respondToChangedContents]): Change name of functions as described. (-[WebBridge respondToChangedSelection]): Change name of functions as described. * WebView.subproj/WebView.m: (-[WebView dealloc:]): Dealloc typing style ivar. (-[WebView setTypingStyle:]): Change to set typing style ivar. (-[WebView typingStyle]): Return new typing style ivar. * WebView.subproj/WebViewPrivate.h: Add ivar for typing style. 2004-05-25 Ken Kocienda <kocienda@apple.com> Reviewed by John Improve _bridgeForCurrentSelection so that it is frame-savvy. Fixup setSelectedDOMRange:affinity: so that it uses the right bridge. * WebView.subproj/WebView.m: (-[WebView _bridgeForCurrentSelection]): Use _currentFrame not mainFrame. (-[WebView _currentFrame]): Moved to WebView (WebInternal) category so _bridgeForCurrentSelection can use it. (-[WebView setSelectedDOMRange:affinity:]): Derive the bridge to use from the range passed in; _bridgeForCurrentSelection is not the right way to get at the document for the range. * WebView.subproj/WebViewInternal.h: Add _currentFrame declaration. 2004-05-24 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed <rdar://problem/3666022>: (REGRESSION: crash from infinite regress in -[WebFrameView(WebPrivate) scrollPageDown:]) * WebView.subproj/WebView.m: (-[WebView _performResponderOperation:sender:]): Helper method that knows how to pass on operations to the responder chain, allowing us to implement operations that will get passed to views inside us as necessary. Moved a few methods to this, and soon will move even more. (-[WebView scrollLineDown:]): Use the above method. (-[WebView scrollLineUp:]): Ditto. (-[WebView scrollPageDown:]): Ditto. (-[WebView scrollPageUp:]): Ditto. (-[WebView copy:]): Ditto. (-[WebView cut:]): Ditto. (-[WebView paste:]): Ditto. (-[WebView delete:]): Ditto. (-[WebView insertBacktab:]): Ditto. 2004-05-24 Chris Blumenberg <cblu@apple.com> Improved editing via drag Reviewed by kocienda. * WebView.subproj/WebDataSource.m: (-[WebDataSource _documentFragmentWithImageResource:]): made this method return a fragment instead of replace the selection so that the caller do other things with the fragment (-[WebDataSource _documentFragmentWithArchive:]): ditto (-[WebDataSource _replaceSelectionWithArchive:selectReplacement:]): call renamed methods * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDocumentInternal.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:]): made this method return a fragment instead of replace the selection so that the caller do other things with the fragment (-[WebHTMLView _replaceSelectionWithPasteboard:selectReplacement:]): new (-[WebHTMLView paste:]): call _replaceSelectionWithPasteboard:selectReplacement: (-[WebHTMLView dragOperationForDraggingInfo:]): handle the case where the destination is editable, but the source is not (-[WebHTMLView draggingCancelledWithDraggingInfo:]): new, removes drag caret (-[WebHTMLView draggingUpdatedWithDraggingInfo:]): remove drag caret when we can't handle the drag (-[WebHTMLView concludeDragForDraggingInfo:]): instead of calling paste, move the selection when doing a move and replace the drag caret when doing a copy * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebView.m: (-[WebViewPrivate dealloc]): (-[WebView _setDraggingDocumentView:]): new (-[WebView _dragOperationForDraggingInfo:]): if the current dragging document view changes, tell the previous dragging document view that dragging cancelled (-[WebView draggingExited:]): new, tell the previous dragging document view that dragging cancelled (-[WebView concludeDragOperation:]): release the dragging document view (-[WebView replaceSelectionWithNode:]): pass the selectReplacement BOOL to the bridge (-[WebView replaceSelectionWithText:]): ditto (-[WebView replaceSelectionWithMarkupString:]): ditto (-[WebView replaceSelectionWithArchive:]): ditto (-[WebView pasteAsPlainText:]): ditto (-[WebView insertTab:]): ditto (-[WebView insertText:]): ditto * WebView.subproj/WebViewPrivate.h: 2004-05-24 John Sullivan <sullivan@apple.com> Reviewed by Dave. - added private RSSFeedReferrer field to WebHistoryItem so RSS feeds in the back/forward list can remember what page (if any) they were initiated from. * History.subproj/WebHistoryItem.m: new RSSFeedReferrer ivar in private structure (-[WebHistoryItemPrivate dealloc]): release RSSFeedReferrer (-[WebHistoryItem copyWithZone:]): copy RSSFeedReferrer (-[WebHistoryItem RSSFeedReferrer]): return RSSFeedReferrer (-[WebHistoryItem setRSSFeedReferrer:]): set RSSFeedReferrer * History.subproj/WebHistoryItemPrivate.h: declare -RSSFeedReferrer and -setRSSFeedReferrer: 2004-05-22 Darin Adler <darin@apple.com> Reviewed by Ken. - implemented some of the trivial WebView editing operations; some had bug reports, to wit: - fixed <rdar://problem/3655342>: (Editing: -centerSelectionInVisibleArea: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655398>: (Editing: -deleteWordBackward: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655397>: (Editing: -deleteWordForward: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655387>: (Editing: -insertBacktab: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655386>: (Editing: -insertTab: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655351>: (Editing: -moveWordBackward: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655352>: (Editing: -moveWordBackwardAndModifySelection: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655353>: (Editing: -moveWordForward: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655354>: (Editing: -moveWordForwardAndModifySelection: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655374>: (Editing: -pasteAsPlainText: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655362>: (Editing: -scrollLineDown: method unimplemented (WebKit editing API)) - fixed <rdar://problem/3655363>: (Editing: -scrollLineUp: method unimplemented (WebKit editing API)) * WebView.subproj/WebView.m: (-[WebView centerSelectionInVisibleArea:]): Implemented. The implementation isn't perfect, but it's hooked up. It simply calls ensureCaretVisible for now. (-[WebView moveBackward:]): Implemented. The WebCore API already has a way to specify backward as opposed to left. A separate issue is the fact that these operations don't have bi-di-savvy implementations, but now this method is hooked up and will work at least for left-to-right text. (-[WebView moveBackwardAndModifySelection:]): Ditto. (-[WebView moveForward:]): Ditto. (-[WebView moveForwardAndModifySelection:]): Ditto. (-[WebView moveWordBackward:]): Ditto. (-[WebView moveWordBackwardAndModifySelection:]): Ditto. (-[WebView moveWordForward:]): Ditto. (-[WebView moveWordForwardAndModifySelection:]): Ditto. (-[WebView scrollLineDown:]): Forward to WebFrameView. (-[WebView scrollLineUp:]): Ditto. (-[WebView scrollPageDown:]): Ditto. (-[WebView scrollPageUp:]): Ditto. (-[WebView delete:]): Implemented. Follows pattern used in cut, copy, and paste. (-[WebView pasteAsPlainText:]): Implemented. Calls delegate, then replaceSelectionWithText: on the bridge. (-[WebView insertTab:]): Implemented. Calls delegate, then replaceSelectionWithText: on the bridge. (-[WebView insertBacktab:]): Implemented. Does nothing. If we ever change so that you can use a WebView as a field editor, then we might have to add code here. (-[WebView deleteWordForward:]): Implement by calling moveForwardAndModifySelection: and then delete:. Might not be a perfect implementation in the presence of delegates who refuse to delete because it will change the selection even if the delete is disallowed. (-[WebView deleteWordBackward:]): Implement by calling moveBackwardAndModifySelection: and then delete:. Same issue about about delegates as deleteWordForward:. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _pasteFromPasteboard:]): Added a FIXME. * DOM.subproj/DOMViews.h: Updated from recent change to WebCore. 2004-05-21 Richard Williamson <rjw@apple.com> Removed _bindObject:forFrame: SPI. Reviewed by Chris. * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.h: === Safari-141 === 2004-05-21 Darin Adler <darin@apple.com> Reviewed by Ken and Chris. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _pasteFromPasteboard:]): Call replaceSelectionWithText: instead of replaceSelectionWithMarkupString: when pasting plain text. * WebView.subproj/WebDataSource.m: (-[WebDataSource _replaceSelectionWithMarkupString:baseURL:]): Remove bogus check for empty markup. There's nothing wrong with an empty string, and no reason that replacing with empty string should be a no-op instead of a delete. 2004-05-20 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed <rdar://problem/3662383>: (REGRESSION: drag slide-back sometimes causes link to load) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge handleMouseDragged:]): Added BOOL result to handleMouseDragged:. * WebView.subproj/WebHTMLViewPrivate.h: Added BOOL result to _handleMouseDragged:. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _handleMouseDragged:]): Added BOOL result, returning YES when the drag started, and no when the hysteresis has not yet been overcome. 2004-05-20 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt Provide the methods to glue the WebView's editing delegate so that these methods work: <rdar://problem/3655316>: "Editing: -webViewShouldBeginEditing:inDOMRange: method unimplemented (WebKit editing API)" <rdar://problem/3655317>: "Editing: -webViewShouldEndEditing:inDOMRange: method unimplemented (WebKit editing API)" * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge shouldBeginEditing:]): New method used to glue delegate to focus shifts. (-[WebBridge shouldEndEditing:]): Ditto. * WebView.subproj/WebView.m: (-[WebView _shouldBeginEditingInDOMRange:]): Ditto. (-[WebView _shouldEndEditingInDOMRange:]): Ditto. * WebView.subproj/WebViewPrivate.h: Ditto. 2004-05-20 Richard Williamson <rjw@apple.com> Fixed typo in header comment. Reviewed by Ken. * Plugins.subproj/WebScriptObject.h: 2004-05-19 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3462627>: (API: Need a way to disable/customize dragging) Reviewed by john. * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeImage:URL:title:archive:types:]): fixed bug that caused exception * WebView.subproj/WebDefaultUIDelegate.m: (-[WebDefaultUIDelegate webView:shouldBeginDragForElement:dragImage:mouseDownEvent:mouseDraggedEvent:]): new, returns YES (-[WebDefaultUIDelegate webView:dragOperationForDraggingInfo:overElement:]): new, returns [WebView dragOperationForDraggingInfo:] (-[WebDefaultUIDelegate webView:shouldProcessDragWithDraggingInfo:overElement:]): new, returns YES * WebView.subproj/WebDocumentInternal.h: added WebDocumentDragging and WebDocumentElement for document dragging * WebView.subproj/WebDocumentPrivate.h: moved WebDocumentSelection to WebDocumentInternal.h * WebView.subproj/WebFrame.m: (-[WebFrame _actionInformationForNavigationType:event:originalURL:]): * WebView.subproj/WebHTMLView.h: * WebView.subproj/WebHTMLView.m: (+[WebHTMLView _insertablePasteboardTypes]): new (-[WebHTMLView _handleMouseDragged:]): call shouldBeginDragForElement:::: delegate API (-[WebHTMLView _mayStartDragWithMouseDragged:]): call renamed elementAtPoint SPI (-[WebHTMLView initWithFrame:]): don't register for drag types since this is handled at the WebView (-[WebHTMLView menuForEvent:]): call renamed elementAtPoint SPI (-[WebHTMLView _isSelectionEvent:]): call renamed elementAtPoint SPI (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): rather than unregistering drag types on the WebView, just tell it that we're dragging (-[WebHTMLView draggedImage:endedAt:operation:]): ditto (-[WebHTMLView _canProcessDragWithDraggingInfo:]): new (-[WebHTMLView dragOperationForDraggingInfo:]): new WebDocumentDragging SPI (-[WebHTMLView draggingUpdatedWithDraggingInfo:]): ditto (-[WebHTMLView concludeDragForDraggingInfo:]): ditto (-[WebHTMLView elementAtPoint:]): renamed from _elementAtPoint since this is part of the WebDocumentElement SPI * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebImageView.h: * WebView.subproj/WebImageView.m: (-[WebImageView elementAtPoint:]): new (-[WebImageView menuForEvent:]): call elementAtPoint (-[WebImageView mouseDragged:]): rather than unregistering drag types on the WebView, just tell it that we're dragging (-[WebImageView draggedImage:endedAt:operation:]): ditto * WebView.subproj/WebTextView.h: * WebView.subproj/WebTextView.m: (-[WebTextView _elementAtWindowPoint:]): new (-[WebTextView elementAtPoint:]): new (-[WebTextView menuForEvent:]): call _elementAtWindowPoint * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebViewPrivate dealloc]): removed draggedTypes ivar (+[WebView URLFromPasteboard:]): implemented (+[WebView URLTitleFromPasteboard:]): implemented (-[WebView _registerDraggedTypes]): moved (-[WebView _frameViewAtWindowPoint:]): new (-[WebView _draggingDocumentViewAtWindowPoint:]): new (-[WebView _elementAtWindowPoint:]): new (-[WebView dragOperationForDraggingInfo:]): updated this API to handle subviews that may want to handle drags (-[WebView _dragOperationForDraggingInfo:]): new, handles UI delegate for drag control (-[WebView draggingEntered:]): call _dragOperationForDraggingInfo: (-[WebView draggingUpdated:]): ditto (-[WebView concludeDragOperation:]): work with the UI delegate and the subview to handle what happens * WebView.subproj/WebViewPrivate.h: 2004-05-19 Richard Williamson <rjw@apple.com> Removed extraneous tabs that were added (by XCode?). * DOM.subproj/DOM-compat.h: * Plugins.subproj/WebScriptObject.h: 2004-05-19 Richard Williamson <rjw@apple.com> Updated header copy script to only copy if modified headers are different. * copy-webcore-files-to-webkit: 2004-05-19 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt and Darin Fix for this bug: <rdar://problem/3643230>: "can't tab out of contentEditable Elements" * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge interceptEditingKeyEvent:]): Renamed from _editingKeyDown. Also now returns a BOOL to report whether the event was handled or not. * WebView.subproj/WebView.m: (-[WebView _interceptEditingKeyEvent:]): Also renamed from _editingKeyDown. Now includes a check if the web view is editable and whether the event is a tab key event. If the former is not true and the latter is, the key is not intercepted. This causes the tab to shift once the key is processed by other non-editing key-handling mechanisms. * WebView.subproj/WebViewPrivate.h: Changed declaration due to name change. 2004-05-19 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge isEditable]): Return the isEditable value for the WebView which contains this bridge's frame. 2004-05-19 Darin Adler <darin@apple.com> - fixed headers with licenses mangled by Xcode auto-indenting * DOM.subproj/DOMExtensions.h: * WebCoreSupport.subproj/WebGraphicsBridge.h: * WebCoreSupport.subproj/WebGraphicsBridge.m: 2004-05-18 David Hyatt <hyatt@apple.com> Improve layout scheduling. Reviewed by kocienda * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToLayoutAcceptable]): (-[WebFrame _checkLoadCompleteForThisFrame]): * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): 2004-05-18 Richard Williamson <rjw@apple.com> Finished implementation of windowScriptObject. Reviewed by Maciej. * WebView.subproj/WebView.m: (-[WebView windowScriptObject]): 2004-05-18 Richard Williamson <rjw@apple.com> Added WebKit portion of webView:windowScriptObjectAvailable: implementation. Still need to implement creating the WebScriptObject wrapper on the WebCore side. Reviewed by Maciej. Removed "_" from _setPageWidthForPrinting:. This method facilitates a work-around for carbon printing. At some point we may make this method public API. Reviewed by Chris. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge overrideMediaType]): (-[WebBridge windowObjectCleared]): * WebView.subproj/WebDefaultFrameLoadDelegate.m: (-[WebDefaultFrameLoadDelegate webView:windowScriptObjectAvailable:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView setPageWidthForPrinting:]): 2004-05-18 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3520322>: "can't use <WebKit/HIWebView.h> or <WebKit/CarbonUtils.h> from non-Objective C" * Carbon.subproj/CarbonUtils.h: Added ifdefs so file compiles when included from non-Objective-C. Changed style to match other Carbon headers a bit more closely. Also remove unnecessary includes. * Carbon.subproj/HIWebView.h: Ditto. - fixed <rdar://problem/3648505>: "this text file scrolls to the second line instead of first when pressing home" * WebView.subproj/WebFrameView.m: (-[WebFrameView _scrollToTopLeft]): Scroll to origin.y instead of assuming that top is 0; can be non-0 for text view. (-[WebFrameView _scrollToBottomLeft]): Use NSMaxY instead of height for the same reason. 2004-05-17 David Hyatt <hyatt@apple.com> Fix for performance regression in PLT caused by not setting _timeOfLastCompletedLoad, causing page cache to release during the benchmark. * WebView.subproj/WebFrame.m: (-[WebFrame _setState:]): 2004-05-17 Chris Blumenberg <cblu@apple.com> Implemented new WebView pasteboard methods. Made a lot of factoring changes related to pasteboard management. Reviewed by john. * Misc.subproj/WebNSPasteboardExtras.h: * Misc.subproj/WebNSPasteboardExtras.m: (+[NSPasteboard _web_writableTypesForURL]): renamed to not include "drag" these types are also used for copying (+[NSPasteboard _web_writableTypesForImage]): new (-[NSPasteboard _web_bestURL]): tweak (-[NSPasteboard _web_writeURL:andTitle:types:]): take an array of types that this method should write, don't declare the types since this complicates things for the caller (-[NSPasteboard _web_writeImage:URL:title:archive:types:]): ditto * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragImage:archive:rect:URL:title:event:]): call renamed methods * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate copyLinkToClipboard:]): call code factored out to WebView (-[WebDefaultUIDelegate copyImageToClipboard:]): ditto * WebView.subproj/WebDocumentPrivate.h: * WebView.subproj/WebHTMLView.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _selectedRTFData]): new factored out method (-[WebHTMLView _writeSelectionToPasteboard:]): factored code out to writeSelectionWithPasteboardTypes:toPasteboard: (-[WebHTMLView _dragImageForLinkElement:]): tweak (-[WebHTMLView _handleMouseDragged:]): call renamed methods (-[WebHTMLView pasteboardTypesForSelection]): new (-[WebTextView writeSelectionWithPasteboardTypes:toPasteboard:]): new, code moved from _writeSelectionToPasteboard: * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebImageView.h: * WebView.subproj/WebImageView.m: (-[WebImageView writeImageToPasteboard:types:]): call renamed methods (-[WebImageView copy:]): (-[WebImageView writeSelectionToPasteboard:types:]): call renamed methods * WebView.subproj/WebTextView.h: * WebView.subproj/WebTextView.m: (-[WebTextView pasteboardTypesForSelection]): new (-[WebTextView writeSelectionWithPasteboardTypes:toPasteboard:]): new * WebView.subproj/WebView.m: (-[WebView _writeImageElement:withPasteboardTypes:toPasteboard:]): new (-[WebView _writeLinkElement:withPasteboardTypes:toPasteboard:]): mew (-[WebView dragOperationForDraggingInfo:]): implemented API (-[WebView draggingEntered:]): call API (-[WebView draggingUpdated:]): ditto (-[WebView concludeDragOperation:]): ditto (-[WebView pasteboardTypesForSelection]): implemented API (-[WebView writeSelectionWithPasteboardTypes:toPasteboard:]): ditto (-[WebView pasteboardTypesForElement:]): ditto (-[WebView writeElement:withPasteboardTypes:toPasteboard:]): ditto * WebView.subproj/WebViewPrivate.h: 2004-05-17 Ken Kocienda <kocienda@apple.com> Reviewed by John Remove overrides in WebView for scrollPageDown and scrollPageUp. NSView behavior gives us just what we want, and there is no special behavior required for editing. <rdar://problem/3655364>: "Editing: -scrollPageDown: method unimplemented (WebKit editing API)" <rdar://problem/3655365>: "Editing: -scrollPageUp: method unimplemented (WebKit editing API)" * WebView.subproj/WebView.h: Comment methods out and add a note about why. * WebView.subproj/WebView.m: Remove stubbed out implementation. 2004-05-14 Vicki Murley <vicki@apple.com> Reviewed by mjs. <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release * WebKit.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0 2004-05-14 David Hyatt <hyatt@apple.com> Eliminate timedLayout. Reviewed by darin * WebView.subproj/WebFrame.m: (-[WebFramePrivate dealloc]): (-[WebFrame _detachFromParent]): (-[WebFrame _transitionToLayoutAcceptable]): (-[WebFrame _setState:]): (-[WebFrame _checkLoadCompleteForThisFrame]): (-[WebFrame stopLoading]): * WebView.subproj/WebFramePrivate.h: === Safari-140 === 2004-05-14 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3655495>: (exception loading applets) Reviewed by kocienda. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): when calling old cocoa plug-ins, use old keys 2004-05-14 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3655204>: (repro assertion failure and crash loading java applets) Reviewed by kocienda. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): call pluginViewWithArguments: for old Cocoa plug-ins 2004-05-14 Chris Blumenberg <cblu@apple.com> Copied headers from WebCore. * DOM.subproj/DOMCore.h: * DOM.subproj/DOMEvents.h: 2004-05-14 Ken Kocienda <kocienda@apple.com> Reviewed by me * Plugins.subproj/WebPluginController.m: (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]): Fixed a compile error: undeclared identifier. Looked like a typo. 2004-05-13 Richard Williamson <rjw@apple.com> Backed out mistaken change that I didn't mean to checkin. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): 2004-05-13 Richard Williamson <rjw@apple.com> Updated to reflect new API. Reviewed by Chris. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setIsSelected:forView:]): * WebView.subproj/WebFrame.m: (-[WebFrame _reloadForPluginChanges]): 2004-05-13 Chris Blumenberg <cblu@apple.com> Fixed some indenting issues in public headers. * Plugins.subproj/WebJavaPlugIn.h: * Plugins.subproj/WebPlugin.h: * Plugins.subproj/WebScriptObject.h: * WebView.subproj/WebEditingDelegate.h: * WebView.subproj/WebFrameView.h: * WebView.subproj/WebPolicyDelegate.h: * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebView.h: 2004-05-13 Ken Kocienda <kocienda@apple.com> Reviewed by Chris Moved -DOMDocument convenience back to private header. I mistakenly moved it to the public header earlier today. * WebView.subproj/WebView.h: Removed * WebView.subproj/WebViewPrivate.h: Re-added 2004-05-13 Richard Williamson <rjw@apple.com> Updated to implementation to reflect new API. Left old SPI in place for compatibility. Can remove when the Java plug-in updates. Reviewed by Chris. * Plugins.subproj/WebPlugin.h: * Plugins.subproj/WebPluginContainer.h: * Plugins.subproj/WebPluginController.h: * Plugins.subproj/WebPluginController.m: (-[WebPluginController startAllPlugins]): (-[WebPluginController stopAllPlugins]): (-[WebPluginController addPlugin:]): (-[WebPluginController destroyAllPlugins]): (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]): (-[WebPluginController showURL:inFrame:]): (-[WebPluginController webPlugInContainerShowStatus:]): (-[WebPluginController showStatus:]): (-[WebPluginController webPlugInContainerSelectionColor]): (-[WebPluginController selectionColor]): (-[WebPluginController webFrame]): 2004-05-13 Chris Blumenberg <cblu@apple.com> - Added stubs for WebView action and drag & drop customization API's - Fixed: <rdar://problem/3616555>: (API: Make DOM extensions and WebKit DOM operations public) Reviewed by rjw. * DOM.subproj/WebDOMOperations.h: added remaining DOM operations * DOM.subproj/WebDOMOperationsPrivate.h: * Misc.subproj/WebKit.h: added new public headers * WebKit.pbproj/project.pbxproj: * WebKit.exp: added symbol for WebElementDOMNodeKey * WebView.subproj/WebUIDelegate.h: added new UI delegate methods * WebView.subproj/WebView.h: added new pasteboard related methods * WebView.subproj/WebView.m: (+[WebView URLFromPasteboard:]): new stub (+[WebView URLTitleFromPasteboard:]): new stub (-[WebView dragOperationForDraggingInfo:]): new stub (-[WebView pasteboardTypesForSelection]): new stub (-[WebView writeSelectionWithPasteboardTypes:toPasteboard:]): new stub (-[WebView pasteboardTypesForElement:]): new stub (-[WebView writeElement:withPasteboardTypes:toPasteboard:]): new stub * WebView.subproj/WebViewPrivate.h: 2004-05-13 Richard Williamson <rjw@apple.com> Changed imports of all DOM headers. DOM headers should be imported using the normal #import <WebCore/foo.h>, they import is modified when copied to WebKit. Other approved API changes. Currently unimplemented. Reviewed by Chris. * ChangeLog: * DOM.subproj/DOM.h: * DOM.subproj/DOMCSS.h: * DOM.subproj/DOMCore.h: * DOM.subproj/DOMEvents.h: * DOM.subproj/DOMExtensions.h: * DOM.subproj/DOMHTML.h: * DOM.subproj/DOMRange.h: * DOM.subproj/DOMStylesheets.h: * DOM.subproj/DOMTraversal.h: * DOM.subproj/DOMViews.h: * Plugins.subproj/WebPlugin.h: * Plugins.subproj/WebPluginContainer.h: * Plugins.subproj/WebPluginPackage.m: * Plugins.subproj/WebPluginViewFactory.h: * Plugins.subproj/WebScriptObject.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebFrameLoadDelegate.h: * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView windowScriptObject]): * copy-webcore-files-to-webkit: 2004-05-13 Ken Kocienda <kocienda@apple.com> Reviewed by Kevin Move WebKit editing APIs to public API files. * WebCoreSupport.subproj/WebBridge.m: Add WebEditingDelegate include. * WebKit.pbproj/project.pbxproj: Go Xcode! * WebView.subproj/WebDefaultEditingDelegate.m: Remove WebViewPrivate include; add WebEditingDelegate include. * WebView.subproj/WebEditingDelegate.h: Added. New file. * WebView.subproj/WebView.h: Move API-approved interfaces to this file. * WebView.subproj/WebView.m: Add WebEditingDelegate include. * WebView.subproj/WebViewPrivate.h: Move API-approved interfaces from this file. 2004-05-12 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3633296>: (Japanese input is not working properly in Carbon Web Kit applications (including CarbonWeb)) <rdar://problem/3631390>: (can't toggle between Input Methods (IMEs) using cmd-space in Carbon Web Kit applications) Reviewed by rjw. * Carbon.subproj/CarbonWindowAdapter.m: (-[CarbonWindowAdapter sendSuperEvent:]): call [NSInputContext processInputKeyBindings:inEvent] just as NSApp does * Carbon.subproj/HIWebView.m: (HIWebViewEventHandler): [NSApp setWindowsNeedUpdate:YES] must be called before events so that ActivateTSMDocument is called to set an active document. Without an active document, TSM will use a default document which uses a bottom-line input window which we don't want. 2004-05-11 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3616537>: (API: Make WebResource, WebArchive and related API's public) <rdar://problem/3616471>: (API: provide way to get from WebFrame to DOMDocument and vice versa) Reviewed by rjw. * DOM.subproj/WebDOMOperations.h: * DOM.subproj/WebDOMOperations.m: (-[DOMHTMLFrameElement contentFrame]): new (-[DOMHTMLIFrameElement contentFrame]): new (-[DOMHTMLObjectElement contentFrame]): new * DOM.subproj/WebDOMOperationsPrivate.h: * Misc.subproj/WebNSImageExtras.m: (-[NSImage _web_saveAndOpen]): fixed leak * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource _addSubresources:]): made private (-[WebDataSource _archiveWithMarkupString:nodes:]): handle object tags with frame content (-[WebDataSource _archiveWithCurrentState:]): renamed from _archive, now takes flag (-[WebDataSource _replaceSelectionWithArchive:]): call renamed _addSubresources (-[WebDataSource webArchive]): new (-[WebDataSource mainResource]): new (-[WebDataSource subresources]): made public (-[WebDataSource subresourceForURL:]): made public (-[WebDataSource addSubresource:]): made public * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDocumentPrivate.h: * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (-[WebFrame _loadRequest:subresources:subframeArchives:]): call renamed _addSubresources (-[WebFrame DOMDocument]): new (-[WebFrame frameElement]): new (-[WebFrame loadArchive:]): made public * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation loadArchive]): call renamed _addSubresources * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation archive]): call webArchive on WebDataSource 2004-05-10 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - avoid redecoding animated images that are only used once for ~2.5% iBench speedup (WebCore part of fix) * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer increaseUseCount]): (-[WebImageRenderer decreaseUseCount]): (-[WebImageRenderer retainOrCopyIfNeeded]): 2004-05-10 Maciej Stachowiak <mjs@apple.com> Fix build. * WebView.subproj/WebFrame.m: 2004-05-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. - avoid messing with undo manager needlessly for ~1% HTML iBench speedup * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge registerCommandForUndo:]): mark undo/redo item flag (-[WebBridge registerCommandForRedo:]): ditto (-[WebBridge clearUndoRedoOperations]): check flag before removing items, and clear it after removing them 2004-05-08 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - -[WebFrame childFrames] is so hot that a special internal version which avoids the copy and autorelease results in a .75% performance improvement on HTML iBench. * WebView.subproj/WebFramePrivate.h: Prototype new method. * WebView.subproj/WebFrame.m: (-[WebFrame _internalChildFrames]): New method, just returns internal value instead of copying. (-[WebFrame _descendantFrameNamed:]): Use it (-[WebFrame _textSizeMultiplierChanged]): likewise (-[WebFrame _viewWillMoveToHostWindow:]): likewise (-[WebFrame _viewDidMoveToHostWindow]): likewise (-[WebFrame _saveDocumentAndScrollState]): likewise (-[WebFrame _numPendingOrLoadingRequests:]): likewise (-[WebFrame _checkLoadComplete]): Refactored this and it's two helpers a little so we could get away with using _internalChildFrames. (-[WebFrame _checkLoadCompleteForThisFrame]): Renamed from _isLoadComplete (-[WebFrame _recursiveCheckLoadComplete]): renamed from (class method) _recursiveCheckCompleteFromFrame: * WebView.subproj/WebDataSource.m: (-[WebDataSource _defersCallbacksChanged]): Use it (-[WebDataSource isLoading]): likewise * WebView.subproj/WebView.m: (-[WebView _frameForDataSource:fromFrame:]): likewise (-[WebView _frameForView:fromFrame:]): likewise 2004-05-10 Chris Blumenberg <cblu@apple.com> Forgot to commit this copied header. * DOM.subproj/DOMExtensions.h: === Safari-139 === 2004-05-06 Chris Blumenberg <cblu@apple.com> * DOM.subproj/WebDOMOperations.h: improved a header doc comment 2004-05-05 Chris Blumenberg <cblu@apple.com> - DOM Extensions API tweaks Reviewed by kocienda. * DOM.subproj/DOMExtensions.h: copied from WebCore * DOM.subproj/WebDOMOperations.h: added header doc comments * DOM.subproj/WebDOMOperations.m: (-[DOMNode _URLsFromSelectors:]): use renamed URLWithAttributeString (-[DOMDocument URLWithAttributeString:]): renamed (-[DOMHTMLTableElement _web_background]): new private method (-[DOMHTMLTableElement _subresourceURLs]): use new private method (-[DOMHTMLTableCellElement _web_background]): new private method (-[DOMHTMLTableCellElement _subresourceURLs]): use new private method 2004-05-04 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt * DOM.subproj/DOMTraversal.h: File coppied from WebCore 2004-05-02 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed <rdar://problem/3640419>: "_webkit_stringByReplacingValidPercentEscapes does not handle %00 properly" * Misc.subproj/WebNSURLExtras.m: (-[NSString _webkit_stringByReplacingValidPercentEscapes]): Use the function in NSURL instead of implementing our own here. 2004-04-30 John Sullivan <sullivan@apple.com> * WebView.subproj/WebView.m: fixed deployment build breakage 2004-04-30 John Sullivan <sullivan@apple.com> - more work on getting the font panel to work with editable HTML. The font panel in Blot now correctly reflects the first selected font when the selection is at least one character long. Reviewed by Ken. * WebView.subproj/WebView.m: removed unfinished plumbing to support reflecting selected attributes (e.g. text color, underline) in font panel, since this doesn't work in Mail or TextEdit either. (_fontFromStyle): removed assertion for now (-[WebView _updateFontPanel]): now uses new bridge method to get the NSFont from the node, instead of trying to create an NSFont from a DOMCSSStyleDeclaration 2004-04-29 John Sullivan <sullivan@apple.com> - more work on getting the font panel to work with editable HTML Reviewed by Ken. * WebView.subproj/WebView.m: (-[WebView computedStyleForElement:pseudoElement:]): convert nil pseudoElement to empty string because lower level chokes on nil (_fontFromStyle): I tried to implement this, but was thwarted by missing API, so I added a bunch of FIXMEs instead (_stylesRepresentSameFont): new function, not yet implementable (_stylesRepresentSameAttributes): new function, not yet implementable (-[WebView _updateFontPanel]): added code to get first and last element in selection, and to use NodeIterator to walk through the entire selection to see if more than one font or set of attributes is in use. However, createNodeIterator is declared in DOMTraversal.h but not actually defined anywhere, so I had to prevent this code from actually being called. 2004-04-28 Chris Blumenberg <cblu@apple.com> - Made WebArchive and WebResource conform to NSCoding and NSCopying. Reviewed by rjw. * DOM.subproj/WebDOMOperations.h: added header doc comment for WebArchive methods * WebView.subproj/WebArchive.h: * WebView.subproj/WebArchive.m: (-[WebArchive initWithCoder:]): new (-[WebArchive encodeWithCoder:]): new (-[WebArchive copyWithZone:]): new * WebView.subproj/WebResource.h: * WebView.subproj/WebResource.m: (-[WebResource init]): new (-[WebResource initWithData:URL:MIMEType:textEncodingName:frameName:]): call [self init] (-[WebResource initWithCoder:]): new (-[WebResource encodeWithCoder:]): new (-[WebResource copyWithZone:]): new 2004-04-28 John Sullivan <sullivan@apple.com> A little bit more progress in wiring up the font panel. Reviewed by Ken. * WebView.subproj/WebViewInternal.h: put _updateFontPanel here. Also moved _isLoading here, since it was already in a category named WebInternal * WebView.subproj/WebView.m: (-[WebView _isLoading]): moved into WebInternal category implementation (_textAttributesFromStyle): changed from method to function (_fontFromStyle): added, guts not filled in yet (-[WebView _updateFontPanel]): now calls these two functions (but results are always nil) (-[WebView setSelectedDOMRange:affinity:]): remove call to _updateFontPanel here since it's now called in the proper bottleneck * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge postDidChangeNotification]): call -[WebView _updateFontPanel] in addition to sending notification (-[WebBridge postDidChangeSelectionNotification]): ditto 2004-04-28 John Sullivan <sullivan@apple.com> - fixed these bugs: <rdar://problem/3636570>: "API: [WebPreferences tabsToLinks] should be public API" <rdar://problem/3610597>: "API: could turn "stealth browsing" preference into API" Reviewed by Darin. I just moved the declarations and implementations from one place to another. (No clients in WebKit needed their #imports updated.) This confused cvs diff quite a bit. * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (-[WebPreferences setTabsToLinks:]): (-[WebPreferences tabsToLinks]): (-[WebPreferences setPrivateBrowsingEnabled:]): (-[WebPreferences privateBrowsingEnabled]): (-[WebPreferences _pageCacheSize]): (-[WebPreferences _objectCacheSize]): (-[WebPreferences _backForwardCacheExpirationInterval]): * WebView.subproj/WebPreferencesPrivate.h: 2004-04-27 David Hyatt <hyatt@apple.com> Cut the time spent on an operation inside widthForNextCharacter from 17% of the function time down to less than 5% merely by adding a check for non-zero letter-spacing (thus avoiding double precision math in the common case where we just add 0 between letters). Reviewed by rjw * WebCoreSupport.subproj/WebTextRenderer.m: (widthForNextCharacter): 2004-04-28 John Sullivan <sullivan@apple.com> Initial plumbing to get the font panel to be updated from an editable WebView. Reviewed by Ken. * WebView.subproj/WebView.m: (-[WebView _textAttributesFromStyle:]): new dummy method, will need implementation (-[WebView _updateFontPanel]): new method, sets the font shown in the font panel from the current selection. Lots of placeholder stuff. (-[WebView setSelectedDOMRange:affinity:]): call _updateFontPanel here for now. 2004-04-28 Ken Kocienda <kocienda@apple.com> Reviewed by Darin * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge postDidChangeNotification]): Posts Cocoa notification when the document changes due to editing. (-[WebBridge postDidChangeSelectionNotification]): Posts Cocoa notification when the document selection changes. * WebKit.exp: Export editing notification string constants. * WebView.subproj/WebView.m: Define editing notification string constants. (-[WebView computedStyleForElement:pseudoElement:]): Add implementation. (-[WebView setEditingDelegate:]): Do work to set up delegate to receive notification callbacks. (-[WebView DOMDocument]): Simplify to just call the bridge DOMDocument. No need to jump through hoops here. (-[WebView insertNewline:]): Consult delegate before taking action. (-[WebView deleteBackward:]): Ditto. (-[WebView insertText:]): Ditto. 2004-04-27 John Sullivan <sullivan@apple.com> Fixed broken development build. * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToLayoutAcceptable]): updated bad variable name used only in LOG statement to match recent change. 2004-04-27 Richard Williamson <rjw@apple.com> Fixes for: <rdar://problem/3279301>: API: WebKitErrorCannotFindPlugin and WebKitErrorCannotLoadPlugin should use PlugIn <rdar://problem/3278513>: API: Need API to control the size of WebHistory <rdar://problem/3564519>: API: please add a way to set the media type for a WebView <rdar://problem/3565642>: API: allow a way to extend the MIME types that a WebView will display <rdar://problem/3577693>: API: add ability to subclass WebView but still use it with Carbon Reviewed by Chris. * Carbon.subproj/HIWebView.h: * Carbon.subproj/HIWebView.m: (HIWebViewCreate): (HIWebViewCreateWithClass): (HIWebViewConstructor): * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: (-[WebHistoryPrivate setHistoryAgeInDaysLimit:]): (-[WebHistoryPrivate historyAgeInDaysLimit]): (-[WebHistoryPrivate setHistoryItemLimit:]): (-[WebHistoryPrivate historyItemLimit]): (-[WebHistoryPrivate _ageLimitDate]): (-[WebHistoryPrivate arrayRepresentation]): (-[WebHistory setHistoryItemLimit:]): (-[WebHistory historyItemLimit]): (-[WebHistory setHistoryAgeInDaysLimit:]): (-[WebHistory historyAgeInDaysLimit]): * History.subproj/WebHistoryPrivate.h: * Misc.subproj/WebKitErrors.h: * Misc.subproj/WebKitErrors.m: (registerErrors): * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge isViewSelected:]): (-[WebBridge overrideMediaType]): * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebViewPrivate dealloc]): (+[WebView MIMETypesShownAsHTML]): (+[WebView setMIMETypesShownAsHTML:]): (-[WebView customUserAgent]): (-[WebView setMediaStyle:]): (-[WebView mediaStyle]): * WebView.subproj/WebViewPrivate.h: 2004-04-27 David Hyatt <hyatt@apple.com> Eliminate the preferences for timed/resource layouts. Accessing them is now taking 0.5% on the cvs-base test, so we're just going to hardcode the values instead. Reviewed by mjs * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToLayoutAcceptable]): (-[WebFrame _isLoadComplete]): * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): (-[WebPreferences _objectCacheSize]): * WebView.subproj/WebPreferencesPrivate.h: * WebView.subproj/WebView.m: (-[WebView _mainReceivedBytesSoFar:fromDataSource:complete:]): 2004-04-27 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt Make selections draw in a more Cocoa-like way, where fully-selected lines draw out to the ends of lines, and spaces between lines are drawn with the selection color as well. * Misc.subproj/WebKitNSStringExtras.m: Use new WebCoreTextGeometry struct. No change in functionality. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawRun:style:geometry:]): Use new WebCoreTextGeometry struct. No change in functionality. (-[WebTextRenderer drawHighlightForRun:style:geometry:]): Ditto. (-[WebTextRenderer _CG_drawHighlightForRun:style:geometry:]): Many changes to add the new selection drawing behavior. (-[WebTextRenderer _CG_drawRun:style:geometry:]): Use new WebCoreTextGeometry struct. No change in functionality. (-[WebTextRenderer _ATSU_drawHighlightForRun:style:geometry:]): Many changes to add the new selection drawing behavior. (-[WebTextRenderer _ATSU_drawRun:style:geometry:]): Use new WebCoreTextGeometry struct. No change in functionality. 2004-04-26 Richard Williamson <rjw@apple.com> Added support for specifying composite operation on an image element, i.e.: <img composite="source-over" src="triangle.png"> <img style="position:relative; left:-200px;" composite="destination-in" src="circle.png"> This feature was requested by the dashboard guys. They can use it to apply transparency masks to widgies. Reviewed by Ken. * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer initWithMIMEType:]): (-[WebImageRenderer initWithData:MIMEType:]): (-[WebImageRenderer initWithContentsOfFile:]): (-[WebImageRenderer copyWithZone:]): (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): (-[WebImageRenderer drawImageInRect:fromRect:]): (-[WebImageRenderer drawImageInRect:fromRect:compositeOperator:]): 2004-04-26 Chris Blumenberg <cblu@apple.com> More header doc changes after John's review. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebResource.h: 2004-04-26 Chris Blumenberg <cblu@apple.com> * WebView.subproj/WebDataSourcePrivate.h: added some header doc comments * WebView.subproj/WebFramePrivate.h: fixed header doc typo 2004-04-24 Darin Adler <darin@apple.com> Reviewed by Dave. * Misc.subproj/WebNSURLExtras.m: (hexDigit): Use capitalized hex, not lowercase, for consistency with similar functions in WebCore and what other web browsers do. 2004-04-23 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed <rdar://problem/3627362>: "bad access with libgmalloc in -[_WebCoreHistoryProvider containsItemForURLUnicode:length:]" * History.subproj/WebHistory.m: (-[_WebCoreHistoryProvider containsItemForURLUnicode:length:]): Add range checks so we don't overrun the buffer while looking for slashes. 2004-04-23 Chris Blumenberg <cblu@apple.com> Reviewed by John Added header doc comments to proposed API's. * WebView.subproj/WebArchive.h: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebResource.h: === Safari-138 === 2004-04-23 Ken Kocienda <kocienda@apple.com> Reviewed by John Added some plumbing for applying styles. * DOM.subproj/DOMExtensions.h: Copied from WebCore. * WebView.subproj/WebView.m: (-[WebView DOMDocument]): Added new helper. (-[WebView styleDeclarationWithText:]): Added new helper. * WebView.subproj/WebViewPrivate.h: Declare above methods. 2004-04-22 Richard Williamson <rjw@apple.com> Updates to plugin binding APIs. Updates to Java plugin APIs. Transparency fix for Dashboard. Reviewed by John and Greg Bolsinga. * Plugins.subproj/WebPluginJava.h: Added. New API for Java plugin. * Plugins.subproj/npfunctions.h: * Plugins.subproj/npruntime.h: (_NPString::): (_NPString::_NPVariant::): * Plugins.subproj/npsap.h: Added. New API for plugin bindings. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): Update for Dashboard. View must fill with transparency when not drawing background. * copy-webcore-files-to-webkit: 2004-04-22 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt More work to bring code up to date with the latest API proposal. Note that all of the replaceXXX methods below now operate on the current selection, so the method implementations have been simplifed accordingly. * WebView.subproj/WebDataSource.m: (-[WebDataSource _replaceSelectionWithArchive:]): New name for _replaceSelectionWithWebArchive. * WebView.subproj/WebDataSourcePrivate.h: Ditto. * WebView.subproj/WebDefaultEditingDelegate.m: (-[WebDefaultEditingDelegate webViewShouldBeginEditing:inDOMRange:]): Added inDOMRange: parameter. (-[WebDefaultEditingDelegate webViewShouldEndEditing:inDOMRange:]): Ditto. (-[WebDefaultEditingDelegate webView shouldChangeSelectedDOMRange:toDOMRange:proposedRange affinity:stillSelecting:]): Missed adding affinity in last patch. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _pasteFromPasteboard:]): Call old method with new name: _replaceSelectionWithArchive * WebView.subproj/WebView.m: (-[WebView replaceSelectionWithNode:]): New version of insertNode:replacingDOMRange: (-[WebView replaceSelectionWithText:]): New version of insertText:replacingDOMRange: (-[WebView replaceSelectionWithMarkupString:]): New version of insertMarkupString:replacingDOMRange: (-[WebView replaceSelectionWithArchive:]): New version of insertWebArchive:replacingDOMRange: (-[WebView deleteSelection]): New version of deleteDOMRange: (-[WebView applyStyle:]): New version of applyStyle:toElementsInDOMRange: * WebView.subproj/WebViewPrivate.h: 2004-04-22 Ken Kocienda <kocienda@apple.com> Reviewed by John Adds the notion of selection affinity to the editing API, bringing it up to date with the latest proposal. * WebView.subproj/WebView.m: (-[WebView _alterCurrentSelection:direction:granularity:]): Pass selection affinity to the delegate. We can just pass the current one since this does not change with arrow keys. (-[WebView setSelectedDOMRange:affinity:]): Set the affinity on the selection. (-[WebView selectionAffinity]): New accessor. (-[WebView insertNode:replacingDOMRange:]): Change to pass selection affinity to call to set selection. This is just to get the code to compile for now, since this method will soon be removed in place of a similar one from the latest proposal that always works on the current selection. (-[WebView insertText:replacingDOMRange:]): Ditto. (-[WebView insertMarkupString:replacingDOMRange:]): Ditto. (-[WebView insertWebArchive:replacingDOMRange:]): Ditto. (-[WebView deleteDOMRange:]): Ditto. (-[WebView applyStyle:toElementsInDOMRange:]): Ditto. * WebView.subproj/WebViewPrivate.h: Add selection affinity to API declarations as needed. 2004-04-22 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Work around this bug: <rdar://problem/3630640>: "Calling interpretKeyEvents: in a custom text view can fail to process keys right after app startup" * WebView.subproj/WebView.m: (-[WebView _editingKeyDown:]): The issue is with a message to nil in AppKit key binding manager code. Add call to [NSKeyBindingManager sharedKeyBindingManager] to make sure the not-supposed-to-be-nil object is created before calling interpretKeyEvents:. 2004-04-22 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt Added calls to ensure caret visibility after the editing action is done. * WebView.subproj/WebView.m: (-[WebView _alterCurrentSelection:direction:granularity:]): (-[WebView insertNewline:]): (-[WebView deleteBackward:]): (-[WebView insertText:]): 2004-04-20 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3605209>: "HITLIST: REGRESSION (131-132): iframes/frames no longer dump on layout tests" Reviewed by hyatt. * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): the encoding was not being set in the about:blank case. Call receivedData:textEncodingName: as we did in the past to set it. 2004-04-20 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt Added implementations for these methods. * WebView.subproj/WebView.m: (-[WebView moveUpAndModifySelection:]): (-[WebView moveWordLeft:]): (-[WebView moveWordLeftAndModifySelection:]): (-[WebView moveWordRight:]): (-[WebView moveWordRightAndModifySelection:]): 2004-04-20 John Sullivan <sullivan@apple.com> - fixed <rdar://problem/3622393>: When in stealth mode, visited webpage contents should not be cached to disk Reviewed by Ken. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate willCacheResponse:]): if will cache to disk and in stealth mode, replace cache response with an identical one that won't cache to disk. 2004-04-19 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt * WebView.subproj/WebView.m: (-[WebView moveDown:]): Added implementation. (-[WebView moveUp:]): Added implementation. 2004-04-19 Chris Blumenberg <cblu@apple.com> Added support for pasting frames via WebArchives. Reviewed by kocienda. * WebView.subproj/WebDataSource.m: (-[WebDataSource _addSubframeArchives:]): renamed, now allows subframe archives to be added at anytime (-[WebDataSource _popSubframeArchiveWithName:]): renamed, now deletes the returned subframe to consume less memory (-[WebDataSource _replaceSelectionWithWebArchive:]): added support for subframes * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame _loadRequest:subresources:subframeArchives:]): call renamed methods (-[WebFrame _loadURL:intoChild:]): ditto * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation loadArchive]): ditto === Safari-137 === 2004-04-16 Richard Williamson <rjw@apple.com> Added an SPI to allow ObjC instances to be easily bound to JS. This is needed by the dashboard guys for their prototyping. Eventually they will use new API. Reviewed by Chris. * WebView.subproj/WebView.m: (-[WebView _bindObject:withName:toFrame:]): * WebView.subproj/WebViewPrivate.h: 2004-04-16 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3587599>: Mail Page, Web Archives don't preserve subframes Moved code that assembled subresource URLs from DOM nodes from WebCore to WebKit. Reviewed by rjw. * DOM.subproj/DOMExtensions.h: copied from WebCore * DOM.subproj/WebDOMOperations.h: * DOM.subproj/WebDOMOperations.m: (-[DOMNode webArchive]): call renamed methods (-[DOMNode markupString]): ditto (-[DOMNode _URLsFromSelectors:]): new, returns array of URLs given selectors (-[DOMNode _subresourceURLs]): new, base class does nothing, subclasses call _URLsFromSelectors with URL selectors (-[DOMDocument webFrame]): new (-[DOMRange webArchive]): call renamed methods (-[DOMRange markupString]): ditto (-[DOMHTMLBodyElement _subresourceURLs]): new (-[DOMHTMLInputElement _subresourceURLs]): new (-[DOMHTMLLinkElement _subresourceURLs]): new (-[DOMHTMLScriptElement _subresourceURLs]): new (-[DOMHTMLImageElement _subresourceURLs]): new (-[DOMHTMLEmbedElement _subresourceURLs]): new (-[DOMHTMLObjectElement _subresourceURLs]): new (-[DOMHTMLParamElement _subresourceURLs]): new (-[DOMHTMLTableElement _subresourceURLs]): new (-[DOMHTMLTableCellElement _subresourceURLs]): new * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebArchive.h: * WebView.subproj/WebArchive.m: (-[WebArchivePrivate dealloc]): release new subframeArchives ivar (-[WebArchive initWithMainResource:subresources:subframeArchives:]): take subframeArchives (-[WebArchive _initWithPropertyList:]): new, recursively creates WebArchives (-[WebArchive initWithData:]): call _initWithPropertyList (-[WebArchive subframeArchives]): new (-[WebArchive _propertyListRepresentation]): new, recursively creates property lists of WebArchives (-[WebArchive data]): call _propertyListRepresentation * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate saveResource]): call renamed methods * WebView.subproj/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): release new pendingSubframeArchives ivar (-[WebDataSource _archiveWithMarkupString:nodes:]): renamed and reimplemented, handles subframes (-[WebDataSource _archive]): new (-[WebDataSource _setPendingSubframeArchives:]): new (-[WebDataSource _archiveForFrameName:]): new * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame loadArchive:]): handle subframes (-[WebFrame _loadRequest:subresources:subframeArchives:]): ditto (-[WebFrame _loadURL:intoChild:]): use the subframe archive if we have it (-[WebFrame loadRequest:]): call renamed methods * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation loadWebArchive]): call renamed methods and handle subframes * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _selectedArchive:]): call renamed methods (-[WebHTMLView _pasteFromPasteboard:]): call renamed methods * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebImageRepresentation.h: * WebView.subproj/WebImageRepresentation.m: instead of storing some items from the data source, just store the data source (-[WebImageRepresentation dealloc]): removed use of deleted ivars (-[WebImageRepresentation URL]): use dataSource instead of ivar (-[WebImageRepresentation doneLoading]): use new boolean ivar (-[WebImageRepresentation setDataSource:]): store the data source (-[WebImageRepresentation receivedData:withDataSource:]): use dataSource instead of ivar (-[WebImageRepresentation receivedError:withDataSource:]): ditto (-[WebImageRepresentation finishedLoadingWithDataSource:]): ditto (-[WebImageRepresentation title]): ditto (-[WebImageRepresentation data]): ditto (-[WebImageRepresentation filename]): ditto (-[WebImageRepresentation archive]): ditto * WebView.subproj/WebResource.h: * WebView.subproj/WebResource.m: (-[WebResourcePrivate dealloc]): release new frame name ivar (-[WebResource initWithData:URL:MIMEType:textEncodingName:frameName:]): take a frame name (-[WebResource frameName]): new (-[WebResource _initWithPropertyList:]): handle frame name (-[WebResource _initWithCachedResponse:originalURL:]): call renamed methods (-[WebResource _propertyListRepresentation]): * WebView.subproj/WebResourcePrivate.h: handle frame name 2004-04-15 David Hyatt <hyatt@apple.com> Make sure isOpaque returns NO when the WebHTMLVIew doesn't draw its background. Reviewed by darin * WebView.subproj/WebFrameView.m: (-[WebFrameView isOpaque]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView isOpaque]): 2004-04-15 John Sullivan <sullivan@apple.com> * WebView.subproj/WebPreferencesPrivate.h: added comments 2004-04-14 Richard Williamson <rjw@apple.com> Updated fix for 3576315. Don't hardcode 22 as the titlebar height. (Note, other places in CarbonWindowFrame DO hardcode window geometry information, yuck!). Reviewed by Hyatt. * Carbon.subproj/CarbonWindowFrame.m: 2004-04-14 John Sullivan <sullivan@apple.com> - changed stealth mode preference name from "historyIsFrozen" to "privateBrowsingEnabled" Reviewed by Darin. * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): updated for method name change * WebView.subproj/WebPreferences.m: changed preference key name (+[WebPreferences initialize]): updated for preference key name change (-[WebPreferences setPrivateBrowsingEnabled:]): changed name from setHistoryIsFrozen: (-[WebPreferences privateBrowsingEnabled]): changed name from historyIsFrozen: * WebView.subproj/WebPreferencesPrivate.h: changed declared method names * English.lproj/StringsNotToBeLocalized.txt: updated for this and other recent changes 2004-04-13 Chris Blumenberg <cblu@apple.com> - Added WebElementDOMNodeKey as a potential API so that clients can get the node from an element dictionary. - Removed WebElementIsEditableKey. This functionality is available via [DOMNode isContentEditable]. Reviewed by rjw. * DOM.subproj/WebDOMOperations.h: * DOM.subproj/WebDOMOperations.m: (-[DOMDocument URLWithRelativeString:]): new potential API * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): indenting tweak (-[WebDefaultUIDelegate copyImageToClipboard:]): use WebElementDOMNodeKey * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _handleMouseDragged:]): use WebElementDOMNodeKey (-[WebHTMLView _dragOperationForDraggingInfo:]): use isContentEditable * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.h: 2004-04-13 Chris Blumenberg <cblu@apple.com> Fixed deployment build failure. Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _handleMouseDragged:]): removed use of fileWrapper variable 2004-04-12 Chris Blumenberg <cblu@apple.com> Factored out WebArchive to DOM code so that it could be used by both [WebHTMLView _pasteFromPasteboard:] and [WebView insertWebArchive:replacingDOMRange:]. Reviewed by kocienda. * WebView.subproj/WebDataSource.m: (-[WebDataSource _replaceSelectionWithMarkupString:baseURL:]): moved from WebHTMLView (-[WebDataSource _replaceSelectionWithImageResource:]): ditto (-[WebDataSource _replaceSelectionWithWebArchive:]): ditto * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _replaceSelectionWithMarkupString:]): renamed (-[WebHTMLView _pasteFromPasteboard:]): call renamed methods * WebView.subproj/WebView.m: (-[WebView insertMarkupString:replacingDOMRange:]): call renamed methods (-[WebView insertWebArchive:replacingDOMRange:]): have data source handle the archive instead of the bridge 2004-04-12 Ken Kocienda <kocienda@apple.com> Reviewed by Dave Added execCommand support for cut/copy/paste. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge issueCutCommand]): Glue for calling from WebCore to do a cut in Cocoa. (-[WebBridge issueCopyCommand]): Same as above, but for copy. (-[WebBridge issuePasteCommand]): Same as above, but for paste. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView copy:]): Move this to private implementation category so the bridge can see it. (-[WebHTMLView cut:]): Ditto. (-[WebHTMLView paste:]): Ditto. * WebView.subproj/WebHTMLViewPrivate.h: Move copy;, cut:, and paste: to private implementation category so the bridge can see it. * WebView.subproj/WebView.m: (-[WebView copy:]): Implemented by calling WebHTMLView to do the work. (-[WebView cut:]): Ditto. (-[WebView paste:]): Ditto. * WebView.subproj/WebViewPrivate.h: Added all the NSReponder methods we plan to implement as part of the WebKit editing API. 2004-04-09 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Stubbed in the entire WebKit editing API, improving some methods already present in minor ways, and adding those methods not yet present. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge editingKeyDown:]): * WebView.subproj/WebDefaultEditingDelegate.m: (-[WebDefaultEditingDelegate webView:shouldChangeSelectedDOMRange:toDOMRange:stillSelecting:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _pasteMarkupString:]): * WebView.subproj/WebView.m: (-[WebView _alterCurrentSelection:direction:granularity:]): (-[WebView _currentSelectionIsEditable]): (-[WebView computedStyleForElement:pseudoElement:]): (-[WebView _editingKeyDown:]): (-[WebView setEditable:]): (-[WebView isEditable]): (-[WebView setTypingStyle:]): (-[WebView typingStyle]): (-[WebView setSmartInsertDeleteEnabled:]): (-[WebView smartInsertDeleteEnabled]): (-[WebView setContinuousSpellCheckingEnabled:]): (-[WebView isContinuousSpellCheckingEnabled]): (-[WebView spellCheckerDocumentTag]): (-[WebView undoManager]): (-[WebView insertNode:replacingDOMRange:]): (-[WebView insertText:replacingDOMRange:]): (-[WebView insertMarkupString:replacingDOMRange:]): (-[WebView insertWebArchive:replacingDOMRange:]): (-[WebView deleteDOMRange:]): (-[WebView applyStyle:toElementsInDOMRange:]): (-[WebView centerSelectionInVisibleArea:]): (-[WebView moveBackward:]): (-[WebView moveBackwardAndModifySelection:]): (-[WebView moveDown:]): (-[WebView moveDownAndModifySelection:]): (-[WebView moveForward:]): (-[WebView moveForwardAndModifySelection:]): (-[WebView moveLeft:]): (-[WebView moveLeftAndModifySelection:]): (-[WebView moveRight:]): (-[WebView moveRightAndModifySelection:]): (-[WebView moveToBeginningOfDocument:]): (-[WebView moveToBeginningOfLine:]): (-[WebView moveToBeginningOfParagraph:]): (-[WebView moveToEndOfDocument:]): (-[WebView moveToEndOfLine:]): (-[WebView moveToEndOfParagraph:]): (-[WebView moveUp:]): (-[WebView moveUpAndModifySelection:]): (-[WebView moveWordBackward:]): (-[WebView moveWordBackwardAndModifySelection:]): (-[WebView moveWordForward:]): (-[WebView moveWordForwardAndModifySelection:]): (-[WebView moveWordLeft:]): (-[WebView moveWordLeftAndModifySelection:]): (-[WebView moveWordRight:]): (-[WebView moveWordRightAndModifySelection:]): (-[WebView pageDown:]): (-[WebView pageUp:]): (-[WebView scrollLineDown:]): (-[WebView scrollLineUp:]): (-[WebView scrollPageDown:]): (-[WebView scrollPageUp:]): (-[WebView selectAll:]): (-[WebView selectParagraph:]): (-[WebView selectLine:]): (-[WebView selectWord:]): (-[WebView copy:]): (-[WebView cut:]): (-[WebView paste:]): (-[WebView copyFont:]): (-[WebView pasteFont:]): (-[WebView delete:]): (-[WebView pasteAsPlainText:]): (-[WebView pasteAsRichText:]): (-[WebView changeFont:]): (-[WebView changeAttributes:]): (-[WebView changeDocumentBackgroundColor:]): (-[WebView changeColor:]): (-[WebView alignCenter:]): (-[WebView alignJustified:]): (-[WebView alignLeft:]): (-[WebView alignRight:]): (-[WebView indent:]): (-[WebView insertTab:]): (-[WebView insertBacktab:]): (-[WebView insertNewline:]): (-[WebView insertParagraphSeparator:]): (-[WebView changeCaseOfLetter:]): (-[WebView uppercaseWord:]): (-[WebView lowercaseWord:]): (-[WebView capitalizeWord:]): (-[WebView deleteForward:]): (-[WebView deleteBackward:]): (-[WebView deleteBackwardByDecomposingPreviousCharacter:]): (-[WebView deleteWordForward:]): (-[WebView deleteWordBackward:]): (-[WebView deleteToBeginningOfLine:]): (-[WebView deleteToEndOfLine:]): (-[WebView deleteToBeginningOfParagraph:]): (-[WebView deleteToEndOfParagraph:]): (-[WebView complete:]): (-[WebView checkSpelling:]): (-[WebView showGuessPanel:]): (-[WebView performFindPanelAction:]): (-[WebView startSpeaking:]): (-[WebView stopSpeaking:]): (-[WebView insertText:]): * WebView.subproj/WebViewPrivate.h: 2004-04-09 Darin Adler <darin@apple.com> Reviewed by Ken. - added "transparent mode" * WebView.subproj/WebFrameInternal.h: Added. Contains _updateDrawsBackground. * WebView.subproj/WebFrame.m: (-[WebFrame _makeDocumentView]): Call _updateDrawsBackground to tell the newly created KHTMLView whether to draw a background or not. (-[WebFrame _setState:]): Don't tell the scroll view to start drawing background if the WebView is not supposed to draw a background. (-[WebFrame _updateDrawsBackground]): Call setDrawsBackground: on the bridge, and do the same for all subframes. * WebView.subproj/WebFrameView.m: (-[WebFrameView setFrameSize:]): Only call setDrawsBackground:YES on the scroll view if the WebView has drawsBackground set to YES. * WebView.subproj/WebViewPrivate.h: Added new proposed API, setDrawsBackground and drawsBackground. Also added drawsBackground boolean to private structure. * WebView.subproj/WebView.m: (-[WebView _commonInitializationWithFrameName:groupName:]): Set drawsBackground to YES by default. (-[WebView setDrawsBackground:]): Added. Sets boolean and calls _updateDrawsBackground to update the flag for each frame. (-[WebView drawsBackground]): Added. Returns value of boolean. (-[WebView _bridgeForCurrentSelection]): Tweaked comment for no good reason. * WebView.subproj/WebViewInternal.h: Added, but empty for the moment. * WebView.subproj/WebFramePrivate.h: Tweaked a bit. 2004-04-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3616873>: support for pasting and drag and dropping of URLS to editable WebViews <rdar://problem/3546417>: support for pasting and drag and dropping of images to editable WebViews Reviewed by rjw. * DOM.subproj/WebDOMOperations.h: * DOM.subproj/WebDOMOperations.m: (-[DOMNode webArchive]): renamed from "archive" because "archive" collides with DOMHTMLObjectElement's method (-[DOMRange webArchive]): ditto * Misc.subproj/WebNSPasteboardExtras.h: * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeImage:URL:title:archive:]): take just an archive instead of an HTML string and file wrapper * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragImage:archive:rect:URL:title:event:]): take just an archive instead of an HTML string and file wrapper * WebView.subproj/WebDataProtocol.h: * WebView.subproj/WebDataProtocol.m: (+[NSURL _web_uniqueWebDataURL]): new (+[NSURL _web_uniqueWebDataURLWithRelativeString:]): new * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate copyImageToClipboard:]): call renamed _web_writeImage * WebView.subproj/WebFrame.m: (-[WebFrame _webDataRequestForData:MIMEType:textEncodingName:baseURL:unreachableURL:]): use _web_uniqueWebDataURL for creating a URL * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _pasteImageResource:]): new (-[WebHTMLView _pasteFromPasteboard:]): renamed, now handles images and URLs (-[WebHTMLView _handleMouseDragged:]): call renamed _web_dragImage (-[WebHTMLView paste:]): call renamed _pasteFromPasteboard (-[WebHTMLView concludeDragOperation:]): call renamed _pasteFromPasteboard * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebImageRepresentation.h: * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation archive]): new * WebView.subproj/WebImageView.m: (-[WebImageView writeImageToPasteboard:]): call renamed _web_writeImage (-[WebImageView mouseDragged:]): call renamed _web_dragImage === Safari-136 === 2004-04-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3548274>: API: DOM API for WebKit clients Reviewed by kocienda. * DOM.subproj/DOM.h: copied from WebCore * WebKit.pbproj/project.pbxproj: made our DOM headers public! 2004-04-08 Chris Blumenberg <cblu@apple.com> Moved WebArchive to its own file. Reviewed by kocienda. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebArchive.h: Added. * WebView.subproj/WebArchive.m: Added. (-[WebArchive data]): renamed from dataRepresentation * WebView.subproj/WebDataSource.m: * WebView.subproj/WebFrame.m: * WebView.subproj/WebHTMLRepresentation.m: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _writeSelectionToPasteboard:]): call renamed [WebArchive data] * WebView.subproj/WebResource.h: * WebView.subproj/WebResource.m: 2004-04-07 Chris Blumenberg <cblu@apple.com> Created WebDOMOperations which are WebKit-specific categories on DOM objects. Reviewed by rjw. * DOM.subproj/DOMExtensions.h: * DOM.subproj/WebDOMOperations.h: Added. * DOM.subproj/WebDOMOperations.m: Added. (-[DOMNode _bridge]): new (-[DOMNode archive]): new (-[DOMNode markupString]): new (-[DOMRange _bridge]): new (-[DOMRange archive]): new (-[DOMRange markupString]): new (-[DOMHTMLImageElement image]): * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge webFrame]): new * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDataSource.m: (-[WebDataSource _archiveWithMarkupString:subresourceURLStrings:]): moved from WebHTMLRepresentation * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate copyImageToClipboard:]): call markupString on the node * WebView.subproj/WebDocumentPrivate.h: * WebView.subproj/WebFrame.m: (+[WebFrame frameForDOMDocument:]): new (-[WebFrame loadArchive:]): renamed * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: * WebView.subproj/WebHTMLRepresentationPrivate.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _selectedArchive:]): renamed (-[WebHTMLView _handleMouseDragged:]): called renamed methods 2004-04-07 Darin Adler <darin@apple.com> Reviewed by Chris. * DOM.subproj/DOMCSS.h: Updated from WebCore. 2004-04-07 Ken Kocienda <kocienda@apple.com> Reviewed by Darin and Dave (many weeks ago....I am so ashamed for not landing) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge expiresTimeForResponse:]): Now adds in the difference between the Mac OS X epoch and the "standard" unix epoch when passing back a time that WebCore will use for its cache expiration determinations. 2004-04-07 Richard Williamson <rjw@apple.com> Fix for 3604388. The runtime version check (_CFExecutableLinkedOnOrAfter) used by many of our frameworks doesn't work for CFM apps. So, conditional panther bugs fixes aren't being pickup by CFM apps that use WebKit, specifically Contribute. This particular radar describes a problem that was conditionally fixed in the AppKit for panther. The work-around is to force NSBitmapImageRep to execute to conditional code. Reviewed by Maciej. * Carbon.subproj/CarbonUtils.m: (WebInitForCarbon): 2004-04-06 Richard Williamson <rjw@apple.com> Fixed 3510805. Only release pool in timer if the current nesting level of the pool matches the nesting level when the pool was created. Reviewed by Chris. * Carbon.subproj/CarbonUtils.m: (getNumPools): (WebInitForCarbon): (PoolCleaner): 2004-04-06 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3613974>: remove "to Clipboard" from context menus because it is redundant Reviewed by john. * English.lproj/Localizable.strings: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate menuItemWithTag:]): 2004-04-06 Ken Kocienda <kocienda@apple.com> Reviewed by Dave * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge issueUndoCommand]): New method. Forwards call to the undo manager. Added to support undo called via Javascript execCommand. (-[WebBridge issueRedoCommand]): Ditto. 2004-04-05 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3612580>: SPI: WebPlugin selection Reviewed by kocienda. * Plugins.subproj/WebPlugin.h: extended SPI for selection * Plugins.subproj/WebPluginContainer.h: ditto * Plugins.subproj/WebPluginController.m: (-[WebPluginController selectionColor]): new, calls [WebCoreBridge selectionColor] * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setIsSelected:forView:]): new, calls [WebPlugin setIsSelected:] (-[WebBridge isViewSelected:]): new, calls [WebPlugin isSelected] 2004-04-02 Chris Blumenberg <cblu@apple.com> Forgot to add the WebKit copy of DOMExtensions.h. * DOM.subproj/DOMExtensions.h: Added. 2004-04-02 John Sullivan <sullivan@apple.com> Reviewed by Dave. * WebView.subproj/WebPreferences.m: (-[WebPreferences historyIsFrozen]): take out OMIT_TIGER_FEATURES ifdeffing, since if we turn this into API then we'll probably want it to work in Panther also. To protect Safari users, Safari now explicitly sets historyIsFrozen to NO when starting up in Panther. * English.lproj/StringsNotToBeLocalized.txt: updated for recent changes 2004-04-02 Chris Blumenberg <cblu@apple.com> Moved the DOM extensions to their own headers Reviewed by kocienda. * DOM.subproj/DOM.h: changed from WebCore * DOM.subproj/DOMHTML.h: ditto * WebKit.pbproj/project.pbxproj: added DOMExtensions.h * copy-webcore-files-to-webkit: copy DOMExtensions.h === Safari-135 === 2004-04-01 Richard Williamson <rjw@apple.com> Fixed 3609493. Don't remove the plugin's view until after sending pluginDestroy. This change was requested by Greg and is needed in the Lavender update. Reviewed by Greg Bolsinga. * Plugins.subproj/WebPluginController.m: (-[WebPluginController destroyAllPlugins]): * Plugins.subproj/npruntime.h: 2004-03-31 John Sullivan <sullivan@apple.com> - fixed <rdar://problem/3577917>: API: mechanism for displaying error page for failed page load This was not commented on for a week in macosx-api-reviewers, so it has the silent rubber stamp of approval. Note that it isn't guarded by "Tiger only" availability macros because we (probably) want to use it in Panther for Safari. Maybe what we should do is guard the API with "Tiger only" macros but add an SPI version that Safari uses? Reviewed by Dave. * WebView.subproj/WebDataSource.h: moved unreachableURL to here * WebView.subproj/WebDataSource.m: (-[WebDataSource unreachableURL]): moved this from private category to main section * WebView.subproj/WebDataSourcePrivate.h: removed unreachableURL from here * WebView.subproj/WebFrame.h: moved loadAlternateHTMLString... to here * WebView.subproj/WebFrame.m: (-[WebFrame loadAlternateHTMLString:baseURL:forUnreachableURL:]): moved this from private category to main section * WebView.subproj/WebFramePrivate.h: removed unreachableURL from here 2004-03-31 Richard Williamson <rjw@apple.com> Changed to reflect NP_runtime.h to npruntime.h. * copy-webcore-files-to-webkit: 2004-03-31 John Sullivan <sullivan@apple.com> Reviewed by Darin. * WebView.subproj/WebPreferences.m: (-[WebPreferences historyIsFrozen]): always return NO on Panther and older, so you can't get into a state where the WebKit pref is invisibly set and affecting Safari. 2004-03-31 Darin Adler <darin@apple.com> * WebView.subproj/WebHTMLView.m: Whitespace tweaks. 2004-03-30 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3604391>: Plug-in context menus (Flash) don't work in Carbon WebKit applications (e.g., CarbonWeb) Reviewed by rjw. * Carbon.subproj/HIWebView.m: (ContextMenuClick): instead of calling menuForEvent (which is not implemented on our plug-in view) call rightMouseDown and let AppKit handle the rest 2004-03-29 John Sullivan <sullivan@apple.com> - some support for "Stealth Browsing"; add a preference that controls whether a history item is added when a page is visited. This is called "historyIsFrozen" for now, but I wouldn't be surprised to see this name change. Reviewed by Dave. * WebView.subproj/WebPreferencesPrivate.h: new historyIsFrozen, setHistoryIsFrozen: methods * WebView.subproj/WebPreferences.m: new WebKitHistoryIsFrozenPreferenceKey (+[WebPreferences initialize]): set initial value of WebKitHistoryIsFrozenPreferenceKey (-[WebPreferences setHistoryIsFrozen:]): set value of WebKitHistoryIsFrozenPreferenceKey (-[WebPreferences historyIsFrozen]): read value of WebKitHistoryIsFrozenPreferenceKey * WebView.subproj/WebFrame.m: (-[WebFrame _transitionToCommitted:]): don't add item to history if history is frozen 2004-03-29 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3559178>: navigator.language always returns "en" * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory defaultLanguageCode]): Call +[NSUserDefaults _web_preferredLanguageCode] rather than returning "en". * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2004-03-26 John Sullivan <sullivan@apple.com> - fixed <rdar://problem/3576334>: Printing "empty" page gives print error, leaves browser window UI broken Reviewed by Dave. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView knowsPageRange:]): AppKit printing mechanism can't handle the case where you tell it there is nothing at all to print, so when we hit that case we give it a degenerate 1-pixel rect to print. This prints a blank page (with correctly-placed header & footer if so configured), which matches other browsers' behavior for this page. * Plugins.subproj/npruntime.h: cvs keeps thinking I've removed a blank line from this auto-copied file. Richard said to just check it in to see if it stops doing this. === Safari-134 === 2004-03-26 John Sullivan <sullivan@apple.com> - fixed the following bugs: <rdar://problem/3601630>: command-modified keypresses that would activate links are ignored by WebKit <rdar://problem/3601604>: WebActionModifierFlagsKey not set correctly for modified keypresses that activate links <rdar://problem/3544946>: cmd-return should open a link in a new tab Reviewed by Darin. * WebView.subproj/WebFrame.m: (-[WebFrame _actionInformationForNavigationType:event:originalURL:]): Pass modifier flags always, not just for mouse events. This fixes 3601604. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView performKeyEquivalent:]): Give the bridge a chance to intercept command-modified keypresses. This fixes 3601630. Together these two changes fix 3544946. 2004-03-25 David Hyatt <hyatt@apple.com> Implement the rest of the search field. Implement onscroll at the document level. Reviewed by darin * English.lproj/Localizable.strings: * WebCoreSupport.subproj/WebBridge.m: * WebCoreSupport.subproj/WebViewFactory.m: (-[NSMenu addItemWithTitle:action:tag:]): (-[WebViewFactory submitButtonDefaultLabel]): (-[WebViewFactory cellMenuForSearchField]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _frameOrBoundsChanged]): (-[WebHTMLView viewDidMoveToWindow]): * WebView.subproj/WebHTMLViewPrivate.h: 2004-03-25 Richard Williamson <rjw@apple.com> Netscape plugin API header cleanup. Replaced our hacked up version of npapi.h with the "official SDK" npapi.h. Moved our changes to the new npfunctions.h. npfunctions.h really replaces what was defined in the Netscape npupp.h header. However, rather than use the "official SDK" npupp.h I think the cleaner npfunctions.h is better. npupp.h actually has a bunch of Mac classic specific stuff that is no longer needed. Copied npruntime.h to WebKit using Ken's copy-o-matic mechanism. Made npapi.h, npruntime.h, and npfunctions.h SPI. With a bit more consideration they will become API. They will also eventually be made available for other platforms/vendors are mozilla.org. Reviewed by Ken. * Plugins.subproj/WebBaseNetscapePluginStream.h: * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream dealloc]): (-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]): * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebNetscapePluginPackage.h: * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): * Plugins.subproj/npapi.h: * Plugins.subproj/npruntime.h: Added. * WebKit.pbproj/project.pbxproj: * copy-webcore-files-to-webkit: 2004-03-24 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3566805>: REGRESSION: When the subject of mailto is 2 byte Safari failed to send mail address and subject to Mail.app * Misc.subproj/WebNSURLExtras.m: (applyHostNameFunctionToMailToURLString): Update to handle hostnames that end just before a '?' since a '?' ends the entire part of the URL that can contain hostnames. Also change the logic so that the '?' will successfully end the search. 2004-03-24 Ken Kocienda <kocienda@apple.com> Reviewed by me * DOM.subproj/DOMHTML.h: Checking in copied over version of modified file. 2004-03-23 David Hyatt <hyatt@apple.com> Fix for 3513627, HTML mail prints upside down occasionally. Change printing so that it never resizes the WebHTMLView when formatting for printing. When computing page rects, instead of using the view's bounds, use the root layer's width instead. Reviewed by darin * WebView.subproj/WebHTMLView.m: (-[WebHTMLView knowsPageRange:]): === Safari-133 === 2004-03-17 David Hyatt <hyatt@apple.com> Expose ageLimitDate so that the autocomplete code can access it. Reviewed by john * History.subproj/WebHistory.m: (-[WebHistory ageLimitDate]): * History.subproj/WebHistoryPrivate.h: 2004-03-17 Richard Williamson <rjw@apple.com> Fixed 3591667. Plugin view is added to view hierarchy before calling init. Reviewed by Ken. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addSubview:]): 2004-03-16 Darin Adler <darin@apple.com> * DOM.subproj/DOMHTML.h: Updated from WebCore. * DOM.subproj/DOMRange.h: Ditto. 2004-03-16 Darin Adler <darin@apple.com> Reviewed by Ken. - update for new DOM namespacing and header organization * DOM.subproj/DOM.h: Changed to include the other DOM headers. * DOM.subproj/DOMCSS.h: Added. * DOM.subproj/DOMCore.h: Added. * DOM.subproj/DOMEvents.h: Added. * DOM.subproj/DOMHTML.h: Added. * DOM.subproj/DOMRange.h: Added. * DOM.subproj/DOMStylesheets.h: Added. * DOM.subproj/DOMTraversal.h: Added. * DOM.subproj/DOMViews.h: Added. * WebKit.pbproj/project.pbxproj: Added new files. * WebView.subproj/WebDefaultEditingDelegate.m: (-[WebDefaultEditingDelegate webView:shouldApplyStyle:toElementsInDOMRange:]): (-[WebDefaultEditingDelegate webView:shouldChangeTypingStyle:toStyle:]): Change class names from CSS to DOMCSS. * WebView.subproj/WebViewPrivate.h: Ditto. * copy-webcore-files-to-webkit: Add new files. 2004-03-15 Ken Kocienda <kocienda@apple.com> Reviewed by John Fix for this bug: <rdar://problem/3588717>: REGRESSION (125-131u): Tabbing to links and tabbing in bookmarks view no longer works WebView can't lay claim to -keyDown: just for editing events, as this gets in the way of tab processing. The solution is to give WebView a private method for processing editing key events fed to it from over the bridge, and leave -keyDown: unimplemented. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge editingKeyDown:]): Changed from -keyDown: to keep terminology consistent with renamed WebView -editingKeyDown: method. * WebView.subproj/WebView.m: (-[WebView editingKeyDown:]): Give WebView a method to handle editing key events in a way that does not interfere with other key down events it processes. * WebView.subproj/WebViewPrivate.h: Declare -editingKeyDown: method. === Safari-132 === 2004-03-15 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2004-03-12 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed <rdar://problem/3433887>: copied   characters remain non-breaking spaces; other browsers give normal spaces * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _writeSelectionToPasteboard:]): Convert non-breaking spaces to the normal kind in the plain text part of the pasteboard. 2004-03-12 Ken Kocienda <kocienda@apple.com> Reviewed by Chris * WebView.subproj/WebView.m: (-[WebView _alterCurrentSelection:direction:granularity:]): Changed name from _alterSelection:direction:granularity: to give a little extra clarity. Also, the body calls through to renamed rangeByAlteringCurrentSelection:direction:granularity: in WebCore. (-[WebView moveRight:]): Now calls renamed _alterCurrentSelection:direction:granularity:. (-[WebView moveRightAndModifySelection:]): Ditto. (-[WebView moveLeft:]): Ditto. (-[WebView moveLeftAndModifySelection:]): Ditto. 2004-03-11 Richard Williamson <rjw@apple.com> Workaround for 3585644. Force the window number of the mouse moved event to be correct. Reviewed by Chris. * Carbon.subproj/CarbonWindowFrame.m: * Carbon.subproj/HIWebView.m: (MouseMoved): (MouseDragged): 2004-03-11 Ken Kocienda <kocienda@apple.com> Reviewed by Dave Various changes to begin implementing the draft API proposal. * DOM.subproj/DOM.h: Checking in generated file. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge registerCommandForUndo:]): Now takes an id, a wrapped WebCore EditCommand implementation object. (-[WebBridge registerCommandForRedo:]): Ditto. (-[WebBridge clearUndoRedoOperations]): Use the web view's undo manager. (-[WebBridge keyDown:]): Pass keyDown events through to the web view. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDefaultEditingDelegate.h: Added. * WebView.subproj/WebDefaultEditingDelegate.m: Added. Stubbed in default implementations declared in the draft editing API. * WebView.subproj/WebFrame.m: (-[WebFramePrivate dealloc]): WebFrame no longer has an undo manager. * WebView.subproj/WebFramePrivate.h: Ditto. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _selectedWebArchive:]): selectedRange method is now selectedDOMRange. * WebView.subproj/WebView.m: (-[WebViewPrivate dealloc]): Dealloc new editingDelegateForwarder. (-[WebView _editingDelegateForwarder]): Added. (-[WebView keyDown:]): Added. (-[WebView _bridgeForCurrentSelection]): Added. (-[WebView setSelectedDOMRange:]): Added. (-[WebView selectedDOMRange]): Added. (-[WebView insertText:]): Added. (-[WebView _alterSelection:direction:granularity:]): Added. (-[WebView selectWord:]): Added. (-[WebView moveRight:]): Added. (-[WebView moveRightAndModifySelection:]): Added. (-[WebView moveLeft:]): Added. (-[WebView moveLeftAndModifySelection:]): Added. (-[WebView deleteBackward:]): Added. (-[WebView insertNewline:]): Added. (-[WebView insertParagraphSeparator:]): Added. (-[WebView setEditingDelegate:]): Added. (-[WebView editingDelegate]): Added. (-[WebView undoManager]): Added. (-[WebView insertText:replacingDOMRange:]): Added. * WebView.subproj/WebViewPrivate.h: Added a collection of editing API declarations that will be public some day, but are still under review. 2004-03-11 John Sullivan <sullivan@apple.com> - fixed <rdar://problem/3585056>: Assertion failure if error page is loaded from webView:unableToImplementPolicyWithError: - also added HeaderDoc comments to could-be-API-soon methods and fixed a conceptual problem with said methods Reviewed by Darin. * WebView.subproj/WebDataSourcePrivate.h: added HeaderDoc comment for -unreachableURL * WebView.subproj/WebFramePrivate.h: added HeaderDoc comment for -loadAlternateHTMLString:baseURL:forUnreachableURL:; also added boolean delegateIsHandlingUnimplementablePolicy ivar to WebFramePrivate * WebView.subproj/WebFrame.m: (-[WebFrame _shouldReloadToHandleUnreachableURLFromRequest:]): treat delegateIsHandlingUnimplementablePolicy like delegateIsDecidingNavigationPolicy. Safari serves up error pages during the latter but clients are equally or more likely to do so during the former. (-[WebFrame _handleUnimplementablePolicyWithErrorCode:forURL:]): set delegateIsHandlingUnimplementablePolicy during delegate callback (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): tweaked assertion so it doesn't erroneously fire for clients that call loadAlternateHTML:baseURL:forUnreachableURL: while processing webView:unableToImplementPolicyWithError: 2004-03-11 Chris Blumenberg <cblu@apple.com> Made WebArchive a class instead of a data object. This allows clients to easily get the main resource and subresources from a WebArchive. Reviewed by kocienda. * WebKit.exp: * WebView.subproj/WebDocumentPrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame loadWebArchive:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation loadWebArchive]): (-[WebHTMLRepresentation _webArchiveWithMarkupString:subresourceURLStrings:]): (-[WebHTMLRepresentation webArchiveFromNode:]): (-[WebHTMLRepresentation webArchiveFromRange:]): * WebView.subproj/WebHTMLRepresentationPrivate.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _selectedWebArchive:]): (-[WebHTMLView _writeSelectionToPasteboard:]): (-[WebHTMLView _pasteMarkupFromPasteboard:]): * WebView.subproj/WebResource.h: * WebView.subproj/WebResource.m: (-[WebArchivePrivate dealloc]): (-[WebResource _response]): (-[WebArchive init]): (-[WebArchive initWithMainResource:subresources:]): (-[WebArchive initWithData:]): (-[WebArchive dealloc]): (-[WebArchive mainResource]): (-[WebArchive subresources]): (-[WebArchive dataRepresentation]): * WebView.subproj/WebResourcePrivate.h: 2004-03-10 Chris Blumenberg <cblu@apple.com> Made dragging of web archives work. Reviewed by rjw. * English.lproj/StringsNotToBeLocalized.txt: updated * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient connection:didReceiveResponse:]): added a FIXME about working around old Foundations that don't know about web archive files * WebView.subproj/WebView.m: (+[WebView canShowFile:]): tweak (+[WebView suggestedFileExtensionForMIMEType:]): tweak (+[WebView _MIMETypeForFile:]): handle web archive files since Foundation may be too old to know about them 2004-03-09 Chris Blumenberg <cblu@apple.com> Made web archives use NSPropertyListBinaryFormat_v1_0 instead of NSPropertyListXMLFormat_v1_0 because NSPropertyListBinaryFormat_v1_0 is 3-5 times faster to serialize and parse. Reviewed by rjw. * WebView.subproj/WebResource.m: (+[WebResource _parseWebArchive:mainResource:subresources:]): add timing code (+[WebResource _webArchiveWithMainResource:subresources:]): add timing code, use NSPropertyListBinaryFormat_v1_0 2004-03-09 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3577508>: API: web archive related API's Implemented WebKit side of: <rdar://problem/3144033>: ability to save web sites (images and all) Reviewed by rjw. * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge receivedData:textEncodingName:]): renamed to take a textEncodingName instead of data source. The data source argument is only needed for the textEncodingName. * WebKit.exp: * WebView.subproj/WebDataSource.m: (-[WebDataSource _subresourcesDictionary]): new (+[WebDataSource _repTypesAllowImageTypeOmission:]): include "application/x-webarchive" * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDocumentInternal.h: * WebView.subproj/WebDocumentPrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame loadWebArchive:]): renamed, code factored out to [WebResource _parseWebArchive:mainResource:subresources:] * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFrameView.m: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): include "application/x-webarchive" * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentationPrivate dealloc]): (-[WebHTMLRepresentation _isDisplayingWebArchive]): new (-[WebHTMLRepresentation receivedData:withDataSource:]): don't feed data to WebCore if we're displaying a web archive since web archive can't be progressively loaded (-[WebHTMLRepresentation loadWebArchive]): new, feeds web archive data to WebCore (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): call loadWebArchive if necessary (-[WebHTMLRepresentation documentSource]): if displaying a web archive, return the HTML source from within the archive (-[WebHTMLRepresentation _webArchiveWithMarkupString:subresourceURLStrings:]): new (-[WebHTMLRepresentation markupStringFromNode:]): implementation of new API (-[WebHTMLRepresentation markupStringFromRange:]): ditto (-[WebHTMLRepresentation webArchiveFromNode:]): ditto (-[WebHTMLRepresentation webArchiveFromRange:]): ditto * WebView.subproj/WebHTMLRepresentationPrivate.h: * WebView.subproj/WebHTMLView.m: (+[WebHTMLView _selectionPasteboardTypes]): use renamed WebArchivePboardType (-[WebHTMLView _selectedWebArchive:]): renamed, call renamed methods (-[WebHTMLView _writeSelectionToPasteboard:]): call renamed methods (-[WebHTMLView _haveSelection]): indentation tweak (-[WebHTMLView _canDelete]): ditto (-[WebHTMLView _canPaste]): ditto (-[WebHTMLView _pasteMarkupFromPasteboard:]): renamed, call [WebResource _webArchiveWithMainResource:subresources:] (-[WebHTMLView initWithFrame:]): use renamed WebArchivePboardType (-[WebHTMLView paste:]): call renamed _pasteMarkupFromPasteboard (-[WebHTMLView concludeDragOperation:]): call renamed _pasteMarkupFromPasteboard * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient connection:didReceiveResponse:]): modify the MIME type for web archives since Foundation is not yet web archive aware. This is ifdef'd pre-Tiger code. * WebView.subproj/WebResource.h: * WebView.subproj/WebResource.m: (+[WebResource _parseWebArchive:mainResource:subresources:]): new (+[WebResource _webArchiveWithMainResource:subresources:]): new * WebView.subproj/WebResourcePrivate.h: 2004-03-09 John Sullivan <sullivan@apple.com> - fixed the following bugs: <rdar://problem/3579715>: Going to an error page in back/forward list doesn't work correctly in some cases <rdar://problem/3581031>: REGRESSION (130+): World Leak of WebFrame after trying to load page with unknown scheme Reviewed by Darin. * WebView.subproj/WebDataSourcePrivate.h: renamed __setRequest -> __adoptRequest * WebView.subproj/WebDataSource.m: (-[WebDataSource _URLForHistory]): updated comment (-[WebDataSource __adoptRequest:]): Renamed from __setRequest; now takes an NSMutableURLRequest and uses it as-is. (-[WebDataSource _setRequest:]): now saves a mutable copy, instead of relying on the caller to do so. The (only) caller wasn't doing so in all cases, leading to trouble in River City. Also, special-case unreachable URL handling to allow alternate content to replace a URL in a redirect-like way without sending a redirect callback. * WebView.subproj/WebFrame.m: (-[WebFrame loadAlternateHTMLString:baseURL:forUnreachableURL:]): renamed after discussion with Richard (was loadPlaceholderHTMLString:baseURL:unreachableURL:) (-[WebFrame _shouldReloadToHandleUnreachableURLFromRequest:]): new helper method, returns YES only if we receive a load request for alternate content from a delegate for an unreachable URL while we are going back or forward. That's a lot of prepositions! (-[WebFrame _loadRequest:subresources:]): if _shouldReloadToHandleUnreachableURLFromRequest: returns YES, change load type to WebFrameLoadTypeReload so b/f list is preserved appropriately. (-[WebFrame _transitionToCommitted:]): Update currentItem in the unreachableURL case. (-[WebFrame _isLoadComplete]): Don't reset b/f list before calling provisionalLoadDidFail delegate; instead, determine where to reset b/f list beforehand, and then actually reset list afterwards only if we didn't start an alternate content load in the delegate. Also, set new boolean ivar so we know when we're processing a provisionalLoadDidFail delegate callback. (-[WebFrame _loadItem:withLoadType:]): don't make extra copy before calling __adoptRequest; just pass it the one we made here. (-[WebFrame _checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): If we're loading alternate content for an unreachableURL, don't ask the decision listener, just do it. (This avoids problem with nested calls to checking the navigation policy that led to a WebFrame leak, and is conceptually the right thing to do also.) Also added some asserts that helped me track down the WebFrame leak. Set new boolean ivar so we know when we're processing a navigation policy delegate decision. (-[WebFrame _currentBackForwardListItemToResetTo]): new method, replaces _resetBackForwardListToCurrent. Does the same test as the latter but returns a boolean rather than actually resetting. (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): save dataSource in a local var before calling stopLoading, and use it for _setProvisionalDataSource, because otherwise stopLoading was clobbering the dataSource for an unreachable URL handling case. * WebView.subproj/WebFramePrivate.h: two new boolean ivars * WebView.subproj/WebView.m: (+[WebView _canHandleRequest:]): return YES when we're loading alternate content for an unreachable URL === Safari-131 === 2004-03-08 Ken Kocienda <kocienda@apple.com> Reviewed by Darin * WebKit.pbproj/project.pbxproj: Added CFBundleName to Info.plist 2004-03-05 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3560132>: REGRESSION: Safari crashed in -[NSPasteboard setData:forType:] dragging a map out of Mapquest.com Reviewed by john. * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeImage:URL:title:fileWrapper:HTMLString:]): declare the pboard types by calling _web_writeURL:::: before calling setData:: 2004-03-05 John Sullivan <sullivan@apple.com> First cut at WebKit support for showing error pages for unreachable URLs. This doesn't work quite right with the back/forward list yet, but is good enough for demos. Reviewed by Darin. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate didReceiveResponse:]): use new _webDataRequextExternalURL to share code * WebView.subproj/WebDataProtocol.h: Three new methods (all internal to WebKit): -[NSURLRequest _webDataRequestUnreachableURL], -[NSURLRequest _webDataRequestExternalURL], -[NSURLRequest _webDataRequestSetUnreachableURL] * WebView.subproj/WebDataProtocol.m: new unreachableURL field of WebDataRequestParameters (-[WebDataRequestParameters copyWithZone:]): copy new field (-[WebDataRequestParameters dealloc]): release new field (-[NSURLRequest _webDataRequestUnreachableURL]): read new field (-[NSURLRequest _webDataRequestExternalURL]): new method, returns baseURL or "about:blank" for webdata protocol requests. This was done in multiple places previously. (-[NSURLRequest _webDataRequestExternalRequest]): now calls _webDataRequestExternalURL to share code (-[NSMutableURLRequest _webDataRequestSetUnreachableURL:]): write new field * WebView.subproj/WebDataSource.m: (-[WebDataSource unreachableURL]): new method, might become API; returns the unreachable URL, if any, for which this datasource holds placeholder content (-[WebDataSource _URLForHistory]): new method, returns the URL to be stored in History for this dataSource. This returns nil for run-of-the-mill WebDataProtocol URLs (replacing code elsewhere that checked for this case) but returns the unreachableURL for the case where this datasource holds placeholder content. (-[WebDataSource _setTitle:]): now calls _URLForHistory * WebView.subproj/WebDataSourcePrivate.h: added unreachableURL in the should-become-API section, and _URLForHistory elsewhere * WebView.subproj/WebFrame.m: (-[WebFrame loadPlaceholderHTMLString:baseURL:unreachableURL:]): new should-become-API method for displaying an error page for an unreachable URL (-[WebFrame loadPropertyList:]): updated to pass nil for unreachableURL (-[WebFrame _webDataRequestForData:MIMEType:textEncodingName:baseURL:unreachableURL:]): added unreachableURL parameter, which gets set on the data request (-[WebFrame _addBackForwardItemClippedAtTarget:]): use _URLForHistory instead of just checking for WebDataProtocol (-[WebFrame _createItem:]): use unreachableURL if there is one (-[WebFrame _transitionToCommitted:]): use _URLForHistory instead of just checking for WebDataProtocol (-[WebFrame _isLoadComplete]): check whether a new load has started in the delegate callback and if so, don't reset the loading state here (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): added unreachableURL parameter, which gets passed through (-[WebFrame loadData:MIMEType:textEncodingName:baseURL:]): send nil unreachableURL parameter (-[WebFrame _loadHTMLString:baseURL:unreachableURL:]): new bottleneck method for loadHTMLString:baseURL: and loadPlaceholderHTMLString:baseURL:unreachableURL:; this is the guts of loadHTMLString:baseURL: with the new unreachableURL parameter passed through (-[WebFrame loadHTMLString:baseURL:]): now calls new bottleneck method * WebView.subproj/WebFramePrivate.h: added loadPlaceholderString:baseURL:unreachableURL: to should-be-API section; added unreachableURL parameter to _webDataRequestForData:MIMEType:textEncodingName:baseURL: 2004-03-04 Chris Blumenberg <cblu@apple.com> - Made image dragging and copying always work without needing to re-download by using the data source's WebResource of the image instead of relying on the Foundation cache. - Fixed a "drag to self" problem I introduced in my last check-in. You could drag a URL from a WebHTMLView and drop it on its own WebView which we shouldn't allow. Reviewed by rjw. * ChangeLog: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge fileWrapperForURL:]): call _fileWrapperForURL on WebDataSource * WebView.subproj/WebDataSource.m: (-[WebDataSource _fileWrapperForURL:]): moved from WebView, creates a wrapper from a WebResource * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate copyImageToClipboard:]): call [WebDataSource _fileWrapperForURL:] * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _handleMouseDragged:]): call [WebDataSource _fileWrapperForURL:] (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): call [WebDataSource _fileWrapperForURL:] (-[WebHTMLView _dragOperationForDraggingInfo:]): new, factored out from draggingUpdated: (-[WebHTMLView draggingEntered:]): call _dragOperationForDraggingInfo:, if NSDragOperationNone, forward to WebView to it can handle the drag (-[WebHTMLView draggingUpdated:]): ditto (-[WebHTMLView concludeDragOperation:]): ditto * WebView.subproj/WebResource.m: (-[WebResource _fileWrapperRepresentation]): new * WebView.subproj/WebResourcePrivate.h: * WebView.subproj/WebView.m: (-[WebViewPrivate dealloc]): release draggedTypes, a new ivar that keeps track of drag types that we're currently registered for (-[WebView _setDraggedTypes:]): new (-[WebView unregisterDraggedTypes]): new, calls _setDraggedTypes then super (-[WebView registerForDraggedTypes:]): ditto (-[WebView _dragOperationForDraggingInfo:]): new, compares the types on the pasteboard against the types we are currently registered for. Normally the AppKit handles this for us, but since these messages can be forwarded from WebHTMLView, we need to do this comparison ourselves. (-[WebView draggingEntered:]): calls _dragOperationForDraggingInfo: (-[WebView draggingUpdated:]): ditto (-[WebView concludeDragOperation:]): ditto * WebView.subproj/WebViewPrivate.h: define new draggedTypes ivar 2004-03-03 Chris Blumenberg <cblu@apple.com> Fixed a typo. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView concludeDragOperation:]): 2004-03-03 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3576070>: REGRESSION: web view won't accept drag of webloc file Reviewed by rjw. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView draggingUpdated:]): if we're not handling the drag, forward this message to the WebView since it may want to handle it (-[WebHTMLView concludeDragOperation:]): if we're not handling the drag, forward this message to the WebView since it may want to handle it 2004-03-03 Darin Adler <darin@apple.com> Reviewed by Vicki. * English.lproj/InfoPlist.strings: Removed. No need to localize the version and copyright string, and that's all that was in here. * WebKit.pbproj/project.pbxproj: Removed InfoPlist.strings from build. 2004-03-03 Ken Kocienda <kocienda@apple.com> Reviewed by Chris * copy-webcore-files-to-webkit: Fixed up this script so that it does not fail if it is running "non-locally", like for B&I. The idiom is to check these files into WebKit after copying them from WebCore, hence this script is merely a convenience to keep the files in sync. 2004-03-02 Ken Kocienda <kocienda@apple.com> Reviewed by me * DOM.subproj/DOM.h: Checked in header copied over from WebCore. 2004-03-02 Richard Williamson <rjw@apple.com> Added WebJavaScriptObject API. The location of this file may change. Reviewed by Chris. * Plugins.subproj/NP_objc.h: Added. * WebKit.pbproj/project.pbxproj: 2004-03-02 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3575598>: REGRESSION: Safari crashes at IS&T website Reviewed by darin. * WebView.subproj/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): don't stop the icon loader here because that can cause an infinite loop (-[WebDataSource _stopLoadingInternal]): always stop the icon loader here instead of just when the data source is loading as well. === Safari-130 === 2004-03-02 Ken Kocienda <kocienda@apple.com> Reviewed by me * DOM.subproj/DOM.h: Rollout last night's checkin. The tree was closed. 2004-03-01 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3574979>: REGRESSION (129-TOT): crash loading macromedia.com deliverResource was being called after it had already been called in setDefersCallbacks:. Reviewed by rjw. * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate deliverResource]): set deliveredResource to YES (-[WebBaseResourceHandleDelegate deliverResourceAfterDelay]): new, calls deliverResource after a delay (-[WebBaseResourceHandleDelegate loadWithRequest:]): call deliverResourceAfterDelay (-[WebBaseResourceHandleDelegate setDefersCallbacks:]): call deliverResourceAfterDelay 2004-03-01 Ken Kocienda <kocienda@apple.com> Reviewed by me * DOM.subproj/DOM.h: Checked in header copied over from WebCore. 2004-03-01 Ken Kocienda <kocienda@apple.com> Reviewed by me * DOM.subproj/DOM.h: Oh, it's like the Keystone Cops this afternoon... Backed out an unintended change to thsi file. 2004-03-01 Ken Kocienda <kocienda@apple.com> Reviewed by me * copy-webcore-files-to-webkit: Dumb typing error on my part in making my previous quick fix. This quick fix works. 2004-03-01 Chris Blumenberg <cblu@apple.com> Updated the WebKit project file to 1.1 because a previous check-in reverted to 1.01. * WebKit.pbproj/project.pbxproj: 2004-03-01 Ken Kocienda <kocienda@apple.com> Reviewed by me * copy-webcore-files-to-webkit: Made this file buildit-compliant 2004-03-01 Chris Blumenberg <cblu@apple.com> Found a bug in my last check-in. If a load that originates from a WebResource is cancelled before the data from the WebResource is delivered, callbacks are sent anyway. Reviewed by rjw. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate cancelWithError:]): cancel the perform request for deliverResource 2004-03-01 Chris Blumenberg <cblu@apple.com> Reviewed by darin. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader didFinishLoading]): rejigger handle code to avoid Deployment failure * WebKit.pbproj/project.pbxproj: 2004-03-01 Chris Blumenberg <cblu@apple.com> - Made WebResource loading not use Foundation at all. This allows "Mail Page" and paste to more directly load subresources without any indirection involving NSURLConnection and the Foundation cache. - Made WebIconLoader a subclass of WebBaseResourceHandleDelegate. This makes favicons appear in the activity window among other things. Reviewed by kocienda. * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebIconLoader.m: removed connection and data ivars since WebBaseResourceHandleDelegate holds these (-[WebIconLoaderPrivate dealloc]): removed calls to deleted ivars (-[WebIconLoader URL]): call renamed request ivar (-[WebIconLoader startLoading]): call loadWithRequest (-[WebIconLoader stopLoading]): call cancel (-[WebIconLoader didFinishLoading]): * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginConnectionDelegate didReceiveResponse:]): renamed to be connection-less since callbacks may came from a WebResource and not an NSURLConnection (-[WebNetscapePluginConnectionDelegate didReceiveData:lengthReceived:]): ditto (-[WebNetscapePluginConnectionDelegate didFinishLoading]): ditto (-[WebNetscapePluginConnectionDelegate didFailWithError:]): ditto * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient didReceiveResponse:]): ditto (-[WebSubresourceClient didReceiveData:lengthReceived:]): ditto (-[WebSubresourceClient didFinishLoading]): ditto (-[WebSubresourceClient didFailWithError:]): ditto * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate loadWithRequest:]): instead of storing the resource in the Foundation cache in order to later load it from the cache, deliver the callbacks ourselves after a delay (-[WebBaseResourceHandleDelegate setDefersCallbacks:]): call deliverResource if callbacks are turned back on (-[WebBaseResourceHandleDelegate deliverResource]): new, calls didReceiveResponse:, didReceiveData:lengthReceived:, and didFinishLoading (-[WebBaseResourceHandleDelegate willSendRequest:redirectResponse:]): renamed to be connection-less since callbacks may came from a WebResource and not an NSURLConnection (-[WebBaseResourceHandleDelegate didReceiveAuthenticationChallenge:]): ditto (-[WebBaseResourceHandleDelegate didCancelAuthenticationChallenge:]): ditto (-[WebBaseResourceHandleDelegate didReceiveResponse:]): ditto (-[WebBaseResourceHandleDelegate didReceiveData:lengthReceived:]): ditto (-[WebBaseResourceHandleDelegate didFinishLoading]): ditto (-[WebBaseResourceHandleDelegate didFailWithError:]): ditto (-[WebBaseResourceHandleDelegate willCacheResponse:]): ditto (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): calls connection-less version of this method (-[WebBaseResourceHandleDelegate connection:didReceiveAuthenticationChallenge:]): ditto (-[WebBaseResourceHandleDelegate connection:didCancelAuthenticationChallenge:]): ditto (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): ditto (-[WebBaseResourceHandleDelegate connection:didReceiveData:lengthReceived:]): ditto (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): ditto (-[WebBaseResourceHandleDelegate connection:didFailWithError:]): ditto (-[WebBaseResourceHandleDelegate connection:willCacheResponse:]): ditto (-[WebBaseResourceHandleDelegate cancelWithError:]): call renamed _completeProgressForConnectionDelegate on WebView (-[WebBaseResourceHandleDelegate cancelledError]): tweak * WebView.subproj/WebDataSource.m: (-[WebDataSource _loadIcon]): set the data source on the icon loader so it can callback * WebView.subproj/WebResource.m: (-[WebResource _response]): new, factored out from _cachedResponseRepresentation (-[WebResource _cachedResponseRepresentation]): call _response * WebView.subproj/WebResourcePrivate.h: * WebView.subproj/WebView.m: (-[WebView _incrementProgressForConnectionDelegate:response:]): renamed to be connection-less (-[WebView _incrementProgressForConnectionDelegate:data:]): ditto (-[WebView _completeProgressForConnectionDelegate:]): ditto * WebView.subproj/WebViewPrivate.h: 2004-03-01 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Changed all Objective-C DOM classes from protocols to classes. * DOM.subproj/DOM-compat.h: * DOM.subproj/DOM.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:referrer:reload:onLoadEvent:target:triggeringEvent:form:formValues:]): (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): * WebView.subproj/WebFormDelegate.h: * WebView.subproj/WebFormDelegate.m: (-[WebFormDelegate frame:sourceFrame:willSubmitForm:withValues:submissionListener:]): * WebView.subproj/WebFrame.m: (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFormState initWithForm:values:sourceFrame:]): (-[WebFormState form]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation DOMDocument]): (-[WebHTMLRepresentation setSelectionFrom:startOffset:to:endOffset:]): (-[WebHTMLRepresentation attributedStringFrom:startOffset:to:endOffset:]): (-[WebHTMLRepresentation elementWithName:inForm:]): (-[WebHTMLRepresentation elementForView:]): (-[WebHTMLRepresentation elementDoesAutoComplete:]): (-[WebHTMLRepresentation elementIsPassword:]): (-[WebHTMLRepresentation formForElement:]): (-[WebHTMLRepresentation controlsInForm:]): (-[WebHTMLRepresentation searchForLabels:beforeElement:]): (-[WebHTMLRepresentation matchLabels:againstElement:]): 2004-02-27 John Sullivan <sullivan@apple.com> - WebKit changes to allow performance improvements to bookmarks Reviewed by Darin. * History.subproj/WebHistoryItemPrivate.h: added notificationsSuppressed/setNotificationsSuppressed, and setURLString * History.subproj/WebHistoryItem.m: (-[WebHistoryItem setNotificationsSuppressed:]): setter for new flag. When this flag is set, making changes to the WebHistoryItem will not cause WebHistoryChanged notifications to be sent. This is a big speedup for reading bookmarks from disk, since currently each WebBookmarkLeaf object keeps around a WebHistoryItem object that isn't really part of history and thus doesn't need to send notifications about history changing. (-[WebHistoryItem notificationsSuppressed]): getter for new flag (-[WebHistoryItem setURLString:]): new method, extracted from guts of setURL:; this allows callers (though currently only callers at Apple) that have a URL string in hand to set it directly on the WebHistoryItem rather than converting to a URL and back, both relatively slow operations. Also, doesn't sent a notification if notifications are suppressed. (-[WebHistoryItem setURL:]): now calls extracted method (-[WebHistoryItem setAlternateTitle:]): doesn't send notification if notifications are suppressed (-[WebHistoryItem setOriginalURLString:]): ditto (-[WebHistoryItem setTitle:]): ditto (-[WebHistoryItem _setLastVisitedTimeInterval:]): ditto 2004-02-26 Chris Blumenberg <cblu@apple.com> WebKit side of: <rdar://problem/3056566>: mail a link to this page <rdar://problem/2961206>: implement ability to e-mail entire page Reviewed by john. * English.lproj/StringsNotToBeLocalized.txt: * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _createFileDatabase]): tweaks (-[WebIconDatabase _loadIconDictionaries]): fixed an assertion failure I found in Blot. Keep the original list of icon URLs as a separate list when doing the initial clean-up so we don't over release any icons. (-[WebIconDatabase _updateFileDatabase]): tweaks (-[WebIconDatabase _setIcon:forIconURL:]): tweaks (-[WebIconDatabase _releaseIconForIconURLString:]): tweaks (-[WebIconDatabase _retainOriginalIconsOnDisk]): use the original list of icons on disk instead of the current list (-[WebIconDatabase _releaseOriginalIconsOnDisk]): use the original list of icons on disk instead of the current list * Misc.subproj/WebIconDatabasePrivate.h: * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDataSource.m: (-[WebDataSource _propertyListWithData:subresourceURLStrings:]): new, code moved from [WebHTMLView _selectedPropertyList:], creates property list rep of data and subresources (-[WebDataSource propertyList]): does the above with all the data source data, this is what "Mail Page" uses * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame loadPropertyList:]): renamed from loadHTMLPropertyList because the property list may contain non-HTML data * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _selectedPropertyList:]): renamed, code moved to [WebDataSource _propertyListWithData:subresourceURLStrings:] (-[WebHTMLView _writeSelectionToPasteboard:]): call renamed _selectedPropertyList 2004-02-26 Ken Kocienda <kocienda@apple.com> Reviewed by Chris Updated usage of DOM SPI to use new names and conventions. Unless indicated otherwise, the changes were to update protocol names for, which changed from using a "WebDOM" prefix to a "DOM" prefix, and changing now need only include the DOM.h header from WebKit to get everything. * DOM.subproj/DOM-compat.h: Added. This header contains some compatibility declarations to work with older clients of our DOM SPI. Though this file is checked into WebKit, it really lives and should be updated in WebCore. It is copied into WebKit by the build system as needed. * DOM.subproj/DOM.h: Added. This file includes the new "guts" of the DOM SPI. As above, this file is checked into WebKit, it really lives and should be updated in WebCore. It is copied into WebKit by the build system as needed. * DOM.subproj/WebDOMDocument.h: Removed declarations. Now just includes DOM.h and DOM-compat.h * DOM.subproj/WebDOMDocument.m: Removed. * DOM.subproj/WebDOMElement.h: Removed declarations. Now just includes DOM.h and DOM-compat.h * DOM.subproj/WebDOMElement.m: Removed. * DOM.subproj/WebDOMNode.h: Removed declarations. Now just includes DOM.h and DOM-compat.h * DOM.subproj/WebDOMNode.m: Removed. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:referrer:reload:onLoadEvent:target:triggeringEvent:form:formValues:]) (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]) * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDefaultContextMenuDelegate.m: * WebView.subproj/WebFormDelegate.h: * WebView.subproj/WebFormDelegate.m: (-[WebFormDelegate frame:sourceFrame:willSubmitForm:withValues:submissionListener:]) * WebView.subproj/WebFrame.h: Unrelated change. Removed -undoManager accessor from public header. Moved to private header. * WebView.subproj/WebFrame.m: (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]) (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]) (-[WebFrame undoManager]): Moved -undoManager accessor to private category implementation. (-[WebFormState initWithForm:values:sourceFrame:]) (-[WebFormState form]) (-[WebFrame childFrames]) * WebView.subproj/WebFramePrivate.h: Moved in -undoManager accessor. * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation DOMDocument]) (-[WebHTMLRepresentation setSelectionFrom:startOffset:to:endOffset:]) (-[WebHTMLRepresentation attributedStringFrom:startOffset:to:endOffset:]) (-[WebHTMLRepresentation elementWithName:inForm:]) (-[WebHTMLRepresentation elementForView:]) (-[WebHTMLRepresentation elementDoesAutoComplete:]) (-[WebHTMLRepresentation elementIsPassword:]) (-[WebHTMLRepresentation formForElement:]) (-[WebHTMLRepresentation controlsInForm:]) (-[WebHTMLRepresentation searchForLabels:beforeElement:]) (-[WebHTMLRepresentation matchLabels:againstElement:]) * WebView.subproj/WebHTMLView.m: * copy-webcore-files-to-webkit: Added. Copies DOM.h and DOM-compat.h from WebCore when they have been updated there. 2004-02-25 John Sullivan <sullivan@apple.com> WebKit part of fix for <rdar://problem/3546370>: add a way to tab to menus, checkmarks, and buttons without turning on Full Keyboard Acceess Reviewed by Ken. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge _retrieveKeyboardUIModeFromPreferences:]): turn on WebCoreKeyboardAccessFull bit whenever we turn on WebCoreKeyboardAccessTabsToLinks bit 2004-02-24 Chris Blumenberg <cblu@apple.com> I forgot to add these files in my last check-in. * WebView.subproj/WebResource.h: Added. * WebView.subproj/WebResource.m: Added. (-[WebResourcePrivate dealloc]): (-[WebResource initWithData:URL:MIMEType:textEncodingName:]): (-[WebResource dealloc]): (-[WebResource data]): (-[WebResource URL]): (-[WebResource MIMEType]): (-[WebResource textEncodingName]): (+[WebResource _resourcesFromPropertyLists:]): (+[WebResource _propertyListsFromResources:]): (-[WebResource _initWithPropertyList:]): (-[WebResource _initWithCachedResponse:originalURL:]): (-[WebResource _propertyListRepresentation]): (-[WebResource _cachedResponseRepresentation]): * WebView.subproj/WebResourcePrivate.h: Added. 2004-02-24 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3565476>: design/implement new pasteboard type for HTML that includes subresources Reviewed by rjw. * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginConnectionDelegate initWithStream:view:]): don't manage buffer, WebBaseResourceHandleDelegate does this now (-[WebNetscapePluginConnectionDelegate releaseResources]): ditto (-[WebNetscapePluginConnectionDelegate connection:didReceiveData:lengthReceived:]): ditto (-[WebNetscapePluginConnectionDelegate connectionDidFinishLoading:]): ditto * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate releaseResources]): release resourceData and resource (-[WebBaseResourceHandleDelegate loadWithRequest:]): check the dataSource for a resource, load that if we have one (-[WebBaseResourceHandleDelegate addData:]): new, adds data to resourceData (-[WebBaseResourceHandleDelegate saveResource]): new, saves data as a resource on the dataSource (-[WebBaseResourceHandleDelegate saveResourceWithCachedResponse:]): new, replaces the resource on the dataSource to save memory (-[WebBaseResourceHandleDelegate resourceData]): new (-[WebBaseResourceHandleDelegate connection:didReceiveData:lengthReceived:]): call addData: (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): call saveResource (-[WebBaseResourceHandleDelegate connection:willCacheResponse:]): new, calls saveResourceWithCachedResponse: * WebView.subproj/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): release subresources (-[WebDataSource subresources]): new, returns the subresources of the data source (-[WebDataSource subresourceForURL:]): new, returns a resource for a URL (-[WebDataSource addSubresource:]): new (-[WebDataSource addSubresources:]): new (-[WebDataSource _receivedData:]): added an assert (-[WebDataSource _setData:]): replaces the data of the data source (-[WebDataSource initWithRequest:]): create subresources * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame loadHTMLPropertyList:]): new, loads a frame from an HTML plist (-[WebFrame _webDataRequestForData:MIMEType:textEncodingName:baseURL:]): new, factored out from loadData:MIMEType:textEncodingName:baseURL: (-[WebFrame _loadRequest:subresources:]): new, factored out from loadRequest:, handles subresources (-[WebFrame loadRequest:]): now just calls _loadRequest:subresources: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _dataSource]): new internal convenience (+[WebHTMLView _selectionPasteboardTypes]): renamed from _pasteboardTypes to be more precise (-[WebHTMLView _selectedHTMLPropertyList:]): new, constructs an HTML plist from the selection (-[WebHTMLView _writeSelectionToPasteboard:]): calls _selectedHTMLPropertyList to support WebHTMLPboardType (-[WebHTMLView _pasteHTMLFromPasteboard:]): added support for pasting WebHTMLPboardType (+[WebHTMLView initialize]): call renamed _selectionPasteboardTypes (-[WebHTMLView initWithFrame:]): allow WebHTMLPboardType to be dragged in (-[WebHTMLView validRequestorForSendType:returnType:]): call renamed _selectionPasteboardTypes * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient addData:]): override since the main resource does it's own buffering (-[WebMainResourceClient saveResource]): override to do nothing since the main resource is not saved as a subresource (-[WebMainResourceClient saveResourceWithCachedResponse:]): override, calls _setData on the data source to (-[WebMainResourceClient connection:didReceiveData:lengthReceived:]): * WebView.subproj/WebResource.h: Added. * WebView.subproj/WebResource.m: Added. New class the represents the data, URL, MIME type and textEncodingName of a resource. (-[WebResourcePrivate dealloc]): (-[WebResource initWithData:URL:MIMEType:textEncodingName:]): (-[WebResource dealloc]): (-[WebResource data]): (-[WebResource URL]): (-[WebResource MIMEType]): (-[WebResource textEncodingName]): (-[WebResource description]): (+[WebResource _resourcesFromPropertyLists:]): (+[WebResource _propertyListsFromResources:]): (-[WebResource _initWithPropertyList:]): (-[WebResource _propertyListRepresentation]): (-[WebResource _initWithCachedResponse:originalURL:]): (-[WebResource _cachedResponseRepresentation]): * WebView.subproj/WebResourcePrivate.h: Added. * WebView.subproj/WebView.m: === Safari-129 === 2004-02-20 Darin Adler <darin@apple.com> Reviewed by mjs. - fix build breakage caused by removal of kWindowNoBufferingAttribute. * Carbon.subproj/CarbonWindowAdapter.m: (-[CarbonWindowAdapter initWithCarbonWindowRef:takingOwnership:disableOrdering:carbon:]): always used a retained backing store type 2004-02-20 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3563402>: when copying HTML, relative URLs should be made absolute Reviewed by dave. * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation HTMLString]): renamed from reconstructed source to be more analogous with other data get methods * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _writeSelectionToPasteboard:]): call renamed selectedHTML on the bridge 2004-02-19 John Sullivan <sullivan@apple.com> - WebKit part of fix for <rdar://problem/3292380>: Cycle Tabs keyboard shortcut (cmd-shift-arrows) conflicts with text editing Reviewed by Chris. * WebView.subproj/WebFrameView.m: (-[WebFrameView keyDown:]): If shift key is down along with an arrow key, call super rather than eating event since we don't handle any shifted events here. 2004-02-15 Darin Adler <darin@apple.com> Reviewed by John and Don. - discovered that jaguar.com doesn't need spoofing any more, so removed the spoofing machinery entirely; if we ever have to bring it back we can, but I doubt we will * WebView.subproj/WebView.m: Removed include of WebUserAgentSpoofTable.c. (-[WebViewPrivate dealloc]): Release the new single userAgent rather than the array and userAgentOverride we used to. (-[WebView _preferencesChangedNotification:]): Release the single user agent, rather than the entire cache. Also only do it when the user agent is not overridden. (-[WebView setApplicationNameForUserAgent:]): Ditto. (-[WebView setCustomUserAgent:]): Set the new userAgentOverridden boolean, and also set userAgent itself. (-[WebView customUserAgent]): Return userAgent, but only if userAgentOverridden is true. (-[WebView userAgentForURL:]): Simplify, now that there's no automatic spoofing to do. Made even simpler by the fact that custom and computed user agents both share the same field now. * WebView.subproj/WebViewPrivate.h: Got rid of UserAgentStringType, turned the userAgent field into a single item instead of an array, and replaced the userAgentOverride field with a boolean userAgentOverridden field. * Makefile.am: Removed the rule to build WebUserAgentSpoofTable.c. * WebView.subproj/WebUserAgentSpoofTable.c: Removed. * WebView.subproj/WebUserAgentSpoofTable.gperf: Removed. 2004-02-15 Darin Adler <darin@apple.com> Reviewed by Dave. * WebKit.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols, and removing redundant settings of things that match defaults in other build styles. 2004-02-12 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - redo visited link history checking for a 2% speed improvement * History.subproj/WebHistory.m: (-[_WebCoreHistoryProvider containsItemForURLString:]): Removed. (-[_WebCoreHistoryProvider containsItemForURLLatin1:length:]): Implemented. For https and http URLs with empty path, add a slash. Make a CFString using the passed-in latin1 buffer without copying. (-[_WebCoreHistoryProvider containsItemForURLUnicode:length:]): Ditto for unicode. (matchLetter): New static helper function. (matchUnicodeLetter): Ditto. === Safari-128 === 2004-02-10 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge registerCommandForUndo]): Some cleanup. Cookie for events no longer needed. (-[WebBridge registerCommandForRedo]): Ditto. (-[WebBridge clearUndoRedoOperations]): Tells the Cocoa undo manager to clear steps targeted at the bridge. * WebView.subproj/WebFrame.h: Declare undo manager accessor. * WebView.subproj/WebFrame.m: (-[WebFramePrivate dealloc]): Release undo manager (-[WebFrame undoManager]): Allocate and return an undo manager. This helps undo in a browser to be per tab. * WebView.subproj/WebFramePrivate.h: Declare undo manager ivar. 2004-02-08 Darin Adler <darin@apple.com> Reviewed by Dave. - fixed things seen in the profile, for a total speedup of 4% on cvs-base - fixed some layout regressions from my last speedup due to text measurement inconsistencies by adding a flag to control whether word rounding is done or not - fixed text measurement to be used with AppKit to match AppKit again, as it did at some point in the past * WebCoreSupport.subproj/WebTextRenderer.h: Remove some unused fields, and added a field to say whether we treat this font as fixed pitch. * WebCoreSupport.subproj/WebTextRenderer.m: (getUncachedWidth): Remove space width hack from this level. There was already a width hack up at the higher level for space itself, so there's not a significant speed benefit, and the higher level can make a more intelligent choice based on the current rounding setting since it's not cached. (-[WebTextRenderer _computeWidthForSpace]): Don't store so many widths; just the adjusted width we will actually use. (widthForNextCharacter): Use two different rules for when to adjust space widths, based on whether this is a fixed pitch font or not. Also, don't do any adjusting of space widths if applyWordRounding is false. * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _web_drawAtPoint:font:textColor:]): Turn off rounding, so we get the kind of spacing AppKit would normally give. (-[NSString _web_widthWithFont:]): Ditto. * Misc.subproj/WebStringTruncator.m: (stringWidth): Ditto. 2004-02-08 Darin Adler <darin@apple.com> - fixed things seen in the profile, for a total speedup of 3.7% on cvs-base * Misc.subproj/WebNSURLExtras.m: (-[NSURL _web_userVisibleString]): Check for "xn--" as we walk the string instead of in a separate call to strcasestr. Faster this way. 2004-02-07 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Get rid of the DEPLOYMENT_LOCATION and DEPLOYMENT_POSTPROCESSING flags that were in the Deployment build style. These were causing the need to chmod all the time after building WebCore successfully, and were doing us no good. 2004-02-06 Darin Adler <darin@apple.com> * Resources/missing_image.tiff: Compressed with compress-tiffs; saved 15890 bytes. === Safari-127 === 2004-02-05 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt Added so that editing can hook into Cocoa undo architecture. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge registerCommandForUndo:]): 2004-02-04 David Hyatt <hyatt@apple.com> Fix deployment build bustage. * Plugins.subproj/WebBaseNetscapePluginView.m: (ConsoleConnectionChangeNotifyProc): 2004-02-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3546028>: Safari should not give plug-ins any time, thus use 0% CPU, when not in the currently active session Reviewed by john. * Plugins.subproj/WebBaseNetscapePluginView.m: (+[WebBaseNetscapePluginView initialize]): observe CG changes (-[WebBaseNetscapePluginView addWindowObservers]): observe user switch notifications (-[WebBaseNetscapePluginView removeWindowObservers]): stop observing user switch notifications (-[WebBaseNetscapePluginView viewHasMoved:]): tweak (-[WebBaseNetscapePluginView windowWillClose:]): tweak (-[WebBaseNetscapePluginView windowBecameKey:]): tweak (-[WebBaseNetscapePluginView windowResignedKey:]): tweak (-[WebBaseNetscapePluginView windowDidMiniaturize:]): tweak (-[WebBaseNetscapePluginView windowDidDeminiaturize:]): tweak (-[WebBaseNetscapePluginView loginWindowDidSwitchFromUser:]): new, stop null events (-[WebBaseNetscapePluginView loginWindowDidSwitchToUser:]): new, restart null events (ConsoleConnectionChangeNotifyProc): new, post user switch notifications 2004-02-02 John Sullivan <sullivan@apple.com> Reviewed by Darin. * Misc.subproj/WebNSURLExtras.h: * Misc.subproj/WebNSURLExtras.m: (-[NSURL _web_URLWithLowercasedScheme]): new method, returns a URL whose scheme has been tolower'ed * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2004-02-02 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3546924>: REGRESSION: dragging text or images over a WebView is jerky Reviewed by mjs. * DOM.subproj/WebDOMNode.h: added HTMLString to the protocol * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate copyImageToClipboard:]): get the HTML representation via the DOM node * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _handleMouseDragged:]): get the HTML representation via the DOM node * WebView.subproj/WebView.h: removed the HTML string element key constant * WebView.subproj/WebView.m: removed the HTML string element key constant 2004-02-02 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3546426>: when copying images via context menus, only some data is added to the pasteboard Reviewed by john. * Misc.subproj/WebNSPasteboardExtras.h: * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeImage:URL:title:fileWrapper:HTMLString:]): new, writes and image, URL and other optional arguments to the pasteboard * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragImage:fileWrapper:rect:URL:title:HTMLString:event:]): factored code out to _web_writeImage, call _web_writeImage * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate copyImageToClipboard:]): call _web_writeImage * WebView.subproj/WebImageView.m: (-[WebImageView writeImageToPasteboard:]): call _web_writeImage 2004-02-02 Darin Adler <darin@apple.com> - fixed build failure on Merlot * Misc.subproj/WebNSPasteboardExtras.m: Import just CoreTranslationFlavorTypeNames.h rather than all of ApplicationServicesPriv.h; should compile faster and avoid build failure. 2004-02-02 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3546379>: support for editing via drag & drop Reviewed by kocienda. * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragImage:fileWrapper:rect:URL:title:HTMLString:event:]): added a HTMLString argument so that we retain all attributes when dragging images * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _canDelete]): call renamed isSelectionEditable (-[WebHTMLView _canPaste]): call renamed isSelectionEditable (-[WebHTMLView _pasteHTMLFromPasteboard:]): new, factored out from paste: (-[WebHTMLView _handleMouseDragged:]): removed code that returned early if we were loading, this kind of protection is no longer needed since we now retain the view while dragging, call renamed _web_dragImage (-[WebHTMLView initWithFrame:]): register for drop types (-[WebHTMLView paste:]): call _pasteHTMLFromPasteboard (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): set new isDragging BOOL to YES (-[WebHTMLView draggedImage:endedAt:operation:]): set new isDragging BOOL to NO (-[WebHTMLView draggingEntered:]): new (-[WebHTMLView draggingUpdated:]): new, handle caret movement during the drag (-[WebHTMLView prepareForDragOperation:]): new (-[WebHTMLView performDragOperation:]): new (-[WebHTMLView concludeDragOperation:]): new, paste in the drag * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebImageView.m: (-[WebImageView mouseDragged:]): call renamed _web_dragImage * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: === Safari-126 === 2004-01-30 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3536126>: REGRESSION (Merlot): WebKit dragging is in strange location Reviewed by kocienda. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _handleMouseDragged:]): use the proper offset when dragging text 2004-01-28 John Sullivan <sullivan@apple.com> More header/footer work: refactored the header/footer code so it could be easily reused by other WebDocument classes; used it from WebImageView and WebTextView; removed the page count parameters because it's possible (though currently nasty, see 3543078) to determine this in the client. Reviewed by Dave. * Misc.subproj/WebNSPrintOperationExtras.h Added. * Misc.subproj/WebNSPrintOperationExtras.m Added. (-[NSPrintOperation _web_pageSetupScaleFactor]): new convenience method. * WebView.subproj/WebUIDelegatePrivate.h: Removed page index and page count parameters from delegate methods. * WebView.subproj/WebViewPrivate.h: New private category for header/footer printing methods so that different WebDocument methods can share almost all of the code. * WebView.subproj/WebView.m: (-[WebView _headerHeight]): (-[WebView _footerHeight]): (-[WebView _drawHeaderInRect:]): (-[WebView _drawFooterInRect:]): (-[WebView _adjustPrintingMarginsForHeaderAndFooter]): (-[WebView _drawHeaderAndFooter]): Moved all of these methods here, formerly in WebHTMLView. Removed the page index and page count parameters. * WebView.subproj/WebHTMLView.m: Removed all the header/footer code that's now in WebView.m, and the method that's now -[NSPrintOperation _web_pageSetupScaleFactor] (-[WebHTMLView _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]): call methods differently that have now been moved (-[WebHTMLView _scaleFactorForPrintOperation:]): ditto (-[WebHTMLView knowsPageRange:]): ditto (-[WebHTMLView drawPageBorderWithSize:]): now just turns around and calls -[WebView _drawHeaderAndFooter] * WebView.subproj/WebImageView.m: (-[WebImageView drawPageBorderWithSize:]): new method, just calls -[WebView _drawHeaderAndFooter] (-[WebImageView beginDocument]): now calls -[WebView _adjustPrintMarginsForHeaderAndFooter], also moved in file. (-[WebImageView endDocument]): just moved in file. * WebView.subproj/WebTextView.m: (-[WebTextView drawPageBorderWithSize:]): new method, just calls -[WebView _drawHeaderAndFooter] (-[WebTextView knowsPageRange:]): overridden to call -[WebView _adjustPrintMarginsForHeaderAndFooter] * WebKit.pbproj/project.pbxproj: updated for added files 2004-01-28 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3197222>: need context menu items for back, forward, refresh. Reviewed by rjw. * English.lproj/Localizable.strings: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate menuItemWithTag:]): added support for WebMenuItemTagGoBack, WebMenuItemTagGoForward, WebMenuItemTagStop and WebMenuItemTagReload tags (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): added support for Back, Forward, Stop and Reload * WebView.subproj/WebUIDelegate.h: added WebMenuItemTagGoBack, WebMenuItemTagGoForward, WebMenuItemTagStop and WebMenuItemTagReload tags 2004-01-27 John Sullivan <sullivan@apple.com> WebKit part of fixes for: <rdar://problem/3123975>: ER: please list the source URL in the header or footer when printing the contents of a page <rdar://problem/3184091>: Safari - Configurable printing header/footer <rdar://problem/3306826>: Please allow printing the date (as well as URL) in the header or footer Reviewed by Dave. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _headerHeight]): new method, gets result from WebView's UI delegate or returns 0 (-[WebHTMLView _footerHeight]): new method, gets result from WebView's UI delegate or returns 0 (-[WebHTMLView _drawHeaderInRect:]): new method, gives WebView's UI delegate a chance to draw header (-[WebHTMLView _drawFooterInRect:]): new method, gives WebView's UI delegate a chance to draw footer (-[WebHTMLView _adjustPrintingMarginsForHeaderAndFooter]): new method, adds header and footer heights into page margins so AppKit printing code will compute and use the right area (-[WebHTMLView _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]): now calls _adjustPrintingMarginsForHeaderAndFooter if starting to print (-[WebHTMLView drawPageBorderWithSize:]): new method, computes rects for header and footer and calls new drawing methods * WebView.subproj/WebUIDelegatePrivate.h: add header and footer-related delegate methods 2004-01-27 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3541812>: Implement Paste menu item <rdar://problem/3541814>: Implement Delete menu item <rdar://problem/3541811>: Implement Cut menu item Reviewed by dave. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _haveSelection]): new, renamed from hasSelection, calls haveSelection on the bridge, quicker than generating string rep of selection (-[WebHTMLView _canDelete]): new (-[WebHTMLView _canPaste]): new (-[WebHTMLView takeFindStringFromSelection:]): call renamed _haveSelection (-[WebHTMLView cut:]): new (-[WebHTMLView delete:]): new (-[WebHTMLView paste:]): new (-[WebHTMLView validateUserInterfaceItem:]): updated for new methods (-[WebHTMLView validRequestorForSendType:returnType:]): call renamed _haveSelection * WebView.subproj/WebHTMLViewPrivate.h: 2004-01-27 Chris Blumenberg <cblu@apple.com> Fixed build breakage. Reviewed by darin. * WebKit.pbproj/project.pbxproj: Use full path instead of -L to get at WebKitSecurity.a 2004-01-27 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3536624>: Webkit 1.2 links against SecurityNssAsn1.framework Reviewed by Darin. * WebCoreSupport.subproj/WebKeyGeneration.h: Set DISABLE_WEB_KEY_GENERATION on Merlot for now. Then don't include anything if that's set. * WebCoreSupport.subproj/WebKeyGeneration.cpp: Don't compile anything if DISABLE_WEB_KEY_GENERATION is set. * WebCoreSupport.subproj/WebKeyGenerator.m: (-[WebKeyGenerator signedPublicKeyAndChallengeStringWithStrengthIndex:challenge:pageURL:]): Always return nil if DISABLE_WEB_KEY_GENERATION is set. (-[WebKeyGenerator addCertificatesToKeychainFromData:]): Always return failure if DISABLE_WEB_KEY_GENERATION is set. * WebKit.pbproj/project.pbxproj: Added shell build step to make library with security libraries in it. On Merlot, makes empty library. Also added library to link options. * WebKitSecurityDummy.c: Added. Used to make empty version of library for build on Merlot. 2004-01-26 Darin Adler <darin@apple.com> * Makefile.am: Switch from pbxbuild to xcodebuild. 2004-01-26 Darin Adler <darin@apple.com> Reviewed by John. - fixed <rdar://problem/3521379>: image dimensions uses lowercase x instead of multiplication sign * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation title]): Change string to use multiplication sign instead of x. * English.lproj/Localizable.strings: Updated. 2004-01-23 Ken Kocienda <kocienda@apple.com> Reviewed by Richard * WebView.subproj/WebHTMLView.m: (-[WebHTMLView updateShowsFirstResponder]): Renamed from updateFocusRing: since it is now used to kill caret blink timer. (-[WebHTMLView windowDidBecomeKey:]): Now calls new updateShowsFirstResponder method. (-[WebHTMLView windowDidResignKey:]): Ditto. 2004-01-22 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3537542>: support for copying HTML Reviewed by dave. * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation reconstructedSource]): for BLOT's eventual use * WebView.subproj/WebHTMLView.m: (+[WebHTMLView _pasteboardTypes]): provide NSHTMLPboardType (-[WebHTMLView _writeSelectionToPasteboard:]): add HTML to the pasteboard 2004-01-22 John Sullivan <sullivan@apple.com> Reviewed by Chris. * English.lproj/StringsNotToBeLocalized.txt: brought this file back up to date 2004-01-22 Darin Adler <darin@apple.com> - fixed 3536624: Webkit 1.2 links against SecurityNssAsn1.framework * WebKit.pbproj/project.pbxproj: Remove SecurityNssAsn1.framework from the list we link against. It's still included in the list for places to find headers. === Safari-125 === === Safari-124 === 2004-01-15 Vicki Murley <vicki@apple.com> Reviewed by Darin. * WebKit.pbproj/project.pbxproj: Update copyright date to 2004. * English.lproj/InfoPlist.strings: Update copyright date to 2004. === Safari-122 === === Safari-121 === 2004-01-10 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3524906: REGRESSION (114-115): page with plug-in content never stops loading (travelking.com.tw) Put the plug-in streams clients into their own separate set. Now a plug-in client is not considered part of "loading", but it does participate in the callback deferral mechanism, which was the real goal of the change I made that introduced this regression. Also remove the plug-in client in one case I had missed before (cancel). * WebView.subproj/WebDataSourcePrivate.h: Added a new set of plugInStreamClients. * WebView.subproj/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): Release the set. (-[WebDataSource _addPlugInStreamClient:]): Added. Adds to the set. (-[WebDataSource _removePlugInStreamClient:]): Added. Removes from the set. (-[WebDataSource _defersCallbacksChanged]): Added code to loop through plugInStreamClients too. * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream start]): Use _add/removePlugInStreamClient instead of _add/removeSubresourceClient. (-[WebNetscapePluginConnectionDelegate connectionDidFinishLoading:]): Ditto. (-[WebNetscapePluginConnectionDelegate connection:didFailWithError:]): Ditto. (-[WebNetscapePluginConnectionDelegate cancelWithError:]): Override to call _removePlugInStreamClient and then call super. 2004-01-09 Darin Adler <darin@apple.com> - rolled out most of Dave's change for 3510669 and 3515442; it is not working yet * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLView.m: 2004-01-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Chris. <rdar://problem/3514446>: cert downloaded from BofA or MIT is rejected (ACL issue on private key?) * WebCoreSupport.subproj/WebKeyGeneration.cpp: (createPair): Cut & paste hunk of code from Security framework. (Safari_SecKeyCreatePair): Ditto. (signedPublicKeyAndChallengeString): Instead of creating a normal ACL, use our hacked version of the SecKeyCreatePair call that doesn't put in any kind of ACL. This works around a SecureTransport bug. 2004-01-09 David Hyatt <hyatt@apple.com> Fixes for 3510669 and 3515442, blank frame problems caused by WebKit's resizing not scheduling actual layouts via WebCore. Reviewed by darin * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _web_layoutIfNeededRecursive:testDirtyRect:]): (-[WebHTMLView initWithFrame:]): (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): (-[WebHTMLView setNeedsLayout:]): * WebView.subproj/WebHTMLViewPrivate.h: 2004-01-09 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed 3510805: "PoolCleaner" in Carbon WebKit leads to overrelease and crash using color picker in BBEdit * Carbon.subproj/CarbonUtils.m: (PoolCleaner): Only do the autorelease pool stuff in the default run loop mode. If we're in another run loop mode that means we are in some Cocoa code that sets up its own autorelease pool; it's important that we don't release ours in that case. 2004-01-08 Maciej Stachowiak <mjs@apple.com> Reviewed by John. <rdar://problem/3522298>: Error on MIT's x509 certificate site * WebCoreSupport.subproj/WebKeyGeneration.cpp: (addCertificatesToKeychainFromData): Sign the freshly minted public key using RSA/MD5 instead of RSA/SHA-1, because MIT only supports MD5. 2004-01-08 Richard Williamson <rjw@apple.com> Fixed 3524430. This was a regression introduced when we added '-' and '?' to the word boundary detection. Also backed out workaround for 3521759 as it's no longer needed with correct argument passing to ATSUPositionToOffset. Reviewed by Hyatt. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:]): (widthForNextCharacter): 2004-01-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3522900>: REGRESSION (100-117): Java plug-in description is garbled when displaying Plug-ins.html Reviewed by darin. * Misc.subproj/WebKitNSStringExtras.h: * Misc.subproj/WebKitNSStringExtras.m: (+[NSString _web_encodingForResource:]): new method, returns the encoding for a resource handle given its file system path * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage stringForStringListID:andIndex:]): call _web_encodingForResource when creating the NSString === Safari-120 === 2004-01-06 Richard Williamson <rjw@apple.com> Fixed 3513660. Make ATSU layout and draw with integer glyph boundaries. This fix should be removed if/when we convert WebCore to use floats for measuring/positioning (3521781). Reviewed by John. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _createATSUTextLayoutForRun:]): 2004-01-05 Richard Williamson <rjw@apple.com> Fix for 3514454. Work-around added for 3521759. Filed 3521781 to cover deeper problem. Reviewed by Kocienda. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _ATSU_drawHighlightForRun:style:atPoint:]): (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:]): 2003-12-22 John Sullivan <sullivan@apple.com> - WebKit part of fix for <rdar://problem/3515706>: REGRESSION (100-118): Web Kit printing does not honor Page Setup scale factor Reviewed by Darin. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _userScaleFactorForPrintOperation:]): new method, extracts the scale factor provided by the user in the Page Setup dialog (-[WebHTMLView _scaleFactorForPrintOperation:]): take user scale factor into account (-[WebHTMLView knowsPageRange:]): renamed local var scaleFactor -> totalScaleFactor for clarity; take user scale factor into account for print width; now assumes computePageRects returns autoreleased result. * WebKit.pbproj/project.pbxproj: Xcode version wars; Darin says these don't affect the build. 2003-12-21 Darin Adler <darin@apple.com> Reviewed by John. - fixed a storage leak * WebView.subproj/WebFrame.m: (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): Move the release of the request out of an if statement, since it's always needed. 2003-12-19 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3515255>: Standalone image drag makes ocassionally makes 2 copies Reviewed by john. * WebKit.pbproj/project.pbxproj: Xcode 1.1 file format change * WebView.subproj/WebImageView.h: * WebView.subproj/WebImageView.m: copied double-drag protection code from WebHTMLView (-[WebImageView mouseDown:]): set ignoringMouseDraggedEvents to NO (-[WebImageView mouseDragged:]): if ignoringMouseDraggedEvents, return (-[WebImageView draggedImage:endedAt:operation:]): set ignoringMouseDraggedEvents to YES === Safari-119 === 2003-12-18 Richard Williamson <rjw@apple.com> Fixed 3511415. We have to un-visually order visually ordered text before passing to ATSU. Reviewed by John. * WebCoreSupport.subproj/WebTextRenderer.m: (reverseCharactersInRun): (-[WebTextRenderer _ATSU_drawHighlightForRun:style:atPoint:]): (-[WebTextRenderer _ATSU_drawRun:style:atPoint:]): (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:]): 2003-12-17 Richard Williamson <rjw@apple.com> Fixed 3503011 (really, this time). Always use integer width for '-' and '?', as we do for spaces, to ensure that 'words' (as defined by out rounding hack) start on integer boundaries. Reviewed by John. * WebCoreSupport.subproj/WebTextRenderer.m: (widthForNextCharacter): 2003-12-17 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3393758>: REGRESSION (85-100): Flash onKeyUp event non-functional <rdar://problem/3479020>: REGRESSION (85-100): Safari sends plug-in key events to wrong instance of plug-in Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendEvent:]): set suspendKeyUpEvents to NO (-[WebBaseNetscapePluginView keyMessageForEvent:]): copied from CVS (-[WebBaseNetscapePluginView keyUp:]): if !suspendKeyUpEvents, send the keyUp event (-[WebBaseNetscapePluginView keyDown:]): set suspendKeyUpEvents to YES (-[WebBaseNetscapePluginView windowBecameKey:]): call SetUserFocusWindow 2003-12-17 Darin Adler <darin@apple.com> Reviewed by Richard. - fixed 3513274: REGRESSION: anchor navigation within frames with "Back" is broken at tivofaq.com * WebView.subproj/WebDataSource.m: (-[WebDataSource _setURL:]): Since this method is only used when you do a fragment scroll, we need to update the original request as well as the request. This ensure that the fragment gets recorded in the history item (which goes in the back/forward history). === Safari-118 === 2003-12-17 John Sullivan <sullivan@apple.com> - fixed <rdar://problem/3512801>: REGRESSION (Safari 100-116): Mike Hay's Magic 8-ball game ignores slow clicks Reviewed by Darin. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _handleAutoscrollForMouseDragged:]): start the autoscroll timer here, so the timer only runs when KHTML is handling the event. (-[WebHTMLView mouseDown:]): don't start the autoscroll timer here. 2003-12-16 Ken Kocienda <kocienda@apple.com> * WebCoreSupport.subproj/WebBridge.m: ObjC runtime needs a declaration for new _calculatedExpiration SPI in NSURLResponse in Foundation 2003-12-16 Richard Williamson <rjw@apple.com> Fixed 3512348: Rewrote _CG_drawHighlightForRun:style:atPoint: to use width iterators. Much faster, better cheaper, etc. Reviewed by Dave. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _CG_drawHighlightForRun:style:atPoint:]): 2003-12-16 Richard Williamson <rjw@apple.com> Fixed 3503011. Added '-' and '?' to rounding hack. Reviewed by John. * WebCoreSupport.subproj/WebTextRenderer.m: (isRoundingHackCharacter): (widthForNextCharacter): 2003-12-16 Darin Adler <darin@apple.com> Reviewed by Richard. - finished fix to 3109132: can't open movie file via open panel * WebView.subproj/WebView.m: (+[WebView _supportedFileExtensions]): Include all the extensions for each MIME type, not jus the preferred one. 2003-12-16 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3512199>: WebBridge expiresTimeForResponse can be improved to use better expiration calculations * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge expiresTimeForResponse:]): Switch to use new _calculatedExpiration SPI method on NSURLResponse. 2003-12-15 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3505546>: always get keychain prompt when sending mail using cert downloaded with Safari Reviewed by john. * WebCoreSupport.subproj/WebKeyGeneration.cpp: (signedPublicKeyAndChallengeString): set up the SecAccessRef with "everything goes" restrictions 2003-12-14 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3311205: click() on a file input type form element does not work bring up the file chooser as it does in IE * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileButton performClick]): Add method for clicking, now part of the WebCoreFileButton protocol. The rest of the fix is in WebCore. 2003-12-13 Darin Adler <darin@apple.com> Fixed by Ed Voas, reviewed by me. - fixed 3278443: CARBON: grow box obscures scroll bar knob * Carbon.subproj/CarbonWindowAdapter.m: (-[CarbonWindowAdapter _growBoxRect]): Return the grow box so AppKit's scroll bar code will know where it is. 2003-12-12 Ken Kocienda <kocienda@apple.com> * WebCoreSupport.subproj/WebKeyGeneration.cpp: (signedPublicKeyAndChallengeString): Fix build-bustin' typo. 2003-12-12 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3396936>: can't obtain a digital ID from Verisign, form submission fails <rdar://problem/3505208>: keys added to keychain from KEYGEN need better UI names Reviewed by rjw. * English.lproj/Localizable.strings: * WebCoreSupport.subproj/WebKeyGeneration.cpp: (signedPublicKeyAndChallengeString): take a key description arg and use it, take and return CFStrings, handle the empty string case (addCertificatesToKeychainFromData): return a WebCertificateParseResult so WB knows how to handle the cert * WebCoreSupport.subproj/WebKeyGeneration.h: * WebCoreSupport.subproj/WebKeyGenerator.h: * WebCoreSupport.subproj/WebKeyGenerator.m: (-[WebKeyGenerator signedPublicKeyAndChallengeStringWithStrengthIndex:challenge:pageURL:]): take a page URL so we can use its host name in the key description * WebKit.pbproj/project.pbxproj: 2003-12-12 Vicki Murley <vicki@apple.com> * WebKit.pbproj/project.pbxproj: 2003-12-12 Vicki Murley <vicki@apple.com> * WebKit.pbproj/project.pbxproj: 2003-12-12 Vicki Murley <vicki@apple.com> * WebKit.pbproj/project.pbxproj: 2003-12-11 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3489280>: redirect via post blows cache, causing everything to get reloaded Now POST requests reload the main document by default, but will not reload all subresources. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withRequest:customHeaders:referrer:forDataSource:]): * WebView.subproj/WebFrame.m: (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): Take the cache policy for subresources from the original request, rather than the data source's current request. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient _isPostOrRedirectAfterPost:redirectResponse:]): New helper. (-[WebMainResourceClient connection:willSendRequest:redirectResponse:]): Call new helper to set the cache policy on the main resource load. === Safari-117 === 2003-12-11 Ken Kocienda <kocienda@apple.com> Reviewed by Darin * WebCoreSupport.subproj/WebBridge.m: time_t is a signed type, so casting -1 to a time_t does not work to make a max value. We'll go with INT_MAX. 2003-12-11 Ken Kocienda <kocienda@apple.com> Reviewed and C++ heavy-lifting by Darin Fix warnings in C++ files. * WebCoreSupport.subproj/WebKeyGeneration.cpp: (signedPublicKeyAndChallengeString): Add cast to remove warning. (addCertificatesToKeychainFromData): Add cast to remove warning. * WebKit.pbproj/project.pbxproj: Add back warnings to C++ files. * WebKitPrefix.h: Add define for NULL that works for C++. 2003-12-09 Ken Kocienda <kocienda@apple.com> Reviewed by Darin <rdar://problem/3505444>: WebCore cache does not use expiration dates on cache items * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge expiresTimeForResponse:]): New method. Call response freshness lifetime method and add it to the current time to yield an expiration time. 2003-12-10 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. WebKit part of fix for: <rdar://problem/3487160>: Implement synchronous loading for XMLHttpRequest * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): 2003-12-10 Richard Williamson <rjw@apple.com> Added method to get to the bridge from a view. This is used to ultimately get the part and KJS::Window for a particular applet. Reviewed by Hyatt. * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory refreshPlugins:]): (-[WebViewFactory bridgeForView:]): 2003-12-10 John Sullivan <sullivan@apple.com> - WebKit part of fix for: <rdar://problem/3505231>: REGRESSION (100-114): Some sites autoscroll to bottom of page when loading Reviewed by Darin * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: removed _web_scrollPointToVisible:fromView: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView scrollPoint:]): removed call to _web_scrollPointToVisible:fromView: 2003-12-10 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3505537>: certificates downloaded from Verisign are multipart/mixed, must be parsed out Reviewed by kocienda. * WebCoreSupport.subproj/WebKeyGeneration.cpp: (signedPublicKeyAndChallengeString): tweak (addCertificateToKeychainFromData): renamed to use lowercase "c" in "keychain" (addCertificatesToKeychainFromData): take data instead of a path to a file * WebCoreSupport.subproj/WebKeyGeneration.h: * WebCoreSupport.subproj/WebKeyGenerator.h: * WebCoreSupport.subproj/WebKeyGenerator.m: (-[WebKeyGenerator signedPublicKeyAndChallengeStringWithStrengthIndex:challenge:]): added temporary workaround for 3396936 2003-12-09 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3504237>: add downloaded certificates to keychain Reviewed by darin. * WebCoreSupport.subproj/WebKeyGeneration.cpp: (signedPublicKeyAndChallengeString): (addCertificateToKeyChainFromData): new (addCertificateToKeyChainFromFile): new * WebCoreSupport.subproj/WebKeyGeneration.h: * WebCoreSupport.subproj/WebKeyGenerator.h: * WebCoreSupport.subproj/WebKeyGenerator.m: (-[WebKeyGenerator addCertificateToKeyChainFromFileAtPath:]): new * WebKit.exp: * WebKit.pbproj/project.pbxproj: made WebKeyGenerator.h private 2003-12-09 John Sullivan <sullivan@apple.com> - fixed <rdar://problem/3504907>: REGRESSION (100-116): Clicking QuickTime-requiring link twice crashes (wholenote.com) I found the bug; Darin wrote the fix; I reviewed and tested. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage stringForStringListID:andIndex:]): Rewrote this method to not use GetIndString, because GetIndString looks at all open resource files and in this case was reading information from the wrong plugin file. 2003-12-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3234676>: Support for KEYGEN tag (ie 509 email certificates from www.thawte.com) Reviewed by mjs. * WebCoreSupport.subproj/WebKeyGeneration.cpp: Added. (gnrAddContextAttribute): new (gnrGetSubjPubKey): new (gnrNullAlgParams): new (gnrSign): new (gnrFreeCssmData): new (signedPublicKeyAndChallengeString): new * WebCoreSupport.subproj/WebKeyGeneration.h: Added. * WebCoreSupport.subproj/WebKeyGenerationFactory.h: Added. Renamed from WebLocalizedStringFactory. * WebCoreSupport.subproj/WebKeyGenerationFactory.m: Added. (+[WebKeyGenerationFactory createSharedFactory]): no change (-[WebKeyGenerationFactory dealloc]): no change (-[WebKeyGenerationFactory strengthMenuItemTitles]): new (-[WebKeyGenerationFactory signedPublicKeyAndChallengeStringWithStrengthIndex:challenge:]): new * WebCoreSupport.subproj/WebLocalizedStringFactory.h: Removed. * WebCoreSupport.subproj/WebLocalizedStringFactory.m: Removed. * WebCoreSupport.subproj/WebNetscapeTemplates.cpp: Added. * WebCoreSupport.subproj/WebNetscapeTemplates.h: Added. * WebKit.pbproj/project.pbxproj: * WebKitPrefix.h: * WebView.subproj/WebFrameView.m: 2003-12-05 John Sullivan <sullivan@apple.com> - fixed <rdar://problem/3491427>: REGRESSION (100-114): multi-page HTML content in Mail is blank when printed Darin and I figured this one out. Reviewed by Ken. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]): Don't call setNeedsDisplay:NO when we're turning printing on, as doing so prevents anything from drawing in the case where this is called from adjustPageHeightsNew:top:bottom:limit 2003-12-05 Darin Adler <darin@apple.com> Reviewed by John. - fixed regression in small caps with substituted fonts my patch from yesterday caused - fixed 3463599: if Lucida font is installed, you see bad glyphs on pages that use it (advogato.org) - fixed storage leak if a renderer is ever deallocated (I don't think we ever do that) - fixed some small leaks in various error cases by adding appropriate free and dispose calls * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer dealloc]): Free the Unicode glyph map too. (fontContainsString): Moved inline function up here so it will be inlined. (-[WebTextRenderer _setupFont]): Free the glyph map and set it back to zero if we fail after extending the glyph map to include space. This fixes the "wrong glyph codes" bug with Lucida above. (-[WebTextRenderer _extendUnicodeCharacterToGlyphMapToInclude:]): Add free calls needed to avoid storage leaks in failure cases. (-[WebTextRenderer _extendCharacterToGlyphMapToInclude:]): Ditto. (-[WebTextRenderer _initializeATSUStyle]): Add ATSUDisposeStyle to fix storage leak. (freeWidthMap): Use a loop instead of recursion. (freeGlyphMap): Use a loop instead of recursion. (freeUnicodeGlyphMap): Added. (widthForNextCharacter): Don't use the original characters or cluster length, because the character may have been capitalized for use in small caps rendering. So check the character for <= 0xFFFF instead of looking at clusterLength, and break the character into a local array instead of using the original character pointer. 2003-12-04 Darin Adler <darin@apple.com> Reviewed by Richard. - fixed 3497879: REGRESSION (100-115): all non-BMP characters (including Deseret) are broken * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _CG_pointToOffset:style:position:reversed:]): Bump offset by getting it from the iterator; don't assume we can just bump it by one each time. It would be even nicer to have a bit more abstraction. (initializeCharacterWidthIterator): Remove call to initializeCharacterShapeIterator. (widthForNextCharacter): Move handling of surrogate pairs (non-BMP) in here and unify it with the handling of BMP characters; this removes the broken code that was returning the wrong font, and changes us to use the code that was already doing the right thing for the surrogate pair case. Also get rid of the use of 0 width to mean "no glyph", which fixes the doubled glyph problem. Also got rid of remnants of use of the shape iterator. * Misc.subproj/WebUnicode.h: Remove obsolete shape iterator. * Misc.subproj/WebUnicode.m: Ditto. === Safari-116 === 2003-12-04 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed 3498426: assertion failure in tooltip code at macosx.apple.com * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _setToolTip:]): Work around the apparent bug in AppKit (3500217) that causes it to return 0 for the tool tip tag by using removeAllToolTips and not storing the tag at all. Besides the assertion failure there may also be a symptom of a "stuck" tool tip and a small memory leak until the window is closed. * WebView.subproj/WebHTMLViewPrivate.h: Remove unused toolTipTag. 2003-12-02 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3439222>: always hangs opening plain text file on a particular machine due to missing font, no UI to detect <rdar://problem/3492983>: Certain fonts cause Safari to hang on text/plain pages Reviewed by rjw. * WebView.subproj/WebTextView.m: (-[WebTextView setFixedWidthFont]): Use [[WebTextRendererFactory sharedFactory] fontWithFamilies:traits:size:] to get the font since it takes the font family which is what we store in WebPreferences and it does fallback work. Only set the font if non-nil is returned. 2003-11-21 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. <rdar://problem/3487185>: implement security checks for XMLHttpRequest * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient connection:willSendRequest:redirectResponse:]): Let WebCore know about redirects. 2003-12-01 Richard Williamson <rjw@apple.com> Moved grungy polling code from WebKit to the JavaPlugin. Reviewed by Chris. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge pollForAppletInView:]): 2003-12-01 Ken Kocienda <kocienda@apple.com> Reviewed by John Fix for this bug: <rdar://problem/3496873>: Move key event helper functions to WebKit * Misc.subproj/WebNSEventExtras.h: Add declarations for new key event helpers. * Misc.subproj/WebNSEventExtras.m: (-[NSEvent _web_isKeyEvent:]): Added. (-[NSEvent _web_isDeleteKeyEvent]): Added. (-[NSEvent _web_isEscapeKeyEvent]): Added. (-[NSEvent _web_isOptionTabKeyEvent]): Added. (-[NSEvent _web_isReturnOrEnterKeyEvent]): Added. (-[NSEvent _web_isTabKeyEvent]): Added. * WebKit.pbproj/project.pbxproj: Made WebNSEventExtras.h a private header so WebBrowser can use the new helpers. === Safari-115 === 2003-11-21 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. WebKit part of fix for: <rdar://problem/3487134>: Implement http request/response status and headers for XMLHttpRequest * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge startLoadingResource:withURL:customHeaders:]): Added customHeaders parameter. (-[WebBridge startLoadingResource:withURL:customHeaders:postData:]): Ditto. * WebCoreSupport.subproj/WebSubresourceClient.h: * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withRequest:customHeaders:referrer:forDataSource:]): Add the custom headers. (+[WebSubresourceClient startLoadingResource:withURL:customHeaders:referrer:forDataSource:]): Pass along the custom headers. (+[WebSubresourceClient startLoadingResource:withURL:customHeaders:postData:referrer:forDataSource:]): Pass along the custom headers. 2003-11-21 John Sullivan <sullivan@apple.com> - WebKit part of fix for <rdar://problem/3333744>: Safari prints page with very, very long line very, very small Reviewed by Ken. * WebView.subproj/WebHTMLView.m: renamed PrintingExtraWidthFactor to PrintingMinimumShrinkFactor, added PrintingMaximumShrinkFactor of 2.0, which matches IE (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): now takes a min and max page width; passes them along to bridge (-[WebHTMLView _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]): now takes a min and max page width; passes them along to layoutTo... (-[WebHTMLView _scaleFactorForPrintOperation:]): now takes PrintingMaximumScaleFactor into account (-[WebHTMLView knowsPageRange:]): now takes PrintingMaximumScaleFactor into account (-[WebHTMLView layout]): pass 0 for maximumPageWidth when passing 0 for minimumPageWidth (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): ditto (-[WebHTMLView _web_setPrintingModeRecursive]): ditto (-[WebHTMLView _web_clearPrintingModeRecursive]): ditto (-[WebHTMLView endDocument]): ditto 2003-11-20 John Sullivan <sullivan@apple.com> - WebKit part of <rdar://problem/3183124>: Support page-break-before/after with a value of "always" Dave and I wrote and reviewed this. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _setPrinting:pageWidth:adjustViewSize:]): reset page rects when printing status changes (-[WebHTMLView _availablePaperWidthForPrintOperation:]): new helper method to compute paper width taking margins into account (-[WebHTMLView _scaleFactorForPrintOperation:]): new helper method to compute how much we need to shrink to fit one page across (-[WebHTMLView _provideTotalScaleFactorForPrintOperation:]): we overrode this secret internal AppKit method to make shrink-to-fit work; we wrote bug 3491344 about the need for this to be public. (-[WebHTMLView knowsPageRange:]): new method, computes rects and returns YES (-[WebHTMLView rectForPage:]): new method, returns rect computed above (-[WebHTMLView _calculatePrintHeight]): new method, used by knowsPageRange * WebView.subproj/WebHTMLViewPrivate.h: new pageRects ivar 2003-11-20 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. - fixed 3490086 - support http post for XMLHttpRequest * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge startLoadingResource:withURL:postData:]): * WebCoreSupport.subproj/WebSubresourceClient.h: * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withRequest:referrer:forDataSource:]): (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): (+[WebSubresourceClient startLoadingResource:withURL:postData:referrer:forDataSource:]): 2003-11-20 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3491229>: Need UI and localized strings for <KEYGEN> support Reviewed by john. * ChangeLog: * English.lproj/Localizable.strings: * WebCoreSupport.subproj/WebLocalizedStringFactory.h: Added. * WebCoreSupport.subproj/WebLocalizedStringFactory.m: Added. (+[WebLocalizedStringFactory createSharedFactory]): new (-[WebLocalizedStringFactory dealloc]): new (-[WebLocalizedStringFactory keyGenerationMenuItemTitles]): new * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebFrameView.m: call [WebLocalizedStringFactory createSharedFactory] 2003-11-20 Richard Williamson <rjw@apple.com> Added spin of event loop during applet lookup poll. This is necessary to allow timers and performOnMainThread: methods a chance to fire. The plugin depends on these mechanisms during initialization. Reviewed by Chris. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge pollForAppletInView:]): 2003-11-20 Ken Kocienda <kocienda@apple.com> John and I decided to apply the _web_ prefix to the tab key event method in the extras file, but I neglected to do this before checking in. Fixed now. * Misc.subproj/WebNSEventExtras.h: * Misc.subproj/WebNSEventExtras.m: (-[NSEvent _web_isTabKeyEvent]) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView keyDown:]) 2003-11-20 Ken Kocienda <kocienda@apple.com> Reviewed by John Fix for this bug: <rdar://problem/3482159>: Tabbing to links gets "stuck" in "style switcher" on zeldman.com * Misc.subproj/WebNSEventExtras.h: Added. * Misc.subproj/WebNSEventExtras.m: Added. (-[NSEvent _isTabKeyEvent]): New helper. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView keyDown:]): Pass the key event to super unconditionally if it is a tab key. This fixes the bug. 2003-11-19 John Sullivan <sullivan@apple.com> - WebKit part of fix for: <rdar://problem/3305671>: Web pages print with 1.25" border without regard to Page Setup margin settings Reviewed by Dave. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView beginDocument]): Lay out the page into a width 25% wider than there's room for on the printed page. This will make pages that can fit into a thin area be scaled down a little when printed, which lets them fit on fewer pages. This closely matches what IE and Camino (at least) do; I used Google as my test page, and the Google logo is now precisely the same size when printed from Safari as when printed from IE. Pages that don't fit into a thin area are already causing the printed page to be scaled horizontally to fit, and this won't affect them. 2003-11-19 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3489935>: Mentioning "to Disk" in context menus such as "Download Linked File To Disk..." is redundant Reviewed by john. * English.lproj/Localizable.strings: * English.lproj/StringsNotToBeLocalized.txt: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate menuItemWithTag:]): use "Download Linked File" and "Download Image" 2003-11-19 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3488783>: Flash at http://www.sjwilson.net/reef/ does not load photos Reviewed by rjw. * Misc.subproj/WebKitNSStringExtras.h: * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _web_stringByStrippingReturnCharacters]): new * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView requestWithURLCString:]): call _web_stringByStrippingReturnCharacters on the relative string 2003-11-19 Richard Williamson <rjw@apple.com> More LiveConnect stuff. Horrible polling hack that blocks main thread waiting for applet to fully initialize. Reviewed by Ken. * Plugins.subproj/WebPluginController.m: (-[WebPluginController addPlugin:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge pollForAppletInView:]): 2003-11-19 David Hyatt <hyatt@apple.com> Make updateScrollers guard non-static, so that it applies only to the view whose scrollers are being updated. Reviewed by darin * WebView.subproj/WebDynamicScrollBarsView.h: * WebView.subproj/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView reflectScrolledClipView:]): 2003-11-18 Richard Williamson <rjw@apple.com> More live connect stubs. We're getting close. Reviewed by Chris. * Plugins.subproj/WebPluginController.m: (-[WebPluginController addPlugin:]): (-[WebPluginController _delayedGetApplet:]): * WebView.subproj/WebView.m: (-[WebView _goToItem:withLoadType:]): 2003-11-17 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3487335: REGRESSION (112-113): "a:b" error message does not cite the URL properly * Misc.subproj/WebKitErrors.m: (+[NSError _webKitErrorWithCode:failingURL:]): Call _webKitErrorWithDomain:code:URL:. (+[NSError _webKitErrorWithDomain:code:URL:]): Call _web_errorWithDomain:code:URL:, instead of using the deprecated failingURL: flavor. (-[NSError _initWithPluginErrorCode:contentURLString:pluginPageURLString:pluginName:MIMEType:]): Change this method to call the other one. (-[NSError _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:]): Implement this one, and put in the NSErrorFailingURLKey, as well as the NSErrorFailingURLStringKey, to match what Foundation now does for other errors. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): Change to use the non-deprecated flavor of the NSError call above. * English.lproj/StringsNotToBeLocalized.txt: Updated for above changes and other recent changes. 2003-11-16 Maciej Stachowiak <mjs@apple.com> Reviewed by Dave. WebKit part of fix for: <rdar://problem/3131664>: add support for the window.print() command used for "print this page" buttons * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge print]): Call delegate. * WebView.subproj/WebDefaultUIDelegate.m: (-[WebDefaultUIDelegate webViewPrint:]): Implemented (do nothing). * WebView.subproj/WebUIDelegatePrivate.h: Added. Add extra SPI method webViewPrint: for UI delegate. * WebKit.pbproj/project.pbxproj: Install WebUIDelegatePrivate.h as private header 2003-11-15 Darin Adler <darin@apple.com> Reviewed by John. - fixes 3457162 -- selecting text during a page load that blows the text field away causes a crash - fixes 3160035 -- crash or hang if you hold down a button while "go to about:blank soon" test runs - without causing 3484608 -- REGRESSION: Flash broken at http://www.macromedia.com/ The WebKit part of this fix is making setDefersCallbacks: work. It had succumbed to bit rot. This has a side effect of not considering a page load done until all the plug-in streams are loaded. If that's not a good idea, we'll have to keep two separate lists in WebDataSource. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate setDataSource:]): Set the defersCallbacks state from the WebView here so that clients don't have to do it. * WebView.subproj/WebDataSource.m: (-[WebDataSource _addSubresourceClient:]): Remove call to set the defersCallbacks state on the subresource client, because the above change obviates it. (the client/delegate terminology makes it confusing, but it's a subclass). Also loosen the type so we can call this on clients for plug-in streams too. (-[WebDataSource _removeSubresourceClient:]): Loosen type here too. (-[WebDataSource _defersCallbacksChanged]): And here. * WebView.subproj/WebDataSourcePrivate.h: Loosen type of subresource client so we can pass in the delegates for plug-in streams too. * WebView.subproj/WebMainResourceClient.h: Added an _initialRequest field so we can defer the very first callback, which does not rely on NSURLConnection. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient dealloc]): Release the initial request. (-[WebMainResourceClient loadWithRequestNow:]): Moved the guts of loadWithRequest in here; to be used when the request is no longer deferred. Also removed the code to call setDefersCallbacks: on the connection, and assert that we are only called when callbacks are not deferred. Because the very first callback was not deferred, we would end up calling setDefersCallbacks:NO on the WebView, so nothing would be deferred. (-[WebMainResourceClient loadWithRequest:]): If callbacks are not deferred, then call the loadWithRequestNow: method, otherwise simply store the request in _initialRequest. (-[WebMainResourceClient setDefersCallbacks:]): If there is an _initialRequest and we are ceasing deferral of callbacks, then call the loadWithRequestNow: method. * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream start]): Call _addSubresourceClient, and then _removeSubresourceClient if the load fails to even start. (-[WebNetscapePluginConnectionDelegate connectionDidFinishLoading:]): Call _removeSubresourceClient. (-[WebNetscapePluginConnectionDelegate connection:didFailWithError:]): Call _removeSubresourceClient. * Plugins.subproj/WebBaseNetscapePluginStream.h: Removed unneeded import. * Plugins.subproj/WebPluginDatabase.m: Add import needed now that WebBaseNetscapePluginStream.h imports less than before. 2003-11-16 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - fixed 3362841 - javascript History Object length property is always 0 * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge historyLength]): Add one to the length to match other browsers. 2003-11-14 John Sullivan <sullivan@apple.com> - WebKit part of fix for <rdar://problem/3474757>: Safari on-screen text needs review Reviewed by Ken. * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate menuItemWithTag:]): change "Download Link to Disk" to "Download Linked File to Disk" * English.lproj/Localizable.strings: updated for these changes 2003-11-14 Ken Kocienda <kocienda@apple.com> Reviewed by John Fix for this bug: <rdar://problem/3481701>: Crashes before loading page/no error msg (forums.pelicanparts.com) Works in IE and Netscape This fix is really a workaround for this bug: <rdar://problem/3484937>: Horribly malformed URL crashes when call is made to CFURLCopyHostName The fix is to avoid all usages of [NSURL host] by replacing all such calls with a private URL method added to WebNSURLExtras. I copied a number of URL methods from the private NSURL extras file in Foundation to the WebKit URL extras file. * Misc.subproj/WebNSDataExtras.h: Added. Helper for new URL extras. * Misc.subproj/WebNSDataExtras.m: Ditto. (-[NSData _web_isCaseInsensitiveEqualToCString:]): New helper. * Misc.subproj/WebNSURLExtras.h: * Misc.subproj/WebNSURLExtras.m: (-[NSURL _web_hasQuestionMarkOnlyQueryString]): Added. (-[NSURL _web_schemeSeparatorWithoutColon]): Added. (-[NSURL _web_dataForURLComponentType:]): Added. (-[NSURL _web_schemeData]): Added. (-[NSURL _web_hostData]): Added. (-[NSURL _web_hostString]): Added. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebView.m: (-[WebView userAgentForURL:]): Replace call to [NSURL host] with new extras _web_hostString method. === Safari-114 === 2003-11-14 Vicki Murley <vicki@apple.com> - rolled out Darin's fixes for 3457162 and 3160035, since these changes broke plugins on macromedia.com and disney.go.com * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate setDataSource:]): * WebView.subproj/WebDataSource.m: (-[WebDataSource _addSubresourceClient:]): * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient dealloc]): (-[WebMainResourceClient loadWithRequest:]): (-[WebMainResourceClient setDefersCallbacks:]): 2003-11-14 Darin Adler <darin@apple.com> Reviewed by John. - fixes 3457162 -- selecting text during a page load that blows the text field away causes a crash - fixes 3160035 -- crash or hang if you hold down a button while "go to about:blank soon" test runs The WebKit part of this fix is making setDefersCallbacks: work. It had succumbed to bit rot. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate setDataSource:]): Set the defersCallbacks state from the WebView here so that clients don't have to do it. * WebView.subproj/WebDataSource.m: (-[WebDataSource _addSubresourceClient:]): Remove call to set the defersCallbacks state on the subresource client, because the above change obviates it. (the client/delegate terminology makes it confusing, but it's a subclass). * WebView.subproj/WebMainResourceClient.h: Added an _initialRequest field so we can defer the very first callback, which does not rely on NSURLConnection. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient dealloc]): Release the initial request. (-[WebMainResourceClient loadWithRequestNow:]): Moved the guts of loadWithRequest in here; to be used when the request is no longer deferred. Also removed the code to call setDefersCallbacks: on the connection, and assert that we are only called when callbacks are not deferred. Because the very first callback was not deferred, we would end up calling setDefersCallbacks:NO on the WebView, so nothing would be deferred. (-[WebMainResourceClient loadWithRequest:]): If callbacks are not deferred, then call the loadWithRequestNow: method, otherwise simply store the request in _initialRequest. (-[WebMainResourceClient setDefersCallbacks:]): If there is an _initialRequest and we are ceasing deferral of callbacks, then call the loadWithRequestNow: method. 2003-11-13 Ken Kocienda <kocienda@apple.com> Reviewed by John Fix for this bug: <rdar://problem/3483284>: Tabbing to links needs to honor new WebKit tab-to-links preference * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge dealloc]): Remove self from notification center. (-[WebBridge _retrieveKeyboardUIModeFromPreferences:]): Now checks for WebCoreKeyboardAccessTabsToLinks preference. (-[WebBridge keyboardUIMode]): Adds self to notification center to pick up changes to WebPreferences. 2003-11-13 Ken Kocienda <kocienda@apple.com> Reviewed by John Fix for this bug: <rdar://problem/3481719>: WebKit needs preference for tabbing to links * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): Add initialization of new WebKitTabToLinksPreferenceKey. (-[WebPreferences setTabsToLinks:]): Added preference setter. (-[WebPreferences tabsToLinks]): Added preference getter. * WebView.subproj/WebPreferencesPrivate.h: Declared new methods as SPI on WebPreferences. 2003-11-12 Richard Williamson <rjw@apple.com> Fixed 3475082. Remove unnecessary orderKey before showKey. Written by Ed Voas. Reviewed by Richard. * Carbon.subproj/CarbonWindowAdapter.m: (-[CarbonWindowAdapter makeKeyWindow]): 2003-11-12 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3482147>: replace _releaseFutureIconForURL assertion with a log statement Reviewed by rjw. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _releaseFutureIconForURL:]): 2003-11-10 Richard Williamson <rjw@apple.com> Fixed 3478765. Use ICU to access unicode properties. Fixed 3478831. Unicode property/conversion functions should be 32 bit savvy. Fixed 3478885. Remove dead arabic shaping code Reviewed by Darin. * Misc.subproj/WebUnicode.h: * Misc.subproj/WebUnicode.m: (_unicodeDigitValue): (_unicodeDirection): (_unicodeMirrored): (_unicodeMirroredChar): (_unicodeLower): (_unicodeUpper): (WebKitInitializeUnicode): (shapeForNextCharacter): (initializeCharacterShapeIterator): * Misc.subproj/WebUnicodeTables.m: * WebCoreSupport.subproj/WebTextRenderer.m: (widthForNextCharacter): (fontContainsString): 2003-11-10 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3478351>: Safari: URL Alias on Dock failed to open the 2byte URL Reviewed by dave. * Misc.subproj/WebNSURLExtras.m: (-[NSString _web_mapHostNameWithRange:encode:makeString:]): if the host name is percent-escaped, use CFURLCreateStringByReplacingPercentEscapes 2003-11-10 Richard Williamson <rjw@apple.com> Use ICU for upper/lower conversion. Fixed 3477157, 3478455, 3478456, 3478457, 3478486. Remaining issues with surrogates (3477159) and Turkish I (3478482). Reviewed by Ken. * Misc.subproj/WebUnicode.m: (_unicodeLower): (_unicodeUpper): 2003-11-07 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3240778>: add "save" menu item to contextual menu for text pages Reviewed by darin. * WebView.subproj/WebTextView.m: (-[WebTextView menuForEvent:]): Made WebTextView's context menu behavior like WebHTMLView's context menu behavior with regards to selection. If the control-click was on a selection, show menu options for the selection like copy. If it was not on a selection, show menu options such as save and print. Don't select anything when control-clicking. 2003-11-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3478022>: assertion failure while loading WMP content Reviewed by darin. * ChangeLog: * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginConnectionDelegate connection:didReceiveResponse:]): Don't continue if the stream is cancelled in startStreamWithResponse. 2003-11-07 Richard Williamson <rjw@apple.com> Fixed 3477067. Use our case unicode conversion routines. Reviewed by Ken. * WebCoreSupport.subproj/WebTextRenderer.m: (toUpper): 2003-11-06 Richard Williamson <rjw@apple.com> Fixed 3476393. Call scrollPoint: recursively up the view hierarchy to ensure point is visible. Reviewed by Ken. * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_scrollPointToVisible:fromView:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView scrollPoint:]): === Safari-113 === 2003-11-05 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3473913 -- host names in simple mailto URLs are not getting encoded/decoded correctly yet * Misc.subproj/WebNSURLExtras.m: (applyHostNameFunctionToMailToURLString): Handle case where host name is at the end of the string. (applyHostNameFunctionToURLString): Add the # character to the set of characters that can end a domain name. 2003-11-05 Richard Williamson <rjw@apple.com> Fixed 3413067, 3405797, 3456877 Use ATSUI to render Arabic and Hebrew. Reviewed by John. * WebCoreSupport.subproj/WebTextRenderer.m: (shouldUseATSU): 2003-11-05 John Sullivan <sullivan@apple.com> - fixed <rdar://problem/3469791>: Bigger/Smaller commands are disabled for HTML Mail in separate window (w/WebKit-111) Reviewed by Darin. * WebView.subproj/WebFrameView.m: (-[WebFrameView acceptsFirstResponder]): always be willing to become first responder, even if no page has yet been loaded. (-[WebFrameView becomeFirstResponder]): if no page has yet been loaded (so our scrollview refuses first responder-ness), don't do any special becoming-first- responder shenanigans. Also removed obsolete overrides for nextKeyView, nextValidKeyView, previousKeyView, and previousValidKeyView that are no longer required now that we handle the key loop more like NSScrollView. * WebView.subproj/WebFrameViewPrivate.h: removed now-unused ivar inNextValidKeyView 2003-11-05 Richard Williamson <rjw@apple.com> Fixed 3029966. Animated backgrounds specified in <BODY> don't animate Fixed 3474824. Tiled animated GIFs don't animate. Fixed 3029966. Animated backgrounds specified with CSS don't animate. Reviewed by Chris. * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer nextFrame:]): (-[WebImageRenderer drawImageInRect:fromRect:]): (-[WebImageRenderer startAnimationIfNecessary]): (-[WebImageRenderer tileInRect:fromPoint:]): * WebView.subproj/WebImageView.m: (-[WebImageView drawRect:]): 2003-11-05 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3201364>: Safari crashes when hosting carbon plug-in using drag and drop Reviewed by rjw. * WebView.subproj/WebView.m: (-[WebView draggingUpdated:]): return NSDragOperationNone if we're over a plug-in view so the plug-in can handle the drag 2003-11-05 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3474360>: should attempt to resolve symbolic links when choosing "Save Link As..." Reviewed by kocienda. * WebView.subproj/WebView.m: (-[WebView _fileWrapperForURL:]): follow sym links 2003-11-05 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3455910>: hitting up or down arrows when focus is on a pop-up menu should pop the menu * WebView.subproj/WebFrameView.m: (-[WebFrameView keyDown:]): Call super with the event if focus is on a pop up button. 2003-11-05 Ken Kocienda <kocienda@apple.com> Reviewed by Maciej Fix for these bugs: <rdar://problem/3467558>: Cannot tab to form file input widgets <rdar://problem/3473631>: WebFileButton sends notifications to communicate with WebCore Tabbing now works for these widgets. While I was in the neighborhood, I improved the communication mechanism between the WebKit and WebCore sides of the file button implementation, replacing notifications with a callback object. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge fileButtonWithDelegate:]): Method now takes a delegate object. * WebCoreSupport.subproj/WebFileButton.h: * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileButton initWithBridge:delegate:]): (-[WebFileButton initWithFrame:]): (-[WebFileButton dealloc]): (-[WebFileButton chooseFilename:]): Sends callback rather than posting a notification. (-[WebFileButton chooseButtonPressed:]): Ditto. (-[WebFileButton mouseDown:]): (-[WebFileButton acceptsFirstResponder]): (-[WebFileButton becomeFirstResponder]): Make the button subview first responder. (-[WebFileButton nextKeyView]): Hook up to WebBridge key view machinery. (-[WebFileButton previousKeyView]): Ditto. (-[WebFileButton nextValidKeyView]): Ditto. (-[WebFileButton previousValidKeyView]): Ditto. (-[WebFileChooserButton initWithDelegate:]): (-[WebFileChooserButton nextValidKeyView]): Ditto. (-[WebFileChooserButton previousValidKeyView]): Ditto. (-[WebFileChooserButton resignFirstResponder]): Sends a focus change callback. 2003-11-04 Darin Adler <darin@apple.com> Reviewed by John, except for one bit reviewed by Maciej. - first step for IDNA support; helper functions for Safari * Misc.subproj/WebNSURLExtras.h: Add six new methods to manipulate host names directly. * Misc.subproj/WebNSURLExtras.m: (applyHostNameFunctionToMailToURLString): Added. Finds host names within a mailto URL. (applyHostNameFunctionToURLString): Added. Finds host names within a URL. (collectRangesThatNeedMapping): Added. Builds a list of host name ranges that need mapping. (collectRangesThatNeedEncoding): Added. Calls the above for encoding. (collectRangesThatNeedDecoding): Added. Calls the above for decoding. (mapHostNames): Added. Helper function that does the entire mapping process for a URL. (+[NSURL _web_URLWithUserTypedString:]): Call mapHostNames to encode after trimming whitespace. (-[NSURL _web_userVisibleString]): Call mapHostNames to decode after decoding escape sequences. (-[NSURL _webkit_URLByRemovingFragment]): Removed unneeded redundant NULL check. (-[NSString _web_mapHostNameWithRange:encode:makeString:]): Added. Workhorse function to call the IDN functions in the Unicode library. (-[NSString _web_hostNameNeedsDecodingWithRange:]): Added. (-[NSString _web_hostNameNeedsEncodingWithRange:]): Added. (-[NSString _web_decodeHostNameWithRange:]): Added. (-[NSString _web_encodeHostNameWithRange:]): Added. (-[NSString _web_decodeHostName]): Added. (-[NSString _web_encodeHostName]): Added. * WebKit.pbproj/project.pbxproj: Added libicucore.dylib. * English.lproj/StringsNotToBeLocalized.txt: Updated for above changes. 2003-11-04 John Sullivan <sullivan@apple.com> - a little optimization I noticed when looking at 3125137 Reviewed by Chris. * Misc.subproj/WebStringTruncator.m: (truncateString): if incoming string has length 0, bail out right away 2003-11-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3472403>: RTFD of copied text and images should use original image data not tiffs <rdar://problem/3472435>: dragging local image file downloads it instead of copies it <rdar://problem/3472450>: copied and dragged local image files are TIFF, not original image data Reviewed by john. * Misc.subproj/WebNSPasteboardExtras.h: * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeFileWrapperAsRTFDAttachment:]): new * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragImage:fileWrapper:rect:URL:title:event:]): take a file wrapper instead of data so [NSPasteboard _web_writeFileWrapperAsRTFDAttachment:] can be called * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge fileWrapperForURL:]): call fileWrapperForURL on the WebView * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate copyImageToClipboard:]): call [NSPasteboard _web_writeFileWrapperAsRTFDAttachment:] * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _handleMouseDragged:]): when calling _web_dragImage, pass a file wrapper from fileWrapperForURL (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): call fileWrapperForURL * WebView.subproj/WebImageRepresentation.h: * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation fileWrapper]): new * WebView.subproj/WebImageView.m: (-[WebImageView writeImageToPasteboard:]): call [NSPasteboard _web_writeFileWrapperAsRTFDAttachment:] (-[WebImageView mouseDragged:]): pass the file wrapper to _web_dragImage * WebView.subproj/WebView.m: (-[WebView _fileWrapperForURL:]): new, returns a file wrapper from a local file or from the cache * WebView.subproj/WebViewPrivate.h: 2003-11-04 John Sullivan <sullivan@apple.com> - fixed <rdar://problem/3472813>: REGRESSION (100-111): Some tabs start out scrolled down to focused text field Reviewed by Ken. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView acceptsFirstResponder]): The logic to avoid accepting first responder on clicks was too broad; it was rejecting first-responder-ness even for clicks outside of this view. Clicking a tab item was going through some logic in NSTabView looking for the first valid key view starting with the web view, but the web view was returning NO due to this faulty click logic. Thus the first subview text field was becoming first responder, and causing scroll. 2003-11-03 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3472377>: Provide NSRTFDPboardType on pasteboard when copying or dragging images <rdar://problem/3470809>: REGRESSION (111-112): Can't copy & paste image into Photoshop 7 Reviewed by hyatt. * Misc.subproj/WebNSPasteboardExtras.h: * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeFileDataAsRTFDAttachment:withFilename:]): renamed, now writes file data as an RTF attachment * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragImage:originalData:rect:URL:title:event:]): call renamed _web_writeFileDataAsRTFDAttachment * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate copyImageToClipboard:]): call renamed _web_writeFileDataAsRTFDAttachment * WebView.subproj/WebImageView.m: (-[WebImageView writeImageToPasteboard:]): call renamed _web_writeFileDataAsRTFDAttachment 2003-11-03 Vicki Murley <vicki@apple.com> Reviewed by kocienda. - fixed <rdar://problem/3471096>: non-B&I builds should not use order files, because they cause false "regressions" in perf. * WebKit.pbproj/project.pbxproj: added empty SECTORDER_FLAGS variables to the Development and Deployment build styles 2003-11-03 Ken Kocienda <kocienda@apple.com> Reviewed by John Fix for this bug: <rdar://problem/3470342>: focus rings are shown for links in web pages even in non-frontmost windows * WebView.subproj/WebHTMLView.m: (-[WebHTMLView updateFocusRing]): New method. Uses the "keyness" of the view's window to toggle focus ring drawing. (-[WebHTMLView windowDidBecomeKey:]): Calls updateFocusRing. (-[WebHTMLView windowDidResignKey:]): Ditto. 2003-11-01 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - remove use of obsolete HTTLCookiePolicyBaseURL SPI * WebCoreSupport.subproj/WebSubresourceClient.m: startLoadingResource:withURL:referrer:forDataSource:]): Use setMainDocumentURL, not setHTTPCookiePolicyBaseURL. * WebView.subproj/WebFrame.m: (-[WebFrame _addExtraFieldsToRequest:alwaysFromRequest:]): Likewise. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient connection:willSendRequest:redirectResponse:]): Likewise. 2003-11-01 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3470882 -- storage leaks in WebDownload code - fixed 3470884 -- download is always nil in downloadWindowForAuthenticationSheet: call from WebDownload * Misc.subproj/WebDownload.m: (-[WebDownloadInternal initWithDownload:]): Removed this method, which was never called. (-[WebDownloadInternal dealloc]): Added missing call to [super dealloc] to fix one cause of a leak of the WebDownloadInternal object itself. Removed the release of webDownload, which was always nil, and if it wasn't would end up causing a leak due to a reference cycle. (-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]): Remove the use of webDownload, which was always nil, and instead use the download parameter passed to us, casting it to WebDownload, since it's guaranteed to be one. (-[WebDownload _setRealDelegate:]): Added. Shared by the methods below to set up the real delegate before calling init. The old code called init twice, causing an second call to the superclass's init method, which caused it to create an extra copy of its internal structure, as well as causing us to create two WebDownloadInternal objects. (-[WebDownload init]): Don't allocate a second WebDownloadInternal if _setRealDelegate already allocated it for us. Before we would allocate and leak an extra one each time. (-[WebDownload dealloc]): Added. Releases the WebDownloadInternal. This is the second cause of the leak of the WebDownloadInternal object. (-[WebDownload initWithRequest:delegate:]): Call [self _setRealDelegate:] instead of calling [self init] and then [_webInternal setRealDelegate:], avoiding the leaks caused by doing it the other way. (-[WebDownload _initWithLoadingConnection:request:response:delegate:proxy:]): Ditto. (-[WebDownload _initWithLoadingResource:request:response:delegate:proxy:]): Ditto. (-[WebDownload _initWithRequest:delegate:directory:]): Ditto. 2003-10-31 David Hyatt <hyatt@apple.com> Fix for 3466542, add a real minimum font size setting. Reviewed by john * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): (-[WebPreferences setMinimumFontSize:]): (-[WebPreferences minimumLogicalFontSize]): (-[WebPreferences setMinimumLogicalFontSize:]): * WebView.subproj/WebView.m: (-[WebView _updateWebCoreSettingsFromPreferences:]): 2003-10-31 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3469088>: focus not removed from text link when user hits cmd-L or clicks in window chrome * WebView.subproj/WebHTMLView.m: (-[WebHTMLView deselectText]): Added new method just to deselect text. (-[WebHTMLView resignFirstResponder]): Just deseclect text if we are doing a programmatic setting of focus. Deselect all otherwise. 2003-10-30 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3458368>: drawing to the screen while window hidden: http://www.bhphotovideo.com/ Reviewed by john. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): clip out the plug-in when the window is miniaturized or hidden (-[WebBaseNetscapePluginView restartNullEvents]): don't restart null events if the window is miniaturized, this allows restartNullEvents to be called in start and viewDidMoveToWindow without needing to make the check (-[WebBaseNetscapePluginView start]): just call restartNullEvents instead of checking if the window is miniaturized 2003-10-30 Ken Kocienda <kocienda@apple.com> Reviewed by Hyatt * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge documentView]): Added. * WebCoreSupport.subproj/WebGraphicsBridge.h: Added. * WebCoreSupport.subproj/WebGraphicsBridge.m: Added. (+[WebGraphicsBridge createSharedBridge]): Added. (-[WebGraphicsBridge setFocusRingStyle:radius:color:]): Added. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebFrameView.m: Create a WebGraphicsBridge when creating a WebFrameView. === Safari-112 === 2003-10-29 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3467632 - Leak of plugin info visiting http://www.ebay.com * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage dealloc]): Release lastModifiedDate. 2003-10-29 Chris Blumenberg <cblu@apple.com> WebKit part of fix for: <rdar://problem/3467744>: Photoshop files (.psd) don't show up in Open dialog in Safari, but can be viewed <rdar://problem/3109132>: Can't open movie file via open panel even though it can be dropped in browser window Reviewed by john. * WebView.subproj/WebView.m: (+[WebView _supportedMIMETypes]): new (+[WebView _supportedFileExtensions]): new * WebView.subproj/WebViewPrivate.h: 2003-10-29 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3438716>: jpg and gif images copied from Safari and placed in mail are sent as tiff Reviewed by john. * Misc.subproj/WebNSPasteboardExtras.h: * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeFileContents:withFilename:]): new * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragImage:originalData:rect:URL:title:event:]): now takes originalData and calls _web_fileContents:withFilename: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate copyImageToClipboard:]): call _web_writeFileContents:withFilename: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _handleMouseDragged:]): call renamed _web_dragImage and [WebView _cachedResponseForURL:] (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): call [WebView _cachedResponseForURL:] * WebView.subproj/WebImageView.m: (-[WebImageView writeImageToPasteboard:]): call _web_writeFileContents:withFilename: (-[WebImageView mouseDragged:]): call renamed _web_dragImage * WebView.subproj/WebView.m: (-[WebView _cachedResponseForURL:]): new * WebView.subproj/WebViewPrivate.h: 2003-10-28 John Sullivan <sullivan@apple.com> - fixed <rdar://problem/3466082>: 7B85/111: Crash viewing web page ([WebView setNextKeyView:]) Reviewed by Chris. * WebView.subproj/WebView.m: (-[WebView dealloc]): set _private to nil after releasing, because [super dealloc] can dispatch to it (-[WebView mainFrame]): fixed spelling error in comment 2003-10-28 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3465383>: REGRESSION: Text field progress bar goes to 100% after error or stop Reviewed by john. * WebView.subproj/WebFrame.m: (-[WebFrame _isLoadComplete]): call _progressCompleted after we deliver the didFailLoadWithError or didFinishLoadForFrame message as we do in other places. This allows to be aware of the error (if there is one), when they get the WebViewProgressFi nishedNotification notification. 2003-10-27 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3083264 - frame names changed by JavaScript are not reflected in WebFrame at the WebKit level * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge didSetName:]): Tell the WebFrame about its new name. 2003-10-28 John Sullivan <sullivan@apple.com> - fixed 3465613 -- REGRESSION (111): Crash creating nib that contains WebView Reviewed by Chris. * WebView.subproj/WebView.m: (-[WebView mainFrame]): check for nil _private before dereferencing. 2003-10-28 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3465591>: Security: Netscape plug-ins can execute JavaScript in other frames Reviewed by mjs. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): renamed, no need to pass the target frame since the target is either the plug-in itself or the frame that contains the plug-in (-[WebBaseNetscapePluginView loadPluginRequest:]): call renamed evaluateJavaScriptPluginRequest (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): if this is a JS request that is targeted at a frame, return NPERR_INVALID_PARAM if the frame is not the frame that contains the plugin 2003-10-28 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3437959>: javascript: URLs don't work from Java (and other Cocoa plugins, if any) Reviewed by mjs. * Plugins.subproj/WebPluginController.m: (-[WebPluginController showURL:inFrame:]): support JS requests targeted only to the plug-in's frame. 2003-10-27 John Sullivan <sullivan@apple.com> - fixed 3441258 -- hysteresis to start dragging a link is too small; too easy to start drag Reviewed by Chris. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _handleMouseDragged:]): Split DragHysteresis into two values, one for links and one for images. Make the link one much larger than the image one (since dragging an image doesn't occur accidentally in the ways that dragging a link does). 2003-10-27 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3462523>: Safari Sometimes Destroys Applets When Going "Back" Reviewed by darin. * History.subproj/WebHistoryItem.m: (+[WebHistoryItem _destroyAllPluginsInPendingPageCaches]): Don't destroy plug-ins that are currently being viewed. 2003-10-27 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3463144>: assertion failure when viewing jpeg with SoundPix installed Reviewed by john. * WebView.subproj/WebDataSource.m: (+[WebDataSource _repTypesAllowImageTypeOmission:]): don't allow image types to override types that are already registered as we do in [WebFrameView _viewTypesAllowImageTypeOmission:] 2003-10-24 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3462977>: ER: Nice if images dragged from web pages didn't redownload <rdar://problem/3031582>: Dragging an image to the desktop doesn't leave the file where I dropped it <rdar://problem/3061371>: "CFURLGetFSRef failed" log when dragging image to Finder Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): attempt to fetch the image data from the cache, if that works, write out the file 2003-10-26 Darin Adler <darin@apple.com> * WebKitPrefix.h: Add a definition of NULL here so we get the stricter type checking even on pre-Merlot systems. === Safari-111 === 2003-10-24 Richard Williamson <rjw@apple.com> Fixed 3425358. Don't try to create page cache for pages that have a nil view(). Reviewed by Hyatt. * WebView.subproj/WebFrame.m: (-[WebFrame _createPageCacheForItem:]): (-[WebFrame _setState:]): 2003-10-24 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3424039>: standalone plug-in content occasionaly redirects to blank page Reviewed by john. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): don't honor JS requests from standalone plug-ins to workaround 3462628 which is a deeper issue. 2003-10-24 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3462256>: REGRESSION: Plain text is downloaded Reviewed by john. * WebView.subproj/WebView.m: (+[WebView _viewClass:andRepresentationClass:forMIMEType:]): use _web_objectForMIMEType when getting an object for a MIME. Removed unnecessary code that checked for the document classes after loading the plug-in DB since it is not an optimization because the plug-in DB calls _viewTypesAllowImageTypeOmission:NO. 2003-10-23 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3364036>: ER: Allow plug-ins to override built-in types such as image/jpeg Reviewed by john. * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase refresh]): Allow plug-ins to override built-in types except for our core HTML types and don't allow the QT plug-in to override any types because it handles many types that we already handle * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:): instead of asserting, handle the case where we ask a plug-in to map from an extension to a MIME type, but nil is returned (-[WebBridge frameRequiredForMIMEType:URL:]): no need to start up the plug-in DB because this is now handled by [WebView _viewClass:andRepresentationClass:forMIMEType:] * WebView.subproj/WebDataSource.m: (+[WebDataSource _representationClassForMIMEType:]): call [WebView _viewClass:andRepresentationClass:forMIMEType:] (-[WebDataSource _makeRepresentation]): call _representationClassForMIMEType * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebFrameView.m: (-[WebFrameView _makeDocumentViewForDataSource:]): tweak (+[WebFrameView _viewClassForMIMEType:]): call [WebView _viewClass:andRepresentationClass:forMIMEType:] * WebView.subproj/WebView.m: (+[WebView _viewClass:andRepresentationClass:forMIMEType:]): new, central place for mapping from a MIME to the document classes. We now load the plug-in DB when a non-HTML MIME type is encountered instead of loading the plug-in DB when the class for the MIME type is not found. This is required to fully fix 3364036. (+[WebView canShowMIMEType:]): call [WebView _viewClass:andRepresentationClass:forMIMEType:] (+[WebView registerViewClass:representationClass:forMIMEType:]): tweak * WebView.subproj/WebViewPrivate.h: 2003-10-23 John Sullivan <sullivan@apple.com> - fixed 3459272 -- Can't set up keyboard loop inside a WebDocumentView without subclassing views - fixed 3179062 -- can't tab back to address bar from image-only page - fixed 3252009 -- tabbing from address bar to content area does not work with WebTextView - fixed 3461398 -- Can't click on a standalone image to focus it (for later keyboard scrolling) I redid the way WebView and WebFrameView splice themselves into the keyview loop in a way very similar to what NSScrollView and NSClipView do. This means that contained and sibling views won't need to do anything special to put themselves into the key loop. Reviewed by Chris. * WebView.subproj/WebFrameView.m: (-[WebFrameView _scrollView]): check for nil pointer before dereferencing; this can happen during [super dealloc]'s keyview-loop-fixup code (-[WebFrameView initWithFrame:]): wire our nextKeyView link to the contained scrollview (so previousKeyView will work correctly from scrollview) (-[WebFrameView acceptsFirstResponder]): return what the contained scrollview says (-[WebFrameView becomeFirstResponder]): in previous direction, use previousValidKeyView (follows normal NSView keyview links); in forward direction, hand first responder-ness to contained scrollview (which will in turn hand it down to clipview, which will in turn hand it down to document) (-[WebFrameView setNextKeyView:]): wire up scrollview instead of self, if it exists * WebView.subproj/WebImageView.m: (-[WebImageView acceptsFirstResponder]): overridden to return YES; this fixes 3461398 and puts the finishing touches on 3179062 * WebView.subproj/WebView.m: (-[WebView _commonInitializationWithFrameName:groupName:]): wire our nextKeyView link to the contained webframeview (so previousKeyView will work correctly from webframeview). Also, if there's a nextKeyView already set (in a nib, e.g.), wire it to our contained webframeview. (-[WebView acceptsFirstResponder]): return what the contained webframeview says (-[WebView becomeFirstResponder]): in previous direction, use previousValidKeyView (follows normal NSView keyview links); in forward direction, hand first responder-ness to contained webframeview (which will in turn hand it down to scrollview, etc.) (-[WebView setNextKeyView:]): wire up webframeview instead of self, if it exists 2003-10-22 Richard Williamson <rjw@apple.com> Match WebCore's notion of distributing linegap between top and bottom of line. WebKit used to put it all at the bottom of the line. Reviewed by Hyatt. * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:usingPrinterFont:]): (-[WebTextRenderer _CG_drawHighlightForRun:style:atPoint:]): 2003-10-21 Maciej Stachowiak <mjs@apple.com> Reviewed by Dave. Finished exception blocking changes, so now I can finally say: - fixed 3137084 - Many non-reproducible crashers in ContextImp::mark / ScopeChain::mark - fixed 3308848 - nil-deref in KHTMLView::topLevelWidget - fixed 3311511 - nil deref inside KJS::Screen - fixed 3397422 - 7B51: Safari crashed in KJS::ObjectImp::mark() - fixed 3408373 - Panther7B58 : Safari Crashed in KJS::ObjectImp::mark - fixed 3409307 - 7B55: safari crashed in KJS::Interpreter::globalExec() (idle, nothing particular going on) - fixed 3410160 - 7B60 Safari crashed in KHTMLPart::parentPart called from JS while in the background - fixed 3413224 - unrepro crash in KJS::Window::mark - fixed 3419940 - unrepro crash in KJS::Collector::allocate trying to access http://www.lindyinthepalms.com - fixed 3420123 - Panther7B66: Safari crashed while going to http://www.tangents.co.uk/index2.html - fixed 3423225 - Safari crash in vtable for KWQMapImpl (vtable for KWQMapImpl + 8). - fixed 3437190 - nil-deref on quit in calling marked() from ScopeChain::mark() * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer ascent]): (-[WebTextRenderer descent]): (-[WebTextRenderer lineSpacing]): (-[WebTextRenderer xHeight]): (-[WebTextRenderer drawLineForCharacters:yOffset:withWidth:withColor:]): (-[WebTextRenderer _smallCapsRenderer]): (-[WebTextRenderer _initializeATSUStyle]): (-[WebTextRenderer _createATSUTextLayoutForRun:]): (-[WebTextRenderer _trapezoidForRun:style:atPoint:]): (-[WebTextRenderer _ATSU_drawHighlightForRun:style:atPoint:]): (-[WebTextRenderer _ATSU_drawRun:style:atPoint:]): (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:]): 2003-10-22 Richard Williamson <rjw@apple.com> Fixed 3458715. Reset to 0, not .1 when done. Reviewed by Chris. * WebView.subproj/WebView.m: (-[WebView _resetProgress]): (-[WebView _progressStarted:]): 2003-10-21 Richard Williamson <rjw@apple.com> Don't use small caps font for characters that don't have an uppercase counterpart (i.e. punctuation marks). Reviewed by Hyatt. * WebCoreSupport.subproj/WebTextRenderer.m: (widthForNextCharacter): 2003-10-21 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3176170>: OBJECT tag with no or empty TYPE is mishandled Reviewed by rjw. * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase pluginForExtension:]): If no plug-in is found from the extension, attempt to map from the extension to a MIME type using our mappings and find a plug-in from the MIME type. This improves our chances of finding a plug-in when n o MIME type is specified. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): If the passed MIME is empty, nil it out so that clients only need to check for nil. This avoids error sheets complaining about "" MIME types. (-[WebBridge frameRequiredForMIMEType:URL:]): Renamed to include URL. If no MIME is specified, only create a plug-in view if we can map from the extension. 2003-10-20 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3457627>: empty Flash plugin at tvguide.com Fixed issues with plug-in stream error handling. Improved plug-in logging. Reviewed by kocienda. * Misc.subproj/WebKitLogging.h: added WebKitLogPluginEvents * Misc.subproj/WebKitLogging.m: * Plugins.subproj/WebBaseNetscapePluginStream.h: * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]): improved logging (-[WebBaseNetscapePluginStream destroyStream]): improved logging (-[WebBaseNetscapePluginStream destroyStreamWithFailingReason:]): renamed from cancelWithReason to avoid confusion (-[WebBaseNetscapePluginStream receivedError:]): calls destroyStreamWithFailingReason after determining a reason from the NSError (-[WebBaseNetscapePluginStream cancelWithReason:]): calls destroyStreamWithFailingReason, this method is overriden by subclasses to cancel the actual load (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): call destroyStreamWithFailingReason, not cancelWithReason because the loaded has already ended here (-[WebBaseNetscapePluginStream deliverData]): improved logging * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendActivateEvent:]): use even logging (-[WebBaseNetscapePluginView sendUpdateEvent]): ditto (-[WebBaseNetscapePluginView becomeFirstResponder]): ditto (-[WebBaseNetscapePluginView resignFirstResponder]): ditto (-[WebBaseNetscapePluginView mouseDown:]): ditto (-[WebBaseNetscapePluginView mouseUp:]): ditto (-[WebBaseNetscapePluginView mouseEntered:]): ditto (-[WebBaseNetscapePluginView mouseExited:]): ditto (TSMEventHandler): ditto (-[WebBaseNetscapePluginView destroyStream:reason:]): call cancelWithReason so the reason is passed back to the plug-in * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): tweak * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedError:withDataSource:]): call receivedError (-[WebNetscapePluginRepresentation cancelWithReason:]): override, cancel the load, call super * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream cancelWithReason:]): override, cancel the load, call super (-[WebNetscapePluginConnectionDelegate connection:didReceiveResponse:]): be sure to call the stream before calling super because the stream can be cleared out when calling super (-[WebNetscapePluginConnectionDelegate connection:didReceiveData:lengthReceived:]): ditto (-[WebNetscapePluginConnectionDelegate connectionDidFinishLoading:]): ditto (-[WebNetscapePluginConnectionDelegate connection:didFailWithError:]): ditto 2003-10-20 Richard Williamson <rjw@apple.com> Conditionally excluded fix for 3446192. We'll enable the fix once 3446669 has been fixed. This patch switches to the new UTI typing API for pasteboard types. Reviewed by Ken. * Misc.subproj/WebNSPasteboardExtras.m: (+[NSPasteboard initialize]): 2003-10-20 Richard Williamson <rjw@apple.com> Fixed 3456103. Don't assert, just check for inappropriate state. Reviewed by Hyatt Add a debug menu item to always use ATSU text drawing. This will be helpful to the ATSU folks in performance tuning there API. Right now I see approx. 2X slowdown using ATSU. Also did some shuffling around of inline related stuff. Reviewed by Chris. * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (isControlCharacter): (isAlternateSpace): (isSpace): (getUncachedWidth): (widthFromMap): (widthForGlyph): (+[WebTextRenderer _setAlwaysUseATSU:]): (glyphForCharacter): (glyphForUnicodeCharacter): (shouldUseATSU): * WebView.subproj/WebView.m: (+[WebView _setAlwaysUseATSU:]): (-[WebView _progressCompleted:]): * WebView.subproj/WebViewPrivate.h: 2003-10-19 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3442218>: crash due to infinite recursion trying to load standalone plug-in content Reviewed by darin. * WebView.subproj/WebFrame.m: (-[WebFrame stopLoading]): manage the isStoppingLoad ivar, return if isStoppingLoad is YES * WebView.subproj/WebFramePrivate.h: added the isStoppingLoad ivar 2003-10-19 Darin Adler <darin@apple.com> Reviewed by Dave and Ken. - fixed 3457066 -- REGRESSION (91-92): command-left-arrow causes a scroll to the left before going back * WebView.subproj/WebFrameView.m: (-[WebFrameView keyDown:]): Add an else so that we don't fall into the scrolling code when the command key is down for right and left arrow. 2003-10-18 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3229530>: Dragging standalone image to desktop should save it, not re-download it Reviewed by darin. * English.lproj/Localizable.strings: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDocumentPrivate.h: Added. * WebView.subproj/WebImageRepresentation.h: * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation dealloc]): release new filename and data ivars (-[WebImageRepresentation doneLoading]): return YES if data is non-nil (-[WebImageRepresentation setDataSource:]): store the filename (-[WebImageRepresentation receivedError:withDataSource:]): store the data (-[WebImageRepresentation finishedLoadingWithDataSource:]): store the data (-[WebImageRepresentation data]): new (-[WebImageRepresentation filename]): new * WebView.subproj/WebImageView.m: (-[WebImageView namesOfPromisedFilesDroppedAtDestination:]): just save the image, don't download it (-[WebImageView image]): new 2003-10-17 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3456176>: Assertion failure when loading atomfilms.com Reviewed by kocienda. * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginConnectionDelegate connection:didReceiveData:lengthReceived:]): call super before calling plug-in code as we do in other callbacks (-[WebNetscapePluginConnectionDelegate connectionDidFinishLoading:]): ditto (-[WebNetscapePluginConnectionDelegate connection:didFailWithError:]): ditto 2003-10-16 Richard Williamson <rjw@apple.com> Fixed 3455306. Ensure that progress is correctly ended when a load is interupted (i.e. becomes a download). Reviewed by mjs. * WebView.subproj/WebFrame.m: (-[WebFrame _isLoadComplete]): 2003-10-16 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3455176>: Assertion failure when loading non-existant plug-in content Reviewed by rjw. * Misc.subproj/WebDownload.m: fixed build failure when using new Foundation. We are overriding and calling a renamed method. Continue to override the old method, override the new method and declare their interfaces to avoid build failures. * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginConnectionDelegate connection:didReceiveResponse:]): cancel the load before telling the plug-in about the error so plug-in code doesn't attempt to cancel the load twice 2003-10-16 Richard Williamson <rjw@apple.com> Fixed 3453991. We weren't setting the array cursor correctly after changing capacity. Reviewed by John. * ChangeLog: * History.subproj/WebBackForwardList.m: (-[WebBackForwardList setCapacity:]): === Safari-110 === 2003-10-16 Richard Williamson <rjw@apple.com> Tweaked the progress behavior and factored cleanup of progress related ivars. Reviewed by Hyatt. * WebView.subproj/WebDataSource.m: (-[WebDataSource _startLoading:]): * WebView.subproj/WebFrame.m: (-[WebFrame _isLoadComplete]): * WebView.subproj/WebView.m: (-[WebView _resetProgress]): (-[WebView _progressStarted:]): (-[WebView _finalProgressComplete]): (-[WebView _progressCompleted:]): (-[WebView _incrementProgressForConnection:data:]): * WebView.subproj/WebViewPrivate.h: 2003-10-14 Richard Williamson <rjw@apple.com> Added logging for estimated progress. Added a time delta to the throttler, so we now send notifications if a delta amount has been exceeded OR a delta between notifications has been exceeded. Reviewed by Chris. * Misc.subproj/WebKitLogging.h: * Misc.subproj/WebKitLogging.m: * WebView.subproj/WebView.m: (-[WebViewPrivate init]): (-[WebView _progressStarted]): (-[WebView _progressCompleted]): (-[WebView _incrementProgressForConnection:data:]): * WebView.subproj/WebViewPrivate.h: 2003-10-14 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3450449>: assertion failure in WebBridge _retrieveKeyboardUIModeFromPreferences Can't assert that the preference always exists and is valid as I thought you could. This could just mean that the a preference for full keyboard access has not been specified by the user yet. If this is so, just return the default keyboard access mode. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge _retrieveKeyboardUIModeFromPreferences:]) 2003-10-13 Richard Williamson <rjw@apple.com> Added support for small-caps. Reworked drawing and measuring to use new iterators. Position checking was already using the new iterator code, but I was reluctant to switch the mainline drawing and measuring code over to the new approach until now. Lots of other code cleanup. Reviewed by John. * Misc.subproj/WebUnicode.m: (initializeCharacterShapeIterator): * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (+[WebTextRenderer shouldBufferTextDrawing]): (+[WebTextRenderer initialize]): (-[WebTextRenderer initWithFont:usingPrinterFont:]): (-[WebTextRenderer dealloc]): (-[WebTextRenderer widthForCharacters:length:]): (-[WebTextRenderer widthForString:]): (-[WebTextRenderer ascent]): (-[WebTextRenderer descent]): (-[WebTextRenderer lineSpacing]): (-[WebTextRenderer xHeight]): (-[WebTextRenderer drawRun:style:atPoint:]): (-[WebTextRenderer floatWidthForRun:style:widths:]): (-[WebTextRenderer drawLineForCharacters:yOffset:withWidth:withColor:]): (-[WebTextRenderer drawHighlightForRun:style:atPoint:]): (-[WebTextRenderer pointToOffset:style:position:reversed:]): (-[WebTextRenderer _setIsSmallCapsRenderer:]): (-[WebTextRenderer _isSmallCapsRenderer]): (-[WebTextRenderer _smallCapsRenderer]): (-[WebTextRenderer _smallCapsFont]): (-[WebTextRenderer _substituteFontForString:families:]): (-[WebTextRenderer _substituteFontForCharacters:length:families:]): (-[WebTextRenderer _convertCharacters:length:toGlyphs:skipControlCharacters:]): (-[WebTextRenderer _convertUnicodeCharacters:length:toGlyphs:]): (-[WebTextRenderer _computeWidthForSpace]): (-[WebTextRenderer _setupFont]): (_drawGlyphs): (-[WebTextRenderer _CG_drawHighlightForRun:style:atPoint:]): (-[WebTextRenderer _CG_drawRun:style:atPoint:]): (-[WebTextRenderer _floatWidthForRun:style:widths:fonts:glyphs:startPosition:numGlyphs:]): (-[WebTextRenderer _CG_floatWidthForRun:style:widths:fonts:glyphs:startPosition:numGlyphs:]): (-[WebTextRenderer _extendUnicodeCharacterToGlyphMapToInclude:]): (-[WebTextRenderer _updateGlyphEntryForCharacter:glyphID:font:]): (-[WebTextRenderer _extendCharacterToGlyphMapToInclude:]): (-[WebTextRenderer _extendGlyphToWidthMapToInclude:font:]): (-[WebTextRenderer _trapezoidForRun:style:atPoint:]): (-[WebTextRenderer _ATSU_floatWidthForRun:style:]): (-[WebTextRenderer _ATSU_drawHighlightForRun:style:atPoint:]): (-[WebTextRenderer _ATSU_drawRun:style:atPoint:]): (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:]): (-[WebTextRenderer _CG_pointToOffset:style:position:reversed:]): (freeWidthMap): (freeGlyphMap): (glyphForCharacter): (glyphForUnicodeCharacter): (mapForSubstituteFont): (widthFromMap): (widthForGlyph): (initializeCharacterWidthIterator): (widthAndGlyphForSurrogate): (ceilCurrentWidth): (widthForNextCharacter): (fillStyleWithAttributes): (findLengthOfCharacterCluster): (shouldUseATSU): (isControlCharacter): (isAlternateSpace): (isSpace): (fontContainsString): (GetScratchUniCharString): (toUpper): (isUpper): 2003-10-10 Maciej Stachowiak <mjs@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Fixed for Private change from a while back. 2003-10-10 David Hyatt <hyatt@apple.com> Patch to move widgets during layout instead of waiting until paint time. Reviewed by darin * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame _isLoadComplete]): * WebView.subproj/WebHTMLView.m: * WebView.subproj/WebHTMLViewPrivate.h: 2003-10-09 Richard Williamson <rjw@apple.com> Ensure that the autoscroll timer is always stopped if a mouse up event is lost. Reviewed by John. * WebView.subproj/WebHTMLView.m: (-[WebHTMLViewPrivate dealloc]): (-[WebHTMLView _startAutoscrollTimer:]): (-[WebHTMLView _stopAutoscrollTimer]): (-[WebHTMLView _autoscroll]): (-[WebHTMLView mouseDown:]): * WebView.subproj/WebHTMLViewPrivate.h: 2003-10-09 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3333897>: should support navigator.plugins.refresh as a way to add a plugin without restarting Safari Reviewed by rjw. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView dealloc]): release the plug-in object * Plugins.subproj/WebBasePluginPackage.h: * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage initWithPath:]): store the last mod date (-[WebBasePluginPackage dealloc]): release the last mod date (-[WebBasePluginPackage lastModifiedDate]): new (-[WebBasePluginPackage isEqual:]): new (-[WebBasePluginPackage hash]): new * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): convert the NPP_Shutdown proc pointer so that we can use it later (-[WebNetscapePluginPackage unload]): added log message * Plugins.subproj/WebPluginDatabase.h: * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): tweak (-[WebPluginDatabase plugins]): tweak (-[WebPluginDatabase init]): call refresh (-[WebPluginDatabase refresh]): new (-[WebPluginDatabase loadPluginIfNeededForMIMEType:]): tweak * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory refreshPlugins:]): new * WebView.subproj/WebControllerSets.h: * WebView.subproj/WebControllerSets.m: (+[WebViewSets makeWebViewsPerformSelector:]): new * WebView.subproj/WebFrame.m: (-[WebFrame _reloadForPluginChanges]): new * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebView.m: (-[WebView _reloadForPluginChanges]): new * WebView.subproj/WebViewPrivate.h: === Safari-109 === 2003-10-03 Richard Williamson <rjw@apple.com> Fix part of 3438071. Creating an instance of WebPreferences using init will do the expected thing: that is, create a new instance! We used to always return standardPreferences. Reviewed by Chris. * WebView.subproj/WebPreferences.m: (-[WebPreferences init]): (+[WebPreferences standardPreferences]): 2003-10-03 David Hyatt <hyatt@apple.com> Fix for numerous regressions caused by an inadvertent renaming of the recursiveDisplay override method. Reviewed by darin * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]): 2003-10-03 Richard Williamson (Home0 <rjw@apple.com> Fixed some edge case issue (control characters after end of word) with our rounding hack. Reviewed by Darin. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _CG_floatWidthForRun:style:widths:fonts:glyphs:startGlyph:endGlyph:numGlyphs:]): 2003-10-03 Ken Kocienda <kocienda@apple.com> Reviewed by Darin, with much help from Maciej and Hyatt Fix for this bug: <rdar://problem/3441321>: Form buttons do not respond to key events when focused * WebView.subproj/WebFrameView.m: (-[WebFrameView _firstResponderIsControl]): Added to tell if the focus is on a form control. (-[WebFrameView keyDown:]): Call new _firstResponderIsControl method to see whether space bar key events should propagate. Adding this check keeps us from blocking the event here and allows AppKit to handle it. * WebView.subproj/WebFrameViewPrivate.h: Add new _firstResponderIsControl method. 2003-10-02 Maciej Stachowiak <mjs@apple.com> Folded Private implementation files into the regular ones as the first step towards pulling in our SPI exposure and other code cleanup. * History.subproj/WebHistory.m: * History.subproj/WebHistoryPrivate.m: Removed. * Misc.subproj/WebIconDatabasePrivate.h: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.m: Removed. * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.m: Removed. * WebView.subproj/WebFrameView.m: * WebView.subproj/WebFrameViewPrivate.m: Removed. * WebView.subproj/WebHTMLView.m: * WebView.subproj/WebHTMLViewPrivate.m: Removed. * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.m: Removed. 2003-10-02 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3440063>: Safari 1.1 won't load new pages after visiting adultswim.com, assertion failure on debug build Reviewed by rjw. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): if not data was received for a stream, create the temp file anyway. Plug-ins expect this. === Safari-108 === 2003-10-02 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2003-10-01 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3441466 - REGRESSION: http://www.meyerweb.com/eric/css/edge/complexspiral/glassy.html broken on scroll * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setState:]): Don't turn on scroll-blitting here when the page is done... (-[WebFrame _transitionToCommitted:]): Instead do it here, when the page is committed. 2003-10-02 Darin Adler <darin@apple.com> Reviewed by Ken. - in preparation for a WebCore whitespace-handling change, made WebTextRenderer draw and measure newline characters as if they are spaces (just as we already do with non-breaking spaces) - removed some unused stuff from WebTextRenderer - other unimportant tweaks (e.g. unsigned int -> unsigned) * WebCoreSupport.subproj/WebTextRenderer.m: (kFixedOne), (fixed1), (FixToFloat), (FloatToFixed): Removed these. We can use the standard ones from <FixMath.h> instead of defining our own. (isControlCharacter): Added. Inline function that we can use instead of the macro we had before. (isAlternateSpace): Added. Returns YES for newlines and non-breaking spaces. (isSpace): Added. Returns YES for real spaces and the two alternate spaces as well. (initializeCharacterWidthIterator): Use isSpace. (-[WebTextRenderer convertCharacters:length:toGlyphs:skipControlCharacters:]): Use isAlternateSpace and isControlCharacter. (-[WebTextRenderer _CG_floatWidthForRun:style:widths:fonts:glyphs:startGlyph:endGlyph:numGlyphs:]): Use isControlCharacter, isAlternateSpace, and isSpace. Also fix a small bug where numGlyphs would not get set up properly when the run length is 0, and used local variables when possible instead of going back at the run structure. (-[WebTextRenderer _ATSU_floatWidthForRun:style:]): Use the standard FixedToFloat instead of our own FixToFloat. (-[WebTextRenderer _ATSU_drawHighlightForRun:style:atPoint:]): Ditto. 2003-10-02 David Hyatt <hyatt@apple.com> Work on exposing elements to the Acc API. This patch gets us to the point where text under the mouse is voiced. Reviewed by darin * WebView.subproj/WebHTMLView.m: (-[WebHTMLView accessibilityAttributeValue:]): (-[WebHTMLView accessibilityHitTest:]): 2003-10-01 John Sullivan <sullivan@apple.com> Reviewed by Darin * WebView.subproj/WebHTMLView.m: (-[WebHTMLView viewDidMoveToSuperview]): skip some work when when we've been removed. This wasn't causing any trouble before, but was at least conceptually inefficient. 2003-10-01 John Sullivan <sullivan@apple.com> - fixed 3441372: REGRESSION (107+): Plain text document is initially drawn with proportional font Reviewed by Hyatt * WebView.subproj/WebTextView.m: (-[WebTextView setDataSource:]): Changed a != to an == 2003-10-01 Richard Williamson <rjw@apple.com> Fixed 3438441. If a load is triggered by a onload handling, don't add an entry for it into the b/f or history. The new Google ads use this technique. Reviewed by Ken. * Misc.subproj/WebKitLogging.h: * Misc.subproj/WebKitLogging.m: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:referrer:reload:onLoadEvent:target:triggeringEvent:form:formValues:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _addBackForwardItemClippedAtTarget:]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _isLoadComplete]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _itemForRestoringDocState]): 2003-10-01 Darin Adler <darin@apple.com> Reviewed by John. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _webView]): Fixed problem where we'd get a nil WebView and pass crazy values for subframe text multipliers. 2003-10-01 David Hyatt <hyatt@apple.com> Fix for 3440804, broken scrollbars in downloads window. Make Auto be the default value in the enum, so that all scrollviews will be automatically initialized to be auto. Reviewed by cblu * WebView.subproj/WebDynamicScrollBarsView.m: 2003-09-30 Richard Williamson <rjw@apple.com> Attempt to find a reasonable font using a simple string matching heuristic if none of the fonts actually specified are found. In particular we will use Geeza Pro if "arabic", "urdu", or "pashto" is contained (case-insensitive) in any of the requested font family names. Geeza Pro is a much better fallback font for Arabic (and variant languages) than Helvetica. Reviewed by Chris. * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory fontWithFamilies:traits:size:]): 2003-09-30 John Sullivan <sullivan@apple.com> - fixed 3045617 -- Make Text Bigger/Smaller doesn't affect non-html documents. I added an internal protocol inside WebKit to make this work, and implemented it for plain text and RTF. I also slightly shuffled the existing code to handle this for HTML so that it goes through the new protocol in that case also. * WebView.subproj/WebDocumentInternal.h: Added. New header file, holds definition of _web_WebDocumentTextSizing protocol. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _textSizeMultiplierChanged]): if the document view conforms to the new protocol, tell it that the multiplier has changed. Also, don't tell the bridge here anymore; let WebHTMLView do that. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _updateTextSizeMultiplier]): tell the bridge here instead of having WebFrame do so (-[WebHTMLView viewDidMoveToSuperview]): call _updateTextSizeMultiplier (in case it changed while we were switched out) (-[WebHTMLView _web_textSizeMultiplierChanged]): call _updateTextSizeMultiplier * WebView.subproj/WebTextRepresentation.m: (-[WebTextRepresentation receivedData:withDataSource:]): * WebView.subproj/WebTextView.h: now implements _web_WebDocumentTextSizing protocol; new ivar for holding local copy of text size multiplier; new public method appendReceivedData:fromDataSource: * WebView.subproj/WebTextView.m: (-[WebTextView initWithFrame:]): set local copy of text size multiplier to 1.0 (-[WebTextView _textSizeMultiplierFromWebView]): new method, asks the webview's opinion of the text size multiplier (-[WebTextView setFixedWidthFont]): use the text size multiplier when setting font size (-[WebTextView _adjustRichTextFontSizeByRatio:]): new method, borrowed from Mail and tweaked, that walks through the rich text and adjusts the font sizes (-[WebTextView _updateTextSizeMultiplier]): new method, updates local copy of text size multiplier to match webview's opinion (-[WebTextView setDataSource:]): set the text size multiplier appropriately before setting the fixed-width font; this is too early for the RTF case though since the fonts are embedded in the data (-[WebTextView appendReceivedData:fromDataSource:]): new method. Most of this logic was in WebTextRepresentation, but it's a little better encapsulated here, plus now it handles the text multiplier for RTF. (-[WebTextView defaultsChanged:]): added comment (-[WebTextView _web_textSizeMultiplierChanged]): call updateTextSizeMultiplier * WebView.subproj/WebView.m: (-[WebView canMakeTextSmaller]): (-[WebView canMakeTextLarger]): return NO if the main frame doesn't support the text sizing protocol. This means that if the main frame doesn't support it but a subframe does, you can't adjust the text size. This seems fine for now since the only case with subframes is HTML, where the main frame does support changing text size. * WebKit.pbproj/project.pbxproj: updated for new file 2003-09-30 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3428262>: Plugin loads for static files, but not PHP scripts Reviewed by rjw. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge frameRequiredForMIMEType:]): load the plug-in DB so this method returns reliable results. 2003-09-30 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3006869>: show image dimensions in title bar when single image is loaded Reviewed by rjw. * English.lproj/Localizable.strings: * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation title]): return "foo.jpg 50x50 pixels" 2003-09-30 Richard Williamson <rjw@apple.com> Fixed 3420396. If a frame targets _top and a URL that contains a fragment (very unusual, it's meaningless for a frameset to contain a named anchor point) the frameset won't be reloaded. Our normal path is to just scroll to the anchor point. This is on ly important because our Help folks oddly depend on the behavior. Reviewed by Chris. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): 2003-09-30 Ken Kocienda <kocienda@apple.com> Reviewed by Maciej Fix for this bug: <rdar://problem/3439688>: WebKit needs to retrieve full keyboard access preference * WebCoreSupport.subproj/WebBridge.h: Add two ivars: one to track the keyboard UI mode, the other a flag we use to register for notifications. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge dealloc]): Remove the notification observer to keyboard UI mode changes. (-[WebBridge _retrieveKeyboardUIModeFromPreferences:]): New method. Accesses the preferences to get the current keyboard UI mode. (-[WebBridge keyboardUIMode]): Returns the current keyboard UI mode. Registers for notifications of keyboard UI mode changes when called the first time. 2003-09-30 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. - fixed 3375281 - Keyboard event handlers not fired if focus not in form field - fixed 3242927 - KeyPressed Event in Javascript don't work - fixed 3375353 - keyboard event.target not updated when blurring from form items - fixed 3183754 - returning false from key press handlers does not prevent typing or form submission * WebView.subproj/WebHTMLView.m: (-[WebHTMLView keyDown:]): Ask the bridge before passing the event along. (-[WebHTMLView keyUp:]): Likewise. * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: Remove dead code. 2003-09-30 Richard Williamson <rjw@apple.com> Fixed 3422138. We weren't sending a didChange call for isLoading until the load was complete! Also [WebView isLoading] wasn't accounting for provisional datasources. Reviewed by Chris. * WebView.subproj/WebView.m: (-[WebView isLoading]): * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _didStartProvisionalLoadForFrame:]): (-[WebView _didCommitLoadForFrame:]): (-[WebView _didFinishLoadForFrame:]): (-[WebView _didFailLoadWithError:forFrame:]): (-[WebView _didFailProvisionalLoadWithError:forFrame:]): 2003-09-30 David Hyatt <hyatt@apple.com> Improvements to scrolling and layout. Also fixing 3264346, body overflow should apply to document's scrollbars. Reviewed by darin * WebView.subproj/WebDynamicScrollBarsView.h: * WebView.subproj/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView initWithFrame:]): (-[WebDynamicScrollBarsView setScrollBarsSuppressed:repaintOnUnsuppress:]): (-[WebDynamicScrollBarsView updateScrollers]): (-[WebDynamicScrollBarsView reflectScrolledClipView:]): (-[WebDynamicScrollBarsView setAllowsScrolling:]): (-[WebDynamicScrollBarsView allowsScrolling]): (-[WebDynamicScrollBarsView setAllowsHorizontalScrolling:]): (-[WebDynamicScrollBarsView setAllowsVerticalScrolling:]): (-[WebDynamicScrollBarsView allowsHorizontalScrolling]): (-[WebDynamicScrollBarsView allowsVerticalScrolling]): (-[WebDynamicScrollBarsView horizontalScrollingMode]): (-[WebDynamicScrollBarsView verticalScrollingMode]): (-[WebDynamicScrollBarsView setHorizontalScrollingMode:]): (-[WebDynamicScrollBarsView setVerticalScrollingMode:]): (-[WebDynamicScrollBarsView setScrollingMode:]): 2003-09-29 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3422739>: Plug-in streams not cancelled when plug-in returns error from NPP_NewStream Reviewed by mjs. * Plugins.subproj/WebBaseNetscapePluginStream.h: renamed receivedError to cancelWithReason * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]): call cancelWithReason if NPP_NewStream returns an error (-[WebBaseNetscapePluginStream cancelWithReason:]): renamed (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): tweak * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedError:withDataSource:]): call renamed cancelWithReason (-[WebNetscapePluginRepresentation cancelWithReason:]): new override, stop load then call super * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream cancelWithReason:]): new override, stop load then call super (-[WebNetscapePluginStream stop]): call cancelWithReason (-[WebNetscapePluginConnectionDelegate connection:didReceiveResponse:]): call renamed cancelWithReason (-[WebNetscapePluginConnectionDelegate connection:didFailWithError:]): call renamed cancelWithReason 2003-09-25 Maciej Stachowiak <mjs@apple.com> Roll out build system change since it did not actually work. :-( * WebKit.pbproj/project.pbxproj: 2003-09-25 David Hyatt <hyatt@apple.com> Change layout so that it is called from the private _recursive functions instead of inside drawRect. Reviewed by kocienda * WebView.subproj/WebHTMLView.m: (-[WebHTMLView layoutToPageWidth:adjustingViewSize:]): (-[WebHTMLView drawRect:]): * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:testDirtyRect:]): (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): (-[WebHTMLView _web_setPrintingModeRecursive]): (-[WebHTMLView _web_clearPrintingModeRecursive]): (-[WebHTMLView _web_layoutIfNeededRecursive:testDirtyRect:]): (-[NSView _web_setPrintingModeRecursive]): (-[NSView _web_clearPrintingModeRecursive]): (-[NSView _web_layoutIfNeededRecursive:testDirtyRect:]): 2003-09-25 Richard Williamson <rjw@apple.com> Fixed 3433802. Written by Ed. Carbon WebView doesn't detach native view when removed. Reviewed by Richard. * Carbon.subproj/HIWebView.m: (OwningWindowChanged): 2003-09-25 Richard Williamson <rjw@apple.com> Fixed 3433488. Written by Ed. WebKit doesn't sync window visibility when new webview added to visible window. Reviewed by Richard. * Carbon.subproj/CarbonWindowAdapter.m: (-[CarbonWindowAdapter initWithCarbonWindowRef:takingOwnership:disableOrdering:carbon:]): 2003-09-25 Richard Williamson <rjw@apple.com> Fixed 3434854. Written by Ed. Correctly handle window modality in carbon. Reviewed by Richard. * Carbon.subproj/CarbonWindowAdapter.m: (-[CarbonWindowAdapter initWithCarbonWindowRef:takingOwnership:disableOrdering:carbon:]): 2003-09-25 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. Updated setup for engineering builds. Don't embed the framework into Safari or hack the install name. However, do copy WebCore and JavaScriptCore into the proper sub-umbrella locations. * WebKit.pbproj/project.pbxproj: * embed-frameworks.sh: Added. === Safari-107 === 2003-09-25 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3341222>: WebView doesn't follow AppKit default nextKeyView pattern * WebCoreSupport.subproj/WebBridge.h: Added a variable to guard against recursion in -[WebBridge inNextKeyViewOutsideWebFrameViews]. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge inNextKeyViewOutsideWebFrameViews]): Accessor for recursion guard. (-[WebBridge nextKeyViewOutsideWebFrameViews]): Do not ask webView for its next key view, but rather, ask it for the next key view of the last view in its key view loop. This is what will get us to the next view outside of the webView. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView nextKeyView]): Ask AppKit, rather than khtml, for the next key key view if -[WebBridge inNextKeyViewOutsideWebFrameViews] returns YES. Doing so gives us the correct answer as calculated by AppKit, and makes HTML views behave like other views. This check also heads off an infinite recursion through -[WebBridge nextKeyViewOutsideWebFrameViews]. Also did some cleanup of some code that was marked for removal "some day". That "some day" is today. 2003-09-25 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3176853 -- can't attach files that have no extensions with Yahoo mail (bad Content-Type headers) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge MIMETypeForPath:]): Return @"application/octet-stream" rather than nil or empty string when the type is not known. 2003-09-24 Darin Adler <darin@apple.com> Reviewed by Maciej. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): Added one more call to _stopAutoscrollTimer for when drags begin. 2003-09-24 Richard Williamson <rjw@apple.com> Fixed 3420736. Clear renderer caches when get an ATS font changed notification. This fix may be moot depending on progress toward fixing 2695906. Also 3428451 needs to should be resolved. Also added code to get and log entry point for the function used to get a Java class from plugins. That class is used for LiveConnect support. Reviewed by John. * Misc.subproj/WebKitLogging.h: * Misc.subproj/WebKitLogging.m: * Plugins.subproj/WebNetscapePluginPackage.h: * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): * Plugins.subproj/npapi.h: * WebCoreSupport.subproj/WebTextRenderer.m: (FillStyleWithAttributes): * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory clearCaches]): (fontsChanged): (+[WebTextRendererFactory createSharedFactory]): (-[WebTextRendererFactory fontWithFamily:traits:size:]): (-[WebTextRendererFactory cachedFontFromFamily:traits:size:]): 2003-09-23 Darin Adler <darin@apple.com> Reviewed by John and Richard. - fixed 3127833 -- autoscroll only works when mouse is moving * WebView.subproj/WebHTMLView.m: (-[WebHTMLView viewDidMoveToWindow]): Stop the auto-scroll timer. This covers the case where a view is removed from the view hierarchy while the mouse is down. (-[WebHTMLView mouseDown:]): Start the auto-scroll timer. (-[WebHTMLView mouseUp:]): Stop the auto-scroll timer. * WebView.subproj/WebHTMLViewPrivate.h: Add an auto-scroll timer, and methods to start and stop it. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _startAutoscrollTimer]): Create and schedule a timer. It uses the same 1/10 second interval that NSTextView uses for its scrolling timer. (-[WebHTMLView _stopAutoscrollTimer]): Invalidate and release the timer. (-[WebHTMLView _autoscroll]): Check for a mouse up event in the queue; if one is there, then no autoscrlling. But if not, then create a fake mouse dragged event and dispatch it; that will lead to autoscrolling. 2003-09-22 Darin Adler <darin@apple.com> Reviewed by Dave. - worked around 3429631 -- window stops getting mouse moved events after first tooltip appears * WebView.subproj/WebHTMLViewPrivate.m: (-[NSToolTipPanel setAcceptsMouseMovedEvents:]): Do nothing, preventing the real setAcceptsMouseMovedEvents: (in class NSWindow) from being called. 2003-09-22 Darin Adler <darin@apple.com> Reviewed by Dave. - fixed 3431033 -- crash in -[NSToolTipManager _shouldInstallToolTip:] * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _addTrackingRect:owner:userData:assumeInside:useTrackingNum:]): Override this alternate version of addTrackingRect. If I don't do this, we might create a real tracking rect, which we would then never remove. (-[WebHTMLView removeTrackingRect:]): Added assertions. 2003-09-22 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Rename Mixed build style to OptimizedWithSymbols. 2003-09-21 Darin Adler <darin@apple.com> * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView removeTrackingRect:]): Remove bogus assert. 2003-09-21 Darin Adler <darin@apple.com> Reviewed by Dave. - fixed 3106411 -- show title attribute for page elements in tooltip on mouseover (important for PeopleSoft) * WebView.subproj/WebHTMLViewPrivate.h: Added fields needed for tool tip implementation. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLViewPrivate dealloc]): Release the tool tip string. (-[WebHTMLView addTrackingRect:owner:userData:assumeInside:]): Override the default NSView tracking rectangle implementation so we can trick the tool tip manager into trusting us about when you leave and enter the rectangle for each element. (-[WebHTMLView removeTrackingRect:]): The other half of the above stuff. (-[WebHTMLView _sendToolTipMouseExited]): Added. Makes an event just good enough to fool the tool tip manager, and send it on. (-[WebHTMLView _sendToolTipMouseEntered]): Ditto. (-[WebHTMLView _setToolTip:]): Added. Manages the new and old tool tips in a way that fools the tool tip manager into working even though we don't know the rectangles of the tool tips beforehand. The advantage of using AppKit tool tips is that they have all sorts of nice little features, like wrapping to a nice rectangular shape and fading out when you move away. (-[WebHTMLView view:stringForToolTip:point:userData:]): This is how the tool tip manager gets the actual tool tip text. (-[WebHTMLView _updateMouseoverWithEvent:]): Call _setToolTip method, using the value passed along with the WebCoreElementTitleKey in the dictionary. - unrelated code cleanup * WebView.subproj/WebFramePrivate.h: Don't define WebCorePageCacheStateKey here; instead use a definition exported from WebCore. * WebView.subproj/WebFramePrivate.m: Ditto. * English.lproj/StringsNotToBeLocalized.txt: Update for above changes. 2003-09-19 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. Roll out old fix for 3410980. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge goBackOrForward:]): 2003-09-19 Darin Adler <darin@apple.com> Reviewed by Dave. - do the prep work for the mini controls feature; Dave will finish this * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileButton isFlipped]): Make this flipped, easier to understand coordinates that way. (-[WebFileButton drawRect:]): Update for flipped-ness. (-[WebFileButton visualFrame]): Update for flipped-ness. (-[WebFileButton setVisualFrame:]): Update for flipped-ness. (-[WebFileButton baseline]): Update for flipped-ness. 2003-09-19 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3410980 - FileMaker: going forward with an empty forward list makes a frame come out blank sometimes * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge backOrForwardItemWithDistance:]): Factored out from goBackOrForward. (-[WebBridge canGoBackOrForward:]): Use the new method. (-[WebBridge goBackOrForward:]): Likewise. 2003-09-17 John Sullivan <sullivan@apple.com> - WebKit part of fix for 3157018 -- Would like option to not print backgrounds Reviewed by Darin * WebView.subproj/WebPreferences.h: new accessor methods for new shouldPrintBackgrounds preference * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): set initial value for WebKitShouldPrintBackgroundsPreferenceKey to NO (-[WebPreferences shouldPrintBackgrounds]): new method, read NSUserDefaults value (-[WebPreferences setShouldPrintBackgrounds:]): new method, write NSUserDefault value * WebView.subproj/WebViewPrivate.m: (-[WebView _updateWebCoreSettingsFromPreferences:]): tell WebCore about value of shouldPrintBackgrounds * English.lproj/StringsNotToBeLocalized.txt: Updated for these and other recent changes 2003-09-17 Darin Adler <darin@apple.com> Reviewed by Maciej. * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage pathByResolvingSymlinksAndAliasesInPath:]): Pass the "no UI" flag, so we don't prompt the user when we're trying to load plug-ins. Also use OSStatus rather than OSErr so we don't miss error codes that just happen to have zeroes in the low 16 bits. 2003-09-17 Darin Adler <darin@apple.com> Reviewed by John. * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileButton setFilename:]): Don't call -[NSWorkspace iconForFile:] on a path that does not start with a '/'. This can happen if JavaScript or the web page sets the path explicitly, and adding this check avoids an unpleasant warning on the console. === WebKit-106 === 2003-09-16 Richard Williamson <rjw@apple.com> Backed out fix to 3412062 to resolve 3424197. Many sites use a technique of posting forms the same URL to generate content server side. The fix to 3412062 broke those sites. Reviewed by Darin. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): === WebKit-105 === === WebKit-104 === 2003-09-12 Richard Williamson <rjw@apple.com> Fixed 3420097. If redirects are cancelled during a pending load don't reset the quickRedirect flag. Reviewed by Darin. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportClientRedirectCancelled:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:formState:]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _clientRedirectedTo:delay:fireDate:lockHistory:isJavaScriptFormAction:]): (-[WebFrame _clientRedirectCancelled:]): === WebKit-103 === 2003-09-12 Richard Williamson <rjw@apple.com> Fixed 3412062. Don't allow pages with the same URL as the current URL to enter b/f or history. Reviewed by Maciej. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): 2003-09-11 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3413463 - QuickTime plug-in content doesn't load in Safari (NPP_Write not called) * Plugins.subproj/npapi.h: Fix erroneous function pointer declarations that led to an int16/int32 mismatch. 2003-09-12 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3420112>: Reproducible Safari crash in in -[WebBaseNetscapePluginView sendEvent:] Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendEvent:]): temporarily retain self in case the plug-in view is released while sending an event. (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:targetFrame:]): don't deliver the return value of the JS evaluation if stringByEvaluatingJavaScriptFromString caused the plug-in to stop. === WebKit-102 === 2003-09-11 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. - fixed 3417486 - after logging off from secure Etrade website, going back returns you to secure page * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadItem:withLoadType:]): Don't request stale data for https pages, as this could be a security risk. 2003-09-11 Richard Williamson <rjw@apple.com> Fixed 3406671. Added a private method for Mail to get selection rect. Reviewed by Darin Adler. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView updateTextBackgroundColor]): * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _handleMouseDragged:]): (-[WebHTMLView _pluginController]): (-[WebHTMLView _selectionRect]): 2003-09-10 Richard Williamson <rjw@apple.com> Fixed 3231031. Use the normal methodology for displaying each frame of a GIF. That is, just call setNeedsDisplayInRect, rather than drawing directly. Drawing directly violates layering/clipping. Reviewed by Dave Hyatt. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer nextFrame:]): === Safari-100 === 2003-09-09 Richard Williamson <rjw@apple.com> Fixed 3414988. Don't store absolute path to home directory. Reviewed by Chris Blumenberg. Fixed 3414319. Send correct WebView back as parameter to webViewShow: Review by Darin. Fixed 3095029. Draw a frame's border in WebFrameView, instead of WebHTMLView, and correctly inset the frame's scrollview to account for the border. Mostly written by Darin. Reviewed by Darin (and Richard). * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _createFileDatabase]): Store @"~/Library/Icon" instead of absolute path, and always try to tilde expand stored path. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setHasBorder:]): * WebView.subproj/WebFrameView.m: (-[WebFrameView drawRect:]): (-[WebFrameView setFrameSize:]): * WebView.subproj/WebFrameViewPrivate.h: * WebView.subproj/WebFrameViewPrivate.m: (-[WebFrameView _isMainFrame]): (-[WebFrameView _tile]): (-[WebFrameView _drawBorder]): (-[WebFrameView _shouldDrawBorder]): (-[WebFrameView _setHasBorder:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): Changes to correct draw border in WebFrameView instead of WebHTMLView. * WebView.subproj/WebViewPrivate.m: (-[WebView _openNewWindowWithRequest:]): Send correct parameter (returned from webView:createWebViewWithRequest:), rather than self, to webViewShow:. 2003-09-09 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3412380>: REGRESSION (85-98): www.minoltan.com is decoded incorrectly on Japanese system The default encoding that Safari uses is latin1 regardless of the current system encoding. This is how it's always been. The problem is that the UI is displaying shift JIS for the default text encoding instead of latin1. This is happening because WebKit is using "latin1" instead of "ISO-8859-1" for the default text encoding name. "ISO-8859-1" is the IANA character set name for latin1 and this is what the WebKitDefaultTextEncodingNamePreferenceKey preference expects. This ends up confusing Safari, so Saf ari just ends up displaying the first item in the pop-up menu which is shift JIS. Reviewed by rjw. * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): The WebKitDefaultTextEncodingNamePreferenceKey should be "ISO-8859-1" not "latin1" since "ISO-8859-1" is the IANA character set name for latin1. === Safari-99 === 2003-09-08 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed 3412726 -- some HTML messages in Mail lose a line at page breaks when printed (multipart/alternative) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Go into printing mode when asked to adjust page height, if not already in it. We already have code in drawRect that does this when actually printing, but it's also important to lay out the same way when deciding where to break pages, otherwise the difference between printer and screen fonts can lead to page breaks that split a line of text across two pages, and that can lead to missing lines of text as well. 2003-09-07 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3410939 -- disabling Geneva and Helvetica (by removing them, or by using Font Book) makes Safari crash * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory fallbackFontWithTraits:size:]): Fall back on Lucida Grande (plain, not bothering with traits) if Helvetica is not present. * English.lproj/StringsNotToBeLocalized.txt: Update for this and other recent changes. 2003-09-07 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed 3406660 -- screen fonts are not being used for substitute fonts (Japanese text, Roman font) * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer substituteFontForString:families:]): Get a printer or screen font, based on the renderer's mode. The old code didn't do anything explicit. (-[WebTextRenderer _setupFont]): Remove ignored parameter for clarity. (-[WebTextRenderer initWithFont:usingPrinterFont:]): Fixed code paths that would not explicitly get a printer or screen font, and code paths that would get data from the original "before mapping to printer or screen font" NSFont object. === Safari-98 === 2003-09-05 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Incorporate releaseGState fix that Darin developed for textareas and list boxes in WebCore. It turns out that we this workaround in WebClipView as well to get proper drawing of subframes. In addition, removed some tests that which performed runtime checks for code in AppKit. AppKit will have the checked-for code in all versions that will be used with the version of WebKit. * WebView.subproj/WebClipView.m: (-[WebClipView initWithFrame:]) (-[WebClipView resetAdditionalClip]) (-[WebClipView setAdditionalClip:]) 2003-09-04 John Sullivan <sullivan@apple.com> - fixed 3409011 -- the graphics views palette does not open Reviewed by Maciej * WebView.subproj/WebPreferences.m: (+[WebPreferences _removeReferenceForIdentifier:]): special-case nil, which is a magic initial identifier already special-cased in the other mutator 2003-09-05 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3406140 - REGRESSION (7B52-7B55): time spent in NSFont makes Safari 50% slower in Five Apps test * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory fontWithFamily:traits:size:]): Make font using the font name we found, not the one we were looking for. Since the compare is case-insensitive, it makes a difference. Also, don't make the font twice. 2003-09-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3316704>: Shockwave: getnetText steam is not functioning correctly Reviewed by mjs. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]): if the content length is unknown, use 0 instead of -1 2003-09-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3286922>: Shockwave: Using HTTP to stream .mp3 or .swa files fails at ~50% Reviewed by mjs. * Plugins.subproj/WebBaseNetscapePluginStream.h: new deliveryData and reason ivars * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream dealloc]): release deliveryData ivar (-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]): set new reason ivar (-[WebBaseNetscapePluginStream destroyStream]): new, calls NPP_StreamAsFile, NPP_DestroyStream and NPP_URLNotify (-[WebBaseNetscapePluginStream destroyStreamWithReason:]): set the reason, call destroyStream (-[WebBaseNetscapePluginStream receivedError:]): set deliveryData length to 0 so no more data is streamed, call destroyStreamWithReason (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): don't call NPP_StreamAsFile because this has to be called right before NPP_DestroyStream in destroyStream (-[WebBaseNetscapePluginStream deliverData]): new, call NPP_WriteReady and NPP_Write and properly obey their returned values (-[WebBaseNetscapePluginStream receivedData:]): call deliverData * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream stop]): call receivedError here (-[WebNetscapePluginConnectionDelegate connection:didFailWithError:]): don't call receivedError here because after the load is complete, stream is set to nil and receivedError can be called after the completed load 2003-09-04 Chris Blumenberg <cblu@apple.com> * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView postURL:target:len:buf:file:]): Fixed typo in newly added comment. 2003-09-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3407328>: request headers at the start of the file passed to NPN_PostURL don't work for Acrobat plug-in? Reviewed by john. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView postURL:target:len:buf:file:]): As documented, allow headers to be specified via NPP_PostURL when using a file. === Safari-97 === 2003-09-03 John Sullivan <sullivan@apple.com> - fixed 3406411 -- infoseek.co.jp: many console errors about attempting to set non-screen font (HiraMinPro-W3) Reviewed by Ken * WebCoreSupport.subproj/WebTextRenderer.m: (_drawGlyphs): use ERROR instead of NSLog for the printing-font-used-on-screen case, so it doesn't flood the world's console logs. We need to investigate why this is happening also, but that can probably be post-Panther. 2003-09-01 John Sullivan <sullivan@apple.com> - WebKit part of fix for 3402489 -- REGRESSION (7B48-7B55): Some printed web pages are too small (width is half a page) This was a regression caused by the fix for 3378810. Reviewed by Maciej * WebView.subproj/WebHTMLView.m: (-[WebHTMLView layoutToPageWidth:adjustingViewSize:]): now takes adjustViewSize flag, and passes it down to one of bridge's forceLayout calls. (-[WebHTMLView layout]): pass NO for adjustViewSize flag in this case (-[WebHTMLView _setPrinting:pageWidth:adjustViewSize:]): pass adjustViewSize flag down to layoutToPageWidth instead of using it directly here; this is the wrong level to use it directly since the bridge is no longer set up for printing after the layoutToPageWidth call completes. 2003-08-30 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - fixed 3401709 - [WebView searchFor:] with wrap:NO hangs if the search fails * WebView.subproj/WebView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): Fix for wrap:NO case as suggested by Darin. === Safari-96 === 2003-08-29 Richard Williamson <rjw@apple.com> Fixed 3401334. Use IB document key when checking for reference removal on instances of WebPreferences. Also removed _userDefaultsKeysForIB, no longer needed by IB. Reviewed by John. * WebView.subproj/WebPreferences.m: (+[WebPreferences _removeReferenceForIdentifier:]): (-[WebPreferences _postPreferencesChangesNotification]): * WebView.subproj/WebPreferencesPrivate.h: 2003-08-29 Richard Williamson <rjw@apple.com> Fixed 3400807. Don't release state associated with the current b/f item. We shouldn't normally have page cache state associated with the current item (3401376). This fix guarantees that we won't prematurely release the page cache state for the current item. Reviewed byJohn Sullivan. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList _clearPageCache]): 2003-08-28 Richard Williamson <rjw@apple.com> Fixed 3399736. Fixed several problems with WebView/WebPreferences interaction. Reviewed by Eric Seymour. * Misc.subproj/WebKitLogging.h: * Misc.subproj/WebKitLogging.m: Added debug logging. * WebCoreSupport.subproj/WebTextRenderer.m: (_drawGlyphs): Checkin for 3398229 below. * WebView.subproj/WebPreferences.m: (-[WebPreferences initWithIdentifier:]): (-[WebPreferences initWithCoder:]): (-[WebPreferences encodeWithCoder:]): (+[WebPreferences standardPreferences]): (+[WebPreferences _getInstanceForIdentifier:]): (+[WebPreferences _setInstance:forIdentifier:]): (+[WebPreferences _concatenateKeyWithIBCreatorID:]): * WebView.subproj/WebView.m: (-[WebView _commonInitializationWithFrameName:groupName:]): (-[WebView initWithCoder:]): (-[WebView encodeWithCoder:]): 2003-08-27 Richard Williamson <rjw@apple.com> Fixed 3398229. When we request a font from NSFont by name we should use a case specific name. We do case insensitve comparsion, but once a match is found we should use the actual font name, not the requested name. Two layout tests are still failing, b ut I don't think the failures are font related. Reviewed by Hyatt. * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory fontWithFamily:traits:size:]): === Safari-95 === 2003-08-27 Richard Williamson <rjw@apple.com> Fixed 3397235. WebView wasn't archiving useBackForwardList. Reviewed by Eric Seymour. * WebView.subproj/WebView.m: (-[WebView initWithCoder:]): (-[WebView encodeWithCoder:]): 2003-08-26 Richard Williamson <rjw@apple.com> Fixed 3385478. Look for an exact match for font names (using PS names) before matching on family names. Also added logging to help debug now resolved binding problem. Reviewed by Maciej. * Misc.subproj/WebKitLogging.h: * Misc.subproj/WebKitLogging.m: * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory fontWithFamily:traits:size:]): * WebView.subproj/WebView.m: (-[WebView addObserver:forKeyPath:options:context:]): (-[WebView removeObserver:forKeyPath:]): 2003-08-26 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3310943 -- REGRESSION (Panther): textareas in forms sometimes draw blank (bugreporter) There are two fixes here. The more elegant and slightly faster one that requires a new AppKit, and the less elegant one that works without AppKit support. By including both we don't have to worry about timing of submission of WebKit vs. AppKit but we get the good, elegant fix. Later, we can delete the less elegant fix. * WebView.subproj/WebClipView.m: (+[WebClipView initialize]): Set up a boolean global so we only hav to do the "does AppKit support _focusRingVisibleRect" check one time. (-[WebClipView resetAdditionalClip]): Only do the renewGState thing if we don't have the _focusRingVisibleRect method, but if we do the renewGState thing, do it to self and all descendants using _web_renewGStateDeep. (-[WebClipView setAdditionalClip:]): Ditto. (-[WebClipView visibleRect]): Only limit this based on the additional clip if we don't have the _focusRingVisibleRect method. (-[WebClipView _focusRingVisibleRect]): Override the new method. Harmless if it's an old AppKit that doesn't have the method yet. (-[NSView _web_renewGStateDeep]): Implemented this helper method. We can get rid of it once we are entirely on the new AppKit. 2003-08-26 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3321247 -- window size box disappears from Help window (caused by WebKit NSView hackery) * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]), (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): Don't propagate dirty rects at all. This was causing problems because now the AppKit uses dirty regions, not dirty rects. In AppKit-722 and newer, _setDrawsDescendants: takes care of this for us so we don't have to do anything at all. 2003-08-26 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3392650 -- REGRESSION?: assertion fails trying Apple-hosted page load test while not on Apple network * WebView.subproj/WebFramePrivate.m: (-[WebFrame _isLoadComplete]): Stop loading the provisional data source before blowing it away, in case there are some callbacks that haven't occurred yet. It's a waste of time to try to handle those additional callbacks, and can lead to failed assertions since the data source won't be hooked up to any frame any more. 2003-08-25 Richard Williamson <rjw@apple.com> Fix for 3391609. Our rounding hack wasn't correctly reflected in the selection point code. Piggy-backed on this fix are fixes for selection of letter-spacing, word-spacing and justified text. Reviewed by Hyatt. * WebCoreSupport.subproj/WebTextRenderer.m: (initializeCharacterWidthIterator): (widthAndGlyphForSurrogate): (widthForNextCharacter): (-[WebTextRenderer _CG_floatWidthForRun:style:widths:fonts:glyphs:startGlyph:endGlyph:numGlyphs:]): 2003-08-25 John Sullivan <sullivan@apple.com> - fixed 3391264 -- REGRESSION (Panther): Back/Forward buttons not updating immediately after page load The buttons are updated in response to window update notifications. Jaguar was sending so many extra bogus notifications that it masked the fact that we weren't ensuring that these notifications were sent at all in the case of non-event-based interesting changes that might affect menu items/toolbar items/etc. Reviewed by Richard * WebView.subproj/WebViewPrivate.m: (-[WebView _didStartProvisionalLoadForFrame:]): call -[NSApp setWindowsNeedUpdate:YES] so window update notices will be sent (-[WebView _didCommitLoadForFrame:]): ditto (-[WebView _didFinishLoadForFrame:]): ditto (-[WebView _didFailLoadWithError:forFrame:]): ditto (-[WebView _didFailProvisionalLoadWithError:forFrame:]): ditto 2003-08-24 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3382179 -- REGRESSION: many images scroll down while loading (e.g., homepage.mac.com slide show) * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): While loading, always draw one less line than the number NSImage says we have, since that last line is a partial line and draws unwanted white. This is not what the bug report complains about, but is a longstanding and very minor issue. Remove the code that adjust the Y origin. This is what the bug report is about. That adjustment is incorrect and was unknowingly compensating for some kind of NSImage bug that is now fixed. (-[WebImageRenderer tileInRect:fromPoint:]): Added an assertion that the WebImageRenderer is flipped. The code does assume that it's flipped. 2003-08-22 John Sullivan <sullivan@apple.com> - fixed 3385837 -- REGRESSION: can't paste link from Safari into Keynote (paste at top level, not into text) Reviewed by Darin The problem was that we were using a single list of pasteboard types for both "types we can read" and "types we can write", but NSFilenamesPBoardType wasn't being written to, creating a bad pasteboard. The fix is to split this list in two. We could do this a little more elegantly if we weren't paranoid about last-minute SPI changes breaking compatibility with Sherlock or some other internal client. * Misc.subproj/WebNSPasteboardExtras.h: add new _web_writableDragTypesForURL, commented various methods better. * Misc.subproj/WebNSPasteboardExtras.m: (+[NSPasteboard _web_writableDragTypesForURL]): implement _web_writableDragTypesForURL; it's just like _web_dragTypesForURL but without the NSFilenamesPBoardType (-[NSPasteboard _web_writeURL:andTitle:withOwner:]): use _web_writableDragTypesForURL * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragPromisedImage:rect:URL:title:event:]): use _web_writableDragTypesForURL 2003-08-22 Darin Adler <darin@apple.com> Reviewed by Dave. - fixed 3386051 -- REGRESSION: text "too dark" after the page is deactivated and reactivated (bugweb) Cached clips were causing us to draw nothing for the top frames of framesets, resulting in darkened text because we draw anti-aliased text twice without drawing a background. * WebView.subproj/WebClipView.m: (-[WebClipView resetAdditionalClip]): Invalidate cached graphics state when changing the visible rect. (-[WebClipView setAdditionalClip:]): Ditto. 2003-08-21 Darin Adler <darin@apple.com> * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _setPrinting:pageWidth:adjustViewSize:]): Tweak to printing fix: Be sure to call adjustViewSize after applying styles and doing layout. 2003-08-21 Richard Williamson <rjw@apple.com> Fixed 3378810. Avoid resizing frame from drawRect: when printing. This will corrupt the graphics context. Reviewed by Hyatt. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView layoutToPageWidth:]): (-[WebHTMLView drawRect:]): (-[WebHTMLView _setPrinting:pageWidth:adjustViewSize:]): (-[WebHTMLView beginDocument]): (-[WebHTMLView endDocument]): === Safari-94 === 2003-08-21 John Sullivan <sullivan@apple.com> - fixed 3387950 -- REGRESSION (85-89): Standalone image in Safari prints much smaller than in Jaguar Reviewed by Chris. * WebView.subproj/WebImageView.m: (-[WebImageView adjustFrameSize]): renamed from setFrameSizeUsingImage; now sets the frame size to exactly the image size (as it did in Jaguar always) when we're not drawing to the screen. (-[WebImageView setFrameSize:]): updated for name change (-[WebImageView layout]): ditto (-[WebImageView beginDocument]): adjust frame size (before printing) (-[WebImageView endDocument]): adjust frame size (after printing) 2003-08-19 Richard Williamson <rjw@apple.com> Fixed 3383623 (and 3384896). Remove our unbeknownst work-around for an NSImage bug that incorrectly flipped y coordinate when drawing a partial rect within the image. This has been fixed in Panther, making our work-around no longer necessary. Reviewed by Darin. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer tileInRect:fromPoint:]): * WebKit.pbproj/project.pbxproj: 2003-08-18 Richard Williamson <rjw@apple.com> Fixed 3140065. Bidi neutrals in RTL runs are now handled correctly. Still have problem with bidi neutrals at directional boundaries 3382926. Reviewed by Maciej. * Misc.subproj/WebUnicode.h: * Misc.subproj/WebUnicode.m: (shapedString): * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _CG_floatWidthForRun:style:widths:fonts:glyphs:startGlyph:endGlyph:numGlyphs:]): 2003-08-18 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3299893 -- oncontextmenu support * WebView.subproj/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): Call sendContextMenuEvent: on the bridge, and don't show a menu if the event is handled over in WebCore. (-[WebHTMLView mouseDown:]): Don't send a mouse down event in the case where we already sent a context menu event and decided not to put up a real context menu. 2003-08-18 Richard Williamson <rjw@apple.com> Fix build problem from last checkin. Reviewed by Darin. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer initWithData:MIMEType:]): (-[WebImageRenderer initWithContentsOfFile:]): 2003-08-17 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3376522 -- REGRESSION: uncaught exception from bad .ico causes crash (login window at 34sp.com) I added exception handling in all the places we load images with NSImage. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _iconsForIconURLString:]): Add exception handler. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader connectionDidFinishLoading:]): Add exception handler. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer initWithData:MIMEType:]): Add exception handler. (-[WebImageRenderer initWithContentsOfFile:]): Add exception handler. (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): Add exception handler. 2003-08-15 Richard Williamson <rjw@apple.com> Fixed 3378530. Ensure that line is always drawn within bounds of element. Reviewed by Chris. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawLineForCharacters:yOffset:withWidth:withColor:]): 2003-08-15 Richard Williamson <rjw@apple.com> Fixed 3379439. Remove checks for CG symbols. No longer needed. Reviewed by Darin. * WebCoreSupport.subproj/WebTextRendererFactory.m: (+[WebTextRendererFactory createSharedFactory]): === Safari-93 === 2003-08-14 Vicki Murley <vicki@apple.com> Reviewed by John. * WebKit.pbproj/project.pbxproj: deleted WebKit.order from the project. 2003-08-14 Vicki Murley <vicki@apple.com> Reviewed by John. * WebKit.order: Removed. We now point to the WebKit order file in /AppleInternal/OrderFiles. * WebKit.pbproj/project.pbxproj: set sectorder flag to point to /AppleInternal/OrderFiles/WebKit.order 2003-08-14 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed 3344259 -- flipped image when copying from Safari in 1000s of colors mode The workaround is to turn off the NSImage cache. Andrew says this won't have any practical repercussions other than making the bug go away. Seems to have a side effect of speeding up the cvs-base page load test! * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer initWithMIMEType:]): Set mode to NSImageCacheNever. (-[WebImageRenderer initWithData:MIMEType:]): Ditto. (-[WebImageRenderer initWithContentsOfFile:]): Ditto. (-[WebImageRenderer _adjustSizeToPixelDimensions]): Don't set mode to NSImageCacheDefault. 2003-08-14 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3375042>: Change usages of NSURL absoluteString in WebKit to use improved variants * History.subproj/WebHistoryItem.m: (-[WebHistoryItem initWithURL:title:]): Use data-as-string. (-[WebHistoryItem initWithURL:target:parent:title:]): Use data-as-string. (-[WebHistoryItem setURL:]): Use data-as-string. * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate addItem:]): Remove FIX_VISITED ifdef (-[WebHistoryPrivate removeItem:]): Ditto (-[WebHistoryPrivate containsURL:]): Ditto. Use data-as-string. (-[WebHistoryPrivate itemForURL:]): Ditto. Ditto. (-[WebHistoryPrivate loadFromURL:error:]): Fix log message to URL. (-[WebHistoryPrivate _saveHistoryGuts:URL:error:]): Ditto. (-[WebHistoryPrivate saveToURL:error:]): Ditto. * History.subproj/WebURLsWithTitles.m: (+[WebURLsWithTitles writeURLs:andTitles:toPasteboard:]): Use visible-string. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader connectionDidFinishLoading:]): Use data-as-string. * Misc.subproj/WebKitErrors.m: (+[NSError _webKitErrorWithDomain:code:URL:]): Added new convenience that takes a URL instead of a URL string. (-[NSError _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:]): Added new convenience that takes URLs instead of a URL stringis. * Misc.subproj/WebKitErrorsPrivate.h: Declared new conveniences. * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeURL:andTitle:withOwner:types:]): Use visible-string. * Misc.subproj/WebNSURLExtras.h: * Misc.subproj/WebNSURLExtras.m: (-[NSURL _web_originalDataAsString]): Added. (-[NSURL _webkit_isJavaScriptURL]): Use data-as-string. (-[NSURL _webkit_scriptIfJavaScriptURL]): Ditto (-[NSURL _webkit_isFTPDirectoryURL]): Ditto (-[NSURL _webkit_shouldLoadAsEmptyDocument]): Ditto. Also use _web_isEmpty. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): Use data-as-string. * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): Use new error convenience. * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginConnectionDelegate connection:didReceiveResponse:]): Ditto. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge requestedURLString]): Use data-as-string. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): Use new error convenience. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate cancelledError]): Ditto. * WebView.subproj/WebDataProtocol.m: (-[WebDataProtocol startLoading]): Ditto. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _stopLoadingInternal]): Ditto. (-[WebDataSource _updateIconDatabaseWithURL:]): Use data-as-string. (-[WebDataSource _loadIcon]): Ditto. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _createItem:]): Use data-as-string. (-[WebFrame _transitionToCommitted:]): Fix log message to use URL. (-[WebFrame _purgePageCache]): Use _web_isEmpty (-[WebFrame _setState:]): Fix log message to use URL. (-[WebFrame _handleUnimplementablePolicyWithErrorCode:forURL:]): Use new error convenience. (-[WebFrame _loadItem:withLoadType:]): Fix log message to use URL. (-[WebFrame _checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): Fix log messages to use URL. (-[WebFrame _shouldTreatURLAsSameAsCurrent:]): Use data-as-string. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _dragImageForLinkElement:]): Use visible-string. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient interruptForPolicyChangeError]): Use new error convenience. * WebView.subproj/WebPreferences.m: (-[WebPreferences setUserStyleSheetLocation:]): Use data-as-string. * WebView.subproj/WebView.m: (-[WebView mainFrameURL]): Use data-as-string. (-[WebView mainFrameIcon]): Use data-as-string. * WebView.subproj/WebViewPrivate.m: (-[WebView _updateWebCoreSettingsFromPreferences:]): Use data-as-string. 2003-08-12 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. - fixed 3365242 - non-repro abort in HTMLTokenizer at ajc.com * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _receivedData:]): ref the data source around processing the data and afterwards, to avoid crashing if a script in this chunk of data made the frame go away. 2003-08-13 Richard Williamson <rjw@apple.com> Fixed 3376077. Override automaticallyNotifiesObserversForKey: to prevent unnecessary additional notifications from being sent. Also added development-only logging (bulk of the change). Reviewed by Chris. * Misc.subproj/WebKitLogging.h: * Misc.subproj/WebKitLogging.m: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setTitle:]): (-[WebDataSource _updateIconDatabaseWithURL:]): * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _didChangeValueForKey:]): (-[WebView _willChangeValueForKey:]): (-[WebView _progressStarted]): (-[WebView _progressCompleted]): (-[WebView _incrementProgressForConnection:data:]): (+[WebView automaticallyNotifiesObserversForKey:]): (-[WebView _willChangeBackForwardKeys]): (-[WebView _didChangeBackForwardKeys]): (-[WebView _didStartProvisionalLoadForFrame:]): (-[WebView _didCommitLoadForFrame:]): (-[WebView _didFinishLoadForFrame:]): (-[WebView _didFailLoadWithError:forFrame:]): (-[WebView _didFailProvisionalLoadWithError:forFrame:]): 2003-08-13 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3347134>: After first successful POST in Flash, Safari does not repeat POST and gives cached reply Reviewed by kocienda. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView _postURLNotify:target:len:buf:file:notifyData:allowHeaders:]): call [request setCachePolicy:NSURLRequestReloadIgnoringCacheData] 2003-08-13 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3366441>: URL strings with UTF-8 characters processed improperly for display by WebKit * Misc.subproj/WebNSURLExtras.h: * Misc.subproj/WebNSURLExtras.m: (isHexDigit): Added (hexDigitValue): Added (-[NSURL _web_userVisibleString]): Added. Produces a string that is suitable for display to a user in the UI. (-[NSURL _web_isEmpty]): Convenience to check for an empty URL * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge requestedURLString]): Now calls _web_userVisibleString 2003-08-13 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3374458>: Choose UTF-8 for encoding when calling CFURLCreateAbsoluteURLWithBytes in WebKit Calling CFURLCreateAbsoluteURLWithBytes with ISO Latin 1 string encoding results in some issues when trying to decode a URL path in preparation for doing file I/O. Instead of doing a redecoding step whenever a path is needed to perform I/O, use UTF-8 as the encoding right from the start. This will mean that illegal UTF-8 sequences will be rejected by CFURLCreateAbsoluteURLWithBytes. However, we can work around this by falling back on ISO Latin1 in this case. The end result is that existing code throughout the URL loading system can remain unchanged and simply call the path method on NSURL as it does now and get the right result for its I/O requirements. * Misc.subproj/WebNSURLExtras.m: (+[NSURL _web_URLWithData:relativeToURL:]) 2003-08-13 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3374487>: URLs with UTF-8 escape sequences can't be accessed when typed in the Safari location bar * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_bestURL]): Call _web_URLWithUserTypedString: to make a URL from this type of string. * Misc.subproj/WebNSURLExtras.h: * Misc.subproj/WebNSURLExtras.m: (hexDigit): Added. (+[NSURL _web_URLWithUserTypedString:]): Added. Creates a URL from a string that is typed in a user, for example, in the Safari location bar. 2003-08-12 John Sullivan <sullivan@apple.com> - fixed 3369505 -- leaks of NSCFTimer after running through the cvs-base test suite Reviewed by Richard * WebView.subproj/WebFrame.m: (-[WebFrame stopLoading]): release timer before nil'ing it out 2003-08-12 Ed Voas <voas@apple.com> Reviewed by Richard. Make sure to override the standard behavior for ordering windows to do nothing for Carbon stuff. * Carbon.subproj/CarbonWindowAdapter.m: (-[CarbonWindowAdapter _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:]): 2003-08-11 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3163589>: Macromedia Flash 6 cannot take Asian text entry in Safari Revidewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView installKeyEventHandler]): new (-[WebBaseNetscapePluginView removeKeyEventHandler]): new (-[WebBaseNetscapePluginView becomeFirstResponder]): call installKeyEventHandler (-[WebBaseNetscapePluginView resignFirstResponder]): call removeKeyEventHandler (-[WebBaseNetscapePluginView keyUp:]): call TSMProcessRawKeyEvent so key events go through the machinery and UI that plug-ins expect (-[WebBaseNetscapePluginView keyDown:]): call TSMProcessRawKeyEvent so key events go through the machinery and UI that plug-ins expect (TSMEventHandler): turn the TSM event into a series of EventRecords and pass them to the plug-in (-[WebBaseNetscapePluginView stop]): call removeKeyEventHandler because resignFirstResponder may not get called 2003-08-08 Richard Williamson <rjw@apple.com> Lots of healthy cleanup. Introduced width and shaping iterators to simplify code and remove allocations for large text runs. Should go further and make more use of these in the future (post panther). Fixed 3369608. Crash in -[WebTextRenderer _CG_drawRun:style:atPoint:] at lovepucca.net Fixed 3118050. Crash selecting text at http://www.faqs.org/rfcs/rfc2849.html (SELECTION) Fixed 3371115. Can't correctly select text that contains surrogate pairs Reviewed by darin. * Misc.subproj/WebUnicode.h: * Misc.subproj/WebUnicode.m: (prevChar): (nextChar): (prevLogicalCharJoins): (nextLogicalCharJoins): (glyphVariantLogical): (hasShapeForNextCharacter): (shapeForNextCharacter): (initializeCharacterShapeIterator): (shapedString): * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (initializeCharacterWidthIterator): (widthAndGlyphForSurrogate): (widthForNextCharacter): (-[WebTextRenderer _CG_floatWidthForRun:style:widths:fonts:glyphs:startGlyph:endGlyph:numGlyphs:]): (-[WebTextRenderer _CG_pointToOffset:style:position:reversed:]): Just formatting changed here * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _dragImageForLinkElement:]): 2003-08-08 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3368236 -- NSURL exception going back at http://derstandard.at/ * WebView.subproj/WebFramePrivate.m: (-[WebFrame _createItem:]): Put "about:blank" in the back/forward item if there is no URL (which happens because there is no data source because the frame has never successfully loaded anything). Perhaps we can do better some day, but this avoids all the major bad effects in a safe way. * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. === Safari-92 === 2003-08-07 Richard Williamson <rjw@apple.com> Fixed 3362939. Checked flippyness of view and adjust y coord accordingly. Reviewed by John. * Misc.subproj/WebKitNSStringExtras.m: 2003-08-07 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3330742>: 1.0 Safari fails to send NPP_URLNotify with the error of NPRES_NETWORK_ERR to Flash Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream destroyStreamWithReason:]): call NPP_URLNotify so we cover both the failure and successful cases (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): have destroyStreamWithReason call NPP_URLNotify 2003-08-07 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3368552>: Fix inappropriate use of NSURL creation methods in WebKit Change calls to URLWithString: or URLWithString:relativeToURL to _web_URLWithDataAsString: and _web_URLWithDataAsString:relativeToURL, respectively. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _loadURL:intoChild:]): * WebView.subproj/WebPreferences.m: (-[WebPreferences userStyleSheetLocation]): * WebView.subproj/WebView.m: (-[WebView takeStringURLFrom:]): (-[WebView setMainFrameURL:]): 2003-08-06 Darin Adler <darin@apple.com> Reviewed by Richard. - fixed 3347114 -- remove vestiges of posing, including init routine, from WebKit * WebView.subproj/WebHTMLViewPrivate.m: Removed WebNSTextView, WebNSView, and WebNSWindow, removed the code to have them pose as NSTextView, NSView, and NSWindow, and removed excess imports that are no longer needed. 2003-08-06 Richard Williamson <rjw@apple.com> Fixed 3365378. Edge case text run > 1024 hit by JS generated string. We weren't correctly checking size of string length. Used /2 instead of *2. Reviewed by Vicki (and Dan!). * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _CG_drawHighlightForRun:style:atPoint:]): (-[WebTextRenderer _CG_drawRun:style:atPoint:]): 2003-08-06 Richard Williamson <rjw@apple.com> Fixed 3348630. Pick up about 1% by moving implementation of _unicodeDirection to WebCore and inlining. Reviewed by Ken. * Misc.subproj/WebUnicode.h: * Misc.subproj/WebUnicode.m: (_unicodeDirection): (_unicodeJoining): (_unicodeMirrored): (WebKitInitializeUnicode): * Misc.subproj/WebUnicodeTables.m: 2003-08-06 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3161102>: Avoid retain cycles by destroying plug-ins in the page cache before dealloc Reviewed by rjw. * History.subproj/WebHistoryItemPrivate.h: added declaration for [WebBackForwardList _clearPageCache] * WebView.subproj/WebViewPrivate.m: (-[WebView _close]): clear the page cache when we are closing the web view so we call destroy on all the plug-ins on the page cache to break any retain cycles. 2003-08-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3106525>: Results of JavaScript requests are not returned to plug-ins Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginStream.h: * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setNotifyData:]): new (-[WebBaseNetscapePluginStream startStreamWithURL:expectedContentLength:lastModifiedDate:MIMEType:]): renamed from setResponse (-[WebBaseNetscapePluginStream startStreamWithResponse:]): new (-[WebBaseNetscapePluginStream receivedData:]): tweak (-[WebBaseNetscapePluginStream destroyStreamWithReason:]): tweak (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): tweak * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:targetFrame:]): new (-[WebBaseNetscapePluginView loadPluginRequest:]): call evaluateJavaScriptPluginRequest:: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): call loadPluginRequest for JS requests * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedData:withDataSource:]): call renamed startStreamWithResponse * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:]): call setNotifyData (-[WebNetscapePluginConnectionDelegate connection:didReceiveResponse:]): call renamed startStreamWithResponse 2003-08-05 Ken Kocienda <kocienda@apple.com> Reviewed by Richard Plugins in WebKit need to store URLs in the form of "C-style" strings. Create and use a new, improved method to make these strings, and do not traverse through the NSURL absoluteString method, since that can i introduce errors. * Misc.subproj/WebNSURLExtras.h: Added _web_URLCString method. * Misc.subproj/WebNSURLExtras.m: (-[NSURL _web_URLCString]): Added. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setResponse:]): Call new _web_URLCString method. (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): Ditto. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView frameStateChanged:]): Ditto. (-[WebBaseNetscapePluginView loadPluginRequest:]): Ditto. 2003-08-05 Ken Kocienda <kocienda@apple.com> Reviewed by John Fix for this bug: <rdar://problem/3365035>: Modify WebNSURLExtras to call improved NSURL creation API * Misc.subproj/WebNSURLExtras.m: (+[NSURL _web_URLWithDataAsString:]): Call through to _web_URLWithDataAsString:relativeToURL:. (+[NSURL _web_URLWithDataAsString:relativeToURL:]): Call through to _web_URLWithData:relativeToURL:. (+[NSURL _web_URLWithData:]): Ditto. (+[NSURL _web_URLWithData:relativeToURL:]): Call CFURLCreateAbsoluteURLWithBytes API in CoreFoundation. (-[NSURL _web_originalData]): Use CFURLGetBytes API in CoreFoundation. Also make sure that a relative URL is resolved against its base. (-[NSURL _web_displayableString]): Call _web_originalData to get bytes to use to create the string. (-[NSURL _web_URLStringLength]): Use CFURLGetBytes API in CoreFoundation. 2003-08-04 Richard Williamson <rjw@apple.com> Fixed 3363011. Pass b/f related key down events to super if b/f is disabled. Reviewed by Chris. * WebView.subproj/WebFrameView.m: (-[WebFrameView keyDown:]): Fixed 3363345. Retain static array used by IB to present WebView's bindable keys. Review by Maciej * WebView.subproj/WebViewPrivate.m: (-[WebView _declaredKeys]): 2003-08-04 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fix for this bug: <rdar://problem/3363318>: REGRESSION: Plug-in content doesn't show up, animate etc WebNetscapePluginConnectionDelegate must implement this method: - (void)connection:(NSURLConnection *)con didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginConnectionDelegate connection:didReceiveData:lengthReceived:]) 2003-08-04 Darin Adler <darin@apple.com> Reviewed by Richard. - fixed 3298153 -- get "screen font while printing" error, bad stuff happens after that (Sherlock, Safari) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): If we find ourselves in drawRect with the wrong printing mode, that usually means we're being printed as part of some larger print process, so do the layout in printing mode. 2003-08-04 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3360977>: REGRESSION (7B28-7B29): main webview rejects drop of doc icon from BBEdit Reviewed by darin. * Misc.subproj/WebNSPasteboardExtras.m: (+[NSPasteboard _web_dragTypesForURL]): we handle NSFilenamesPboardType * WebKit.pbproj/project.pbxproj: 2003-08-04 Richard Williamson <rjw@apple.com> Fixed 3223989. Pass key down events to super if scrolling is disabled. Reviewed by Chris (Welcome back!). * WebView.subproj/WebFrameView.m: (-[WebFrameView keyDown:]): 2003-08-01 Richard Williamson <rjw@apple.com> Fixed 3095376. Implemented correct selection behavior for rtl scripts. We still use our Arabic and Hebrew layout scheme. Fixed 3360487. Implemented selection of ATSU rendered code. Fixed 3360242. Return nil from _bodyBackgroundColor when no background color specified. This was requested by Doug D. Reviewed by Maciej. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawHighlightForRun:style:atPoint:]): (-[WebTextRenderer _CG_drawHighlightForRun:style:atPoint:]): (-[WebTextRenderer drawRun:style:atPoint:]): (-[WebTextRenderer _CG_drawRun:style:atPoint:]): (-[WebTextRenderer _CG_floatWidthForRun:style:widths:fonts:glyphs:startGlyph:endGlyph:numGlyphs:]): (-[WebTextRenderer _ATSU_drawHighlightForRun:style:atPoint:]): (-[WebTextRenderer _ATSU_drawRun:style:atPoint:]): (-[WebTextRenderer pointToOffset:style:position:reversed:]): (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:]): (-[WebTextRenderer _CG_pointToOffset:style:position:reversed:]): 2003-08-01 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3339255 - REGRESSION (73-85): javascript failure at gia.apple.com * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setState:]): When going to provisional state, tell the bridge that a provisional load started, so it can cancel any pending redirects. === Safari-91 === 2003-07-31 Richard Williamson <rjw@apple.com> Make sure width is initialized for monospace optimizations. Reviewed by Vicki. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer checkSelectionPoint:style:position:reversed:]): 2003-07-31 Richard Williamson <rjw@apple.com> Fixed 3359152. SPI to get the background color for a frame. Reviewed by hyatt. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer checkSelectionPoint:style:position:reversed:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _bodyBackgroundColor]): 2003-07-31 Richard Williamson <rjw@apple.com> Fixed 3358870. Fall back on 'user defaults' values when a value in a custom instance of WebPreferences hasn't been overriden. Reviewed by Eric Seymour. * WebView.subproj/WebPreferences.m: (-[WebPreferences _stringValueForKey:]): (-[WebPreferences _integerValueForKey:]): (-[WebPreferences _boolValueForKey:]): 2003-07-30 Richard Williamson <rjw@apple.com> Preparation for 3095376. Reviewed by Maciej. * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _web_widthWithFont:]): * Misc.subproj/WebStringTruncator.m: (stringWidth): * WebCoreSupport.subproj/WebTextRenderer.m: (shouldUseATSU): (-[WebTextRenderer widthForCharacters:length:]): (-[WebTextRenderer drawRun:style:atPoint:]): (-[WebTextRenderer _CG_drawRun:style:atPoint:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:characterPosition:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:widths:letterSpacing:wordSpacing:smallCaps:fontFamilies:]): (-[WebTextRenderer floatWidthForRun:style:widths:]): (-[WebTextRenderer _floatWidthForRun:style:widths:fonts:glyphs:startGlyph:endGlyph:numGlyphs:]): (-[WebTextRenderer _CG_floatWidthForRun:style:widths:fonts:glyphs:startGlyph:endGlyph:numGlyphs:]): (-[WebTextRenderer _createATSUTextLayoutForRun:]): (-[WebTextRenderer _trapezoidForRun:style:atPoint:]): (-[WebTextRenderer _ATSU_floatWidthForRun:style:]): (-[WebTextRenderer _ATSU_drawRun:style:atPoint:]): (-[WebTextRenderer checkSelectionPoint:style:position:reversed:]): 2003-07-30 Richard Williamson <rjw@apple.com> Fixed 3356518. Added private method called by IB to ensure that autoresizeSubviews flag is turned on correctly. Reviewed by mjs. * WebView.subproj/WebViewPrivate.m: (-[WebView _finishedMakingConnections]): 2003-07-28 Richard Williamson <rjw@apple.com> Fixed 3323866. Provide SPI to IB to enable scoping of preferences values on a document-by-document basis. Reviewed by Maciej. * WebView.subproj/WebPreferences.m: (-[WebPreferencesPrivate dealloc]): (-[WebPreferences initWithIdentifier:]): (-[WebPreferences initWithCoder:]): (+[WebPreferences _userDefaultsKeysForIB]): (+[WebPreferences _setIBCreatorID:]): (+[WebPreferences _IBCreatorID]): (-[WebPreferences _concatenateKeyWithIBCreatorID:]): * WebView.subproj/WebPreferencesPrivate.h: 2003-07-28 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3344647 -- reachedTerminalState assertion in WebBaseResourceHandleDelegate.m * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient cancelWithError:]): Use [super cancelWithError:] rather than [self receivedError:]. I checked carefully to see that this code now does everything the old code did (and a bit more). 2003-07-28 Richard Williamson <rjw@apple.com> Fixed 3341859. Check that the WebHTMLView is initialized in viewWillMoveToWindow: and viewDidMoveToWindow. Don't do anything if we aren't initialized. This happens when decoding a WebView. When WebViews are decoded their subviews are created by initWithCoder: and so won't be normally initialized. The stub views are discarded by WebView. Reviewed by John. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView viewWillMoveToWindow:]): (-[WebHTMLView viewDidMoveToWindow]): 2003-07-28 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3279864 -- remove class_poseAs calls from WebKit * WebView.subproj/WebHTMLView.m: (-[WebHTMLView initWithFrame:]): Call _setDrawsOwnDescendants, if we have a new enough AppKit. * WebView.subproj/WebHTMLViewPrivate.m: (+[WebHTMLView load]): Don't pose as NSView, if we have a new enough AppKit. 2003-07-28 Ken Kocienda <kocienda@apple.com> Reviewed by John Fix for this bug: <rdar://problem/3336933>: REGRESSION (Panther): Mozilla build downloaded with wrong extension, bad file size (gzip) Use new delegate methods that allow for the correct reporting of progress in cases where Foundation-level content decoding has been performed on data received * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient connection:didReceiveData:lengthReceived:]): * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:didReceiveData:]): (-[WebBaseResourceHandleDelegate connection:didReceiveData:lengthReceived:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient connection:didReceiveData:lengthReceived:]): 2003-07-28 Darin Adler <darin@apple.com> Reviewed by Richard. - fixed leak of WebDataRequestParameters objects * WebView.subproj/WebDataProtocol.m: (-[NSMutableURLRequest _webDataRequestParametersForWriting]): Release the WebDataRequestParameters object after putting it in the dictionary. 2003-07-28 John Sullivan <sullivan@apple.com> - fixed 3236815 -- bitmap TIFFs at > 72 dpi are scaled incorrectly in Safari when viewed standalone (uspto.gov) Reviewed by Darin * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer _adjustSizeToPixelDimensions]): call setScalesWhenResized:YES 2003-07-25 Richard Williamson <rjw@apple.com> Fixed 3344519. Prevent infinite recursion attempting font substitution. Reviewed by Darin. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _floatWidthForRun:style:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:startGlyph:endGlyph:numGlyphs:]): 2003-07-25 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - fixed 3280582 - REGRESSION (74-85): authentication sheet doesn't state that previous login was incorrect * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForChallenge:]): Use chall, the parameter, not challenge, the not-yet-set ivar so we get the right failure count &c. 2003-07-25 Richard Williamson <rjw@apple.com> Use 11 point bold, instead of 12 point bold to draw dragged link labels. This matches the text drawn in the bookmarks bar. Reviewed by John. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _dragImageForLinkElement:]): 2003-07-24 Richard Williamson <rjw@apple.com> Fixed 3279910. Change the way we draw dragged link to use WebKit's measurement and drawing. Also made the look match the bookmarks bar text. Reviewed by Maciej. * Misc.subproj/WebKitNSStringExtras.h: * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _web_drawDoubledAtPoint:withTopColor:bottomColor:font:]): * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _dragImageForLinkElement:]): (-[WebHTMLView _handleMouseDragged:]): 2003-07-24 Richard Williamson <rjw@apple.com> Removed unnecessary log. Reviewed by John. * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory imageRendererWithData:MIMEType:]): Add another check to use ATSU for Limbu (Unicode 4.0) script. Also made shouldUseATSU inline. * WebCoreSupport.subproj/WebTextRenderer.m: (shouldUseATSU): === Safari-90 === 2003-07-23 Maciej Stachowiak <mjs@apple.com> Build breakage fix: Fix WebKit to build with the latest Foundation. * Misc.subproj/WebNSURLExtras.h: * Misc.subproj/WebNSURLExtras.m: (-[NSURL _webkit_isJavaScriptURL]): (-[NSURL _webkit_scriptIfJavaScriptURL]): (-[NSURL _webkit_isFTPDirectoryURL]): (-[NSString _webkit_isFTPDirectoryURL]): 2003-07-23 Richard Williamson <rjw@apple.com> Fixed 3311725: Added support for key/value binding. (As a side effect also made icon loading work! In 1.0 it doesn't work unless a secret preference value is set.) Reviewed by Ken. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _createFileDatabase]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): (-[WebDataSource _setTitle:]): (-[WebDataSource _updateIconDatabaseWithURL:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): (-[WebFrame _isLoadComplete]): * WebView.subproj/WebView.m: (-[WebView setMainFrameURL:]): (-[WebView mainFrameURL]): (-[WebView isLoading]): (-[WebView mainFrameTitle]): (-[WebView mainFrameIcon]): * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _progressStarted]): (-[WebView _progressCompleted]): (-[WebView _incrementProgressForConnection:data:]): (-[WebView _completeProgressForConnection:]): (-[WebView _declaredKeys]): (-[WebView setObservationInfo:]): (-[WebView observationInfo]): (-[WebView _willChangeBackForwardKeys]): (-[WebView _didChangeBackForwardKeys]): (-[WebView _didStartProvisionalLoadForFrame:]): (-[WebView _didCommitLoadForFrame:]): (-[WebView _didFinishLoadForFrame:]): (-[WebView _didFailLoadWithError:forFrame:]): (-[WebView _didFailProvisionalLoadWithError:forFrame:]): 2003-07-23 Richard Williamson <rjw@apple.com> Fixed 3341119: Crash when content contains nil (0x0) characters. Reviewed by Ken. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _CG_drawRun:style:atPoint:]): 2003-07-23 Darin Adler <darin@apple.com> Reviewed by John. - fixed 2/3 of 3279864 -- remove class_poseAs calls from WebKit (will also remove init routine) * WebView.subproj/WebHTMLViewPrivate.m: (+[WebHTMLView load]): Only pose as NSTextView and NSWindow if we have an older AppKit. If we have a new enough AppKit, the code in WebCore now takes care of things. 2003-07-23 Richard Williamson <rjw@apple.com> Fixed for 3259840. Use ATSU for scripts we don't handle internally, i.e.: Syriac, Thaana, Devanagari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, Malayalam, Sinhala, Thai, Lao, Tibetan, Myanmar, Hangul Jamo, Khmer, Mongolian Also fixed issues with our rendering of Arabic. Changed the internal API to take WebCoreTextRun and WebCoreTextStyle parameters instead of scads on individual parameters. Much cleaner. Reviewed by Maciej. * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _web_widthWithFont:]): * Misc.subproj/WebStringTruncator.m: (stringWidth): * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (shouldUseATSU): (-[WebTextRenderer _setupFont:]): (-[WebTextRenderer dealloc]): (-[WebTextRenderer widthForCharacters:length:]): (-[WebTextRenderer drawRun:style:atPoint:]): (-[WebTextRenderer _CG_drawRun:style:atPoint:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:characterPosition:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:letterSpacing:wordSpacing:smallCaps:fontFamilies:]): (-[WebTextRenderer floatWidthForRun:style:applyRounding:attemptFontSubstitution:widths:]): (-[WebTextRenderer _floatWidthForRun:style:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:startGlyph:endGlyph:numGlyphs:]): (-[WebTextRenderer _CG_floatWidthForRun:style:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:startGlyph:endGlyph:numGlyphs:]): (-[WebTextRenderer extendCharacterToGlyphMapToInclude:]): (-[WebTextRenderer _initializeATSUStyle]): (-[WebTextRenderer _createATSUTextLayoutForRun:]): (-[WebTextRenderer _trapezoidForRun:style:atPoint:]): (-[WebTextRenderer _ATSU_floatWidthForRun:style:]): (-[WebTextRenderer _ATSU_drawRun:style:atPoint:]): 2003-07-23 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Removed dependency on Foundation NSURL_NSURLExtras file. Copied the required methods from that file to WebNSURLExtras, temporarily renaming the methods that are now in both places to have a _webkit_ prefix. The names will be changed back once every one is living on a Foundation version that no longer contains these methods. The files below were changed in one of three ways: 1. Rename _web_URLWithString: to _web_URLWithDataAsString: 2. Tweak headers to depend on WebNSURLExtras instead of NSURL_NSURLExtras. 3. At call sites, tweak names of methods that moved to WebKit (_web_ -> _webkit_). * History.subproj/WebHistory.m: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem URL]): * History.subproj/WebHistoryPrivate.m: * History.subproj/WebURLsWithTitles.m: (+[WebURLsWithTitles URLsFromPasteboard:]): * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _iconForFileURL:withSize:]): * Misc.subproj/WebIconLoader.m: * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_bestURL]): * Misc.subproj/WebNSURLExtras.h: * Misc.subproj/WebNSURLExtras.m: (ReleaseIfNotNULL): (+[NSURL _web_URLWithDataAsString:]): (+[NSURL _web_URLWithDataAsString:relativeToURL:]): (+[NSURL _web_URLWithData:]): (+[NSURL _web_URLWithData:relativeToURL:]): (-[NSURL _web_originalData]): (-[NSURL _web_displayableString]): (-[NSURL _web_URLStringLength]): (-[NSURL _webkit_canonicalize]): (-[NSURL _webkit_URLByRemovingFragment]): (-[NSURL _webkit_isJavaScriptURL]): (-[NSURL _webkit_scriptIfJavaScriptURL]): (-[NSURL _webkit_isFTPDirectoryURL]): (-[NSURL _webkit_shouldLoadAsEmptyDocument]): (isHexDigit): (hexDigitValue): (-[NSString _webkit_isJavaScriptURL]): (-[NSString _webkit_stringByReplacingValidPercentEscapes]): (-[NSString _webkit_scriptIfJavaScriptURL]): * Misc.subproj/WebNSViewExtras.m: * Panels.subproj/WebAuthenticationPanel.m: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView requestWithURLCString:]): (-[WebBaseNetscapePluginView loadPluginRequest:]): (-[WebBaseNetscapePluginView _postURLNotify:target:len:buf:file:notifyData:allowHeaders:]): * Plugins.subproj/WebNullPluginView.m: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge requestedURLString]): * WebCoreSupport.subproj/WebCookieAdapter.m: (-[WebCookieAdapter cookiesForURL:]): (-[WebCookieAdapter setCookies:forURL:policyBaseURL:]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setTitle:]): (-[WebDataSource _loadIcon]): * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): (-[WebFrame _shouldReloadForCurrent:andDestination:]): (-[WebFrame _URLsMatchItem:]): * WebView.subproj/WebFrameView.m: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementAtPoint:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient loadWithRequest:]): (-[WebMainResourceClient setDefersCallbacks:]): 2003-07-22 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2003-07-21 Ken Kocienda <kocienda@apple.com> Fixed build breaker. Removed glyphCountFromFont function. It was used only in an ERROR function, which does not compile in on deployment builds, causing a "defined, but not used warning". As this function is only a one-liner call into ATS, I replaced the usage in the ERROR call with a call to the ATS function directly. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:usingPrinterFont:]) 2003-07-18 Richard Williamson <rjw@apple.com> Fixed 3283594. "Times RO" appears to have a corrupt regular variant. Added additional bullet proofing to catch corrupt fonts. Also added a special case hack to map "Times RO" to "Time New Roman" if the variant doesn't have valid glyphs. Fixed 3319846. The page mentioned in this bug required > 10 substitute fonts for the same base font. This triggered some buggy code that hasn't been exercise before. Specifically the code that resizes the substitute fonts array was incorrect. Reviewed by mjs. * Misc.subproj/WebAssertions.h: Added FATAL_ALWAYS macro that logs and CRASHES even in deployment builds. * WebCoreSupport.subproj/WebTextRenderer.m: (mapForSubstituteFont): (widthFromMap): (FillStyleWithAttributes): (-[WebTextRenderer convertCharacters:length:toGlyphs:skipControlCharacters:]): (-[WebTextRenderer convertUnicodeCharacters:length:toGlyphs:]): (-[WebTextRenderer _computeWidthForSpace]): (-[WebTextRenderer _setupFont:]): (pathFromFont): (glyphCountFromFont): (-[WebTextRenderer initWithFont:usingPrinterFont:]): (-[WebTextRenderer extendUnicodeCharacterToGlyphMapToInclude:]): (-[WebTextRenderer extendCharacterToGlyphMapToInclude:]): 2003-07-17 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3250608 -- REGRESSION (74-85): reproducible Safari crash in blinkCaretTimerAction * WebView.subproj/WebHTMLViewPrivate.m: (-[WebNSTextView drawInsertionPointInRect:color:turnedOn:]): Use NSView's setNeedsDisplayInRect: instead of the one in NSTextView. This avoids the layout that the NSTextView version of the call might do. By definition, we don't need layout to draw the insertion point, because we did the layout to find where the insertion point should display. If we do the layout we can end up recursing into the insertion point drawing code, which wreaks major havoc. Still no idea why this happened less in version 74. 2003-07-17 Ken Kocienda <kocienda@apple.com> Reviewed by John * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge startLoadingResource:withURL:]): Now uses NSURL instead of NSString (-[WebBridge objectLoadedFromCacheWithURL:response:size:]): Ditto (-[WebBridge reportClientRedirectToURL:delay:fireDate:lockHistory:isJavaScriptFormAction:]): Ditto (-[WebBridge setIconURL:]): Ditto (-[WebBridge setIconURL:withType:]): Ditto (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Ditto (-[WebBridge userAgentForURL:]): Ditto (-[WebBridge requestedURL]): Now returns string using _web_absoluteString * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _receivedError:complete:]): Now uses NSURL instead of NSString * WebView.subproj/WebFramePrivate.m: (-[WebFrame _opened]): Ditto (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:formState:]): Ditto (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): Ditto 2003-07-17 Ken Kocienda <kocienda@apple.com> * Misc.subproj/WebNSURLExtras.m: (-[NSURL _web_URLStringLength]): Fix premature use of new CFURL API. New code is ifdef'ed out for now until everyone has revved. 2003-07-17 Ken Kocienda <kocienda@apple.com> Reviewed by Darin * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): Now uses NSURL in API instead of NSString (-[WebBridge loadURL:referrer:reload:target:triggeringEvent:form:formValues:]): Ditto (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): Ditto * WebKit.pbproj/project.pbxproj: Added WebNSURLExtras file * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady:]): Now uses NSURL in API instead of NSString 2003-07-15 Richard Williamson <rjw@apple.com> Fixed 3315952: Add support for <IMG> in attributed string conversion. Added RTFD pasteboard type. Reviewed by John. * WebView.subproj/WebHTMLViewPrivate.m: (+[WebHTMLView _pasteboardTypes]): (-[WebHTMLView _writeSelectionToPasteboard:]): 2003-07-14 Darin Adler <darin@apple.com> Reviewed by Maciej. - make some improvements to handling of the timer, inspired by some bug reports * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate dealloc]): Instead of releasing the timer, assert it is nil. (-[WebFrame _detachFromParent]): Invalidate and release the timer after finishing dealing with self, in case the reference from the timer is the last one. (-[WebFrame _timedLayout:]): Release the timer after doing all the other work, in case the reference from the timer is the last one. (-[WebFrame _setState:]): Release the timer after doing all the other work, in case the reference from the timer is the last one. 2003-07-14 Darin Adler <darin@apple.com> Rolled out workaround to bug 3298153 -- get "screen font while printing" error, bad stuff happens after that (Sherlock, Safari). It turns out the real fix was on the WebCore side. Now that we have that fix we don't need these extra calls to printerFont, which is a relatively slow call that may need to look up a font by name each time it's called. * WebCoreSupport.subproj/WebTextRenderer.m: (_drawGlyphs): Remove code to look up the printer font. 2003-07-14 Maciej Stachowiak <mjs@apple.com> Rolled in fix from Safari-89-branch 2003-07-12 Maciej Stachowiak <mjs@apple.com> Try to fix OS build by making the Frameworks link in both SYMROOT and DSTROOT, and at both build time and install time. * WebKit.pbproj/project.pbxproj: 2003-07-14 Dave Hyatt <hyatt@apple.com> Roll this change out. It was a bad change that I only made because I was using the opacity APIs wrong. Reviewed by (nobody, just a straight backout of a previous checkin) * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): 2003-07-13 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Add command to prevent build from failing if symlink creation fails. 2003-07-13 Darin Adler <darin@apple.com> Fixed symbolic link path as Matt Reda suggested. * WebKit.pbproj/project.pbxproj: Changed paths in both of Maciej's new build phases to use Versions/Current instead of Versions/A. 2003-07-13 Darin Adler <darin@apple.com> Fixed DSTROOT path as Eric Weiss suggested. * WebKit.pbproj/project.pbxproj: Changed paths in both of Maciej's new build phases. 2003-07-12 Maciej Stachowiak <mjs@apple.com> Try to fix OS build by making the Frameworks link in both SYMROOT and DSTROOT, and at both build time and install time. * WebKit.pbproj/project.pbxproj: 2003-07-11 Dave Hyatt <hyatt@apple.com> Make sure image compositing obeys the current global alpha that is in effect, e.g., if someone has set an opacity within the current layer. It's worth noting that I'm not even sure *why* this patch works, but it does, even with nested opacity layers. Reviewed by darin * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): === Safari-89 === 2003-07-10 Richard Williamson <rjw@apple.com> Fixed 3298153. Force use of printer font when printing. Reviewed by Chris. * WebCoreSupport.subproj/WebTextRenderer.m: (_drawGlyphs): 2003-07-10 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3161102>: Avoid retain cycles by destroying plug-ins in the page cache before dealloc Fixed: <rdar://problem/3320624>: WebElementImageAltStringKey is not exported :-( Unspoof freebsd since we now handle gzip'd content. Reviewed by rjw. * History.subproj/WebHistoryItem.m: (+[WebHistoryItem _destroyAllPluginsInPendingPageCaches]): new, destroys all plug-ins (+[WebHistoryItem _releaseAllPendingPageCaches]): call _destroyAllPluginsInPendingPageCaches * WebKit.exp: export WebElementImageAltStringKey * WebView.subproj/WebUserAgentSpoofTable.c: unspoof freebsd (hash): (_web_findSpoofTableEntry): * WebView.subproj/WebUserAgentSpoofTable.gperf: unspoof freebsd 2003-07-10 John Sullivan <sullivan@apple.com> Reviewed by Chris * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): fixed copy/paste error in comment that I stumbled across 2003-07-09 Richard Williamson <rjw@apple.com> Fixed 3141257. Animate multiple copies of the same image on the same page. Reviewed by hyatt. * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (+[WebImageRenderer stopAnimationsInView:]): (-[WebImageRenderer retainOrCopyIfNeeded]): (-[WebImageRenderer copyWithZone:]): (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): (-[WebImageRenderer dealloc]): (-[WebImageRenderer repetitionCount]): (-[WebImageRenderer scheduleFrame]): (-[WebImageRenderer beginAnimationInRect:fromRect:]): * WebCoreSupport.subproj/WebImageRendererFactory.h: * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory imageRendererWithMIMEType:]): (-[WebImageRendererFactory imageRendererWithData:MIMEType:]): (-[WebImageRendererFactory imageRendererWithBytes:length:MIMEType:]): 2003-07-09 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3229364>: user stylesheet path should be stored relative to home directory Reviewed by john. * Misc.subproj/WebKitNSStringExtras.h: * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _web_stringByAbbreviatingWithTildeInPath]): new, handles home directories that have symlinks in path * WebView.subproj/WebPreferences.m: (-[WebPreferences userStyleSheetLocation]): converts path string or URL string to URL (-[WebPreferences setUserStyleSheetLocation:]): converts URL to path string or URL string 2003-07-08 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3125264 -- nuke NSImage workaround when we drop Jaguar support * Misc.subproj/WebNSImageExtras.m: Removed the workaround. - removed other Jaguar-specific code * WebCoreSupport.subproj/WebImageRenderer.m: Remove workaround for improper handling of GIF animation loops with no loop counting, bug 3090341. * WebView.subproj/WebHTMLViewPrivate.m: Remove workaround for problem extracting scroll wheel events without also getting all others, which caused jumping around if you used the scroll wheel while moving the mouse, bug 3245425. * Misc.subproj/WebKitErrorsPrivate.h: Remove Jaguar-only import of <NSError.h>. * Plugins.subproj/WebNetscapePluginPackage.m: Remove Jaguar-only side of #if. * Plugins.subproj/WebNetscapePluginRepresentation.m: Remove Jaguar-only import of <NSError.h>. * WebKit/Plugins.subproj/WebPluginPackage.m: Remove unnecessary import of <NSError.h>. * Plugins.subproj/WebPluginPackage.m: Remove Jaguar-only side of #if. * WebCoreSupport.subproj/WebSubresourceClient.m: Remove Jaguar-only import of <NSError.h>. * WebView.subproj/WebDefaultFrameLoadDelegate.m: Remove Jaguar-only import of <NSError.h>. * WebView.subproj/WebImageRepresentation.m: Remove Jaguar-only import of <NSError.h>. * WebKit/English.lproj/StringsNotToBeLocalized.txt: Updated for this and other recent changes. 2003-07-08 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3134494>: no progressive loading for standalone images Fixed: <rdar://problem/3280633>: exception raised (attempt to create array with nil element) when dragging image out of HTML Reviewed by rjw. * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragPromisedImage:rect:URL:title:event:]): don't take a file type since this can now be gotten from the image * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer _adjustSizeToPixelDimensions]): new method that rjw factored from incrementalLoadWithBytes::: (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): call _adjustSizeToPixelDimensions so we have the correct image size as the image loads (-[WebImageRenderer MIMEType]): new accessor * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _handleMouseDragged:]): use renamed _web_dragPromisedImage * WebView.subproj/WebImageRepresentation.h: * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation doneLoading]): new (-[WebImageRepresentation setDataSource:]): create the image here (-[WebImageRepresentation receivedData:withDataSource:]): pass data to image (-[WebImageRepresentation receivedError:withDataSource:]): complete image loading (-[WebImageRepresentation finishedLoadingWithDataSource:]): complete image loading * WebView.subproj/WebImageView.h: * WebView.subproj/WebImageView.m: (-[WebImageView initWithFrame:]): call setAutoresizingMask so setFrameSize is called often enough (-[WebImageView dealloc]): tweak (-[WebImageView haveCompleteImage]): new (-[WebImageView drawingRect]): new (-[WebImageView drawRect:]): fill white then draw the image so we never show the previous page (-[WebImageView setFrameSizeUsingImage]): new, ensures that the view always fills the content area (so we draw over the previous page) and that the view is at least as large as the image. (-[WebImageView setFrameSize:]): call setFrameSizeUsingImage (-[WebImageView layout]): call setFrameSizeUsingImage (-[WebImageView setDataSource:]): store the rep (-[WebImageView dataSourceUpdated:]): call setNeedsLayout and setNeedsDisplay (-[WebImageView viewDidMoveToWindow]): tweak (-[WebImageView validateUserInterfaceItem:]): only allow copy if haveCompleteImage (-[WebImageView writeImageToPasteboard:]): only writeImageToPasteboard if haveCompleteImage (-[WebImageView writeSelectionToPasteboard:types:]): tweak (-[WebImageView menuForEvent:]): tweak (-[WebImageView mouseDragged:]): only allow drag if haveCompleteImage (-[WebImageView namesOfPromisedFilesDroppedAtDestination:]): tweak 2003-07-08 Dave Hyatt <hyatt@apple.com> Change minimum font size pref value back to 9. This change has been made in conjunction with associated WebCore changes that allow us to institute a minimum font size safely without the need for a visible GUI pref. Reviewed by darin * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): 2003-07-07 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - fixed 3295916 - b/c JavaScriptCore and WebCore are installing in wrong location, private headers are public * WebKit.pbproj/project.pbxproj: Make a link from Frameworks to Versions/A/Frameworks. === Safari-88 === 2003-07-07 Darin Adler <darin@apple.com> Reviewed by Dave. - fix compile error from B&I Panther build; really, this time * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer extendUnicodeCharacterToGlyphMapToInclude:]): Use unsigned, not int. (-[WebTextRenderer extendCharacterToGlyphMapToInclude:]): Ditto. 2003-07-06 Darin Adler <darin@apple.com> - fix compile error from B&I Panther build * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer extendUnicodeCharacterToGlyphMapToInclude:]): Rearrange code so that we won't get a warning if numGlyphs type is either signed or unsigned. We don't want to depend on the new ATS headers or the old ones; this is compatible with both. (-[WebTextRenderer extendCharacterToGlyphMapToInclude:]): Ditto. 2003-07-03 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebImageRenderer.m: Remove obsolete comment. 2003-07-03 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3206011>: Don't accepts drags when showing dialogs or sheets Reviewed by john. * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragOperationForDraggingInfo:]): 2003-07-03 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3291566>: Aborting standalone image load makes image directory page unusable Reviewed by john. * WebKit.pbproj/project.pbxproj: Xcode-ified WebKit.pbproj * WebView.subproj/WebImageView.h: * WebView.subproj/WebImageView.m: (-[WebImageView drawRect:]): layout if we need to, fill with white if we don't have an image yet (-[WebImageView setNeedsLayout:]): set the bit (-[WebImageView layout]): if we don't have an image, the frame size is the visible area so we draw white over the previous web page 2003-07-02 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. - fixed 3304992 - REGRESSION: Every GET on an authenticated site requires a login (genentech) I fixed this by adding a per-window queue of waiting authentication requests. Before going to a later item in the queue, the auth handler checks if there's already a credential available to handle it, and if so uses that as the answer instead of prompting. * Panels.subproj/WebPanelAuthenticationHandler.h: * Panels.subproj/WebPanelAuthenticationHandler.m: (-[NSMutableDictionary _web_setObject:forUncopiedKey:]): (-[WebPanelAuthenticationHandler init]): (-[WebPanelAuthenticationHandler dealloc]): (-[WebPanelAuthenticationHandler enqueueChallenge:forWindow:]): (-[WebPanelAuthenticationHandler tryNextChallengeForWindow:]): (-[WebPanelAuthenticationHandler startAuthentication:window:]): (-[WebPanelAuthenticationHandler _authenticationDoneWithChallenge:result:]): 2003-06-30 John Sullivan <sullivan@apple.com> - fixed 3310716 -- Authentication dialog could be tweaked to better match guidelines Reviewed by Chris * Panels.subproj/English.lproj/WebAuthenticationPanel.nib: left-aligned "Name:" and "Password:" labels; slightly tweaked layout at right edge of sheet 2003-06-26 Chris Blumenberg <cblu@apple.com> Changes to make WebKit compile with gcc 3.3. Reviewed by darin. * Carbon.subproj/HIWebView.m: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setScrollbarsVisible:]): (-[WebBridge loadURL:referrer:reload:target:triggeringEvent:form:formValues:]): (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): * WebView.subproj/WebPreferences.m: (-[WebPreferences setDefaultFontSize:]): (-[WebPreferences setDefaultFixedFontSize:]): (-[WebPreferences setMinimumFontSize:]): * WebView.subproj/WebView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): 2003-06-24 Chris Blumenberg <cblu@apple.com> Renamed the context menu item Download Image To Disk" to "Download Image to Disk". Reviewed by john. * English.lproj/Localizable.strings: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate menuItemWithTag:]): 2003-06-19 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3294803>: HTTP error sent as content instead of error to plug-ins Reviewed by john. * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginConnectionDelegate connection:didReceiveResponse:]): if the response is an error, cancel the load, return a network error === Safari-85.1 === 2003-06-15 Vicki Murley <vicki@apple.com> Reviewed by darin. * WebKit.pbproj/project.pbxproj: remove SECTORDER_FLAGS variable, so that we don't use order file for our Panther submission === Safari-85 === 2003-06-13 Darin Adler <darin@apple.com> Reviewed by Darin (Richard wrote the first cut), then Don and Dave. - fixed 3291467 -- CARBON: context menus are broken when using WebKit from Carbon * Carbon.subproj/HIWebView.m: (ContextMenuClick): Rewrite method to create a fake right mouse up event, and pass that to menuForEvent: and _popUpMenuWithEvent. 2003-06-13 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed 3291778 -- REGRESSION (51-52): QT controller never shows up for mp3 in frame * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): Handle the "invisible" plug-in cases in a more complete way. Detect the various ways of being invisible (big negative X value, 0 size, not really in a window) and in all those cases, use a clip rect to guarantee we won't be seen, and make sure the size passed to the plug-in is *not* 0. * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2003-06-13 David Hyatt <hyatt@apple.com> Fix for 3291319, scrolling is much worse since 79. The problem was a fix for resize events that needed to use the scrollview size and not the document view size inside the scrollview. Reviewed by darin * WebView.subproj/WebHTMLView.m: (-[WebHTMLView layoutToPageWidth:]): * WebView.subproj/WebHTMLViewPrivate.h: 2003-06-13 Chris Blumenberg <cblu@apple.com> Fixed previous " Reviewed by" string. * ChangeLog: 2003-06-13 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3291502>: REGRESSION (80-81): freebsd.org is giving us gzipped content (because we stopped spoofing) Reviewed by john. * WebView.subproj/WebUserAgentSpoofTable.c: (hash): (_web_findSpoofTableEntry): * WebView.subproj/WebUserAgentSpoofTable.gperf: 2003-06-12 Richard Williamson <rjw@apple.com> Restoring fix for 3221078 that I earlier backed out in a panic about performance. In careful performance testing I now see no performance regression, and maybe a tiny improvement. The earlier performance regression Vicki saw was entirely due to the incorrect checkin for the fix to 3288532. Reviewed by Chris & Gramps. * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: 2003-06-12 Richard Williamson <rjw@apple.com> Correct fix for 3288532 again. This time will feeling! Reviewed by Gramps. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList setCapacity:]): 2003-06-12 Don Melton <gramps@apple.com> Since Richard didn't actually correct the fix for 3288532 in WebBackForwardList.m, I've backed out out his original fix entirely. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList setCapacity:]): 2003-06-12 Richard Williamson <rjw@apple.com> Correct fix for 3288532. * History.subproj/WebBackForwardList.m: 2003-06-12 Richard Williamson <rjw@apple.com> Fixed 3288532. When setCapacity: shrinks capacity, trim the back/forward list. Setting to zero will effectively flush the list. Reviewed by John. * History.subproj/WebBackForwardList.m: 2003-06-12 Richard Williamson <rjw@apple.com> Fixed 3221078. Maintain a seperate width map for substitute fonts to avoid collision of glyph codes. Reviewed by Chris & Gramps. * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: === Safari-84 === 2003-06-12 Darin Adler <darin@apple.com> Fixed by Richard, reviewed by me. - fixed 3289047 -- REGRESSION: can't go back after using form at attwireless.com * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportClientRedirectToURL:delay:fireDate:lockHistory:isJavaScriptFormAction:]): Added isJavaScriptFormAction parameter, passed on to frame. * WebView.subproj/WebFramePrivate.h: Added isJavaScriptFormAction parameter. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _clientRedirectedTo:delay:fireDate:lockHistory:isJavaScriptFormAction:]): If isJavaScriptFormAction is YES, then don't treat this is a "quick redirect" which is merged with the previous page for purposes of back/forward. 2003-06-11 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3289577>: Reenable Carbon Java plug-ins when in Carbon app Reviewed by gramps. * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): only call canUsePlugin: for web plug-ins 2003-06-11 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3289380>: REGRESSION: policyDataSource == nil assertion failure after closing particular window Reviewed by john. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueAfterNavigationPolicy:]): don't clear policyDataSource here because this method may not be called during navigation (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): clear policyDataSource here 2003-06-11 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3288097>: REGRESSION: assertion failure after hitting back while loading page after fragment scroll Fixed by darin, reviewed by me. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _URLsMatchItem:]): ignore the URL fragment so we scroll back at the current page instead of attempt to load the current page 2003-06-11 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3285808 -- repro world leak when replacing div that contains iframe (at www.kbs.co.kr) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge frameDetached]): Add a call to _detachFromParent. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _removeChild:]): Nil out the parent pointer in the removed child. 2003-06-10 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3288076>: REGRESSION: Fragment scroll stops page load We do policy navigation checks for the regular load case, fragment scroll and redirects. We only want to stop the load, change the provisional data source etc in the regular load case. Reviewed by darin. * WebView.subproj/WebFramePrivate.m: got rid of _prepareForProvisionalLoadWithDataSource:: since the work done in this method only needs to be done in _continueLoadRequestAfterNavigationPolicy:: (which covers the regular load case). (-[WebFrame _invalidatePendingPolicyDecisionCallingDefaultAction:]): don't clear policyDataSource because it needs to be called in _continueLoadRequestAfterNavigationPolicy:: (-[WebFrame _setPolicyDataSource:]): new (-[WebFrame _checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): don't call _prepareForProvisionalLoadWithDataSource::, don't muck with policyDataSource because it is only needed in the regular load case (-[WebFrame _continueAfterNavigationPolicy:]): don't call _prepareForProvisionalLoadWithDataSource::, call _setPolicyDataSource:nil after _continueLoadRequestAfterNavigationPolicy:: has used policyDataSource (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): this method covers the regular load case. This is where we need to stop the load, set the load type and the provisional data source. Code was in _prepareForProvisionalLoadWithData Source:: (-[WebFrame _loadDataSource:withLoadType:formState:]): set the policyLoadType and policyDataSource (the beginning of the regular load case) 2003-06-10 Richard Williamson <rjw@apple.com> Back out incorrect fix to 3287862. 2003-06-10 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3156169>: cmd-click opens new win but stops loading in prev win Reviewed by rjw. * WebView.subproj/WebFrame.m: (-[WebFrame stopLoading]): set the provisional data source to nil to avoid a newly added assert in [WebFramePrivate setProvisionalDataSource:] and since it is wasteful to retain it in this case * WebView.subproj/WebFramePrivate.h: added policyDataSource and policyLoadType ivars * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate dealloc]): added an assert (-[WebFramePrivate setProvisionalDataSource:]): added an assert (-[WebFrame _isLoadComplete]): formatting tweak (-[WebFrame _invalidatePendingPolicyDecisionCallingDefaultAction:]): reset policyDataSource (-[WebFrame _checkNewWindowPolicyForRequest:action:frameName:formState:andCall:withSelector:]): formatting tweak (-[WebFrame _prepareForProvisionalLoadWithDataSource:loadType:]): new, calls stopLoading, _setLoadType and _setProvisionalDataSource (-[WebFrame _checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): call _prepareForProvisionalLoadWithDataSource:loadType: only in the "use" policy case (-[WebFrame _continueAfterNavigationPolicy:]): call _setProvisionalDataSource:andLoadType: (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:formState:]): formatting tweak (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): formatting tweak (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): if there is no request to continue with, don't reset things like the provisional data source since it was never unset in this case (-[WebFrame _loadDataSource:withLoadType:formState:]): don't call stopLoading, _setLoadType and _setProvisionalDataSource, since that stops the frame even for command-click and option-click. Do this work in _prepareForProvisionalLoadWithDataSource :loadType: instead. 2003-06-10 Richard Williamson <rjw@apple.com> Fixed 3287862. Don't override resize flags when decoding WebView. Reviewed by Chris. * WebView.subproj/WebView.m: (-[WebView _commonInitializationFrameName:groupName:]): 2003-06-10 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3286006>: Carbon Java plug-in problems may require workaround in WebKit Reviewed by john. * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase canUsePlugin:]): if in a carbon app, only use the mach-o java plug-in when its version is anything but 1.0.0 (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): call canUsePlugin on all the plug-ins 2003-06-10 Vicki Murley <vicki@apple.com> Reviewed by john. * WebKit.order: new order file for 1.0 2003-06-09 Chris Blumenberg <cblu@apple.com> * WebView.subproj/WebDataSource.h: Removed FIXME related to pageTitle. 2003-06-09 Chris Blumenberg <cblu@apple.com> <rdar://problem/3283359>: don't load Cocoa Java plug-in if in Carbon app Reviewed by darin. * Plugins.subproj/WebPluginDatabase.h: removed pluginForFilename, wasn't being used * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): don't use the plug-in if ![self isCocoa] && [[[webPlugin bundle] bundleIdentifier] isEqualToString:JavaCocoaPluginIdentifier] 2003-06-09 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3284848>: REGRESSION: repro crash in Flash handling null event, going back to Japanese Disney page When restarting plug-ins from the BF cache, we were not calling NPP_SetWindow. Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView stop]): set the window type to 0 to force the calling of NPP_SetWindow === Safari-83 === 2003-06-07 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2003-06-07 Darin Adler <darin@apple.com> Rolled out Chris's fix for 3156169 because it was causing a lot of crashes and problems with basic behavior. We can try again later. One of the problems was that Back wasn't working. Another was that you could not follow the link at the top of the page at kbb.com. More testing seemed to reveal still more problems. * WebView.subproj/WebFramePrivate.h: Rolled back to previous version. * WebView.subproj/WebFramePrivate.m: Ditto. 2003-06-06 Richard Williamson <rjw@apple.com> Fixed 3283236. Remove use of forward declarations in public header because CodeWarrior pukes on 'em. Reviewed by Chris. * WebView.subproj/WebDataSource.h: 2003-06-06 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3156169>: cmd-click opens new win but stops loading in prev win Reviewed by darin. * WebView.subproj/WebFramePrivate.h: added policyDataSource and policyLoadType as ivars * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate dealloc]): added ASSERT (-[WebFramePrivate setProvisionalDataSource:]): added ASSERT (-[WebFrame _isLoadComplete]): formatting tweak (-[WebFrame _invalidatePendingPolicyDecisionCallingDefaultAction:]): clear policyDataSource (-[WebFrame _checkNewWindowPolicyForRequest:action:frameName:formState:andCall:withSelector:]): formatting tweak (-[WebFrame _checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): retain policyDataSource (-[WebFrame _continueAfterNavigationPolicy:]): stop the load, set the load type, set the provisional data source in the "use" case (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): formatting tweak (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): don't reset things if something other than "use" has been chosen (-[WebFrame _loadDataSource:withLoadType:formState:]): DON'T stop the load, set the load type, set the provisional data source 2003-06-06 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3282881>: Java plugin fails in carbon WebKit apps Fixed by Mike Hay, reviewed by me. * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase initIsCocoa]): (-[WebPluginDatabase isCocoa]): (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): don't load cocoa plug-ins if isCocoa. 2003-06-05 John Sullivan <sullivan@apple.com> - fixed 3266216 -- repro crash in -[WebBaseResourceHandleDelegate connection:didReceiveData:] in GIA Application The problem was that an NSURLConnection delegate object (in this case a WebMainResourceClient) was being dealloc'ed during one of its connection delegate methods. To prevent this kind of problem, I added [self retain]/[self release] guards around the meat of all of the connection delegate methods in which arbitrary code could be run. Another approach would be to do this retain/release pair in NSURLConnection, but Darin deemed it wiser not to muck with Foundation at this point for this issue. Reviewed by Darin * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginConnectionDelegate connection:didReceiveResponse:]): guard with [self retain]/[self release] (-[WebNetscapePluginConnectionDelegate connection:didReceiveData:]): ditto (-[WebNetscapePluginConnectionDelegate connection:didFailWithError:]): ditto * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient connection:didReceiveResponse:]): ditto (-[WebSubresourceClient connection:didReceiveData:]): ditto * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): ditto (-[WebBaseResourceHandleDelegate connection:didReceiveAuthenticationChallenge:]): ditto (-[WebBaseResourceHandleDelegate connection:didCancelAuthenticationChallenge:]): ditto (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): ditto (-[WebBaseResourceHandleDelegate connection:didReceiveData:]): ditto. Also, commented out two assertions that fire illegitimately in the steps in this bug report. (-[WebBaseResourceHandleDelegate connection:didFailWithError:]): ditto * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient connection:willSendRequest:redirectResponse:]): ditto (-[WebMainResourceClient connection:didReceiveResponse:]): ditto (-[WebMainResourceClient connection:didReceiveData:]): ditto 2003-06-04 Richard Williamson <rjw@apple.com> Fixed 3277775. Send less notifications. Notifcations suck! Reviewed by David. * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebViewPrivate init]): (-[WebView _progressStarted]): (-[WebView _progressCompleted]): (-[WebView _incrementProgressForConnection:data:]): 2003-06-04 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3277675 -- REGRESSION: mouse wheel events not coalesced * WebView.subproj/WebHTMLViewPrivate.m: (-[WebNSWindow nextEventMatchingMask:untilDate:inMode:dequeue:]): When the mask is scroll wheel mask, instead of getting no events, do some tricks to get the next event if it is a scroll wheel event, and nothing otherwise. Also ifdef the fix so we don't compile it on Panther, since the underlying bug was fixed on Panther. - other changes * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer copyWithZone:]): Remove unneeded line of code. The super function copies all simple fields for us. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView setMIMEType:]): Use copy instead of retain, do it in the right order to avoid "same object release/retain" disease. (-[WebBaseNetscapePluginView setBaseURL:]): Do retain before release (same reason as above). 2003-06-03 Chris Blumenberg <cblu@apple.com> Fixed: 3278496 - <rdar://problem/3278496>: NSURLDownload: initWithSource and source should be renamed to initWithRequest and request Reviewed by rjw. * Misc.subproj/WebDownload.m: (-[WebDownload initWithRequest:delegate:]): (-[WebDownload _initWithRequest:delegate:directory:]): * WebView.subproj/WebImageView.m: (-[WebImageView setNeedsDisplay:]): * WebView.subproj/WebViewPrivate.m: (-[WebView _downloadURL:toDirectory:]): 2003-06-03 Richard Williamson <rjw@apple.com> Fixed 3263188, 3274636. Written by Ed Voas. Reviewed by Richard. * Carbon.subproj/CarbonUtils.m: (WebInitForCarbon): Ensure the process info is correctly initialized so the correct "flavour" (carbon) is detected. * Carbon.subproj/HIWebView.m: (Draw): Always draw the growbox after drawing the web view, assuming overlap. === Safari-82 === 2003-06-03 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3167792>: hang in _web_dragPromisedImage dragging 4 MB image Reviewed by john. * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragPromisedImage:rect:URL:fileType:title:event:]): if the original image is greater than 1500x1500, use a file icon for the drag image to avoid hanging 2003-06-02 Richard Williamson <rjw@apple.com> Fix for 3250352. Reviewed by Chris. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): Check respondsToSelector: before calling. * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebUIDelegate.h: Headerdoc tweaks. === Safari-81 === 2003-06-02 Chris Blumenberg <cblu@apple.com> Fixed: <rdar://problem/3154910>: No video when viewing QT plug-in content at some pages but audio works This fix works around QT plug-in bug 3275755, but I think the fix is logical and worth keeping even after 3275755 is fixed. Eric Carlson: The problem happens when you call NPP_SetWindow with a 0 width or height more than once. The first call to NPP_SetWindow always seems to have width and height set to 0, but the next call sometimes has it set to the correct values (those in the EMBED tag) . This is when it draws successfully. It seems to me that the fix is to always pass the correct width and height to NPP_SetWindow. You always position the plug-in far offscreen (1000000, -52) and set the clip region to an empty rect (48576, 52, 48576, 52) so there isn't really any danger of the plug-in drawing anyway. Additionally, you pass the correct width and height in the call to NPP_New before the first call to NPP_SetWindow. Reviewed by john, darin. * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): use the NSView width and height if greater than 0, else use the tag specified width and height (-[WebBaseNetscapePluginView isNewWindowEqualToOldWindow]): new (-[WebBaseNetscapePluginView setWindow]): NPP_SetWindow may be expensive, only call it if it has changed * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage launchRealPlayer]): tweak, no need to store error code since it is ignored 2003-05-30 Richard Williamson <rjw@apple.com> Fixed 3272516. Items are now expired from the b/f cache if they are older than 30 minutes. This number was pulled out of our #!$es. Also did some cleanup of the b/f cache code. Reviewed by Ken. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge saveDocumentToPageCache:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): (-[WebFrame _createPageCacheForItem:]): (-[WebFrame _setState:]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): (-[WebPreferences _resourceTimedLayoutEnabled]): (-[WebPreferences _backForwardCacheExpirationInterval]): * WebView.subproj/WebPreferencesPrivate.h: * WebView.subproj/WebView.h: * WebView.subproj/WebPreferences.h: Cleaned up some headerdoc comments. 2003-05-29 Richard Williamson <rjw@apple.com> Implemented 'estimatedProgress' method on WebView. This should eventually replace the broken algorithm on WebBrowser. Maybe for panther. Reviewed by Chris. * WebKit.exp: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): (-[WebBaseResourceHandleDelegate connection:didReceiveData:]): (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): (-[WebBaseResourceHandleDelegate connection:didFailWithError:]): (-[WebBaseResourceHandleDelegate cancelWithError:]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _isLoadComplete]): (-[WebFrame _numPendingOrLoadingRequests:]): * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView estimatedProgress]): * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebViewPrivate dealloc]): (-[WebView _isPerformingProgrammaticFocus]): (-[WebView _progressStarted]): (-[WebView _progressCompleted]): (-[WebView _incrementProgressForConnection:data:]): (-[WebView _completeProgressForConnection:]): Code cleanup. Moved variable initialization into block that check for non-nil self. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer initWithMIMEType:]): (-[WebImageRenderer initWithData:MIMEType:]): (-[WebImageRenderer initWithContentsOfFile:]): 2003-05-29 Richard Williamson <rjw@apple.com> Fixed 3272226. The shared image factory was being released when any renderer had 0 reps! Reviewed by John. * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory imageRendererWithMIMEType:]): 2003-05-29 Chris Blumenberg <cblu@apple.com> Fixed: 3151216 - Safari crashes on Drag&Drop if plugin dialog is open Reviewed by rjw. * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragOperationForDraggingInfo:]): return NSDragOperationNone is the app has a modal window so the current page can't be changed with a drag * WebView.subproj/WebView.m: (-[WebView draggingEntered:]): return _web_dragOperationForDraggingInfo 2003-05-29 Chris Blumenberg <cblu@apple.com> Fixed: 3273109 - leak from functionPointerForTVector in -[WebNetscapePluginPackage load] * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): free the main function after using it 2003-05-29 Richard Williamson <rjw@apple.com> Fixed 3273115. Always use pixel dimensions, not absolute dimensions. Reviewed by Ken. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): 2003-05-29 Richard Williamson <rjw@apple.com> Fix 3272292. Ensure that loadStatus is always initialized to NSImageRepLoadStatusUnknownType. Reviewed by Chris. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer initWithMIMEType:]): (-[WebImageRenderer initWithData:MIMEType:]): (-[WebImageRenderer initWithContentsOfFile:]): 2003-05-28 Ken Kocienda <kocienda@apple.com> Reviewed by Richard Fix for this bug: Radar 3260323 (Some links at nike.com cause assertion failure (connectionDidFinishLoading sent after cancel)) Added a flag which is set when a load is cancelled. This flag prevents bad behvior when loads that finish cause the load itself to be cancelled (which could happen with a javascript that changes the window location). This is used to prevent both the body of cancelWithError: and the body of connectionDidFinishLoading: running for a single delegate. Cancelling wins. * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): (-[WebBaseResourceHandleDelegate cancelWithError:]): 2003-05-28 Chris Blumenberg <cblu@apple.com> Fixed: 3270576 - RealPlayer plug-in fails to load Reviewed by darin. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage launchRealPlayer]): new (-[WebNetscapePluginPackage load]): call launchRealPlayer to regenerate its broken plist file 2003-05-28 Richard Williamson <rjw@apple.com> Fixed 3165631 (and other similar). Fixed 3262592. We now set NSImage's cache mode to NSImageCacheNever during progressive loads. It gets reset to NSImageCacheDefault when loads complete. If an image is scaled, NSImage appears to create a NSCacheImageRep with the wrong size during progessive image loading. Specifically it appears to create a cached rep with the original size. Reviewed by Chris. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory imageRendererWithMIMEType:]): * WebView.subproj/WebPreferences.h: Updated headerdoc comments. 2003-05-27 Chris Blumenberg <cblu@apple.com> Fixed: 3233442 - Crash in -[WebNetscapePluginPackage load] at http://www.adultswim.com/ Reviewed by mjs. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): don't call NPP_Shutdown if the plug-in fails to load 2003-05-27 Chris Blumenberg <cblu@apple.com> Don't load and save icons if the icon DB directory default is not set. Reviewed by darin. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _createFileDatabase]): don't create the DB if the default is not set (-[WebIconDatabase _loadIconDictionaries]): don't load the dictionaries if the DB doesn't exist (-[WebIconDatabase _updateFileDatabase]): don't update the DB if it doesn't exist * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): don't load icons if the icon DB directory default is not set 2003-05-27 Maciej Stachowiak <mjs@apple.com> Rolled in fix from Safari-80~1-branch 2003-05-27 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. * WebKit.pbproj/project.pbxproj: Removed no longer needed and harmful flag. 2003-05-27 Richard Williamson <rjw@apple.com> Fix for IB. Reviewed by Eric Seymour. * WebView.subproj/WebPreferences.m: (-[WebPreferences initWithIdentifier:]): Added retain to uniqued instance. (As we did recently for initWithCoder:). 2003-05-27 Chris Blumenberg <cblu@apple.com> Fixed: 3270013 - Exception raised when visiting http://www.shutterfly.com/favicon.ico Reviewed by john. * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory imageRendererWithBytes:length:MIMEType:]): return nil if the image has no representations 2003-05-27 Chris Blumenberg <cblu@apple.com> Fixed: 3242864 - repro assertion failure in WebIconDatabase.m for www.shutterfly.com Reviewed by john. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader connectionDidFinishLoading:]): don't set the icon on the DB if it has no representations 2003-05-27 Richard Williamson <rjw@apple.com> Fixes for IB. Reviewed by Eric Seymour. * WebView.subproj/WebPreferences.m: (-[WebPreferences initWithCoder:]): Added retain to uniqued instance * WebView.subproj/WebView.m: (-[WebView initWithCoder:]): (-[WebView setPreferences:]): Added release check to global uniquing dictionary. 2003-05-23 Richard Williamson <rjw@apple.com> Tweaks for IB. Updated WebView and WebPreferences to use keyed archiving. Added private method to export settable user defaults keys. Reviewed by Ken. * WebView.subproj/WebPreferences.m: (-[WebPreferences initWithCoder:]): (+[WebPreferences _userDefaultsKeysForIB]): * WebView.subproj/WebPreferencesPrivate.h: * WebView.subproj/WebView.m: (-[WebView initWithCoder:]): 2003-05-23 Richard Williamson <rjw@apple.com> Added export of _WebHistoryItemChangedNotification. * WebKit.exp: 2003-05-23 Chris Blumenberg <cblu@apple.com> Fixed: 3259426 - Can't copy mailto links to clipboard Reviewed by john. * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): offer "Copy Link to Clipboard" for all links 2003-05-22 Richard Williamson <rjw@apple.com> *** Public API change *** 100% compatible. Added notification when history items change values. Fixed 3265672 Reviewed by John. * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem setAlternateTitle:]): (-[WebHistoryItem setURL:]): (-[WebHistoryItem setOriginalURLString:]): (-[WebHistoryItem setTitle:]): (-[WebHistoryItem _setLastVisitedTimeInterval:]): 2003-05-22 Richard Williamson <rjw@apple.com> Fixed 3266464. Build problem on panther caused by overly pedantic gcc. Reviewed by John. * WebView.subproj/WebPreferences.m: (-[WebPreferences initWithCoder:]): * WebView.subproj/WebView.m: (-[WebView initWithCoder:]): 2003-05-22 Richard Williamson <rjw@apple.com> Add _web to method in category name. Fixed 3266102. @selector missing ":". Reviewed by Darin. * WebView.subproj/WebPreferences.m: (+[WebPreferences _removeReferenceForIdentifier:]): (-[NSMutableDictionary _web_checkLastReferenceForIdentifier:]): 2003-05-22 Darin Adler <darin@apple.com> Reviewed by John. - removed all entries except for jaguar.com because: a) most of these sites now work fine without the spoofing or have gone away b) nj.com and oregonlive.com do not work, but the spoofing committee (Mark, Don, Dave, and me) decided we should stop spoofing and get them to fix the sites instead If we can resolve jaguar.com in a similar way, we can remove the spoofing feature altogether. * WebView.subproj/WebUserAgentSpoofTable.gperf: Removed all but jaguar.com. * WebView.subproj/WebUserAgentSpoofTable.c: Regenerated. 2003-05-21 Richard Williamson <rjw@apple.com> *** Public API Change *** The fix for 3265442 requires new API. This API is an addition that is 100% compatible with the existing API. Provide support for IB to palettize WebView. Fixed 3265442. Fixed 3263106. Reviewed by Chris. * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (-[WebPreferencesPrivate dealloc]): (-[WebPreferences init]): (-[WebPreferences initWithIdentifier:]): (-[WebPreferences initWithCoder:]): (-[WebPreferences encodeWithCoder:]): (+[WebPreferences standardPreferences]): (-[WebPreferences dealloc]): (-[WebPreferences identifier]): (-[WebPreferences _stringValueForKey:]): (-[WebPreferences _setStringValue:forKey:]): (-[WebPreferences _integerValueForKey:]): (-[WebPreferences _setIntegerValue:forKey:]): (-[WebPreferences _boolValueForKey:]): (-[WebPreferences _setBoolValue:forKey:]): (-[WebPreferences autosaves]): (+[WebPreferences _getInstanceForIdentifier:]): (+[WebPreferences _setInstance:forIdentifier:]): (+[WebPreferences _removeReferenceForIdentifier:]): (-[WebPreferences _postPreferencesChangesNotification]): (-[NSMutableDictionary _checkLastReferenceForIdentifier:]): * WebView.subproj/WebPreferencesPrivate.h: * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView _commonInitializationFrameName:groupName:]): (-[WebView initWithCoder:]): (-[WebView encodeWithCoder:]): (-[WebView dealloc]): (-[WebView setPreferencesIdentifier:]): (-[WebView preferencesIdentifier]): 2003-05-21 Chris Blumenberg <cblu@apple.com> Fixed data source leak when viewing standalone plug-in content. Reviewed by rjw. * Plugins.subproj/WebBaseNetscapePluginStream.h: don't inherit from WebBaseResourceHandleDelegate * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream transferMode]): new * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation dealloc]): don't release the data source (-[WebNetscapePluginRepresentation setDataSource:]): don't retain the data source * Plugins.subproj/WebNetscapePluginStream.h: * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:]): create a WebNetscapePluginConnectionDelegate (-[WebNetscapePluginStream dealloc]): release the WebNetscapePluginConnectionDelegate (-[WebNetscapePluginStream start]): start the load on the WebNetscapePluginConnectionDelegate (-[WebNetscapePluginStream stop]): start the load on the WebNetscapePluginConnectionDelegate (-[WebNetscapePluginConnectionDelegate initWithStream:view:]): new class, inherits from WebBaseResourceHandleDelegate (-[WebNetscapePluginConnectionDelegate _releaseResources]): (-[WebNetscapePluginConnectionDelegate connection:didReceiveResponse:]): (-[WebNetscapePluginConnectionDelegate connection:didReceiveData:]): (-[WebNetscapePluginConnectionDelegate connectionDidFinishLoading:]): (-[WebNetscapePluginConnectionDelegate connection:didFailWithError:]): (-[WebNetscapePluginConnectionDelegate cancel]): * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate response]): new 2003-05-21 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - fixed 3254473 - REGRESSION: nike help page reloads on mouseovers, triggered by onresize function REGRESSION: reload loop due to onresize handler (fortune.com, flipdog.com, stanford.edu) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView layoutToPageWidth:]): Go back to checking for at least one layout instead of last layout event time. Measure size in a way that ignores whether the scrollbares are there or not. * WebView.subproj/WebHTMLViewPrivate.h: Remove last layout event time and add back laid out at least once boolean. 2003-05-21 Chris Blumenberg <cblu@apple.com> These problems: 3184359 - icon exception closing window while typing 3245476 - Safari-78 crashes or hangs after IMDB Find and using the history menu to go back ... are not or are no longer reproducible. They were caused by an exception raised in WebKit. Since we don't use exceptions in WebKit, I've replaced the exception with an assert. Reviewed by john. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _releaseFutureIconForURL:]): assert instead of exception if failure 2003-05-21 Ed Voas <voas@apple.com> - fixed 3262868: Update Carbon WebKit API prefixes - fixed 3264980: Carbon support in WebKit needs to route mouse events properly Reviewed by Richard. * Carbon.subproj/CarbonUtils.h: * Carbon.subproj/CarbonUtils.m: (WebInitForCarbon): (WebConvertNSImageToCGImageRef): * Carbon.subproj/HIWebView.h: * Carbon.subproj/HIWebView.m: (HIWebViewGetWebView): (OwningWindowChanged): (WindowHandler): (HIWebViewEventHandler): * WebKit.exp: 2003-05-21 Vicki Murley <vicki@apple.com> Reviewed by john - fixed 3234553: Safari and its frameworks should link using order files * WebKit.order: Added. * WebKit.pbproj/project.pbxproj: set SECTORDER_FLAGS = -sectorder __TEXT __text WebKit.order; 2003-05-20 Richard Williamson <rjw@apple.com> Fixed 3262825. Fixed 3245625. Fixed 3262547. Recursively check items when going back/forward to ensure all frame URLs are correct. Added some logging to help diagnose back/forward problems. Reviewed by John. * History.subproj/WebHistory.m: (-[WebHistory addItem:]): * Misc.subproj/WebKitLogging.h: * Misc.subproj/WebKitLogging.m: * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithRequest:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _createItem:]): (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _URLsMatchItem:]): (-[WebFrame _loadItem:withLoadType:]): === Safari-80 === 2003-05-20 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Due to some header file changes in Foundation on Panther, Tweaked some includes so that WebKit builds on Jaguar and Panther. * Carbon.subproj/CarbonWindowFrame.m: * Plugins.subproj/WebNetscapePluginPackage.m: * Plugins.subproj/WebPluginPackage.m: 2003-05-19 Maciej Stachowiak <mjs@apple.com> - fixed 3261096 - Make WebKit an umbrella framework * WebKit.pbproj/project.pbxproj: Build WebKit as a public umbrella framework when doing a B&I build. 2003-05-19 Ken Kocienda <kocienda@apple.com> Reviewed by Darin * Panels.subproj/WebAuthenticationPanel.m: Now imports Foundation/NSURLCredential.h * WebCoreSupport.subproj/WebCookieAdapter.m: Now imports Foundation/NSHTTPCookie.h 2003-05-19 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Changed imports to include headers from Foundation instead of WebFoundation. Removed WebFoundation.framework as a dependency in the project file. * History.subproj/WebHistory.m: * History.subproj/WebHistoryItem.m: * History.subproj/WebHistoryPrivate.m: * History.subproj/WebURLsWithTitles.m: * Misc.subproj/WebDownload.h: * Misc.subproj/WebDownload.m: * Misc.subproj/WebFileDatabase.m: * Misc.subproj/WebIconDatabase.m: * Misc.subproj/WebIconLoader.m: * Misc.subproj/WebKitErrors.m: * Misc.subproj/WebKitErrorsPrivate.h: * Misc.subproj/WebNSPasteboardExtras.m: * Misc.subproj/WebNSViewExtras.m: * Panels.subproj/WebAuthenticationPanel.h: * Panels.subproj/WebAuthenticationPanel.m: * Panels.subproj/WebPanelAuthenticationHandler.h: * Panels.subproj/WebPanelAuthenticationHandler.m: * Plugins.subproj/WebBaseNetscapePluginStream.m: * Plugins.subproj/WebBaseNetscapePluginView.m: * Plugins.subproj/WebNetscapePluginDocumentView.m: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: * Plugins.subproj/WebNetscapePluginRepresentation.m: * Plugins.subproj/WebNetscapePluginStream.m: * Plugins.subproj/WebNullPluginView.m: * Plugins.subproj/WebPluginController.m: * WebCoreSupport.subproj/WebBridge.m: * WebCoreSupport.subproj/WebCookieAdapter.m: * WebCoreSupport.subproj/WebImageRendererFactory.m: * WebCoreSupport.subproj/WebSubresourceClient.m: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebBaseResourceHandleDelegate.m: * WebView.subproj/WebDataProtocol.h: * WebView.subproj/WebDataProtocol.m: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebDefaultContextMenuDelegate.m: * WebView.subproj/WebDefaultFrameLoadDelegate.m: * WebView.subproj/WebDefaultPolicyDelegate.m: * WebView.subproj/WebDefaultResourceLoadDelegate.m: * WebView.subproj/WebDefaultUIDelegate.m: * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebFrameView.m: * WebView.subproj/WebFrameViewPrivate.m: * WebView.subproj/WebHTMLRepresentation.m: * WebView.subproj/WebHTMLViewPrivate.m: * WebView.subproj/WebImageRepresentation.m: * WebView.subproj/WebMainResourceClient.m: * WebView.subproj/WebPreferences.m: * WebView.subproj/WebTextRepresentation.m: * WebView.subproj/WebTextView.m: * WebView.subproj/WebUIDelegate.h: * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.m: 2003-05-16 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - fixed 3255088 - repro crash in WebCredentialStorage remembering password from onlinetrafficsafety.com * WebView.subproj/WebFormDelegate.h: * WebView.subproj/WebFormDelegate.m: (-[WebFormDelegate frame:sourceFrame:willSubmitForm:withValues:submissionListener:]): Expect sourceFrame argument. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): Include source frame in form state. (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): Include source frame in form state. Post directly to the target frame if it exists, since we want the form state to contain the right source frame. (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): Pass source frame to form delegate. (-[WebFormState initWithForm:values:sourceFrame:]): New sourceFrame argument. (-[WebFormState dealloc]): release sourceFrame. (-[WebFormState sourceFrame]): New method. 2003-05-16 Ken Kocienda <kocienda@apple.com> Reviewed by Gramps Moved in WebDatabase and WebFileDatabase files from WebFoundation. Copied NSLRUFileList from WebFoundation and renamed to WebLRUFileList. Updated StringsNotToBeLocalized.txt. * English.lproj/StringsNotToBeLocalized.txt: * Misc.subproj/WebDatabase.h: * Misc.subproj/WebDatabase.m: * Misc.subproj/WebFileDatabase.h: * Misc.subproj/WebFileDatabase.m: (-[WebFileDatabaseOp initWithCode:key:object:]): (-[WebFileDatabaseOp perform:]): (SetThreadPriority): (-[WebFileDatabase _createLRUList:]): (-[WebFileDatabase _truncateToSizeLimit:]): (+[WebFileDatabase _syncLoop:]): (-[WebFileDatabase setObject:forKey:]): (-[WebFileDatabase removeObjectForKey:]): (-[WebFileDatabase removeAllObjects]): (-[WebFileDatabase objectForKey:]): (-[WebFileDatabase performSetObject:forKey:]): (-[WebFileDatabase performRemoveObjectForKey:]): (-[WebFileDatabase close]): (-[WebFileDatabase lazySync:]): (-[WebFileDatabase sync]): (-[WebFileDatabase count]): (-[WebFileDatabase usage]): * Misc.subproj/WebIconDatabase.m: * Misc.subproj/WebKitLogging.h: * Misc.subproj/WebKitLogging.m: * Misc.subproj/WebLRUFileList.h: Added. * Misc.subproj/WebLRUFileList.m: Added. (WebLRUFileListCreate): (WebLRUFileListRelease): (WebLRUFileListRebuildFileDataUsingRootDirectory): (WebLRUFileListRemoveFileWithPath): (WebLRUFileListTouchFileWithPath): (WebLRUFileListSetFileData): (WebLRUFileListGetPathOfOldestFile): (WebLRUFileListRemoveOldestFileFromList): (WebLRUFileListContainsItem): (WebLRUFileListGetFileSize): (WebLRUFileListCountItems): (WebLRUFileListGetTotalSize): (WebLRUFileListRemoveAllFilesFromList): (compareTimes): (cStringEqual): (cStringHash): (NSLRUFileDataEqual): (WebLRUFileListGetOldestFileData): (NSLRUFileDataReleaseApplierFunction): (NSLRUFileDataRelease): (NSLRUFileDataBinaryHeapDumpApplierFunction): (NSLRUFileDataDictDumpApplierFunction): (WebLRUFileListDescription): * WebKit.pbproj/project.pbxproj: 2003-05-15 Chris Blumenberg <cblu@apple.com> Fixed: 3199310 - No user agent included in favicon.ico requests Reviewed by kocienda. * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebIconLoader.m: (-[WebIconLoaderPrivate dealloc]): use the request ivar (-[WebIconLoader URL]): ditto (-[WebIconLoader startLoading]): ditto (-[WebIconLoader connection:didReceiveData:]): ditto (-[WebIconLoader connectionDidFinishLoading:]): ditto * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): create a icon loader with a request with the extra fields set 2003-05-15 Chris Blumenberg <cblu@apple.com> Fixed: 3155760 - Plug-in MIME and extension mapping should be case-insensitive Reviewed by john. * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage getPluginInfoFromBundleAndMIMEDictionary:]): store the extensions and MIMEs as lowercase strings (-[NSArray _web_lowercaseStrings]): new, returns array of lowercase strings * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage getPluginInfoFromResources]): store the extensions and MIMEs as lowercase strings * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase pluginForMIMEType:]): lowercase the passed MIME type (-[WebPluginDatabase pluginForExtension:]): lowercase the passed extension === Safari-79 === 2003-05-15 Ken Kocienda <kocienda@apple.com> Reviewed by John Updated for recent changes. * English.lproj/StringsNotToBeLocalized.txt: 2003-05-15 Ken Kocienda <kocienda@apple.com> Reviewed by John Changed the names of some extras files in WebFoundation: Updated imports and usages in this project. WebNSCalendarDateExtras -> NSCalendarDate_NSURLExtras WebNSDataExtras -> NSData_NSURLExtras WebNSDictionaryExtras -> NSDictionary_NSURLExtras WebNSErrorExtras -> NSError_NSURLExtras WebNSFileManagerExtras -> NSFileManager_NSURLExtras WebNSObjectExtras -> NSObject_NSURLExtras WebNSStringExtras -> NSString_NSURLExtras WebNSURLExtras -> NSURL_NSURLExtras WebNSUserDefaultsExtras -> NSUserDefaults_NSURLExtras * History.subproj/WebHistory.m: * History.subproj/WebHistoryItem.m: * History.subproj/WebHistoryPrivate.m: * History.subproj/WebURLsWithTitles.m: * Misc.subproj/WebIconDatabase.m: * Misc.subproj/WebIconLoader.m: * Misc.subproj/WebKitErrors.m: * Misc.subproj/WebNSPasteboardExtras.m: * Misc.subproj/WebNSViewExtras.m: * Panels.subproj/WebAuthenticationPanel.m: * Panels.subproj/WebPanelAuthenticationHandler.m: * Plugins.subproj/WebBaseNetscapePluginStream.m: * Plugins.subproj/WebBaseNetscapePluginView.m: * Plugins.subproj/WebNetscapePluginRepresentation.m: * Plugins.subproj/WebNullPluginView.m: * WebCoreSupport.subproj/WebBridge.m: * WebCoreSupport.subproj/WebCookieAdapter.m: * WebCoreSupport.subproj/WebSubresourceClient.m: * WebView.subproj/WebBaseResourceHandleDelegate.m: * WebView.subproj/WebDataProtocol.m: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebDefaultResourceLoadDelegate.m: * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebFrameView.m: * WebView.subproj/WebFrameViewPrivate.m: * WebView.subproj/WebHTMLViewPrivate.m: * WebView.subproj/WebMainResourceClient.m: * WebView.subproj/WebPreferences.m: * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.m: 2003-05-14 Ken Kocienda <kocienda@apple.com> Reviewed by Chris WebKitSystemBits files that contain a system memory size getter. This function is used in a few of places in WebKit. * History.subproj/WebBackForwardList.m: * Misc.subproj/WebKitSystemBits.h: Added. * Misc.subproj/WebKitSystemBits.m: Added. (initCapabilities): (WebSystemMainMemory): * WebCoreSupport.subproj/WebBridge.m: * WebCoreSupport.subproj/WebTextRendererFactory.m: * WebKit.pbproj/project.pbxproj: 2003-05-14 Ken Kocienda <kocienda@apple.com> Reviewed by David File and class renaming in WebFoundation: WebFileTypeMappings -> NSURLFileTypeMappings * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge MIMETypeForPath:]): * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory supportedMIMETypes]): * WebView.subproj/WebDataSource.m: * WebView.subproj/WebMainResourceClient.m: * WebView.subproj/WebViewPrivate.m: (+[WebView suggestedFileExtensionForMIMEType:]): (+[WebView _MIMETypeForFile:]): 2003-05-14 Ken Kocienda <kocienda@apple.com> Reviewed by Maciej Copied WebLocalizableStrings.[hm] from WebFoundation to WebKit Updated all imports. Added logging exported symbols to exports file. * Misc.subproj/WebKitErrors.m: * Misc.subproj/WebLocalizableStrings.h: Added. * Misc.subproj/WebLocalizableStrings.m: Added. * Panels.subproj/WebAuthenticationPanel.m: * WebCoreSupport.subproj/WebBridge.m: * WebCoreSupport.subproj/WebFileButton.m: * WebCoreSupport.subproj/WebViewFactory.m: * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDefaultContextMenuDelegate.m: 2003-05-14 Maciej Stachowiak <mjs@apple.com> Reviewed by Don. - fixed 3257307 - REGRESSION: crash using onFocus="this.blur()" * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge makeFirstResponder:]): Let the WebView know that this is a programmatic focus. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView becomeFirstResponder]): Check if this is a programmatic focus from WebCore - if so, treat it like a direct focus, even if there is a selection direction set. * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _pushPerformingProgrammaticFocus]): New method to indicate upcoming programmatic focus. (-[WebView _popPerformingProgrammaticFocus]): New method to indicate end of programmatic focus. Needs to nest with the previous. (-[WebView _isPerformingProgrammaticFocus]): Check if we are handling a programmatic focus from WebCore. 2003-05-14 Ken Kocienda <kocienda@apple.com> Reviewed by John Copied WebAssertions.[hm] from WebFoundation to WebKit Updated all imports. Added logging exported symbols to exports file. * History.subproj/WebBackForwardList.m: * History.subproj/WebHistory.m: * History.subproj/WebHistoryItem.m: * Misc.subproj/WebAssertions.h: Added. * Misc.subproj/WebAssertions.m: Added. (vprintf_stderr_objc): (WebReportAssertionFailure): (WebReportAssertionFailureWithMessage): (WebReportArgumentAssertionFailure): (WebReportFatalError): (WebReportError): (WebLog): * Misc.subproj/WebKitLogging.h: * Misc.subproj/WebNSPasteboardExtras.m: * Misc.subproj/WebStringTruncator.m: * Panels.subproj/WebAuthenticationPanel.m: * Panels.subproj/WebPanelAuthenticationHandler.m: * Plugins.subproj/WebBaseNetscapePluginView.m: * Plugins.subproj/WebNetscapePluginDocumentView.m: * Plugins.subproj/WebNetscapePluginRepresentation.m: * WebCoreSupport.subproj/WebBridge.m: * WebCoreSupport.subproj/WebCookieAdapter.m: * WebCoreSupport.subproj/WebFileButton.m: * WebCoreSupport.subproj/WebImageRenderer.m: * WebCoreSupport.subproj/WebImageRendererFactory.m: * WebCoreSupport.subproj/WebJavaScriptTextInputPanel.m: * WebCoreSupport.subproj/WebSubresourceClient.m: * WebCoreSupport.subproj/WebTextRendererFactory.m: * WebCoreSupport.subproj/WebViewFactory.m: * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebBaseResourceHandleDelegate.m: * WebView.subproj/WebClipView.m: * WebView.subproj/WebDataProtocol.m: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDefaultPolicyDelegate.m: * WebView.subproj/WebFrameViewPrivate.m: * WebView.subproj/WebHTMLViewPrivate.m: * WebView.subproj/WebImageView.m: * WebView.subproj/WebTextRepresentation.m: * WebView.subproj/WebTextView.m: * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.m: 2003-05-13 Richard Williamson <rjw@apple.com> Fixed 3014661. We now display (a lame Lemay) image when an image fails to load. We also display the alt text if it fits within the image container above the missing image icon. Alt text is also now shown if image loading is disabled. Reviewed by John. * Resources/missing_image.tiff: Added. * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer initWithMIMEType:]): (-[WebImageRenderer initWithData:MIMEType:]): (-[WebImageRenderer initWithContentsOfFile:]): (-[WebImageRenderer copyWithZone:]): (-[WebImageRenderer isNull]): (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory imageRendererWithName:]): * WebKit.pbproj/project.pbxproj: 2003-05-13 Darin Adler <darin@apple.com> Reviewed by Chris and Richard. - fixed 3257296 -- REGRESSION: crash in WebImageRendererFactory (movietickets.com) * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer initWithMIMEType:]): Check for nil. (-[WebImageRenderer initWithData:MIMEType:]): Check for nil, also don't check for GIF signature until after the object is allocated. 2003-05-12 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3254484 - Add a way to print JavaScript exceptions to the console via the debug menu * Misc.subproj/WebCoreStatistics.h: * Misc.subproj/WebCoreStatistics.m: (+[WebCoreStatistics shouldPrintExceptions]): Call through to WebCore. (+[WebCoreStatistics setShouldPrintExceptions:]): Call through to WebCore. 2003-05-13 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed 3120355 -- importing IE favorites garbles non-ASCII characters (esp. bad for non-Roman languages) * WebView.subproj/WebViewPrivate.h: Added _decodeData:. * WebView.subproj/WebViewPrivate.m: (+[WebView _decodeData:]): Added. Calls through to WebCore. 2003-05-13 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - renamed NSErrorFailingURLKey to NSErrorFailingURLStringKey * Misc.subproj/WebKitErrors.m: (-[NSError _initWithPluginErrorCode:contentURLString:pluginPageURLString:pluginName:MIMEType:]): 2003-05-13 John Sullivan <sullivan@apple.com> fixed build break Reviewed by Darin * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer initWithData:MIMEType:]): move #ifdefs; two required methods were being #ifdeffed out on Panther 2003-05-12 Richard Williamson <rjw@apple.com> Fixed 3251316. *** Public API Change *** Added -(void)setGroupName:(NSString *) and -(NSString *)groupName; Reviewed by mjs. * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: 2003-05-12 Richard Williamson <rjw@apple.com> Fixed 3194614 and 3194751. Add SPI to set 'renderless' mode for a frame. Reviewed by darin. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: WebImageRenderers now get a MIME type that can be used to faciliate selection of an appropriate decoder. Reviewed by darin. * WebCoreSupport.subproj/WebImageRenderer.h: * WebCoreSupport.subproj/WebImageRenderer.m: * WebCoreSupport.subproj/WebImageRendererFactory.m: * WebKit.pbproj/project.pbxproj: 2003-05-12 John Sullivan <sullivan@apple.com> - addition to Darin's previous patch; when checking whether a request can be handled, take into account the schemes that were registered without an NSURLProtocol getting involved. Reviewed by Darin * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (+[WebView _canHandleRequest:]): like NSURLConnection canHandleRequest, but also takes into account the schemes that were registered without an NSURLProtocol * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:]): use +[WebView _canHandleRequest] instead of +[NSURLConnection canHandleRequest] * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): ditto * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]): ditto * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueAfterNavigationPolicy:]): ditto 2003-05-12 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3254576 -- REGRESSION: visiting bookmarks view sometimes waits for other tabs to load first * WebView.subproj/WebViewPrivate.h: Added new SPI for registering view and represenation classes by scheme rather than MIME type. * WebView.subproj/WebViewPrivate.m: (+[WebView _registerViewClass:representationClass:forURLScheme:]]): Added. (+[WebView _generatedMIMETypeForURLScheme:]): Added. Makes a special MIME type for us only by the special "register scheme" mechanism. (+[WebView _representationExistsForURLScheme:]): Added. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): Check for schemes that have their own representation, and handle them just like empty documents, loading no data, and doing it synchronously. (-[WebMainResourceClient loadWithRequest:]): Same thing here, only also arrange to get the appropriate MIME type. (-[WebMainResourceClient setDefersCallbacks:]): Same check here. * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2003-05-11 Darin Adler <darin@apple.com> * WebView.subproj/WebHTMLView.m: (-[WebHTMLView layoutToPageWidth:]): Added a check for nil that I forgot. 2003-05-10 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3254473 - REGRESSION: reload loop due to onresize handler (fortune.com, flipdog.com, stanford.edu) * WebView.subproj/WebHTMLView.m: (-[WebHTMLView layoutToPageWidth:]): Don't send out a resize event any time during the first event that results in a layout. The old check was merely for the first layout, but we need to ignore any number of layouts that are all part of handling a first event. Some day we may need to refine this rule even further, but this fixes the present bug. * WebView.subproj/WebHTMLViewPrivate.h: Goodbye laidOutAtLeastOnce, hello firstLayoutEventTime. 2003-05-10 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3250119 -- REGRESSION: WebFrame leaked after showing pop-up menu The leak was caused by various code storing the "element" dictionary that describes where a click took place. * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): Don't store the element in a retained global. Instead attach it as the represented object to each menu item. (-[WebDefaultUIDelegate openNewWindowWithURL:element:]): Pass in an element. (-[WebDefaultUIDelegate downloadURL:element:]): Ditto. (-[WebDefaultUIDelegate openLinkInNewWindow:]): Get element from represented object. (-[WebDefaultUIDelegate downloadLinkToDisk:]): Ditto. (-[WebDefaultUIDelegate copyLinkToClipboard:]): Ditto. (-[WebDefaultUIDelegate openImageInNewWindow:]): Ditto. (-[WebDefaultUIDelegate downloadImageToDisk:]): Ditto. (-[WebDefaultUIDelegate copyImageToClipboard:]): Ditto. (-[WebDefaultUIDelegate openFrameInNewWindow:]): Ditto. * WebView.subproj/WebDefaultUIDelegate.h: Remove element field. * WebView.subproj/WebDefaultUIDelegate.m: (-[WebDefaultUIDelegate dealloc]): No need to release element any more. * WebView.subproj/WebHTMLViewPrivate.h: Remove dragElement instance variable. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLViewPrivate dealloc]): No need to release dragElement any more. (-[WebHTMLView _handleMouseDragged:]): Get element again here. The old code used to get it from an instance variable, but that is unnecessary. (-[WebHTMLView _mayStartDragWithMouseDragged:]): Don't store the element. 2003-05-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. Updated for NSURLResponse API changes. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): * WebView.subproj/WebDataProtocol.m: (-[WebDataProtocol startLoading]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient loadWithRequest:]): 2003-05-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - removed WebAuthenticationChallenge - adjusted everything for removal of NSURLAuthenticationChallenge subclasses. * Misc.subproj/WebDownload.m: (-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]): (-[WebDownloadInternal download:didCancelAuthenticationChallenge:]): * Panels.subproj/WebPanelAuthenticationHandler.m: (-[WebPanelAuthenticationHandler startAuthentication:window:]): (-[WebPanelAuthenticationHandler _authenticationDoneWithChallenge:result:]): * WebView.subproj/WebAuthenticationChallenge.h: Removed. * WebView.subproj/WebAuthenticationChallenge.m: Removed. * WebView.subproj/WebAuthenticationChallengeInternal.h: Removed. * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate useCredential:forAuthenticationChallenge:]): (-[WebBaseResourceHandleDelegate continueWithoutCredentialForAuthenticationChallenge:]): (-[WebBaseResourceHandleDelegate cancelAuthenticationChallenge:]): (-[WebBaseResourceHandleDelegate connection:didReceiveAuthenticationChallenge:]): (-[WebBaseResourceHandleDelegate connection:didCancelAuthenticationChallenge:]): (-[WebBaseResourceHandleDelegate setIdentifier:]): * WebView.subproj/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate webView:resource:didReceiveAuthenticationChallenge:fromDataSource:]): (-[WebDefaultResourceLoadDelegate webView:resource:didCancelAuthenticationChallenge:fromDataSource:]): * WebView.subproj/WebResourceLoadDelegate.h: * Misc.subproj/WebKit.h: Remove headers that are gone. * WebKit.exp: Remove classes that are gone. * WebKit.pbproj/project.pbxproj: Remove files that are gone. 2003-05-09 David Hyatt <hyatt@apple.com> Change the minfontsize to 1, i.e., to have no minimum. This matches other browsers while still retaining the pref control in WebKit. Fixes www.gamespot.com. The bug is 3254489. Reviewed by darin * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): 2003-05-09 Maciej Stachowiak <mjs@apple.com> Reviewed by John. Rename connection:didFailLoadingWithError: to connection:didFailWithError: to match NSURLDownload and NSURLProtocol. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader connection:didFailWithError:]): * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream connection:didFailWithError:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient connection:didFailWithError:]): * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:didFailWithError:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:]): (-[WebMainResourceClient connection:didFailWithError:]): 2003-05-09 Richard Williamson <rjw@apple.com> Apply the same check used to by-pass fast rendering in the fix to 3146161 to measurement. Reviewed by Ken. * Misc.subproj/WebKitNSStringExtras.m: 2003-05-09 Ken Kocienda <kocienda@apple.com> Reviewed by John Removed unneeded import of WebFoundation/WebQueue.h. * WebCoreSupport.subproj/WebTextRendererFactory.h 2003-05-08 Richard Williamson <rjw@apple.com> Fixed 3146161. Use the AppKit to render complex text in the simple string drawing method. Reviewed by John. * Misc.subproj/WebKitNSStringExtras.m: 2003-05-08 Richard Williamson <rjw@apple.com> Make representations without intrinsic titles return nil. Reviewed by John. * Plugins.subproj/WebNetscapePluginRepresentation.m: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebImageRepresentation.m: * WebView.subproj/WebTextRepresentation.m: 2003-05-08 Richard Williamson <rjw@apple.com> Fixed 3252460. *** Public API Change *** Added title method to WebDocumentRepresentation. Fixed 3250352. Check that delegate implements method. Reviewed by hyatt. * WebView.subproj/WebDataSource.m: (-[WebDataSource pageTitle]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): (-[WebDataSource _title]): * WebView.subproj/WebDocument.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation title]): * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation title]): * WebView.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation title]): * WebView.subproj/WebTextRepresentation.h: * WebView.subproj/WebTextRepresentation.m: (-[WebTextRepresentation dealloc]): (-[WebTextRepresentation setDataSource:]): (-[WebTextRepresentation title]): 2003-05-08 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Fixed paths for non-Panther builds. 2003-05-08 John Sullivan <sullivan@apple.com> Closed up all gaps in WebKit between "ASSERT" and "(" to make Darin's day a little brighter. Reviewed by Darin * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): (-[WebBridge handleMouseDragged:]): (-[WebBridge mayStartDragWithMouseDragged:]): * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate _releaseResources]): (-[WebBaseResourceHandleDelegate dealloc]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): * WebView.subproj/WebViewPrivate.m: (-[WebView _preferencesChangedNotification:]): 2003-05-08 John Sullivan <sullivan@apple.com> - fixed 3252632 -- Registering a WebDocumentView too early breaks built-in image viewing A startup-performance optimization was breaking the case where clients registered WebDocumentView types before the first WebFrameView had been created. The fix is to allow registering WebDocumentView types without retrieving the built-in image types. Reviewed by Darin * WebView.subproj/WebFrameViewPrivate.h: remove _viewTypes; expose _viewTypesAllowImageTypeOmission. All callers have to specify the boolean now. * WebView.subproj/WebFrameViewPrivate.m: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): assert that the list of image types isn't nil before inserting them; insert each image type only if not already present. (+[WebFrameView _viewClassForMIMEType:]): replace _viewTypes with _viewTypesAllowImageTypeOmission * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase init]): replace _viewTypes with _viewTypesAllowImageTypeOmission * WebView.subproj/WebDataSourcePrivate.h: remove _repTypes; expose _repTypesAllowImageTypeOmission. All callers have to specify the boolean now. * WebView.subproj/WebDataSourcePrivate.m: (+[WebDataSource _representationClassForMIMEType:]): replace _repTypes with _repTypesAllowImageTypeOmission * WebView.subproj/WebView.m: (+[WebView registerViewClass:representationClass:forMIMEType:]): replace _viewTypes with _viewTypesAllowImageTypeOmission, and replace _repTypes with _repTypesAllowImageTypeOmission 2003-05-08 Darin Adler <darin@apple.com> Reviewed by Richard. - fixed 3242414 -- REGRESSION: PLT times reported 10% slower after emptying cache with B/F cache enabled - made it only compute the page cache size once * History.subproj/WebBackForwardList.m: (-[WebBackForwardList init]): Set initial page cache size to special value, COMPUTE_DEFAULT_PAGE_CACHE_SIZE. (-[WebBackForwardList setPageCacheSize:]): Remove code to set pageCacheSizeModified and call to _setUsesPageCache:, not needed any more. (-[WebBackForwardList pageCacheSize]): If cache size is COMPUTE_DEFAULT_PAGE_CACHE_SIZE, then compute it. The old code would compute the cache size each time this method was called until pageCacheSizeModified was set. (-[WebBackForwardList _usesPageCache]): Just check pageCacheSize for 0 to see if we use a page cache. No need for a separate boolean any more. * History.subproj/WebHistoryItemPrivate.h: Remove _setUsesPageCache (gone altogether) and _clearPageCache (now only used internally). === Safari-78 === 2003-05-07 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3127927 -- web view should not use primary selection color when it's not first responder * WebView.subproj/WebHTMLView.m: (-[WebHTMLView updateTextBackgroundColor]): Added. Sets the usesInactiveTextBackgroundColor flag on the bridge, and does setNeedsDisplayInRect: of the selectionRect if the state changes. (-[WebHTMLView viewDidMoveToWindow]): Call updateTextBackgroundColor. (-[WebHTMLView windowDidBecomeKey:]): Call updateTextBackgroundColor. (-[WebHTMLView windowDidResignKey:]): Call updateTextBackgroundColor. (-[WebHTMLView becomeFirstResponder]): Call updateTextBackgroundColor. (-[WebHTMLView resignFirstResponder]): Call updateTextBackgroundColor. - fixed up WebHistoryItem initializers so there is a designated initializer * History.subproj/WebHistoryItem.m: (-[WebHistoryItem init]): Call initWithURLString:title:lastVisitedTimeInterval:, which is the designated initializer. (-[WebHistoryItem initWithURL:title:]): Ditto. (-[WebHistoryItem initWithURL:target:parent:title:]): Ditto. - other changes * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate addItem:]): Fixed assertion to not use _lastVisitedDate; we're trying to get rid of calls to that method. 2003-05-07 Vicki Murley <vicki@apple.com> Reviewed by darin. - modify the Mixed build style to build optimized with symbols * WebKit.pbproj/project.pbxproj: removed OPTIMIZATION_CGLAGS 2003-05-06 Richard Williamson <rjw@apple.com> Fixed problem for HelpViewer. HV calls stopLoading in a webView:resource:didReceiveResponse. This causes the premature release of the connection delegate. Reviewed by Ken. * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient connectionDidFinishLoading:]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate _releaseResources]): (-[WebBaseResourceHandleDelegate dealloc]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient stopLoadingForPolicyChange]): (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient continueAfterContentPolicy:]): (-[WebMainResourceClient connection:didReceiveResponse:]): (-[WebMainResourceClient connectionDidFinishLoading:]): 2003-05-06 Darin Adler <darin@apple.com> - removed obsolete file that's still around for some reason * Downloads.subproj/WebDownload.m: Removed. 2003-05-06 Darin Adler <darin@apple.com> - fixed crash on startup * History.subproj/WebHistoryItem.m: (-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]): Allocate WebHistoryItemPrivate. 2003-05-06 Darin Adler <darin@apple.com> - fixed 3249211 -- WebTextRenderer.h should not use "AttributeGroup" type for styleGroup * WebCoreSupport.subproj/WebTextRenderer.h: Update to use ATSStyleGroupPtr. 2003-05-06 Darin Adler <darin@apple.com> Reviewed by Ken. - used ObjectAlloc to find large numbers of allocations on startup and get rid of some * History.subproj/WebHistoryItem.m: (-[WebHistoryItem initFromDictionaryRepresentation:]): Use the init method that takes a URL string so we don't have to create and then destroy a URL for each item we decode. * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate addItem:]): Use URLString instead of making and destroying a URL each time this is called. (-[WebHistoryPrivate removeItem:]): Ditto. (-[WebHistoryPrivate _loadHistoryGuts:URL:error:]): Check URLString for nil; no reason to construct and then destroy a URL just to check validity. * WebCoreSupport.subproj/WebTextRendererFactory.m: (FontCacheKeyCopy): Added. (FontCacheKeyFree): Added. (FontCacheKeyEqual): Added. (FontCacheKeyHash): Added. (FontCacheValueRetain): Added. (FontCacheValueRelease): Added. (-[WebTextRendererFactory cachedFontFromFamily:traits:size:]): Use a C struct for the font cache key instead of using an Objective-C object. This saves us an object allocation and deallocation when doing a lookup. Also took advantage of the CFDictionary ability to store NULL and distinguish it from "not found" so we don't need a separate set for cache misses. 2003-05-05 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. Fix build by separating mutating data protocol methods into category on NSMutableURLRequest. Also, formatting fixes. * WebView.subproj/WebDataProtocol.h: * WebView.subproj/WebDataProtocol.m: (+[NSURLRequest _webDataRequestURLForData:]): (-[NSURLRequest _webDataRequestData]): (-[NSURLRequest _webDataRequestEncoding]): (-[NSURLRequest _webDataRequestMIMEType]): (-[NSURLRequest _webDataRequestBaseURL]): (-[NSURLRequest _webDataRequestExternalRequest]): (-[NSMutableURLRequest _webDataRequestSetData:]): * WebView.subproj/WebFrame.m: 2003-05-04 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed a storage leak * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setState:]): Release the timer before setting to nil. 2003-05-03 David Hyatt <hyatt@apple.com> Add smallCaps boolean to the string measuring and drawing methods. Not actually supported yet. Reviewed by darin * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _web_widthWithFont:]): * Misc.subproj/WebStringTruncator.m: (stringWidth): * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer widthForCharacters:length:]): (-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:rightToLeft:letterSpacing:wordSpacing:smallCaps:fontFamilies:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:characterPosition:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:letterSpacing:wordSpacing:smallCaps:fontFamilies:]): (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:letterSpacing:wordSpacing:smallCaps:fontFamilies:]): 2003-05-04 Darin Adler <darin@apple.com> Reviewed by John. - added validation to "Interface Builder" methods on WebView * WebView.subproj/WebView.h: Add NSUserInterfaceValidations protocol so that subclassers know that they can call [super validateUserInterfaceItem:]. * WebView.subproj/WebView.m: (-[WebView canMakeTextSmaller]): Simplify. (-[WebView canMakeTextLarger]): Simplify. (-[WebView _isLoading]): Added. (-[WebView validateUserInterfaceItem:]): Added. Checks for the six actions we implement, and returns NO if they are not valid. 2003-05-02 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. - reformatted method prototypes to match AppKit style - remove "Public header file" from headers that are not public - fix header doc @method names to match actual method names * Carbon.subproj/CarbonWindowAdapter.h: * Carbon.subproj/HIViewAdapter.h: * DOM.subproj/WebDOMDocument.h: * DOM.subproj/WebDOMNode.h: * History.subproj/WebBackForwardList.h: * History.subproj/WebHistoryItemPrivate.h: * History.subproj/WebHistoryPrivate.h: * History.subproj/WebURLsWithTitles.h: * Misc.subproj/WebIconDatabase.h: * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebKitNSStringExtras.h: * Misc.subproj/WebUnicode.h: * Panels.subproj/WebPanelAuthenticationHandler.h: * Plugins.subproj/WebBasePluginPackage.h: * Plugins.subproj/WebNetscapePluginStream.h: * Plugins.subproj/WebNullPluginView.h: * Plugins.subproj/WebPluginViewFactory.h: * WebCoreSupport.subproj/WebGlyphBuffer.h: * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRendererFactory.h: * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebControllerSets.h: * WebView.subproj/WebDataProtocol.h: * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDebugDOMNode.h: * WebView.subproj/WebDocument.h: * WebView.subproj/WebFrame.h: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFrameView.h: * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLView.h: * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebPolicyDelegate.h: * WebView.subproj/WebPolicyDelegatePrivate.h: * WebView.subproj/WebPreferencesPrivate.h: * WebView.subproj/WebRenderNode.h: * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebUIDelegate.h: * WebView.subproj/WebView.h: * WebView.subproj/WebViewPrivate.h: 2003-05-02 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 2936175 - MALLORY: please implement onResize * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView layoutToPageWidth:]): If we just resized and we're not printing, make sure to send a resize event after the layout. 2003-05-02 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3236383 -- http://www.xy.com/ exception, crash loading main page * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge closeWindowSoon]): Replaces closeWindow. Schedule a closeWindow operation in the WebView. Important to not have the call's execution depend on whether this WebBridge or WebFrame is still around after the delay. * WebView.subproj/WebViewPrivate.h: Added _closeWindow. * WebView.subproj/WebViewPrivate.m: (-[WebView _closeWindow]): Make a webViewClose: call on the UI delegate. 2003-05-02 Darin Adler <darin@apple.com> Reviewed by John. - first step in fixing 3236383 -- http://www.xy.com/ exception, crash loading main page Changed WebFrame to explicitly detach from the bridge so we don't have a stale pointer; also cleaned up WebBridge initialization. * WebCoreSupport.subproj/WebBridge.h: Added initWithWebFrame: and close methods, removed setWebFrame: method. * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webFrameView:webView:]): Use the new initWithWebFrame:. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _detachFromParent]): Call close on the bridge. - fixed many places that call a WebView a "controller" * Misc.subproj/WebKitStatistics.h: * Misc.subproj/WebKitStatistics.m: * Misc.subproj/WebKitStatisticsPrivate.h: * Misc.subproj/WebNSViewExtras.m: * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: * Plugins.subproj/WebNetscapePluginStream.m: * WebCoreSupport.subproj/WebBridge.m: * WebCoreSupport.subproj/WebSubresourceClient.m: * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: * WebView.subproj/WebControllerSets.h: * WebView.subproj/WebControllerSets.m: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebDefaultContextMenuDelegate.m: * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFrameView.m: * WebView.subproj/WebFrameViewPrivate.h: * WebView.subproj/WebFrameViewPrivate.m: * WebView.subproj/WebImageView.m: * WebView.subproj/WebMainResourceClient.m: * WebView.subproj/WebTextView.m: * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: 2003-05-01 John Sullivan <sullivan@apple.com> - fixed 3246045 -- History items without a valid date in History.plist show up with unexpected dates in UI Reviewed by Darin. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem initFromDictionaryRepresentation:]): don't set lastVisitedTimeInterval to [nil doubleValue], since this is random * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2003-05-01 Richard Williamson <rjw@apple.com> Added missing header and alphabetized. Reviewed by Ken. * Misc.subproj/WebKit.h: 2003-05-01 Chris Blumenberg <cblu@apple.com> Fixed: 3234888 - REGRESSION: "can't add a plug-in to a defunct WebPluginController" error, then crash Fixed: 3226392 - REGRESSION: Safari crashed while loading Java applet at PopCap.com Reviewed by darin. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame setController:]): fixed comment * WebView.subproj/WebView.m: (-[WebView dealloc]): call [self _close] * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebViewPrivate dealloc]): let the WebView class clear the frames (-[WebView _close]): remove self from controller set and detach and release frame === Safari-77 === 2003-05-01 John Sullivan <sullivan@apple.com> - fixed 3245793 -- Launching Safari-75 after tip of tree erases all history Reviewed by Chris, Don * History.subproj/WebHistoryItem.m: keep using "lastVisitedDate" as the dictionary key, since old Safaris otherwise can't read the History file. (-[WebHistoryItem dictionaryRepresentation]): keep storing the time interval as a string, since old Safaris otherwise can't read the History file (-[WebHistoryItem initFromDictionaryRepresentation:]): read the stored date as a string and convert to a double, as we did before. 2003-05-01 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3169117 -- dragging while using a scroll wheel affects scroll movement * WebView.subproj/WebHTMLViewPrivate.m: (-[WebNSWindow nextEventMatchingMask:untilDate:inMode:dequeue:]): Just return nil when called with NSScrollWheelMask to work around the bug where any kind of event can be returned when this mask is passed. This will prevent scroll wheel events from being coalesced, but it's better than extracting events of all different types. Mouse moved events are particularly bad because they have deltaX/Y/Z and the scroll wheel code in NSScrollView treats them as if they were scroll wheel events. 2003-05-01 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Updated to use approved NSHTTPCookieStorage API. +sharedCookieManager -> +sharedHTTPCookieStorage -acceptPolicy -> -cookieAcceptPolicy -cookieRequestHeaderFieldsForURL: -> -cookiesForURL: -setCookiesFromResponseHeader:forURL:policyBaseURL: -> -setCookies:forURL:mainDocumentURL: * WebCoreSupport.subproj/WebCookieAdapter.m: (-[WebCookieAdapter cookiesEnabled]): (-[WebCookieAdapter cookiesForURL:]): (-[WebCookieAdapter setCookies:forURL:policyBaseURL:]): 2003-05-01 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2003-04-30 Kenneth Kocienda <kocienda@apple.com> Reviewed by Richard Modified WebFoundation error constant names. Names now begin with NSURLError prefix. * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedError:withDataSource:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate cancelledError]): * WebView.subproj/WebDataProtocol.m: (-[WebDataProtocol startLoading]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _stopLoadingInternal]): 2003-04-30 Kenneth Kocienda <kocienda@apple.com> Reviewed by Richard Use NSURLResponse new SPI methods to set instance variables. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): * WebView.subproj/WebDataProtocol.m: (-[WebDataProtocol startLoading]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient loadWithRequest:]): 2003-04-30 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. Moved NSURLProtectionSpace over to officially blessed API. * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForChallenge:]): 2003-04-30 Richard Williamson <rjw@apple.com> Copy MIME type when copying WebDataProtocol's parameters. Reviewed by Ken. * WebView.subproj/WebDataProtocol.m: (-[WebDataRequestParameters copyWithZone:]): 2003-04-30 Richard Williamson <rjw@apple.com> Documentation fixes. Added "ADVISORY NOTE" about possible API change after beta SDK. * History.subproj/WebHistory.h: * WebView.subproj/WebUIDelegate.h: 2003-04-30 Ken Kocienda <kocienda@apple.com> Reviewed by Maciej Tweaked some HTTP-specific NSURLRequest method names as specified in the API errata list. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): (-[WebBaseNetscapePluginView _postURLNotify:target:len:buf:file:notifyData:allowHeaders:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate openNewWindowWithURL:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _addExtraFieldsToRequest:alwaysFromRequest:]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient connection:willSendRequest:redirectResponse:]): 2003-04-30 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. Minor header tweaks. * Misc.subproj/WebDownload.h: Fix copyright notice. * Panels.subproj/WebAuthenticationPanel.h: Added 2003 to copyright. * WebView.subproj/WebAuthenticationChallenge.h: Fix copyright notice, add docs. * WebView.subproj/WebAuthenticationChallengeInternal.h: Fix copyright notice. 2003-04-30 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. Minor header tweaks. * Misc.subproj/WebDownload.h: Fix copyright notice. * Panels.subproj/WebAuthenticationPanel.h: Added 2003 to copyright. * WebView.subproj/WebAuthenticationChallenge.h: Fix copyright notice, add docs. * WebView.subproj/WebAuthenticationChallengeInternal.h: Fix copyright notice. 2003-04-30 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. Fixed imports and @class directives for WebFoundation changes. * Panels.subproj/WebAuthenticationPanel.h: * Panels.subproj/WebAuthenticationPanel.m: 2003-04-30 Richard Williamson <rjw@apple.com> Fixed doc errors. * History.subproj/WebHistory.h: 2003-04-30 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. Some simple renames: sharedURLCredentialStorage --> sharedCredentialStorage URLCredentialWithUser:password:persistence: --> credentialWithUser:password:persistence: * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel runAsModalDialogWithChallenge:]): (-[WebAuthenticationPanel sheetDidEnd:returnCode:contextInfo:]): 2003-04-30 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. Changed things to use WebAuthenticationChallenge for WebResoureceLoadDelegate auth callbacks. * Panels.subproj/WebPanelAuthenticationHandler.m: (-[WebPanelAuthenticationHandler startAuthentication:window:]): (-[WebPanelAuthenticationHandler _authenticationDoneWithChallenge:result:]): * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebAuthenticationChallenge.h: Added. * WebView.subproj/WebAuthenticationChallenge.m: Added. (-[WebAuthenticationChallengeInternal initWithDelegate:]): (-[WebAuthenticationChallengeInternal dealloc]): (-[WebAuthenticationChallenge _initWithAuthenticationChallenge:delegate:]): (-[WebAuthenticationChallenge dealloc]): (-[WebAuthenticationChallenge useCredential:]): (-[WebAuthenticationChallenge cancel]): (-[WebAuthenticationChallenge continueWithoutCredential]): * WebView.subproj/WebAuthenticationChallengeInternal.h: Added. * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:didReceiveAuthenticationChallenge:]): (-[WebBaseResourceHandleDelegate connection:didCancelAuthenticationChallenge:]): (-[WebBaseResourceHandleDelegate useCredential:forAuthenticationChallenge:]): (-[WebBaseResourceHandleDelegate continueWithoutCredentialForAuthenticationChallenge:]): (-[WebBaseResourceHandleDelegate cancelWithError:]): * WebView.subproj/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate webView:resource:didReceiveAuthenticationChallenge:fromDataSource:]): (-[WebDefaultResourceLoadDelegate webView:resource:didCancelAuthenticationChallenge:fromDataSource:]): * WebView.subproj/WebResourceLoadDelegate.h: 2003-04-30 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. Converted download code to use an NSURLDownloadAuthenticationChallenge rather than a vanilla NSURLAuthenticationChallenge. * Misc.subproj/WebDownload.m: (-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]): (-[WebDownloadInternal download:didCancelAuthenticationChallenge:]): * Panels.subproj/WebPanelAuthenticationHandler.h: * Panels.subproj/WebPanelAuthenticationHandler.m: (-[WebPanelAuthenticationHandler startAuthentication:window:]): (-[WebPanelAuthenticationHandler _authenticationDoneWithChallenge:result:]): 2003-04-30 Ken Kocienda <kocienda@apple.com> Reviewed by Richard Changed cookie-related constants and enums to the API-approved names. Also did some text search and replace in comments to catch usages of now-obsolete names. * WebCoreSupport.subproj/WebCookieAdapter.m: (-[WebCookieAdapter cookiesEnabled]): 2003-04-30 Chris Blumenberg <cblu@apple.com> FIXED: Clients of WebKit should have separate icon DB's Reviewed by rjw. * English.lproj/StringsNotToBeLocalized.txt: * Misc.subproj/WebIconDatabase.h: * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _createFileDatabase]): If the icon db hasn't been set using the defaults, create o directory using the bundle id. * WebKit.exp: 2003-04-30 Richard Williamson <rjw@apple.com> API changes from final review meeting. Moved view registry to WebView. Changed WebHistoryItem to use NSTimeInterval (at least for public API). Still creates a NSCalendarDate for compatibility. We should wean Safari off it's use of NSCalendarDate. Added public init method for WebHistoryItem. Removed anchor from WebHistoryItem. Added WebHistorySavedNotification. Reviewed by Darin. * History.subproj/WebHistory.m: (-[WebHistory addItemForURL:]): * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]): (-[WebHistoryItem copyWithZone:]): (-[WebHistoryItem lastVisitedTimeInterval]): (-[WebHistoryItem anchor]): (-[WebHistoryItem _setLastVisitedTimeInterval:]): (-[WebHistoryItem _lastVisitedDate]): (-[WebHistoryItem dictionaryRepresentation]): (-[WebHistoryItem initFromDictionaryRepresentation:]): * History.subproj/WebHistoryItemPrivate.h: * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate insertItem:atDateIndex:]): (-[WebHistoryPrivate removeItemForURLString:]): (-[WebHistoryPrivate addItem:]): (-[WebHistoryPrivate _loadHistoryGuts:URL:error:]): * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase init]): * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (+[WebView registerViewClass:representationClass:forMIMEType:]): 2003-04-29 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - Adjusted for authentication API change - now we expect authentication via the connection delegate, not a separate global authentication handler * Misc.subproj/WebKit.h: Include WebDownload.h * Misc.subproj/WebDownload.h: Added. * Misc.subproj/WebDownload.m: Added - this new class is just like NSURLDownload but if the standard auth delegate methods are not implemented, it prompts using the standard AppKit sheet. * Panels.subproj/WebPanelAuthenticationHandler.h: * Panels.subproj/WebPanelAuthenticationHandler.m: (+[WebPanelAuthenticationHandler sharedHandler]): New method to get a shared handler, since we no logner register an instance with WebFoundation. (-[WebPanelAuthenticationHandler startAuthentication:window:]): Do things using the new API. (-[WebPanelAuthenticationHandler _authenticationDoneWithChallenge:result:]): Likewise. * WebKit.exp: Export WebDownload. * WebKit.pbproj/project.pbxproj: Add new files to build. - Removed WebStandardPanels - this is removed from the API. * Panels.subproj/WebStandardPanels.h: Removed. * Panels.subproj/WebStandardPanels.m: Removed. * Panels.subproj/WebStandardPanelsPrivate.h: Removed. * Panels.subproj/WebAuthenticationPanel.m: Remove WebStandardPanels.h import. - Added new resource load delegate auth methods: * WebView.subproj/WebResourceLoadDelegate.h: - Use WebDownload where appropriate, and remove use of WebStandardPanels: * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:didReceiveAuthenticationChallenge:]): Pass to resource load delegate. (-[WebBaseResourceHandleDelegate connection:didCancelAuthenticationChallenge:]): Likewise. (-[WebBaseResourceHandleDelegate dealloc]): Don't track currentURL any more. (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): Likewise. (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): Likewise. (-[WebBaseResourceHandleDelegate connection:didFailLoadingWithError:]): Likewise. (-[WebBaseResourceHandleDelegate cancelWithError:]): Likewise. * WebView.subproj/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate webView:resource:didReceiveAuthenticationChallenge:fromDataSource:]): Prompt using the standard panel. (-[WebDefaultResourceLoadDelegate webView:resource:didCancelAuthenticationChallenge:fromDataSource:]): Cancel prompting using the standard panel. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): Use WebDownload instead of NSURLDownload. * WebView.subproj/WebView.h: Remove unneeded @class directives, and mention WebDownload instead of NSURLDownload. * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _downloadURL:toDirectory:]): Use WebDownload instead of NSURLDownload. (-[WebView _cacheResourceLoadDelegateImplementations]): Track auth methods too. 2003-04-30 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Changed cookie-related class names: WebCookie -> NSHTTPCookie WebCookiePrivate -> NSHTTPCookieInternal WebCookieManager -> NSHTTPCookieStorage WebCookieManagerPrivate -> NSHTTPCookieStorageInternal * WebCoreSupport.subproj/WebCookieAdapter.m: (-[WebCookieAdapter cookiesEnabled]): (-[WebCookieAdapter cookiesForURL:]): (-[WebCookieAdapter setCookies:forURL:policyBaseURL:]): 2003-04-30 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Changed file names for these classes. The contents of the files themselves remain unchanged. WebCookie -> NSHTTPCookie. WebCookieManager -> NSHTTPCookieStorage. * WebCoreSupport.subproj/WebCookieAdapter.m: * WebView.subproj/WebMainResourceClient.m: 2003-04-30 Darin Adler <darin@apple.com> Reviewed by Ken. - make change to avoid misunderstanding that led to bug report 3179394 "Safari: Request that temp files use actual file extensions" * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): Don't put a dot between "SafariPlugInStream" and the the 6-digit unique number, so the number does not look like an extension. Also make it "WebKitPlugInStream" since this is used for other WebKit clients, and not just Safari. * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2003-04-29 Richard Williamson <rjw@apple.com> API changes from final review meeting. Added textEncodingName method to WebDataSource. Reviewed by Chris. * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource textEncodingName]): 2003-04-29 Chris Blumenberg <cblu@apple.com> Updated to use the new NSURLDownload API. Reviewed by rjw. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): * WebView.subproj/WebViewPrivate.m: (-[WebView _downloadURL:toDirectory:]): 2003-04-29 Richard Williamson <rjw@apple.com> Added "Copyright (C) 2003 Apple Computer, Inc. All rights reserved." to all public headers. Also made formatting consistent. Reviewed by darin. * Carbon.subproj/CarbonUtils.h: * Carbon.subproj/HIWebView.h: * History.subproj/WebBackForwardList.h: * History.subproj/WebHistory.h: * History.subproj/WebHistoryItem.h: * Misc.subproj/WebKit.h: * Misc.subproj/WebKitErrors.h: * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDocument.h: * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrameLoadDelegate.h: * WebView.subproj/WebFrameView.h: * WebView.subproj/WebPolicyDelegate.h: * WebView.subproj/WebPreferences.h: * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebUIDelegate.h: * WebView.subproj/WebView.h: 2003-04-28 Don Melton <gramps@apple.com> Fixed 3225050 -- Default font size should be 16px Fixed 3241813 -- No longer spoof as WinIE for abcnews.go.com when default font size becomes 16px Reviewed by Darin and Maciej. * English.lproj/StringsNotToBeLocalized.txt: Updated. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:usingPrinterFont:]): We need to adjust Times, Helvetica, and Courier to closely match the vertical metrics of their Microsoft counterparts that are the de facto web standard. The AppKit adjustment of 20% is too big and is incorrectly added to line spacing, so we use a 15% adjustment instead and add it to the ascent. * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): Changed default font size from 14 to 16 pixels and default fixed font size from 14 to 13 pixels. Changed standard font from Lucida Grande to Times, serif font from Times New Roman to Times, and sans serif font from Lucida Grande to Helvetica. Also replaced some stray tabs with spaces and made a few other anal-retentive formatting changes. * WebView.subproj/WebUserAgentSpoofTable.c: (hash): (_web_findSpoofTableEntry): * WebView.subproj/WebUserAgentSpoofTable.gperf: No longer spoof as Windows MSIE for abcnews.go.com since we've also changed the default font size. 2003-04-28 Richard Williamson <rjw@apple.com> API changes from final review meeting. goBackOrForwardToItem: -> goToBackForwardItem: drop "Window" from WebUIDelegate method names. WebElementIsSelectedTextKey -> WebElementIsSelectedKey Cross-frame searchFor on WebView now public. Reviewed by Chris. * Plugins.subproj/WebBaseNetscapePluginView.m: * WebCoreSupport.subproj/WebBridge.m: * WebKit.exp: * WebView.subproj/WebDefaultContextMenuDelegate.m: * WebView.subproj/WebDefaultUIDelegate.m: * WebView.subproj/WebFrame.h: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebHTMLView.m: * WebView.subproj/WebHTMLViewPrivate.m: * WebView.subproj/WebImageView.m: * WebView.subproj/WebPolicyDelegate.h: * WebView.subproj/WebTextView.m: * WebView.subproj/WebUIDelegate.h: * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: 2003-04-28 Ken Kocienda <kocienda@apple.com> Reviewed by Chris * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setResponse:]): _lastModifiedDate on NSURLResponse is now SPI. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady:]): Ditto. 2003-04-27 Chris Blumenberg <cblu@apple.com> Improved headerdoc comments. * Misc.subproj/WebKitErrors.h: * WebView.subproj/WebFrameLoadDelegate.h: 2003-04-25 Don Melton <gramps@apple.com> Backed out Richard's (hopefully) accidental checkin of our experiments from earlier today. Otherwise many layout tests are hosed. But this change, or something like it, will arrive soon. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:usingPrinterFont:]): 2003-04-25 Richard Williamson <rjw@apple.com> API changes from final review meeting. WebView: Added canShowMIMETypeAsHTML: WebFrameView: Removed scrollView Removed isDocumentHTML WebDataSource: Removed isDocumentHTML Reviewed by Chris. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:usingPrinterFont:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _layoutChildren]): (-[WebDataSource _mainDocumentError]): (-[WebDataSource _isDocumentHTML]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _makeDocumentView]): (-[WebFrame _setState:]): (-[WebFrame _isLoadComplete]): * WebView.subproj/WebFrameView.h: * WebView.subproj/WebFrameView.m: (-[WebFrameView setAllowsScrolling:]): (-[WebFrameView allowsScrolling]): (-[WebFrameView documentView]): (-[WebFrameView drawRect:]): (-[WebFrameView setFrameSize:]): * WebView.subproj/WebFrameViewPrivate.h: * WebView.subproj/WebFrameViewPrivate.m: (-[WebFrameView _setDocumentView:]): (-[WebFrameView _scrollView]): (-[WebFrameView _contentView]): (-[WebFrameView _verticalKeyboardScrollAmount]): (-[WebFrameView _horizontalKeyboardScrollAmount]): (-[WebFrameView _scrollToBottomLeft]): (+[WebFrameView _viewTypesAllowImageTypeOmission:]): (+[WebFrameView _canShowMIMETypeAsHTML:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _setPrinting:pageWidth:]): * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _updateMouseoverWithEvent:]): * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (+[WebView canShowMIMETypeAsHTML:]): 2003-04-25 Chris Blumenberg <cblu@apple.com> Renamed WebDownload to NSURLDownload and moved it to WebFoundation. Reviewed by rjw. * Downloads.subproj/WebBinHexDecoder.h: Removed. * Downloads.subproj/WebBinHexDecoder.m: Removed. * Downloads.subproj/WebDownload.h: Removed. * Downloads.subproj/WebDownload.m: Removed. * Downloads.subproj/WebDownloadDecoder.h: Removed. * Downloads.subproj/WebDownloadPrivate.h: Removed. * Downloads.subproj/WebGZipDecoder.h: Removed. * Downloads.subproj/WebGZipDecoder.m: Removed. * Downloads.subproj/WebMacBinaryDecoder.h: Removed. * Downloads.subproj/WebMacBinaryDecoder.m: Removed. * Downloads.subproj/crc16.h: Removed. * Downloads.subproj/crc16.m: Removed. * English.lproj/Localizable.strings: * English.lproj/StringsNotToBeLocalized.txt: * Misc.subproj/WebKit.h: * Misc.subproj/WebKitErrors.h: * Misc.subproj/WebKitErrors.m: (-[NSError _initWithPluginErrorCode:contentURLString:pluginPageURLString:pluginName:MIMEType:]): (registerErrors): * Misc.subproj/WebNSWorkspaceExtras.h: Removed. * Misc.subproj/WebNSWorkspaceExtras.m: Removed. * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient initWithDataSource:]): (-[WebMainResourceClient continueAfterContentPolicy:response:]): * WebView.subproj/WebView.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _downloadURL:toDirectory:]): 2003-04-25 Richard Williamson <rjw@apple.com> Final API review changes. parent -> parentFrame children -> childFrames Reviewed by Chris. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _setPrinting:pageWidth:]): 2003-04-25 Richard Williamson <rjw@apple.com> Final API review changes. parent -> parentFrame children -> childFrames Reviewed by Chris. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge childFrames]): (-[WebBridge frameDetached]): 2003-04-25 Richard Williamson <rjw@apple.com> Final API review changes. WebFrame: parent -> parentFrame children -> childFrames loadString:baseURL: -> loadHTMLString:baseURL: laodData:encodingName:baseURL: -> loadData:MIMEType:textEncodingName:baseURL: Reviewed by Chris. * WebView.subproj/WebDataProtocol.h: * WebView.subproj/WebDataProtocol.m: (-[WebDataRequestParameters dealloc]): (-[NSURLRequest _webDataRequestMIMEType]): (-[NSURLRequest _webDataRequestSetMIMEType:]): (-[WebDataProtocol startLoading]): * WebView.subproj/WebDataSource.m: (-[WebDataSource isLoading]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _recursiveStopLoading]): (-[WebDataSource _layoutChildren]): (-[WebDataSource _defersCallbacksChanged]): * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (-[WebFrame loadHTMLString:baseURL:]): (-[WebFrame findFrameNamed:]): (-[WebFrame parentFrame]): (-[WebFrame childFrames]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _createItem]): (-[WebFrame _descendantFrameNamed:]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _isLoadComplete]): (+[WebFrame _recursiveCheckCompleteFromFrame:]): (-[WebFrame _textSizeMultiplierChanged]): (-[WebFrame _viewWillMoveToHostWindow:]): (-[WebFrame _viewDidMoveToHostWindow]): (-[WebFrame _saveDocumentAndScrollState]): (-[WebFrame _loadDataSource:withLoadType:formState:]): * WebView.subproj/WebViewPrivate.m: (-[WebViewPrivate _clearControllerReferences:]): (-[WebView _frameForDataSource:fromFrame:]): (-[WebView _frameForView:fromFrame:]): 2003-04-25 Chris Blumenberg <cblu@apple.com> Don't do "@class WebDataSource" as that class isn't mentioned in this file. * WebView.subproj/WebFrameLoadDelegate.h: 2003-04-25 Chris Blumenberg <cblu@apple.com> Turned WebLocationChangeDelegate into WebFrameLoadDelegate. Renamed WebFrameLoadDelegate all methods to pass a frame instead of the data source. Reviewed by rjw. * English.lproj/Localizable.strings: * Misc.subproj/WebKit.h: * Misc.subproj/WebKitErrors.h: * Misc.subproj/WebKitErrors.m: (registerErrors): * WebCoreSupport.subproj/WebBridge.m: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): (-[WebDataSource _setTitle:]): (-[WebDataSource _setRequest:]): (-[WebDataSource _updateIconDatabaseWithURL:]): * WebView.subproj/WebDefaultFrameLoadDelegate.h: Added. * WebView.subproj/WebDefaultFrameLoadDelegate.m: Added. (+[WebDefaultFrameLoadDelegate sharedFrameLoadDelegate]): (-[WebDefaultFrameLoadDelegate webView:didStartProvisionalLoadForFrame:]): (-[WebDefaultFrameLoadDelegate webView:didReceiveServerRedirectForProvisionalLoadForFrame:]): (-[WebDefaultFrameLoadDelegate webView:didFailProvisionalLoadWithError:forFrame:]): (-[WebDefaultFrameLoadDelegate webView:didCommitLoadForFrame:]): (-[WebDefaultFrameLoadDelegate webView:didReceiveTitle:forFrame:]): (-[WebDefaultFrameLoadDelegate webView:didReceiveIcon:forFrame:]): (-[WebDefaultFrameLoadDelegate webView:didFinishLoadForFrame:]): (-[WebDefaultFrameLoadDelegate webView:didFailLoadWithError:forFrame:]): (-[WebDefaultFrameLoadDelegate webView:didChangeLocationWithinPageForFrame:]): (-[WebDefaultFrameLoadDelegate webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:]): (-[WebDefaultFrameLoadDelegate webView:didCancelClientRedirectForFrame:]): (-[WebDefaultFrameLoadDelegate webView:willCloseFrame:]): * WebView.subproj/WebDefaultLocationChangeDelegate.h: Removed. * WebView.subproj/WebDefaultLocationChangeDelegate.m: Removed. * WebView.subproj/WebFrame.m: * WebView.subproj/WebFrameLoadDelegate.h: Added. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _closeOldDataSources]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _isLoadComplete]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:formState:]): (-[WebFrame _clientRedirectedTo:delay:fireDate:lockHistory:]): (-[WebFrame _clientRedirectCancelled]): * WebView.subproj/WebLocationChangeDelegate.h: Removed. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient interruptForPolicyChangeError]): * WebView.subproj/WebPolicyDelegate.h: * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView setFrameLoadDelegate:]): (-[WebView frameLoadDelegate]): * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebViewPrivate dealloc]): (-[WebView _frameLoadDelegateForwarder]): 2003-04-25 John Sullivan <sullivan@apple.com> - fixed 3240676 -- REGRESSION: Using old Safari then new one erases history Reviewed by Darin. * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate _loadHistoryGuts:URL:error:]): The new code to use a synchronous NSURLConnection to read the property list file did not take into account the two possible formats of the file (NSArray or NSDictionary), so reading old-style history files was completely broken. While in here, I distributed the variable declarations to first use. 2003-04-24 Maciej Stachowiak <mjs@apple.com> Fixed build. * Panels.subproj/WebStandardPanels.m: (-[WebStandardPanels setUsesStandardAuthenticationPanel:]): 2003-04-24 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. Updated for auth API changes. * Panels.subproj/WebStandardPanels.m: (-[WebStandardPanels setUsesStandardAuthenticationPanel:]): 2003-04-24 Richard Williamson <rjw@apple.com> Final API review changes. Renamed WebWindowOperationsDelegate to WebUIDelegate. Merged WebContextMenuDelegate into WebUIDelegate. Fixed crasher if history file doesn't exist. Reviewed by Ken. * History.subproj/WebHistory.h: * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate _loadHistoryGuts:URL:error:]): * Misc.subproj/WebKit.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadPluginRequest:]): (-[WebBaseNetscapePluginView status:]): * Plugins.subproj/WebPluginController.m: (-[WebPluginController showStatus:]): * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): (-[WebBridge showWindow]): (-[WebBridge areToolbarsVisible]): (-[WebBridge setToolbarsVisible:]): (-[WebBridge isStatusBarVisible]): (-[WebBridge setStatusBarVisible:]): (-[WebBridge setWindowFrame:]): (-[WebBridge windowFrame]): (-[WebBridge setWindowContentRect:]): (-[WebBridge windowContentRect]): (-[WebBridge setWindowIsResizable:]): (-[WebBridge windowIsResizable]): (-[WebBridge firstResponder]): (-[WebBridge makeFirstResponder:]): (-[WebBridge closeWindow]): (-[WebBridge runJavaScriptAlertPanelWithMessage:]): (-[WebBridge runJavaScriptConfirmPanelWithMessage:]): (-[WebBridge runJavaScriptTextInputPanelWithPrompt:defaultText:returningText:]): (-[WebBridge runOpenPanelForFileButtonWithResultListener:]): (-[WebBridge setStatusText:]): (-[WebBridge focusWindow]): * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebContextMenuDelegate.h: Removed. * WebView.subproj/WebDefaultContextMenuDelegate.h: * WebView.subproj/WebDefaultContextMenuDelegate.m: * WebView.subproj/WebDefaultUIDelegate.h: * WebView.subproj/WebDefaultUIDelegate.m: (+[WebDefaultUIDelegate sharedUIDelegate]): (-[WebDefaultUIDelegate dealloc]): * WebView.subproj/WebDefaultWindowOperationsDelegate.h: Removed. * WebView.subproj/WebDefaultWindowOperationsDelegate.m: Removed. * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueLoadRequestAfterNewWindowPolicy:frameName:formState:]): * WebView.subproj/WebFrameView.m: * WebView.subproj/WebHTMLViewPrivate.m: * WebView.subproj/WebUIDelegate.h: * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView setUIDelegate:]): (-[WebView UIDelegate]): (-[WebView downloadDelegate]): * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebViewPrivate init]): (-[WebViewPrivate dealloc]): (-[WebView _openNewWindowWithRequest:]): (-[WebView _menuForElement:]): (-[WebView _mouseDidMoveOverElement:modifierFlags:]): (-[WebView _UIDelegateForwarder]): * WebView.subproj/WebWindowOperationsDelegate.h: Removed. 2003-04-24 Richard Williamson <rjw@apple.com> Final API review changes. * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem setAlternateTitle:]): (-[WebHistoryItem initFromDictionaryRepresentation:]): 2003-04-24 Richard Williamson <rjw@apple.com> Final API review changes. Reviewed by Chris. * History.subproj/WebBackForwardList.h: * History.subproj/WebBackForwardList.m: (-[WebBackForwardList containsItem:]): (-[WebBackForwardList capacity]): (-[WebBackForwardList setCapacity:]): (-[WebBackForwardList _clearPageCache]): (-[WebBackForwardList setPageCacheSize:]): (-[WebBackForwardList _setUsesPageCache:]): (-[WebBackForwardList _usesPageCache]): * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: (+[WebHistory optionalSharedHistory]): (+[WebHistory setOptionalSharedHistory:]): (-[WebHistory init]): (-[WebHistory loadFromURL:error:]): (-[WebHistory saveToURL:error:]): * History.subproj/WebHistoryItemPrivate.h: * History.subproj/WebHistoryPrivate.h: * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate init]): (-[WebHistoryPrivate dealloc]): (-[WebHistoryPrivate _loadHistoryGuts:URL:error:]): (-[WebHistoryPrivate loadFromURL:error:]): (-[WebHistoryPrivate _saveHistoryGuts:URL:error:]): (-[WebHistoryPrivate saveToURL:error:]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setTitle:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): (-[WebFrame _canCachePage]): (-[WebFrame _purgePageCache]): 2003-04-24 Maciej Stachowiak <mjs@apple.com> Reviewed by Chris. * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForChallenge:]): Update for new Challenge API. 2003-04-24 Chris Blumenberg <cblu@apple.com> Renamed - [NSURLResponse suggestedFilenameForSaving] to suggestedFilename and moved it to WebFoundation. Reviewed by mjs. * Downloads.subproj/WebDownload.m: (-[WebDownload _createFileIfNecessary]): * English.lproj/Localizable.strings: * English.lproj/StringsNotToBeLocalized.txt: * Misc.subproj/WebNSURLResponseExtras.h: Removed. * Misc.subproj/WebNSURLResponseExtras.m: Removed. * Plugins.subproj/WebNullPluginView.m: include NSError to unbreak build. * WebKit.pbproj/project.pbxproj: 2003-04-24 Chris Blumenberg <cblu@apple.com> Removed WebPluginError and instead added fields to the userInfo of NSError for plug-in specific errors. Reviewed by rjw. * Misc.subproj/WebKitErrors.h: * Misc.subproj/WebKitErrors.m: (+[NSError _webKitErrorWithCode:failingURL:]): (-[NSError _initWithPluginErrorCode:contentURLString:pluginPageURLString:pluginName:MIMEType:]): * Misc.subproj/WebKitErrorsPrivate.h: * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebNullPluginView.h: * Plugins.subproj/WebNullPluginView.m: * Plugins.subproj/WebPlugInError.h: Removed. * Plugins.subproj/WebPlugInError.m: Removed. * Plugins.subproj/WebPluginErrorPrivate.h: Removed. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURLString:attributes:baseURLString:MIMEType:]): (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURLString:]): * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate webView:plugInFailedWithError:dataSource:]): * WebView.subproj/WebResourceLoadDelegate.h: 2003-04-24 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed 3210096 -- server identifies page as UTF-8, page identifies itself as windows-1252, server must win * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge receivedData:withDataSource:]): Change for new WebCore API. Pass the encoding in a separate setEncoding call rather than as a parameter in addData. Also don't handle default encoding here any more. Default encoding is now handled the same way all the other preferences are, in a way that works better on the WebCore side anyway; nil or empty string means use the default encoding. 2003-04-24 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Changed WebError to NSError * Downloads.subproj/WebDownload.h: * Downloads.subproj/WebDownload.m: (-[WebDownload connection:didReceiveData:]): (-[WebDownload connectionDidFinishLoading:]): (-[WebDownload connection:didFailLoadingWithError:]): (-[WebDownload _decodeData:]): (-[WebDownload _writeDataForkData:resourceForkData:]): (-[WebDownload _didCloseFile:]): (-[WebDownload _cancelWithError:]): (-[WebDownload _errorWithCode:]): (CloseCompletionCallback): * English.lproj/StringsNotToBeLocalized.txt: * Misc.subproj/WebIconLoader.m: (-[WebIconLoader connection:didFailLoadingWithError:]): * Misc.subproj/WebKitErrors.h: * Misc.subproj/WebKitErrors.m: (+[NSError _webKitErrorWithCode:failingURL:]): (registerErrors): * Misc.subproj/WebKitErrorsPrivate.h: * Plugins.subproj/WebNetscapePluginRepresentation.h: * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedError:withDataSource:]): * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream connection:didFailLoadingWithError:]): * Plugins.subproj/WebPlugInError.h: * Plugins.subproj/WebPlugInError.m: * WebCoreSupport.subproj/WebBridge.m: * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): (-[WebSubresourceClient receivedError:]): (-[WebSubresourceClient connection:didFailLoadingWithError:]): * WebKit.exp: * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:didFailLoadingWithError:]): (-[WebBaseResourceHandleDelegate cancelWithError:]): (-[WebBaseResourceHandleDelegate cancelledError]): * WebView.subproj/WebDataProtocol.m: (-[WebDataProtocol startLoading]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _stopLoadingInternal]): (-[WebDataSource _setMainDocumentError:]): (-[WebDataSource _receivedError:complete:]): (-[WebDataSource _stopLoadingWithError:]): (-[WebDataSource _mainDocumentError]): * WebView.subproj/WebDefaultLocationChangeDelegate.m: (-[WebDefaultLocationChangeDelegate webView:locationChangeDone:forDataSource:]): * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate webView:unableToImplementPolicyWithError:frame:]): * WebView.subproj/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate webView:resource:didFailLoadingWithError:fromDataSource:]): * WebView.subproj/WebDocument.h: * WebView.subproj/WebFrame.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _handleUnimplementablePolicyWithErrorCode:forURL:]): * WebView.subproj/WebFrameView.m: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation receivedError:withDataSource:]): * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation receivedError:withDataSource:]): * WebView.subproj/WebLocationChangeDelegate.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:]): (-[WebMainResourceClient cancelWithError:]): (-[WebMainResourceClient interruptForPolicyChangeError]): (-[WebMainResourceClient connection:didFailLoadingWithError:]): (-[WebResourceDelegateProxy connection:didFailLoadingWithError:]): * WebView.subproj/WebPolicyDelegate.h: * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebTextRepresentation.m: (-[WebTextRepresentation receivedError:withDataSource:]): * WebView.subproj/WebView.h: * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _receivedError:fromDataSource:]): (-[WebView _mainReceivedError:fromDataSource:complete:]): 2003-04-24 Darin Adler <darin@apple.com> Reviewed by John. * WebView.subproj/WebViewPrivate.m: (-[WebView _updateWebCoreSettingsFromPreferences:]): Added a call to the new setDefaultTextEncoding: method in WebCore. A preparation step for some encoding bug fixes. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addSuperviewObservers]): Improved a comment. === Safari-75 === 2003-04-24 Maciej Stachowiak <mjs@apple.com> (checked in by Darin) Reviewed by Ken and Darin. Fixed an authentication crashing bug that crept into the last few changes, plus a typo. * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForChallenge:]): Remove extra space. (-[WebAuthenticationPanel runAsSheetOnWindow:withChallenge:]): Store the challenge properly. 2003-04-22 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. Adjusted for NSURLCredential changes. * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel runAsModalDialogWithChallenge:]): (-[WebAuthenticationPanel sheetDidEnd:returnCode:contextInfo:]): 2003-04-23 Chris Blumenberg <cblu@apple.com> Reviewed by darin. * English.lproj/StringsNotToBeLocalized.txt: updated 2003-04-23 Chris Blumenberg <cblu@apple.com> Fixed: 3161374 - safari windows don't allow text/URL dragging on the first click Reviewed by john. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _isSelectionEvent:]): new, determines if the event occurred over the selection (-[WebHTMLView acceptsFirstMouse:]): newly implemented, return result of _isSelectionEvent: (-[WebHTMLView shouldDelayWindowOrderingForEvent:]): newly implemented, return result of _isSelectionEvent: 2003-04-23 Chris Blumenberg <cblu@apple.com> Renamed the policy delegate methods. Reviewed by john. * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate webView:unableToImplementPolicyWithError:frame:]): (-[WebDefaultPolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]): (-[WebDefaultPolicyDelegate webView:decidePolicyForNewWindowAction:request:newFrameName:decisionListener:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _handleUnimplementablePolicyWithErrorCode:forURL:]): (-[WebFrame _checkNewWindowPolicyForRequest:action:frameName:formState:andCall:withSelector:]): (-[WebFrame _checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient checkContentPolicyForResponse:]): * WebView.subproj/WebPolicyDelegate.h: 2003-04-22 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Updated to use API-approved methods for accessing protocol-specific URL request data. * WebView.subproj/WebDataProtocol.m: (-[NSURLRequest _webDataRequestParametersForReading]): (-[NSURLRequest _webDataRequestParametersForWriting]): 2003-04-22 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. Renamed classes to match API document. * Panels.subproj/WebAuthenticationPanel.h: * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForChallenge:]): (-[WebAuthenticationPanel runAsModalDialogWithChallenge:]): (-[WebAuthenticationPanel runAsSheetOnWindow:withChallenge:]): (-[WebAuthenticationPanel sheetDidEnd:returnCode:contextInfo:]): * Panels.subproj/WebPanelAuthenticationHandler.h: * Panels.subproj/WebPanelAuthenticationHandler.m: (-[WebPanelAuthenticationHandler init]): (-[WebPanelAuthenticationHandler dealloc]): (-[WebPanelAuthenticationHandler isReadyToStartAuthentication:]): (-[WebPanelAuthenticationHandler startAuthentication:]): (-[WebPanelAuthenticationHandler cancelAuthentication:]): (-[WebPanelAuthenticationHandler _authenticationDoneWithChallenge:result:]): * Panels.subproj/WebStandardPanels.m: (-[WebStandardPanels setUsesStandardAuthenticationPanel:]): 2003-04-21 Ken Kocienda <kocienda@apple.com> Reviewed by Darin API changes in NSURLProtocol and its subclasses: +canHandleURL: becomes +canInitWithRequest: +canonicalURLForURL: becomes +canonicalRequestForRequest: Added new _webIsDataProtocolURL: helper method. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): * WebView.subproj/WebDataProtocol.h: * WebView.subproj/WebDataProtocol.m: (+[WebDataProtocol _webIsDataProtocolURL:]): (+[WebDataProtocol canInitWithRequest:]): (+[WebDataProtocol canonicalRequestForRequest:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _addBackForwardItemClippedAtTarget:]): (-[WebFrame _transitionToCommitted:]): 2003-04-21 Darin Adler <darin@apple.com> * Plugins.subproj/WebNetscapePluginStream.m: Removed unnecessary #import of <WebFoundation/WebFoundation.h>. 2003-04-21 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. Updated for file renames. * Panels.subproj/WebAuthenticationPanel.h: * Panels.subproj/WebPanelAuthenticationHandler.h: * Panels.subproj/WebStandardPanels.m: 2003-04-21 Chris Blumenberg <cblu@apple.com> Fixed previous "Reviewed by". * ChangeLog: 2003-04-21 Chris Blumenberg <cblu@apple.com> Fixed: 3140990 - Safari: Error attempting to load movie from Rhino records Renamed plug-in view methods to mention that they take URL strings. Reviewed by john. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURLString:attributes:baseURLString:MIMEType:]): renamed, try to find the plug-in using the extension of the SRC URL if the plug-in isn't found using the MIME type. (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURLString:]): renamed 2003-04-18 Chris Blumenberg <cblu@apple.com> Fixed: 3139385 - don't accept drags from other frames in the same WebView Reviewed by john. * WebView.subproj/WebFrameView.m: moved drag destination code from WebFrameView to WebView (-[WebFrameView initWithFrame:]): removed drag registration code * WebView.subproj/WebFrameViewPrivate.h: * WebView.subproj/WebFrameViewPrivate.m: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): unregister drag types on the WebView (-[WebHTMLView draggedImage:endedAt:operation:]): reregister drag types on the WebView * WebView.subproj/WebImageView.m: (-[WebImageView mouseDragged:]): unregister drag types on the WebView (-[WebImageView draggedImage:endedAt:operation:]): reregister drag types on the WebView * WebView.subproj/WebView.m: moved drag destination code from WebFrameView to WebView (-[WebView draggingEntered:]): moved from WebFrameView (-[WebView prepareForDragOperation:]): ditto (-[WebView performDragOperation:]): ditto (-[WebView concludeDragOperation:]): ditto * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _registerDraggedTypes]): ditto 2003-04-17 John Sullivan <sullivan@apple.com> Reviewed by Maciej. * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate _loadHistoryGuts:]): if we can't load the file as a dictionary, try loading it the old-fashioned array way. This makes the history file format change forward-compatible. 2003-04-17 Chris Blumenberg <cblu@apple.com> Fixed: 3160751 - Can't use non-'.txt' file extension for text files? Reviewed by mjs. * English.lproj/StringsNotToBeLocalized.txt: * Misc.subproj/WebNSURLResponseExtras.m: (-[NSURL _web_suggestedFilenameForSavingWithMIMEType:]): don't correct the file extension for plain text files 2003-04-17 John Sullivan <sullivan@apple.com> - fixed 3232332 -- History file should be versioned since we might change it in the future - fixed 3220355 -- Console error message at launch when there's no history file Note: a downside of this change is that the history formats before and after this change are not compatible. You will get no history each time you cross that boundary by running different Safaris. Reviewed by Maciej. * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate _loadHistoryGuts:]): check for file-doesn't-exist case before complaining about being unable to read existing file; expect to read dictionary rather than array, and check version in dictionary. (-[WebHistoryPrivate _saveHistoryGuts:]): save dictionary that includes version as well as array of items by date. 2003-04-17 Richard Williamson <rjw@apple.com> Fixed typos in headerdoc comments. * WebView.subproj/WebFrame.h: 2003-04-17 Richard Williamson <rjw@apple.com> Drop down yet one more level to avoid intialization horkage. Call objc_getClass() instead of NSClassFromString(). Reviewed by darin. * WebView.subproj/WebHTMLViewPrivate.m: (+[WebHTMLView load]): 2003-04-17 Darin Adler <darin@apple.com> Reviewed by John. * WebView.subproj/WebDataProtocol.m: (+[NSURLRequest _webDataRequestURLForData:]): Register the WebDataProtocol here instead of doing it with a load method, since this is the bottleneck that must be used before that protocol is needed. It's good to have one less load method, and this may fix a problem reported by a Panther WebKit client on intrigue-dev too. 2003-04-16 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Fixed call to load synchronous URL. Now conforms to new API which allows callers to access error object associated with the load. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadItem:withLoadType:]): 2003-04-16 Chris Blumenberg <cblu@apple.com> - Progressively load plain text in our text view. - Fixed: 3177603 - vCards appear in browser, not downloaded Reviewed by darin. * WebView.subproj/WebTextRepresentation.m: (-[WebTextRepresentation setDataSource:]): added FIXME about document source of RTF not working (-[WebTextRepresentation receivedData:withDataSource:]): feed data to the text view, progressively for plain text * WebView.subproj/WebTextView.m: (+[WebTextView unsupportedTextMIMETypes]): include text/directory, another vcard MIME type (-[WebTextView setDataSource:]): do 1-time attribute settings (-[WebTextView dataSourceUpdated:]): do nothing 2003-04-16 Ken Kocienda <kocienda@apple.com> Reviewed by David Moved this NSURLProtocolClient implementor to API-approved interface. * WebView.subproj/WebDataProtocol.m: (-[WebDataProtocol startLoading]): 2003-04-16 Ken Kocienda <kocienda@apple.com> Fix deployment build breaker caused by uninitialized variable. * WebView.subproj/WebViewPrivate.m: (-[WebView _loadBackForwardListFromOtherView:]): 2003-04-16 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3226281 -- REGRESSION: crash in WebHTMLView removeMouseMovedObserver closing gist.com * Plugins.subproj/WebPluginController.m: (-[WebPluginController showStatus:]): Use _webView instead of _controller. * WebCoreSupport.subproj/WebTextRendererFactory.m: Remove stray semicolon. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView removeMouseMovedObserver]): Use _webView instead of _controller. (-[WebHTMLView menuForEvent:]): Ditto. (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Ditto. * WebView.subproj/WebHTMLViewPrivate.h: Rename _controller to _webView. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _webView]): Use _web_superviewOfClass to find the WebView. This dodges possible stale unretained pointer issues with getting the WebView through the WebFrame, which is what fixes the bug. (-[WebHTMLView _updateMouseoverWithEvent:]): Use _webView instead of _controller. (+[WebHTMLView _pasteboardTypes]): Put the types in order from most preferred to least. (-[WebHTMLView _writeSelectionToPasteboard:]): Ditto. 2003-04-15 Richard Williamson <rjw@apple.com> Create the dictionary for volatile values. Without this fix values were never volatile! Reviewed by mjs. * WebView.subproj/WebPreferences.m: (-[WebPreferences _init]): (-[WebPreferences init]): (+[WebPreferences standardPreferences]): (-[WebPreferences dealloc]): 2003-04-15 Richard Williamson <rjw@apple.com> Fix for 3226746. Remove some ancient and apparantly invalid cruft. Reviewed by trey. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setDataSource:]): 2003-04-15 Richard Williamson <rjw@apple.com> Fixed clipping of progressive images to correctly clip. Reviewed by darin. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): 2003-04-15 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Name change from WebCacheObject to NSCachedURLResponse. No functional changes. * WebView.subproj/WebDataProtocol.m: (-[WebDataProtocol startLoadingWithCacheObject:]): 2003-04-15 Trey Matteson <trey@apple.com> 3227514 Open window in "Same Page" should copy entire back/forward list New support to load a new view by copying the whole backforward list and driving the new view to the current item. Reviewed by John. * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _loadItem:]): Old routine, which only loaded an item. (-[WebView _loadItemsFromOtherView:]): New routine that does the works. 2003-04-15 Ken Kocienda <kocienda@apple.com> Reviewed by John Name change from WebProtocolClient to NSURLProtocolClient. No functional changes. * WebView.subproj/WebDataProtocol.m: (-[WebDataProtocol startLoadingWithCacheObject:]): 2003-04-15 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Name change from WebProtocol to NSURLProtocol. No functional changes. * WebView.subproj/WebDataProtocol.h: * WebView.subproj/WebDataProtocol.m: (-[NSURLRequest _webDataRequestParametersForReading]): (-[NSURLRequest _webDataRequestParametersForWriting]): (+[WebDataProtocol load]): * WebView.subproj/WebFrame.m: 2003-04-14 Trey Matteson <trey@apple.com> 3009051 - Find on Page stops (once) at end of page, should wrap automatically WebKit 3051546 - Find on Page doesn't work for frameset pages 3058437 - can have a selection in two frames at the same time (problem for finding in frames) 3097498 - Find Previous continues to "Find Next" until end of paragraph 3097507 - Find Next searches from previous find hit instead of current selection Primary changes here: I added a wrap flag to the searchFor method, which is needed to control how we search as we traverse the frame tree. A new method is added to WebView that knows about traversing the frame tree as we search. HTMLView and TextView both clear their selections when they lose first responder (see 3228554 for possible improvements to that change). Reviewed by Maciej. * Misc.subproj/WebSearchableTextView.m: Added wrap flag, pass on to TextView. Ensure we do some searching when we would previous get a zero range to search in. * WebView.subproj/WebDocument.h: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: These are all basic methods to support forwards and backwards traversal of the frame tree. Modeled after same methods we have for traversing the DOM. (-[WebFrame _nextSibling]): (-[WebFrame _previousSibling]): (-[WebFrame _lastChild]): (-[WebFrame _nextFrameWithWrap:]): (-[WebFrame _previousFrameWithWrap:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView searchFor:direction:caseSensitive:wrap:]): Added wrap flag, pass it to bridge. (-[WebHTMLView resignFirstResponder]): Clear selection when we lose firstResp. * WebView.subproj/WebTextView.m: (-[WebTextView resignFirstResponder]): Clear selection when we lose firstResp. * WebView.subproj/WebView.m: (-[WebView _currentFrame]): Return the frame holding the first responder. (-[WebView _searchFor:direction:caseSensitive:wrap:]): Main work: traverse the frame tree and drive the overall find. * WebView.subproj/WebViewPrivate.h: 2003-04-14 Chris Blumenberg <cblu@apple.com> Log time spent loading each plug-in. Reviewed by mjs. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _iconsForIconURLString:]): fixed logging code (-[WebIconDatabase _scaleIcon:toSize:]): fixed logging code * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): log time spent loading a plug-in * Plugins.subproj/WebPluginController.m: (-[WebPluginController startAllPlugins]): only log if there are plug-ins to start (-[WebPluginController stopAllPlugins]): only log if there are plug-ins to stop (-[WebPluginController destroyAllPlugins]): only log if there are plug-ins to destroy 2003-04-13 Trey Matteson <trey@apple.com> 3150693 - open new window on "same page" doesn't give me the same frame content The core is a new support method that loads a WebView given a HistoryItem, which thus restores all frames of that item, and optionally the form and scroll state. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem copyWithZone:]): Copy the docState, scrollPosition, isTargetItem. No good reason to have left these out when I wrote this method. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _saveDocumentAndScrollState]): New method to run the frame tree and save all form/scroll state to the current item. * WebView.subproj/WebView.m: _goToItem:withLoadType: moved to WebViewPrivate.m * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _goToItem:withLoadType:]): Moved from WebView.m, no change. (-[WebView _loadItem:showingInView:]): New method to load the view with the item. 2003-04-12 Chris Blumenberg <cblu@apple.com> Fixed: 3162338 - Embedding SVG with <object type="image/svg+xml"> doesn't work Reviewed by dave. * WebCoreSupport.subproj/WebImageRendererFactory.m: (-[WebImageRendererFactory supportedMIMETypes]): code moved from +[WebImageView supportedImageMIMETypes] * WebView.subproj/WebImageView.m: (+[WebImageView supportedImageMIMETypes]): return -[WebImageRendererFactory supportedMIMETypes] 2003-04-13 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. * WebView.subproj/WebDefaultWindowOperationsDelegate.m: (-[WebDefaultWindowOperationsDelegate webView:setContentRect:]): Implemented in terms of webView:setFrame: to save clients work. 2003-04-11 Chris Blumenberg <cblu@apple.com> Removed WebKitErrorResourceLoadInterruptedByPolicyChange error because it isn't used. Reviewed by john. * Misc.subproj/WebKitErrors.h: * Misc.subproj/WebKitErrors.m: (registerErrors): * WebKit.pbproj/project.pbxproj: 2003-04-11 Trey Matteson <trey@apple.com> 3148002 - printing shouldn't depend on the size of the window The basic strategy is copied from khtmlview's print method: We reset the width of the document to the paper width minus margins, and relayout before paginating and printing. Reviewed by Richard. * WebKit.pbproj/project.pbxproj: Someone is using an old version... * WebView.subproj/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView reflectScrolledClipView:]): Don't do the dynamic scrollbar update magic when printing. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView layoutToPageWidth:]): New routine, basically the old layout method with a new parameter. If we're given an width, we call a different bridge method. (-[WebHTMLView layout]): Just call above method with width==0 (-[WebHTMLView drawRect:]): Protect setting/resetting of graphics context and additional clip with a DURING/HANDLER. I saw an assertion failure that could be explained by this, so this is mostly a beartrap for that problem. (-[WebHTMLView _setPrinting:pageWidth:]): Pass page width through to others. (-[WebHTMLView beginDocument]): If we are not in a frame set, do a layout using the page width. (-[WebHTMLView endDocument]): Pass 0 to new pageWidth: arg. 2003-04-08 Trey Matteson <trey@apple.com> 3220349 - assertion failure in [WebFrame _recursiveGoToItem:...] hitting Back while loading movie The problem was that when we go back we call stopLoading on the top frame, but that has a bogus optimization to not do any work if state=Completed. That is a bogus test if a subframe is doing a load. The fix is to just always tell the dataSources to stopLoading. They already bail quickly when they are not loading, so there is no significant additional cost. Reviewed by Richard. * WebView.subproj/WebFrame.m: (-[WebFrame stopLoading]): === Safari-73 === 2003-04-10 Richard Williamson <rjw@apple.com> Fixed 3219525 Our work-around for the CG pattern cache bogosity was always bypassed, consequently we'd unnecessarily burn lots of memory filling that cache. Reviewed by mjs & gramps. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): (-[WebImageRenderer tileInRect:fromPoint:]): 2003-04-10 Darin Adler (Maciej committing for Darin) <darin@apple.com> Reviewed by Maciej. - fixed 3225042 - MallocDebug shows "access after deallocated" problem in WebFrameView * WebView.subproj/WebFrameView.m: (-[WebFrameView dealloc]): Nil out _private. (-[WebFrameView nextKeyView]): Check _private for nil. (-[WebFrameView previousKeyView]): Check _private for nil. 2003-04-10 Richard Williamson <rjw@apple.com> Fix performance regression with iBench (post 71). The iBench cheat was being defeated. Ensure that the layout timer is always invalidated when a frame completes or is cancelled. Reviewed by mjs & gramps. * WebView.subproj/WebFrame.m: (-[WebFrame stopLoading]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setState:]): 2003-04-10 Trey Matteson <trey@apple.com> 3224973 - Safari sometimes stores data for AUTOCOMPLETE=OFF fields and password fields Just glue for calling a new WC function. Reviewed by Darin. * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation elementWithName:inForm:]): === Safari-72 === 2003-04-10 Maciej Stachowiak <mjs@apple.com> Reviewed by Chris. - fixed 3224690 - REGRESSION: Download related errors aren't preserved across launches * WebKit.pbproj/project.pbxproj: Install WebKitErrorsPrivate.h as SPI. 2003-04-10 Darin Adler <darin@apple.com> Reviewed by Trey. - fixed 3224622 -- REGRESSION: in an empty window, repeated tabs don't cycle back to location field Added logic to WebFrameView's next/previous that matches the logic in WebHTMLView. Looking for a better solution some day to the whole nextKeyView thing. * WebView.subproj/WebFrameView.m: (-[WebFrameView nextKeyView]): If being called from nextValidKeyView, return the nextKeyView of the WebView rather than of self. (-[WebFrameView previousKeyView]): Ditto. (-[WebFrameView nextValidKeyView]): Set the inNextValidKeyView flag. (-[WebFrameView previousValidKeyView]): Ditto. * WebView.subproj/WebFrameViewPrivate.h: Add the inNextValidKeyView flag. 2003-04-10 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. Another launch time speedup - don't load the WebKit WebError strings until we actually make a WebKit error. This prevents the WebKit localized strings file from being loaded during normal startup. * Downloads.subproj/WebDownload.m: (+[WebDownloadPrivate initialize]): Don't register WebKit errors. (-[WebDownload _errorWithCode:]): Use _webKitErrorWithCode:failingURL: * Misc.subproj/WebKitErrors.m: (+[WebError _webKitErrorWithCode:failingURL:]): Wrapper that registers the WebKit error codes first. * Misc.subproj/WebKitErrorsPrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _handleUnimplementablePolicyWithErrorCode:forURL:]): Use _webKitErrorWithCode:failingURL: (-[WebFrame _loadItem:withLoadType:]): Use _webKitErrorWithCode:failingURL: * WebView.subproj/WebFrameView.m: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient interruptForPolicyChangeError]): Use _webKitErrorWithCode:failingURL: 2003-04-10 Chris Blumenberg <cblu@apple.com> Fixed: 3222896 - REGRESSION: sound plays after closing a window with a RealPlayer plug-in in it Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView viewDidMoveToHostWindow]): We were starting plug-in on window close because that's when the host window is set to nil. Just check if we now have a host window before we start. 2003-04-10 Darin Adler <darin@apple.com> Reviewed by Trey. - speed up startup by not calling [NSImage imageFileTypes] until we need to * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge frameRequiredForMIMEType:]): Call _viewClassForMIMEType instead of _viewTypes, since _viewClassForMIMEType is now optimized by not loading the image types unless needed. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _representationClass]): Call _representationClassForMIMEType instead of _repTypes, since _representationClassForMIMEType is now optimized by not loading the image types unless needed. (+[WebDataSource _repTypesAllowImageTypeOmission:]): Added. Moved the guts of _repTypes in here. If you pass YES, doesn't bother adding the image types yet. (+[WebDataSource _repTypes]): Now calls _repTypesAllowImageTypeOmission:NO. (+[WebDataSource _representationClassForMIMEType:]): First try the dictionary without requiring the image types, then only in the case where we get nil, try with the image types. * WebView.subproj/WebFrameViewPrivate.m: (-[WebFrameView _makeDocumentViewForDataSource:]): Call _viewClassForMIMEType instead of _viewTypes, since _viewClassForMIMEType is now optimized by not loading the image types unless needed. (+[WebFrameView _viewTypesAllowImageTypeOmission:]): Added. Moved the guts of _viewTypes in here. If you pass YES, doesn't bother adding the image types yet. (+[WebFrameView _viewTypes]): Now calls _viewTypesAllowImageTypeOmission:NO. (+[WebFrameView _viewClassForMIMEType:]): First try the dictionary without requiring the image types, then only in the case where we get nil, try with the image types. 2003-04-09 Trey Matteson <trey@apple.com> 3223413 - crash in [CompletionController controlTextDidChange] at travelocity.com This was a great one to get steps for repro - it has shown up at least twice before. The problem is that when there is a focused TextField within a frame, the proper FormDelegate messages were not being sent on refresh or b/f. The cause was that the FirstResponder would be reset in the middle of detaching the frame, at which point our object graph was already half taken apart. Fix is to detect that case before doing the detach work, and endEditing explicitly. Reviewed by Darin. * ChangeLog: * Misc.subproj/WebKitLogging.h: * Misc.subproj/WebKitLogging.m: New FormDelegate logging category. * WebCoreSupport.subproj/WebBridge.m: All changes in here are just calling LOG for the new category. (-[WebBridge controlTextDidBeginEditing:]): (-[WebBridge controlTextDidEndEditing:]): (-[WebBridge controlTextDidChange:]): (-[WebBridge control:textShouldBeginEditing:]): (-[WebBridge control:textShouldEndEditing:]): (-[WebBridge control:didFailToFormatString:errorDescription:]): (-[WebBridge control:didFailToValidatePartialString:errorDescription:]): (-[WebBridge control:isValidObject:]): (-[WebBridge control:textView:doCommandBySelector:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setDataSource:]): The fix, as described above. 2003-04-09 Richard Williamson <rjw@apple.com> Fix for 3222904. This change fixes the immediate symptoms of the bug, but we need to come back to this issue after beta 2. Bug 3223929 captures the other problems. Reviewed by gramps. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource __setRequest:]): (-[WebDataSource _setRequest:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _shouldReloadForCurrent:andDestination:]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): 2003-04-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Chris, Trey, Darin and Don. - fixed 3223568 - site icons lost when moving from older Safari to 71 * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _createFileDatabase]): Rename old database containing directory to new, so we carry over old databases. The format is forward but not backward compatible. (-[WebIconDatabase _loadIconDictionaries]): Treat no version at all as version 1, so we can load old-style databases. Reviewed by Trey. * English.lproj/StringsNotToBeLocalized.txt: Updated. 2003-04-09 Chris Blumenberg <cblu@apple.com> Fixed: 3223022 - Plug-in content bleeds onto frontmost tab Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView viewDidMoveToWindow]): Explicitly call setWindow when the plug-in view is moved out of the window so it is clipped out of sight. 2003-04-08 Trey Matteson <trey@apple.com> 3221355 document is numb to clicks after going back The layoutTimer now does a layout if the doc is in state Completed, in addition to LayoutAcceptable. Reviewed by Richard. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _timedLayout:]): 2003-04-08 Chris Blumenberg <cblu@apple.com> Fixed: 3221128 - Double grey lines on macromedia.com home page Flash relies on the ordering of attributes in the EMBED tag (which is really stupid). salign must come after scale. Changed our plug-in API's to preserve orderings using arrays rather than lose orderings when using dictionaries. Reviewed by trey. * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: * Plugins.subproj/WebNetscapePluginEmbeddedView.h: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:MIMEType:attributeKeys:attributeValues:]): take attributeKeys and attributeValues instead of a dictionary * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): create attributeKeys and attributeValues to pass to the above method (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]): create attributeKeys and attributeValues to pass to the above method 2003-04-08 Chris Blumenberg <cblu@apple.com> Fixed: 3220463 - REGRESSION: PDF viewer plug-in does not display (worked in 69 and previous) Reviewed by darin. * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView didStart]): always call redeliverStream. Have WebNetscapePluginRepresentation determine if it actually needs to do that. * Plugins.subproj/WebNetscapePluginRepresentation.h: * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedData:withDataSource:]): keep track of _dataLengthReceived which is independent of the data received by the data source (-[WebNetscapePluginRepresentation redeliverStream]): only redeliver the stream if _dataLengthReceived is greater than 0 2003-04-07 Chris Blumenberg <cblu@apple.com> Fixed: 3206018 - REGRESSION: Clicks on the BBC news ticker applet don't open story in new window MSIE and Netscape for Windows treat a nil target as _top. Since this is usually the target audience of applet developers, we will mimic this. This makes 3206018 behave as expected. Reviewed by gramps. * Plugins.subproj/WebPluginController.m: (-[WebPluginController showURL:inFrame:]): treat nil as _top. 2003-04-07 Richard Williamson <rjw@apple.com> API conveniences for IB. Reviewed by Maciej. * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView canGoBack]): (-[WebView canGoForward]): (-[WebView reload:]): (-[WebView canMakeTextSmaller]): (-[WebView canMakeTextLarger]): (-[WebView makeTextSmaller:]): (-[WebView makeTextLarger:]): 2003-04-07 Richard Williamson <rjw@apple.com> Fix for 3220988. Cancel frame load if it's detached before finished loading. Reviewed by Maciej. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge frameDetached]): * WebView.subproj/WebFrame.h: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _removeChild:]): 2003-04-07 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. - fixed 3219584 - REGRESSION: launch times appear slower in v71 * WebView.subproj/WebView.m: (+[WebView canShowMIMEType:]): Avoid loading plugin database if we can find a view without doing so. 2003-04-07 Darin Adler <darin@apple.com> * WebView.subproj/WebUserAgentSpoofTable.c: Regenerated. When I landed my last change to the .gperf file I forgot to land this. === Safari-71 === 2003-04-04 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed 3217687 -- REGRESSION: printing uses widths from screen fonts, messing up layout * WebCoreSupport.subproj/WebTextRendererFactory.m: Removed now-unused rendererWithFont: which called, the now-removed usingPrinterFonts method. WebCore now calls the one with the usingPrinterFont parameter. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): Remove setUsingPrinterFonts: calls. This is now handled by the document on the WebCore side. (-[WebHTMLView _setPrinting:]): Ditto. 2003-04-04 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. - fixed 3188914 - loop checking for Flash at http://www.scottsmind.com/celebrity_defacer/index.php * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): Take a mutable request, and make sure to set referrer to the frame URL (as other browsers do). (-[WebBaseNetscapePluginView getURLNotify:target:notifyData:]): pass an NSMutableURLRequest. (-[WebBaseNetscapePluginView getURL:target:]): Likewise. (-[WebBaseNetscapePluginView _postURLNotify:target:len:buf:file:notifyData:allowHeaders:]): If the plug-in passes a Content-Length header, take it out of the headers and truncate the content appropriately to make WebFoundation happy. 2003-04-03 Richard Williamson <rjw@apple.com> Fix checks for about: to avoid using our 'fake' request when using WebDataProtocol. This fixes the assertion in the Snippet Editor. Reviewed by mjs. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): 2003-04-03 Trey Matteson <trey@apple.com> 3218212 REGRESSION: page on screen draws ugly while printing is happening Turn autodisplay of the window off while we print. Reviewed by Darin. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView beginDocument]): Turn it off. (-[WebHTMLView endDocument]): and back on. 2003-04-03 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. - removed no-longer forwarding of become/resignFirstResponder * WebView.subproj/WebHTMLViewPrivate.m: Removed become/resignFirstResponder poses for WebNSTextView. 2003-04-03 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard and Don. - fixed 3218262 - REGRESSION: Page address becomes about:blank when command-clicking bookmark to load tab * WebView.subproj/WebDataProtocol.m: (-[NSURLRequest _webDataRequestParametersForWriting]): Renamed from _webDataRequestParameters. (-[NSURLRequest _webDataRequestParametersForReading]): Like the above, but make sure nto to create the part if it does not exist. (-[NSURLRequest _webDataRequestData]): Use _webDataRequestParametersForReading. (-[NSURLRequest _webDataRequestEncoding]): Likewise. (-[NSURLRequest _webDataRequestBaseURL]): Likewise. (-[NSURLRequest _webDataRequestSetData:]):Use _webDataRequestParametersForWriting. (-[NSURLRequest _webDataRequestSetEncoding:]): Likewise. (-[NSURLRequest _webDataRequestSetBaseURL:]): Likewise. (-[NSURLRequest _webDataRequestExternalRequest]): Use _webDataRequestParametersForReading. 2003-04-03 Richard Williamson <rjw@apple.com> Tweaks to minimize access to the parts of a WebDataRequest that turn out to be slow. Although we've changed NSURLRequest to be faster, it's still good to keep these tweaks. Reviewed by ken. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): * WebView.subproj/WebDataProtocol.h: * WebView.subproj/WebDataProtocol.m: (-[NSURLRequest _webDataRequestExternalRequest]): (+[WebDataProtocol canHandleURL:]): * WebView.subproj/WebDataSource.m: (-[WebDataSource request]): 2003-04-03 Trey Matteson <trey@apple.com> 3067928 - printing should not break lines in half This is just glue to call the right piece in WebCore. Reviewed by Darin. (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Defer to WebCore to set pagination boundary. 2003-04-03 Richard Williamson <rjw@apple.com> As requested by Nancy, drop "Is" and "Are" from setters, but leave them in place on the getters. Reviewed by cblu. * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (-[WebPreferences setJavaEnabled:]): (-[WebPreferences setJavaScriptEnabled:]): (-[WebPreferences setPlugInsEnabled:]): 2003-04-03 Darin Adler <darin@apple.com> Reviewed by Ken. - remove spoof entries as decided in meeting with Don, Dave, Mark Malone * WebView.subproj/WebUserAgentSpoofTable.gperf: Remove battle.net because it's only there to make Darin happy, and the site works fine without it. Remove pier1.com and disney.go.com because we want to try evangelism first in both those cases, and having a released version where the site works weakens our evangelism efforts. * WebView.subproj/WebUserAgentSpoofTable.c: Regenerated. - disable workaround for Panther bug in Panther builds * Misc.subproj/WebNSImageExtras.m: (-[NSImage _web_dissolveToFraction:]): Add ifdefs. 2003-04-02 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. - fixed 3213556 - VIP: parent.mainFrameWidth=undefined on page refresh results in missing content * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadItem:withLoadType:]): When reload or going back/forward, make sure to load the original URL of the item, not it's most recent URL. (-[WebFrame _loadURL:intoChild:]): Likewise. 2003-04-02 Richard Williamson <rjw@apple.com> Raise exceptions when these methods are called inappropriately. Reviewed by Trey. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList goBack]): (-[WebBackForwardList goForward]): (-[WebBackForwardList goToItem:]): 2003-04-02 Richard Williamson <rjw@apple.com> Added new API on WebFrame, loadData: and loadString: Reviewed by Maciej. Fixed loading of cocoa plugins. Reviewed by Chris. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList _entries]): * Plugins.subproj/WebBasePluginPackage.h: * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage bundle]): * Plugins.subproj/WebPluginDatabase.h: * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase init]): (-[WebPluginDatabase loadPluginIfNeededForMIMEType:]): (-[WebPluginDatabase dealloc]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): * WebView.subproj/WebDataProtocol.h: Added. * WebView.subproj/WebDataProtocol.m: Added. (-[WebDataRequestParameters copyWithZone:]): (-[WebDataRequestParameters mutableCopyWithZone:]): (-[WebDataRequestParameters dealloc]): (+[NSURLRequest _webDataRequestURLForData:]): (-[NSURLRequest _webDataRequestParameters]): (-[NSURLRequest _webDataRequestData]): (-[NSURLRequest _webDataRequestSetData:]): (-[NSURLRequest _webDataRequestEncoding]): (-[NSURLRequest _webDataRequestSetEncoding:]): (-[NSURLRequest _webDataRequestBaseURL]): (-[NSURLRequest _webDataRequestSetBaseURL:]): (-[NSURLRequest _webDataRequestExternalRequest]): (+[WebDataProtocol load]): (+[WebDataProtocol doesURLHaveInternalDataScheme:]): (+[WebDataProtocol canHandleURL:]): (+[WebDataProtocol canonicalURLForURL:]): (-[WebDataProtocol startLoadingWithCacheObject:]): (-[WebDataProtocol stopLoading]): * WebView.subproj/WebDataSource.m: (-[WebDataSource initialRequest]): (-[WebDataSource request]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady:]): * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (-[WebFrame loadRequest:]): (-[WebFrame loadString:baseURL:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _addBackForwardItemClippedAtTarget:]): (-[WebFrame _transitionToCommitted:]): * WebView.subproj/WebFrameViewPrivate.m: (-[WebFrameView _makeDocumentViewForDataSource:]): * WebView.subproj/WebView.m: (+[WebView canShowMIMEType:]): 2003-04-02 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. - fixed 3177183 - disneyland.com says "500 Internal Server Error" * WebView.subproj/WebUserAgentSpoofTable.gperf: Spoof as Mac IE for disney.go.com * WebView.subproj/WebUserAgentSpoofTable.c: Regenerated. 2003-04-02 Richard Williamson <rjw@apple.com> Reviewed by john. * WebView.subproj/WebPreferences.h: (-[WebPreferences setUserStyleSheetLocation:]): Cleaned up arg and comment. 2003-04-02 Richard Williamson <rjw@apple.com> Fix for 3200447. Use class_pose to pose so as to avoid indirect invocation of appkit class initializers. Reviewed by darin. * WebView.subproj/WebHTMLViewPrivate.m: (+[WebHTMLView load]): 2003-04-02 Richard Williamson <rjw@apple.com> Removed private headers. Reviewed by john. * Misc.subproj/WebKit.h: 2003-04-01 Trey Matteson <trey@apple.com> 3174227 - aggressive caching of generated pages causes problems with WIKI We decided to fix half the observed behavior, as all the bad behavior is arguably due to a mis-configured server (that sets a max-age=60 on all its pages). The fix is that when a redirect comes in response to a POST we force a load from origin, since this is a common technique sites do to prevent a post from ending up in the b/f list, and it is very likely you are on your way back to look at data that you believe you just edited. Reviewed by Ken. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadItem:withLoadType:]): Nit cleanup. Remove unused arg. (-[WebFrame _recursiveGoToItem:fromItem:withLoadType:]): Same nit cleanup. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient connection:willSendRequest:redirectResponse:]): Force loadFromOrigin if we have a redirect in response to a POST. * WebView.subproj/WebResourceLoadDelegate.h: Add headerdoc comment for redirectResponse param. 2003-04-01 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. - fixed 3214748 - REGRESSION: After using latest Safari for awhile, can't launch older Safaris (icon db problem) * Misc.subproj/WebIconDatabase.m: Changed icon cache path, since we are breaking compatibility and the old version does not support versioning. (-[WebIconDatabase _loadIconDictionaries]): Check version. (-[WebIconDatabase _updateFileDatabase]): Save version. 2003-04-01 Ken Kocienda <kocienda@apple.com> Reviewed by Darin NSURLConnectionDelegate is no longer a formal protocol. NSURLConnection no longer has a loadWithDelegate: method. Loads start implicitly at init time. Some clients have been updated to call the willSendRequest:redirectResponse: callback manually since this callback is no longer sent for initial loads. * Downloads.subproj/WebDownload.m: (-[WebDownload initWithRequest:]): (-[WebDownload _initWithLoadingResource:request:response:delegate:proxy:]): (-[WebDownload loadWithDelegate:]): * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]): * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate loadWithRequest:]): * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient loadWithRequest:]): (-[WebResourceDelegateProxy setDelegate:]): 2003-04-01 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3213918 -- REGRESSION: printing Mapquest directions, screen font is used, causing exception, crashes - fixed 3144287 -- CSS with media=print not used when printing * WebView.subproj/WebFramePrivate.m: (-[WebFrame _opened]): Don't call the reapplyStyles method directly here, use setNeedsToApplyStyles instead. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView reapplyStyles]): Pass the appropriate device type here. (-[WebHTMLView drawRect:]): Don't call setUsingPrinterFonts:NO at the end of this method if we were already using printer fonts at the start. This was the bug fix. (-[WebHTMLView _setPrinting:]): Renamed from _setUsingPrinterFonts since this now controls the styles used too, not just the fonts. (-[WebHTMLView beginDocument]): Updated for _setPrinting name change. (-[WebHTMLView endDocument]): Ditto. * WebView.subproj/WebHTMLViewPrivate.h: Renamed "usingPrinterFonts" field to "printing". 2003-04-01 Richard Williamson <rjw@apple.com> Fixed ~2% performance regression problem. The regression was caused by the allocation of a forwarder on every delegate callback. Modified code to only create forwarders once, and reset when delegates change. Reviewed by Ken. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCacheWithURL:response:size:]): * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate setDataSource:]): (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): (-[WebBaseResourceHandleDelegate connection:didReceiveData:]): (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): * WebView.subproj/WebView.m: (-[WebView setWindowOperationsDelegate:]): (-[WebView setResourceLoadDelegate:]): (-[WebView setContextMenuDelegate:]): (-[WebView setPolicyDelegate:]): (-[WebView setLocationChangeDelegate:]): * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebViewPrivate dealloc]): (-[WebView _locationChangeDelegateForwarder]): (-[WebView _resourceLoadDelegateForwarder]): (-[WebView _cacheResourceLoadDelegateImplementations]): (-[WebView _resourceLoadDelegateImplementations]): (-[WebView _policyDelegateForwarder]): (-[WebView _contextMenuDelegateForwarder]): (-[WebView _windowOperationsDelegateForwarder]): (-[_WebSafeForwarder forwardInvocation:]): * API-Issues.rtf: Notes to self. 2003-04-01 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Allowed update-alex-localizable-strings to sort this file. 2003-03-31 Trey Matteson <trey@apple.com> 3212724 - bookmarks and history items have screwed up designated inits and support code for: 3116315 - autocomplete needs some prioritization magic The main changes are adding and maintaining a visitCount to the HistoryItem, cleaning up the init methods of HistoryItem. Also lastVisitedDate is now set explicitly instead of automatically getting the current date. Reviewed by John. * History.subproj/WebHistory.m: (-[WebHistory addItemForURL:]): Set lastVisitedDate of new item. (-[WebHistory _itemForURLString:]): New helper routine. * History.subproj/WebHistoryItem.h: Conform to NSCopying. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem init]): Behave like a designated initializer. (-[WebHistoryItem copyWithZone:]): New. (-[WebHistoryItem initWithURL:title:]): Call the designated initializer. (-[WebHistoryItem initWithURL:target:parent:title:]): Call the designated initializer. Don't blindly init lastVisitedDate. (-[WebHistoryItem setLastVisitedDate:]): Update visitCount too. (-[WebHistoryItem visitCount]): New getter. (-[WebHistoryItem setVisitCount:]): New setter. (-[WebHistoryItem _mergeAutoCompleteHints:]): Combine autocomplete info of two items. Used when one item replaces another in the history. (-[WebHistoryItem dictionaryRepresentation]): Write visitCount. (-[WebHistoryItem initFromDictionaryRepresentation:]): Read visitCount. * History.subproj/WebHistoryItemPrivate.h: * History.subproj/WebHistoryPrivate.h: * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate addItem:]): Merge autocomplete date from old item to new. (-[WebHistoryPrivate itemForURLString:]): s/entry/item/ (-[WebHistoryPrivate containsItemForURLString:]): s/entry/item/ (-[WebHistoryPrivate containsURL:]): s/entry/item/ (-[WebHistoryPrivate itemForURL:]): s/entry/item/ (-[WebHistoryPrivate _loadHistoryGuts:]): Skip history items without visitDate. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): Update last visitTime when we revisit the same URL (since no new history item is created). 2003-03-31 Richard Williamson <rjw@apple.com> Fixed 3213637. We weren't calling the correct delegate method, setStatus: instead of webView:setStatus: Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView status:]): 2003-03-31 Maciej Stachowiak <mjs@apple.com> Reviewed by Chris. - fixed 3210813 - REGRESSION: full size stock chart on etrade shows up empty after viewing mini stock chart I fixed this by adding a "negative cache" of icon URLs that loaded something but failed to yield an icon. This prevents us from asking for the site icon over and over, which was messing up the session cookie. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase init]): (-[WebIconDatabase iconForURL:withSize:cache:]): (-[WebIconDatabase _updateFileDatabase]): (-[WebIconDatabase _iconsForIconURLString:]): (-[WebIconDatabase _setHaveNoIconForIconURL:]): (-[WebIconDatabase _releaseIconForIconURLString:]): * Misc.subproj/WebIconDatabasePrivate.h: * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]): (-[WebIconLoader connectionDidFinishLoading:]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _iconLoaderReceivedPageIcon:]): 2003-03-31 Darin Adler <darin@apple.com> * English.lproj/InfoPlist.strings: Changed "1.0 Beta" to "1.0 Beta 2". * WebKit.pbproj/project.pbxproj: Changed "1.0 Beta" to "1.0 Beta 2". * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. * English.lproj/Localizable.strings: Regenerated (new script, "1.0 Beta 2"). 2003-03-31 Richard Williamson <rjw@apple.com> Reviewed by darin. * History.subproj/WebHistory.h: Added use of WebHistoryItemsKey instead of @"Entries". * History.subproj/WebHistory.m:(-[WebHistory _sendNotification:entries:]): Use WebHistoryItemsKey as key instead of @"Entries". * History.subproj/WebHistoryItem.m: (-[WebHistoryItem init]): Fix double allocation of WebHistoryPrivate. * WebKit/WebKit.exp Added export for WebHistoryItemsKey * WebKit/API-Issues.rtf Notes. 2003-03-31 Darin Adler <darin@apple.com> Reviewed by Chris. - improved default behaviors in window operations delegate * WebView.subproj/WebDefaultWindowOperationsDelegate.m: (-[WebDefaultWindowOperationsDelegate webViewShowWindowBehindFrontmost:]): Removed unused method. (-[WebDefaultWindowOperationsDelegate webViewCloseWindow:]): Added default implementation, calls close on window. (-[WebDefaultWindowOperationsDelegate webViewFocusWindow:]): Added default implementation, makeKeyAndOrderFront. (-[WebDefaultWindowOperationsDelegate webViewUnfocusWindow:]): Added default implementation, uses _cycleWindowsReversed as needed. (-[WebDefaultWindowOperationsDelegate webViewFirstResponderInWindow:]): Added default implementation, calls firstResponder. (-[WebDefaultWindowOperationsDelegate webView:makeFirstResponderInWindow:]): Added default implementation, calls makeFirstResponder. (-[WebDefaultWindowOperationsDelegate webViewIsResizable:]): Added default implementation, calls showsResizeIndicator. (-[WebDefaultWindowOperationsDelegate webView:setResizable:]): Added default implementation, calls setShowsResizeIndicator. (-[WebDefaultWindowOperationsDelegate webView:setFrame:]): Use display:YES, not display:NO. (-[WebDefaultWindowOperationsDelegate webViewFrame:]): Return NSZeroRect if window is nil instead of random garbage. (-[WebDefaultWindowOperationsDelegate webView:setContentRect:]): Use display:YES, not display:NO. (-[WebDefaultWindowOperationsDelegate webViewContentRect:]): Return NSZeroRect if window is nil instead of random garbage. (-[WebDefaultWindowOperationsDelegate webView: runJavaScriptAlertPanelWithMessage:]): Added a FIXME because we should have a default implementation here. (-[WebDefaultWindowOperationsDelegate webView:runJavaScriptConfirmPanelWithMessage:]): Ditto. (-[WebDefaultWindowOperationsDelegate webView:runJavaScriptTextInputPanelWithPrompt:defaultText:]): Put a default implementation here. (-[WebDefaultWindowOperationsDelegate webView:runOpenPanelForFileButtonWithResultListener:]): Added a FIXME because we should have a default implementation here. 2003-03-29 Chris Blumenberg <cblu@apple.com> Fixed: 3178058 - Plug-ins are stopped/reloaded when switching tabs Made the "Enable plug-ins" preference toggle in real-time again. No events including null events are sent when a plug-in is in a non-frontmost tab. This causes Flash movies to pause (which is nice) and QT movies to continue to play. Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): use the current window, clip out the plug-in when not in an actual window (-[WebBaseNetscapePluginView restorePortState:]): use the current window (-[WebBaseNetscapePluginView sendEvent:]): added asserts (-[WebBaseNetscapePluginView sendActivateEvent:]): tweak (-[WebBaseNetscapePluginView sendNullEvent]): tweak (-[WebBaseNetscapePluginView restartNullEvents]): tweak (-[WebBaseNetscapePluginView isInResponderChain]): tweak (-[WebBaseNetscapePluginView performKeyEquivalent:]): tweak (-[WebBaseNetscapePluginView canStart]): new, implemented by subclasses (-[WebBaseNetscapePluginView didStart]): new, implemented by subclasses (-[WebBaseNetscapePluginView addWindowObservers]): new (-[WebBaseNetscapePluginView removeWindowObservers]): new (-[WebBaseNetscapePluginView start]): check pref, call canStart, addWindowObservers and didStart (-[WebBaseNetscapePluginView stop]): call removeWindowObservers (-[WebBaseNetscapePluginView currentWindow]): new, returns the actual window else the host window (-[WebBaseNetscapePluginView initWithFrame:]): observer pref change notifications (-[WebBaseNetscapePluginView dealloc]): call removeObserver (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): stop if there is no host window (-[WebBaseNetscapePluginView viewDidMoveToWindow]): start if we moved to a window (-[WebBaseNetscapePluginView viewWillMoveToHostWindow:]): stop if there will be no windows (-[WebBaseNetscapePluginView viewDidMoveToHostWindow]): start if there is a window (-[WebBaseNetscapePluginView preferencesHaveChanged:]): renamed, start or stop (-[WebBaseNetscapePluginView destroyStream:reason:]): tweak (-[NSData _web_locationAfterFirstBlankLine]): tweak * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView initWithFrame:]): call setAutoresizingMask here (-[WebNetscapePluginDocumentView canStart]): new, return YES if there is a data source (-[WebNetscapePluginDocumentView didStart]): redeliver the stream if there is any data (-[WebNetscapePluginDocumentView setDataSource:]): start if there is a current window (-[WebNetscapePluginDocumentView layout]): no need to call setWindow, this is done in the superclass (-[WebNetscapePluginDocumentView viewWillMoveToHostWindow:]): forward to super to make compiler happy (-[WebNetscapePluginDocumentView viewDidMoveToHostWindow]): forward to super to make compiler happy * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView didStart]): start the load (-[WebNetscapePluginEmbeddedView dataSource]): tweak * WebView.subproj/WebDocument.h: added viewWillMoveToHostWindow: and viewDidMoveToHostWindow * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _viewWillMoveToHostWindow:]): forward to document view and subframes (-[WebFrame _viewDidMoveToHostWindow]): forward to document view and subframes * WebView.subproj/WebHTMLView.m: (-[WebHTMLView viewWillMoveToHostWindow:]): forward to plug-in views (-[WebHTMLView viewDidMoveToHostWindow]): forward to plug-in views (-[NSArray _web_makePluginViewsPerformSelector:withObject:]): new * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _reset]): don't stop plug-ins here. WebBaseNetscapePluginView can handle that * WebView.subproj/WebImageView.m: (-[WebImageView viewWillMoveToHostWindow:]): implement new WebDocumentView methods (-[WebImageView viewDidMoveToHostWindow]): implement new WebDocumentView methods * WebView.subproj/WebTextView.m: (-[WebTextView viewWillMoveToHostWindow:]): implement new WebDocumentView methods (-[WebTextView viewDidMoveToHostWindow]): implement new WebDocumentView methods * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView setHostWindow:]): new (-[WebView hostWindow]): new * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebViewPrivate dealloc]): release the host window 2003-03-31 Darin Adler <darin@apple.com> Reviewed by John. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge nextKeyViewOutsideWebFrameViews]): Get next key view from WebView, only using the top level WebFrameView if the WebView doesn't have one set (for compatibility in case some of our current WebKit clients are using this). (-[WebBridge previousKeyViewOutsideWebFrameViews]): Ditto. 2003-03-31 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3211730 -- REGRESSION: Flash spawns blank page then loads new page inside banner itself * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadPluginRequest:]): Load the request in the frame we found or created, not always in our own frame (oops!). - other changes * History.subproj/WebHistory.h: Update comments to all say "Item" instead of "Entry". They didn't match the method names any more. * WebView.subproj/WebView.m: (-[WebView acceptsFirstResponder]): Return YES. (-[WebView becomeFirstResponder]): Pass first responder on to the WebFrameView in the same way the WebFrameView passes it on to the document view. 2003-03-30 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3204257 - CNN's 'war on iraq' ticker stops on mouseover * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _updateMouseoverWithEvent:]): When leaving an HTML view, tell it that the mouse moved outside everything in the view, even accounting for scrolled off portions (otherwise khtml gets confused). This makes cross-frame mouse enter/leave work properly. (-[WebHTMLView _clearLastHitViewIfSelf]): Method to clear last hit view, so we don't need to retain it. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView dealloc]): Call _clearLastHitViewIfSelf. 2003-03-28 Richard Williamson <rjw@apple.com> Fix typo in comments that broke headerdoc. * WebView.subproj/WebWindowOperationsDelegate.h: 2003-03-28 Ken Kocienda <kocienda@apple.com> Reviewed by John Imports NSURLConnection private header to access NSURLConnection code that did not make the API cut. * WebView.subproj/WebBaseResourceHandleDelegate.m: * WebView.subproj/WebMainResourceClient.m: 2003-03-28 Ken Kocienda <kocienda@apple.com> Reviewed by Trey NSURLConnection class method changed name: canInitWithRequest: -> canHandleRequest: Moved to API-approved model for synchronous loads. Removed fixme I put in yesterday having to do with reposting form data. The feature is fully functional again. * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate webView:decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadItem:fromItem:withLoadType:]): (-[WebFrame _continueAfterNavigationPolicy:]): 2003-03-28 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Cosmetic change. Instances of 'resource' as a local variable name have been changed to 'connection'. Some other changes related to this cosmetic cleanup were done as well. As part of this change, I needed to change some 'connection' method arguments to 'con' to avoid the name conflict now that instance variables are named .connection'. * Downloads.subproj/WebDownload.m: (-[WebDownloadPrivate dealloc]): (-[WebDownload initWithRequest:]): (-[WebDownload _initWithLoadingResource:request:response:delegate:proxy:]): (+[WebDownload _downloadWithLoadingResource:request:response:delegate:proxy:]): (-[WebDownload loadWithDelegate:]): (-[WebDownload _downloadEnded]): (-[WebDownload _cancelWithError:]): * Downloads.subproj/WebDownloadPrivate.h: * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream connection:didReceiveResponse:]): (-[WebNetscapePluginStream connection:didReceiveData:]): (-[WebNetscapePluginStream connectionDidFinishLoading:]): (-[WebNetscapePluginStream connection:didFailLoadingWithError:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient connection:willSendRequest:redirectResponse:]): (-[WebSubresourceClient connection:didReceiveResponse:]): (-[WebSubresourceClient connection:didReceiveData:]): (-[WebSubresourceClient connectionDidFinishLoading:]): (-[WebSubresourceClient connection:didFailLoadingWithError:]): * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate _releaseResources]): (-[WebBaseResourceHandleDelegate startLoading:]): (-[WebBaseResourceHandleDelegate loadWithRequest:]): (-[WebBaseResourceHandleDelegate setDefersCallbacks:]): (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): (-[WebBaseResourceHandleDelegate connection:didReceiveData:]): (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): (-[WebBaseResourceHandleDelegate connection:didFailLoadingWithError:]): (-[WebBaseResourceHandleDelegate cancelWithError:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:]): (-[WebMainResourceClient cancelWithError:]): (-[WebMainResourceClient connection:willSendRequest:redirectResponse:]): (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient connection:didReceiveResponse:]): (-[WebMainResourceClient connection:didReceiveData:]): (-[WebMainResourceClient connectionDidFinishLoading:]): (-[WebMainResourceClient connection:didFailLoadingWithError:]): (-[WebMainResourceClient startLoading:]): 2003-03-28 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Changed names for URL connection callback methods to use the API-approved names. No functional changes. * Downloads.subproj/WebDownload.h: * Downloads.subproj/WebDownload.m: (-[WebDownload _initWithLoadingResource:request:response:delegate:proxy:]): (-[WebDownload connection:willSendRequest:redirectResponse:]): (-[WebDownload connection:didReceiveResponse:]): (-[WebDownload connection:didReceiveData:]): (-[WebDownload connectionDidFinishLoading:]): (-[WebDownload connection:didFailLoadingWithError:]): * Misc.subproj/WebIconLoader.m: (-[WebIconLoader connectionDidFinishLoading:]): (-[WebIconLoader connection:willSendRequest:redirectResponse:]): (-[WebIconLoader connection:didReceiveResponse:]): (-[WebIconLoader connection:didReceiveData:]): (-[WebIconLoader connection:didFailLoadingWithError:]): * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream connection:didReceiveResponse:]): (-[WebNetscapePluginStream connection:didReceiveData:]): (-[WebNetscapePluginStream connectionDidFinishLoading:]): (-[WebNetscapePluginStream connection:didFailLoadingWithError:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCacheWithURL:response:size:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient connection:willSendRequest:redirectResponse:]): (-[WebSubresourceClient connection:didReceiveResponse:]): (-[WebSubresourceClient connection:didReceiveData:]): (-[WebSubresourceClient connectionDidFinishLoading:]): (-[WebSubresourceClient connection:didFailLoadingWithError:]): * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate connection:willSendRequest:redirectResponse:]): (-[WebBaseResourceHandleDelegate connection:didReceiveResponse:]): (-[WebBaseResourceHandleDelegate connection:didReceiveData:]): (-[WebBaseResourceHandleDelegate connectionDidFinishLoading:]): (-[WebBaseResourceHandleDelegate connection:didFailLoadingWithError:]): * WebView.subproj/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:]): (-[WebMainResourceClient connection:willSendRequest:redirectResponse:]): (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient connection:didReceiveResponse:]): (-[WebMainResourceClient connection:didReceiveData:]): (-[WebMainResourceClient connectionDidFinishLoading:]): (-[WebMainResourceClient connection:didFailLoadingWithError:]): (-[WebMainResourceClient startLoading:]): (-[WebResourceDelegateProxy connection:willSendRequest:redirectResponse:]): (-[WebResourceDelegateProxy connection:didReceiveResponse:]): (-[WebResourceDelegateProxy connection:didReceiveData:]): (-[WebResourceDelegateProxy connectionDidFinishLoading:]): (-[WebResourceDelegateProxy connection:didFailLoadingWithError:]): * WebView.subproj/WebResourceLoadDelegate.h: 2003-03-27 Chris Blumenberg <cblu@apple.com> Left out a "!" in my last check-in. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): 2003-03-27 Chris Blumenberg <cblu@apple.com> - Allow Netscape plug-ins that don't have resource files to load in Safari. - Added more error handling when loading plug-ins. Reviewed by darin. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): 2003-03-27 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3192344 - nil-deref in KWin::info scrolling amazon while other shopping tabs load - fixed 3098365 - Default window size changes as a result of popup windows - fixed 3189291 - javascript window.close() closes window, not just originating tab * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setWindowIsResizable:]): New bridge method, implemented by calling window operations delegate. (-[WebBridge windowIsResizable]): Likewise. (-[WebBridge firstResponder]): Likewise. (-[WebBridge makeFirstResponder:]): Likewise. (-[WebBridge closeWindow]): Likewise. 2003-03-27 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Changed WebResource to NSURLConnection. Some other "supporting" names changed as well. Note that there are no functional modifications, only name changes. * Downloads.subproj/WebDownload.m: (-[WebDownload initWithRequest:]): (-[WebDownload _initWithLoadingResource:request:response:delegate:proxy:]): (+[WebDownload _downloadWithLoadingResource:request:response:delegate:proxy:]): (-[WebDownload loadWithDelegate:]): (-[WebDownload resource:willSendRequest:]): (-[WebDownload resource:didReceiveResponse:]): (-[WebDownload resource:didReceiveData:]): (-[WebDownload resourceDidFinishLoading:]): (-[WebDownload resource:didFailLoadingWithError:]): * Downloads.subproj/WebDownloadPrivate.h: * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]): (-[WebIconLoader resourceDidFinishLoading:]): (-[WebIconLoader resource:willSendRequest:]): (-[WebIconLoader resource:didReceiveResponse:]): (-[WebIconLoader resource:didReceiveData:]): (-[WebIconLoader resource:didFailLoadingWithError:]): * Plugins.subproj/WebNetscapePluginStream.h: * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:]): (-[WebNetscapePluginStream resource:didReceiveResponse:]): (-[WebNetscapePluginStream resource:didReceiveData:]): (-[WebNetscapePluginStream resourceDidFinishLoading:]): (-[WebNetscapePluginStream resource:didFailLoadingWithError:]): * WebCoreSupport.subproj/WebBridge.m: * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient resource:willSendRequest:]): (-[WebSubresourceClient resource:didReceiveResponse:]): (-[WebSubresourceClient resource:didReceiveData:]): (-[WebSubresourceClient resourceDidFinishLoading:]): (-[WebSubresourceClient resource:didFailLoadingWithError:]): * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate loadWithRequest:]): (-[WebBaseResourceHandleDelegate resource:willSendRequest:]): (-[WebBaseResourceHandleDelegate resource:didReceiveResponse:]): (-[WebBaseResourceHandleDelegate resource:didReceiveData:]): (-[WebBaseResourceHandleDelegate resourceDidFinishLoading:]): (-[WebBaseResourceHandleDelegate resource:didFailLoadingWithError:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate webView:decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]): * WebView.subproj/WebDefaultResourceLoadDelegate.m: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueAfterNavigationPolicy:]): (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient resource:willSendRequest:]): (-[WebMainResourceClient resource:didReceiveResponse:]): (-[WebMainResourceClient resource:didReceiveData:]): (-[WebMainResourceClient resourceDidFinishLoading:]): (-[WebMainResourceClient resource:didFailLoadingWithError:]): (-[WebResourceDelegateProxy setDelegate:]): (-[WebResourceDelegateProxy resource:willSendRequest:]): (-[WebResourceDelegateProxy resource:didReceiveResponse:]): (-[WebResourceDelegateProxy resource:didReceiveData:]): (-[WebResourceDelegateProxy resourceDidFinishLoading:]): (-[WebResourceDelegateProxy resource:didFailLoadingWithError:]): * WebView.subproj/WebPolicyDelegate.h: * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.m: 2003-03-27 Richard Williamson <rjw@apple.com> API change: WebHistory initWithFile: -> initWithContentsOfURL: Reviewed by Ken. * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: (-[WebHistory initWithContentsOfURL:]): (-[WebHistory URL]): * History.subproj/WebHistoryPrivate.h: * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate initWithContentsOfURL:]): (-[WebHistoryPrivate dealloc]): (-[WebHistoryPrivate _loadHistoryGuts:]): (-[WebHistoryPrivate loadHistory]): (-[WebHistoryPrivate _saveHistoryGuts:]): (-[WebHistoryPrivate URL]): (-[WebHistoryPrivate saveHistory]): 2003-03-27 Darin Adler <darin@apple.com> Reviewed by Shelley. - fixed 3157067 -- Pier1.com doesn't load; Microsoft VBScript runtime error in user-agent checking code Besides this fix, I also filed an evangelism bug, bug 3210612. * WebView.subproj/WebUserAgentSpoofTable.gperf: Added pier1.com. * WebView.subproj/WebUserAgentSpoofTable.c: Regenerated. 2003-03-27 Ken Kocienda <kocienda@apple.com> Reviewed by Trey Moved to final NSURLResponse and NSHTTPURLResponse API. * Downloads.subproj/WebDownload.m: * Misc.subproj/WebNSURLResponseExtras.m: (-[NSURLResponse suggestedFilenameForSaving]): (-[NSHTTPURLResponse suggestedFilenameForSaving]): * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setResponse:]): * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _representationClass]): (-[WebDataSource _commitIfReady:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _opened]): (-[WebFrame _loadItem:fromItem:withLoadType:]): * WebView.subproj/WebFrameViewPrivate.m: (-[WebFrameView _makeDocumentViewForDataSource:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient checkContentPolicyForResponse:]): (-[WebMainResourceClient resource:didReceiveResponse:]): (-[WebMainResourceClient startLoading:]): * WebView.subproj/WebTextRepresentation.m: (-[WebTextRepresentation setDataSource:]): * WebView.subproj/WebTextView.m: (-[WebTextView dataSourceUpdated:]): === Safari-69 === 2003-03-26 Richard Williamson <rjw@apple.com> File name change WebPluginError.[hm] -> WebPlugInError.[hm] * Misc.subproj/WebKit.h: * Plugins.subproj/WebNullPluginView.m: * Plugins.subproj/WebPlugInError.h: * Plugins.subproj/WebPluginError.h: Removed. * Plugins.subproj/WebPluginError.m: Removed. * Plugins.subproj/WebPluginErrorPrivate.h: * WebKit.pbproj/project.pbxproj: 2003-03-26 Richard Williamson <rjw@apple.com> WebPreferences API changes: JavaScriptCanOpenWindowsAutomatically -> javaScriptCanOpenWindowsAutomatically setJavaScriptCanOpenWindowsAutomatically -> setJavaScriptCanOpenWindowsAutomatically willLoadImagesAutomatically -> loadsImagesAutomatically setWillLoadImagesAutomatically -> setLoadsImagesAutomatically JavaEnabled -> isJavaEnabled setJavaEnabled -> setIsJavaEnabled JavaScriptEnabled -> isJavaScriptEnabled setJavaScriptEnabled -> setIsJavaScriptEnabled pluginsEnabled -> arePlugInsEnabled setPluginsEnabled -> setArePlugInsEnabled allowAnimatedImageLooping -> allowsAnimatedImageLooping setAllowAnimatedImageLooping -> setAllowsAnimatedImageLooping allowAnimatedImages -> allowsAnimatedImages setAllowAnimatedImages -> setAllowsAnimatedImages Made WebHistoryItem's ivars private. WebPluginError API changes: pluginPageURL -> plugInPageURLString contentURL -> contentURLString Reviewed by cblu. * API-Issues.rtf: * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItemPrivate dealloc]): (-[WebHistoryItem init]): (-[WebHistoryItem dealloc]): (-[WebHistoryItem URLString]): (-[WebHistoryItem originalURLString]): (-[WebHistoryItem title]): (-[WebHistoryItem setDisplayTitle:]): (-[WebHistoryItem icon]): (-[WebHistoryItem lastVisitedDate]): (-[WebHistoryItem hash]): (-[WebHistoryItem anchor]): (-[WebHistoryItem isEqual:]): (-[WebHistoryItem description]): (-[WebHistoryItem _retainIconInDatabase:]): (-[WebHistoryItem initWithURL:target:parent:title:]): (-[WebHistoryItem URL]): (-[WebHistoryItem target]): (-[WebHistoryItem parent]): (-[WebHistoryItem setURL:]): (-[WebHistoryItem setOriginalURLString:]): (-[WebHistoryItem setTitle:]): (-[WebHistoryItem setTarget:]): (-[WebHistoryItem setParent:]): (-[WebHistoryItem setLastVisitedDate:]): (-[WebHistoryItem documentState]): (-[WebHistoryItem scrollPoint]): (-[WebHistoryItem setScrollPoint:]): (-[WebHistoryItem setAnchor:]): (-[WebHistoryItem isTargetItem]): (-[WebHistoryItem setIsTargetItem:]): (-[WebHistoryItem _recurseToFindTargetItem]): (-[WebHistoryItem targetItem]): (-[WebHistoryItem formData]): (-[WebHistoryItem setFormData:]): (-[WebHistoryItem formContentType]): (-[WebHistoryItem setFormContentType:]): (-[WebHistoryItem formReferrer]): (-[WebHistoryItem setFormReferrer:]): (-[WebHistoryItem children]): (-[WebHistoryItem addChildItem:]): (-[WebHistoryItem childItemWithName:]): (-[WebHistoryItem dictionaryRepresentation]): (-[WebHistoryItem initFromDictionaryRepresentation:]): (-[WebHistoryItem setAlwaysAttemptToUsePageCache:]): (-[WebHistoryItem alwaysAttemptToUsePageCache]): (-[WebHistoryItem _scheduleRelease]): (-[WebHistoryItem setHasPageCache:]): (-[WebHistoryItem pageCache]): * Plugins.subproj/WebPluginError.h: * Plugins.subproj/WebPluginError.m: (-[WebPlugInError plugInPageURLString]): * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (-[WebPreferences isJavaEnabled]): (-[WebPreferences setIsJavaEnabled:]): (-[WebPreferences isJavaScriptEnabled]): (-[WebPreferences setIsJavaScriptEnabled:]): (-[WebPreferences javaScriptCanOpenWindowsAutomatically]): (-[WebPreferences arePlugInsEnabled]): (-[WebPreferences setArePlugInsEnabled:]): (-[WebPreferences allowsAnimatedImages]): (-[WebPreferences allowsAnimatedImageLooping]): (-[WebPreferences setAllowsAnimatedImageLooping:]): (-[WebPreferences setLoadsImagesAutomatically:]): (-[WebPreferences loadsImagesAutomatically]): * WebView.subproj/WebViewPrivate.m: (-[WebView _updateWebCoreSettingsFromPreferences:]): 2003-03-26 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Changed WebResponse to NSURLResponse. Some other "supporting" names changed as well. Note that there are no functional modifications, only name changes. * Downloads.subproj/WebDownload.h: * Downloads.subproj/WebDownload.m: (-[WebDownload _initWithLoadingResource:request:response:delegate:proxy:]): (+[WebDownload _downloadWithLoadingResource:request:response:delegate:proxy:]): (-[WebDownload _setResponse:]): (-[WebDownload resource:didReceiveResponse:]): * Downloads.subproj/WebDownloadPrivate.h: * Misc.subproj/WebIconLoader.m: (-[WebIconLoader resource:didReceiveResponse:]): * Misc.subproj/WebKit.h: * Plugins.subproj/WebBaseNetscapePluginStream.h: * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setResponse:]): * Plugins.subproj/WebNetscapePluginDocumentView.m: * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream resource:didReceiveResponse:]): * WebCoreSupport.subproj/WebBridge.m: * WebCoreSupport.subproj/WebSubresourceClient.h: * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient resource:didReceiveResponse:]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate resource:didReceiveResponse:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource response]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setResponse:]): (-[WebDataSource _commitIfReady:]): (-[WebDataSource _addResponse:]): * WebView.subproj/WebDefaultPolicyDelegate.m: * WebView.subproj/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate webView:resource:didReceiveResponse:fromDataSource:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _opened]): * WebView.subproj/WebFrameViewPrivate.m: * WebView.subproj/WebHTMLRepresentation.m: * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient continueAfterContentPolicy:]): (-[WebMainResourceClient checkContentPolicyForResponse:]): (-[WebMainResourceClient resource:didReceiveResponse:]): (-[WebMainResourceClient startLoading:]): (-[WebResourceDelegateProxy resource:didReceiveResponse:]): * WebView.subproj/WebPolicyDelegate.h: * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebTextRepresentation.m: * WebView.subproj/WebTextView.m: 2003-03-26 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2003-03-26 Darin Adler <darin@apple.com> Reviewed by Trey. - fixed 3209091 -- REGRESSION: WebFrameView leak (world leak) * WebView.subproj/WebView.m: (-[WebView _commonInitialization:frameName:groupName:]): Use copy, not retain, on an incoming NSString parameter. (-[WebView initWithFrame:frameName:groupName:]): Release the WebFrameView after setting it up. - other changes * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): Put the bug workaround here inside an ifdef so we don't compile it in on Panther. 2003-03-26 Chris Blumenberg <cblu@apple.com> Use the private _cfBundle method on NSBundle so we only create 1 bundle per plug-in package class. Reviewed by trey. * Plugins.subproj/WebBasePluginPackage.h: * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage initWithPath:]): (-[WebBasePluginPackage getPluginInfoFromBundleAndMIMEDictionary:]): (-[WebBasePluginPackage dealloc]): * Plugins.subproj/WebNetscapePluginPackage.h: * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage openResourceFile]): (-[WebNetscapePluginPackage closeResourceFile:]): (-[WebNetscapePluginPackage getPluginInfoFromPLists]): (-[WebNetscapePluginPackage initWithPath:]): (-[WebNetscapePluginPackage load]): (-[WebNetscapePluginPackage unload]): * Plugins.subproj/WebPluginPackage.m: (-[WebPluginPackage initWithPath:]): (-[WebPluginPackage viewFactory]): (-[WebPluginPackage load]): (-[WebPluginPackage isLoaded]): 2003-03-26 Ken Kocienda <kocienda@apple.com> Reviewed by Maciej Finished conversion to NSMutableURLRequest. HTTP-specific mutator methods are now properly placed on an HTTP category of NSMutableURLRequest. All client code has been updated to use NSMutableURLRequest where appropriate. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate resource:willSendRequest:]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate openNewWindowWithURL:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _addExtraFieldsToRequest:alwaysFromRequest:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient resource:willSendRequest:]): 2003-03-25 Richard Williamson <rjw@apple.com> Changed use of plugin to plugIn in our public API as instructed by those that must be obeyed. Reviewed by Trey. Changed userStyleSheetLocation to take/pass an NSURL. Reviewed by Chris * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebNullPluginView.h: * Plugins.subproj/WebNullPluginView.m: (-[WebNullPluginView viewDidMoveToWindow]): * Plugins.subproj/WebPluginError.h: * Plugins.subproj/WebPluginError.m: (-[WebPlugInError plugInPageURL]): (-[WebPlugInError plugInName]): * Plugins.subproj/WebPluginErrorPrivate.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]): * WebView.subproj/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate webView:plugInFailedWithError:dataSource:]): * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (-[WebPreferences userStyleSheetLocation]): (-[WebPreferences setUserStyleSheetLocation:]): * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _updateWebCoreSettingsFromPreferences:]): * API-Issues.rtf: notes to self 2003-03-25 Chris Blumenberg <cblu@apple.com> Fixed: 3135385 - many file types don't work with the QuickTime plugin in Safari Reviewed by trey. * Plugins.subproj/WebBasePluginPackage.h: * Plugins.subproj/WebBasePluginPackage.m: (+[WebBasePluginPackage pluginWithPath:]): tweak (-[WebBasePluginPackage pathByResolvingSymlinksAndAliasesInPath:]): moved up from WebNetscapePluginPackage (-[WebBasePluginPackage initWithPath:]): retain path, create bundle so subclasses don't have to do this work (-[WebBasePluginPackage getPluginInfoFromBundleAndMIMEDictionary:]): was getMIMEInformation from WebPluginPackage (-[WebBasePluginPackage dealloc]): release the bundle (-[WebBasePluginPackage setMIMEToExtensionsDictionary:]): tweak * Plugins.subproj/WebNetscapePluginPackage.h: * Plugins.subproj/WebNetscapePluginPackage.m: (+[WebNetscapePluginPackage preferredLocalizationName]): new (-[WebNetscapePluginPackage openResourceFile]): tweak (-[WebNetscapePluginPackage closeResourceFile:]): tweak (-[WebNetscapePluginPackage stringForStringListID:andIndex:]): tweak (-[WebNetscapePluginPackage getPluginInfoFromResources]): was getMIMEInformation (-[WebNetscapePluginPackage pListForPath:createFile:]): new, calls BP_CreatePluginMIMETypesPreferences if createFile==YES (-[WebNetscapePluginPackage getPluginInfoFromPLists]): calls getPluginInfoFromBundleAndMIMEDictionary with the MIME dictionary from the user's home dir. (-[WebNetscapePluginPackage initWithPath:]): have the superclass do some initialization, call getPluginInfoFromPLists and/or getPluginInfoFromResources (-[WebNetscapePluginPackage executableType]): tweak (-[WebNetscapePluginPackage load]): get the BP_CreatePluginMIMETypesPreferences symbol (-[WebNetscapePluginPackage unload]): tweak (-[WebNetscapePluginPackage dealloc]): tweak * Plugins.subproj/WebPluginPackage.h: * Plugins.subproj/WebPluginPackage.m: (-[WebPluginPackage initWithPath:]): have the superclass do some initialization, call getPluginInfoFromBundleAndMIMEDictionary (-[WebPluginPackage viewFactory]): tweak (-[WebPluginPackage load]): call principalClass (-[WebPluginPackage isLoaded]): tweak * Plugins.subproj/npapi.h: added declaration for the BP_CreatePluginMIMETypesPreferences function pointer. 2003-03-25 John Sullivan <sullivan@apple.com> - WebKit part of fix for 3141794 -- No scroll bar for the "collections" column of the bookmarks window Reviewed by Darin. * WebView.subproj/WebDynamicScrollBarsView.h: replaced disallowsScrolling boolean ivar with separate booleans for disallowHorizontalScrolling and disallowVerticalScrolling * WebView.subproj/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): take the two disallow booleans into account separately (-[WebDynamicScrollBarsView setAllowsHorizontalScrolling:]), (-[WebDynamicScrollBarsView allowsHorizontalScrolling]), (-[WebDynamicScrollBarsView setAllowsVerticalScrolling:]), (-[WebDynamicScrollBarsView allowsVerticalScrolling]): new methods, do the obvious (-[WebDynamicScrollBarsView setAllowsScrolling:]): changed to set both ivars (-[WebDynamicScrollBarsView allowsScrolling]): changed to return YES if scrolling is allowed in either direction * WebKit.exp: exported symbol for WebDynamicScrollBarsView class name 2003-03-25 Ken Kocienda <kocienda@apple.com> Reviewed by Richard Fixed a bug that could occur in the new immutable/mutable request scheme. When opening a javascript window, it was possible for a request passed as a method argument to be released during the course of a method, particularly after that request was passed to willSendRequest:. The solution is to ask the data source for its current request rather than using the one stored in the method argument. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient startLoading:]): 2003-03-24 Trey Matteson <trey@apple.com> Pass -seg_addr_table_filename <FILENAME> to ld. This makes our frameworks in SYMROOT actually work for symbol resolution because they will have the correct prebinding address. It also fixes obscure B&I problems with prebinding reported by Matt Reda. Note the reason all this is tricky for our projects is that we have a different install location for Jaguar and Panther. The purpose of this arg is to declare at link time our eventual location, which allows the prebinding address to be found in /AppleInternal/Developer/seg_addr_table. We use a funky back-tick expression within OTHER_LDFLAGS to get a conditional value depending on the build train we are in. This can all go away once we only build on Panther and don't embed the frameworks inside the Safari.app wrapper. In addition I fixed the OTHER_LDFLAGS settings in our build styles to be additive instead of overriding, so we have the args we used for B&I in force when building outside of B&I. Reviewed by Maciej. * WebKit.pbproj/project.pbxproj: 2003-03-25 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Updated to use NSMutableURLRequest where appropriate. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView requestWithURLCString:]): (-[WebBaseNetscapePluginView _postURLNotify:target:len:buf:file:notifyData:allowHeaders:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithRequest:]): (-[WebDataSource request]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setURL:]): * WebView.subproj/WebFrame.m: (-[WebFrame loadRequest:]): (-[WebFrame reload]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadItem:fromItem:withLoadType:]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]): 2003-03-25 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3205745 -- WebKit.framework's Localizable.strings file contains high ASCII in the Key definition. * English.lproj/Localizable.strings: Regenerated with the new version of the extract-localizable-strings tool that uses \U syntax instead of "high ASCII". - changed cursive font back to "Apple Chancery" for now * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): Change to "Apple Chancery". * English.lproj/StringsNotToBeLocalized.txt: Update for above change. 2003-03-24 Darin Adler <darin@apple.com> Reviewed by Dave. - fixed 3206803 -- REGRESSION: Lucida Handwriting font doesn't work * WebCoreSupport.subproj/WebTextRendererFactory.m: (acceptableChoice): Added. Returns NO if the weight/traits are no good. (betterChoice): Added. Returns YES if the new weight/traits are better than the old. (-[WebTextRendererFactory fontWithFamily:traits:size:]): Use the new functions to judge which font is good enough. Now it will accept an italic font if that's all we have. - fixed 3206904 -- use "Lucida Handwriting" for "cursive" so it works on systems without Classic * WebView.subproj/WebPreferences.m: (+[WebPreferences initialize]): Change default from "Apple Chancery" to "Lucida Handwriting". * English.lproj/StringsNotToBeLocalized.txt: Updated for this change. 2003-03-24 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. - made API (actually doc-only) changes needed for 3087535 - bugzilla queries come back as downloaded files * Downloads.subproj/WebDownload.h: Documented that download:didReceiveResponse: may be sent more than once. * WebView.subproj/WebLocationChangeDelegate.h: Documented that locationChangeCommittedForDataSource: may be sent more than once. * WebView.subproj/WebPolicyDelegate.h: Documented that decideContentPolicyForMIMEType:andRequest:inFrame: may be sent more than once. * WebView.subproj/WebResourceLoadDelegate.h: Documented that resource:didReceiveResponse:fromDataSource: may be sent more than once. 2003-03-24 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. - fixed 3083339 - significant top and side margin appended to new windows Part of the fix involves adding new window operation delegate methods. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setWindowFrame:]): Tweaked code a bit. (-[WebBridge windowFrame]): Added. (-[WebBridge setWindowContentRect:]): Added. (-[WebBridge windowContentRect]): Added. * WebView.subproj/WebDefaultWindowOperationsDelegate.m: (-[WebDefaultWindowOperationsDelegate webView:setContentRect:]): Implemented. (-[WebDefaultWindowOperationsDelegate webViewContentRect:]): Likewise. * WebView.subproj/WebWindowOperationsDelegate.h: 2003-03-24 Chris Blumenberg <cblu@apple.com> Fixed: 3155489 - Seed: PostScript files display instead of downloading, often as a blank page Fixed: 3106251 - quicken file not downloaded, can't save manually Reviewed by trey. * WebView.subproj/WebDataSourcePrivate.m: (+[WebDataSource _repTypes]): call [WebImageView supportedImageMIMETypes] * WebView.subproj/WebFrameViewPrivate.m: (+[WebFrameView _viewTypes]): call [WebImageView supportedImageMIMETypes] * WebView.subproj/WebImageView.h: * WebView.subproj/WebImageView.m: (+[WebImageView initialize]): was -initialize (oops) (+[WebImageView unsupportedImageMIMETypes]): new, AppKit images that we shouldn't display inline, includes ps and pdf (+[WebImageView supportedImageMIMETypes]): new, was in WebViewPrivate * WebView.subproj/WebTextView.h: * WebView.subproj/WebTextView.m: (+[WebTextView unsupportedTextMIMETypes]): renamed, added text/qif (quicken) * WebView.subproj/WebView.m: (+[WebView canShowMIMEType:]): call [WebTextView unsupportedTextMIMETypes] * WebView.subproj/WebViewPrivate.h: removed _supportedImageMIMETypes * WebView.subproj/WebViewPrivate.m: removed _supportedImageMIMETypes 2003-03-24 Ken Kocienda <kocienda@apple.com> Reviewed by hyatt. Moved closer to target API for NSURLRequest. Merged in final names for immutable and mutable versions of this class and its HTTP category. The next step will be to actually make the split between immutable/mutable variants of NSURLRequest. In WebKit, this amounts to name changes only. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]): * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView _postURLNotify:target:len:buf:file:notifyData:allowHeaders:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): (-[WebBridge incomingReferrer]): * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate resource:willSendRequest:]): * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate openNewWindowWithURL:]): * WebView.subproj/WebFrame.m: (-[WebFrame reload]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _createItem]): (-[WebFrame _loadItem:fromItem:withLoadType:]): (-[WebFrame _addExtraFieldsToRequest:alwaysFromRequest:]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient resource:willSendRequest:]): 2003-03-22 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3203869 -- Monaco 9 looks different in Safari than in TextEdit (uses outline instead of bitmap) * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _web_widthWithFont:]): Pass usingPrinterFont:NO, since this is used exclusively for on-screen text, not printing. * Misc.subproj/WebStringTruncator.m: (truncateString): Ditto. * WebCoreSupport.subproj/WebTextRenderer.h: Add usingPrinterFont boolean field and parameter to init. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:forScreen:]): Add usingPrinterFont parameter, and get the screen font if it's NO, also store the boolean for later use. (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding: attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:letterSpacing:wordSpacing:fontFamilies:]): Pass the usingPrinterFont parameter through when getting a substitute font. * WebCoreSupport.subproj/WebTextRendererFactory.h: Add separate caches for screen and printing text renderers. Add usingPrinterFont parameter to our rendererWithFont: method (the one inherited from WebCore still has no parameter). * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory init]): Create both caches. (-[WebTextRendererFactory dealloc]): Release both caches. (-[WebTextRendererFactory rendererWithFont:]): Call the new rendererWithFont:usingPrinterFont: method, passing usingPrinterFonts from the WebCore side. Thus any fonts fetched by WebCore during printing are printing fonts, and otherwise they are screen fonts. (-[WebTextRendererFactory rendererWithFont:usingPrinterFont:]): Added. Has the code from the old rendererWithFont: method, but passes the usingPrinterFont parameter through to the WebTextRenderer init method. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView initWithFrame:]): Don't set unused canDragTo and canDragFrom fields. (-[WebHTMLView drawRect:]): Call -[WebTextRendererFactory setUsingPrinterFonts:] here if we are printing, as indicated by the usingPrinterFonts field. The reason we do this only inside drawRect is so we don't affect redraws of other HTML views that are not being printed that might be in "needs display" state when printing began. (-[WebHTMLView _setUsingPrinterFonts:]): Added. Calls _setUsingPrinterFonts on all WebHTMLViews inside this one, then does the work for this one. Uses the frame hierarchy rather than the view hierarchy, but either would work. If printer font state is changing, then sets the WebTextRendererFactory mode, then forces a layout and application of styles, but without triggering display. (-[WebHTMLView beginDocument]): Do an explicit display so this view does not have to be displayed while it is in "use printer fonts" mode. Then call _setUsingPrinterFonts:YES so that drawRect will use printer fonts, and also that the WebCore data structures and layout will be updated to reflect printer fonts as opposed to screen fonts. (-[WebHTMLView endDocument]): Call _setUsingPrinterFonts:NO to restore things to normal after printing. * WebView.subproj/WebHTMLViewPrivate.h: Removed unused canDragTo, canDragFrom, and liveAllowsScrolling fields. Added usingPrinterFonts field. * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2003-03-24 Ken Kocienda <kocienda@apple.com> Reviewed by Darin Removed now-obsolete WebResponseCachePolicy enum. Once the new cache API is ready, there will be new features to replace what this enum provided. Seeing as how this enum was largely unused, there is no impact associated with removing it now. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): 2003-03-24 Ken Kocienda <kocienda@apple.com> Reviewed by John Cleaned up some missed WebRequest -> NSURLRequest name conversions. * WebView.subproj/WebFramePrivate.m 2003-03-24 Ken Kocienda <kocienda@apple.com> Reviewed by John Changed WebRequest to NSURLRequest. Several other names, like some constants whose names were based on WebRequest, changed as well. * Downloads.subproj/WebDownload.h: * Downloads.subproj/WebDownload.m: (-[WebDownload initWithRequest:]): (-[WebDownload _initWithLoadingResource:request:response:delegate:proxy:]): (+[WebDownload _downloadWithLoadingResource:request:response:delegate:proxy:]): (-[WebDownload _setRequest:]): (-[WebDownload resource:willSendRequest:]): * Downloads.subproj/WebDownloadPrivate.h: * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]): (-[WebIconLoader resource:willSendRequest:]): * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView requestWithURLCString:]): (-[WebBaseNetscapePluginView loadPluginRequest:]): (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): (-[WebBaseNetscapePluginView getURLNotify:target:notifyData:]): (-[WebBaseNetscapePluginView getURL:target:]): (-[WebBaseNetscapePluginView _postURLNotify:target:len:buf:file:notifyData:allowHeaders:]): (-[WebPluginRequest initWithRequest:frameName:notifyData:]): (-[WebPluginRequest request]): * Plugins.subproj/WebBaseNetscapePluginViewPrivate.h: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView viewDidMoveToWindow]): * Plugins.subproj/WebNetscapePluginStream.h: * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:]): * Plugins.subproj/WebPluginController.m: (-[WebPluginController showURL:inFrame:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): (-[WebBridge objectLoadedFromCacheWithURL:response:size:]): (-[WebBridge isReloading]): (-[WebBridge loadEmptyDocumentSynchronously]): * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): (-[WebSubresourceClient resource:willSendRequest:]): * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate startLoading:]): (-[WebBaseResourceHandleDelegate loadWithRequest:]): (-[WebBaseResourceHandleDelegate resource:willSendRequest:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithRequest:]): (-[WebDataSource initialRequest]): (-[WebDataSource request]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setURL:]): (-[WebDataSource _setRequest:]): (-[WebDataSource _originalRequest]): (-[WebDataSource _lastCheckedRequest]): (-[WebDataSource _setLastCheckedRequest:]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): (-[WebDefaultContextMenuDelegate openNewWindowWithURL:]): * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate webView:decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]): (-[WebDefaultPolicyDelegate webView:decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener:]): * WebView.subproj/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate webView:identifierForInitialRequest:fromDataSource:]): (-[WebDefaultResourceLoadDelegate webView:resource:willSendRequest:fromDataSource:]): * WebView.subproj/WebDefaultWindowOperationsDelegate.m: * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (-[WebFrame loadRequest:]): (-[WebFrame reload]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _createItem]): (-[WebFrame _loadItem:fromItem:withLoadType:]): (-[WebFrame _loadRequest:triggeringAction:loadType:formState:]): (-[WebFrame _invalidatePendingPolicyDecisionCallingDefaultAction:]): (-[WebFrame _checkNewWindowPolicyForRequest:action:frameName:formState:andCall:withSelector:]): (-[WebFrame _continueAfterNewWindowPolicy:]): (-[WebFrame _checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): (-[WebFrame _continueAfterNavigationPolicy:]): (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:formState:]): (-[WebFrame _addExtraFieldsToRequest:alwaysFromRequest:]): (-[WebFrame _continueLoadRequestAfterNewWindowPolicy:frameName:formState:]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrame _loadRequest:inFrameNamed:]): * WebView.subproj/WebFrameView.m: (-[WebFrameView concludeDragOperation:]): * WebView.subproj/WebImageRepresentation.m: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterNavigationPolicy:formState:]): (-[WebMainResourceClient resource:willSendRequest:]): (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient startLoading:]): (-[WebResourceDelegateProxy resource:willSendRequest:]): * WebView.subproj/WebPolicyDelegate.h: * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebView.m: (-[WebView takeStringURLFrom:]): * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _downloadURL:toDirectory:]): (-[WebView _openNewWindowWithRequest:]): * WebView.subproj/WebWindowOperationsDelegate.h: 2003-03-21 Chris Blumenberg <cblu@apple.com> Fixed: 3081681 - text/calendar should be downloaded instead of displayed Fixed: 3177603 - vCards appear in browser, not downloaded Reviewed by darin. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (+[WebDataSource _representationClassForMIMEType:]): was _canShowMIMEType * WebView.subproj/WebFrameViewPrivate.h: * WebView.subproj/WebFrameViewPrivate.m: (+[WebFrameView _viewClassForMIMEType:]): was _canShowMIMEType * WebView.subproj/WebTextView.h: * WebView.subproj/WebTextView.m: (+[WebTextView unshowableMIMETypes]): new, returns text types that shouldn't be shown * WebView.subproj/WebView.m: (+[WebView canShowMIMEType:]): call unshowableMIMETypes 2003-03-20 Richard Williamson <rjw@apple.com> Use "Item" consistently in the WebHistory and WebBackForwardList. Change createSharedHistoryWithFile: to setSharedHistory: Make the various page cache methods per WebBackForwardList instead of global. Reviewed by gramps. * History.subproj/WebBackForwardList.h: * History.subproj/WebBackForwardList.m: (-[WebBackForwardListPrivate dealloc]): (-[WebBackForwardList init]): (-[WebBackForwardList dealloc]): (-[WebBackForwardList goBack]): (-[WebBackForwardList goForward]): (-[WebBackForwardList goToItem:]): (-[WebBackForwardList backItem]): (-[WebBackForwardList currentItem]): (-[WebBackForwardList forwardItem]): (-[WebBackForwardList containsItem:]): (-[WebBackForwardList maximumSize]): (-[WebBackForwardList setMaximumSize:]): (-[WebBackForwardList description]): (-[WebBackForwardList clearPageCache]): (-[WebBackForwardList setPageCacheSize:]): (-[WebBackForwardList pageCacheSize]): (-[WebBackForwardList setUsesPageCache:]): (-[WebBackForwardList usesPageCache]): (-[WebBackForwardList backListCount]): (-[WebBackForwardList forwardListCount]): (-[WebBackForwardList itemAtIndex:]): * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: (-[_WebCoreHistoryProvider containsItemForURLString:]): (+[WebHistory setSharedHistory:]): (-[WebHistory addItemForURL:]): (-[WebHistory addItem:]): (-[WebHistory removeItem:]): (-[WebHistory removeItems:]): (-[WebHistory removeAllItems]): (-[WebHistory addItems:]): (-[WebHistory orderedItemsLastVisitedOnDay:]): (-[WebHistory containsItemForURLString:]): (-[WebHistory itemForURL:]): * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryPrivate.h: * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate insertItem:atDateIndex:]): (-[WebHistoryPrivate removeItemForURLString:]): (-[WebHistoryPrivate addItem:]): (-[WebHistoryPrivate removeItem:]): (-[WebHistoryPrivate removeItems:]): (-[WebHistoryPrivate removeAllItems]): (-[WebHistoryPrivate addItems:]): (-[WebHistoryPrivate orderedItemsLastVisitedOnDay:]): (-[WebHistoryPrivate containsItemForURLString:]): (-[WebHistoryPrivate itemForURL:]): (-[WebHistoryPrivate _loadHistoryGuts:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge goBackOrForward:]): * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setTitle:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _addBackForwardItemClippedAtTarget:]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _canCachePage]): (-[WebFrame _purgePageCache]): (-[WebFrame _goToItem:withLoadType:]): (-[WebFrame _resetBackForwardListToCurrent]): * WebView.subproj/WebLocationChangeDelegate.h: * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView _commonInitialization:frameName:groupName:]): (-[WebView setMaintainsBackForwardList:]): (-[WebView goBack]): (-[WebView goForward]): 2003-03-20 Chris Blumenberg <cblu@apple.com> Properly handle file URL directory errors. Reviewed by trey. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _iconForFileURL:withSize:]): when file URL has no path, return generic file icon * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient interruptForPolicyChangeError]): set the URL, don't set it to nil! 2003-03-20 Vicki Murley <vicki@apple.com> don't include WebFoundation.h Reviewed by cblu. * Plugins.subproj/WebBaseNetscapePluginStream.m: * Plugins.subproj/WebNetscapePluginRepresentation.m: * Plugins.subproj/WebNetscapePluginStream.m: === Safari-68 === 2003-03-20 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2003-03-19 Ed Voas voas@apple.com Reviewed by Richard. React to WebView API changes. Redo HIWebView API. * Carbon.subproj/HIWebView.h: * Carbon.subproj/HIWebView.m: (if): (switch): * Carbon.subproj/HIWebViewPriv.h: Removed. * WebKit.exp: * WebKit.pbproj/project.pbxproj: 2003-03-19 Richard Williamson <rjw@apple.com> Removed initWithView:* constructors from WebView. New designated initializer for WebView is initWithFrame:frameName:groupName: Reviewed by cblu & ed. * Carbon.subproj/HIWebView.m: * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView init]): (-[WebView initWithFrame:]): 2003-03-19 Richard Williamson <rjw@apple.com> Rename WebControllerPolicyDelegate*.[hm] to WebPolicyDelegate*.[hm] Reviewed by trey. * API-Issues.rtf: * Misc.subproj/WebKit.h: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebControllerPolicyDelegate.h: Removed. * WebView.subproj/WebControllerPolicyDelegate.m: Removed. * WebView.subproj/WebControllerPolicyDelegatePrivate.h: Removed. * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebDefaultContextMenuDelegate.m: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebFrameView.h: * WebView.subproj/WebHTMLViewPrivate.m: * WebView.subproj/WebMainResourceClient.m: * WebView.subproj/WebPolicyDelegate.m: * WebView.subproj/WebPolicyDelegatePrivate.h: * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.h: 2003-03-19 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3202780 -- REGRESSION: progress bar, stop button, both get stuck in "loading" state (bartsoft.com) * WebView.subproj/WebDataSource.m: (-[WebDataSource isLoading]): Add back the "is this page complete" check, so that subresource loads don't make us think we're loading again, once the page is complete. On the other hand, frames must still be checked independent of the "is this page complete" flag to avoid reintroducing bug 3200611. 2003-03-19 Ed Voas voas@apple.com Reviewed by Richard. Got it working in non-compositing mode as well, so in theory it can work inside a PowerPlant application as well. It's a bit of what I'd consider a hack, but it's pretty straightforward. * Carbon.subproj/CarbonWindowAdapter.m: (-[CarbonWindowAdapter setViewsNeedDisplay:]): * Carbon.subproj/HIViewAdapter.h: * Carbon.subproj/HIViewAdapter.m: (+[HIViewAdapter bindHIViewToNSView:nsView:]): (-[HIViewAdapter setNeedsDisplay:]): (-[HIViewAdapter setNeedsDisplayInRect:]): (SetViewNeedsDisplay): * Carbon.subproj/HIWebView.m: (if): 2003-03-18 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. - fixed 3127431 - bring the window with the named frame to the front * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge focusWindow]): Tell the window operations delegate to focus. (-[WebBridge loadURL:referrer:reload:target:triggeringEvent:form:formValues:]): If this navigation is meant for a different frame, focus its window. (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): Likewise. 2003-03-18 Trey Matteson <trey@apple.com> 3077223 full keyboard UI navigation fails in authentication sheet Hook up the views in this panel into a useful nextKeyView cycle. Reviewed by Maciej. * Panels.subproj/English.lproj/WebAuthenticationPanel.nib: 2003-03-17 Trey Matteson <trey@apple.com> Support for saving passwords on forms-based logins. Biggest change is that the willSubmitForm: message is async to allow a sheet to be presented. Also fixed @interface.*{ so prepare-change-log can swallow WebFramePrivate.m. Reviewed by Maciej. * WebView.subproj/WebControllerPolicyDelegate.m: (-[WebPolicyDecisionListener continue]): The decision listener also implements WebFormSubmissionListener, to share some other impl. * WebView.subproj/WebControllerPolicyDelegatePrivate.h: * WebView.subproj/WebFormDelegate.h: * WebView.subproj/WebFormDelegate.m: (-[WebFormDelegate frame:willSubmitForm:withValues:submissionListener:]): Take listener param for async API. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): Latent bug. Don't call willSubmitForm if no values are being submitted. (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): Latent bug. Don't call willSubmitForm if no values are being submitted. (-[WebFrame _continueAfterWillSubmitForm:]): Continuation code for after FormDelegate is done with willSubmitForm. (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): Pass new listener arg to willSubmitForm. * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: Nuke deadwood formIsLoginForm. (-[WebHTMLRepresentation elementIsPassword:]): Just pass through glue over the bridge. 2003-03-18 Richard Williamson <rjw@apple.com> Another rename WebController*.[hm] to WebView*.[hm] Reviewed by darin. * Carbon.subproj/HIWebView.h: * Misc.subproj/WebKit.h: * Misc.subproj/WebNSPasteboardExtras.m: * Panels.subproj/WebStandardPanelsPrivate.h: * Plugins.subproj/WebBaseNetscapePluginView.m: * Plugins.subproj/WebNetscapePluginDocumentView.m: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: * Plugins.subproj/WebNetscapePluginStream.m: * Plugins.subproj/WebNullPluginView.m: * Plugins.subproj/WebPluginController.m: * WebCoreSupport.subproj/WebBridge.m: * WebCoreSupport.subproj/WebSubresourceClient.m: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebBaseResourceHandleDelegate.m: * WebView.subproj/WebController.h: Removed. * WebView.subproj/WebController.m: Removed. * WebView.subproj/WebControllerPrivate.h: Removed. * WebView.subproj/WebControllerPrivate.m: Removed. * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebDefaultContextMenuDelegate.m: * WebView.subproj/WebDefaultPolicyDelegate.m: * WebView.subproj/WebDefaultResourceLoadDelegate.m: * WebView.subproj/WebDefaultWindowOperationsDelegate.m: * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebFrameView.m: * WebView.subproj/WebFrameViewPrivate.m: * WebView.subproj/WebHTMLView.m: * WebView.subproj/WebHTMLViewPrivate.m: * WebView.subproj/WebImageView.m: * WebView.subproj/WebMainResourceClient.m: * WebView.subproj/WebTextView.m: * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: 2003-03-18 Richard Williamson <rjw@apple.com> Renamed WebView*.[hm] to WebFrameView*.[hm] * Misc.subproj/WebKit.h: * Misc.subproj/WebNSViewExtras.m: * Panels.subproj/WebStandardPanels.m: * Plugins.subproj/WebBaseNetscapePluginView.m: * Plugins.subproj/WebNetscapePluginDocumentView.m: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: * Plugins.subproj/WebNetscapePluginRepresentation.m: * Plugins.subproj/WebNullPluginView.m: * Plugins.subproj/WebPluginController.m: * Plugins.subproj/WebPluginDatabase.m: * WebCoreSupport.subproj/WebBridge.m: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.m: * WebView.subproj/WebControllerPrivate.m: * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebDebugDOMNode.m: * WebView.subproj/WebDefaultContextMenuDelegate.m: * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebFrameView.m: * WebView.subproj/WebFrameViewPrivate.h: * WebView.subproj/WebFrameViewPrivate.m: * WebView.subproj/WebHTMLView.m: * WebView.subproj/WebHTMLViewPrivate.m: * WebView.subproj/WebImageView.m: * WebView.subproj/WebMainResourceClient.m: * WebView.subproj/WebRenderNode.m: * WebView.subproj/WebTextView.m: * WebView.subproj/WebView.h: Removed. * WebView.subproj/WebView.m: Removed. * WebView.subproj/WebViewPrivate.h: Removed. * WebView.subproj/WebViewPrivate.m: Removed. 2003-03-18 Richard Williamson <rjw@apple.com> Stage 2 of WebController to WebView renaming. Reviewed by hyatt. * API-Issues.rtf: * Carbon.subproj/HIWebView.h: * Carbon.subproj/HIWebView.m: * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_bestURL]): * Panels.subproj/WebStandardPanels.m: (-[WebStandardPanels _didStartLoadingURL:inController:]): (-[WebStandardPanels _didStopLoadingURL:inController:]): (-[WebStandardPanels frontmostWindowLoadingURL:]): * Panels.subproj/WebStandardPanelsPrivate.h: * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView controller]): (-[WebBaseNetscapePluginView loadPluginRequest:]): * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation isPluginViewStarted]): (-[WebNetscapePluginRepresentation receivedData:withDataSource:]): * Plugins.subproj/WebNullPluginView.m: (-[WebNullPluginView viewDidMoveToWindow]): * Plugins.subproj/WebPluginController.m: (-[WebPluginController showStatus:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge mainFrame]): (-[WebBridge createWindowWithURL:frameName:]): (-[WebBridge showWindow]): (-[WebBridge areToolbarsVisible]): (-[WebBridge setToolbarsVisible:]): (-[WebBridge areScrollbarsVisible]): (-[WebBridge setScrollbarsVisible:]): (-[WebBridge isStatusBarVisible]): (-[WebBridge setStatusBarVisible:]): (-[WebBridge setWindowFrame:]): (-[WebBridge window]): (-[WebBridge runJavaScriptAlertPanelWithMessage:]): (-[WebBridge runJavaScriptConfirmPanelWithMessage:]): (-[WebBridge runJavaScriptTextInputPanelWithPrompt:defaultText:returningText:]): (-[WebBridge runOpenPanelForFileButtonWithResultListener:]): (-[WebBridge setStatusText:]): (-[WebBridge objectLoadedFromCacheWithURL:response:size:]): (-[WebBridge setWebFrame:]): (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): (-[WebBridge userAgentForURL:]): (-[WebBridge nextKeyViewOutsideWebFrameViews]): (-[WebBridge previousKeyViewOutsideWebFrameViews]): (-[WebBridge defersLoading]): (-[WebBridge setDefersLoading:]): (-[WebBridge setNeedsReapplyStyles]): (-[WebBridge setNeedsLayout]): (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): (-[WebBridge handleMouseDragged:]): (-[WebBridge mayStartDragWithMouseDragged:]): (-[WebBridge historyLength]): (-[WebBridge goBackOrForward:]): (formDelegate): * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): * WebKit.exp: * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate resource:willSendRequest:]): (-[WebBaseResourceHandleDelegate resource:didReceiveResponse:]): (-[WebBaseResourceHandleDelegate resource:didReceiveData:]): (-[WebBaseResourceHandleDelegate resourceDidFinishLoading:]): (-[WebBaseResourceHandleDelegate resource:didFailLoadingWithError:]): (-[WebBaseResourceHandleDelegate cancelWithError:]): * WebView.subproj/WebContextMenuDelegate.h: * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebView _commonInitialization:frameName:groupName:]): (-[WebView initWithFrame:]): (-[WebView supportsTextEncoding]): (-[WebView userAgentForURL:]): * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebViewPrivate _clearControllerReferences:]): (+[WebView canShowFile:]): (+[WebView suggestedFileExtensionForMIMEType:]): (-[WebView _createFrameNamed:inParent:allowsScrolling:]): (-[WebView _findFrameNamed:]): (-[WebView _openNewWindowWithRequest:]): (-[WebView _menuForElement:]): (-[WebView _mouseDidMoveOverElement:modifierFlags:]): (-[WebView _frameForView:fromFrame:]): * WebView.subproj/WebControllerSets.h: * WebView.subproj/WebControllerSets.m: (+[WebControllerSets addController:toSetNamed:]): (+[WebControllerSets removeController:fromSetNamed:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _controller]): (-[WebDataSource _setController:]): (-[WebDataSource _startLoading:]): (-[WebDataSource _setTitle:]): (-[WebDataSource _setRequest:]): (-[WebDataSource _layoutChildren]): (+[WebDataSource _repTypes]): (-[WebDataSource _receivedData:]): (-[WebDataSource _updateIconDatabaseWithURL:]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): (-[WebDefaultContextMenuDelegate openNewWindowWithURL:]): (-[WebDefaultContextMenuDelegate downloadURL:]): * WebView.subproj/WebDefaultLocationChangeDelegate.m: (-[WebDefaultLocationChangeDelegate webView:locationChangeStartedForDataSource:]): (-[WebDefaultLocationChangeDelegate webView:serverRedirectedForDataSource:]): (-[WebDefaultLocationChangeDelegate webView:locationChangeCommittedForDataSource:]): (-[WebDefaultLocationChangeDelegate webView:receivedPageTitle:forDataSource:]): (-[WebDefaultLocationChangeDelegate webView:receivedPageIcon:forDataSource:]): (-[WebDefaultLocationChangeDelegate webView:locationChangeDone:forDataSource:]): (-[WebDefaultLocationChangeDelegate webView:willCloseLocationForDataSource:]): (-[WebDefaultLocationChangeDelegate webView:locationChangedWithinPageForDataSource:]): (-[WebDefaultLocationChangeDelegate webView:clientWillRedirectTo:delay:fireDate:forFrame:]): (-[WebDefaultLocationChangeDelegate webView:clientRedirectCancelledForFrame:]): * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate webView:unableToImplementPolicyWithError:inFrame:]): (-[WebDefaultPolicyDelegate webView:decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]): (-[WebDefaultPolicyDelegate webView:decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener:]): * WebView.subproj/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate webView:identifierForInitialRequest:fromDataSource:]): (-[WebDefaultResourceLoadDelegate webView:resource:willSendRequest:fromDataSource:]): (-[WebDefaultResourceLoadDelegate webView:resource:didReceiveResponse:fromDataSource:]): (-[WebDefaultResourceLoadDelegate webView:resource:didReceiveContentLength:fromDataSource:]): (-[WebDefaultResourceLoadDelegate webView:resource:didFinishLoadingFromDataSource:]): (-[WebDefaultResourceLoadDelegate webView:resource:didFailLoadingWithError:fromDataSource:]): (-[WebDefaultResourceLoadDelegate webView:pluginFailedWithError:dataSource:]): * WebView.subproj/WebDefaultWindowOperationsDelegate.m: (-[WebDefaultWindowOperationsDelegate webView:runJavaScriptConfirmPanelWithMessage:]): (-[WebDefaultWindowOperationsDelegate webView:runJavaScriptTextInputPanelWithPrompt:defaultText:]): (-[WebDefaultWindowOperationsDelegate webView:runOpenPanelForFileButtonWithResultListener:]): * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (-[WebFrame init]): (-[WebFrame initWithName:webFrameView:webView:]): (-[WebFrame frameView]): (-[WebFrame webView]): (-[WebFrame findFrameNamed:]): (+[WebFrame registerViewClass:representationClass:forMIMEType:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (if): (switch): * WebView.subproj/WebHTMLView.h: * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _controller]): * WebView.subproj/WebImageView.m: (-[WebImageView controller]): (-[WebImageView menuForEvent:]): * WebView.subproj/WebLocationChangeDelegate.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient checkContentPolicyForResponse:]): * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebTextView.m: (-[WebTextView menuForEvent:]): * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebFrameView setAllowsScrolling:]): (-[WebFrameView allowsScrolling]): (-[WebFrameView scrollView]): (-[WebFrameView documentView]): (-[WebFrameView drawRect:]): (-[WebFrameView setFrameSize:]): * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebFrameView _controller]): (-[WebFrameView _setDocumentView:]): (-[WebFrameView _setController:]): (-[WebFrameView _contentView]): (-[WebFrameView _verticalKeyboardScrollAmount]): (-[WebFrameView _horizontalKeyboardScrollAmount]): (-[WebFrameView _scrollToBottomLeft]): (+[WebFrameView _viewTypes]): * WebView.subproj/WebWindowOperationsDelegate.h: 2003-03-18 Darin Adler <darin@apple.com> Reviewed by Richard. - fixed 3187143 -- when a font-family has many variants, Safari chooses the wrong one * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory fontWithFamily:traits:size:]): Changed the algorithm here in two ways. 1) Pick the family member with matching traits that has a weight closest to 5, the standard weight; the old code picked the first family member with matching traits. 2) Match traits based on a mask of which traits are the important ones. The old code matched traits based on a rule of "if the trait bit is 1 it matters, otherwise don't care". 2003-03-18 Darin Adler <darin@apple.com> Reviewed by Richard. - fixed 3194756 -- REGRESSION: Geneva bold yields Geneva plain, used to yield Helvetica bold (apple.com) * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory fontWithFamily:traits:size:]): Remove the first call to NSFontManager before we do our searching algorithm. We always need to do the searching, because NSFontManager uses a different set of rules. 2003-03-17 Chris Blumenberg <cblu@apple.com> Fixed: 3200647 - File I/O related download errors just says "error" Reviewed by darin. * Downloads.subproj/WebDownload.m: (+[WebDownloadPrivate initialize]): call _registerWebKitErrors * English.lproj/Localizable.strings: * Misc.subproj/WebKitErrors.h: cleaned-up, removed unused errors * Misc.subproj/WebKitErrors.m: (+[WebError _registerWebKitErrors]): (registerErrors): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebView.m: (+[WebFrameView initialize]): call _registerWebKitErrors 2003-03-17 Darin Adler <darin@apple.com> Reviewed by Chris and Richard. - fixed 3200611 -- Progress indicator in tabs not shown for subframe loads * WebView.subproj/WebDataSource.m: (-[WebDataSource isLoading]): Remove the early out for when we're in the WebFrameStateComplete state. The top frame being complete does not really tell us anything about whether subframes are complete, especially since they can have their locations changed without affecting the top level frame at all. * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2003-03-17 Chris Blumenberg <cblu@apple.com> Made data categories use the "_web_" prefix. Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView _postURLNotify:target:len:buf:file:notifyData:allowHeaders:]): (-[NSData _web_startsWithBlankLine]): (-[NSData _web_locationAfterFirstBlankLine]): 2003-03-17 Chris Blumenberg <cblu@apple.com> Fixed: 3199105 - Accept carbon-style file URLs from plug-in POST requests Fixed: 3148767 - POST (aka Flash Remoting) doesn't work from Flash Reviewed by kocienda. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView _postURLNotify:target:len:buf:file:notifyData:allowHeaders:]): parse headers, handle carbon POSIX paths (-[WebBaseNetscapePluginView postURLNotify:target:len:buf:file:notifyData:]): call _postURLNotify (-[WebBaseNetscapePluginView postURL:target:len:buf:file:]): call _postURLNotify (-[NSData startsWithBlankLine]): new (-[NSData locationAfterFirstBlankLine]): new 2003-03-17 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3200259 - REGRESSION: Clicking on Flash links at homestarrunner.com creates blank windows * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadPluginRequest:]): Don't always make the window, only do it if the frame doesn't already exist. Duh. 2003-03-17 Darin Adler <darin@apple.com> Reviewed by Trey and Maciej. - fixed 3199154 -- REGRESSION: world leaks on any page load test * WebView.subproj/WebController.m: (-[WebController initWithView:frameName:groupName:]): Call through to initWithFrame, the designated initializer, not init. Calling [super init] results in calling our initWithFrame method, resulting in two calls to the _commonInitialization method. 2003-03-17 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. Adjusted for WebFoundation API changes. * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForRequest:]): 2003-03-17 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2003-03-17 Chris Blumenberg <cblu@apple.com> Fixed: 3199951 - Standalone plug-in content that is cancelled doesn't restart when switching tabs Instead of creating and managing resourceData in WebMainResourceClient then passing the ownership to WebDataSource, just manage it in WebDataSource. We had the prior behavior because we didn't buffer downloads. Now, we always buffer. The fix for the bug is to retain the incomplete data even though the load ends in error. Reviewed by darin. * WebView.subproj/WebDataSource.h: updated headerdoc for the data method * WebView.subproj/WebDataSource.m: (-[WebDataSource data]): just return resourceData * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _receivedData:]): create resourceData if necessary, append data to it. * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient initWithDataSource:]): don't work with resourceData (-[WebMainResourceClient dealloc]): don't work with resourceData (-[WebMainResourceClient resource:didReceiveData:]): don't work with resourceData (-[WebMainResourceClient resourceDidFinishLoading:]): don't work with resourceData 2003-03-16 Trey Matteson <trey@apple.com> 3198135 - need to fix our projects so SYMROOT is not stripped Tweaked stripping options: B&I build does not COPY_PHASE_STRIP. Deployment build still does. We strip manually as part of the install that we do ourselves. Reviewed by Maciej. * WebKit.pbproj/project.pbxproj: 2003-03-14 Chris Blumenberg <cblu@apple.com> Backed out changes to WebBaseNetscapePluginView. Unintentional commit. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView postURLNotify:target:len:buf:file:notifyData:]): (-[WebBaseNetscapePluginView postURL:target:len:buf:file:]): 2003-03-14 Chris Blumenberg <cblu@apple.com> Fixed: 3198961 - REGRESSION: Stopping load of plug-in content is not reflected in UI Reviewed by mjs. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient cancelWithError:]): call receivedError so [dataSource _receivedError:error complete:YES] is called 2003-03-14 Maciej Stachowiak <mjs@apple.com> Reviewed by Don. - revert premature controller --> webView renaming, it's causing problems with window opening and such. * WebView.subproj/WebDefaultWindowOperationsDelegate.m: 2003-03-14 Chris Blumenberg <cblu@apple.com> Fixed: 3197872 - Standalone plug-in content isn't restarted when switching tabs Fixed: 3189675 - assertion in plug-in code fails (nil window) with .swf page displaying standalone in a tab We start plug-ins when they are added to the window and stop them when they are removed. To restart a plug-in, the data stream must be redelivered. This works in the embedded plug-in case, but in the standalone plug-in case, the stream is delivered by th e machinery in WebKit. The stream is only delivered once. This fix addresses that. Reviewed by trey. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setResponse:]): reset the offset ivar (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): If we create a file for the plug-in, handle the case where the file is already created. * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView isStarted]): added so the stream knows the state of the view * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView initWithFrame:]): tweak (-[WebNetscapePluginDocumentView viewDidMoveToWindow]): call redeliverStream if we are added back to the window (-[WebNetscapePluginDocumentView setDataSource:]): only start the plug-in if we are in a window, don't assert * Plugins.subproj/WebNetscapePluginRepresentation.h: * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation dealloc]): release the retained data source and error (-[WebNetscapePluginRepresentation setDataSource:]): retain the data source (-[WebNetscapePluginRepresentation isPluginViewStarted]): new (-[WebNetscapePluginRepresentation receivedData:withDataSource:]): only do work if isPluginViewStarted (-[WebNetscapePluginRepresentation receivedError:withDataSource:]): retain the error, only do work if isPluginViewStarted (-[WebNetscapePluginRepresentation finishedLoadingWithDataSource:]): only do work if isPluginViewStarted (-[WebNetscapePluginRepresentation redeliverStream]): call receivedData:: with all the received data up to this point. Call receivedError:: or finishedLoadingWithDataSource: if the load is already complete. 2003-03-13 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. - fixed 3188209 - REGRESSION: onmouseup handlers not running for most form elements * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileButton chooseButtonPressed:]): Send appropriate NSNotification. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebNSTextView mouseDown:]): Call fieldEditorDidMouseDown: on delegate, if implemented, after calling super. 2003-03-13 Richard Williamson <rjw@apple.com> First stage of the WebController -> WebView, WebView -> WebFrameView. This change does the WebView -> WebFrameView part of the change. Also changes WebController's inheritance. It now inherits from NSView. Also added some simple action methods to WebController (soon to be WebView) to facilitate IB hookup. Reviewed by Maciej. * Carbon.subproj/CarbonWindowAdapter.m: * Carbon.subproj/HIWebView.h: * Carbon.subproj/HIWebView.m: (if): (switch): * Carbon.subproj/HIWebViewPriv.h: * Misc.subproj/WebKitStatistics.m: (+[WebKitStatistics viewCount]): * Misc.subproj/WebKitStatisticsPrivate.h: * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_parentWebFrameView]): * Panels.subproj/WebStandardPanels.m: (-[WebStandardPanels frontmostWindowLoadingURL:]): * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView layout]): * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView dataSource]): * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedData:withDataSource:]): * Plugins.subproj/WebNullPluginView.m: (-[WebNullPluginView viewDidMoveToWindow]): * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase init]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge areScrollbarsVisible]): (-[WebBridge setScrollbarsVisible:]): (-[WebBridge window]): (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): (-[WebBridge nextKeyViewOutsideWebFrameViews]): (-[WebBridge previousKeyViewOutsideWebFrameViews]): (-[WebBridge setNeedsReapplyStyles]): (-[WebBridge setNeedsLayout]): (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): (-[WebBridge frameRequiredForMIMEType:]): (-[WebBridge handleMouseDragged:]): (-[WebBridge mayStartDragWithMouseDragged:]): * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (+[WebContentTypes canShowMIMEType:]): (-[WebController _commonInitialization:frameName:groupName:]): (-[WebController init]): (-[WebController initWithFrame:]): (-[WebController initWithView:]): (-[WebController supportsTextEncoding]): (-[WebController takeStringURLFrom:]): (-[WebController goBack:]): (-[WebController goForward:]): (-[WebController stopLoading:]): * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate _clearControllerReferences:]): (-[WebController _createFrameNamed:inParent:allowsScrolling:]): (-[WebController _frameForView:fromFrame:]): (-[WebController _frameForView:]): * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _layoutChildren]): (-[WebDataSource _receivedData:]): * WebView.subproj/WebDebugDOMNode.h: * WebView.subproj/WebDebugDOMNode.m: (-[WebDebugDOMNode initWithWebFrameView:]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate controller:contextMenuItemsForElement:defaultMenuItems:]): * WebView.subproj/WebDefaultLocationChangeDelegate.m: (-[WebDefaultLocationChangeDelegate controller:locationChangeStartedForDataSource:]): (-[WebDefaultLocationChangeDelegate controller:serverRedirectedForDataSource:]): (-[WebDefaultLocationChangeDelegate controller:locationChangeCommittedForDataSource:]): (-[WebDefaultLocationChangeDelegate controller:receivedPageTitle:forDataSource:]): (-[WebDefaultLocationChangeDelegate controller:receivedPageIcon:forDataSource:]): (-[WebDefaultLocationChangeDelegate controller:locationChangeDone:forDataSource:]): (-[WebDefaultLocationChangeDelegate controller:willCloseLocationForDataSource:]): (-[WebDefaultLocationChangeDelegate controller:locationChangedWithinPageForDataSource:]): (-[WebDefaultLocationChangeDelegate controller:clientWillRedirectTo:delay:fireDate:forFrame:]): (-[WebDefaultLocationChangeDelegate controller:clientRedirectCancelledForFrame:]): * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate controller:unableToImplementPolicyWithError:inFrame:]): (-[WebDefaultPolicyDelegate controller:decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]): (-[WebDefaultPolicyDelegate controller:decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener:]): * WebView.subproj/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate controller:identifierForInitialRequest:fromDataSource:]): (-[WebDefaultResourceLoadDelegate controller:resource:willSendRequest:fromDataSource:]): (-[WebDefaultResourceLoadDelegate controller:resource:didReceiveResponse:fromDataSource:]): (-[WebDefaultResourceLoadDelegate controller:resource:didReceiveContentLength:fromDataSource:]): (-[WebDefaultResourceLoadDelegate controller:resource:didFinishLoadingFromDataSource:]): (-[WebDefaultResourceLoadDelegate controller:resource:didFailLoadingWithError:fromDataSource:]): (-[WebDefaultResourceLoadDelegate controller:pluginFailedWithError:dataSource:]): * WebView.subproj/WebDefaultWindowOperationsDelegate.m: (-[WebDefaultWindowOperationsDelegate controller:runJavaScriptConfirmPanelWithMessage:]): (-[WebDefaultWindowOperationsDelegate controller:runJavaScriptTextInputPanelWithPrompt:defaultText:]): (-[WebDefaultWindowOperationsDelegate controller:runOpenPanelForFileButtonWithResultListener:]): * WebView.subproj/WebDocument.h: * WebView.subproj/WebDynamicScrollBarsView.m: * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (-[WebFrame init]): (-[WebFrame initWithName:webFrameView:controller:]): (-[WebFrame view]): (+[WebFrame registerViewClass:representationClass:forMIMEType:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (if): (switch): * WebView.subproj/WebHTMLView.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): (-[WebHTMLView draggedImage:endedAt:operation:]): (-[WebHTMLView becomeFirstResponder]): * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _controller]): (-[WebHTMLView _frame]): (-[WebHTMLView _elementAtPoint:]): * WebView.subproj/WebImageView.m: (-[WebImageView controller]): (-[WebImageView menuForEvent:]): (-[WebImageView mouseDragged:]): (-[WebImageView draggedImage:endedAt:operation:]): * WebView.subproj/WebLocationChangeDelegate.h: * WebView.subproj/WebRenderNode.h: * WebView.subproj/WebRenderNode.m: (-[WebRenderNode initWithName:position:rect:view:children:]): (-[WebRenderNode initWithWebFrameView:]): * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebTextView.m: (-[WebTextView menuForEvent:]): * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebFrameView initWithFrame:]): (-[WebFrameView dealloc]): * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: * WebView.subproj/WebWindowOperationsDelegate.h: 2003-03-13 John Sullivan <sullivan@apple.com> Reviewed by Trey. * English.lproj/StringsNotToBeLocalized.txt: Removed all the bookmarks-related strings that I forgot to remove in my previous checkin. 2003-03-13 John Sullivan <sullivan@apple.com> Removed all the bookmarks code from WebKit; put it in WebBrowser instead. Reviewed by Darin * Bookmarks.subproj/WebBookmark.h: Removed. * Bookmarks.subproj/WebBookmark.m: Removed. * Bookmarks.subproj/WebBookmarkGroup.h: Removed. * Bookmarks.subproj/WebBookmarkGroup.m: Removed. * Bookmarks.subproj/WebBookmarkGroupPrivate.h: Removed. * Bookmarks.subproj/WebBookmarkImporter.h: Removed. * Bookmarks.subproj/WebBookmarkImporter.m: Removed. * Bookmarks.subproj/WebBookmarkLeaf.h: Removed. * Bookmarks.subproj/WebBookmarkLeaf.m: Removed. * Bookmarks.subproj/WebBookmarkList.h: Removed. * Bookmarks.subproj/WebBookmarkList.m: Removed. * Bookmarks.subproj/WebBookmarkPrivate.h: Removed. * Bookmarks.subproj/WebBookmarkProxy.h: Removed. * Bookmarks.subproj/WebBookmarkProxy.m: Removed. * WebKit.exp: removed all bookmark-related symbols * WebKit.pbproj/project.pbxproj: updated for removed files === Safari-67 === 2003-03-12 Chris Blumenberg <cblu@apple.com> 3196673 - REGRESSION: Assertion failure when download fails to create file - Retain the download delegate because it will live longer than the WebController which it is an instance of. Reviewed by rjw. * Downloads.subproj/WebDownload.m: (-[WebDownload _initWithLoadingResource:request:response:delegate:proxy:]): call _downloadStarted (-[WebDownload loadWithDelegate:]): call _downloadStarted (-[WebDownload _downloadStarted]): renamed from _loadStarted (-[WebDownload _downloadEnded]): release delegate (-[WebDownload resource:willSendRequest:]): reordered so if we are released in this method, we never call self (-[WebDownload resourceDidFinishLoading:]): don't call _loadEnded because _downloadEnded gets called in _didCloseFile and _cancelWithError (-[WebDownload resource:didFailLoadingWithError:]): don't call _loadEnded because _downloadEnded gets called in _didCloseFile and _cancelWithError (-[WebDownload _didCloseFile:]): call _downloadEnded (-[WebDownload _cancelWithError:]): call _downloadEnded * WebView.subproj/WebController.h: mention that the download delegate gets retained. 2003-03-12 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3193552 -- REGRESSION: crash loading ftp directory URL - fixed minor problems with setDefersCallbacks handling and object lifetime * WebView.subproj/WebBaseResourceHandleDelegate.h: Removed now-unused cancelQuietly. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate cancel]): Changed cancel to tolerate being called when we have already cancelled. It's an error to call cancelWithError once we have cancelled. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient interruptForPolicyChangeError]): Added. New function to create the WebError object for policy change. (-[WebMainResourceClient stopLoadingForPolicyChange]): Changed to just be a call to cancelWithError:. (-[WebMainResourceClient resource:willSendRequest:]): Call setDefersCallbacks:YES here; continueAfterNavigationPolicy already takes care of setDefersCallbacks:NO, but we lost this one somewhere along the way. (-[WebMainResourceClient continueAfterContentPolicy:response:]): Changed to call receivedError: on interruptForPolicyChangeError directly. It wasn't clearer to call a method named interruptForPolicyChange. (-[WebMainResourceClient resource:didReceiveResponse:]): Don't bother calling setDefersCallbacks:YES here any more; checkContentPolicyForResponse: takes care of that so there's no need to do it here. Initialize _contentLength before calling checkContentPolicyForResponse:, since that method can result in deallocating self. 2003-03-12 John Sullivan <sullivan@apple.com> Reviewed by Trey * English.lproj/StringsNotToBeLocalized.txt: updated for recent changes 2003-03-11 Chris Blumenberg <cblu@apple.com> Fixed deployment build failure. * WebView.subproj/WebFramePrivate.m: 2003-03-11 Richard Williamson <rjw@apple.com> Added controller: parameter to all WebControllers delegates. Reviewed by chris. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadPluginRequest:]): * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebNullPluginView.m: (-[WebNullPluginView viewDidMoveToWindow]): * Plugins.subproj/WebPluginController.m: (-[WebPluginController showStatus:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): (-[WebBridge showWindow]): (-[WebBridge areToolbarsVisible]): (-[WebBridge setToolbarsVisible:]): (-[WebBridge isStatusBarVisible]): (-[WebBridge setStatusBarVisible:]): (-[WebBridge setWindowFrame:]): (-[WebBridge runJavaScriptAlertPanelWithMessage:]): (-[WebBridge runJavaScriptConfirmPanelWithMessage:]): (-[WebBridge runJavaScriptTextInputPanelWithPrompt:defaultText:returningText:]): (-[WebBridge runOpenPanelForFileButtonWithResultListener:]): (-[WebBridge setStatusText:]): (-[WebBridge objectLoadedFromCacheWithURL:response:size:]): * WebCoreSupport.subproj/WebSubresourceClient.m: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate resource:willSendRequest:]): (-[WebBaseResourceHandleDelegate resource:didReceiveResponse:]): (-[WebBaseResourceHandleDelegate resource:didReceiveData:]): (-[WebBaseResourceHandleDelegate resourceDidFinishLoading:]): (-[WebBaseResourceHandleDelegate resource:didFailLoadingWithError:]): (-[WebBaseResourceHandleDelegate cancelWithError:]): * WebView.subproj/WebContextMenuDelegate.h: * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _openNewWindowWithRequest:]): (-[WebController _menuForElement:]): (-[WebController _mouseDidMoveOverElement:modifierFlags:]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): (-[WebDataSource _setTitle:]): (-[WebDataSource _setRequest:]): (-[WebDataSource _updateIconDatabaseWithURL:]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate controller:contextMenuItemsForElement:defaultMenuItems:]): * WebView.subproj/WebDefaultLocationChangeDelegate.m: (-[WebDefaultLocationChangeDelegate controller:locationChangeStartedForDataSource:]): (-[WebDefaultLocationChangeDelegate controller:serverRedirectedForDataSource:]): (-[WebDefaultLocationChangeDelegate controller:locationChangeCommittedForDataSource:]): (-[WebDefaultLocationChangeDelegate controller:receivedPageTitle:forDataSource:]): (-[WebDefaultLocationChangeDelegate controller:receivedPageIcon:forDataSource:]): (-[WebDefaultLocationChangeDelegate controller:locationChangeDone:forDataSource:]): (-[WebDefaultLocationChangeDelegate controller:willCloseLocationForDataSource:]): (-[WebDefaultLocationChangeDelegate controller:locationChangedWithinPageForDataSource:]): (-[WebDefaultLocationChangeDelegate controller:clientWillRedirectTo:delay:fireDate:forFrame:]): (-[WebDefaultLocationChangeDelegate controller:clientRedirectCancelledForFrame:]): * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate controller:unableToImplementPolicy:error:forURL:inFrame:]): (-[WebDefaultPolicyDelegate controller:decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]): (-[WebDefaultPolicyDelegate controller:decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener:]): * WebView.subproj/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate controller:identifierForInitialRequest:fromDataSource:]): (-[WebDefaultResourceLoadDelegate controller:resource:willSendRequest:fromDataSource:]): (-[WebDefaultResourceLoadDelegate controller:resource:didReceiveResponse:fromDataSource:]): (-[WebDefaultResourceLoadDelegate controller:resource:didReceiveContentLength:fromDataSource:]): (-[WebDefaultResourceLoadDelegate controller:resource:didFinishLoadingFromDataSource:]): (-[WebDefaultResourceLoadDelegate controller:resource:didFailLoadingWithError:fromDataSource:]): (-[WebDefaultResourceLoadDelegate controller:pluginFailedWithError:dataSource:]): * WebView.subproj/WebDefaultWindowOperationsDelegate.m: (-[WebDefaultWindowOperationsDelegate controller:runJavaScriptConfirmPanelWithMessage:]): (-[WebDefaultWindowOperationsDelegate controller:runJavaScriptTextInputPanelWithPrompt:defaultText:]): (-[WebDefaultWindowOperationsDelegate controller:runOpenPanelForFileButtonWithResultListener:]): * WebView.subproj/WebFramePrivate.m: (if): (switch): * WebView.subproj/WebLocationChangeDelegate.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient checkContentPolicyForResponse:andCallSelector:]): * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebWindowOperationsDelegate.h: 2003-03-11 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. Final policy API changes: - changed WebPolicyDecisionListener to protocol in public API - replaced policy enum with separate methods - made content policy handling async * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebControllerPolicyDelegate.m: (-[WebPolicyDecisionListener _usePolicy:]): (-[WebPolicyDecisionListener use]): (-[WebPolicyDecisionListener ignore]): (-[WebPolicyDecisionListener download]): * WebView.subproj/WebControllerPolicyDelegatePrivate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate unableToImplementPolicyWithError:inFrame:]): (-[WebDefaultPolicyDelegate decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]): (-[WebDefaultPolicyDelegate decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (switch): * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient cancelContentPolicy]): (-[WebMainResourceClient cancel]): (-[WebMainResourceClient cancelQuietly]): (-[WebMainResourceClient cancelWithError:]): (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient continueAfterContentPolicy:]): (-[WebMainResourceClient checkContentPolicyForResponse:]): (-[WebMainResourceClient resource:didReceiveResponse:]): 2003-03-11 Darin Adler <darin@apple.com> Reviewed by John. - fixed mistake in that last check-in that made Safari assert on startup with Chris's bookmarks bar * Misc.subproj/WebStringTruncator.m: (centerTruncateToBuffer): Fix logic here to not use an uninitialized variable. 2003-03-11 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3193213 -- assert truncatedLength+1 < STRING_BUFFER_SIZE creating tab label for firstyearibs.com - fixed 3194935 -- WebStringTruncator rightTruncateString: will break between composed characters - fixed right truncator to use interpolation algorithm rather than linear search * Misc.subproj/WebStringTruncator.m: (centerTruncateToBuffer): Changed from a class method to a plain function, and tweaked the code a bit. (rightTruncateToBuffer): Added. Like centerTruncateToBuffer, but does it on the right end instead. (stringWidth): Added. Helper function that calls the TextRenderer method with the right parameters. (truncateString): Moved all the code from centerTruncateString here, adding one new parameter, the truncate to buffer function. (+[WebStringTruncator centerTruncateString:toWidth:]): Call truncateString with the appropriate parameters. (+[WebStringTruncator centerTruncateString:toWidth:withFont:]): Ditto. (+[WebStringTruncator rightTruncateString:toWidth:withFont:]): Ditto. === Safari-66 === 2003-03-10 Maciej Stachowiak <mjs@apple.com> Reviewed by Dave. - fixed 3194221 - REGRESSION: search results loaded in wrong frame at directory.apple.com * WebView.subproj/WebFramePrivate.m: (_postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:): Deliver targetted form posts correctly. 2003-03-10 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3010915 -- mouse wheel won't scroll the main document when you are over [i]frame * WebView.subproj/WebDynamicScrollBarsView.h: Made WebDynamicScrollBarsView a subclass of WebCoreScrollView instead of NSScrollView. - other changes * WebView.subproj/WebFramePrivate.m: (-[WebFrame _actionInformationForNavigationType:event:originalURL:): Fix problem where you would not get any information if the click was on a subview of the WebHTMLView, like a form control. 2003-03-10 Chris Blumenberg <cblu@apple.com> Fixed some download-related leaks. Primarily, we were leaking the data source that started the download. The data source is now immediately released when it becomes a download. Reviewed by darin. * Downloads.subproj/WebDownload.m: (-[WebDownloadPrivate dealloc]): release the WebResourceDelegateProxy (-[WebDownload _initWithLoadingResource:request:response:delegate:proxy:]): renamed, don't pass a datasource so WebDownload is completely disconnected from the that. Pass the proxy so it transfers ownership from WebMainResourceClient and it doesn' t leak when we cancel a download. (-[WebDownload _setRequest:]): added (-[WebDownload _setResponse:]): added (-[WebDownload resource:willSendRequest:]): call _setRequest (-[WebDownload resource:didReceiveResponse:]): call _setResponse * Downloads.subproj/WebDownloadPrivate.h: * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: removed notifyDelegatesOfInterruptionByPolicyChange, no longer called * WebView.subproj/WebMainResourceClient.h: made WebResourceDelegateProxy available to other classes * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:]): moved most error handling code here (-[WebMainResourceClient cancel]): stop load, call receivedError (-[WebMainResourceClient interruptForPolicyChange]): renamed, call receivedError with the policy interrupt error (-[WebMainResourceClient stopLoadingForPolicyChange]): call interruptForPolicyChange (-[WebMainResourceClient continueAfterContentPolicy:response:]): for WebPolicySave, create the download, call interruptForPolicyChange and return so the response isn't set on the superclass. (-[WebMainResourceClient resource:didFailLoadingWithError:]): call receivedError (-[WebResourceDelegateProxy setDelegate:]): don't retain the delegate (-[WebResourceDelegateProxy resourceDidFinishLoading:]): don't release the delegate (-[WebResourceDelegateProxy resource:didFailLoadingWithError:]): don't release the delegate 2003-03-07 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. - fixed 3127705 - don't open new window on opt-click even if the link requests it - fixed 3143971 - cmd-click should override the target="_blank" and target="_new" (important for tabs) - removed open new window and open new window behind policies - removed [WebFrame findOrCreateFrameNamed:] from API - remved showWindowBehind from window operations delegate - added decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener: delegate method * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadPluginRequest:]): (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): (-[WebPluginRequest initWithRequest:frameName:notifyData:]): (-[WebPluginRequest dealloc]): (-[WebPluginRequest frameName]): * Plugins.subproj/WebPluginController.m: (-[WebPluginController showURL:inFrame:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:referrer:reload:target:triggeringEvent:form:formValues:]): (-[WebBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _openNewWindowWithRequest:]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate openNewWindowWithURL:]): * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate decideNewWindowPolicyForAction:andRequest:newFrameName:decisionListener:]): * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[NSObject performSelector:withObject:withObject:withObject:]): * WebView.subproj/WebWindowOperationsDelegate.h: 2003-03-07 Chris Blumenberg <cblu@apple.com> Updated header doc comments. * Downloads.subproj/WebDownload.h: 2003-03-07 Richard Williamson <rjw@apple.com> Drop mainDocumentError from WebDataSource. Combine registerView: and registerRepresentation: into one method on WebFrame. Reviewed by trey. * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase init]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _mainDocumentError]): * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (+[WebFrame registerViewClass:representationClass:forMIMEType:]): * WebView.subproj/WebFramePrivate.m: (switch): * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: 2003-03-07 John Sullivan <sullivan@apple.com> WebKit part of fixes to these two synching-related bugs: 3190844 -- Bookmarks Bar and Menu collections need to be marked specially in Bookmarks file 3192197 -- Safari should write out UUID-full Bookmarks file after reading UUID-free one Reviewed by Trey * Bookmarks.subproj/WebBookmark.h: * Bookmarks.subproj/WebBookmark.m: (-[WebBookmark setUUID:]): Removed the leading underscore, made this method public. Removed unnecessary constraint that new or old UUID had to be nil; now short-circuits the no-change case. (-[WebBookmark copyWithZone:]): updated for name change (-[WebBookmark initFromDictionaryRepresentation:withGroup:]): ditto * Bookmarks.subproj/WebBookmarkGroup.h: * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup bookmarkForUUID:]): new public method to find a bookmark from a UUID. (-[WebBookmarkGroup _addBookmark:]): updated for name change * Bookmarks.subproj/WebBookmarkPrivate.h: removed declaration for old _setUUID 2003-03-07 Darin Adler <darin@apple.com> Reviewed by John. - fixed regression caused when we made the stopLoading method on WebDataSource private * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _recursiveStopLoading]): The children are frames, so we need to do stopLoading, not _stopLoading. 2003-03-07 Chris Blumenberg <cblu@apple.com> Fixed: 3191052 - Predetermined downloads should not be started from the browser window - Stripped the rest of WebKit of download related code. Reviewed by trey. * Downloads.subproj/WebDownload.h: Changed the download delegate method from download:didStartFromDataSource: download:didStartFromRequest:. Passing the data source wasn't that helpful. It was also quirky that the data source would sometimes be ni l. * Downloads.subproj/WebDownload.m: (-[WebDownloadPrivate dealloc]): release directory path (-[WebDownload _initWithLoadingResource:dataSource:]): call _loadStarted and _loadEnded (-[WebDownload loadWithDelegate:]): call _loadStarted (-[WebDownload _loadStarted]): set flag, retain self (-[WebDownload _loadEnded]): set flag, release self (-[WebDownload resource:willSendRequest:]): call _loadEnded if the returned request is nil (-[WebDownload resourceDidFinishLoading:]): call _loadEnded (-[WebDownload resource:didFailLoadingWithError:]): call _loadEnded (-[WebDownload _createFileIfNecessary]): handle a predetermined download directory, not path (-[WebDownload _cancelWithError:]): call _loadEnded (-[WebDownload _setDirectoryPath:]): new private method * Downloads.subproj/WebDownloadPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _mainReceivedError:fromDataSource:complete:]): don't call [dataSource isDownloading] (-[WebController _downloadURL:toDirectory:]): create and start a self retained WebDownload * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: removed download related methods * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: removed download related methods (-[WebDataSource _commitIfReady:]): don't call isDownloading * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): when handing off the load to the download, don't deal with the download path (-[WebMainResourceClient resource:didReceiveResponse:]): no more predetermined downloads come through here 2003-03-06 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. Step towards policy API changes. Remove WebPolicyNone, WebPolicyRevealInFinder, WebPolicyOpenURL and WebPolicyShow. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]): * WebView.subproj/WebFramePrivate.m: (switch): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): 2003-03-06 Richard Williamson <rjw@apple.com> Remove setWebView: from WebFrame. Reviewed by chris. * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:controller:]): (-[WebFrame name]): 2003-03-06 Richard Williamson <rjw@apple.com> API changes. WebCapabilities -> WebContentTypes. Move fileExtension from WebDataSource to WebContentTypes Reviewed by chris. * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_bestURL]): * WebKit.exp: * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (+[WebContentTypes suggestedFileExtensionForMIMEType:]): (-[WebController supportsTextEncoding]): (-[WebController setCustomTextEncodingName:]): (-[WebController _mainFrameOverrideEncoding]): (-[WebController customTextEncodingName]): (-[WebController stringByEvaluatingJavaScriptFromString:]): (-[WebController userAgentForURL:]): * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDefaultPolicyDelegate.m: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): 2003-03-06 Chris Blumenberg <cblu@apple.com> Implemented WebDownload API. Fixed: 3118355 - Download mechanism that doesn't involve WebDataSource, WebFrame, WebController etc Fixed: 3110173 - add per-request disabling of download decoding, use to turn off when "Open Safe Files" is off Reviewed by trey, rjw, mjs. * Downloads.subproj/WebDownload.h: Tweaked comments, added new methods. * Downloads.subproj/WebDownload.m: (-[WebDownloadPrivate dealloc]): release new objects (-[WebDownload initWithRequest:]): was initWithRequest:delegate:, but found that starting the load from the init method made it tricky to do other set up work before the load started. (-[WebDownload _initWithLoadingResource:dataSource:]): private init method, "catches up" to load by sending delegate method immediately, doesn't retain the dataSource, uses it for info (-[WebDownload loadWithDelegate:]): new, starts load (-[WebDownload cancel]): cancel load with no error (-[WebDownload path]): simple getter (-[WebDownload setPath:]): implement this because WebDownload is the WebDownloadDecisionListener, call _setPath (-[WebDownload resource:willSendRequest:]): resource delegate method (-[WebDownload resource:didReceiveResponse:]): resource delegate method (-[WebDownload resource:didReceiveData:]): resource delegate method, decode and write data, cancel load if error (-[WebDownload resourceDidFinishLoading:]): resource delegate method, decode and write data if necessary, end in error if error (-[WebDownload resource:didFailLoadingWithError:]): resource delegate method, end in error (-[WebDownload _pathWithUniqueFilenameForPath:]): this work was done in _createFileIfNecessary, does what it says (-[WebDownload _createFSRefForPath:]): this work was done in _createFileIfNecessary as well, makes fileRefPtr point to a file (-[WebDownload _createFileIfNecessary]): creates file, creates temp file if path hasn't been set yet (-[WebDownload _decodeHeaderData:dataForkData:resourceForkData:]): call private method (-[WebDownload _decodeData:dataForkData:resourceForkData:]): made private, if the download is encoded, ask client if OK to decode (-[WebDownload _decodeData:]): hardly changed, don't cancel, just return error (-[WebDownload _dataIfDoneBufferingData:]): moved, not changed (-[WebDownload _finishDecoding]): hardly changed, don't cancel, just return error (-[WebDownload _writeForkData:isDataFork:]): moved, not changed (-[WebDownload _writeDataForkData:resourceForkData:]): moved, not changed (-[WebDownload _isFileClosed]): new (-[WebDownload _fileDidClose:]): new, called by the callback thread, delete file if deleteFile flag is set, report error or end successfully (-[WebDownload _closeForkAsync:]): new (-[WebDownload _closeForkSync:]): new (-[WebDownload _closeFileAsync]): new (-[WebDownload _closeFileSync]): new (-[WebDownload _deleteFileAsnyc]): new (-[WebDownload _closeAndDeleteFileAsync]): new (-[WebDownload _cancelWithError:]): kill load if there is one, report error if there is one, close and delete file is not already closed or deleted (-[WebDownload _cancelWithErrorCode:]): internal convenienve, calls _cancelWithError (-[WebDownload _setPath:]): set path, if we are already saving data to a temp path, move the file and continue downloading (-[WebDownload _currentPath]): new (-[WebDownload _errorWithCode:]): new (-[WebDownload _dataForkReferenceNumber]): added underscore (-[WebDownload _setDataForkReferenceNumber:]): added underscore (-[WebDownload _resourceForkReferenceNumber]): added underscore (-[WebDownload _setResourceForkReferenceNumber:]): added underscore (-[WebDownload _areWritesCancelled]): added underscore (-[WebDownload _setWritesCancelled:]): added underscore (-[WebDownload _encounteredCloseError]): new (-[WebDownload _setEncounteredCloseError:]): new (WriteCompletionCallback): call underscored methods (CloseCompletionCallback): call underscored methods, handle close error, don't delete file (DeleteCompletionCallback): call _currentPath * Downloads.subproj/WebDownloadPrivate.h: * WebView.subproj/WebBaseResourceHandleDelegate.h: renamed handle to resource * WebView.subproj/WebBaseResourceHandleDelegate.m: renamed handle to resource (-[WebBaseResourceHandleDelegate _releaseResources]): renamed handle to resource (-[WebBaseResourceHandleDelegate startLoading:]): renamed handle to resource (-[WebBaseResourceHandleDelegate loadWithRequest:]): renamed handle to resource (-[WebBaseResourceHandleDelegate setDefersCallbacks:]): renamed handle to resource (-[WebBaseResourceHandleDelegate resource:willSendRequest:]): renamed handle to resource (-[WebBaseResourceHandleDelegate resource:didReceiveResponse:]): renamed handle to resource, don't handle downloads (-[WebBaseResourceHandleDelegate resource:didReceiveData:]): renamed handle to resource, don't handle downloads (-[WebBaseResourceHandleDelegate resourceDidFinishLoading:]): renamed handle to resource, don't handle downloads (-[WebBaseResourceHandleDelegate resource:didFailLoadingWithError:]): renamed handle to resource, don't handle downloads (-[WebBaseResourceHandleDelegate cancelWithError:]): renamed handle to resource, don't handle downloads * WebView.subproj/WebController.h: updated comments * WebView.subproj/WebController.m: (-[WebController setDownloadDelegate:]): call the ivar downloadDelegate, not downloadProgressDelegate (-[WebController downloadDelegate]): call the ivar downloadDelegate, not downloadProgressDelegate * WebView.subproj/WebControllerPolicyDelegate.h: removed saveFilenameForResponse:andRequest:, handle by WebDownload * WebView.subproj/WebControllerPrivate.h: call the ivar downloadDelegate, not downloadProgressDelegate * WebView.subproj/WebDefaultPolicyDelegate.m: removed saveFilenameForResponse:andRequest:, handle by WebDownload * WebView.subproj/WebMainResourceClient.h: added WebResourceDelegateProxy icar * WebView.subproj/WebMainResourceClient.m: remove most download related stuff (-[WebMainResourceClient initWithDataSource:]): create a WebResourceDelegateProxy which allows us to change the resource delegate (-[WebMainResourceClient dealloc]): release the proxy (-[WebMainResourceClient receivedError:complete:]): don't handle downloads (-[WebMainResourceClient continueAfterContentPolicy:response:]): pass the load off to the download (-[WebMainResourceClient resource:didReceiveResponse:]): don't handle downloads (-[WebMainResourceClient resource:didReceiveData:]): don't handle downloads (-[WebMainResourceClient resourceDidFinishLoading:]): don't handle downloads (-[WebMainResourceClient resource:didFailLoadingWithError:]): don't handle downloads (-[WebMainResourceClient startLoading:]): make the proxy the delegate (-[WebResourceDelegateProxy setDelegate:]): switches the resource delegate (-[WebResourceDelegateProxy resource:willSendRequest:]): forwards message (-[WebResourceDelegateProxy resource:didReceiveResponse:]): forwards message (-[WebResourceDelegateProxy resource:didReceiveData:]): forwards message (-[WebResourceDelegateProxy resourceDidFinishLoading:]): forwards message (-[WebResourceDelegateProxy resource:didFailLoadingWithError:]): forwards message 2003-03-06 Richard Williamson <rjw@apple.com> Move tweaks to WebKit API. Removed [WebFrame setController:] from public API. Removed [WebDataSource stringWithData:] from public API. Reviewed by hyatt. * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource mainDocumentError]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _stringWithData:]): * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebHTMLRepresentation.m: * WebView.subproj/WebTextRepresentation.m: (-[WebTextRepresentation setDataSource:]): * WebView.subproj/WebTextView.m: (-[WebTextView dataSourceUpdated:]): 2003-03-06 Richard Williamson <rjw@apple.com> Tweaks to WebKit API. Dropped URL on WebDataSource. Dropped start/stop loading on WebDataSource. Drop frameForView and frameForDataSource from WebController. Moved canShowXX to WebCapabilities. Reviewed by hyatt. * Downloads.subproj/WebDownload.m: (-[WebDownload errorWithCode:]): * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_bestURL]): * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_printViewHierarchy:]): * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView dataSource]): * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): * WebKit.exp: * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (+[WebCapabilities canShowMIMEType:]): (+[WebCapabilities canShowFile:]): (-[WebController mainFrame]): * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _frameForDataSource:fromFrame:]): (-[WebController _frameForDataSource:]): (-[WebController _frameForView:fromFrame:]): (-[WebController _frameForView:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading]): (-[WebDataSource _stopLoading]): (-[WebDataSource _stopLoadingInternal]): (-[WebDataSource _recursiveStopLoading]): (-[WebDataSource _updateIconDatabaseWithURL:]): (-[WebDataSource _loadIcon]): (-[WebDataSource _URL]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate openFrameInNewWindow:]): * WebView.subproj/WebDefaultPolicyDelegate.m: * WebView.subproj/WebFrame.m: (-[WebFrame stopLoading]): * WebView.subproj/WebFramePrivate.m: (if): * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _frame]): (-[WebHTMLView _elementAtPoint:]): * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation setDataSource:]): * WebView.subproj/WebImageView.m: (-[WebImageView menuForEvent:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient cancel]): (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient resource:didReceiveData:]): (-[WebMainResourceClient resourceDidFinishLoading:]): * WebView.subproj/WebTextView.m: (-[WebTextView menuForEvent:]): * WebView.subproj/WebView.m: (-[WebView webFrame]): * WebView.subproj/WebViewPrivate.m: (-[WebView _isMainFrame]): 2003-03-06 Ed Voas voas@apple.com Reviewed by Richard. Don't use _HIViewSetNeedsDisplayInRect for now. Fixes Jaguar builds. * Carbon.subproj/HIViewAdapter.m: (-[HIViewAdapter setNeedsDisplay:]): (-[HIViewAdapter setNeedsDisplayInRect:]): 2003-03-05 Maciej Stachowiak <mjs@apple.com> Reviewed by John. Step towards policy API chantes - removed unneeded policy and URL arguments from unableToImplementPolicy: * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): 2003-03-06 Ed Voas voas@apple.com Reviewed by Richard. First cut of Carbon view support. It will need tweaking as we go, but I think I finally have all the assertions taken care of, and I also believe that I have the drawing glitches all sorted out now. * Carbon.subproj/CarbonUtils.h: Added. * Carbon.subproj/CarbonUtils.m: Added. (InitWebKitForCarbon): (PoolCleaner): (ConvertNSImageToCGImageRef): * Carbon.subproj/CarbonWindowAdapter.h: Added. * Carbon.subproj/CarbonWindowAdapter.m: Added. (+[CarbonWindowAdapter frameViewClassForStyleMask:]): (-[CarbonWindowAdapter initWithContentRect:styleMask:backing:defer:]): (-[CarbonWindowAdapter initWithCarbonWindowRef:takingOwnership:disableOrdering:carbon:]): (-[CarbonWindowAdapter setViewsNeedDisplay:]): (-[CarbonWindowAdapter initWithCarbonWindowRef:takingOwnership:]): (-[CarbonWindowAdapter dealloc]): (-[CarbonWindowAdapter windowRef]): (-[CarbonWindowAdapter _hasWindowRef]): (-[CarbonWindowAdapter _managesWindowRef]): (-[CarbonWindowAdapter _removeWindowRef]): (-[CarbonWindowAdapter _carbonWindowClass]): (-[CarbonWindowAdapter reconcileToCarbonWindowBounds]): (-[CarbonWindowAdapter sendSuperEvent:]): (-[CarbonWindowAdapter _cancelKey:]): (-[CarbonWindowAdapter _commonAwake]): (-[CarbonWindowAdapter _destroyRealWindow:]): (-[CarbonWindowAdapter _oldPlaceWindow:]): (-[CarbonWindowAdapter _termWindowIfOwner]): (-[CarbonWindowAdapter _windowMovedToRect:]): (-[CarbonWindowAdapter constrainFrameRect:toScreen:]): (-[CarbonWindowAdapter selectKeyViewFollowingView:]): (-[CarbonWindowAdapter selectKeyViewPrecedingView:]): (-[CarbonWindowAdapter makeKeyWindow]): (-[CarbonWindowAdapter canBecomeKeyWindow]): (-[CarbonWindowAdapter canBecomeMainWindow]): (-[CarbonWindowAdapter encodeWithCoder:]): (-[CarbonWindowAdapter initWithCoder:]): (-[CarbonWindowAdapter setContentView:]): (-[CarbonWindowAdapter worksWhenModal]): (-[CarbonWindowAdapter _setModalWindowLevel]): (-[CarbonWindowAdapter _clearModalWindowLevel]): (-[CarbonWindowAdapter carbonHICommandIDFromActionSelector:]): (-[CarbonWindowAdapter sendCarbonProcessHICommandEvent:]): (-[CarbonWindowAdapter sendCarbonUpdateHICommandStatusEvent:withMenuRef:andMenuItemIndex:]): (-[CarbonWindowAdapter _handleRootBoundsChanged]): (-[CarbonWindowAdapter _handleContentBoundsChanged]): (-[CarbonWindowAdapter _handleCarbonEvent:callRef:]): (NSCarbonWindowHandleEvent): * Carbon.subproj/CarbonWindowContentView.h: Added. * Carbon.subproj/CarbonWindowContentView.m: Added. * Carbon.subproj/CarbonWindowFrame.h: Added. * Carbon.subproj/CarbonWindowFrame.m: Added. (+[CarbonWindowFrame frameRectForContentRect:styleMask:]): (+[CarbonWindowFrame contentRectForFrameRect:styleMask:]): (+[CarbonWindowFrame minFrameSizeForMinContentSize:styleMask:]): (-[CarbonWindowFrame frameRectForContentRect:styleMask:]): (-[CarbonWindowFrame contentRectForFrameRect:styleMask:]): (-[CarbonWindowFrame minFrameSizeForMinContentSize:styleMask:]): (-[CarbonWindowFrame initWithFrame:styleMask:owner:]): (-[CarbonWindowFrame dealloc]): (-[CarbonWindowFrame _setFrameNeedsDisplay:]): (-[CarbonWindowFrame _setSheet:]): (-[CarbonWindowFrame _updateButtonState]): (-[CarbonWindowFrame _windowChangedKeyState]): (-[CarbonWindowFrame _showToolbarWithAnimation:]): (-[CarbonWindowFrame _hideToolbarWithAnimation:]): (-[CarbonWindowFrame closeButton]): (-[CarbonWindowFrame styleMask]): (-[CarbonWindowFrame dragRectForFrameRect:]): (-[CarbonWindowFrame isOpaque]): (-[CarbonWindowFrame minimizeButton]): (-[CarbonWindowFrame setTitle:]): (-[CarbonWindowFrame title]): (-[CarbonWindowFrame _sheetHeightAdjustment]): (-[CarbonWindowFrame _maxTitlebarTitleRect]): (-[CarbonWindowFrame _clearDragMargins]): (-[CarbonWindowFrame _resetDragMargins]): * Carbon.subproj/HIViewAdapter.h: Added. * Carbon.subproj/HIViewAdapter.m: Added. (+[HIViewAdapter bindHIViewToNSView:nsView:]): (+[HIViewAdapter getHIViewForNSView:]): (+[HIViewAdapter unbindNSView:]): (-[HIViewAdapter initWithFrame:view:]): (-[HIViewAdapter hiView]): (-[HIViewAdapter nextValidKeyView]): (-[HIViewAdapter setNeedsDisplay:]): (-[HIViewAdapter setNeedsDisplayInRect:]): (-[CarbonSheetInterceptor _orderFrontRelativeToWindow:]): (-[CarbonSheetInterceptor _orderOutRelativeToWindow:]): * Carbon.subproj/HIWebView.h: Added. * Carbon.subproj/HIWebView.m: Added. (if): (switch): * Carbon.subproj/HIWebViewPriv.h: Added. * WebKit.exp: * WebKit.pbproj/project.pbxproj: === Safari-65 === 2003-03-05 Richard Williamson <rjw@apple.com> API changes WebView and WebDataSource give up -(WebController *)controller. WebView gets -(WebFrame *)webFrame. Reviewed by cblu. * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView dataSource]): * Plugins.subproj/WebNullPluginView.m: (-[WebNullPluginView viewDidMoveToWindow]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge startLoadingResource:withURL:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): (-[WebSubresourceClient receivedError:]): (-[WebSubresourceClient resourceDidFinishLoading:]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate setDataSource:]): * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController backForwardList]): (-[WebController setUsesBackForwardList:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _controller]): (-[WebDataSource _receivedError:complete:]): (-[WebDataSource _loadIcon]): * WebView.subproj/WebFrame.h: * WebView.subproj/WebFramePrivate.m: (switch): * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _controller]): (-[WebHTMLView _frame]): (-[WebHTMLView _elementAtPoint:]): * WebView.subproj/WebImageView.m: (-[WebImageView controller]): (-[WebImageView menuForEvent:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient interruptForPolicyChangeAndKeepLoading:]): (-[WebMainResourceClient continueAfterNavigationPolicy:formState:]): (-[WebMainResourceClient resource:willSendRequest:]): (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient checkContentPolicyForResponse:andCallSelector:]): (-[WebMainResourceClient resource:didReceiveResponse:]): (-[WebMainResourceClient resource:didReceiveData:]): (-[WebMainResourceClient resourceDidFinishLoading:]): (-[WebMainResourceClient resource:didFailLoadingWithError:]): * WebView.subproj/WebTextView.m: (-[WebTextView menuForEvent:]): * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView webFrame]): (-[WebView concludeDragOperation:]): * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _controller]): 2003-03-05 Maciej Stachowiak <mjs@apple.com> Reviewed by Ken. * WebView.subproj/WebFramePrivate.m: (_recursiveGoToItem:fromItem:withLoadType:): Account for possibility of nil target. 2003-03-05 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed crash when going back due to frame name of nil since we don't force the name "_top" any more. * WebView.subproj/WebController.m: (-[WebController _goToItem:withLoadType:]): Handle nil target properly. 2003-03-05 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3189441 -- REGRESSION: layout tests crash building generated frame name * WebView.subproj/WebFramePrivate.m: (-[WebFrame _addFramePathToString:]): Handle a frame name of nil here, since we don't force the name "_top" any more. 2003-03-04 Trey Matteson <trey@apple.com> Support for autofill. These are just two new glue routines that call down through the bridge. They allow regexp driven binding of AB data to form elements. Reviewed by Maciej. * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation searchForLabels:beforeElement:]): Call straight to bridge. (-[WebHTMLRepresentation matchLabels:againstElement:]): Call straight to bridge. 2003-03-04 Maciej Stachowiak <mjs@apple.com> Reinstate missing part of last checking. * WebView.subproj/WebFramePrivate.m: 2003-03-04 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. Added the ability to set the top-level frame name via the WebController initializer. Also made [[controller mainFrame] frameName] return the true top-level frame name instead of "_top", since that is already special-cased anywhere it needs to be. * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController init]): Update for change to designated initializer. (-[WebController initWithView:]): New convenience initializer. (-[WebController initWithView:frameName:setName:]): Added ability to set top-level frame name. * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate dealloc]): Remove topLevelFrameNAme field. (-[WebController _setTopLevelFrameName:]): Actually set it on the top level frame, no point to keeping it here. (-[WebController _findFrameInThisWindowNamed:]): No more need to special-case top-level frame name. * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:controller:]): call [self _setName:] instead of [_private setName:] * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setName:]): Don't let the name get set to _blank. 2003-03-04 John Sullivan <sullivan@apple.com> Reviewed by Darin * Misc.subproj/WebKitNSStringExtras.h: * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _web_widthWithFont:]): (-[NSString _web_drawAtPoint:font:textColor:): removed the unnecessary string parameter from these two NSString methods. 2003-03-04 Darin Adler <darin@apple.com> Reviewed by Maciej. - got rid of some framework initialization (working on bug 3185161) * WebView.subproj/WebPreferences.m: (-[WebPreferences _postPreferencesChangesNotification]): Moved this function up. (+[WebPreferences standardPreferences]): Call _postPreferencesChangesNotification when this is made, for consistency with the old behavior. (+[WebPreferences initialize]): Changed to initialize from load, and got rid of stuff we don't want to do from inside an initialize function. 2003-03-04 Richard Williamson <rjw@apple.com> Remove initWithURL: and frameName from WebDataSource public API. Reviewed by trey. * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource webFrame]): 2003-03-04 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. * English.lproj/Localizable.strings: Regenerated. 2003-03-03 Richard Williamson <rjw@apple.com> Switch all WebController's delegate to use informal protocols. Reviewed by trey. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView status:]): * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebNullPluginView.m: (-[WebNullPluginView viewDidMoveToWindow]): * Plugins.subproj/WebPluginController.m: (-[WebPluginController showStatus:]): * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): (-[WebBridge showWindow]): (-[WebBridge areToolbarsVisible]): (-[WebBridge setToolbarsVisible:]): (-[WebBridge isStatusBarVisible]): (-[WebBridge setStatusBarVisible:]): (-[WebBridge setWindowFrame:]): (-[WebBridge setStatusText:]): (-[WebBridge objectLoadedFromCacheWithURL:response:size:]): (-[WebBridge setWebFrame:]): * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate resourceLoadDelegate]): (-[WebBaseResourceHandleDelegate downloadDelegate]): (-[WebBaseResourceHandleDelegate resource:willSendRequest:]): (-[WebBaseResourceHandleDelegate resource:didReceiveResponse:]): (-[WebBaseResourceHandleDelegate resource:didReceiveData:]): (-[WebBaseResourceHandleDelegate resourceDidFinishLoading:]): (-[WebBaseResourceHandleDelegate resource:didFailLoadingWithError:]): (-[WebBaseResourceHandleDelegate cancelWithError:]): (-[WebBaseResourceHandleDelegate notifyDelegatesOfInterruptionByPolicyChange]): * WebView.subproj/WebContextMenuDelegate.h: * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController setWindowOperationsDelegate:]): (-[WebController windowOperationsDelegate]): (-[WebController setResourceLoadDelegate:]): (-[WebController resourceLoadDelegate]): (-[WebController setDownloadDelegate:]): (-[WebController downloadDelegate]): (-[WebController setContextMenuDelegate:]): (-[WebController contextMenuDelegate]): (-[WebController setPolicyDelegate:]): (-[WebController policyDelegate]): (-[WebController setLocationChangeDelegate:]): (-[WebController locationChangeDelegate]): (-[WebController stringByEvaluatingJavaScriptFromString:]): * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _openNewWindowWithRequest:behind:]): (-[WebController _menuForElement:]): (-[WebController _mouseDidMoveOverElement:modifierFlags:]): (-[WebController _locationChangeDelegateForwarder]): (-[WebController _resourceLoadDelegateForwarder]): (-[WebController _policyDelegateForwarder]): (-[WebController _contextMenuDelegateForwarder]): (-[WebController _windowOperationsDelegateForwarder]): (-[_WebSafeForwarder initWithTarget:defaultTarget:templateClass:]): (-[_WebSafeForwarder forwardInvocation:]): (-[_WebSafeForwarder methodSignatureForSelector:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): (-[WebDataSource _setTitle:]): (-[WebDataSource _setRequest:]): (-[WebDataSource _updateIconDatabaseWithURL:]): * WebView.subproj/WebDefaultContextMenuDelegate.h: * WebView.subproj/WebDefaultContextMenuDelegate.m: (+[WebDefaultContextMenuDelegate sharedContextMenuDelegate]): * WebView.subproj/WebDefaultLocationChangeDelegate.h: Added. * WebView.subproj/WebDefaultLocationChangeDelegate.m: Added. (+[WebDefaultLocationChangeDelegate sharedLocationChangeDelegate]): (-[WebDefaultLocationChangeDelegate locationChangeStartedForDataSource:]): (-[WebDefaultLocationChangeDelegate serverRedirectedForDataSource:]): (-[WebDefaultLocationChangeDelegate locationChangeCommittedForDataSource:]): (-[WebDefaultLocationChangeDelegate receivedPageTitle:forDataSource:]): (-[WebDefaultLocationChangeDelegate receivedPageIcon:forDataSource:]): (-[WebDefaultLocationChangeDelegate locationChangeDone:forDataSource:]): (-[WebDefaultLocationChangeDelegate willCloseLocationForDataSource:]): (-[WebDefaultLocationChangeDelegate locationChangedWithinPageForDataSource:]): (-[WebDefaultLocationChangeDelegate clientWillRedirectTo:delay:fireDate:forFrame:]): (-[WebDefaultLocationChangeDelegate clientRedirectCancelledForFrame:]): * WebView.subproj/WebDefaultPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: (+[WebDefaultPolicyDelegate sharedPolicyDelegate]): * WebView.subproj/WebDefaultPolicyDelegatePrivate.h: Removed. * WebView.subproj/WebDefaultResourceLoadDelegate.h: Added. * WebView.subproj/WebDefaultResourceLoadDelegate.m: Added. (+[WebDefaultResourceLoadDelegate sharedResourceLoadDelegate]): (-[WebDefaultResourceLoadDelegate identifierForInitialRequest:fromDataSource:]): (-[WebDefaultResourceLoadDelegate resource:willSendRequest:fromDataSource:]): (-[WebDefaultResourceLoadDelegate resource:didReceiveResponse:fromDataSource:]): (-[WebDefaultResourceLoadDelegate resource:didReceiveContentLength:fromDataSource:]): (-[WebDefaultResourceLoadDelegate resource:didFinishLoadingFromDataSource:]): (-[WebDefaultResourceLoadDelegate resource:didFailLoadingWithError:fromDataSource:]): (-[WebDefaultResourceLoadDelegate pluginFailedWithError:dataSource:]): * WebView.subproj/WebDefaultWindowOperationsDelegate.h: Added. * WebView.subproj/WebDefaultWindowOperationsDelegate.m: Added. (+[WebDefaultWindowOperationsDelegate sharedWindowOperationsDelegate]): (-[WebDefaultWindowOperationsDelegate runJavaScriptConfirmPanelWithMessage:]): (-[WebDefaultWindowOperationsDelegate runJavaScriptTextInputPanelWithPrompt:defaultText:]): (-[WebDefaultWindowOperationsDelegate runOpenPanelForFileButtonWithResultListener:]): * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:controller:]): (-[WebFrame findOrCreateFrameNamed:]): * WebView.subproj/WebFramePrivate.m: (if): (switch): * WebView.subproj/WebLocationChangeDelegate.h: * WebView.subproj/WebLocationChangeDelegate.m: Removed. * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient interruptForPolicyChangeAndKeepLoading:]): (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient checkContentPolicyForResponse:andCallSelector:]): * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebWindowOperationsDelegate.h: 2003-03-03 Darin Adler <darin@apple.com> Reviewed by Richard. - simplified the custom user agent and text encoding methods as per request from documentation group * WebView.subproj/WebController.h: Removed hasCustomUserAgent, resetUserAgent, hasCustomTextEncoding, and resetTextEncoding. Updated comments to indicate what nil means. * WebView.subproj/WebController.m: (-[WebController setCustomUserAgent:]): Remove assertion, allow nil. (-[WebController customUserAgent]): Remove nil check. (-[WebController setCustomTextEncodingName:]): Remove assertion, allow nil, and do an == check along with the isEqualToString: check to handle the nil case. (-[WebController customTextEncodingName]): Remove nil check. 2003-03-01 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3163855 - Need control over certain potential dialogs/sheets * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge runJavaScriptAlertPanelWithMessage:]): Moved here from view factory. Call the bridge instead of popping up the dialog. (-[WebBridge runJavaScriptConfirmPanelWithMessage:]): Likewise. (-[WebBridge runJavaScriptTextInputPanelWithPrompt:defaultText:returningText:]): Likewise. (-[WebBridge fileButton]): Moved here from view factory, so we can pass the bridge to the button. (-[WebBridge runOpenPanelForFileButtonWithResultListener:]): Call the delegate. * WebCoreSupport.subproj/WebFileButton.h: * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileButton initWithBridge:]): New method so this object knows about the bridge. (-[WebFileButton beginSheet]): Instead of popping up the sheet directly, call the bridge (which will call the delegate). (-[WebFileButton chooseFilename:]): Update for the new filename. (-[WebFileButton cancel]): Do nothing. * WebCoreSupport.subproj/WebViewFactory.m: Removed some methods. * WebKit.exp: Export .objc_class_WebJavaScriptTextInputPanel (for now). * WebKit.pbproj/project.pbxproj: Export WebJavaScriptTextInputPanel.h (for now). * WebView.subproj/WebWindowOperationsDelegate.h: Added new methods. 2003-03-01 Richard Williamson <rjw@apple.com> Reviewed by Chris & Darin. Fixed frameRequiredForMIMEType: to correctly check for BOTH netscape plugins and cocoa plugins. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge frameRequiredForMIMEType:]): Made WebPluginViewFactory.h private (SPI) to provide access to plugin package keys. * WebKit.pbproj/project.pbxproj: 2003-02-28 Richard Williamson <rjw@apple.com> Make WebDOM* classes private instead of public. This change was made before but the project file must have been accidentally overwritten. Make the WebPlugin* classes private. * WebKit.pbproj/project.pbxproj: 7003-02-28 Trey Matteson <trey@apple.com> Various support for autofill/autocomplete. We receive a form along with the formValues from WC on submit, which we just pass along to the FormDelegate. As part of this we store the values and the form together in a new private WebFormState class. Lots of glue for passing this around instead of just the values dict. Send willCloseLocationForDataSource when we are finally through with a page. Reviewed by Darin. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:reload:triggeringEvent:form:formValues:]): Pass along form along with values (-[WebBridge postWithURL:data:contentType:triggeringEvent:form:formValues:]): Pass along form along with values * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady:]): Call frame to send willCloseLocationForDataSource. * WebView.subproj/WebFormDelegate.h: * WebView.subproj/WebFormDelegate.m: (-[WebFormDelegate frame:willSubmitForm:withValues:]): Pass form along with values * WebView.subproj/WebFrame.m: (-[WebFrame loadRequest:]): Pass FormState instead of just values. (-[WebFrame reload]): Pass FormState instead of just values. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: <<prepare-ChangeLog flailed on this file>> Lots of routines were we pass FormState instead of the form values dict -([WebFrame _closeOldDataSources]): New, sends willCloseLocation for whole frame tree. New, trivial, WebFormState class. * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation formIsLoginForm:]): Changed to take form instead of form field. (-[WebHTMLRepresentation formForElement:]): New, just pass through bridge. (-[WebHTMLRepresentation controlsInForm:]): New, just pass through bridge. * WebView.subproj/WebLocationChangeDelegate.h: Add willCloseLocationForDataSource. * WebView.subproj/WebLocationChangeDelegate.m: (-[WebLocationChangeDelegate willCloseLocationForDataSource:]): Default impl. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterNavigationPolicy:formState:]): Pass FormState instead of just values. (-[WebMainResourceClient resource:willSendRequest:]): Pass FormState instead of just values. 2003-02-28 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. - fixed 3180170 - filepile.com does not work correctly I fixed this by making referrer work correctly for targetted cross-frame and cross-window links. It is still not working right for JavaScript window.open though. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): Set referrer. (-[WebBridge loadURL:referrer:reload:triggeringEvent:formValues:]): Pass referrer along to frame. (-[WebBridge postWithURL:referrer:data:contentType:triggeringEvent:formValues:]): Likewise. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadItem:fromItem:withLoadType:]): Pass referrer. (-[WebFrame _loadURL:referrer:loadType:triggeringEvent:formValues:]): Use passed-in referrer (link could have been clicked in another frame). (-[WebFrame _loadURL:intoChild:]): Pass referrer. (-[WebFrame _postWithURL:referrer:data:contentType:triggeringEvent:formValues:]): Use passed-in referrer. 2003-02-28 Darin Adler <darin@apple.com> Reviewed by Trey. - fixed 3183575 -- <https://sbcreg.sbcglobal.net> casuses infinite refresh & crash The page had history.forward(1) which was causing us to reload. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge goBackOrForward:]): Handle edge cases by checking backListCount and forwardListCount at this level. Be sure to do nothing when we are already on the right page. * History.subproj/WebBackForwardList.h: Added forwardListCount, updated comment for entryAtIndex. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList forwardListCount]): Added. (-[WebBackForwardList entryAtIndex:]): Return nil for out of range indices. 2003-02-27 Maciej Stachowiak <mjs@apple.com> Reviewed by Richard. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge window]): Avoid calling removed call. * WebView.subproj/WebView.m: Remove override of window method. * WebView.subproj/WebWindowOperationsDelegate.h: Adjust for new API. === Safari-64 === === Safari-63 === 2003-02-26 Maciej Stachowiak <mjs@apple.com> Reviewed by Dave. - fixed reproducible hang at http://asp.eltonsoft.dk/cast/get.asp?cat=Quicktime WebKit's processing time was O(N^3) in the number of frames. Improved it to O(N^2) by storing frame pointer directly in WebDataSource instead of linear scan. Could still be improved more. * WebView.subproj/WebDataSource.m: (-[WebDataSource webFrame]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _stopLoadingWithError:]): (-[WebDataSource _setWebFrame:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _detachFromParent]): (-[WebFrame _setDataSource:]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _isLoadComplete]): (-[WebFrame _clearProvisionalDataSource]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formValues:]): (-[WebFrame _loadDataSource:withLoadType:formValues:]): (-[WebFrame _setProvisionalDataSource:]): 2003-02-26 Richard Williamson <rjw@apple.com> Fixed 3102760. Removed WebDocumentDragSettings from API. Reviewed by Chris. * WebView.subproj/WebDocument.h: * WebView.subproj/WebHTMLView.h: * WebView.subproj/WebHTMLView.m: * WebView.subproj/WebImageView.h: * WebView.subproj/WebImageView.m: (-[WebImageView initWithFrame:]): (-[WebImageView mouseDragged:]): * WebView.subproj/WebTextView.h: * WebView.subproj/WebTextView.m: (-[WebTextView initWithFrame:]): (-[WebTextView layout]): 2003-02-25 David Hyatt <hyatt@apple.com> Fix for bug #3181249. Ensure the padding argument gets passed through properly (instead of just passing 0). Reviewed by darin * WebCoreSupport.subproj/WebTextRenderer.m: 2003-02-25 John Sullivan <sullivan@apple.com> WebKit part of fix for 3181290 -- need call to reload all bookmarks from disk, for synching's sake. I ended up not adding a new call, but making the existing loadBookmarkGroup work better when called after the initial load. It wasn't doing anything wrong before; it just wasn't passing along enough information to clients to enable them to do the right thing. Reviewed by Trey * Bookmarks.subproj/WebBookmarkGroup.h: new extern NSStrings WebBookmarksWillBeReloadedNotification and WebBookmarksWereReloadedNotification * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup _sendNotification:forBookmark:children:]): soften assert so it doesn't fire on the new cases. (-[WebBookmarkGroup _bookmarksWillBeReloaded]): send WebBookmarksWillBeReloadedNotification (-[WebBookmarkGroup _bookmarksWereReloaded]): send WebBookmarksWereReloadedNotification (-[WebBookmarkGroup _loadBookmarkGroupGuts]): bracket the load with the new notification-sending calls * WebKit.exp: add the two new extern NSStrings 2003-02-25 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3176962 -- add KHTML somewhere in the user agent string * English.lproj/StringsNotToBeLocalized.txt: Change "(like Gecko)" to "(KHTML, like Gecko)". * WebView.subproj/WebController.m: (-[WebController userAgentForURL:]): Ditto. 2003-02-20 Chris Blumenberg <cblu@apple.com> Added _web_superviewOfClass:stoppingAtClass:. Climbs up hierarchy and returns nil when stoppingAtClass is hit. Reviewed by darin. * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_superviewOfClass:stoppingAtClass:]): (-[NSView _web_superviewOfClass:]): 2003-02-20 Ken Kocienda <kocienda@apple.com> Reviewed by David Modified to use new WebFoundation API. Though there seem to be many changes, they are all "uninteresting" in that the changes only moved code to use new method and class names. * Downloads.subproj/WebDownload.h: * Downloads.subproj/WebDownload.m: (-[WebDownload initWithRequest:delegate:]): (-[WebDownload _initWithLoadingHandle:request:response:delegate:]): (-[WebDownload createFileIfNecessary]): * Downloads.subproj/WebDownloadPrivate.h: * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]): (-[WebIconLoader resourceDidFinishLoading:]): (-[WebIconLoader resource:willSendRequest:]): (-[WebIconLoader resource:didReceiveResponse:]): (-[WebIconLoader resource:didReceiveData:]): (-[WebIconLoader resource:didFailLoadingWithError:]): * Misc.subproj/WebResourceResponseExtras.h: * Misc.subproj/WebResourceResponseExtras.m: (-[WebHTTPResponse suggestedFilenameForSaving]): * Plugins.subproj/WebBaseNetscapePluginStream.h: * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setResponse:]): * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendEvent:]): (-[WebBaseNetscapePluginView requestWithURLCString:]): (-[WebBaseNetscapePluginView loadPluginRequest:]): (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): (-[WebBaseNetscapePluginView getURLNotify:target:notifyData:]): (-[WebBaseNetscapePluginView getURL:target:]): (-[WebBaseNetscapePluginView postURLNotify:target:len:buf:file:notifyData:]): (-[WebPluginRequest initWithRequest:frame:notifyData:]): (-[WebPluginRequest request]): * Plugins.subproj/WebBaseNetscapePluginViewPrivate.h: * Plugins.subproj/WebNetscapePluginDocumentView.m: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView viewDidMoveToWindow]): * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedError:withDataSource:]): * Plugins.subproj/WebNetscapePluginStream.h: * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:]): (-[WebNetscapePluginStream resource:didReceiveResponse:]): (-[WebNetscapePluginStream resource:didReceiveData:]): (-[WebNetscapePluginStream resourceDidFinishLoading:]): (-[WebNetscapePluginStream resource:didFailLoadingWithError:]): * Plugins.subproj/WebPluginController.m: (-[WebPluginController showURL:inFrame:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): (-[WebBridge objectLoadedFromCacheWithURL:response:size:]): (-[WebBridge defersLoading]): (-[WebBridge setDefersLoading:]): (-[WebBridge loadEmptyDocumentSynchronously]): * WebCoreSupport.subproj/WebCookieAdapter.m: (-[WebCookieAdapter cookiesForURL:]): (-[WebCookieAdapter setCookies:forURL:policyBaseURL:]): * WebCoreSupport.subproj/WebSubresourceClient.h: * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): (-[WebSubresourceClient resource:willSendRequest:]): (-[WebSubresourceClient resource:didReceiveResponse:]): (-[WebSubresourceClient resource:didReceiveData:]): (-[WebSubresourceClient resourceDidFinishLoading:]): (-[WebSubresourceClient resource:didFailLoadingWithError:]): * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate startLoading:]): (-[WebBaseResourceHandleDelegate loadWithRequest:]): (-[WebBaseResourceHandleDelegate setDefersCallbacks:]): (-[WebBaseResourceHandleDelegate resource:willSendRequest:]): (-[WebBaseResourceHandleDelegate resource:didReceiveResponse:]): (-[WebBaseResourceHandleDelegate resource:didReceiveData:]): (-[WebBaseResourceHandleDelegate resourceDidFinishLoading:]): (-[WebBaseResourceHandleDelegate resource:didFailLoadingWithError:]): (-[WebBaseResourceHandleDelegate cancelledError]): * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebResourceLoadDelegate identifierForInitialRequest:fromDataSource:]): (-[WebResourceLoadDelegate resource:willSendRequest:fromDataSource:]): (-[WebResourceLoadDelegate resource:didReceiveResponse:fromDataSource:]): * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _downloadURL:toDirectory:]): (-[WebController defersCallbacks]): (-[WebController setDefersCallbacks:]): (-[WebController _openNewWindowWithRequest:behind:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithURL:]): (-[WebDataSource initWithRequest:]): (-[WebDataSource initialRequest]): (-[WebDataSource request]): (-[WebDataSource response]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _addSubresourceClient:]): (-[WebDataSource _stopLoading]): (-[WebDataSource _setURL:]): (-[WebDataSource _setRequest:]): (-[WebDataSource _setResponse:]): (-[WebDataSource _commitIfReady:]): (-[WebDataSource _defersCallbacksChanged]): (-[WebDataSource _originalRequest]): (-[WebDataSource _lastCheckedRequest]): (-[WebDataSource _setLastCheckedRequest:]): (-[WebDataSource _addResponse:]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate contextMenuItemsForElement:defaultMenuItems:]): (-[WebDefaultContextMenuDelegate openNewWindowWithURL:]): * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate savePathForResponse:andRequest:]): (-[WebDefaultPolicyDelegate decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]): * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (-[WebFrame loadRequest:]): (-[WebFrame reload]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _createItem]): (-[WebFrame _opened]): (-[WebFrame _loadItem:fromItem:withLoadType:]): (-[WebFrame _loadRequest:triggeringAction:loadType:formValues:]): (-[WebFrame _invalidatePendingPolicyDecisionCallingDefaultAction:]): (-[WebFrame _checkNavigationPolicyForRequest:dataSource:formValues:andCall:withSelector:]): (-[WebFrame _continueAfterNavigationPolicy:]): (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:formValues:]): (-[WebFrame _addExtraFieldsToRequest:alwaysFromRequest:]): (-[WebFrame _loadURL:loadType:triggeringEvent:formValues:]): (-[WebFrame _postWithURL:data:contentType:triggeringEvent:formValues:]): (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formValues:]): (-[WebFrame _downloadRequest:toDirectory:]): * WebView.subproj/WebHTMLRepresentation.m: * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterNavigationPolicy:formValues:]): (-[WebMainResourceClient resource:willSendRequest:]): (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient checkContentPolicyForResponse:andCallSelector:]): (-[WebMainResourceClient resource:didReceiveResponse:]): (-[WebMainResourceClient resource:didReceiveData:]): (-[WebMainResourceClient resourceDidFinishLoading:]): (-[WebMainResourceClient resource:didFailLoadingWithError:]): (-[WebMainResourceClient startLoading:]): * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebTextRepresentation.m: * WebView.subproj/WebTextView.m: * WebView.subproj/WebView.m: (-[WebView concludeDragOperation:]): * WebView.subproj/WebViewPrivate.m: * WebView.subproj/WebWindowOperationsDelegate.h: 2003-02-18 Maciej Stachowiak <mjs@ap0101m-dhcp138.apple.com> Reviewed by Chris. Merged changes from Safari-58-1-branch. 2003-02-11 Richard Williamson <rjw@apple.com> Add import of CGFontCache.h, which is no longer included by CoreGraphicsPrivate.h. Reviewed by Vicki. * WebCoreSupport.subproj/WebTextRendererFactory.m: 2003-02-11 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. * WebCoreSupport.subproj/WebTextRenderer.m: Change (void **) cast to (void *) for compatibility with the latest Panther. 2003-02-11 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. * WebKit.pbproj/project.pbxproj: Add /System/Library/PrivateFrameworks === Safari-62 === 2003-02-17 Ken Kocienda <kocienda@apple.com> Reviewed by Trey Rolled in documentation changes from Peter Kelly, our tech writer. * History.subproj/WebBackForwardList.h * History.subproj/WebHistory.h * Misc.subproj/WebKitErrors.h * Misc.subproj/WebResourceResponseExtras.h * Panels.subproj/WebStandardPanels.h * Plugins.subproj/WebPluginError.h * WebView.subproj/WebContextMenuDelegate.h * WebView.subproj/WebController.h * WebView.subproj/WebControllerPolicyDelegate.h * WebView.subproj/WebDataSource.h * WebView.subproj/WebDefaultPolicyDelegate.h * WebView.subproj/WebDocument.h * WebView.subproj/WebFrame.h * WebView.subproj/WebPreferences.h * WebView.subproj/WebResourceLoadDelegate.h * WebView.subproj/WebView.h * WebView.subproj/WebWindowOperationsDelegate.h 2003-02-13 Trey Matteson <trey@apple.com> 2943514 hide the cursor when using the arrow keys to scroll Reviewed by Darin * WebView.subproj/WebView.m: (-[WebView keyDown:]): Hide that cursor. 2003-02-16 Chris Blumenberg <cblu@apple.com> Added debug method that can be used inside of gdb to examine an image. Needed this many times. Reviewed by darin. * Misc.subproj/WebNSImageExtras.h: * Misc.subproj/WebNSImageExtras.m: (-[NSImage _web_saveAndOpen]): 2003-02-15 Darin Adler <darin@apple.com> * English.lproj/Localizable.strings: Regenerated. 2003-02-14 David Hyatt <hyatt@apple.com> Patch to the drawLine function for the inline box model landing. Reviewed by kocienda * WebCoreSupport.subproj/WebTextRenderer.m: 2003-02-13 Trey Matteson <trey@apple.com> First checkin for working forms autocomplete. This level mostly just has glue to go from app to WC through the bridge. WebHTMLReo exports some new SPI to get the element of a view, and then to get some HTML-level properties of that element. Reviewed by Chris * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup _saveBookmarkGroupGuts]): Don't dump entire bookmark dict in the log. * WebKit.exp: New class used by app, objc_class_name_WebHTMLRepresentation. * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation elementForView:]): New SPI. (-[WebHTMLRepresentation elementDoesAutoComplete:]): New SPI. (-[WebHTMLRepresentation elementIsInLoginForm:]): New SPI. 2003-02-13 Chris Blumenberg <cblu@apple.com> Fixed WebKit typos found by Peter Wilson. Reviewed by darin. * Misc.subproj/WebKitErrors.h: * Misc.subproj/WebKitErrors.m: (categoryInitialize): Error should be WebErrorDescriptionCannotFindApplicationForURL not WebErrorDescriptionCannotNotFindApplicationForURL * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): call findOrCreateFrameNamed * Plugins.subproj/WebPluginController.m: (-[WebPluginController showURL:inFrame:]): call findOrCreateFrameNamed * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge findOrCreateFrameNamed:]): call findOrCreateFrameNamed * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (-[WebFrame findOrCreateFrameNamed:]): fixed name * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueAfterNavigationPolicy:]): use WebErrorDescriptionCannotFindApplicationForURL * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): use WebErrorDescriptionCannotFindApplicationForURL * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView setAllowsScrolling:]): cast to WebDynamicScrollBarsView (-[WebView allowsScrolling]): cast to WebDynamicScrollBarsView (-[WebView frameScrollView]): return NSScrollView * WebView.subproj/WebViewPrivate.m: (-[WebView _setDocumentView:]): cast to WebDynamicScrollBarsView 2003-02-12 Chris Blumenberg <cblu@apple.com> - Moved the WebKit error registration out of WebView because apps that use WebKit but not WebView might need to use WebKit errors (like my test app for WebDownload). - Added file close and file move errors (needed for WebDownload). Reviewed by kocienda. * English.lproj/Localizable.strings: Localize file close and file move errors. * Misc.subproj/WebKitErrors.h: Added file close and file move errors. * Misc.subproj/WebKitErrors.m: Added. (+[WebError initialize]): register the errors here * WebKit.exp: Export the WebDownload class (forgot to do this earlier). * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebView.m: don't register the errors here 2003-02-12 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed 3158484 -- after submission failure, submitting a second time doesn't work * WebView.subproj/WebDataSourcePrivate.h: Added _receivedError:complete: method. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _receivedError:complete:]): Added, parallel to _receivedData and _finishedLoading. Calls the new bridge method didNotOpenURL: for cases where we fail before committing (which calls openURL). Note that we can't use our own _bridge method because it asserts that we have committed to prevent accidental misuse. Also make the call on the controller that used to be done directly by the client. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:complete:]): Call the new -[WebDataSource _receivedError:complete:] rather than calling the controller directly. 2003-02-11 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2003-02-11 Darin Adler <darin@apple.com> Reviewed by Ed. - applied a fixed version of Ed Voas's change to make plug-ins position correctly inside Carbon metal windows; should have no effect on Safari * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): Don't assume that the Cocoa concept of the content view matches up with the Carbon concept of where the port is positioned. Instead, convert coordinates to border view coordinates, then back to Carbon content coordinates by using the delta between the port bounds and the port's pixmap bounds. Bug 3160710 was caused by an older version of this patch implicitly assuming the port bounds always had (0,0) for top left. 2003-02-11 Trey Matteson <trey@apple.com> Set -seg1addr in our build styles, but not for the B&I build. This makes our SYMROOTS from B&I usable to determine symbols from crash logs from the field. Also nuked DeploymentFat build style. Reviewed by Ken. * WebKit.pbproj/project.pbxproj: 2003-02-10 Chris Blumenberg <cblu@apple.com> Added HeaderDoc comments for WebDownload and WebPluginError. Reviewed by rjw. * Downloads.subproj/WebDownload.h: * Plugins.subproj/WebPluginError.h: 2003-02-10 Trey Matteson <trey@apple.com> Following the recent fix for ensuring that we always have a FormDelegate, when we need a default policy delegate we use a shared one instead of allocing a new one each time, which then would leak. This included getting rid of the initWithWebController: method in the WebDefaultPolicyDelegate API. The arg was not used. Reviewed by Richard * WebKit.pbproj/project.pbxproj: new private header * WebView.subproj/WebController.m: (-[WebController policyDelegate]): use shared delegate if none set * WebView.subproj/WebDefaultPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: (+[WebDefaultPolicyDelegate _sharedWebPolicyDelegate]): return shared instance * WebView.subproj/WebDefaultPolicyDelegatePrivate.h: Added. * WebView.subproj/WebFormDelegate.m: (+[WebFormDelegate _sharedWebFormDelegate]): Trivial renaming of static. 2003-02-10 Richard Williamson <rjw@apple.com> Update API issues document. * API-Issues.rtf: 2003-02-10 Chris Blumenberg <cblu@apple.com> Fixed: 3168888 - REGRESSION: many downloads fail (due to -36 error from write) Reviewed by darin. * Downloads.subproj/WebDownload.m: (-[WebDownload writeForkData:isDataFork:]): 2003-02-10 Trey Matteson <trey@apple.com> Make sure we have a FormsDelegate installed with NOP behavior if our client does not set one. Editing forms was broken for Ed by the introduction of the new FormDelegate. Reviewed by Darin. * WebKit.pbproj/project.pbxproj: Added new header file. * WebView.subproj/WebControllerPrivate.m: (-[WebController _formDelegate]): Use shared delegate if none set yet. * WebView.subproj/WebFormDelegatePrivate.h: New header. * WebView.subproj/WebFormDelegate.h: Nit cleanup. * WebView.subproj/WebFormDelegate.m: (+[WebFormDelegate _sharedWebFormDelegate]): New method to return a shared NOP implementation. 2003-02-07 Richard Williamson <rjw@apple.com> Changes to support per WebController preferences. Reviewed by Maciej and Ken. * WebView.subproj/WebController.m: (-[WebController setPreferences:]): * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate init]): (-[WebControllerPrivate dealloc]): (-[WebController _setFormDelegate:]): (-[WebController _formDelegate]): (-[WebController _settings]): (-[WebController _updateWebCoreSettingsFromPreferences:]): (-[WebController _releaseUserAgentStrings]): (-[WebController _preferencesChangedNotification:]): * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:controller:]): * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (-[WebPreferences _postPreferencesChangesNotification]): (+[WebPreferences load]): (-[WebPreferences _stringValueForKey:]): (-[WebPreferences _setStringValue:forKey:]): (-[WebPreferences _integerValueForKey:]): (-[WebPreferences _setIntegerValue:forKey:]): (-[WebPreferences _boolValueForKey:]): (-[WebPreferences _setBoolValue:forKey:]): (-[WebPreferences standardFontFamily]): (-[WebPreferences setStandardFontFamily:]): (-[WebPreferences fixedFontFamily]): (-[WebPreferences setFixedFontFamily:]): (-[WebPreferences serifFontFamily]): (-[WebPreferences setSerifFontFamily:]): (-[WebPreferences sansSerifFontFamily]): (-[WebPreferences setSansSerifFontFamily:]): (-[WebPreferences cursiveFontFamily]): (-[WebPreferences setCursiveFontFamily:]): (-[WebPreferences fantasyFontFamily]): (-[WebPreferences setFantasyFontFamily:]): (-[WebPreferences defaultFontSize]): (-[WebPreferences setDefaultFontSize:]): (-[WebPreferences defaultFixedFontSize]): (-[WebPreferences setDefaultFixedFontSize:]): (-[WebPreferences minimumFontSize]): (-[WebPreferences setMinimumFontSize:]): (-[WebPreferences defaultTextEncodingName]): (-[WebPreferences setDefaultTextEncodingName:]): (-[WebPreferences userStyleSheetEnabled]): (-[WebPreferences setUserStyleSheetEnabled:]): (-[WebPreferences userStyleSheetLocation]): (-[WebPreferences setUserStyleSheetLocation:]): (-[WebPreferences JavaEnabled]): (-[WebPreferences setJavaEnabled:]): (-[WebPreferences JavaScriptEnabled]): (-[WebPreferences setJavaScriptEnabled:]): (-[WebPreferences JavaScriptCanOpenWindowsAutomatically]): (-[WebPreferences setJavaScriptCanOpenWindowsAutomatically:]): (-[WebPreferences pluginsEnabled]): (-[WebPreferences setPluginsEnabled:]): (-[WebPreferences allowAnimatedImages]): (-[WebPreferences allowAnimatedImageLooping]): (-[WebPreferences setAllowAnimatedImageLooping:]): (-[WebPreferences setWillLoadImagesAutomatically:]): (-[WebPreferences willLoadImagesAutomatically]): (-[WebPreferences _initialTimedLayoutDelay]): (-[WebPreferences _initialTimedLayoutSize]): (-[WebPreferences _pageCacheSize]): (-[WebPreferences _objectCacheSize]): (-[WebPreferences _initialTimedLayoutEnabled]): (-[WebPreferences _resourceTimedLayoutDelay]): (-[WebPreferences _resourceTimedLayoutEnabled]): * WebView.subproj/WebPreferencesPrivate.h: 2003-02-06 Chris Blumenberg <cblu@apple.com> - Made WebDownload.h a public header. - Added stubs for the new methods. - Moved all private methods to the WebPrivate category. - Added FIXMEs for things that needed to be removed or implemented. Reviewed by rjw. * Downloads.subproj/WebDownload.h: * Downloads.subproj/WebDownload.m: (-[WebDownload initWithRequest:delegate:]): (-[WebDownload dealloc]): (-[WebDownload cancel]): (-[WebDownload _initWithLoadingHandle:request:response:delegate:]): (-[WebDownload initWithDataSource:]): (-[WebDownload receivedData:]): (-[WebDownload finishedLoading]): (-[WebDownload decodeHeaderData:dataForkData:resourceForkData:]): (-[WebDownload decodeData:dataForkData:resourceForkData:]): (-[WebDownload createFileIfNecessary]): (-[WebDownload writeDataForkData:resourceForkData:]): (-[WebDownload dataIfDoneBufferingData:]): (-[WebDownload decodeData:]): (-[WebDownload finishDecoding]): * Downloads.subproj/WebDownloadPrivate.h: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebMainResourceClient.m: 2003-02-06 Chris Blumenberg <cblu@apple.com> Renamed WebDownloadHandler to WebDownload. Made ivars of WebDownload private. Reviewed by kocienda. * Downloads.subproj/WebDownload.h: Added. * Downloads.subproj/WebDownload.m: Added. (-[WebDownloadPrivate init]): (-[WebDownloadPrivate dealloc]): (-[WebDownload initWithDataSource:]): (-[WebDownload dealloc]): (-[WebDownload decodeHeaderData:dataForkData:resourceForkData:]): (-[WebDownload decodeData:dataForkData:resourceForkData:]): (-[WebDownload closeFork:deleteFile:]): (-[WebDownload closeFileAndDelete:]): (-[WebDownload closeFile]): (-[WebDownload cleanUpAfterFailure]): (-[WebDownload createFileIfNecessary]): (-[WebDownload writeDataForkData:resourceForkData:]): (-[WebDownload dataIfDoneBufferingData:]): (-[WebDownload decodeData:]): (-[WebDownload receivedData:]): (-[WebDownload finishDecoding]): (-[WebDownload finishedLoading]): (-[WebDownload cancel]): (-[WebDownload path]): (-[WebDownload writeForkData:isDataFork:]): (-[WebDownload errorWithCode:]): (-[WebDownload cancelWithError:]): (-[WebDownload dataForkReferenceNumber]): (-[WebDownload setDataForkReferenceNumber:]): (-[WebDownload resourceForkReferenceNumber]): (-[WebDownload setResourceForkReferenceNumber:]): (-[WebDownload areWritesCancelled]): (-[WebDownload setWritesCancelled:]): (WriteCompletionCallback): (CloseCompletionCallback): (DeleteCompletionCallback): * Downloads.subproj/WebDownloadHandler.h: Removed. * Downloads.subproj/WebDownloadHandler.m: Removed. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.h: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient dealloc]): (-[WebMainResourceClient download]): (-[WebMainResourceClient isDownload]): (-[WebMainResourceClient receivedError:complete:]): (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient handle:didReceiveData:]): (-[WebMainResourceClient handleDidFinishLoading:]): 2003-02-06 Chris Blumenberg <cblu@apple.com> Fixed: 3125067 - Investigate performance implications of writing download file data Reviewed by trey, rjw, darin. * Downloads.subproj/WebDownloadHandler.h: * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler closeFileAndDelete:]): close the file asynchronously (-[WebDownloadHandler closeFile]): call closeFileAndDelete:NO (-[WebDownloadHandler cleanUpAfterFailure]): call closeFileAndDelete:YES (-[WebDownloadHandler writeDataForkData:resourceForkData:]): call writeForkData:isDataFork: (-[WebDownloadHandler path]): new (-[WebDownloadHandler writeForkData:isDataFork:]): writes file asynchronously (-[WebDownloadHandler errorWithCode:]): moved (-[WebDownloadHandler cancelWithError:]): new, stops load with error (-[WebDownloadHandler dataForkReferenceNumber]): new (-[WebDownloadHandler setDataForkReferenceNumber:]): new (-[WebDownloadHandler resourceForkReferenceNumber]): new (-[WebDownloadHandler setResourceForkReferenceNumber:]): new (WriteCompletionCallback): new (CloseCompletionCallback): new, removes file if necessary (DeleteCompletionCallback): new, * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _stopLoadingWithError:]): new 2003-02-06 Trey Matteson <trey@apple.com> 3137647 - ad frames get their own history entries at channels.netscape.com 3133844 - 2 items in back list at http://www.kiup-bank.com/personal/main01.html Move logic for deciding on "quick redirect" down to WebCore, where we really know what case we're in instead of having to guess from the params we were receiving. Reviewed by Maciej, Darin. * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): Fix build error (URL vs String) * WebView.subproj/WebFramePrivate.h: Nuke Completing state. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToLayoutAcceptable]): Nuke Completing state. (-[WebFrame _transitionToCommitted:]): Nuke Completing state. (-[WebFrame _isLoadComplete]): Nuke Completing state. (-[WebFrame _clientRedirectedTo:delay:fireDate:lockHistory:]): Just obey lockHistory param when deciding whether we are doing a "client redirect" instead of previous guesswork. 2003-02-06 Richard Williamson <rjw@apple.com> Rename WebError to WebKitError. Reviewed by maciej. * API-Issues.rtf: * Bookmarks.subproj/WebBookmarkImporter.m: (-[WebBookmarkImporter initWithPath:]): * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler createFileIfNecessary]): (-[WebDownloadHandler writeDataForkData:resourceForkData:]): (-[WebDownloadHandler decodeData:]): (-[WebDownloadHandler finishedLoading]): * Misc.subproj/WebKitErrors.h: * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]): * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate notifyDelegatesOfInterruptionByPolicyChange]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueAfterNavigationPolicy:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient interruptForPolicyChangeAndKeepLoading:]): (-[WebMainResourceClient continueAfterContentPolicy:response:]): * WebView.subproj/WebView.m: (+[WebView initialize]): 2003-02-05 Chris Blumenberg <cblu@apple.com> Comment should have been "Made WebPluginError constructors private." * ChangeLog: 2003-02-05 Chris Blumenberg <cblu@apple.com> WebKit API clean-up: - Added enum to WebContextMenuDelegate that is the menu item tag of the menu items passed in the default menu item array. - WebPluginError should return URL strings. - Made WebPluginError constructors private. Reviewed by rjw. * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebPluginError.h: * Plugins.subproj/WebPluginError.m: (-[WebPluginError pluginPageURL]): * Plugins.subproj/WebPluginErrorPrivate.h: Added. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebContextMenuDelegate.h: * WebView.subproj/WebDefaultContextMenuDelegate.h: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate menuItemWithTag:]): (-[WebDefaultContextMenuDelegate contextMenuItemsForElement:defaultMenuItems:]): 2003-02-04 Trey Matteson <trey@apple.com> WC now tells us the form values being submitted with a get/post. We forward this info to a new WebFormDelegate method. Most of this change is just glue passing the formValues through all our layers. Reviewed by Maciej * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:reload:triggeringEvent:formValues:]) Pass along formValues. (-[WebBridge postWithURL:data:contentType:triggeringEvent:formValues:]): Pass along formValues. * WebKit.pbproj/project.pbxproj: Reorder previously added files. * WebView.subproj/WebControllerPolicyDelegate.m: Fix latent copy/paste error where two keys had the same underlying string value! * WebView.subproj/WebFormDelegate.h: Declare new delegate method. * WebView.subproj/WebFormDelegate.m: (-[WebFormDelegate frame:willSubmitFormWithValues:]): NOP impl of new method. * WebView.subproj/WebFrame.m: (-[WebFrame loadRequest:]): Pass nil formValues. (-[WebFrame reload]): Pass nil formValues. * WebView.subproj/WebFramePrivate.h: New ivar to hold form values while waiting for the policy delegate response. * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate dealloc]): ASSERT new ivar is nil. (-[WebFrame _loadItem:fromItem:withLoadType:]): Pass nil formValues. (-[WebFrame _loadRequest:triggeringAction:loadType:formValues:]): Pass along formValues. (-[WebFrame _invalidatePendingPolicyDecisionCallingDefaultAction:]): Pass nil formValues to continuation method. (-[WebFrame _checkNavigationPolicyForRequest:dataSource:formValues:andCall:withSelector:]): Stash formValues before calling policy delegate. (-[WebFrame _continueAfterNavigationPolicy:]): Resurrect formValues after calling policy delegate, pass to continuation method. (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:formValues:]): Bail on nil request instead of shouldContinue=NO (-[WebFrame _loadURL:loadType:triggeringEvent:formValues:]): Pass formValues along. (-[WebFrame _loadURL:intoChild:]): Pass nil formValues. (-[WebFrame _postWithURL:data:contentType:triggeringEvent:formValues:]): Pass formValues along. (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]): Pass nil formValues. (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formValues:]): Bail on nil request instead of shouldContinue=NO. Call new FormDelegate method. (-[WebFrame _loadDataSource:withLoadType:formValues:]): Pass formValues along. (-[WebFrame _downloadRequest:toDirectory:]): Pass nil formValues. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterNavigationPolicy:formValues:]): Bail on nil request instead of shouldContinue=NO (-[WebMainResourceClient handle:willSendRequest:]): Pass nil formValues. 2003-02-05 Richard Williamson <rjw@apple.com> WebHistory* API clenaup. Reviewed by Chris. * Bookmarks.subproj/WebBookmarkLeaf.m: * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem title]): (-[WebHistoryItem setDisplayTitle:]): (-[WebHistoryItem hash]): (-[WebHistoryItem anchor]): (-[WebHistoryItem isEqual:]): (-[WebHistoryItem description]): (-[WebHistoryItem _retainIconInDatabase:]): (+[WebHistoryItem entryWithURL:]): (-[WebHistoryItem initWithURL:title:]): (-[WebHistoryItem initWithURL:target:parent:title:]): (-[WebHistoryItem URL]): (-[WebHistoryItem target]): (-[WebHistoryItem parent]): (-[WebHistoryItem dictionaryRepresentation]): (-[WebHistoryItem initFromDictionaryRepresentation:]): * History.subproj/WebHistoryItemPrivate.h: * History.subproj/WebHistoryPrivate.h: * History.subproj/WebHistoryPrivate.m: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController setPreferences:]): (-[WebController preferences]): * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate dealloc]): * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebFramePrivate.m: 2003-02-05 Richard Williamson <rjw@apple.com> Cleanup public WebHistory API, stage 1. Reviewed by trey. * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: (-[_WebCoreHistoryProvider initWithHistory:]): (-[_WebCoreHistoryProvider containsEntryForURLString:]): (-[_WebCoreHistoryProvider dealloc]): (+[WebHistory sharedHistory]): (+[WebHistory createSharedHistoryWithFile:]): * History.subproj/WebHistoryPrivate.h: * History.subproj/WebHistoryPrivate.m: 2003-02-04 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. * WebKit.pbproj/project.pbxproj: Updated to build the framework standalone instead of embedded when doing a B&I build for Panther. 2003-02-04 Chris Blumenberg <cblu@apple.com> Fixed: 3163879 - receivedPageIcon:forDataSource: always sends nil image Reviewed by rjw. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _updateIconDatabaseWithURL:]): 2003-02-04 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed 3135388 -- encoding changes do not affect text in form elements The problem was that form data was being saved and restored, and in the case of buttons, the form data was the incorrectly decoded button label. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToLayoutAcceptable]): Remove the default: case so we get a warning if we omit one of the enum values from this switch statement. (-[WebFrame _transitionToCommitted:]): Move the WebFrameLoadTypeReloadAllowingStaleData case up so it's right next to the case it should be merged with. (-[WebFrame _isLoadComplete]): Remove the default: case so we get a warning if we omit one of enum values from this switch statement. (-[WebFrame _itemForRestoringDocState]): Replace the if statement with a switch statement. Include WebFrameLoadTypeReloadAllowingStaleData, which fixes the bug. 2003-02-03 Richard Williamson <rjw@apple.com> Fixed headerdoc type. * WebView.subproj/WebDocument.h: 2003-02-03 Richard Williamson <rjw@apple.com> Support for new canProvideDocumentSource and documentSource API. Updated all the representations. Added support to show for RTF source. Moved WebKitInitializeUnicode to to early class. This was necessary because WebCore may use the unicode property functions before WebTextRenderer gets initialized. Ensured guarantee that identifierForInitialRequest:fromDataSource: is called with the first initial request. Reviewed by maciej. * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation canProvideDocumentSource]): (-[WebNetscapePluginRepresentation documentSource]): * WebCoreSupport.subproj/WebTextRenderer.m: * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate setIdentifier:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithRequest:]): (-[WebDataSource controller]): (-[WebDataSource initialRequest]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _startLoading:]): (-[WebDataSource _originalRequest]): * WebView.subproj/WebDocument.h: * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): (-[WebHTMLRepresentation canProvideDocumentSource]): * WebView.subproj/WebHTMLView.m: (+[WebHTMLView initialize]): * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation canProvideDocumentSource]): (-[WebImageRepresentation documentSource]): * WebView.subproj/WebTextRepresentation.h: * WebView.subproj/WebTextRepresentation.m: (-[WebTextRepresentation dealloc]): (-[WebTextRepresentation setDataSource:]): (-[WebTextRepresentation finishedLoadingWithDataSource:]): (-[WebTextRepresentation canProvideDocumentSource]): (-[WebTextRepresentation documentSource]): 2003-02-03 Chris Blumenberg <cblu@apple.com> Fixed: 3163073 - SECURITY: Need to check if filename in encoded download is safe Reviewed by kocienda, darin, mjs. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler createFileIfNecessary]): call _web_filenameByFixingIllegalCharacters on the encoded filename 2003-02-01 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin and Ken. - fixed 3162581 - 56 debug: Assertion failure displaying pop-up menu while downloading * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveResponse:]): No need to assert that the controller is not deferred if this is a handle being used for a download. (-[WebMainResourceClient handle:didReceiveData:]): Likewise. (-[WebMainResourceClient handleDidFinishLoading:]): Likewise. (-[WebMainResourceClient handle:didFailLoadingWithError:]): Likewise. 2003-01-31 Trey Matteson <trey@apple.com> New plumbing for autofill/autocomplete. WebBrowser receives controlText delegate messages from our form widgets. Should result in no behavior change. New private API is exposed for the app to set a WebFormDelegate. Reviewed by Richard * WebCoreSupport.subproj/WebBridge.m: Pass msgs from WC on to the controller's FormDelegate. (formDelegate): Little utility function. (-[WebBridge controlTextDidBeginEditing:]): (-[WebBridge controlTextDidEndEditing:]): (-[WebBridge controlTextDidChange:]): (-[WebBridge control:textShouldBeginEditing:]): (-[WebBridge control:textShouldEndEditing:]): (-[WebBridge control:didFailToFormatString:errorDescription:]): (-[WebBridge control:didFailToValidatePartialString:errorDescription:]): (-[WebBridge control:isValidObject:]): (-[WebBridge control:textView:doCommandBySelector:]): * WebKit.exp: New class exported. * WebKit.pbproj/project.pbxproj: New WebFormDelegate files. * WebView.subproj/WebControllerPrivate.h: API to set/get FormDelegate. * WebView.subproj/WebControllerPrivate.m: (-[WebController _setFormDelegate:]): simple setter (-[WebController _formDelegate]): simple getter * WebView.subproj/WebFormDelegate.h: Added. * WebView.subproj/WebFormDelegate.m: Added. NOP impls for all these delegate methods. (-[WebFormDelegate controlTextDidBeginEditing:inFrame:]): (-[WebFormDelegate controlTextDidEndEditing:inFrame:]): (-[WebFormDelegate controlTextDidChange:inFrame:]): (-[WebFormDelegate control:textShouldBeginEditing:inFrame:]): (-[WebFormDelegate control:textShouldEndEditing:inFrame:]): (-[WebFormDelegate control:didFailToFormatString:errorDescription:inFrame:]): (-[WebFormDelegate control:didFailToValidatePartialString:errorDescription:inFrame:]): (-[WebFormDelegate control:isValidObject:inFrame:]): (-[WebFormDelegate control:textView:doCommandBySelector:inFrame:]): 2003-01-31 Chris Blumenberg <cblu@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. * WebView.subproj/WebController.m: fixed key value 2003-01-31 Chris Blumenberg <cblu@apple.com> Fixed : 3155148 - image shown when dragging gets size from image file, not size as used on page Reviewed by darin. * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragPromisedImage:rect:URL:fileType:title:event:]): take a rect so we know the original size and origin * WebKit.exp: added WebElementImageRectKey * WebView.subproj/WebController.h: WebElementImageRectKey * WebView.subproj/WebController.m: WebElementImageRectKey * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _handleMouseDragged:]): call _web_dragPromisedImage with WebElementImageRect * WebView.subproj/WebImageView.m: (-[WebImageView menuForEvent:]): provide the WebElementImageRect since we do this for other image elements (-[WebImageView mouseDragged:]): call _web_dragPromisedImage with [self bounds] === Safari-55 === 2003-01-30 Chris Blumenberg <cblu@apple.com> Backed out my fix for 3161102. Richard and I found problems the fix. 3161102 turns out to not be an issue. Reviewed by rjw. * History.subproj/WebHistoryItem.m: (+[WebHistoryItem _releaseAllPendingPageCaches]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView windowWillClose:]): 2003-01-30 Chris Blumenberg <cblu@apple.com> Fixed: 3161102 - Avoid retain cycles by destroying plug-ins in the page cache before dealloc Reviewed by rjw. * History.subproj/WebHistoryItem.m: (+[WebHistoryItem _releaseAllPendingPageCaches]): iterate over all of the plug-ins and call destroy * WebView.subproj/WebHTMLView.m: (-[WebHTMLView windowWillClose:]): clear page cache 2003-01-30 Chris Blumenberg <cblu@apple.com> Fixed: 3160464 - Slideback sometimes happens twice Because we start drags in mouseDragged (which AppKit says we shouldn't), we get mouseDragged events after a drag (image, link, text etc) has ended. We also get mouseDragged events after we've sent the fake mouseUp to WebCore. That is probably bad for unknown reasons. Reviewed by darin. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDown:]): set ignoringMouseDraggedEvents to NO (-[WebHTMLView mouseDragged:]): check ignoringMouseDraggedEvents (-[WebHTMLView draggedImage:endedAt:operation:]): set ignoringMouseDraggedEvents to NO * WebView.subproj/WebHTMLViewPrivate.h: added ignoringMouseDraggedEvents 2003-01-30 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3160710 -- REGRESSION: bizrate.com front page ad in wrong position The new code to compute port coordinates was screwing up somehow. I had to roll it out and we'll have to try again to fix the problem Ed was fixing. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): Roll back changes between 1.45 and 1.47. 2003-01-29 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3158624 -- crash reentering WebBaseNetscapePluginView removeTrackingRect closing window * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView removeTrackingRect]): Set tracking tag to 0 before releasing the window to prevent reentering. 2003-01-29 Ken Kocienda <kocienda@apple.com> Reviewed by Darin. Fix for this bug: Radar 3142818 (Downloading many items quickly can cause future page loads to fail) The issue was with a mismatch between different object's idea about whether callbacks were being deferred. I have simplified the code in this area somewhat, and I have added some asserts to make sure that callbacks are not sent when deferalls are on. More work will need to be done in callback deferral-land, however. This change fixes the bug, but it may not be a good long-term fix. I will file a bug on the need for this additonal work. * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate defersCallbacks]): Added method. * WebView.subproj/WebMainResourceClient.h: Removed unneeded defersBeforeCheckingPolicy flag. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterNavigationPolicy:request:]): Unconditionally set callback deferrals to NO. (-[WebMainResourceClient handle:willSendRequest:]): Remove all callback deferral code here. (-[WebMainResourceClient continueAfterContentPolicy:response:]): Unconditionally set callback deferrals to NO. (-[WebMainResourceClient handle:didReceiveResponse:]): Assert that the handle argument to this method, the client (self), and the data source's controller all are not deferring callbacks. Unconditionally set callback deferrals to YES. (-[WebMainResourceClient handle:didReceiveData:]): Ditto (-[WebMainResourceClient handleDidFinishLoading:]): Ditto (-[WebMainResourceClient handle:didFailLoadingWithError:]): Ditto 2003-01-29 John Sullivan <sullivan@apple.com> - fixed 3160116 -- REGRESSION:leak in WebBookmarkLeaf at startup Reviewed by Darin * Bookmarks.subproj/WebBookmarkLeaf.m: (-[WebBookmarkLeaf initFromDictionaryRepresentation:withGroup:]): don't leak the _entry that was created in initWithURLString:title:group: 2003-01-29 Trey Matteson <trey@apple.com> 3159750 - REGRESSION: cursor is I-beam when over a standalone image We now reset the cursor to arrow before switching doc views. Also, made various replacements of "id <WebDocumentView>" with "NSView < WebDocumentView> *" to get better compile time checking. Reviewed by Darin. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _makeDocumentView]): Use NSView* (-[WebFrame _transitionToCommitted:]): Use NSView* * WebView.subproj/WebViewPrivate.h: Use NSView* * WebView.subproj/WebViewPrivate.m: (-[WebView _setDocumentView:]): Use NSView*. Reset cursor. (-[WebView _makeDocumentViewForDataSource:]): Use NSView* 2003-01-29 Chris Blumenberg <cblu@apple.com> 3159529 - REGRESSION: URLs with no path are saved as "-.html" Reviewed by darin, trey, kocienda. * Misc.subproj/WebResourceResponseExtras.m: (-[NSURL _web_suggestedFilenameForSavingWithMIMEType:]): Don't use the lastPathComponent if it is "/". 2003-01-28 Trey Matteson <trey@apple.com> Removing ERROR() that isn't an error, left over from the Safari-48 download firedrill. Reviewed by Chris. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler cleanUpAfterFailure]): Don't ERROR if we are asked to cleanup a file and there is nothing to cleanup. This can happen in the rare case of the download being canceled before the first byte arrives, and we deal properly, no ERROR. 2003-01-28 Chris Blumenberg <cblu@apple.com> Fixed: 3150856 - crash with full-size plugins in frame or iframe Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView start]): added assert * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): added assert * WebView.subproj/WebFramePrivate.m: (-[WebFrame _makeDocumentView]): Don't call setDataSource here because the view is not in the view hierarchy at this point. * WebView.subproj/WebViewPrivate.m: (-[WebView _makeDocumentViewForDataSource:]): Call setDataSource on the document view after it has been placed in the view hierarchy. This what we for the top-level view, so should do this for views in subframes as well. 2003-01-28 Chris Blumenberg <cblu@apple.com> Fixed: 3156172 - No filename correction when downloading images via drag & drop Reviewed by mjs, john, trey. * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _downloadURL:]): call _downloadURL:toDirectory: (-[WebController _downloadURL:toDirectory:]): call -[WebFrame _downloadRequest:toDirectory:] * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): release the download directory (-[WebDataSource _setDownloadDirectory:]): new (-[WebDataSource _downloadDirectory]): new * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _downloadRequest:toDirectory:]): renamed * WebView.subproj/WebHTMLView.m: (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): call -[WebController _downloadURL:toDirectory:] * WebView.subproj/WebImageView.m: (-[WebImageView namesOfPromisedFilesDroppedAtDestination:]): call -[WebController _downloadURL:toDirectory:] * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): if the data source has a download directory, use it plus the filename from the response as download path 2003-01-28 Trey Matteson <trey@apple.com> 2940179 - Arrow cursor should change to link cursor after click of link in non-frontmost window 3158240 - cursor does not track when switching from panels to safari windows Two changes here: First, we post fake mousemoved events to get the cursor fixed up without checking if the mouse is down (WC deals with that now). That fixes 2940179, because the button is down when we get notified of becoming key. Second, we observe key window instead of main window notifications everywhere, so we update the cursor when clicking between a panel and our doc windows. Reviewed by Darin. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addMouseMovedObserver]): s/main/key/g (-[WebHTMLView addWindowObservers]): s/main/key/g (-[WebHTMLView removeWindowObservers]): s/main/key/g (-[WebHTMLView windowDidBecomeKey:]): s/main/key/g (-[WebHTMLView windowDidResignKey:]): s/main/key/g * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _frameOrBoundsChanged]): Always post mousemoved event. 2003-01-28 John Sullivan <sullivan@apple.com> - fixed 3158304 -- Assertion failure cancelling "Add Bookmark" or deleting newly-created bookmarks Reviewed by Darin * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup _bookmark:changedUUIDFrom:to:]): new method that notifies group when a bookmark that's already in a group changes its UUID -- the UUID to bookmark dictionary updates for this change. * Bookmarks.subproj/WebBookmarkGroupPrivate.h: private declaration for this method * Bookmarks.subproj/WebBookmark.m: (-[WebBookmark _setUUID:]): notify group when UUID changes (-[WebBookmark UUID]): ditto 2003-01-28 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed 3156197 -- leak in -[WebBookmarkList initFromDictionaryRepresentation:withGroup:] * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList initFromDictionaryRepresentation:withGroup:]): Fixed storage leak by not allocating the list here, because [self init] will be called and that will allocate the list. 2003-01-26 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin and Ken. * English.lproj/StringsNotToBeLocalized.txt: Removed unused exception. 2003-01-27 Chris Blumenberg <cblu@apple.com> Fixed: 3156230 - REGRESSION: Java 141: Safari Does Not Stop Applets When Browser Window Closes Reviewed by dave. * Plugins.subproj/WebPluginController.h: * Plugins.subproj/WebPluginController.m: (-[WebPluginController destroyAllPlugins]): renamed from HTMLViewWillBeDeallocated because it may get called before the dealloc * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addWindowObservers]): observe NSWindowWillCloseNotification (-[WebHTMLView removeWindowObservers]): remove observer for NSWindowWillCloseNotification (-[WebHTMLView windowWillClose:]): call destroyAllPlugins * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLViewPrivate dealloc]): call destroyAllPlugins 2003-01-27 Richard Williamson <rjw@apple.com> Fixed 3139909. Fake the resource load delegate messages (minus willSendRequest) when a page is loaded from a the page cache. Reviewed by john. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate handle:didReceiveResponse:]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _addResponse:]): (-[WebDataSource _responses]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _opened]): 2003-01-27 Trey Matteson <trey@apple.com> 3157104 - reproducible assert in _continueFragmentScrollAfterNavigationPolicy Remove assertion, and it turns out the existing code will handle the case. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:request:]): 2003-01-27 Richard Williamson <rjw@apple.com> Make emptying the page cache synchronous when "Empty Cache" is selected from menu. More bulletproofing to ensure that 3155781 doesn't happen. Reviewed by trey. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList clearPageCache]): 2003-01-27 Chris Blumenberg <cblu@apple.com> Fixed: 3156235 - change throttle for plug-in null events to 50 frames per second (when frontmost) Reviewed by dave. * Plugins.subproj/WebBaseNetscapePluginView.m: 2003-01-27 Richard Williamson <rjw@apple.com> Fixed 3151241. Cleanly handle nil return from resource:willSendRequest:fromDataSource:. Reviewed by trey. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate handle:willSendRequest:]): (-[WebBaseResourceHandleDelegate handleDidFinishLoading:]): (-[WebBaseResourceHandleDelegate handle:didFailLoadingWithError:]): (-[WebBaseResourceHandleDelegate cancelWithError:]): * WebView.subproj/WebControllerPrivate.m: (-[WebController _mainReceivedError:fromDataSource:complete:]): 2003-01-27 John Sullivan <sullivan@apple.com> - fixed 3156744 -- REGRESSION: Renaming bookmarks dragged into bookmark bar does not work at first Reviewed by Darin * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList insertChild:atIndex:]): was adding self to its own group (a no-op), instead of adding the new child to self's group. This was a typo from the refactoring to fix 3152427. 2003-01-27 Chris Blumenberg <cblu@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for changes I previously made. 2003-01-26 Chris Blumenberg <cblu@apple.com> Fixed: 3156725 - Partially selected links show extra underlining when dragged Reviewed by darin. * WebCoreSupport.subproj/WebTextRenderer.m: (drawLineForCharacters...): don't ignore "from" "to" parameters 2003-01-25 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3126211 -- "go back" buttons that use "history.go(-1)" doesn't work (verizonwireless.com is an example) Implemented new bridge functions for use by the history object. * History.subproj/WebBackForwardList.h: Added backListCount and entryAtIndex:. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList backListCount]): Added. (-[WebBackForwardList entryAtIndex:]): Added. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge historyLength]): Added. Calls backListCount. (-[WebBridge goBackOrForward:]): Added. Calls entryAtIndex: and then goBackOrForwardToItem:. 2003-01-25 Chris Blumenberg <cblu@apple.com> Fixed: 3153605 - Drag image when dragging text should be the actual text Reviewed by darin. * Misc.subproj/WebNSImageExtras.m: (-[NSImage _web_dissolveToFraction:]): handle non-flipped images * Misc.subproj/WebNSViewExtras.h: moved some constants around * Misc.subproj/WebNSViewExtras.m: * Resources/text_clipping.tiff: Removed. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _handleMouseDragged:]): cleaned-up, get text drag image from WebCore 2003-01-25 Darin Adler <darin@apple.com> * Plugins.subproj/WebBaseNetscapePluginView.m: Replace some tabs with spaces. 2003-01-24 Richard Williamson <rjw@apple.com> Cleaned up some stray comments. Reviewed by kocienda. * Misc.subproj/WebUnicode.m: (getShape): (nextChar): (glyphVariantLogical): (shapedString): 2003-01-24 Trey Matteson <trey@apple.com> Chris pointed out a FIXME that led to a more contained way to make sure the cursor is correct during and after image/text/URL dragging. Reviewed by Chris. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView draggedImage:endedAt:operation:]): No need to reset the cursor at the end of dragging. WC deals with it. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _handleMouseDragged:]): No need to set the cursor to arrow, WC deals with it. 2003-01-24 Darin Adler <darin@apple.com> Reviewed by Dave. - fixed 3142852 -- frame content repeatedly requested * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge incomingReferrer]): Added a way to get the referrer across the bridge, needed for bug fix. 2003-01-24 Ed Voas <voas@apple.com> Reviewed by Darin. Netscape plugins were being improperly positioned. I noticed this when I put the web view into a window with borders around it (Carbon metal window, but I would imagine Cocoa metal would do it too). * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): 2003-01-23 Trey Matteson <trey@apple.com> 3155162 - cursor changes to I-beam after dragging image 3154468 - no mouseup event comes through after text snippet drag During AK dragging the system takes over the event stream and we never get any mouse move or up events. It also changes the cursor behind out back. When done cached state that thinks it knows the current cursor is wrong. The fix is that after the drag we reset the cursor and synthesize a mouseup event, which then sets the cursor based on what we're really over. Reviewed by Darin. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView draggedImage:endedAt:operation:]): After the drag, reset the cursor, fake up a mouseup event. 2003-01-24 John Sullivan <sullivan@apple.com> Reviewed by Trey * WebView.subproj/WebHTMLView.m: (-[WebHTMLView takeFindStringFromSelection:]): Now uses new _web_setFindPasteboardString:withOwner: to share code. 2003-01-24 John Sullivan <sullivan@apple.com> Reviewed by Trey * Misc.subproj/WebNSPasteboardExtras.h: * Misc.subproj/WebNSPasteboardExtras.m: (+[NSPasteboard _web_setFindPasteboardString:withOwner:]): New method to put text on the Find pasteboard. 2003-01-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. * WebView.subproj/WebController.h: Remove unneeded declaration in sample code. 2003-01-23 Chris Blumenberg <cblu@apple.com> Made WebTextView use the same format for context menus as the rest of WebKit. Implemented "Copy" context menu. Reviewed by john. * English.lproj/Localizable.strings: * WebView.subproj/WebControllerPrivate.m: (-[WebController _menuForElement:]): tweak. * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate contextMenuItemsForElement:defaultMenuItems:]): added "Copy" context menu. * WebView.subproj/WebImageView.m: (-[WebImageView menuForEvent:]): added asserts * WebView.subproj/WebTextView.m: (-[WebTextView menuForEvent:]): implemented 2003-01-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. * WebView.subproj/WebController.m: Add missing static. 2003-01-23 Darin Adler <darin@apple.com> Reviewed by John. * Downloads.subproj/WebBinHexDecoder.m: (-[WebBinHexDecoder fileAttributes]): * Downloads.subproj/WebMacBinaryDecoder.m: (-[WebMacBinaryDecoder fileAttributes]): Use "FinderFlags" instead of "FinderInfo" as appropriate, since these are just the Finder flags, not all the Finder info. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler createFileIfNecessary]): * Misc.subproj/WebNSWorkspaceExtras.m: (-[NSWorkspace _web_noteFileChangedAtPath:]): * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage openResourceFile]): (-[WebNetscapePluginPackage pathByResolvingSymlinksAndAliasesInPath:]): (-[WebNetscapePluginPackage load]): Use fileSystemRepresentation instead of fileSystemRepresentationWithPath: because it's simpler and there's no good reason to use the other one. * WebView.subproj/WebUserAgentSpoofTable.gperf: Improved one of the motivating comments. * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. === Safari-54 === 2003-01-22 Chris Blumenberg <cblu@apple.com> Fixed problem where we weren't stopping the Java plug-in. This problem was introduced on Jan. 1 when the ownership of the WebPluginController was moved from WebFrame to WebDataSource. This change moves the WebPluginController to the WebHTMLView. Why this change? - The state of the plug-ins (currently only the Java plug-in) completely relies on the state of the WebHTMLView, not on the state of the WebDataSource. - WebHTMLView and WebDataSource are usually coupled via WebView and WebFrame, but not always. In a transitional state, the WebHTMLView may not be up to date with the WebDataSource. - WebPluginController controls an array of views. It makes more sense for this object to be owned by a view (WebHTMLView) not a model. Reviewed by darin. * Plugins.subproj/WebPluginController.h: * Plugins.subproj/WebPluginController.m: (-[WebPluginController initWithHTMLView:]): renamed, take the HTML view (-[WebPluginController addPlugin:]): use the HTML view (-[WebPluginController HTMLViewWillBeDeallocated]): renamed (-[WebPluginController showURL:inFrame:]): use the HTML view (-[WebPluginController showStatus:]): use the HTML view * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): get the plug-in controller from the HTML view * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): removed calls to plug-in controller * WebView.subproj/WebHTMLView.m: (-[WebHTMLView initWithFrame:]): create plug-in controller (-[WebHTMLView viewWillMoveToWindow:]): get plug-in controller from self, data source won't be accessible here since we don't have a superview (-[WebHTMLView viewDidMoveToWindow]): get plug-in controller from self (-[WebHTMLView addSubview:]): get plug-in controller from self * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLViewPrivate dealloc]): release plug-in controller (-[WebHTMLView _pluginController]): added 2003-01-22 John Sullivan <sullivan@apple.com> - fixed 3152427 -- Need unique IDs for bookmarks, for synching's sake Bookmarks now have a UUID string so that each can maintain its identity even in the face of multi-machine synching. One known loose end is written up in 3153832 (unique IDs in bookmarks aren't preserved correctly after copy/paste). This should be good enough now for the iSynch folks to start implementing the bookmarks-synching conduit. I also did some cleanup in this area to share more code and handle init methods more cleanly, inspired by earlier feedback from Trey and Darin. Reviewed by Trey and Darin * Bookmarks.subproj/WebBookmark.h: new _UUID ivar, UUID declaration * Bookmarks.subproj/WebBookmarkPrivate.h: new _setUUID and _hasUUID declarations * Bookmarks.subproj/WebBookmark.m: (-[WebBookmark dealloc]): assert that group is nil here; release _UUID (-[WebBookmark copyWithZone:]): implement the code shared by each subclass; formerly had no implementation. (-[WebBookmark _setUUID:]): private method to set the UUID (-[WebBookmark UUID]): public method to get the UUID; this lazily creates the UUID. (-[WebBookmark _hasUUID]): private method to check whether there's a UUID without creating one by side effect (as calling -[WebBookmark UUID] would) (-[WebBookmark initFromDictionaryRepresentation:withGroup:]): implement the code shared by each subclass; formerly had no implementation. (-[WebBookmark dictionaryRepresentation]): implement the code shared by each subclass; formerly had no implementation. * Bookmarks.subproj/WebBookmarkGroup.h: new _bookmarksByUUID ivar * Bookmarks.subproj/WebBookmarkGroupPrivate.h: declarations for new methods _addBookmark: and _removeBookmark: * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup init]): new method, just complains that you should have called initWithFile: instead. (-[WebBookmarkGroup initWithFile:]): create _bookmarksByUUID (-[WebBookmarkGroup dealloc]): release _bookmarksByUUID (-[WebBookmarkGroup _addBookmark:]): new method, if bookmark has UUID, adds it to table, and recursively processes children the same way (-[WebBookmarkGroup _removeBookmark:]): new method, if bookmark has UUID, removes it from table, and recursively processes children the same way (-[WebBookmarkGroup _setTopBookmark:]): replace [bookmark setGroup:group] with [group _addBookmark:bookmark] so it runs through the UUID code (-[WebBookmarkGroup _bookmarkChildren:wereRemovedFromParent:]): retitled this from "wereRemovedToParent" * Bookmarks.subproj/WebBookmarkLeaf.m: (-[WebBookmarkLeaf init]): now calls initWithURLString:title:group with nil parameters so that there's a designated initializer (-[WebBookmarkLeaf initFromDictionaryRepresentation:withGroup:]): rewritten to do only the subclasses' part now (-[WebBookmarkLeaf dictionaryRepresentation]): rewritten to do only the subclasses' part now (-[WebBookmarkLeaf copyWithZone:]): rewritten to do only the subclasses' part now * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList init]): now calls initWithTitle:group with nil parameters so that there's a designated initializer (-[WebBookmarkList initWithTitle:group:]): replace [bookmark setGroup:group] with [group _addBookmark:bookmark] so it runs through the UUID code (-[WebBookmarkList initFromDictionaryRepresentation:withGroup:]): rewritten to do only the subclasses' part now (-[WebBookmarkList dictionaryRepresentation]): rewritten to do only the subclasses' part now (-[WebBookmarkList copyWithZone:]): rewritten to do only the subclasses' part now (-[WebBookmarkList _setGroup:]): removed this override, which used to do the recursion to set the group of children; this recursion is now done by -[WebBookmarkGroup _addBookmark:] and _removeBookmark: (-[WebBookmarkList removeChild:]): wereRemovedToParent -> wereRemovedFromParent (-[WebBookmarkList insertChild:atIndex:]): replace [bookmark setGroup:group] with [group _addBookmark:bookmark] so it runs through the UUID code * Bookmarks.subproj/WebBookmarkProxy.m: (-[WebBookmarkProxy init]): now calls initWithTitle:group with nil parameters so that there's a designated initializer (-[WebBookmarkProxy initWithTitle:group:]): replace [bookmark setGroup:group] with [group _addBookmark:bookmark] so it runs through the UUID code (-[WebBookmarkProxy initFromDictionaryRepresentation:withGroup:]): rewritten to do only the subclasses' part now (-[WebBookmarkProxy dictionaryRepresentation]): rewritten to do only the subclasses' part now (-[WebBookmarkProxy copyWithZone:]): rewritten to do only the subclasses' part now 2003-01-22 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3153673 -- spoof as MacIE to get into http://www.mazdausa.com - fixed 3153678 -- spoof as MacIE for http://wap.sonyericsson.com/ * WebView.subproj/WebUserAgentSpoofTable.gperf: Add the two new entries. Also reorganize existing entries a bit. 2003-01-22 Chris Blumenberg <cblu@apple.com> Removed comment that I added by mistake. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView draggingSourceOperationMaskForLocal:]): 2003-01-22 Chris Blumenberg <cblu@apple.com> Fixed: 3153651 - text dragging does not work to Terminal Reviewed by trey. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView draggingSourceOperationMaskForLocal:]): Terminal only accepts the drag if one of the operations is generic. Made the operation both generic and copy. 2003-01-21 Chris Blumenberg <cblu@apple.com> Added support for text dragging. Reviewed by dave. * Resources/text_clipping.tiff: Added. Temp drag image until we can create an image of the selected text. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge mayStartDragWithMouseDraggedEvent:]): renamed, we now ask if OK to drag during the drag * WebKit.exp: renamed element key for selected text * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.h: renamed element key for selected text * WebView.subproj/WebController.m: renamed element key for selected text * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _handleMouseDragged:]): added support for text dragging (-[WebHTMLView _mayStartDragWithMouseDragged:]): renamed, we now ask if OK to drag during the drag 2003-01-20 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. - fixed 3132120 - onchange handler not firing on mac.com webmail * WebView.subproj/WebHTMLViewPrivate.m: (-[WebNSTextView resignFirstResponder]): If we really resign first responder, and our delegate responds to filedWillBecomeFirstResponder, then call that method. (-[WebNSTextView becomeFirstResponder]): If we really become first responder, and our delegate responds to filedWillBecomeFirstResponder, then call that method. 2003-01-20 Trey Matteson <trey@apple.com> Nit fix to remove a dead "cursor" ivar found while grepping. Reviewed by Richard. * WebView.subproj/WebDynamicScrollBarsView.h: * WebView.subproj/WebDynamicScrollBarsView.m: 2003-01-18 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - fixed 3123041 - VIP: Spewage at bottom of oregonlive.com and other similar pages * WebView.subproj/WebUserAgentSpoofTable.gperf: Added nj.com to spoof list below oregonlive.com (which was already in there). Added comment explaining the need to spoof a bit more. * WebView.subproj/WebUserAgentSpoofTable.c: (hash): (_web_findSpoofTableEntry): Regenerated. 2003-01-17 Chris Blumenberg <cblu@apple.com> Fixed: 3143656 - crash in MIMETypeForFile when a large QT movie is dragged over window Reviewed by darin. * WebView.subproj/WebControllerPrivate.m: (+[WebController _MIMETypeForFile:]): rewrote, now calls _web_guessedMIMEType 2003-01-17 Darin Adler <darin@apple.com> - compressed all our non-compressed TIFF files * Resources/nullplugin.tiff: * Resources/url_icon.tiff: 2003-01-16 Darin Adler <darin@apple.com> * WebView.subproj/WebController.h: Fixed a comment that was out of date. 2003-01-16 Chris Blumenberg <cblu@apple.com> Fixed comment. * Plugins.subproj/WebBaseNetscapePluginView.m: 2003-01-16 Chris Blumenberg <cblu@apple.com> Fixed: 3125743 - right-click doesn't count as ctrl-click in Flash AppKit doesn't call mouseDown or mouseUp on right-click. Simulate control-click mouseDown and mouseUp so plug-ins get the right-click event as they do in Carbon Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView rightMouseDown:]): (-[WebBaseNetscapePluginView rightMouseUp:]): 2003-01-16 Darin Adler <darin@apple.com> Reviewed by John. - added an API for dumping the external representation of the render tree for testing * Misc.subproj/WebCoreStatistics.h: Added renderTreeAsExternalRepresentation. * Misc.subproj/WebCoreStatistics.m: (-[WebFrame renderTreeAsExternalRepresentation]): Added. - removed remnants of an earlier more-naive cut at this same sort of thing * Misc.subproj/WebTestController.h: Removed. * Misc.subproj/WebTestController.m: Removed. * WebKit.exp: Removed WebTestController. * WebKit.pbproj/project.pbxproj: Removed WebTestController. - other changes * WebCoreSupport.subproj/WebBridge.m: Had added new copyright date to touch a file. That's not needed any more, but the date should be updated anyway. === Safari-52 === 2003-01-15 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3143418 - controller assert in WebStandardPanels _didStartLoadingURL - fixed 3141212 - crash in kjs garbage collection (contextimp mark) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge startLoadingResource:withURL:]): If the data source doesn't have a controller, then block the load. 2003-01-15 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed problem where Content-Type was going into WebCore with suffixes like "charset" * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady:]): Pass in contentType from the response, rather than the "Content-Type" header. Also pass in the refresh header separately. * English.lproj/StringsNotToBeLocalized.txt: Updated for above change. 2003-01-13 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin, Dave and Trey, and given the seal of approval by Don. Use new safer file removal call that does not handle directories. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler cleanUpAfterFailure]): Use _web_removeFileOnlyAtPath: * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream dealloc]): Use _web_removeFileOnlyAtPath: (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): Use _web_removeFileOnlyAtPath: 2003-01-14 Darin Adler <darin@apple.com> Reviewed by Dave. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): Fixed uninitialized variable warning so builds work again. * WebView.subproj/WebDataSourcePrivate.m: (+[WebDataSource _repTypes]): Added "application/xml". * WebView.subproj/WebViewPrivate.m: (+[WebView _viewTypes]): Added "application/xml". * English.lproj/Localizable.strings: Regenerated. * English.lproj/StringsNotToBeLocalized.txt: Updated for above change. 2003-01-13 Darin Adler <darin@apple.com> Reviewed by Trey, John, and Maciej, and given the seal of approval by Don. - fixed 3143317 -- plug-in supplied URLs cause correspondingly named files in /tmp to be deleted - fixed 3143330 -- plug-in supplied URLs can overwrite files used in other windows by same plug-in * Plugins.subproj/WebBaseNetscapePluginStream.h: Make path be a char * rather than an NSString. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream dealloc]): Use unlink() to delete the temporary file we made. Since we created the file, we know it doesn't have any fancy stuff like a resource fork. (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): Create the file with mkstemp instead of trying to come up with our own filename. This eliminates the need to delete an old file (because we are guaranteed the file is new) and also mkstemp opens the file for us, so we just need to write the contents. * English.lproj/StringsNotToBeLocalized.txt: Updated for above changes. - unrelated change to help with other bug analysis * WebView.subproj/WebBaseResourceHandleDelegate.m: Added assertions. 2003-01-12 Chris Blumenberg <cblu@apple.com> Fix for checking and creating proper download filenames. Reviewed by mjs, kocienda, trey. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebControllerPolicyDelegate.h: changes for renamed savePathForResponse:andRequest: method * WebView.subproj/WebDefaultPolicyDelegate.m: changes for renamed savePathForResponse:andRequest: method (-[WebDefaultPolicyDelegate savePathForResponse:andRequest:]): renamed * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): changes for renamed savePathForResponse:andRequest: method 2003-01-12 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3144882 -- pretend to be WinIE for abcnews.com * WebView.subproj/WebControllerPrivate.h: Add an enum, UserAgentStringType, with values Safari, MacIE, and WinIE. Also add NumUserAgentStringTypes and turn the userAgent and userAgentWhenPretendingToBeMacIE strings into an array indexed by type. * WebView.subproj/WebController.m: (-[WebController setApplicationNameForUserAgent:]): Use a loop to discard the user agent strings, since we have an array now. (-[WebController userAgentForURL:]): Change user agent algorithm to check two strings rather than once against the spoof table, allowing two dots in the "domain name", which is needed for "abcnews.go.com". Get a user agent string type from the table rather than just a boolean "pretend to be MacIE". Store a string per type rather than one for normalcy and one for MacIE. Add a case for WinIE to the user agent computations. * English.lproj/StringsNotToBeLocalized.txt: Update for change above. * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate dealloc]): Use a loop to discard the user agent strings, since we have an array now. (-[WebController _defaultsDidChange]): Ditto. * WebView.subproj/WebUserAgentSpoofTable.gperf: Add a UserAgentStringType field to the struct. Add MacIE to each existing table entry, and add a new one that says WinIE for abcnews.go.com. * Makefile.am: Pass "-F ,0" to gperf so that we don't get warnings compiling empty entries in the hash table. * WebView.subproj/WebUserAgentSpoofTable.c: Re-generated. - other changes * WebView.subproj/WebHTMLView.m: Removed some old, dead, #if 0'd code. 2003-01-11 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3144479 -- put TITLE from links in status bar * WebKit.exp: Add _WebElementLinkTitleKey and also sort this file. * WebCoreSupport.subproj/WebImageRenderer.m: Need to touch a file to get the above to have any effect, so update the copyright date here. 2003-01-09 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Add the year 2003, remove CFBundleIconFile, bump marketing version to 0.8.1 and version to 52u to keep up with the branch, remove CFHumanReadableCopyright, remove NSPrincipalClass. * English.lproj/InfoPlist.strings: Updated to match above changes. 2003-01-09 Darin Adler <darin@apple.com> Reviewed by Maciej. * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2003-01-09 Richard Williamson <rjw@apple.com> Fixed 3143361. This was a regression introduced with some image rendering optimizations. Don't bypass the tiling code path if the image needs to be rendered out-of-phase. Reviewed by hyatt. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer tileInRect:fromPoint:]): 2003-01-09 Darin Adler <darin@apple.com> Reviewed by Chris. - second pass on 3143332 - we still need a test case to be sure this is right * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): Check for "/". Also report the failure instead of just hanging on forever. 2003-01-09 Darin Adler <darin@apple.com> Reviewed by Richard. - fixed 3143332 -- if path returned is empty string (or "." or "..") it will trash the /tmp symlink * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): Check for empty string, ".", and "..", and don't create files by those names. 2003-01-09 Trey Matteson <trey@apple.com> 3143294 - need short-term bulletproofing of download code against bad filenames We protect against a download location that is not an absolute path. Reviewed by Darin * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): Bail on download if we don't have a abs path to write to. 2003-01-08 Trey Matteson <trey@apple.com> 3142201 - home directory nuked during power download session We add checks for various error cases that could combine to cause this problem. While we never got a reproducible case, we are confident that this is the only file removal done in the download code, and its ability to wreak havoc has been clipped. Reviewed by Richard. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler cleanUpAfterFailure]): Only nuke the partial download if in fact we created a new download file. Never nuke a directory. (-[WebDownloadHandler createFileIfNecessary]): Don't add "." to the foo-1 filenames we generate if the original filename doesn't have any extension. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): If the policyDelegate gives us a nil filename, just stop the whole load, instead of trying to overwrite the user's home directory. 2003-01-08 Chris Blumenberg <cblu@apple.com> Fixed: 3111432 - Support OBJECT tags with type text/plain or text/html Reviewed by dave. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge frameRequiredForMIMEType:]): added, returns YES for non-plug-in views 2003-01-08 Chris Blumenberg <cblu@apple.com> FIXED: 3128098 - flash performance weak!!! Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: Don't throttle plug-in when in an active window. 2003-01-03 Richard Williamson <rjw@apple.com> Fixed 3139129. Added application/xhtml+xml to list of supported type. Reviewed by gramps. * WebView.subproj/WebDataSourcePrivate.m: (+[WebDataSource _repTypes]): * WebView.subproj/WebViewPrivate.m: (+[WebView _viewTypes]): 2003-01-03 Richard Williamson <rjw@apple.com> Support for fixes to 3138743, 3138678. Added isFontFixedPitch used to determine if font is fixed pitch. Makes use of appkit private _isFakeFixedPitch (detects courier and monoca). Updated our fakey test to use the appkit's version. Reviewed by darin. * WebCoreSupport.subproj/WebTextRenderer.m: * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory isFontFixedPitch:]): 2003-01-03 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed leak of WebIconLoader observed using leaks tool * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): Tell the icon loader to stop loading. Add a FIXME asking why we had to do this to fix the leak. (-[WebDataSource _loadIcon]): Add an assertion. 2003-01-03 Richard Williamson <rjw@apple.com> Fix to 3131226. Don't force a layout when the document view is set on the page's scrollview. A layout would occur indirectly as a result of reflectScrolledClipView: being called when the document view was set. The khtmlpart/khtmlview/WebHTMLView would be out of sync at this point and a layout would have unintended and incorrect side effects. Reviewed by Darin (and tested by John). * WebView.subproj/WebDynamicScrollBarsView.h: * WebView.subproj/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): * WebView.subproj/WebViewPrivate.m: (-[WebView _setDocumentView:]): === Alexander-48 === 2003-01-02 Richard Williamson <rjw@apple.com> Increase the minimum font size to 9pt. This bounds the lower size of the sizes array used for named sizes. Net effect is to increase xx-small from 8pt to 9pt. xx-small is used by www.microsoft.com. Reviewed by hyatt. * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): 2003-01-02 Darin Adler <darin@apple.com> Reviewed by Don. - at Scott and Don's request, roll out small text anti-aliasing cutoff Turns out this makes small text look worse, not better. We're not going to respect this setting, and in Panther AppKit will almost certainly be changed not to either. * WebCoreSupport.subproj/WebTextRenderer.m: Rolled out yesterday's change using CVS. 2003-01-02 Darin Adler <darin@apple.com> Reviewed by John and Don. - fixed 3137661 -- REGRESSION: autoscroll selection is broken The new logic in WebCore is slightly pickier, and can't abide a mouse-moved event coming in during a drag. Unfortunately, we were sending a fake mouse-moved event during a drag, so lets not do that. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDown:]): Cancel any scheduled fake mouse-moved event. (-[WebHTMLView mouseUp:]): Send a fake mouse-moved event because we didn't update during the drag. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _frameOrBoundsChanged]): Don't schedule a fake mouse-moved event if the mouse is down, because that means we are in the middle of a drag. 2003-01-02 Darin Adler <darin@apple.com> Reviewed by John and Ken. - fixed 3135548 -- exception in Internet Explorer bookmark import code at first startup * Bookmarks.subproj/WebBookmarkImporter.m: (_breakStringIntoLines): Break lines before a <DT> or </DL>. (_HREFTextFromSpec): Rewrite to simplify, search in a case-insensitive manner. (-[WebBookmarkImporter initWithPath:]): Change prefix checks to be case-insensitive. Don't discard folders altogether if the name can't be parsed as that would mess up nesting w.r.t the next </DL>. Make the </DL> handling robust so we misparse, but don't crash the whole application by raising an exception. * English.lproj/StringsNotToBeLocalized.txt: Updated for this change and recent changes. 2003-01-01 Richard Williamson <rjw@apple.com> Obey the font smoothing size preference (3137618). Reviewed by Don and Darin. * WebCoreSupport.subproj/WebTextRenderer.m: 2002-12-31 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed 3130831 - HOMEPAGE: JavaScript that tries to intercept onmousedown fails, image gets dragged instead - fixed 3125554 - while dragging to select text in a nested frame, you can start dragging a link or image * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge handleMouseDragged:]): New method; call through the WebHTMLView. (-[WebBridge mayStartDragWithMouseDown:]): Likewise. (-[WebBridge handleAutoscrollForMouseDragged:]): Likewise. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): Instead of doing drag handling here, just pass the event to WebCore. (-[WebHTMLView draggedImage:endedAt:operation:]): Send a fake mousemove event instead of sending the current event (likely a mouse up as if it were a mouse move). * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLViewPrivate dealloc]): Release drag element if any. (-[WebHTMLView _dragImageForElement:]): New method. Split out the code to make the special drag image for links. (-[WebHTMLView _handleMouseDragged:]): Move all the drag handling here. This method will get called only if WebCore hasn't blocked default drag handling. (-[WebHTMLView _handleAutoscrollForMouseDragged:]): Do autoscroll. Autoscroll is still lame, we need a timer. (-[WebHTMLView _mayStartDragWithMouseDown:]): Determine if the element is a link or image and so may be dragged; remember the drag element. 2003-01-01 Richard Williamson <rjw@apple.com> Correct fix for 3137430 that doesn't always effectively disable the cache. Reviewed by kocienda. * History.subproj/WebHistoryItem.m: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]): 2003-01-01 Richard Williamson <rjw@apple.com> Don't reset the cookie policy URL if it has already been set. Fixes to 3109590. Reviewed by Maciej. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _addExtraFieldsToRequest:alwaysFromRequest:]): 2003-01-01 Richard Williamson <rjw@apple.com> Don't attempt to restore page from page cache if the cache doesn't contain valid page state. This may happen after a redirect. Fixes 3137430. Reviewed by kocienda. * History.subproj/WebHistoryItem.m: 2002-12-31 Darin Adler <darin@apple.com> Reviewed by Trey. - fixed 3137287 -- REGRESSION: Java applets don't work when you go back to them (Java 1.4.1 plug-in) By attaching the plug-in controller to the frame, we run into trouble. It really needs to be attached to the data source, which has the right lifetime and is kept around in the page cache. * Plugins.subproj/WebPluginController.h: Keep a reference to a data source, not a frame. Add a new _started variable. Rename addPluginView: to addPlugin:, get rid of didAddPluginView:, replace destroyAllPlugins with dataSourceWillBeDeallocated, add startAllPlugins and stopAllPlugins. * Plugins.subproj/WebPluginController.m: (-[WebPluginController initWithDataSource:]): Store a data source reference, not a frame reference. Don't bother registering for the window will close notification, WebHTMLView handles that fine. (-[WebPluginController startAllPlugins]): Do nothing if they are already started, call pluginStart on each otherwise. (-[WebPluginController stopAllPlugins]): Do nothing if they are not started, call pluginStop on each otherwise. (-[WebPluginController addPlugin:]): Initialize the plugin if it's not already in our list. Also start it if we are in "started" mode. (-[WebPluginController dataSourceWillBeDeallocated]): Stop all the plugins, then destroy them. Also nil out the fields of the object. This is always called before the controller is released so we don't need to override dealloc. (-[WebPluginController showURL:inFrame:]): Added error checking and changed now that we start with a data source. (-[WebPluginController showStatus:]): Ditto. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): Use the data source, not the view. Don't add the plugin here, wait until we are ready to start. * WebView.subproj/WebDataSourcePrivate.h: Store a pointer to the plug-in controller here. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): Tell the plug-in controller to go away. (-[WebDataSource _makeHandleDelegates:deferCallbacks:]): Remove unused empty method. (-[WebDataSource _pluginController]): Create a plug-in controller if needed. * WebView.subproj/WebFramePrivate.h: Remove plug-in controller code. * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate dealloc]): Remove plug-in controller code. (-[WebFrame _detachFromParent]): Remove plug-in controller code. (-[WebFrame _transitionToCommitted:]): Remove plug-in controller code. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView viewWillMoveToWindow:]): Stop plug-ins when view moves out of a window. This includes the case when the window is being destroyed. (-[WebHTMLView viewDidMoveToWindow]): Start plug-ins when view moves into a window. (-[WebHTMLView addSubview:]): Add plug-ins to the controller as they are added to us. * WebView.subproj/WebController.m: Added now-needed include due to header change. * WebView.subproj/WebDefaultContextMenuDelegate.m: Ditto. === Alexander-47 === 2002-12-30 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2002-12-30 Trey Matteson <trey@apple.com> 3137110 - REGRESSION: calls from 2nd and subsequent instances of Java 1.4.1 plug-in seem to be ignored We had previously made changes to "numb" a plugin controller after its frame was tossed or changed content. We now finish the job by making sure a new controller is created when we go to a new page with plugins. To so this we release the old controller whenever we flush the plugins from a page. Reviewed by Maciej. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _detachFromParent]): Call newly factored code. (-[WebFrame _transitionToCommitted:]): Call newly factored code. (-[WebFrame _destroyPluginController]): New method to tear down plugins. 2002-12-30 Trey Matteson <trey@apple.com> 3135025 - Assertion failure in _transitionToCommitted on espn nba scoreboard For blank pages we decided that there would be no b/f entry. This means that subframes within such pages (created via doc.write()), should not try to make WebHistoryItems, since they have no parent items to attach them to. Reviewed by Darin. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): Don't make a history item for a subframe it the parent frame has no item. 2002-12-30 Trey Matteson <trey@apple.com> 3135779 - REGRESSION: reproducible assertion failure, going back from ~orubin to the main spies.com page 3136218 - REGRESSION: Assertion failure in _restoreScrollPosition running browser buster Both were caused by subtle interactions between new code for short-circuiting loading of blank pages, and the WebHistoryItem manipulations we do for b/f and reload of child frames. Reviewed by Maciej * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadURL:intoChild:]): Setup provisional or current item before jumping into the real work of loading the URL. (-[WebFrame _restoreScrollPosition]): Tweaked to make the assertion message clearer. 2002-12-30 Darin Adler <darin@apple.com> Reviewed by Don and Ken. - fixed 3136797 -- crash when Adobe SVG Viewer plug-in puts up modal dialog * Plugins.subproj/WebBaseNetscapePluginView.h: Add inSetWindow boolean. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendEvent:]): Don't send any events to a plug-in while it's inside NPP_SetWindow. We don't want to implement more general reentrancy protection, because it could cause trouble for plugins that can handle it correctly, but it's unlikely that any legitimate use would require reentrant calls while inside NPP_SetWindow, and that's the case that crashes for the SVG viewer plug-in when it presents its registration dialog. (-[WebBaseNetscapePluginView setWindow]): Set boolean. 2002-12-29 Darin Adler <darin@apple.com> Reviewed by Don. - fixed 3103287 -- body of page not rendered (page uses JavaScript trick to be both a frameset and a frame) Our self-reference checks prevented this page from working. I just removed the WebKit one, since it was really just working around a problem with the WebCore one that I fixed (didn't ignore #xxx suffixes). * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Remove self-reference check. 2002-12-29 Darin Adler <darin@apple.com> Reviewed by Don. - fixed 3136801 -- scrolling a page that contains a QuickTime movie leaves garbage behind * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView tellQuickTimeToChill]): Added. Calls a QuickDraw SPI CallDrawingNotifications to let QuickTime know it should take a nature break. (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): Call tellQuickTimeToChill. (-[WebBaseNetscapePluginView viewHasMoved:]): Call tellQuickTimeToChill. 2002-12-29 Darin Adler <darin@apple.com> Reviewed by Don. - follow-on to my fix for 3125877 that fixes a crash I observed when a plug-in fails to NPP_New I filed bug 3136870 about the fact that we don't do a good job reporting the error. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendEvent:]): Return quietly if this is called when the plug-in is not started rather than asserting (and doing bad things on Deployment). (-[WebBaseNetscapePluginView setWindow]): Ditto. (-[WebBaseNetscapePluginView viewHasMoved:]): Just call setWindow since it now checks isStarted. 2002-12-29 Darin Adler <darin@apple.com> Reviewed by Don. - fixed 3120630 -- spacebar scrolls the page as well as pausing the QuickTime movie Imitate Mozilla and OmniWeb by not propagating keyboard events after passing them to plug-ins regardless of what the plug-in returns, rather than imitating MacIE, which looks at the return value from NPP_HandleEvent. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView keyUp:]): Remove call to super, add comment. (-[WebBaseNetscapePluginView keyDown:]): Ditto. 2002-12-29 Darin Adler <darin@apple.com> Reviewed by Ken and Don. - fixed 3136120 -- much content missing at www.olympic.org This site gives modern CSS to "Internet Explorer" or "Netscape 6". Since we are neither of those, we need to pretend to be one or the other. So we add olympic.org to our MacIE spoofing list. * WebView.subproj/WebUserAgentSpoofTable.gperf: Add olympic.org to the list of pages that give us better CSS if we claim to be Internet Explorer. * WebView.subproj/WebUserAgentSpoofTable.c: Regenerated. === Alexander-46 === 2002-12-28 Ken Kocienda <kocienda@apple.com> Reviewed by Gramps and Richard Fix for this bug: Radar 3112233 (400 response when attaching files at mail.yahoo.com) I added the MIMETypeForPath method which accesses the WebFoundation mime file map we maintain. KHTML can now access this map by using the bridge. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge MIMETypeForPath:]) 2002-12-28 Darin Adler <darin@apple.com> Reviewed by Gramps and Ken Checked in by Ken - fixed 3125877 -- RealPlayer plug-in doesn't work in Safari * Plugins.subproj/WebBaseNetscapePluginView.h: Remove some methods that don't have any need to be public, getCarbonEvent:, sendEvent:, sendUpdateEvent, setUpWindowAndPort. Make setWindow public. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]): Added. This replaces the old setUpWindowAndPort. Besides setting up the port and the window, it also sets up the port's origin, clip, visible, and update regions properly, and sets the current port. In the case of an update event, we have extra work to do, which was formerly done in drawRect:. (-[WebBaseNetscapePluginView saveAndSetPortState]): Calls saveAndSetPortStateForUpdate:NO. (-[WebBaseNetscapePluginView restorePortState:]): Undoes the port state changes done by the saveAndSetPortState calls. (-[WebBaseNetscapePluginView sendEvent:]): Call saveAndSetPortStateForUpdate: before sending the event to the plug-in. This is the core of fixing the bug. We need to have the port set up properly. Specifically, RealPlayer depended on the port's origin being set and the update region being set. Also added a "draw green" debugging aid to builds without NDEBUG set. (-[WebBaseNetscapePluginView sendNullEvent]): Update text of a FIXME. (-[WebBaseNetscapePluginView setWindow]): Call the new saveAndSetPortState method instead of the old setUpWindowAndPort method. (-[WebBaseNetscapePluginView drawRect:]): Remove bug workarounds that are now inside the saveAndSetPortStateForUpdate: method. (-[WebBaseNetscapePluginView viewDidMoveToWindow]): Add missing call to super. (-[WebBaseNetscapePluginView windowBecameKey:]): Don't send an update event to the plugin directly. Instead mark this view as needing display so we'll get a drawRect later. (-[WebBaseNetscapePluginView windowResignedKey:]): Ditto. (-[WebBaseNetscapePluginView requestWithURLCString:]): Corrected handling of URLs. Absolute URLs are handled by the relative URL function, so there's no need to do an explicit check. Also use requestWithURL instead of doing a three-method dance that does the same thing. (-[WebBaseNetscapePluginView invalidateRect:]): Use setNeedsDisplayInRect: to schedule redrawing rather than forcing an update right away by doing a sendUpdateEvent directly. (-[WebBaseNetscapePluginView invalidateRegion:]): Ditto. (-[WebBaseNetscapePluginView forceRedraw]): Use setNeedsDisplay: and displayIfNeeded to do the drawing through the view system instead of doing a sendUpdateEvent directly. * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView layout]): Do a setWindow rather than a setUpWindowAndPort when the size of the view changes. This matches what other browsers do and extends the bug fix for the Java plug-in to the resize case as well as the scrolling case. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage initWithPath:]): Remove RealPlayer antibodies. 2002-12-27 Darin Adler <darin@apple.com> Reviewed by Don. - fixed 3136206 -- Can't display images in Ambrosia Software image viewer WebKit wasn't creating the frames correctly when they weren't HTML. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _makeDocumentView]): Added. Calls the WebView to make the document view and then installs the new view, as WebHTMLView used to do. (-[WebFrame _transitionToCommitted:]): Call _makeDocumentView instead of calling WebView directly. These are all the calls to _makeDocumentViewForDataSource:. * WebView.subproj/WebViewPrivate.h: Add return value to _makeDocumentViewForDataSource:. * WebView.subproj/WebViewPrivate.m: (-[WebView _makeDocumentViewForDataSource:]): Return the newly-created view. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView setDataSource:]): Removed the code here since it's done by WebFrame now. 2002-12-25 Darin Adler <darin@apple.com> Reviewed by Don. - fixed 3133611 -- Java "ticker" applet renders badly when scrolling page * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView viewHasMoved:]): Call setWindow so we make a call to the plugin each time it moves, rather than just adjusting the data structure we had passed to it earlier. 2002-12-24 Darin Adler <darin@apple.com> Reviewed by Richard and Don. - fixed 3132192 -- HOMEPAGE: Quicktime plug in with AVI content brings Plug-ins not found panel * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): Lower-case the key before searching for it. This is needed for both MIME types and extensions, since we want case insensitive comparison in both cases. === Alexander-45 === 2002-12-23 Ken Kocienda <kocienda@apple.com> Reviewed by Darin and Gramps Workaround for this bug: Radar 3134219 (MPEG-4 files don't work with the QuickTime plugin in Safari, work fine in Mozilla, IE) For beta 1, when getting the MIME information for the QuickTime plugin, we directly insert the information to handle MP4. In the future, we will use the additional plugin entry points to dynamically load this information from the plugin itself. * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage getMIMEInformation]) 2002-12-23 Darin Adler <darin@apple.com> Reviewed by John and Don. - fixed 3134282 -- REGRESSION: text encoding setting reverts when you go to a new location * WebView.subproj/WebFrame.m: (-[WebFrame loadRequest:]): Propagate an override encoding if there was an existing data source and it had an override encoding. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadRequest:triggeringAction:loadType:]): Ditto. === Alexander-44 === 2002-12-20 Trey Matteson <trey@apple.com> Do not add empty URLs to the back forward list. Reviewed by Richard, Darin * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): 2002-12-20 Trey Matteson <trey@apple.com> 3133829 - crash leaving page with a running applet This fixes some holes in how we teardown plugins. An additional fix is expected from Mike Hay to finish the issue. (3133981) Reviewed by Richard * Plugins.subproj/WebPluginController.m: (-[WebPluginController destroyAllPlugins]): frame=nil, so we don't do any more messaging back to WK after this step. (-[WebPluginController showURL:inFrame:]): bail if !frame (-[WebPluginController showStatus:]): bail if !frame * WebView.subproj/WebFramePrivate.m: (-[WebFrame _detachFromParent]): destroy plugins here. We were only doing it in the non-frame case. === Alexander-43 === 2002-12-20 Trey Matteson <trey@apple.com> 3131841 - crash when switching encodings on a page with frames Reviewed by rjw * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): Create a docView in the LoadStale case, like every other kind of load does. 2002-12-20 Richard Williamson <rjw@apple.com> Fixed 3133261. This fix really has two parts. This first part is here in WebTextRenderer. The second part adds some width caching to RenderText. I was using a stack allocated array, this would blow out the stack for large strings. Reviewed by john. * WebCoreSupport.subproj/WebTextRenderer.m: 2002-12-20 Trey Matteson <trey@apple.com> We now build with symbols the B&I. Deployment builds are without symbols, so it is easy to generate a non-huge app as a one-off. Reviewed by Darin * WebKit.pbproj/project.pbxproj: === Alexander-42 === 2002-12-19 John Sullivan <sullivan@apple.com> - WebKit part of fix for 3124949 -- Alexander recreates the default set of bookmarks every time a separate app copy is launched Reviewed by Darin * Bookmarks.subproj/WebBookmarkGroup.h: new _tag ivar and -tag method. * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup dealloc]): release _tag (-[WebBookmarkGroup tag]): return _tag (-[WebBookmarkGroup _loadBookmarkGroupGuts]): read _tag from the dictionary in the file (or leave it at nil if there's no value in the file). * English.lproj/StringsNotToBeLocalized.txt: kept this file up to date 2002-12-19 Darin Adler <darin@apple.com> Reviewed by John. - corrected the name of a method that was leading to trouble elsewhere * WebView.subproj/WebDataSource.h: Change fileType to fileExtension for clarity. * WebView.subproj/WebDataSource.m: (-[WebDataSource fileExtension]): Ditto. === Alexander-41 === 2002-12-19 Darin Adler <darin@apple.com> Reviewed by John. - probably fixed 3129395 -- Reproducible crash when running a javascript at www.scenespot.org * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory runJavaScriptTextInputPanelWithPrompt:defaultText:returningText:]): Close the window. Before we relied on it being released which was bad. But it's not clear this actually was the cause of the bug. 2002-12-19 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed 31323455 -- REGRESSION: Crash in plugin code closing popup window on lordoftherings.net * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendEvent:]): Added an assert. (-[WebBaseNetscapePluginView setWindow]): Added an assert. (-[WebBaseNetscapePluginView stop]): Cancel perform requests, now that we are using them for URL navigation. (-[WebBaseNetscapePluginView frameStateChanged:]): Only notify if the plugin is still running. (-[WebBaseNetscapePluginView loadPluginRequest:]): Added. Does the actual load at idle time. Also fixed to only notify if plugin is loaded. Added a number of FIXMEs for other problems here. Also send JavaScript to the appropriate frame, not always the top level. (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): Use loadPluginRequest: to do the request after a delay. Also remove the special cases for special frame names; they were trying to avoid calling a plugin that has gone away, but we do that a better way now. (-[WebBaseNetscapePluginView getURLNotify:target:notifyData:]): Added logging. (-[WebBaseNetscapePluginView status:]): Use Windows Latin-1 rather than MacRoman for messages. I guess we should test later to find out which is used by MacIE and conform to that, but for now this seems like a better default. (-[WebPluginRequest initWithRequest:frame:notifyData:]): Added. (-[WebPluginRequest dealloc]): Added. (-[WebPluginRequest request]): Added. (-[WebPluginRequest webFrame]): Added. (-[WebPluginRequest notifyData]): Added. 2002-12-18 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed fix for 3132056 -- Supply Finder bits for decoded BinHex files * Downloads.subproj/WebBinHexDecoder.m: (-[WebBinHexDecoder decodeHeader]): Mask off fewer Finder flag bits. Use the same mask as for MacBinary, in fact. 2002-12-18 Darin Adler <darin@apple.com> Reviewed by Richard. - fixed 3127490 -- pages w/frames sometimes show up blank * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): Updated the optimization where we draw the entire view if we did a layout so that it works properly for the case where the clip is narrower because of the parent WebHTMLView. * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. === Alexander-40 === 2002-12-18 Trey Matteson <trey@apple.com> 3098388 - Pressing the back button goes back two levels at allmusic.com I rewrote the logic we use to decide whether a given redirect should be treated as part of the previous navigation. We make use of WebCore's lockHistory setting, the delay time and the frame state. Reviewed by Darin. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportClientRedirectToURL:delay:fireDate:lockHistory:]): Pass lockHistory up to the frame. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _clientRedirectedTo:delay:fireDate:lockHistory:]): New logic. No quick summary, best to read the code. 2002-12-18 Chris Blumenberg <cblu@apple.com> Reject the RealPlayer plug-in because we know it doesn't work. Reviewed by sullivan. * English.lproj/StringsNotToBeLocalized.txt: * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage initWithPath:]): reject the RealPlayer plug-in 2002-12-18 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - fixed 3131171 - Change Alex versions to satisfy both marketing and B&I requirements * English.lproj/InfoPlist.strings: 2002-12-18 Richard Williamson <rjw@apple.com> Fixed 3129951. Don't allow pages that are stopping to enter the page cache. (Fixed yesterday, forgot to checkin.) Reviewed by trey. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setState:]): 2002-12-18 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin and Trey. - fixed 3124933 - abcnews.com leads to empty window with sheet complaining about javascript: URL - fixed 3091248 - picture does not show up in window from epinions - made "about:blank" load synchronously, which I'm told is required by some sites. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): If the URL is nil or empty, pass a nil request - otherwise WebBrowser will try to load it, resulting in an extra back/forward list entry. (-[WebBridge loadEmptyDocumentSynchronously]): Tell the frame to load a request with an empty URL - this will cause a synchronous load of an empty html document * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate loadWithRequest:]): Split off startLoading: part of method to allow behavior to be subclassed. (-[WebBaseResourceHandleDelegate startLoading:]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady:]): Lie and claim the URL is "about:blank" if it's really empty to avoid confusing WebCore. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): Don't put the empty URL in global history. (-[WebFrame _checkNavigationPolicyForRequest:dataSource:andCall:withSelector:]): Don't check policy if URL is empty - this is likely to confuse the client and we know what the right behavior here is. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient startLoading:]): Try to load "about:blank" and the empty URL synchronously, bypassing WebFoundation. (-[WebMainResourceClient continueAfterContentPolicy:response:]): Ditto. (-[WebMainResourceClient setDefersCallbacks:]): Ditto. * English.lproj/StringsNotToBeLocalized.txt: Updated. 2002-12-18 Chris Blumenberg <cblu@apple.com> Fixed: 2862385 - need to pass browser's user agent and version to plug-ins Added some more error checking to the plug-in code Reviewed by trey. * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (+[WebBaseNetscapePluginView setCurrentPluginView:]): new, sets a global variable for the current plug-in (+[WebBaseNetscapePluginView currentPluginView]): new, returns the current plug-in (-[WebBaseNetscapePluginView start]): check if NPP_New fails, return NO if it does, set the current plug-in view. Currently, this is the only place we need to do this. (-[WebBaseNetscapePluginView userAgent]): made instance-specific because it depends on the plug-in view's WebController * Plugins.subproj/WebBaseNetscapePluginViewPrivate.h: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView viewDidMoveToWindow]): don't start the stream is start fails * Plugins.subproj/npapi.m: (NPN_MemAlloc): tweak (NPN_RequestRead): tweak (pluginViewForInstance): returns the instance's plug-in view if it has one, if not, return the current plug-in view (NPN_GetURLNotify): get the instance from pluginViewForInstance (NPN_GetURL): (NPN_PostURLNotify): (NPN_PostURL): (NPN_NewStream): (NPN_Write): (NPN_DestroyStream): (NPN_UserAgent): (NPN_Status): (NPN_InvalidateRect): (NPN_InvalidateRegion): (NPN_ForceRedraw): (NPN_GetValue): (NPN_SetValue): (NPN_GetJavaEnv): (NPN_GetJavaPeer): 2002-12-18 Richard Williamson <rjw@apple.com> Fixed 3109590. We now set the cookie policy URL to a frame's URL if the contents of the frame changes as a result of user action. The site mentioned is this bug branded a service by wrapping it in their own frameset. That frameset had a different domain than the service, so our cookie policy prevented cookies from being set. Reviewed by trey. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): * WebView.subproj/WebFrame.m: (-[WebFrame loadRequest:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadItem:fromItem:withLoadType:]): (-[WebFrame _addExtraFieldsToRequest:alwaysFromRequest:]): (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): (-[WebFrame _postWithURL:data:contentType:triggeringEvent:]): 2002-12-18 Chris Blumenberg <cblu@apple.com> Fixed: 3131714 - System becomes unresponsive while downloading While downloading a file, Safari and the Finder take up 30%-40% of the CPU each. This is happening because for every chunk of data we write to disk, we call -[NSWorkspace noteFileSystemChanged:]. noteFileSystemChanged is inefficient. It calls 2 AppleEven ts each with 60 timeouts. The event also cause the Finder to do a lot of work. We should: - Send 1 AppleEvent ourselves with no timeout since we don't care about the reply - Call the notification/event less often. The only benefit of sending the event for every chunk written is that the file size updates in the Finder. Not worth the performance impact. Reviewed by kocienda. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler cleanUpAfterFailure]): call _web_noteFileChangedAtPath (-[WebDownloadHandler createFileIfNecessary]): call _web_noteFileChangedAtPath (-[WebDownloadHandler writeDataForkData:resourceForkData:]): don't call noteFileSystemChanged (-[WebDownloadHandler finishedLoading]): call _web_noteFileChangedAtPath * Misc.subproj/WebNSWorkspaceExtras.h: Added. * Misc.subproj/WebNSWorkspaceExtras.m: Added. (-[NSWorkspace _web_noteFileChangedAtPath:]): Notifies the Finder (or any other app that cares) that we added, removed or changed the attributes of a file. This method is better than calling noteFileSystemChanged: because noteFileSystemChanged: se nds 2 apple events both with a 60 second timeout. This method returns immediately. * WebKit.pbproj/project.pbxproj: 2002-12-18 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3098293 -- Shockwave plug-in doesn't work The problem is that the Shockwave plug-in depends on being able to do LMGetCurApRefNum and then do a PBGetFCBInfoSync on the result, and if it gets an error it will refuse to initialize. * Plugins.subproj/WebNetscapePluginPackage.m: (+[WebNetscapePluginPackage initialize]): Supply a bogus CurApRefNum. Do it only if CurApRefNum is -1, so we don't screw things up if we are used in a Carbon application. 2002-12-17 Darin Adler <darin@apple.com> Reviewed by Trey. * WebKit.pbproj/project.pbxproj: Remove signature. * WebView.subproj/WebController.m: Turn off inlining so we can build even on the compiler that warns about static data in inline functions. 2002-12-17 John Sullivan <sullivan@apple.com> - fixed 2895826 -- ICON: Need a "no plug-in" icon * Resources/nullplugin.tiff: new plug-in icon. Blue 3-D lego with question marks. 2002-12-17 Richard Williamson <rjw@apple.com> Added support for Aki's 20% boost to line height. This is done with a horrible hack and should be removed when 3129490 is fixed. Reviewed by hyatt. * WebCoreSupport.subproj/WebTextRenderer.m: === Alexander-39 === === Alexander-38 === 2002-12-17 Richard Williamson <rjw@apple.com> Fixed 3127932. Added WebFrameLoadTypeReloadAllowingStaleData to cases that do not get cached in the b/f cache. Reviewed by trey. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setState:]): 2002-12-17 Richard Williamson <rjw@apple.com> Fixed 3128794. Use CG directy to get font metrics rather than the appkit. The appkit has a bug (3129490) that sometimes causes line height to be 20% too large. Reviewed by hyatt. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:]): (-[WebTextRenderer ascent]): (-[WebTextRenderer descent]): (-[WebTextRenderer lineSpacing]): 2002-12-17 Trey Matteson <trey@apple.com> Reworking the code to update the page icon led me to roll the WebIconDB API for URL to NSString. In addition, the vestigial "Site" was removed. Everything below is renaming, except where noted. Reviewed by Darin * English.lproj/StringsNotToBeLocalized.txt: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem _retainIconInDatabase:]): (-[WebHistoryItem icon]): * Misc.subproj/WebIconDatabase.h: * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase init]): (-[WebIconDatabase iconForURL:withSize:cache:]): Use _web_isFileURL. (-[WebIconDatabase iconForURL:withSize:]): (-[WebIconDatabase retainIconForURL:]): (-[WebIconDatabase releaseIconForURL:]): (-[WebIconDatabase _iconDictionariesAreGood]): (-[WebIconDatabase _loadIconDictionaries]): (-[WebIconDatabase _updateFileDatabase]): (-[WebIconDatabase _iconForFileURL:withSize:]): Cons up a NSURL to get the path. Test explicitly for .htm and .html suffixes. (-[WebIconDatabase _setIcon:forIconURL:]): (-[WebIconDatabase _setIconURL:forURL:]): (-[WebIconDatabase _releaseIconForIconURLString:]): (-[WebIconDatabase _retainFutureIconForURL:]): (-[WebIconDatabase _releaseFutureIconForURL:]): (-[WebIconDatabase _sendNotificationForURL:]): * Misc.subproj/WebIconDatabasePrivate.h: * Misc.subproj/WebIconLoader.m: (-[WebIconLoader handleDidFinishLoading:]): * WebKit.exp: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _updateIconDatabaseWithURL:]): (-[WebDataSource _loadIcon]): 2002-12-17 Chris Blumenberg <cblu@apple.com> Fixed: 3113073 - link on http://studio.adobe.com/explore/ redirects to not found page in Alex Reviewed by darin. * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_bestURL]): don't trim whitespace because _web_URLWithString does this for us * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView pluginURLFromCString:]): tweak 2002-12-17 John Sullivan <sullivan@apple.com> - to help with performance of various bookmark operations, added a call that returns the internal array of children, to complement the safer call that returns a copy. Reviewed by Darin * Bookmarks.subproj/WebBookmark.h: commented -children and new -rawChildren * Bookmarks.subproj/WebBookmark.m: (-[WebBookmark rawChildren]): new method, returns nil at this level. (-[WebBookmark contentMatches:]): use -rawChildren instead of -children * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList rawChildren]): new method, returns internal array without copying 2002-12-16 Darin Adler <darin@apple.com> Reviewed by Don and Maciej. * WebView.subproj/WebUserAgentSpoofTable.gperf: Added a couple of new domains to the list we spoof as Mac IE, and added comments. * WebView.subproj/WebUserAgentSpoofTable.c: Regenerated. * WebKit.pbproj/project.pbxproj: Set MACOSX_DEPLOYMENT_TARGET to 10.2 2002-12-16 Chris Blumenberg <cblu@apple.com> Fixed: 3129503 - Crash cancelling download after closing browser window that started download Reviewed by rjw. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setLoading:]): Added comment about our tragic dependence on a non-retained reference to the controller. (-[WebDataSource _recursiveStopLoading]): Call webFrame before calling _stopLoading because we release the controller in _stopLoading and we depend on it in webFrame. === Alexander-37 === 2002-12-16 Maciej Stachowiak <mjs@apple.com> Reviewed by no one but it's just a version bump. * WebKit.pbproj/project.pbxproj: Bump version to 37u3 2002-12-16 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3128858 -- Supply Finder bits for decoded BinHex files * Downloads.subproj/WebBinHexDecoder.h: Add a _finderFlags field. * Downloads.subproj/WebBinHexDecoder.m: (-[WebBinHexDecoder decodeHeader]): Decode Finder flags. (-[WebBinHexDecoder fileAttributes]): Put Finder flags in dictionary. * Downloads.subproj/WebMacBinaryDecoder.m: Tweaked things for no good reason. (It is good to always import your own header first as a check that it's self-sufficient). * WebKit.pbproj/project.pbxproj: Let Electron wipe the slate clean of pre-Electron iniquity. 2002-12-15 Chris Blumenberg <cblu@apple.com> Fixed: 3094928 - Apply Finder bits to decoded downloads Reviewed by darin. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler createFileIfNecessary]): call _web_createFileAtPath:contents:attributes: so we set Finder bits * Downloads.subproj/WebMacBinaryDecoder.h: * Downloads.subproj/WebMacBinaryDecoder.m: (-[WebMacBinaryDecoder decodeData:dataForkData:resourceForkData:]): save Finder bits (-[WebMacBinaryDecoder fileAttributes]): return Finder bits === WebKit-37u2 === 2002-12-15 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed likely B&I build problem. * WebKit.pbproj/project.pbxproj: Get at other frameworks in B&I build. Bump version to 37u2. 2002-12-15 Darin Adler <darin@apple.com> Reviewed by Dave. - implemented user-agent spoofing as described in bug 3044569 * WebView.subproj/WebController.m: (-[WebController userAgentForURL:]): Find the suffix of the host name that contains exactly one dot, lower-case it, and look it up in the user-agent spoof table. For now, anything in the table pretends to be MacIE. Don't fret that this table is simple. We will complicate it as needed. The technique is flexible, even though it may not look it now. * WebView.subproj/WebControllerPrivate.h: Add userAgentWhenPretendingToBeMacIE field. * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate dealloc]): Release userAgentWhenPretendingToBeMacIE. (-[WebController _defaultsDidChange]): Release and nil userAgentWhenPretendingToBeMacIE. * Makefile.am: Added rules to build WebUserAgentSpoofTable.c using gperf. * WebView.subproj/WebUserAgentSpoofTable.c: Added. Generated file. * WebView.subproj/WebUserAgentSpoofTable.gperf: Added. Table * English.lproj/StringsNotToBeLocalized.txt: Update for above changes. - fixed a crash I saw in a simplistic way * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementAtPoint:]): Don't assert if the webFrame is nil, just return a partial dictionary. 2002-12-15 Darin Adler <darin@apple.com> Reviewed by Trey. - fixed 3128260 -- REGRESSION: context menus in frames are always the generic page menu * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView hitTest:]): Check the control key in the mouse down event. If it's down, then do no magic. 2002-12-15 Darin Adler <darin@apple.com> Reviewed by Dave. - fixed 3128651 -- REGRESSION: Mouse wheeling is busted on frames pages * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView hitTest:]): Only do the hitTest magic for left mouse downs; the rest of the clicks end up going to the correct view anyway, without our help. This makes this stop making trouble for the scroll wheel events. 2002-12-14 Don Melton <gramps@apple.com> Fixed 3127173 -- REGRESSION: fboweb.com renders incorrectly Reviewed by darin * English.lproj/StringsNotToBeLocalized.txt: * WebView.subproj/WebController.m: (-[WebController userAgentForURL:]): Changed "PPC" in our user agent string to "PPC Mac OS X" in order to match Mozilla and make the silly server-side user agent string checking work at fboweb.com. Actually, just "PPC " would work fine at fboweb.com. Go figure. 2002-12-13 Darin Adler <darin@apple.com> Reviewed by Don. * WebView.subproj/WebController.m: (-[WebController userAgentForURL:]): Add "(like Gecko)" string and change "WebKit" to "AppleWebKit". * English.lproj/StringsNotToBeLocalized.txt: Update for these changes. * Misc.subproj/WebUnicode.h: No need for & 0xFF since we cast to unsigned char. 2002-12-13 John Sullivan <sullivan@apple.com> - WebKit part of fix for 3028061 -- visiting a bookmarked site that now has a site icon will not update bookmark's icon No longer store the icon in the WebHistoryItem, since there's no mechanism for keeping it fresh and telling interested clients when it changes. Instead, the latest icon is always returned from the icon database, and it's up to clients to get a fresh one when they notice that the icon for a URL has been updated. Reviewed by Darin * History.subproj/WebHistoryItem.h: remove _icon and _loadedIcon ivars * History.subproj/WebHistoryItem.m: (-[WebHistoryItem dealloc]): don't release _icon (-[WebHistoryItem icon]): just return fresh icon from database, don't store (-[WebHistoryItem setURL:]): don't set _loadedIcon to NO === Alexander-37u1 === 2002-12-13 Darin Adler <darin@apple.com> Reviewed by Maciej. * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2002-12-13 Trey Matteson <trey@apple.com> 3108976 - assert _private provisionalItem in -[WebFrame(WebPrivate) _transitionToCommitted 3108865 - frames not maintained going back at directory.apple.com Both bugs are fixed by the same small change. We no longer try to inherit loadType across redirects. Instead we just make sure the right thing happens in _transitionToCommitted: for redirects in the loadType=Standard case. 3122721 - History stores both original and redirected sites Easy fix while in the neighborhood. We just don't add to History when doing a redirect. Reviewed by rjw * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): On redirect, update the URL of the frame's current item, not the current item in the b/f list. Also do not add to history on redirect. (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): Cut out funny business that tried to guess when to inherit loadtype across redirects. 2002-12-13 Richard Williamson <rjw@apple.com> Fixed 3127225. Scale page cache based on available memory. Also added support for setting WebCore object cache size via a preference. Fixed 3126267. Increase CG glyph cache size if font smoothing is turned on. Reviewed by gramps. * History.subproj/WebBackForwardList.m: (+[WebBackForwardList pageCacheSize]): * Misc.subproj/WebKitLogging.h: * Misc.subproj/WebKitLogging.m: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge getObjectCacheSize]): * WebCoreSupport.subproj/WebTextRendererFactory.m: (getAppDefaultValue): (getUserDefaultValue): (getLCDScaleParameters): * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): (-[WebPreferences _pageCacheSize]): (-[WebPreferences _objectCacheSize]): * WebView.subproj/WebPreferencesPrivate.h: 2002-12-13 Chris Blumenberg <cblu@apple.com> Fixed: 3105486 - c|net news.com site seems to have lost its favicon again Reviewed by darin. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _updateFileDatabase]): Only save icons with a size of 16 x 16 since that's the only size we use. 2002-12-13 Chris Blumenberg <cblu@apple.com> Catch NULL status strings passed to NPN_Status. Reviewed by darin. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView status:]): check the incoming string before calling [NSString stringWithCString] 2002-12-12 Trey Matteson <trey@apple.com> 3117101 - PLT slows down as history fills up I saw a 3% sloth effect from a huge (100k) history. This change cut that cost in half. I think we still have a marginally measurable cost for our worst practical case. Reviewed by rjw * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate insertEntry:atDateIndex:]): Comment. (-[WebHistoryPrivate removeEntryForURLString:]): Use removeIdentical instead of remove, since we don't need to do all the equals comparisons. 2002-12-12 Richard Williamson <rjw@apple.com> Changes to fix 3116584. Reviewed by hyatt. Changes to support emptying the page cache from the "Empty Cache" menu. Reviewed by trey. * ChangeLog: * History.subproj/WebBackForwardList.h: * History.subproj/WebBackForwardList.m: (-[WebBackForwardList clearPageCache]): * History.subproj/WebHistoryItem.m: (+[WebHistoryItem _scheduleReleaseTimer]): (-[WebHistoryItem _scheduleRelease]): (+[WebHistoryItem _releasePageCache:]): (-[WebHistoryItem setHasPageCache:]): * WebCoreSupport.subproj/WebTextRenderer.m: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _opened]): 2002-12-12 Richard Williamson <rjw@apple.com> Fixed 3119693. Restore scroll position when going back to item in b/f cache. Reviewed by trey. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _opened]): === Alexander-36 === 2002-12-12 Richard Williamson <rjw@apple.com> Change relating to 3083287. This doesn't fix the problem but flips the geometry calcs to get most incremental images to draw correctly. .mac now slideshows draw with the incorrect sliding behavior while loading. 3083287 has been moved to 0.9/1. Reviewed by darin. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): 2002-12-12 Trey Matteson <trey@apple.com> Fixed 3094525 - Need to use SPI to fix flipped drag image problem We call the new SPI. I also had to rework the dissolve steps to get it to non flip the image in Panther in millions (but leave the old code for the Jaguar case). Reviewed by cblu * Misc.subproj/WebNSImageExtras.m: (+[NSImage load]): Call the SPI. (-[NSImage _web_dissolveToFraction:]): Add new way of building the image for Panther. 2002-12-12 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed most likely cause of 3125565 -- 2% regression running the PLT for uncached loads Don't recompute the user agent when it doesn't change. It almost never changes. * WebView.subproj/WebController.m: (-[WebController initWithView:controllerSetName:]): Add observer so we know when defaults change. (-[WebController dealloc]): Remove observer. (-[WebController setApplicationNameForUserAgent:]): Clear out computed user agent to force it to be recomputed later. (-[WebController applicationNameForUserAgent]): Just retain since we copied when we stored it so we know it's not mutable. (-[WebController customUserAgent]): Ditto. (-[WebController userAgentForURL:]): Use the cached user agent if it's good. Otherwise compute and cache the user agent string. This means that we will almost never recompute it. * WebView.subproj/WebControllerPrivate.h: Add userAgent field to cache in. * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate dealloc]): Release userAgent. (-[WebController _defaultsDidChange]): Release and nil userAgent. 2002-12-12 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3125504 -- REGRESSION: Selection not working correctly for text area on http://glish.com/css/7.asp The problem is that the text area lost its first responder status because WebHTMLView took the click, and NSWindow wanted WebHTMLView to become first responder too. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView acceptsFirstResponder]): Don't allow the NSWindow to make this the first responder during the early part of mouseDown event handling. But do allow anyone else to make this the first responder, for example from keyboard events, or from calls back from WebCore once we begin mouse-down event handling. 2002-12-12 Darin Adler <darin@apple.com> Reviewed by Maciej and Richard. - fixed reentrancy crash I ran into while debugging infinite recursion bugs * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _updateMouseoverWithFakeEvent]): Added. Does part of what _frameOrBoundsChanged did. (-[WebHTMLView _frameOrBoundsChanged]): Schedule the mouseover update to happen soon, rather than doing it right away. If we do it right away, we might reenter because sending a mouse moved event can result in another layout since mouse moved events are the same as mouse dragged events in KHTML. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView viewWillMoveToWindow:]): Cancel the scheduled mouseover update. * WebKit.pbproj/project.pbxproj: Electron uber alles. 2002-12-12 Richard Williamson <rjw@apple.com> Fixed 3125585. One click crasher option clicking on any link. Added additional check to curtail overly zealous ASSERT. Reviewed by mjs. * WebView.subproj/WebControllerPrivate.m: (-[WebController _mainReceivedError:fromDataSource:complete:]): 2002-12-11 Richard Williamson <rjw@apple.com> Fixed 3125425. Just call super if view isn't in view heirarchy, rather than asserting. The assert was firing because NSText was trying to perform a background layout on an item view that was moved to the page cache. Reviewed by gramps. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView visibleRect]): 2002-12-11 Richard Williamson <rjw@apple.com> Fixed 3124121, 3124716 (and other dupes). Regressions related to b/f crash. Reviewed by hyatt. * ChangeLog: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem _scheduleRelease]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge saveDocumentToPageCache:]): * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setState:]): 2002-12-11 Richard Williamson <rjw@apple.com> Fixed 3123375. Provide SPI to release all pending page caches Reviewed by kocienda. * History.subproj/WebBackForwardList.m: * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: * History.subproj/WebHistoryItemPrivate.h: Added. * WebCoreSupport.subproj/WebBridge.m: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebFramePrivate.m: 2002-12-11 Darin Adler <darin@apple.com> Reviewed by Richard. - fixed 3124837 -- Crash trying to handle weird javascript URL in page address field * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): Use the new _web_scriptIfJavaScriptURL to simplify the check for JavaScript URLs, and to use a more tolerant unescaper. * English.lproj/StringsNotToBeLocalized.txt: Updated. 2002-12-11 Darin Adler <darin@apple.com> Reviewed by John. - turned on the mechanism that passes events through WebCore, now that it's working better * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView hitTest:]): Moved this function in here. Rewrote it. It has a new feature where you can set a global and do a normal hit test, needed for the mouse-moved handling below. Also, for efficiency, it does the actual hit testing of itself, rather than calling super, which recurses, and ignoring the result. The sum total is that it always returns self for mouse-moved events, so we pass them all over the bridge at the topmost frame. (-[WebHTMLView _updateMouseoverWithEvent:]): * WebView.subproj/WebHTMLView.m: Moved hitTest: out of here. 2002-12-11 John Sullivan <sullivan@apple.com> - fixed 3124640 -- Crash importing IE Favorites if there are no IE favorites Reviewed by Darin * Bookmarks.subproj/WebBookmarkImporter.m: (-[WebBookmarkImporter initWithPath:]): use alloc/init instead of autoreleasing constructor for error since it's kept around until dealloc. 2002-12-11 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3117611 -- REGRESSION: exception in mouseoverTextForElement with accented characters in status * WebView.subproj/WebHTMLViewPrivate.m: (-[NSMutableDictionary _web_setObjectIfNotNil:forKey:]): Remove the object from the dictionary rather than just leaving the dictionary alone if it's nil. This is needed since we now are reusing an already-existing dictionary. * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2002-12-11 Chris Blumenberg <cblu@apple.com> Fixed: 3118430 - crash / loop trying to copy url of link to clipboard Fixed: 3122585 - REGRESSION: dragging links to the desktop or a Finder window does not do anything Reviewed by john. We were reusing the drag types from the previous drag pasteboard. For example, we would declare image types when dragging URLs. This would confuse the Finder, so location files weren't being created. This would occasional cause us to crash because we wer en't providing the declared data. * Misc.subproj/WebNSPasteboardExtras.h: * Misc.subproj/WebNSPasteboardExtras.m: (+[NSPasteboard _web_dragTypesForURL]): Added more types that we handle (-[NSPasteboard _web_writeURL:andTitle:withOwner:declareTypes:]): declares the provided types, writes URL and title (-[NSPasteboard _web_writeURL:andTitle:withOwner:]): call _web_writeURL:andTitle:withOwner:types: with _web_dragTypesForURL * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragPromisedImage:origin:URL:fileType:title:event:]): call _web_writeURL:andTitle:withOwner: types: plus images types 2002-12-10 Trey Matteson <trey@apple.com> 3092966 - going back goes to different page (can't go back to a POST page) 3123450 - if the user refuses a navigation, the b/f menus is wrong We will rePOST data upon back/forward/refresh if our caches fail us. The policy delegate gets a crack at confirming this operation. Latent bugs where the policy delegate was double queried are fixed. A bug in the b/f cursor when a page failed to load is fixed. Reviewed by Maciej. * English.lproj/StringsNotToBeLocalized.txt: Usual suspects. * History.subproj/WebHistoryItem.h: Add state for reposting forms. * History.subproj/WebHistoryItem.m: Boilerplate changes for new state. (-[WebHistoryItem dealloc]): (-[WebHistoryItem setFormData:]): (-[WebHistoryItem setFormContentType:]): (-[WebHistoryItem formData]): (-[WebHistoryItem formContentType]): (-[WebHistoryItem description]): * WebView.subproj/WebController.m: (-[WebController _goToItem:withLoadType:]): Tighten up an assert as I clarified an assumption as I worked through this task. * WebView.subproj/WebControllerPolicyDelegate.h: New WebNavigationType's for back/forward, refresh, and repost. * WebView.subproj/WebFrame.m: (-[WebFrame loadRequest:]): Eliminate extra copy of a request. (-[WebFrame reload]): Eliminate extra copy of a request. Setup triggeringAction properly if we're about to rePOST. * WebView.subproj/WebFramePrivate.h: Started moving some private methods into the .m file. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _createItem]): Save form state with history items. (-[WebFrame _isLoadComplete]): Fix up b/f cursor on page error before commit succeeds. (-[WebFrame _loadItem:fromItem:withLoadType:]): Set up request to rePOST if that's what the HistoryItem demands. Add call to _addExtraFieldsToRequest so we don't do a double query of the policy delegate. Pre-flight the form post vs. WF cache to setup triggering action properly. (-[WebFrame _actionInformationForLoadType:isFormSubmission:event:originalURL:]): New utility method to help build action dict. (-[WebFrame _continueAfterNavigationPolicy:]): Comment only. (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): Call new utility method instead (just code factoring). (-[WebFrame _postWithURL:data:contentType:triggeringEvent:]): Call new utility method instead (just code factoring). Add call to _addExtraFieldsToRequest so we don't do a double query of the policy delegate. (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]): Whitespace only. (-[WebFrame _resetBackForwardListToCurrent]): Utility routine to fix up b/f cursor on page error. (-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]): Fix up b/f cursor on page error before commit succeeds. 2002-12-10 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3124302 -- REGRESSION: Can't use directory.apple.com because frame resize bar intercepts mouse clicks * WebView.subproj/WebHTMLView.m: (-[WebHTMLView hitTest:]): Don't steal clicks for views that are inside nested WebViews. This isn't the real fix, but it's good enough for now. The real fix will be in WebCore. 2002-12-10 Darin Adler <darin@apple.com> - fixed fix for 3124081 -- REGRESSION: partial progress is left in address field after download Reviewed by Chris. Need to move it down one line so the data source is clear before callback. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient interruptForPolicyChangeAndKeepLoading:]): Do the _clearProvisionalDataSource before the locationChangeDone: callback. 2002-12-10 John Sullivan <sullivan@apple.com> Fixed more "Alexander"s that were lurking in places I forgot to look before. Reviewed by Darin * Makefile.am: "rm -rf $(SYMROOTS)/Safari.app/Frameworks/WebKit.framework" 2002-12-10 Darin Adler <darin@apple.com> - fixed 3124081 -- REGRESSION: partial progress is left in address field after download Reviewed by Chris. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient interruptForPolicyChangeAndKeepLoading:]): Put in code to call the locationChangeDone: method on the location change delegate if keepLoading is YES. Since the data source is not finished loading WebFrame won't do it. 2002-12-10 Chris Blumenberg <cblu@apple.com> Fixed: 3124079 - REGRESSION: Downloads never complete Reviewed by darin. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidFinishLoading:]): release and set to nil the download handler after calling [super handleDidFinishLoading:h] 2002-12-10 Richard Williamson <rjw@apple.com> Fixed 3115427. Page now draws instantly instead of 20 seconds. I added the substitution font we get from the appkit to the character to glyph cache. Fixed early return optimization from letter forming function. It was too eager to return! Reviewed by mjs. * Misc.subproj/WebUnicode.m: (shapedString): * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (glyphForCharacter): (glyphForUnicodeCharacter): (widthForGlyph): (widthForCharacter): (_fontContainsString): (-[WebTextRenderer substituteFontForString:families:]): (-[WebTextRenderer _computeWidthForSpace]): (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:letterSpacing:wordSpacing:fontFamilies:]): (-[WebTextRenderer extendUnicodeCharacterToGlyphMapToInclude:]): (-[WebTextRenderer updateGlyphEntryForCharacter:glyphID:font:]): (-[WebTextRenderer extendCharacterToGlyphMapToInclude:]): (-[WebTextRenderer extendGlyphToWidthMapToInclude:]): 2002-12-10 John Sullivan <sullivan@apple.com> - tweaked the API of WebBookmarkImporter while implementing real "Import IE Favorites" UI Reviewed by Ken * Bookmarks.subproj/WebBookmarkImporter.h: fixed a typo in a constant * Bookmarks.subproj/WebBookmarkImporter.m: (-[WebBookmarkImporter initWithPath:]): Don't pass a group here. This method now creates the topBookmark (as it was doing before) but does not attempt to insert it anywhere. It's up to the client to fetch the topBookmark and do something with it. Also, don't name the new folder here; leave that to the caller also. * English.lproj/Localizable.strings: kept this file up to date 2002-12-10 Darin Adler <darin@apple.com> Reviewed by John. - fixed 3108912 -- onclick handlers not supported on form elements * WebView.subproj/WebHTMLView.m: (-[WebHTMLView hitTest:]): Take over hit testing so that all clicks on subviews are handled by the WebHTMLView. WebCore now handles getting the mouse events to the subviews after passing the events through the DOM. 2002-12-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Trey. - fixed 3123057 - SJ: DHTML doesn't always work on http://www.pixar.com/howwedoit/ * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): Treat a click on a link to the same URL with an anchor as a scroll to anchor, not a same URL load. (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:request:]): Avoid adding the same anchor URL to the back/forward list many times. 2002-12-09 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed 3028664 -- change user agent string to include application name and version * WebView.subproj/WebController.m: (-[WebController setApplicationNameForUserAgent:]): Remove locking, unneeded since we changed how WebFoundation handles user agent. (-[WebController setCustomUserAgent:]): Ditto. (-[WebController resetUserAgent]): Ditto. (-[WebController userAgentForURL:]): Remove locking. Also add new algorithm for computing the user agent which takes the preferred language into account, and incorporates the WebKit version and the application name. * WebView.subproj/WebControllerPrivate.h: No need for a lock. * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate init]): Don't create a lock. (-[WebControllerPrivate dealloc]): Don't release a lock. * WebKit.pbproj/project.pbxproj: Bump versions to 0.8 and 35u. * English.lproj/InfoPlist.strings: In here too. * English.lproj/StringsNotToBeLocalized.txt: Updated for these and other recent changes. 2002-12-09 Richard Williamson <rjw@apple.com> Many changes for b/f list. 1. Always attempt to cache snap back items. 2. Lazily release resources from page cache. This garners gains on the PLT (and presumably iBench) tests, both for uncached. 3. Set the page cache size to 4 (+ snap back items). After releasing resources we hover around 28MB footprint. Closing windows releases all resources. 4. Turn on the back/forward cache by default. The menu item still allows you to toggle b/f on and off. Useful when conducting speed comparison in the PLT. 5. Addition of lazy update to PLT memory statistics to show footprint after lazy release of page cache resources. 6. Delayed to leak detector to account for lazy release of resources. 7. A change when saving a page to back/forward cache to clear and restore the documents root renderer. Without this fix pages would appear to 'flicker' more when content arrived. 8. A change to ensure a layout when restoring a page from the b/f cache. Without this fix scrollbars wouldn't appear correctly. 9. A change to ensure that khtmlview layout and paint timers are unscheduled when a page is placed in the b/f cache. 10. A fix to decouple of khtmlview from it's part when placed in the b/f cache. This fixed a crash caused by inappropriate deference of the part when a page cache item was released. 11. A comment in KHTMLPageCache.h explaining the that our page cache is not the same as the khtml page cache. (Their cache just cached the html source.) 12. Reapply styles when loading page from cache. This ensures that visited link get the appropriate style. Reviewed by kocienda. * History.subproj/WebBackForwardList.m: (+[WebBackForwardList pageCacheSize]): (+[WebBackForwardList setUsesPageCache:]): (+[WebBackForwardList usesPageCache]): * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem setAlwaysAttemptToUsePageCache:]): (-[WebHistoryItem alwaysAttemptToUsePageCache]): (+[WebHistoryItem _invalidateReleaseTimer]): (-[WebHistoryItem _scheduleRelease]): (+[WebHistoryItem _releaseAllPendingPageCaches]): (-[WebHistoryItem _releasePageCache:]): (-[WebHistoryItem setHasPageCache:]): (-[WebWindowWatcher windowWillClose:]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): (-[WebDataSource _commitIfReady:]): (-[WebDataSource _loadingFromPageCache]): * WebView.subproj/WebDynamicScrollBarsView.h: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _purgePageCache]): (+[WebFrame _timeOfLastCompletedLoad]): (-[WebFrame _setState:]): (-[WebFrame _opened]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]): * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): 2002-12-09 Darin Adler <darin@apple.com> Reviewed by Chris. - fixed 3122608 -- REGRESSION: Downloads can't be cancelled When I fixed the leak for other categories of policy interruption, I messed things up for downloads. Added new parameters to handle this right. * WebView.subproj/WebBaseResourceHandleDelegate.h: Remove isDownload flag. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate isDownload]): Return NO, override in subclass. (-[WebBaseResourceHandleDelegate handle:didReceiveResponse:]): Call isDownload method instead of looking at flag directly. * WebView.subproj/WebControllerPrivate.h: Add complete: parameter to _mainReceivedError:. * WebView.subproj/WebControllerPrivate.m: (-[WebController _mainReceivedError:fromDataSource:complete:]): If complete is NO, then don't mark the primary load as complete. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient isDownload]): Added. Returns YES if downloadHandler is non-nil. (-[WebMainResourceClient receivedError:complete:]): Added complete parameter. Call the _setPrimaryLoadComplete: method in the download case (fixes a possible leak), and pass the complete parameter through to the controller. (-[WebMainResourceClient cancel]): Pass complete:YES. (-[WebMainResourceClient interruptForPolicyChangeAndKeepLoading:]): Added the keepLoading flag, and pass complete:!keepLoading. (-[WebMainResourceClient stopLoadingForPolicyChange]): Pass keepLoading:NO. (-[WebMainResourceClient continueAfterContentPolicy:response:]): Pass keepLoading:YES, and remove the call to the now-obsolete setIsDownload:. (-[WebMainResourceClient handle:didFailLoadingWithError:]): Pass complete:YES. 2002-12-08 Darin Adler <darin@apple.com> Reviewed by Don and Dave. - fixed 3120578 -- REGRESSION: going to about:blank creates null view This part of the fix makes sure that a renderer is created, even when there are no bytes of data passed through. This makes the empty document about:blank case work just like the "document with just whitespace in it case". There's another part of the fix in WebCore that takes care of the remaining problem. * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): Call receivedData:withDataSource: on the bridge with nil for the data. It would be even more elegant to add a new call for the case where we finish, but it's not necessary, since the existing receivedData: call does all the right things if passed nil. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _finishedLoading]): Call finishedLoadingWithDataSource: here, to make sure it's done after committing. This parallels what we already do for the didReceiveData call. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidFinishLoading:]): Remove the call to finishedLoadingWithDataSource: because it's handled by _finishedLoading now. This parallels what we already do for the didReceiveData call. - fixed long standing problem where resizing could make you see a "null view" * WebView.subproj/WebView.m: (-[WebView drawRect:]): Add a "paint cyan" feature in development builds. Null view problems are particularly hard to debug without something like this, and we don't care if development builds are slightly slower. No change in deployment. (-[WebView setFrameSize:]): Tell the scroll view to draw the background if we are resized. We can't do our "let the old bits show through" thing any more if we have to redraw because of resizing. - other changes * WebKit.pbproj/project.pbxproj: Remove the old -DAPPLE_CHANGES and -DHAVE_CONFIG_H that we once needed when WebKit used to compile C++ headers from the KHTML part of WebCore. We haven't needed those for ages. Also sort things a bit, using the new Electron feature for sorting lists of files alphabetically, and some by hand. * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2002-12-08 Chris Blumenberg <cblu@apple.com> Fixed: 3121627 - REGRESSION: partial progress is left in address field after download Reviewed by: darin In WebMainResourceClient, make sure to always call receivedError before _clearProvisionalDataSource so that receivedError works. This is done in multiple places, so I factored this out into one method interuptForPolicyChange. * WebView.subproj/WebControllerPrivate.m: (-[WebController _mainReceivedError:fromDataSource:]): added asserts for nil error, dataSource and frame * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient interruptForPolicyChange]): renamed from notifyDelegatesOfInterruptionByPolicyChange because it now also sets the provisionalDataSource on the frame to nil. (-[WebMainResourceClient stopLoadingForPolicyChange]): call interruptForPolicyChange, stop load (-[WebMainResourceClient continueAfterContentPolicy:response:]): call interruptForPolicyChange 2002-12-06 Trey Matteson <trey@apple.com> Clean up some printfs. Use WebKitLogPageCache for page cache info. Reviewed by: rjw * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): (-[WebFrame _purgePageCache]): (-[WebFrame _setState:]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]): 2002-12-06 Trey Matteson <trey@apple.com> 3118584 - implement desired behavior for load - reload - b/f 3119241 - page cache needs to be refreshed after reload 3118096 - isTargetItem:NO saved to disk with every bookmark The most noticeable changes are the addition of the "Same" loadType, and that reload does not restore form state. 3119241 was noticed in passing, and is related. 3118096 is a nit with a possible small perf benefit. Reviewed by: rjw * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem dealloc]): New originalURL field. (-[WebHistoryItem originalURL]): New getter. (-[WebHistoryItem setOriginalURL:]): New setter. (-[WebHistoryItem dictionaryRepresentation]): Dont save isTarget. (-[WebHistoryItem initFromDictionaryRepresentation:]): Dont save isTarget. * WebView.subproj/WebFrame.m: (-[WebFrame loadRequest:]): Test for going to same URL, invoke loadTypeSame case. * WebView.subproj/WebFramePrivate.h: Add loadTypeSame * WebView.subproj/WebFramePrivate.m: (-[WebFrame _addBackForwardItemClippedAtTarget:]): Remove a line of dead code. (-[WebFrame _createItem]): Set originalURL when item is created. (-[WebFrame _transitionToCommitted:]): For loadTypeSame, clear page cache (-[WebFrame _purgePageCache]): Added logging. (-[WebFrame _setState:]): Don't add to page cache if doing a reload. (-[WebFrame _isLoadComplete]): LoadTypeSame is a NOP. (-[WebFrame _loadItem:fromItem:withLoadType:]): LoadTypeSame is an ASSERT. (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): In the LoadTypeSame case load from origin and never do anchor nav. If asked to load the same URL, invoke LoadTypeSame case. (-[WebFrame _loadURL:intoChild:]): Latent bug: WebFrameLoadTypeReloadAllowingStaleData should restore child frame content like reload does. (-[WebFrame _itemForRestoringDocState]): Prevent form state restore on reload and loadSame. (-[WebFrame _shouldTreatURLAsSameAsCurrent:]): New utility function. 2002-12-06 Maciej Stachowiak <mjs@apple.com> Reviewed by: Darin Adler - made framework embedding work correctly with buildit * WebKit.pbproj/project.pbxproj: Give framework a relative install path, don't install it the normal way, and copy it manually to /AppleInternal/Library/Frameworks if installing. Also look for other frameworks in ${DSTROOT}/AppleInternal/Library/Frameworks. 2002-12-05 Darin Adler <darin@apple.com> Reviewed by Trey. - fixed 3103691 -- assertion in WebHTMLView addMouseMovedObserver at versiontracker * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addMouseMovedObserver]): Instead of asserting, do the checks here to determine if the observer should be installed. (-[WebHTMLView viewDidMoveToWindow]): Remove checks, since addMouseMovedObserver now checks. (-[WebHTMLView windowDidBecomeMain:]): Remove checks, since addMouseMovedObserver now checks. 2002-12-05 Richard Williamson <rjw@apple.com> Don't ceil spaces if not a fixed pitch font. This make sites that have hard coded block widths have less wrapping beyond what the designer expected. Fixes 3117225. Reviewed by: mjs * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (widthForGlyph): (-[WebTextRenderer _computeWidthForSpace]): (-[WebTextRenderer initWithFont:]): (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:letterSpacing:wordSpacing:fontFamilies:]): 2002-12-05 Chris Blumenberg <cblu@apple.com> Added WebDocumentText protocol. Made WebHTMLView and WebTextView implement it. Reviewed by: rjw * WebView.subproj/WebController.m: (-[WebController supportsTextEncoding]): check if protocol is WebDocumentText * WebView.subproj/WebDocument.h: * WebView.subproj/WebHTMLView.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView hasSelection]): call selectedString (-[WebHTMLView takeFindStringFromSelection:]): call selectedString (-[WebHTMLView selectAll:]): call selectAll (-[WebHTMLView string]): part of WebDocumentText protocol (-[WebHTMLView attributedString]): part of WebDocumentText protocol (-[WebHTMLView selectedString]): part of WebDocumentText protocol (-[WebHTMLView selectedAttributedString]): part of WebDocumentText protocol (-[WebHTMLView selectAll]): part of WebDocumentText protocol (-[WebHTMLView deselectAll]): part of WebDocumentText protocol * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _writeSelectionToPasteboard:]): call selectedAttributedString * WebView.subproj/WebTextView.h: * WebView.subproj/WebTextView.m: (-[WebTextView string]): part of WebDocumentText protocol (-[WebTextView attributedString]): part of WebDocumentText protocol (-[WebTextView selectedString]): part of WebDocumentText protocol (-[WebTextView selectedAttributedString]): part of WebDocumentText protocol (-[WebTextView selectAll]): part of WebDocumentText protocol (-[WebTextView deselectAll]): part of WebDocumentText protocol 2002-12-05 Darin Adler <darin@apple.com> Reviewed by Richard. - fixed 3107240 -- world leak: reproducible, trying to open TIFF file * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient notifyDelegatesOfInterruptionByPolicyChange]): Send error to the delegate using receivedError: rather than directly. This results in the frame properly stopping the load and fixes the leak. 2002-12-05 Darin Adler <darin@apple.com> Reviewed by Chris. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler initWithDataSource:]): Add WebGZipDecoder to the list. * Downloads.subproj/WebGZipDecoder.h: Finished this. * Downloads.subproj/WebGZipDecoder.m: Finished this. * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2002-12-05 Maciej Stachowiak <mjs@apple.com> Reviewed by: Darin * English.lproj/InfoPlist.strings: removed letters from CFBundleShortVersionString to make buildit happy. === Alexander-35 === 2002-12-05 Darin Adler <darin@apple.com> Reviewed by Ken. - fixed 3118647 -- REGRESSION: click policy no longer works * WebView.subproj/WebFramePrivate.m: (-[WebFrame _actionInformationForNavigationType:event:originalURL:]): Allow mouse up events too. Those are usually the ones that trigger navigation. 2002-12-04 Darin Adler <darin@apple.com> Reviewed by Maciej. - fixed assert when you choose an item from a menu, for example, and that navigates * WebView.subproj/WebFramePrivate.m: (-[WebFrame _actionInformationForNavigationType:event:originalURL:]): If the event is over some other element, just don't include the element info. 2002-12-04 Chris Blumenberg <cblu@apple.com> Fixed: 3116294 - Need "Reload" feature in Downloads window Reviewed by: rjw * WebKit.pbproj/project.pbxproj: made WebFramePrivate.h private so that WebBrowser can call _downloadRequest:toPath: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadDataSource:withLoadType:]): commented out assert that complains about lack of WebView. Long-term solution is to catch this earlier and have a lone datasource download mechanism 3118355. 2002-12-04 Trey Matteson <trey@apple.com> 3097585 - Crash in -[WebFrame(WebPrivate) _isLoadComplete] at result of google image search The root of this problem was that we would detach child frames by calling detach on them all, then clearing the whole array. This would fail because detaching a frame might have to stop a load, which calls checkLoadComplete, which visits the entire frame tree. But if a previously detached child is still sitting in that tree, we end up with an assertion failure. The solution is to remove the kids as they are detached. Reviewed by: Darin Adler * WebView.subproj/WebFramePrivate.m: (-[WebFrame _createItem]): Method rename (a nit I missed from an earlier change) (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]): Method rename (-[WebFrame _detachChildren]): new method to do detaching right (-[WebFrame _detachFromParent]): call new method (-[WebFrame _setDataSource:]): call new method (-[WebFrame _transitionToCommitted:]): Method rename 2002-12-04 Darin Adler <darin@apple.com> Reviewed by Trey and Maciej. - fixed 3117558 -- Assertion failure in KWQKHTMLPart::slotData after typing "amazon.com" twice - update NSEvent handling in preparation for NSView mouse event handling going through WebCore * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadItem:fromItem:withLoadType:]): Added FIXME comments about matching the _loadURL case more closely. (-[WebFrame _actionInformationForNavigationType:event:originalURL:]): Only use the event if it's a mouse down event. This prevents trouble when we have other kinds of events coming through. (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:request:]): Call the new scrollToAnchorWithURL: instead of openURL:. This fixes the assertion failure in the bug above. (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): Update checks here to more closely match the ones in KHTMLPart::openURL that we are replacing. Add more comments. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView hitTest:]): Function to intercept all clicks at the WebHTMLView level, disabled for now because we are not yet ready. - started a gzip download decoder, not yet hooked up * Downloads.subproj/WebGZipDecoder.h: Added. * Downloads.subproj/WebGZipDecoder.m: Added. * WebKit.pbproj/project.pbxproj: Add WebGZipDecoder and zlib. - other changes * Panels.subproj/WebAuthenticationPanel.m: Fixed screwed-up indentation. 2002-12-04 Richard Williamson <rjw@apple.com> Cache the fallback font in the same way we cache other fonts. Reviewed by: Darin * WebCoreSupport.subproj/WebTextRendererFactory.h: * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory fallbackFontWithTraits:size:]): (-[WebTextRendererFactory fontWithFamilies:traits:size:]): (-[WebTextRendererFactory cachedFontFromFamily:traits:size:]): 2002-12-04 Richard Williamson <rjw@apple.com> Fixed massive performance regression. We were leaking WebFontCacheKey. Added a cache of missing fonts to avoid expensive appkit lookup. Reviewed by: Maciej * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory cachedFontFromFamily:traits:size:]): (-[WebTextRendererFactory cachedFontFromFamilies:traits:size:]): 2002-12-03 Darin Adler <darin@apple.com> - fixed 3117193 -- REGRESSION: Hang on Hixie's weblog Reviewed by Maciej. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer substituteFontForString:families:]): Do the operation on the whole string at once instead of a character at a time. I decided to do this rather than correct the bug in the character-at-a-time version. == Rolled over to ChangeLog-2002-12-03 == ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Configurations/��������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024246�014074� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Configurations/Version.xcconfig����������������������������������������������������������0000644�0001750�0001750�00000005375�11260720067�017253� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2009 Apple 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 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 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. MAJOR_VERSION = 532; MINOR_VERSION = 2; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); // The bundle version and short version string are set based on the current build configuration, see below. BUNDLE_VERSION = $(BUNDLE_VERSION_$(CONFIGURATION)); SHORT_VERSION_STRING = $(SHORT_VERSION_STRING_$(CONFIGURATION)) // The system version prefix is based on the current system version. SYSTEM_VERSION_PREFIX = $(SYSTEM_VERSION_PREFIX_$(MAC_OS_X_VERSION_MAJOR)); SYSTEM_VERSION_PREFIX_ = 4; // Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR. SYSTEM_VERSION_PREFIX_1040 = 4; SYSTEM_VERSION_PREFIX_1050 = 5; SYSTEM_VERSION_PREFIX_1060 = 6; // The production build always uses the full version with a system version prefix. BUNDLE_VERSION_Production = $(SYSTEM_VERSION_PREFIX)$(FULL_VERSION); BUNDLE_VERSION_ = $(BUNDLE_VERSION_Production); // The production build always uses the major version with a system version prefix SHORT_VERSION_STRING_Production = $(SYSTEM_VERSION_PREFIX)$(MAJOR_VERSION); SHORT_VERSION_STRING_ = $(SHORT_VERSION_STRING_Production); // Local builds are the full version with a plus suffix. BUNDLE_VERSION_Release = $(FULL_VERSION)+; BUNDLE_VERSION_Debug = $(BUNDLE_VERSION_Release); // Local builds use the major version with a plus suffix SHORT_VERSION_STRING_Release = $(MAJOR_VERSION)+; SHORT_VERSION_STRING_Debug = $(SHORT_VERSION_STRING_Release); DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = $(FULL_VERSION); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Configurations/WebKit.xcconfig�����������������������������������������������������������0000644�0001750�0001750�00000006371�11173134617�017013� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2009 Apple 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 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 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. #include "FeatureDefines.xcconfig" #include "Version.xcconfig" EXPORTED_SYMBOLS_FILE = $(EXPORTED_SYMBOLS_FILE_$(CURRENT_ARCH)); EXPORTED_SYMBOLS_FILE_ = mac/WebKit.exp; EXPORTED_SYMBOLS_FILE_i386 = mac/WebKit.exp; EXPORTED_SYMBOLS_FILE_ppc = mac/WebKit.exp; EXPORTED_SYMBOLS_FILE_ppc64 = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/WebKit.LP64.exp; EXPORTED_SYMBOLS_FILE_x86_64 = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/WebKit.LP64.exp; FRAMEWORK_SEARCH_PATHS = $(UMBRELLA_FRAMEWORKS_DIR) $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks $(FRAMEWORK_SEARCH_PATHS); GCC_PREFIX_HEADER = mac/WebKitPrefix.h; GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) FRAMEWORK_NAME=WebKit WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST $(GCC_PREPROCESSOR_DEFINITIONS); HEADER_SEARCH_PATHS = $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders $(WEBCORE_PRIVATE_HEADERS_DIR)/icu "${BUILT_PRODUCTS_DIR}/usr/local/include" "${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit" $(HEADER_SEARCH_PATHS); INFOPLIST_FILE = mac/Info.plist; INSTALL_PATH = $(SYSTEM_LIBRARY_DIR)/Frameworks; INSTALLHDRS_COPY_PHASE = YES; INSTALLHDRS_SCRIPT_PHASE = YES; PRODUCT_NAME = WebKit; UMBRELLA_FRAMEWORKS_DIR = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks; OTHER_LDFLAGS = -sub_umbrella WebCore $(OTHER_LDFLAGS); WEBCORE_PRIVATE_HEADERS_DIR = $(WEBCORE_PRIVATE_HEADERS_DIR_$(REAL_PLATFORM_NAME)_$(CONFIGURATION)); WEBCORE_PRIVATE_HEADERS_DIR_macosx_Release = $(WEBCORE_PRIVATE_HEADERS_engineering); WEBCORE_PRIVATE_HEADERS_DIR_macosx_Debug = $(WEBCORE_PRIVATE_HEADERS_engineering); WEBCORE_PRIVATE_HEADERS_DIR_macosx_Production = $(UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders; WEBCORE_PRIVATE_HEADERS_engineering = $(BUILT_PRODUCTS_DIR)/WebCore.framework/PrivateHeaders; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Configurations/Base.xcconfig�������������������������������������������������������������0000644�0001750�0001750�00000007706�11211354567�016504� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2009 Apple 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 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 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. DEBUG_INFORMATION_FORMAT = dwarf; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DEBUGGING_SYMBOLS = default; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_CPP_EXCEPTIONS = NO; GCC_ENABLE_CPP_RTTI = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_ENABLE_OBJC_GC = supported; GCC_ENABLE_SYMBOL_SEPARATION = NO; GCC_FAST_OBJC_DISPATCH = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_MODEL_TUNING = G5; GCC_OBJC_CALL_CXX_CDTORS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_THREADSAFE_STATICS = NO; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; LINKER_DISPLAYS_MANGLED_NAMES = YES; OTHER_MIGFLAGS = -F$(BUILT_PRODUCTS_DIR); PREBINDING = NO; VALID_ARCHS = i386 ppc x86_64 ppc64; // FIXME: <rdar://problem/5070292> WebKit should build with -Wshorten-64-to-32 WARNING_CFLAGS = -Wall -Wextra -Wcast-align -Wchar-subscripts -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings; REAL_PLATFORM_NAME = $(REAL_PLATFORM_NAME_$(PLATFORM_NAME)); REAL_PLATFORM_NAME_ = $(REAL_PLATFORM_NAME_macosx); REAL_PLATFORM_NAME_macosx = macosx; // DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants. // We set up the values for each variant here, and have the Debug configuration in the Xcode project use the _debug variant. DEBUG_DEFINES_debug = DISABLE_THREAD_CHECK; DEBUG_DEFINES_normal = NDEBUG; DEBUG_DEFINES = $(DEBUG_DEFINES_$(CURRENT_VARIANT)); GCC_OPTIMIZATION_LEVEL = $(GCC_OPTIMIZATION_LEVEL_$(CURRENT_VARIANT)); GCC_OPTIMIZATION_LEVEL_normal = 2; GCC_OPTIMIZATION_LEVEL_debug = 0; STRIP_INSTALLED_PRODUCT = $(STRIP_INSTALLED_PRODUCT_$(CURRENT_VARIANT)); STRIP_INSTALLED_PRODUCT_normal = YES; STRIP_INSTALLED_PRODUCT_debug = NO; // Dead code stripping needs to be on in the debug variant to avoid link errors. This is due to unconditionally // building the MiG bindings for WebKitPluginClient even when the functions that the bindings wrap are not built. DEAD_CODE_STRIPPING = YES; SECTORDER_FLAGS = -sectorder __TEXT __text mac/WebKit.order; // Use GCC 4.2 with Xcode 3.1, which includes GCC 4.2 but defaults to GCC 4.0. // Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version // number. Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and // XCODE_VERSION_ACTUAL for the full version number. GCC_VERSION = $(GCC_VERSION_$(XCODE_VERSION_MINOR)); GCC_VERSION_ = $(GCC_VERSION_$(XCODE_VERSION_ACTUAL)); GCC_VERSION_0310 = 4.2; ����������������������������������������������������������WebKit/mac/Configurations/DebugRelease.xcconfig�����������������������������������������������������0000644�0001750�0001750�00000004242�11203253711�020137� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2009 Apple 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 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 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. #include "Base.xcconfig" ARCHS = $(ARCHS_$(MAC_OS_X_VERSION_MAJOR)); ARCHS_ = $(ARCHS_1040); ARCHS_1040 = $(NATIVE_ARCH); ARCHS_1050 = $(NATIVE_ARCH); ARCHS_1060 = $(ARCHS_STANDARD_32_64_BIT); ONLY_ACTIVE_ARCH = YES; MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(MAC_OS_X_VERSION_MAJOR)); MACOSX_DEPLOYMENT_TARGET_ = 10.4; MACOSX_DEPLOYMENT_TARGET_1040 = 10.4; MACOSX_DEPLOYMENT_TARGET_1050 = 10.5; MACOSX_DEPLOYMENT_TARGET_1060 = 10.6; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; SECTORDER_FLAGS = ; WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(MAC_OS_X_VERSION_MAJOR)); WEBKIT_SYSTEM_INTERFACE_LIBRARY_ = WebKitSystemInterfaceTiger; WEBKIT_SYSTEM_INTERFACE_LIBRARY_1040 = WebKitSystemInterfaceTiger; WEBKIT_SYSTEM_INTERFACE_LIBRARY_1050 = WebKitSystemInterfaceLeopard; WEBKIT_SYSTEM_INTERFACE_LIBRARY_1060 = WebKitSystemInterfaceSnowLeopard; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Configurations/FeatureDefines.xcconfig���������������������������������������������������0000644�0001750�0001750�00000007261�11261265163�020515� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2009 Apple Inc. All rights reserved. // Copyright (C) 2009 Google 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 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 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. // The contents of this file must be kept in sync with FeatureDefines.xcconfig in JavaScriptCore, // WebCore and WebKit. Also the default values of the ENABLE_FEATURE_NAME macros in build-webkit // should match the values below, but they do not need to be in the same order. // Set any ENABLE_FEATURE_NAME macro to an empty string to disable that feature. ENABLE_3D_CANVAS = $(ENABLE_3D_CANVAS_$(MAC_OS_X_VERSION_MAJOR)); ENABLE_3D_CANVAS_1050 = ENABLE_3D_CANVAS; ENABLE_3D_CANVAS_1060 = ENABLE_3D_CANVAS; ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(MAC_OS_X_VERSION_MAJOR)); ENABLE_3D_RENDERING_1050 = ENABLE_3D_RENDERING; ENABLE_3D_RENDERING_1060 = ENABLE_3D_RENDERING; ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING; ENABLE_DATABASE = ENABLE_DATABASE; ENABLE_DATAGRID = ENABLE_DATAGRID; ENABLE_DATALIST = ENABLE_DATALIST; ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE; ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE; ENABLE_FILTERS = ; ENABLE_GEOLOCATION = ; ENABLE_ICONDATABASE = ENABLE_ICONDATABASE; ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER; ENABLE_MATHML = ; ENABLE_NOTIFICATIONS = ; ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS; ENABLE_RUBY = ENABLE_RUBY; ENABLE_SHARED_WORKERS = ENABLE_SHARED_WORKERS; ENABLE_SVG = ENABLE_SVG; ENABLE_SVG_ANIMATION = ENABLE_SVG_ANIMATION; ENABLE_SVG_AS_IMAGE = ENABLE_SVG_AS_IMAGE; ENABLE_SVG_DOM_OBJC_BINDINGS = ENABLE_SVG_DOM_OBJC_BINDINGS; ENABLE_SVG_FONTS = ENABLE_SVG_FONTS; ENABLE_SVG_FOREIGN_OBJECT = ENABLE_SVG_FOREIGN_OBJECT; ENABLE_SVG_USE = ENABLE_SVG_USE; ENABLE_VIDEO = ENABLE_VIDEO; ENABLE_WEB_SOCKETS = ENABLE_WEB_SOCKETS; ENABLE_WML = ; ENABLE_WORKERS = ENABLE_WORKERS; ENABLE_XPATH = ENABLE_XPATH; ENABLE_XSLT = ENABLE_XSLT; FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XPATH) $(ENABLE_XSLT); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Workers/���������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024250�012531� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Workers/WebWorkersPrivate.h��������������������������������������������������������������0000644�0001750�0001750�00000003307�11242563150�016333� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Google 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: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 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. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "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 THE COPYRIGHT * OWNER 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. */ @interface WebWorkersPrivate : NSObject { } // Returns the total number of currently executing worker threads (shared + dedicated). + (unsigned) workerThreadCount; @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Workers/WebWorkersPrivate.mm�������������������������������������������������������������0000644�0001750�0001750�00000003416�11242563150�016516� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Google 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: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 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. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "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 THE COPYRIGHT * OWNER 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 "WebWorkersPrivate.h" #import <WebCore/WorkerThread.h> @implementation WebWorkersPrivate + (unsigned) workerThreadCount { #if ENABLE_WORKERS return WebCore::WorkerThread::workerThreadCount(); #else return 0; #endif } @end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Info.plist�������������������������������������������������������������������������������0000644�0001750�0001750�00000001472�11133426166�013056� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>${PRODUCT_NAME}</string> <key>CFBundleGetInfoString</key> <string>${BUNDLE_VERSION}, Copyright 2003-2009 Apple Inc.</string> <key>CFBundleIdentifier</key> <string>com.apple.${PRODUCT_NAME}</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>${PRODUCT_NAME}</string> <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> <string>${SHORT_VERSION_STRING}</string> <key>CFBundleVersion</key> <string>${BUNDLE_VERSION}</string> </dict> </plist> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ChangeLog��������������������������������������������������������������������������������0000644�0001750�0001750�00003116435�11262231477�012673� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������2009-10-04 Kevin Decker <kdecker@apple.com> Reviewed by Cameron Zwarich. * WebView/WebPreferenceKeysPrivate.h: Added new key. * WebView/WebPreferences.mm: (+[WebPreferences initialize]): Leave plug-in halting disabled by default. (-[WebPreferences pluginHalterEnabled]): Added. (-[WebPreferences setPluginHalterEnabled:]): Ditto. * WebView/WebPreferencesPrivate.h: Added above new methods. 2009-10-02 Dave Hyatt <hyatt@apple.com> Reviewed by Adam Roben. Add support for blacklist patterns to user stylesheets and scripts in addition to whitelist patterns. * WebView/WebView.mm: (toStringVector): (+[WebView _addUserScriptToGroup:source:url:worldID:whitelist:blacklist:injectionTime:]): (+[WebView _addUserStyleSheetToGroup:source:url:worldID:whitelist:blacklist:]): * WebView/WebViewPrivate.h: 2009-10-01 Mark Rowe <mrowe@apple.com> Fix the Tiger build. Don't unconditionally enable 3D canvas as it is not supported on Tiger. * Configurations/FeatureDefines.xcconfig: 2009-10-01 Chris Marrin <cmarrin@apple.com> Reviewed by Oliver Hunt. Turn on ENABLE_3D_CANVAS in TOT https://bugs.webkit.org/show_bug.cgi?id=29906 * Configurations/FeatureDefines.xcconfig: * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences webGLEnabled]): (-[WebPreferences setWebGLEnabled:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2009-09-30 Sam Weinig <sam@webkit.org> Reviewed by Dan Bernstein. Fix for <rdar://problem/7259706> Need WebKit API or SPI on Mac and Windows to test whether it's safe to load a page in a new tab/window * WebView/WebFrame.mm: (-[WebFrame _allowsFollowingLink:]): * WebView/WebFramePrivate.h: 2009-09-30 Dave Hyatt <hyatt@apple.com> Reviewed by Adam Roben. Add the ability to remove user stylesheets and scripts by URL. * WebView/WebView.mm: (+[WebView _removeUserContentFromGroup:url:worldID:]): * WebView/WebViewPrivate.h: 2009-09-29 Brady Eidson <beidson@apple.com> Rubberstamped by Dan Bernstein. Fix license and some sorting in new files. * WebView/WebHistoryDelegate.h: * WebView/WebNavigationData.h: * WebView/WebNavigationData.mm: 2009-09-29 Brady Eidson <beidson@apple.com> Reviewed by John Sullivan. WebKit Mac API should provide a delegate interface for global history. <rdar://problem/7042773> and https://webkit.org/b/29904 * WebView/WebHistoryDelegate.h: Added. New interface for WebKit clients to implement to manage their own global history store. Object to store all of the bits of data relevant to a page visit: * WebView/WebNavigationData.h: Added. * WebView/WebNavigationData.mm: Added. (-[WebNavigationDataPrivate dealloc]): (-[WebNavigationData initWithURLString:title:originalRequest:response:hasSubstituteData:clientRedirectSource:]): (-[WebNavigationData url]): (-[WebNavigationData title]): (-[WebNavigationData originalRequest]): (-[WebNavigationData response]): (-[WebNavigationData hasSubstituteData]): (-[WebNavigationData clientRedirectSource]): (-[WebNavigationData dealloc]): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::updateGlobalHistory): If the delegate exists, don't use the built-in WebHistory. If the implementation for this method exists, call it. (WebFrameLoaderClient::updateGlobalHistoryRedirectLinks): Ditto * WebView/WebDelegateImplementationCaching.h: * WebView/WebDelegateImplementationCaching.mm: (WebViewGetHistoryDelegateImplementations): (CallHistoryDelegate): * WebView/WebView.mm: (-[WebView _cacheHistoryDelegateImplementations]): (-[WebView setHistoryDelegate:]): (-[WebView historyDelegate]): * WebView/WebViewData.h: * WebView/WebViewPrivate.h: 2009-09-29 Kenneth Russell <kbr@google.com> Reviewed by Dimitri Glazkov. Add support for run-time flag for 3D canvas https://bugs.webkit.org/show_bug.cgi?id=29826 * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Enable experimental WebGL flag when 3D_CANVAS is enabled in the build. 2009-09-28 Fumitoshi Ukai <ukai@chromium.org> Reviewed by Eric Seidel. Add experimentalWebSocketsEnabled in WebPreferences. https://bugs.webkit.org/show_bug.cgi?id=28941 * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences experimentalWebSocketsEnabled]): (-[WebPreferences setExperimentalWebSocketsEnabled:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2009-09-28 Dan Bernstein <mitz@apple.com> Reviewed by Anders Carlsson. <rdar://problem/7240911> REGRESSION (r48586): Crash occurs when loading a PDF CGPDFObjectRef is not a CFTypeRef, and cannot be retained or released. Its lifetime is managed by its container. Just use a Vector to store CGPDFObjectRefs, relying on the CGPDFDocument to keep them alive. * WebView/WebPDFDocumentExtras.mm: (appendValuesInPDFNameSubtreeToVector): (getAllValuesInPDFNameTree): (web_PDFDocumentAllScripts): 2009-09-24 Jon Honeycutt <jhoneycutt@apple.com> Reviewed by Alice Liu. * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): Pass 0 for new Page constructor argument. 2009-09-14 John Gregg <johnnyg@google.com> Reviewed by Eric Seidel. isEnabled switch for notifications (experimental) in Page Settings https://bugs.webkit.org/show_bug.cgi?id=28930 Adds support for the experimentalNotificationsEnabled flag in Settings through WebPreferencesPrivate. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences experimentalNotificationsEnabled]): (-[WebPreferences setExperimentalNotificationsEnabled:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2009-09-23 Geoffrey Garen <ggaren@apple.com> Reviewed by Sam Weinig. Updated for a WebCore rename. * WebView/WebFrame.mm: (-[WebFrame _cacheabilityDictionary]): 2009-09-23 Darin Adler <darin@apple.com> Reviewed by Dan Bernstein. Speed up access to history items by caching date computation. * History/WebHistory.mm: (getDayBoundaries): Refactored from timeIntervalForBeginningOfDay. Returns the beginning of the day that the passed time is within and the beginning of the next day. (beginningOfDay): Added. Uses getDayBoundaries so it can be fast for multiple dates within the same day, which is the common case. (dateKey): Added. Calls beginningOfDay and converts to an integer. (-[WebHistoryPrivate findKey:forDay:]): Changed to call dateKey insetad of timeIntervalForBeginningOfDay. 2009-09-23 David Kilzer <ddkilzer@apple.com> Move definition of USE(PLUGIN_HOST_PROCESS) from WebKitPrefix.h to Platform.h Reviewed by Mark Rowe. * WebKitPrefix.h: Removed definition of WTF_USE_PLUGIN_HOST_PROCESS. 2009-09-22 Timothy Hatcher <timothy@apple.com> Prevent scrolling multiple frames during latched wheel events. Reviewed by Anders Carlsson. * WebView/WebDynamicScrollBarsView.h: * WebView/WebDynamicScrollBarsView.mm: (-[WebDynamicScrollBarsView scrollWheel:]): 2009-09-22 Dan Bernstein <mitz@apple.com> Reviewed by John Sullivan. <rdar://problem/7240911> REGRESSION (r48586): Crash occurs when loading a PDF * WebView/WebPDFDocumentExtras.mm: (addWebPDFDocumentExtras): Made methodList static, because class_addMethods() doesn't copy it. 2009-09-21 Dan Bernstein <mitz@apple.com> Attempt to fix the Tiger build * WebView/WebPDFDocumentExtras.mm: (addWebPDFDocumentExtras): 2009-09-21 Dan Bernstein <mitz@apple.com> Attempt to fix the Tiger build * WebView/WebPDFDocumentExtras.mm: (web_PDFDocumentAllScripts): (addWebPDFDocumentExtras): 2009-09-21 Dan Bernstein <mitz@apple.com> Attempt to fix the Tiger build * WebView/WebPDFDocumentExtras.mm: * WebView/WebPDFRepresentation.mm: 2009-09-21 Dan Bernstein <mitz@apple.com> Attempt to fix the Leopard and Tiger builds * WebView/WebPDFDocumentExtras.mm: 2009-09-21 Dan Bernstein <mitz@apple.com> Reviewed by Anders Carlsson. <rdar://problem/4137135> iFrame with PDF not being handled correctly on usps.com https://bugs.webkit.org/show_bug.cgi?id=4151 * WebView/WebJSPDFDoc.h: Added. * WebView/WebJSPDFDoc.mm: Added. (jsPDFDocInitialize): Retains the WebDataSource. (jsPDFDocFinalize): Releases the WebDataSource. (jsPDFDocPrint): Call the WebUIDelegate method -webView:printFrameView: with the PDF document's view. (makeJSPDFDoc): Makes and returns a JavaScript Doc instance that wraps the WebDataSource. * WebView/WebPDFDocumentExtras.h: Added. * WebView/WebPDFDocumentExtras.mm: Added. (appendValuesInPDFNameSubtreeToArray): Traverses a subtree of a PDF name tree and adds all values in the subtree to an array. (allValuesInPDFNameTree): Returns an array with all of the values in a PDF name tree. (web_PDFDocumentAllScripts): This is the implementation of -[PDFDocument _web_allScripts]. It gets all values in the document-level "JavaScript" name tree, which are action dictionaries, and returns an array of the actions' scripts. (addWebPDFDocumentExtras): Adds the -_web_allScripts method to PDFDocument. * WebView/WebPDFRepresentation.h: * WebView/WebPDFRepresentation.m: Removed. * WebView/WebPDFRepresentation.mm: Copied from WebKit/mac/WebView/WebPDFRepresentation.m. (+[WebPDFRepresentation initialize]): Added. Calls addWebPDFDocumentExtras(). (-[WebPDFRepresentation finishedLoadingWithDataSource:]): Get the scripts from the PDF document, create a JavaScript Doc object for the document, and a JavaScript execution context, then execute every script in the context, with the Doc object as "this". 2009-09-17 Simon Fraser <simon.fraser@apple.com> Reviewed by Dave Hyatt. Compositing layers are incorrectly positioned after scrolling with position:fixed https://bugs.webkit.org/show_bug.cgi?id=29262 When scrolling a page with compositing layers inside a position:fixed element, we need to update the compositing layer positions when the scroll position changes. * WebView/WebHTMLView.mm: (-[WebHTMLView _frameOrBoundsChanged]): Call the new FrameView::scrollPositionChanged() method rather than sending the scroll event directly. 2009-09-17 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Simon Hausmann. Make PlatformWindow return something else than PlatformWidget https://bugs.webkit.org/show_bug.cgi?id=29085 Reflect the rename of platformWindow and it's return type. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::platformPageClient): 2009-09-17 Anders Carlsson <andersca@apple.com> Reviewed by Oliver Hunt. <rdar://problem/7007541> CrashTracer: 4800+ crashes in Safari at com.apple.WebKit • WTF::HashTableIterator... Add null checks for m_instanceProxy (It will be null when a plug-in has crashed). * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::invoke): (WebKit::ProxyInstance::supportsInvokeDefaultMethod): (WebKit::ProxyInstance::supportsConstruct): (WebKit::ProxyInstance::getPropertyNames): (WebKit::ProxyInstance::methodsNamed): (WebKit::ProxyInstance::fieldNamed): (WebKit::ProxyInstance::fieldValue): (WebKit::ProxyInstance::setFieldValue): (WebKit::ProxyInstance::invalidate): 2009-09-16 Simon Fraser <simon.fraser@apple.com> Reviewed by Dan Bernstein. Work around a bug in AppKit on Leopard which causes compositing layers to jitter, and become misplaced when the WebHTMLView is resized or scrolled sometimes. <rdar://problem/7071636> The previous fix didn't fix the case where the layers jiggle when resizing the docked inspector when the view size is over 2048px tall, on Leopard. * WebView/WebHTMLView.mm: (-[WebHTMLView _updateLayerHostingViewPosition]): 2009-09-16 Simon Fraser <simon.fraser@apple.com> Reviewed by Oliver Hunt. Work around a bug in AppKit on Leopard which causes compositing layers to jitter, and become misplaced when the WebHTMLView is resized or scrolled sometimes. <rdar://problem/7071636> We call an internal AppKit method to make sure the layer geometry is updated correctly. * WebView/WebHTMLView.mm: (-[WebHTMLView _updateLayerHostingViewPosition]): 2009-09-15 Simon Fraser <simon.fraser@apple.com> Reviewed by Dan Bernstein. Fixed position elements flash when CSS transforms are applied on page > 2048px tall https://bugs.webkit.org/show_bug.cgi?id=27272 Update the previous workaround for misplaced compositing layers, which used a 4096px threshold, to 2048px since that's the GPU max texture size on some older hardware. * WebView/WebHTMLView.mm: (-[WebHTMLView _updateLayerHostingViewPosition]): 2009-09-15 Alex Milowski <alex@milowski.com> Reviewed by Tor Arne Vestbø. Added the ENABLE_MATHML to the feaure defines * Configurations/FeatureDefines.xcconfig: 2009-09-15 Mark Rowe <mrowe@apple.com> Reviewed by Anders Carlsson. <rdar://problem/7224378> REGRESSION(r48360): Dragging a tab with a plug-in out of a window, the plug-in gets slow and confused In r48360, the fix for <rdar://problem/7090444>, I neglected to consider the case where the plug-in had already been started and -start would do an early-return rather than calling -restartTimers and -addWindowObservers itself. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView viewDidMoveToWindow]): Reinstate the call to -restartTimers and -addWindowObservers, but guard them with a check that the view is still in the window. 2009-09-14 Brady Eidson <beidson@apple.com> Reviewed by Alexey Proskuryakov. Safari 4 cannot be used to update firmware on Linksys routers. <rdar://problem/7174050> and https://bugs.webkit.org/show_bug.cgi?id=29160 Adopt the new WebCore::CredentialStorage in WebKit/Mac. * Misc/WebDownload.mm: (-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]): * Plugins/WebBaseNetscapePluginView.mm: (WebKit::getAuthenticationInfo): 2009-09-12 Mark Rowe <mrowe@apple.com> Reviewed by Anders Carlsson. Fix <rdar://problem/7090444> Crashes in-[WebBaseNetscapePluginView stop] handling NSWindowWillCloseNotification. It's not valid to call -addWindowObservers when the view is not in a window, but this can happen when -start initializes a plug-in and the plug-in removes itself from the document during initialization. -viewDidMoveToWindow calls -start and then calls -addWindowObservers without ensuring that the view is still in a window. If -[WebBaseNetscapePluginView addWindowObservers] is incorrectly called when the view is not in a window, it will observe NSWindowWillCloseNotification on all windows. This unexpected observer registration is not balanced by an unregistration so the notification can be delivered after the view is deallocated, causing the crash seen in <rdar://problem/7090444>. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView start]): Only call -updateAndSetWindow if we still have a current window. (-[WebBaseNetscapePluginView viewDidMoveToWindow]): Remove unnecessary calls to -restartTimers and -addWindowObservers from -[WebBaseNetscapePluginView viewDidMoveToWindow]. They are already called from within -start with the extra benefit of ensuring that the view is still in a window when they are called. 2009-09-11 Mark Rowe <mrowe@apple.com> Reviewed by Jon Honeycutt. Fix <rdar://problem/7145242> Crashes inside WTF::HashTable below NetscapePluginInstanceProxy::disconnectStream * Plugins/Hosted/HostedNetscapePluginStream.mm: (WebKit::HostedNetscapePluginStream::cancelLoad): Canceling the load can result in calling through to disconnectStream. If the plug-in instance holds the last reference to the plug-in stream this will result in the stream being deallocated. This leads to HostedNetscapePluginStream::cancelLoad's call to disconnectStream being passed a deallocated stream object. Since the stream was already disconnected by the call to cancel there's no need to call disconnectStream a second time. 2009-09-11 Eric Seidel <eric@webkit.org> No review, rolling out r48229. http://trac.webkit.org/changeset/48229 * WebView/WebFrame.mm: (-[WebFrame _dragSourceMovedTo:]): 2009-09-10 Mark Rowe <mrowe@apple.com> Rubber-stamped by Sam Weinig. Update JavaScriptCore and WebKit's FeatureDefines.xcconfig so that they are in sync with WebCore as they need to be. * Configurations/FeatureDefines.xcconfig: 2009-09-09 Jens Alfke <snej@chromium.org> Reviewed by Eric Seidel. Initialize DataTransfer's effectAllowed and dropEffect properties correctly according to HTML5 spec (sec. 7.9.2-7.9.3). https://bugs.webkit.org/show_bug.cgi?id=26700 * WebView/WebFrame.mm: (-[WebFrame _dragSourceMovedTo:]): Pass current drag operation (if known) to EventHandler::dragSourceMovedTo(). 2009-09-09 Dave Hyatt <hyatt@apple.com> Reviewed by Adam Roben. https://bugs.webkit.org/show_bug.cgi?id=29102, add support for user stylesheet injection. This is similar to user script injection but allows for user stylesheets to be added. The stylesheets are applied immediately to all Frames in the PageGroup. Added userscripts/simple-stylesheet.html test case. * WebView/WebView.mm: (+[WebView _addUserStyleSheetToGroup:source:url:worldID:patterns:]): * WebView/WebViewPrivate.h: 2009-09-07 Steve Block <steveblock@google.com> Reviewed by Adam Barth. Adds a mock Geolocation service. This will be used to provide predictable behavior of the Geolocation API for use in LayoutTests. Later changes will integrate the the mock Geolocation service with DumpRenderTree. https://bugs.webkit.org/show_bug.cgi?id=28264 * WebCoreSupport/WebGeolocationMockPrivate.h: Added. * WebCoreSupport/WebGeolocationMock.mm: Added. (+[WebGeolocationMock setError:code:]): Added. Used by DumpRender tree to configure the mock Geolocation service. (+[WebGeolocationMock setPosition:latitude:longitude:accuracy:]): Added. Used by DumpRender tree to configure the mock Geolocation service. * WebKit.exp: Modified. Exports WebGeolocationMock. 2009-09-07 Drew Wilson <atwilson@google.com> Reviewed by David Levin. Enable SHARED_WORKERS by default. https://bugs.webkit.org/show_bug.cgi?id=28959 * Configurations/FeatureDefines.xcconfig: 2009-09-06 Cameron McCormack <cam@mcc.id.au> Reviewed by Eric Seidel. Drop <definition-src> support https://bugs.webkit.org/show_bug.cgi?id=28991 * MigrateHeaders.make: Remove reference to ObjC definition-src binding class. 2009-09-04 Mark Mentovai <mark@chromium.org> Reviewed by Dave Hyatt. https://bugs.webkit.org/show_bug.cgi?id=28614 Account for scrollbar state changes that occur during layout. * WebView/WebDynamicScrollBarsView.mm: (-[WebDynamicScrollBarsView updateScrollers]): Perform a layout prior to checking whether the scrollbar modes are off, on, or automatic. The modes may change during layout. * WebView/WebFrameView.mm: (-[WebFrameView _install]): Eliminate duplicated (and incorrect) scrollbar mode tracking between FrameView and ScrollView. 2009-09-03 Dave Hyatt <hyatt@apple.com> Reviewed by Adam Roben. https://bugs.webkit.org/show_bug.cgi?id=28890, make simple user script injection work. This patch adds new API for adding and removing user scripts from page groups. User scripts are bundled together in isolated worlds (you can have multiple scripts together in the same world). Added userscripts/ directory for holding new tests (along with a simple test of script injection). * WebView/WebView.mm: (+[WebView _addUserScriptToGroup:source:url:worldID:patterns:injectionTime:]): (+[WebView _removeUserContentFromGroup:worldID:]): (+[WebView _removeAllUserContentFromGroup:]): * WebView/WebViewPrivate.h: 2009-09-04 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. https://bugs.webkit.org/show_bug.cgi?id=24696 Plumb mixed content notifications to WebFrameLoadDelegatePrivate. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::didDisplayInsecureContent): (WebFrameLoaderClient::didRunInsecureContent): * WebView/WebDelegateImplementationCaching.h: * WebView/WebFrameLoadDelegatePrivate.h: Added. 2009-09-03 Adam Barth <abarth@webkit.org> Unreviewed build fix. Change notImplemented() to a FIXME. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::didDisplayInsecureContent): (WebFrameLoaderClient::didRunInsecureContent): 2009-09-03 Adam Barth <abarth@webkit.org> Reviewed by eric@webkit.org. https://bugs.webkit.org/show_bug.cgi?id=24696 Plumb mixed content notifications to WebFrameLoadDelegatePrivate. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::didDisplayInsecureContent): (WebFrameLoaderClient::didRunInsecureContent): * WebView/WebDelegateImplementationCaching.h: * WebView/WebFrameLoadDelegatePrivate.h: Added. 2009-09-03 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. https://bugs.webkit.org/show_bug.cgi?id=24696 Stub implementations of mixed content methods of FrameLoaderClient. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::didDisplayInsecureContent): (WebFrameLoaderClient::didRunInsecureContent): 2009-09-02 Brady Eidson <beidson@apple.com> Reviewed by Darin Adler. More partial work towards "Page Cache should support pages with Frames" https://bugs.webkit.org/show_bug.cgi?id=13631 * WebView/WebHTMLView.mm: (-[WebHTMLView _topHTMLView]): Rework the ASSERT in this method to reflect the reality of calling this method for pages currently in the PageCache. 2009-08-31 Dimitri Glazkov <dglazkov@chromium.org> Reverting http://trac.webkit.org/changeset/47904, because it caused layout test failure. 2009-08-31 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=28852 Rename KURL single argument constructor to avoid confusion * WebView/WebScriptDebugger.mm: (toNSURL): Adapt to the change. 2009-08-31 Mark Mentovai <mark@chromium.org> Reviewed by Dave Hyatt. https://bugs.webkit.org/show_bug.cgi?id=28614 Perform a layout prior to checking whether the scrollbar modes are off, on, or automatic. The modes may change during layout. * WebView/WebDynamicScrollBarsView.mm: (-[WebDynamicScrollBarsView updateScrollers]): 2009-08-28 Chris Fleizach <cfleizach@apple.com> Reviewed by John Sullivan. update-webkit-localizable-strings script can no longer complete https://bugs.webkit.org/show_bug.cgi?id=28792 * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory AXARIAContentGroupText:]): 2009-08-28 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> Reviewed by Holger Freyther. https://bugs.webkit.org/show_bug.cgi?id=25889 [GTK] scrollbar policy for main frame is not implementable Add empty implementation for new ChromeClient method. * WebCoreSupport/WebChromeClient.h: (WebChromeClient::scrollbarsModeDidChange): 2009-08-25 Eric Carlson <eric.carlson@apple.com> Reviewed by Oliver Hunt. <video> and <audio> controller should be accessible https://bugs.webkit.org/show_bug.cgi?id=28081 * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory localizedMediaControlElementString:]): (-[WebViewFactory localizedMediaControlElementHelpText:]): (-[WebViewFactory localizedMediaTimeDescription:]): New. 2009-08-24 Simon Fraser <simon.fraser@apple.com> Reviewed by NOBODY (build fix) Turn off ENABLE_3D_CANVAS in the xconfig files. * Configurations/FeatureDefines.xcconfig: 2009-08-22 Adam Barth <abarth@webkit.org> Revert 47684. We're going to do this later once clients have had a chance to opt into the setting they like. * Misc/WebKitVersionChecks.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): 2009-08-22 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Don't let local files access web URLs https://bugs.webkit.org/show_bug.cgi?id=28480 * Misc/WebKitVersionChecks.m: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): 2009-08-21 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. <rdar://problem/7162480> Sometimes WebKit does not layout correctly when a WebView is embedded in an HICocoaView Add a null check for the current context when reflectScrolledClipView: is called from outside a draw operation. * WebView/WebDynamicScrollBarsView.mm: (-[WebDynamicScrollBarsView reflectScrolledClipView:]): 2009-08-20 Chris Fleizach <cfleizach@apple.com> Reviewed by Darin Adler. Enable various "grouping" ARIA roles https://bugs.webkit.org/show_bug.cgi?id=28486 * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory AXARIAContentGroupText:]): 2009-08-19 Mark Rowe <mrowe@apple.com> Reviewed by Dan Bernstein. Fix <http://webkit.org/b/28484> Plug-in-related leaks seen on the build bot When the plug-in data is being loaded manually there is a reference cycle between the NetscapePluginInstanceProxy and the HostedNetscapePluginStream. We need to explicitly break the reference cycle in NetscapePluginInstanceProxy::cleanup so that both objects will be destroyed. Take the opportunity to add RefCountedLeakCounter support to HostedNetscapePluginStream and NetscapePluginInstanceProxy to simplify tracking down leaks of these objects in the future. * Plugins/Hosted/HostedNetscapePluginStream.h: * Plugins/Hosted/HostedNetscapePluginStream.mm: (WebKit::HostedNetscapePluginStream::HostedNetscapePluginStream): (WebKit::HostedNetscapePluginStream::~HostedNetscapePluginStream): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): (WebKit::NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy): (WebKit::NetscapePluginInstanceProxy::cleanup): Clear m_manualStream to break the reference cycle. 2009-08-19 Aaron Boodman <aa@chromium.org> Reviewed by David Levin. https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to specify a more granular policy for cross-origin XHR access. * WebView/WebView.mm: Add SPI to manipulate origin access whitelists. (+[WebView _whiteListAccessFromOrigin:destinationProtocol:destinationHost:allowDestinationSubdomains:]): Ditto. (+[WebView _resetOriginAccessWhiteLists]): Ditto. * WebView/WebViewPrivate.h: Ditto. 2009-08-18 Anders Carlsson <andersca@apple.com> Reviewed by Adele Peterson. Mac specific part of <rdar://problem/7135588> HTMLMediaElement should ask WebPolicyLoadDelegate before loading resource * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: Implement shouldLoadMediaElementURL by asking the policy delegate. * WebView/WebPolicyDelegatePrivate.h: Add new delegate method, remove some unused cruft. 2009-08-18 Drew Wilson <atwilson@google.com> Reviewed by Eric Seidel. Need to extend DumpRenderTree to expose number of worker threads. https://bugs.webkit.org/show_bug.cgi?id=28292 * WebKit.exp: Exported WebWorkersPrivate so DumpRenderTree can access it. * Workers/WebWorkersPrivate.h: Added. * Workers/WebWorkersPrivate.mm: Added. (+[WebWorkersPrivate workerThreadCount]): Added WebWorkersPrivate::workerThreadCount() API for DumpRenderTree. 2009-08-17 Darin Adler <darin@apple.com> Reviewed by Sam Weinig. Use a HashMap instead of a list of if statements for the command name exception map. * WebView/WebHTMLView.mm: (createSelectorExceptionMap): Added. (commandNameForSelector): Use createSelectorExceptionMap. 2009-08-16 David Kilzer <ddkilzer@apple.com> <http://webkit.org/b/28366> WebHTMLViewInternal.h: add @class CALayer declaration Reviewed by Simon Fraser. Without WebKitPrefix.h, the missing @class CALayer declaration causes a compile-time error. * WebView/WebHTMLViewInternal.h: Added @class CALayer declaration with USE(ACCELERATED_COMPOSITING). 2009-08-16 David Kilzer <ddkilzer@apple.com> <http://webkit.org/b/28355> Replace MAX()/MIN() macros with type-safe std::max()/min() templates Reviewed by Dan Bernstein. * Plugins/WebBaseNetscapePluginStream.mm: Added using std::min statement. (WebNetscapePluginStream::deliverData): Changed MIN() to min(). Changed C-style cast to a static_cast. * Plugins/WebNetscapePluginView.mm: Added using std::min statement. (-[WebNetscapePluginView _postURL:target:len:buf:file:notifyData:sendNotification:allowHeaders:]): Changed MIN() to min(). Changed C-style cast to a static_cast. * WebView/WebHTMLView.mm: Added using std::max statement. (-[WebHTMLView _dragImageForURL:withLabel:]): Changed MAX() to max(). (-[WebHTMLView _scaleFactorForPrintOperation:]): Ditto. * WebView/WebTextCompletionController.mm: Added using std::max and using std::min statements. (-[WebTextCompletionController _placePopupWindow:]): Changed type of maxWidth variable from float to CGFloat to prevent a type mismatch on x86_64. Changed MAX() to max() and MIN() to min(). Added static_cast for a constant value since CGFloat is defined as a float on i386 and as a double on x86_64. 2009-08-15 Adam Bergkvist <adam.bergkvist@ericsson.com> Reviewed by Sam Weinig. Added ENABLE_EVENTSOURCE flag. https://bugs.webkit.org/show_bug.cgi?id=14997 * Configurations/FeatureDefines.xcconfig: 2009-08-14 Mark Rowe <mrowe@apple.com> Build fix. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::enumerate): Add the necessary .get() calls. 2009-08-14 Brady Eidson <beidson@apple.com> Reviewed by Anders Carlsson. <rdar://problem/7091546> - Assertion failure in plugins/return-error-from-new-stream-doesnt-invoke-destroy-stream.html on 64-bit SnowLeopard * Plugins/Hosted/HostedNetscapePluginStream.mm: (WebKit::HostedNetscapePluginStream::cancelLoad): Since this might be called while the FrameLoader is switching DocumentLoaders during the brief moment where there is no activeDocumentLoader(), accept and handle a validly null DocumentLoader. 2009-08-14 Mark Rowe <mrowe@apple.com> Reviewed by Brady Eidson. Fix leaks of NSNumber and NSMutableArray objects seen during layout tests. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::enumerate): Don't leak an NSMutableArray that we allocate. 2009-08-14 Mark Rowe <mrowe@apple.com> Reviewed by Anders Carlsson. Fix leaks of HostedNetscapePluginStream and NetscapePlugInStreamLoader objects seen during layout tests. * Plugins/Hosted/HostedNetscapePluginStream.mm: (WebKit::HostedNetscapePluginStream::didFail): Disconnect the stream from the plug-in instance proxy when the load fails. 2009-08-13 Darin Adler <darin@apple.com> * Plugins/Hosted/NetscapePluginInstanceProxy.mm: Updated includes. * WebView/WebScriptDebugger.mm: Ditto. 2009-08-12 Mark Rowe <mrowe@apple.com> Reviewed by Kevin Decker. <rdar://problem/6017913> Replace use of HISearchWindowShow in -[WebView _searchWithSpotlightFromMenu]. * WebView/WebView.mm: (-[WebView _searchWithSpotlightFromMenu:]): Use -[NSWorkspace showSearchResultsForQueryString:] post-Leopard. 2009-08-12 Greg Bolsinga <bolsinga@apple.com> Reviewed by Eric Seidel. Add delegate methods about focus and blur and state change https://bugs.webkit.org/show_bug.cgi?id=27153 Have ObjC delegate methods match C++ method names in the ChromeClient. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::formDidFocus): (WebChromeClient::formDidBlur): * WebView/WebUIDelegatePrivate.h: 2009-08-11 John Gregg <johnnyg@google.com> Reviewed by Maciej Stachowiak. Desktop Notifications API https://bugs.webkit.org/show_bug.cgi?id=25643 Adds ENABLE_NOTIFICATION flag. * Configurations/FeatureDefines.xcconfig: 2009-08-11 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Remove dead declarations. * WebView/WebViewInternal.h: 2009-08-11 Dmitry Titov <dimich@chromium.org> Reviewed by Adam Roben. Originally implemented by Glenn Wilson <gwilson@chromium.org>. Added new methods for overriding default WebPreference values and for resetting preferences to their defaults. See https://bugs.webkit.org/show_bug.cgi?id=20534 * WebView/WebPreferences.mm: (-[WebPreferences _setPreferenceForTestWithValue:withKey:]): added. * WebView/WebPreferencesPrivate.h: same. 2009-08-09 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> Reviewed by George Staikos. [WML] Deck access control is completly broken https://bugs.webkit.org/show_bug.cgi?id=27721 Synchronize WebFrameLoadType with FrameLoadType enum. Append 'WebFrameLoadTypeBackWMLDeckNotAccessible'. * WebView/WebFramePrivate.h: 2009-08-07 Simon Fraser <simon.fraser@apple.com> Fix the build on 10.6. * WebView/WebHTMLView.mm: (-[WebHTMLView attachRootLayer:]): 2009-08-07 Simon Fraser <simon.fraser@apple.com> Fix a stylistic nit related to the location of the *, which, for some ridiculous reason, WebKit style dictates to be different between Objective-C and C++. * WebView/WebDynamicScrollBarsView.mm: (-[WebDynamicScrollBarsView reflectScrolledClipView:]): 2009-08-07 Simon Fraser <simon.fraser@apple.com> Reviewed by Dan Bernstein. Work around an issue on Leopard where composited layers are misplaced and squished when the page gets over 4096px tall. https://bugs.webkit.org/show_bug.cgi?id=27272 <rdar://problem/7067892> [Leopard] Composisted layers are misplaced and squished on on long pages <rdar://problem/7068252> [Leopard] When switching to a tab with HW layers, they fade in * WebView/WebDynamicScrollBarsView.mm: (-[WebDynamicScrollBarsView reflectScrolledClipView:]): Call -_updateLayerHostingViewPosition after scrolling. * WebView/WebHTMLView.mm: (-[WebHTMLView _frameOrBoundsChanged]): Call -_updateLayerHostingViewPosition after the view changes size. (-[WebHTMLView attachRootLayer:]): Turn off default animations, to avoid animations of sublayer transform, and fading-in when tab switching. * WebView/WebHTMLViewInternal.h: (-[WebHTMLView _updateLayerHostingViewPosition]): New method that constrains the height of the layer-hosting view to a max height of 4096px, and compensates for the height restriction by placing the layer-hosting view at the top of the visible part of the WebHTMLView, and adjusting the position of the hosted layers via sublayer transform. 2009-08-07 Anders Carlsson <andersca@apple.com> Fix Tiger build. * WebView/WebRenderNode.mm: (-[WebRenderNode _initWithCoreFrame:]): 2009-08-07 Anders Carlsson <andersca@apple.com> Reviewed by Timothy Hatcher and Sam Weinig. Change WebRenderNode to take a WebFrame instead of a WebFrameView. * WebView/WebRenderNode.h: * WebView/WebRenderNode.mm: (-[WebRenderNode _initWithName:position:rect:coreFrame:children:]): (copyRenderNode): (-[WebRenderNode _initWithCoreFrame:]): (-[WebRenderNode initWithWebFrame:]): 2009-08-06 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler and Dan Bernstein. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::hasHTMLView): Always return true when we're in viewless mode. 2009-08-06 Anders Carlsson <andersca@apple.com> Remove WebGraphicsExtras.h include. * Plugins/WebNetscapePluginView.mm: 2009-08-06 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Remove WebGraphicsExtras, it is no longer used. * Misc/WebGraphicsExtras.c: Removed. * Misc/WebGraphicsExtras.h: Removed. 2009-08-06 Chris Marrin <cmarrin@apple.com> Reviewed by David Hyatt. Added ENABLE_3D_CANVAS flag to build, default to off * Configurations/FeatureDefines.xcconfig: 2009-08-04 Michael Nordman <michaeln@google.com> Reviewed by Alexey Proskuryakov. https://bugs.webkit.org/show_bug.cgi?id=27821 Mods to keep up with ApplicationCacheHost refactoring. * WebView/WebDataSource.mm: (-[WebDataSource _transferApplicationCache:]): 2009-07-30 Darin Adler <darin@apple.com> Reviewed by David Levin. Use checked casts for render tree https://bugs.webkit.org/show_bug.cgi?id=23522 * Misc/WebNSAttributedStringExtras.mm: (fileWrapperForElement): * Misc/WebNSPasteboardExtras.mm: (imageFromElement): (-[NSPasteboard _web_declareAndWriteDragImageForElement:URL:title:archive:source:]): * WebView/WebFrame.mm: (-[WebFrame _computePageRectsWithPrintWidthScaleFactor:printHeight:]): (-[WebFrame _accessibilityTree]): * WebView/WebRenderNode.mm: (copyRenderNode): Use checked casts. 2009-07-31 Simon Fraser <simon.fraser@apple.com> Reviewed by Anders Carlsson. Accelerated animations stutter on pages with lots of animations and 3d transforms https://bugs.webkit.org/show_bug.cgi?id=27884 This patch changes the strategy for synchronizing painting view the view, and compositing layer updates. Previously the strategy was to disable screen updates between the time we updated the layer tree, and painted the view. That left screen updates disabled for too long (hundreds of milliseconds) in some cases, causing animation stutter. The new strategy is to batch up changes to the CA layer tree, and commit them all at once just before painting happens (referred to as a "sync" in the code). GraphicsLayerCA now keeps a bitmask of changed properties, and then migrates the values stored in GraphicsLayer into the CA layer tree at commit time. Compositing layers are then synced in FrameView::paintContents(). However, not all style/layout changes will result in painting; to deal with style changes that touch only compositing properties, we set up a runloop observer that takes care of comitting layer changes when no painting happens. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::scheduleCompositingLayerSync): scheduleViewUpdate() renamed to syncCompositingStateRecursive() * WebView/WebView.mm: (-[WebView _close]): (-[WebView _clearLayerSyncLoopObserver]): "viewUpdateRunLoopObserver" is now "layerSyncLoopObserver". (-[WebView _syncCompositingChanges]): Helper method that calls syncCompositingStateRecursive() on the FrameView. (layerSyncRunLoopObserverCallBack): (-[WebView _scheduleCompositingLayerSync]): This is all about layer sycning now. Also, the run loop observer is repeating, because it has to keep firing until syncCompositingStateRecursive() says that it has completed. * WebView/WebViewData.h: "viewUpdateRunLoopObserver" is now "layerSyncLoopObserver". * WebView/WebViewInternal.h: _scheduleViewUpdate is now _scheduleCompositingLayerSync 2009-07-30 Michael Nordman <michaeln@google.com> Reviewed by Darin Fisher. https://bugs.webkit.org/show_bug.cgi?id=27821 Mods to keep up with ApplicationCacheHost refactoring. * WebView/WebDataSource.mm: (-[WebDataSource _transferApplicationCache:]): 2009-07-29 David Kilzer <ddkilzer@apple.com> <http://webkit.org/b/27788> Don't export WebPluginController.h as a private header Reviewed by Mark Rowe. * Plugins/WebPluginController.h: Changed #import of WebPluginContainerCheck.h to use a framework-style include in case other platforms wish to export WebPluginController.h as a private header. 2009-07-29 Kevin McCullough <kmccullough@apple.com> Reviewed by Darin Adler. Added foundation work to allow a testing infrastructure for the Web Inspector. * WebCoreSupport/WebInspectorClient.h: * WebCoreSupport/WebInspectorClient.mm: (WebInspectorClient::inspectorWindowObjectCleared): Send the delegate callback. * WebView/WebDelegateImplementationCaching.h: * WebView/WebView.mm: (-[WebView _cacheFrameLoadDelegateImplementations]): * WebView/WebViewPrivate.h: The delegate SPI. 2009-07-27 Mark Rowe <mrowe@apple.com> Reviewed by Darin Adler. <rdar://problem/7091036> REGRESSION: Microsoft Messenger crashes during file send/receive due to use of WebKit on non-main thread In some situations Microsoft Messenger can attempt to manipulate the DOM from a secondary thread while updating its file transfer progress bar. This results in corruption of WebCore data structures that is quickly followed by a crash. We can work around this by having -[WebFrame DOMDocument] return nil when called from a secondary thread by Microsoft Messenger, which has the effect of turning its attempts at DOM manipulation in to no-ops. * WebView/WebFrame.mm: (needsMicrosoftMessengerDOMDocumentWorkaround): (-[WebFrame DOMDocument]): 2009-07-27 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=27735 Give a helpful name to JSLock constructor argument * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptObjectsCount]): (+[WebCoreStatistics javaScriptGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectsCount]): (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics shouldPrintExceptions]): (+[WebCoreStatistics setShouldPrintExceptions:]): (+[WebCoreStatistics memoryStatistics]): (+[WebCoreStatistics javaScriptReferencedObjectsCount]): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::evaluate): (WebKit::NetscapePluginInstanceProxy::invoke): (WebKit::NetscapePluginInstanceProxy::invokeDefault): (WebKit::NetscapePluginInstanceProxy::construct): (WebKit::NetscapePluginInstanceProxy::getProperty): (WebKit::NetscapePluginInstanceProxy::setProperty): (WebKit::NetscapePluginInstanceProxy::removeProperty): (WebKit::NetscapePluginInstanceProxy::hasMethod): (WebKit::NetscapePluginInstanceProxy::enumerate): (WebKit::NetscapePluginInstanceProxy::addValueToArray): * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::wantsAllStreams): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView sendEvent:isDrawRect:]): (-[WebNetscapePluginView setWindowIfNecessary]): (-[WebNetscapePluginView createPluginScriptableObject]): (-[WebNetscapePluginView evaluateJavaScriptPluginRequest:]): (-[WebNetscapePluginView webFrame:didFinishLoadWithReason:]): (-[WebNetscapePluginView loadPluginRequest:]): (-[WebNetscapePluginView _printedPluginBitmap]): * Plugins/WebPluginController.mm: (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]): (-[WebPluginController startAllPlugins]): (-[WebPluginController stopAllPlugins]): (-[WebPluginController addPlugin:]): (-[WebPluginController destroyPlugin:]): (-[WebPluginController destroyAllPlugins]): * WebView/WebFrame.mm: (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame scopeChain]): (-[WebScriptCallFrame evaluateWebScript:]): * WebView/WebView.mm: (-[WebView aeDescByEvaluatingJavaScriptFromString:]): 2009-07-24 Darin Adler <darin@apple.com> Reviewed by Mark Rowe. REGRESSION (r46298): Exception after clicking on Bookmarks button in the Bookmarks Bar https://bugs.webkit.org/show_bug.cgi?id=27667 * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::transitionToCommittedForNewPage): Moved the code to set the title here. This is late enough that both the view and representation exist. * WebView/WebDataSource.mm: (-[WebDataSource _makeRepresentation]): Removed the code to set the title from here. It's a bit too early. 2009-07-24 Andrei Popescu <andreip@google.com> Reviewed by Anders Carlsson. ApplicationCache should have size limit https://bugs.webkit.org/show_bug.cgi?id=22700 Adds the WebApplicationCache class that is used by the DumpRenderTree test application to configure the Application Cache maximum size. * WebCoreSupport/WebApplicationCache.h: Added. * WebCoreSupport/WebApplicationCache.mm: Added. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::reachedMaxAppCacheSize): Adds empty implementation of the reachedMaxAppCacheSize callback. * WebKit.exp: 2009-07-23 Darin Adler <darin@apple.com> * WebView/WebDataSource.mm: (-[WebDataSource _makeRepresentation]): Landed a comment I forgot last time. 2009-07-23 Darin Adler <darin@apple.com> Reviewed by Brady Eidson. URL appears in back/forward button menu instead of title for items with custom representation https://bugs.webkit.org/show_bug.cgi?id=27586 rdar://problem/5060337 The problem is that DocumentLoader expects to store a title, but for custom representations it is never passed to the document loader. * WebView/WebDataSource.mm: (-[WebDataSource _makeRepresentation]): Added a call to DocumentLoader::setTitle. Works as long as the title does not change during the document's lifetime, which is good enough for the simple cases in Safari. 2009-07-20 Darin Adler <darin@apple.com> Reviewed by Dan Bernstein. REGRESSION (r39185): Safari adds ".jpeg" extension to images that already have ".JPG" extension https://bugs.webkit.org/show_bug.cgi?id=27472 * WebView/WebHTMLView.mm: (matchesExtensionOrEquivalent): Changed category method into a C function. Made it require the leading dot when checking for the extension and do it in a non-case-sensitive way. (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Changed to call the function. 2009-07-21 Roland Steiner <rolandsteiner@google.com> Reviewed by David Levin. Add ENABLE_RUBY to list of build options https://bugs.webkit.org/show_bug.cgi?id=27324 * Configurations/FeatureDefines.xcconfig: Added flag ENABLE_RUBY. 2009-07-17 Brian Weinstein <bweinstein@apple.com> Reviewed by Adam Roben. Fix of <rdar://problem/5712795> Win: Cannot change the height of the docked Web Inspector (14272) https://bugs.webkit.org/show_bug.cgi?id=14272 Removed size calculation code from [WebInspectorWindowController setInitialAttachedHeight] into InspectorController.cpp to make it cross platform, and use InspectorController to store the user's preferred size for an attached window, instead of NSUserDefaults. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController showWindow:]): (-[WebInspectorWindowController setAttachedWindowHeight:]): 2009-07-16 Fumitoshi Ukai <ukai@chromium.org> Reviewed by David Levin. Add --web-sockets flag and ENABLE_WEB_SOCKETS define. https://bugs.webkit.org/show_bug.cgi?id=27206 Add ENABLE_WEB_SOCKETS * Configurations/FeatureDefines.xcconfig: add ENABLE_WEB_SOCKETS 2009-07-16 Xiaomei Ji <xji@chromium.org> Reviewed by Darin Adler. Fix tooltip does not get its directionality from its element's directionality. https://bugs.webkit.org/show_bug.cgi?id=24187 Per mitz's suggestion in comment #6, while getting the plain-text title, we also get the directionality of the title. How to handle the directionality is up to clients. Clients could ignore it, or use attribute or unicode control characters to display the title as what they want. * Misc/WebElementDictionary.mm: (-[WebElementDictionary _spellingToolTip]): Change spellingToolTip caller due to signature change. (-[WebElementDictionary _title]): Change title caller due to signature change. * WebCoreSupport/WebChromeClient.h: Add directionality as 2nd parameter to setToolTip(). * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::setToolTip): Add directionality as 2nd parameter to setToopTip() (without handling it yet). 2009-07-15 Darin Adler <darin@apple.com> Reviewed by Sam Weinig. Renamed parseURL to deprecatedParseURL. * DOM/WebDOMOperations.mm: (-[DOMDocument URLWithAttributeString:]): Renamed. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createPlugin): Renamed. 2009-07-15 Brady Eidson <beidson@apple.com> Reviewed by Dan Bernstein. https://bugs.webkit.org/show_bug.cgi?id=27304 WebKit should provide usage and eligibility information about the page cache. * Misc/WebCoreStatistics.h: * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics numberCachedPages]): (+[WebCoreStatistics numberCachedFrames]): (+[WebCoreStatistics numberAutoreleasedPages]): * WebKit.exp: * WebView/WebFrame.mm: (-[WebFrame _cacheabilityDictionary]): Returns a dictionary with all the data about why the frame is not cacheable. If the frame *is* cacheable, the dictionary is empty. * WebView/WebFramePrivate.h: 2009-07-13 Simon Fraser <simon.fraser@apple.com> Reviewed by Dan Bernstein, Adam Roben. "Unrecognized selector" console log when the Safari 4 Welcome page navigates to Top Sites. <rdar://problem/6994893 attachRootGraphicsLayer() should not assume that the frameView's documentView is a WebHTMLView. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::attachRootGraphicsLayer): 2009-07-13 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler and Kevin Decker. <rdar://problem/7053687> Core Animation plug-ins continue to grow larger and larger when opening new tabs (32 bit-only) * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView setLayer:]): Add a FIXME. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView setLayer:]): Make sure to set the size of the layer before changing the autoresizing mask so it won't grow everytime it's inserted into the layer tree. 2009-07-13 Greg Bolsinga <bolsinga@apple.com> Reviewed by Simon Fraser. Correct these delegate methods' declarations by adding parameter names. * WebView/WebUIDelegatePrivate.h: 2009-07-13 Drew Wilson <atwilson@google.com> Reviewed by David Levin. Add ENABLE(SHARED_WORKERS) flag and define SharedWorker APIs https://bugs.webkit.org/show_bug.cgi?id=26932 Added ENABLE(SHARED_WORKERS) flag (disabled by default). * Configurations/FeatureDefines.xcconfig: 2009-07-12 Keishi Hattori <casey.hattori@gmail.com> Reviewed by Timothy Hatcher. Refactor ConsoleMessage to add MessageType attribute. https://bugs.webkit.org/show_bug.cgi?id=20625 * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::addMessageToConsole): 2009-07-11 Simon Fraser <simon.fraser@apple.com> Enable support for accelerated compositing and 3d transforms on Leopard. <https://bugs.webkit.org/show_bug.cgi?id=20166> <rdar://problem/6120614> Reviewed by Oliver Hunt. * Configurations/FeatureDefines.xcconfig: 2009-07-10 David Kilzer <ddkilzer@apple.com> Bug 27007: Build fixes when ICONDATABASE is disabled <https://bugs.webkit.org/show_bug.cgi?id=27007> Reviewed by Sam Weinig. * Misc/WebIconDatabase.mm: (defaultClient): Return 0 if ICONDATABASE is disabled. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidReceiveIcon): Commented out the body of the method if ICONDATABASE is disabled. (WebFrameLoaderClient::registerForIconNotification): Ditto. * WebCoreSupport/WebIconDatabaseClient.mm: Added #if ENABLE(ICONDATABASE)/#endif guard to source. * WebView/WebView.mm: (-[WebView setFrameLoadDelegate:]): Wrapped code that starts the icon database machinery in #if ENABLE(ICONDATABASE)/#endif. (-[WebView _registerForIconNotification:]): Wrapped method in #if ENABLE(ICONDATABASE)/#endif guard. (-[WebView _dispatchDidReceiveIconFromWebFrame:]): Ditto. * WebView/WebViewInternal.h: Wrapped methods in #if ENABLE(ICONDATABASE)/#endif guard. (-[WebView _registerForIconNotification:]): (-[WebView _dispatchDidReceiveIconFromWebFrame:]): 2009-07-10 Simon Fraser <simon.fraser@apple.com> Reviewed by John Sullivan. Flashing as hardware layers are created and destroyed in some content <rdar://problem/7032246> There's a window of time between the end of one runloop cycle, after CA layers changes have been committed, and the window display at the start of the next cycle when CA may push updates to the screen before AppKit has drawn the view contents. If we know that we need to do drawing synchronization (which we do when content moves between a layer and the view), then we need to call -disableScreenUpdatesUntilFlush from the existing runloop observer that is set up when layers need repainting to ensure that layer updates don't reach the screen before view-based painting does. * WebView/WebHTMLView.mm: (-[WebHTMLView drawRect:]): Tweak the comments * WebView/WebView.mm: (viewUpdateRunLoopObserverCallBack): (-[WebView _scheduleViewUpdate]): Add a big comment to explain the timing of things. Call -disableScreenUpdatesUntilFlush when the view _needsOneShotDrawingSynchronization. 2009-07-09 Brian Weinstein <bweinstein@apple.com> Reviewed by Tim Hatcher. 2009-07-10 Adam Barth <abarth@webkit.org> Reviewed by Sam Weinig with the power of Grayskull. Enable XSSAuditor by default. * WebView/WebPreferences.mm: (+[WebPreferences initialize]): 2009-07-10 Greg Bolsinga <bolsinga@apple.com> Reviewed by Antti Koivisto. Add delegate methods about focus and blur and state change https://bugs.webkit.org/show_bug.cgi?id=27153 Call the appropriate private delegate methods from the ChromeClient. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::formStateDidChange): (WebChromeClient::formDidFocus): (WebChromeClient::formDidBlur): * WebView/WebUIDelegatePrivate.h: 2009-07-09 Brian Weinstein <bweinstein@apple.com> Reviewed by Tim Hatcher. https://bugs.webkit.org/show_bug.cgi?id=27141 Updated WebInspectorClient to use Web Inspector Preferences to remember whether or not it should be docked or a free window instead of NSUserDefaults it used to have. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController init]): (-[WebInspectorWindowController showWindow:]): (-[WebInspectorWindowController attach]): (-[WebInspectorWindowController detach]): 2009-07-09 Drew Wilson <atwilson@google.com> Reviewed by Alexey Proskuryakov. https://bugs.webkit.org/show_bug.cgi?id=26903 Turned on CHANNEL_MESSAGING by default because the MessageChannel API can now be implemented for Web Workers and is reasonably stable. * Configurations/FeatureDefines.xcconfig: 2009-07-09 Darin Adler <darin@apple.com> Reviewed by Adele Peterson and Dan Bernstein. <rdar://problem/7024972> Cannot set font to Helvetica Neue Light in Mail compose window No regression test because this only affects the font panel. * WebView/WebHTMLView.mm: (-[WebHTMLView _addToStyle:fontA:fontB:]): Fix code that detects whether the font would survive a round trip by using the weight corresponding to "bold" or "normal" rather than the actual weight number. 2009-07-09 Beth Dakin and Jon Honeycutt <bdakin@apple.com> Reviewed by Dave Hyatt. Make Widget RefCounted to fix: <rdar://problem/7038831> REGRESSION (TOT): In Mail, a crash occurs at WebCore::Widget::afterMouseDown() after clicking To Do's close box <rdar://problem/6978804> WER #16: Repro Access Violation in WebCore::PluginView::bindingInstance (1310178023) -and- <rdar://problem/6991251> WER #13: Crash in WebKit! WebCore::PluginView::performRequest+203 (1311461169) * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createPlugin): 2009-07-09 Sam Weinig <sam@webkit.org> Reviewed by Steve Falkenburg. Roll out r43848. The quirk is no longer necessary. * WebView/WebView.mm: (-[WebView WebCore::_userAgentForURL:WebCore::]): 2009-07-09 Alexey Proskuryakov <ap@webkit.org> Reviewed by Geoff Garen. <rdar://problem/6921671> Visit count shouldn't be incremented by redirects. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::updateGlobalHistory): Do not increase visit count if there is a redirect source. As a result, only pages that were explicitly visited by the user (by typing a URL, choosing one from bookmarks, or clicking a link) will be counted. * History/WebHistory.mm: (-[WebHistoryPrivate visitedURL:withTitle:increaseVisitCount:]): (-[WebHistory _visitedURL:withTitle:method:wasFailure:increaseVisitCount:]): * History/WebHistoryInternal.h: * History/WebHistoryItem.mm: (-[WebHistoryItem _visitedWithTitle:increaseVisitCount:]): * History/WebHistoryItemInternal.h: Marshal this new argument all the way down to WebCore. 2009-07-08 Greg Bolsinga <bolsinga@apple.com> Reviewed by Darin Adler. Add -[WebView _isProcessingUserGesture] https://bugs.webkit.org/show_bug.cgi?id=27084 Add -_isProcessingUserGesture that calls into WebCore::FrameLoader::isProcessingUserGesture() so that WebView code can determine if a user gesture is in progress. * WebView/WebView.mm: (-[WebView _isProcessingUserGesture]): * WebView/WebViewPrivate.h: 2009-07-07 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. - Fix <rdar://problem/6544693>. For Flash, don't cache which methods or fields in an object are missing, since they can be added at any time. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::hostForPackage): * Plugins/Hosted/NetscapePluginHostProxy.h: (WebKit::NetscapePluginHostProxy::shouldCacheMissingPropertiesAndMethods): * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::methodsNamed): (WebKit::ProxyInstance::fieldNamed): 2009-07-06 David Kilzer <ddkilzer@apple.com> Bug 27006: Build fix when MAC_JAVA_BRIDGE is disabled <https://bugs.webkit.org/show_bug.cgi?id=27006> Reviewed by Darin Adler. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createJavaAppletWidget): Wrap contents of the method in #if ENABLE(MAC_JAVA_BRIDGE)/#endif and return 0 when this feature is disabled. 2009-07-06 David Kilzer <ddkilzer@apple.com> Bug 27005: Build fixes when NETSCAPE_PLUGIN_API is disabled <https://bugs.webkit.org/show_bug.cgi?id=27005> Reviewed by Geoff Garen. * Plugins/WebPluginController.mm: (-[WebPluginController destroyPlugin:]): Wrap call to ScriptController::cleanupScriptObjectsForPlugin() in #if ENABLE(NETSCAPE_PLUGIN_API)/#endif macro. (-[WebPluginController destroyAllPlugins]): Ditto. * Plugins/WebPluginDatabase.mm: (-[WebPluginDatabase removePluginInstanceViewsFor:]): Wrap WebBaseNetscapePluginView class checks in #if ENABLE(NETSCAPE_PLUGIN_API)/#endif macro. (-[WebPluginDatabase destroyAllPluginInstanceViews]): Ditto. 2009-07-06 David Kilzer <ddkilzer@apple.com> BUILD FIX: Use ENABLE(NETSCAPE_PLUGIN_API) instead of USE(PLUGIN_HOST_PROCESS) In r45579, #if/#endif macros for USE(PLUGIN_HOST_PROCESS) were used, but ENABLE(NETSCAPE_PLUGIN_API) should have been used instead. * Plugins/WebNetscapeContainerCheckContextInfo.h: * Plugins/WebNetscapeContainerCheckContextInfo.mm: * Plugins/WebNetscapeContainerCheckPrivate.mm: 2009-07-06 David Kilzer <ddkilzer@apple.com> Bug 27004: Build fix for ENABLE(PLUGIN_PROXY_FOR_VIDEO) after r42618 <https://bugs.webkit.org/show_bug.cgi?id=27004> Reviewed by Geoff Garen. * Plugins/WebPluginController.mm: (mediaProxyClient): Use core() method to convert from DOMElement to WebCore::Element. 2009-07-06 David Kilzer <ddkilzer@apple.com> Bug 27003: Build fix when USE(PLUGIN_HOST_PROCESS) is disabled <https://bugs.webkit.org/show_bug.cgi?id=27003> Reviewed by Geoff Garen. * Plugins/WebNetscapeContainerCheckContextInfo.h: Added #if USE(PLUGIN_HOST_PROCESS)/#endif guards. * Plugins/WebNetscapeContainerCheckContextInfo.mm: Ditto. * Plugins/WebNetscapeContainerCheckPrivate.mm: Ditto. 2009-07-06 Anders Carlsson <andersca@apple.com> Reviewed by Adele Peterson. Initialize wkIsLatchingWheelEvent. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2009-07-03 Dan Bernstein <mitz@apple.com> Reviewed by Simon Fraser. - fix <rdar://problem/6964278> REGRESSION (r42118): Scrolling redraw problem in FileMaker Pro * WebView/WebHTMLView.mm: (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]): Perform layout if needed, even on Mac OS X versions that have -viewWillDraw. This prevents attempts to draw without layout in case -viewWillDraw was not called due to NSView issues or the client did something during the display operation that re-invalidated the layout. 2009-07-02 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. <rdar://problem/6978783> Software-rendered plug-in does not update correctly when inside a hardware layer Replace calls to setNeedsDisplay: and setNeedsDisplayInRect: with a call to the new method invalidatePluginContentRect:. This new method will ask WebCore to do the repainting, taking transforms into account. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::invalidateRect): * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView pluginHostDied]): * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView windowBecameKey:]): (-[WebBaseNetscapePluginView windowResignedKey:]): (-[WebBaseNetscapePluginView preferencesHaveChanged:]): (-[WebBaseNetscapePluginView invalidatePluginContentRect:]): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView invalidateRect:]): (-[WebNetscapePluginView invalidateRegion:]): (-[WebNetscapePluginView forceRedraw]): 2009-07-02 Adam Roben <aroben@apple.com> Fix warnings from update-webkit-localizable-strings Rubber-stamped by Eric Carlson. * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory mediaElementLoadingStateText]): (-[WebViewFactory mediaElementLiveBroadcastStateText]): Changed the localization comments to match the comments in the Windows version of this file, to avoid warnings about different comments for the same localized string. 2009-07-02 Simon Fraser <simon.fraser@apple.com> Reviewed by Dan Bernstein. Compositing-related preference methods are not public API; should move to WebPreferencesPrivate.h <rdar://problem/7027363> Move accelerated-compositing pref to WebPreferencesPrivate.h * WebView/WebPreferences.h: * WebView/WebPreferences.mm: (-[WebPreferences acceleratedCompositingEnabled]): (-[WebPreferences setAcceleratedCompositingEnabled:]): * WebView/WebPreferencesPrivate.h: 2009-07-02 Pierre d'Herbemont <pdherbemont@apple.com> Reviewed by Simon Fraser. <rdar://problem/6518119> Add localized strings for media controller status messages. * WebCoreSupport/WebViewFactory.mm: Add new localized text. (-[WebViewFactory mediaElementLoadingStateText]): (-[WebViewFactory mediaElementLiveBroadcastStateText]): 2009-07-01 Brady Eidson <beidson@apple.com> Reviewed by Sam Weinig. Add a preference/setting to toggle whether content sniffing is enabled for file URLs. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences localFileContentSniffingEnabled]): (-[WebPreferences setLocalFileContentSniffingEnabled:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2009-07-01 David Hyatt <hyatt@apple.com> Reviewed by Tim Hatcher. <rdar://problem/6998524> REGRESSION (r44474): Form text field has focus ring, looks focused, even though the field is not actually focused for keyboard input Add the concept of whether or not the Page is focused by adding a boolean to the focusController. This allows the focused frame and focused node to both be cached and changed programmatically without causing errors when the Page doesn't have focus. * WebView/WebHTMLView.mm: (-[WebHTMLView becomeFirstResponder]): (-[WebHTMLView resignFirstResponder]): 2009-06-30 Adele Peterson <adele@apple.com> Reviewed by Dan Bernstein. Fix for <rdar://problem/7014389> REGRESSION(4-TOT): Hyperlinks have no tooltips in Mail unless you first click in the message body Updated these new methods (added as part of the viewless WebKit effort) that call through to WebHTMLView to use _selectedOrMainFrame, instead of just selectedFrame. When the selection changes, I don't think there is a situation where there's no selected frame, but it seems better to keep these two uses the same, since if there is a case, this will be more like the old behavior, before there was a version of _selectionChanged in WebView. * WebView/WebView.mm: (-[WebView _setToolTip:]): (-[WebView _selectionChanged]): 2009-06-30 Mark Rowe <mrowe@apple.com> Reviewed by Timothy Hatcher. <rdar://problem/7006959> 'Save as…’ does not work in Mail * WebView/WebFrameView.mm: (-[WebFrameView initWithFrame:]): Call _needMailThreadWorkaroundIfCalledOffMainThread rather than needMailThreadWorkaround, as the latter is intended to be used at the point which a workaround would be applied and thus contains a main thread check. Since -initWithFrame: is called on the main thread, this was causing us to not switch from exception-throwing to logging for the thread violation behavior. 2009-06-30 Dan Bernstein <mitz@apple.com> Reviewed by Dave Hyatt. - fix <rdar://problem/6946611> REGRESSION (r30673): Shade10:" D_Snap to Grid" window is clipping * Misc/WebKitVersionChecks.h: Added WEBKIT_FIRST_VERSION_WITHOUT_SHADE10_QUIRK * WebView/WebView.mm: (-[WebView _needsLinkElementTextCSSQuirk]): Added. Returns YES if the client app is a version of Shade 10 earlier than 10.6 and it was linked against a version of WebKit earlier than 531.2. (-[WebView _preferencesChangedNotification:]): Added a call to Settings::setTreatsAnyTextCSSLinkAsStylesheet(). 2009-06-29 Eric Carlson <eric.carlson@apple.com> Reviewed by Simon Fraser. <rdar://problem/7014813> Ask media engine if a movie is streamed or downloaded. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Add QTMovieGetType. 2009-06-29 David Hyatt <hyatt@apple.com> Reviewed by Adam Roben. Put datagrid behind an #ifdef. * Configurations/FeatureDefines.xcconfig: 2009-06-26 John Sullivan <sullivan@apple.com> Added support for disabling Stop Speaking when there is no speaking to stop. Also fixed Stop Speaking so that it works (formerly it would throw an exception, and selecting it from the menu would perform a web search instead (!)). Reviewed by Tim Hatcher. * WebCoreSupport/WebContextMenuClient.h: declare isSpeaking() * WebCoreSupport/WebContextMenuClient.mm: (WebContextMenuClient::isSpeaking): implement by calling through to NSApplication (WebContextMenuClient::stopSpeaking): fixed implementation by correcting the signature of the NSApplication method 2009-06-26 Chris Marrin <cmarrin@apple.com> Reviewed by Simon Fraser <simon.fraser@apple.com>. Additional fix for https://bugs.webkit.org/show_bug.cgi?id=26651 The flag should always default to true to avoid it getting set to false in a build with accelerated compositing turned off and then disabling accelerated compositing when subsequently running a build with it turned on. * WebView/WebPreferences.mm: (+[WebPreferences initialize]): 2009-06-26 Brady Eidson <beidson@apple.com> Fix SnowLeopard build. * Plugins/Hosted/HostedNetscapePluginStream.mm: (WebKit::HostedNetscapePluginStream::didReceiveResponse): 2009-06-26 Brady Eidson <beidson@apple.com> Reviewed by Sam Weinig <rdar://problem/6961578> REGRESSION (r43511): Opening .fdf files from Acrobat Professional fails Replace all usage of the now obsolete [NSURLResponse _webcore_MIMEType]. * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::didReceiveResponse): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView pluginView:receivedData:]): * Plugins/WebPluginController.mm: (-[WebPluginController pluginView:receivedResponse:]): * WebView/WebDataSource.mm: (-[WebDataSource _responseMIMEType]): * WebView/WebResource.mm: (-[WebResource _initWithData:URL:response:]): 2009-06-26 Alexey Proskuryakov <ap@webkit.org> Reviewed by Sam Weinig. <rdar://problem/6651201> Update lookalike character list. * Misc/WebNSURLExtras.mm: (isLookalikeCharacter): Added more characters to the list. 2009-06-25 Anders Carlsson <andersca@apple.com> Reviewed by Oliver Hunt. <rdar://problem/6989017> REGRESSION (SnowLeopard): RealPlayer content replays when opening a new tab or switching back to the RealPlayer tab If a plug-in fails in NPP_New, we would try to recreate it whenever the preferences for a web view would change. Fix this by setting a flag when we fail to instantiate the plug-in, so we only try once. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView start]): 2009-06-25 Chris Marrin <cmarrin@apple.com> Reviewed by Simon Fraser <simon.fraser@apple.com>. https://bugs.webkit.org/show_bug.cgi?id=26651 Preference is named "WebKitAcceleratedCompositingEnabled" and is a boolean value. When false, prevents compositing layers from being created, which prevents hardware animation from running. Also forces video to do software rendering. Added a cache for the flag in RenderLayerCompositing and made it all work on-the-fly when the flag is changed while a page is loaded. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences acceleratedCompositingEnabled]): (-[WebPreferences setAcceleratedCompositingEnabled:]): * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2009-06-24 Dan Bernstein <mitz@apple.com> Reviewed by Anders Carlsson. Fix the most recently seen kind of crash in <rdar://problem/5983224> * WebView/WebHTMLView.mm: (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Null-check the Frame. 2009-06-24 Jeff Johnson <opendarwin@lapcatsoftware.com> Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=26638 WebKitErrors.m: _initWithPluginErrorCode: does not set localizedDescription Add localized descriptions for plugin errors. The localized strings already existed but were unused; now NSLocalizedDescriptionKey is added to the NSError userInfo. * Misc/WebKitErrors.m: (-[NSError _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:]): 2009-06-23 Brady Eidson <beidson@apple.com> Reviewed by Darin Adler. <rdar://problem/6950660> REGRESSION: iSale 5.5.3 crashes after I click a template to load Due to some subtle WebKit changes - presumably some delegate callback behavior - a latent bug in iSale was uncovered where they aren't properly retaining their FrameLoadDelegate, and we ended up calling back to a dealloc'ed object. * WebView/WebView.mm: (-[WebView _needsAdobeFrameReloadingQuirk]): Use more intelligent C++-style initialization. (-[WebView _needsKeyboardEventDisambiguationQuirks]): Ditto. (-[WebView _needsFrameLoadDelegateRetainQuirk]): YES for iSale versions under 5.6 (-[WebView dealloc]): Release the delegate if the quirk is in effect. (-[WebView setFrameLoadDelegate:]): Retain the new delegate if the quirk is in effect. 2009-06-23 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. - Fix <rdar://problem/6965672> Defer calls to WKPCInvalidateRect, so we don't try to invalidate while waiting for a reply, since that is too early. * Plugins/Hosted/NetscapePluginHostProxy.h: (WebKit::NetscapePluginHostProxy::isProcessingRequests): * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): (WebKit::NetscapePluginHostProxy::processRequests): (WKPCInvalidateRect): 2009-06-22 Timothy Hatcher <timothy@apple.com> Add Mail on Tiger and Leopard to the list of applications that need the WebView init thread workaround. <rdar://problem/6929524> Console shows WebKit Threading Violations from Mail Reviewed by Anders Carlsson. * WebView/WebView.mm: (clientNeedsWebViewInitThreadWorkaround): Return true for com.apple.Mail. 2009-06-22 Dan Bernstein <mitz@apple.com> Reviewed by Anders Carlsson. - speculative fix for <rdar://problem/6889082> Crash at -[WebHTMLView(WebPrivate) _updateMouseoverWithEvent:] The crash seems to happen because lastHitView points to a deleted object. Since -close calls -_clearLastHitViewIfSelf, I speculate that lastHitView has been set to an already-closed view. * WebView/WebHTMLView.mm: (-[WebHTMLView hitTest:]): Return nil if the view is closed. 2009-06-22 Alexey Proskuryakov <ap@webkit.org> Reviewed by John Sullivan. <rdar://problem/6956606> REGRESSION (S4Beta -> Final): After the password is input, Japanese can't be input. * WebView/WebHTMLView.mm: (-[WebHTMLView _updateSelectionForInputManager]): Removed an unnecessary check - the function has an early return for null frame. 2009-06-22 Dan Bernstein <mitz@apple.com> Reviewed by Dave Hyatt. - fix <rdar://problem/6990938> REGRESSION (r42787): After showing and hiding the Find banner, the WebHTMLView's height is not restored * WebView/WebFrameView.mm: (-[WebFrameView setFrameSize:]): Mark the FrameView for layout when the WebFrameView's size changes. * WebView/WebView.mm: (-[WebView setFrameSize:]): Left the resize logic here, but only for the single view model. 2009-06-20 Darin Adler <darin@apple.com> Reviewed by Sam Weinig. <rdar://problem/6964221> Need more processing of pluginspage. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createPlugin): Check protocolInHTTPFamily. 2009-06-18 Adam Barth <abarth@webkit.org> Reviewed by Sam Weinig. https://bugs.webkit.org/show_bug.cgi?id=26199 Added preference to enable the XSSAuditor. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences isXSSAuditorEnabled]): (-[WebPreferences setXSSAuditorEnabled:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2009-06-18 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. <rdar://problem/6926859> NPN_ConvertPoint doesn't give the right value when converting to/from NPCoordinateSpaceFlippedScreen When inverting Y, use the height of the first screen instead of the screen the window is on. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::windowFrameChanged): (WebKit::NetscapePluginInstanceProxy::mouseEvent): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView convertFromX:andY:space:toX:andY:space:]): 2009-06-16 Simon Fraser <simon.fraser@apple.com> Reviewed by Dan Bernstein <rdar://problem/6976766> Control-click on pages with accelerated compositing content does not work. Part deux. #ifdef the use of _private->layerHostingView with USE(ACCELERATED_COMPOSITING) * WebView/WebHTMLView.mm: (-[WebHTMLView hitTest:]): 2009-06-16 Simon Fraser <simon.fraser@apple.com> Reviewed by Dan Bernstein <rdar://problem/6976766> Control-click on pages with accelerated compositing content does not work. Remove the WebLayerHostingView subclass of NSView, with its attempts to forward events to the WebHTMLView, and just fix -[WebHTMLView hitTest:] to ignore the layerHostingView. * WebView/WebHTMLView.mm: (-[WebHTMLView hitTest:]): (-[WebHTMLView attachRootLayer:]): 2009-06-15 Simon Fraser <simon.fraser@apple.com> Reviewed by Mark Rowe. <rdar://problem/6974857> Define ENABLE_3D_RENDERING when building on 10.6, and move ENABLE_3D_RENDERING switch from config.h to wtf/Platform.h. * Configurations/FeatureDefines.xcconfig: * WebKitPrefix.h: 2009-06-15 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. <rdar://problem/6967569> CrashTracer: 15 crashes in Safari at com.apple.WebKit • WebKit::NetscapePluginHostManager::didCreateWindow + 85 Make sure to remove the entry from the plug-in host map so we won't end up with an entry that has a null value. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::hostForPackage): 2009-06-15 Dan Bernstein <mitz@apple.com> Reviewed by Tim Hatcher. - make the source code font in the Web Inspector match Mac defaults * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController init]): Set the default monospace font to 11px Menlo, except on Leopard and Tiger where it is 10px Monaco. 2009-06-09 Justin Garcia <justin.garcia@apple.com> Reviewed by Eric Seidel. Landed by Adam Barth. https://bugs.webkit.org/show_bug.cgi?id=26281 REGRESSION: Copying from TextEdit/OmniGraffle and pasting into editable region loses images Prefer RTFD (RTF with inline images) over RTF. In http://trac.webkit.org/changeset/19745 I accidently reversed their order. * WebView/WebHTMLView.mm: (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:]): 2009-06-13 Adam Barth <abarth@webkit.org> Reviewed by Darin Fisher. https://bugs.webkit.org/show_bug.cgi?id=24492 Move registerURLSchemeAsLocal from FrameLoader to SecurityOrigin * WebView/WebView.mm: (+[WebView registerURLSchemeAsLocal:]): 2009-06-12 Peter Kasting <pkasting@google.com> Reviewed by Eric Seidel. * ChangeLog-2007-10-14: Change pseudonym "Don Gibson" to me (was used while Google Chrome was not public); update my email address. 2009-06-08 Dan Bernstein <mitz@apple.com> Rubber-stamped by Mark Rowe. - gave Objective-C++ files the .mm extension * Carbon/HIWebView.m: Removed. * Carbon/HIWebView.mm: Copied from WebKit/mac/Carbon/HIWebView.m. * Misc/WebKitNSStringExtras.m: Removed. * Misc/WebKitNSStringExtras.mm: Copied from WebKit/mac/Misc/WebKitNSStringExtras.m. * Misc/WebStringTruncator.m: Removed. * Misc/WebStringTruncator.mm: Copied from WebKit/mac/Misc/WebStringTruncator.m. * WebInspector/WebNodeHighlight.m: Removed. * WebInspector/WebNodeHighlight.mm: Copied from WebKit/mac/WebInspector/WebNodeHighlight.m. * WebInspector/WebNodeHighlightView.m: Removed. * WebInspector/WebNodeHighlightView.mm: Copied from WebKit/mac/WebInspector/WebNodeHighlightView.m. * WebView/WebDynamicScrollBarsView.m: Removed. * WebView/WebDynamicScrollBarsView.mm: Copied from WebKit/mac/WebView/WebDynamicScrollBarsView.m. 2009-06-05 David Hyatt <hyatt@apple.com> Reviewed by Mark Rowe. https://bugs.webkit.org/show_bug.cgi?id=26220 Update a WebView's active state when it moves to a different window. * WebView/WebView.mm: (-[WebView viewDidMoveToWindow]): 2009-06-04 Sam Weinig <sam@webkit.org> Reviewed by Alice Liu. Move WebView internal data into WebViewData.h/mm. * WebView/WebDelegateImplementationCaching.mm: * WebView/WebView.mm: * WebView/WebViewData.h: Copied from mac/WebView/WebViewInternal.h. * WebView/WebViewData.mm: Copied from mac/WebView/WebViewInternal.mm. * WebView/WebViewInternal.h: * WebView/WebViewInternal.mm: Removed. 2009-06-04 David Hyatt <hyatt@apple.com> Reviewed by Sam Weinig. Remove _updateFocusedStateForFrame, since it's actually not even necessary now that I made setFocusedFrame get called explicitly from become/ResignFirstResponder. setFocusedFrame does the work of focusing the selection already. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::transitionToCommittedForNewPage): * WebView/WebHTMLView.mm: (-[WebHTMLView becomeFirstResponder]): (-[WebHTMLView resignFirstResponder]): * WebView/WebView.mm: * WebView/WebViewInternal.h: 2009-06-04 Dan Bernstein <mitz@apple.com> - build fix * WebView/WebViewInternal.mm: 2009-06-03 David Hyatt <hyatt@apple.com> Reviewed by Sam Weinig. Reworking of focus and active state updating for WebHTMLViews so that it actually works instead of reporting wrong answers. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::transitionToCommittedForNewPage): WebHTMLViews become first responders before they are able to reach their Frames/Pages. This happens because the NSClipView becomes first responder when the WebHTMLView gets destroyed, and then we transfer the responder state back to the new WebHTMLView when it is first connected. Once we have transitioned to a new page and have the Frame/Page available, go ahead and explicitly focus the frame in WebCore and update our focused state. This change allows us to remove the updateFocusedActive timer and the code from viewDidMoveToWindow. * WebView/WebHTMLView.mm: (-[WebHTMLView close]): (-[WebHTMLView addWindowObservers]): (-[WebHTMLView viewWillMoveToWindow:]): (-[WebHTMLView viewDidMoveToWindow]): (-[WebHTMLView _removeWindowObservers]): Remove all the updateFocusedActiveState timer code, since it no longer exists. (-[WebHTMLView windowDidBecomeKey:]): (-[WebHTMLView windowDidResignKey:]): Active state updating is no longer done by WebHTMLViews. It is handled by the WebView instead. (-[WebHTMLView becomeFirstResponder]): (-[WebHTMLView resignFirstResponder]): Reworking of WebHTMLView's code for gaining/losing responder status. No longer update active state here, since the active state can never change just because of responder changes. Make sure that the focused frame gets updated properly (and most importantly actually cleared when a WebHTMLView resigns responder status). * WebView/WebHTMLViewInternal.h: * WebView/WebHTMLViewPrivate.h: State updating for focused and active states has been made independent. * WebView/WebView.mm: (-[WebView _updateActiveState]): WebView now handles updating of active state in _updateActiveState. It is now purely based off whether the window is key and nothing else. (-[WebView addWindowObserversForWindow:]): (-[WebView removeWindowObservers]): Start listening for the window becoming/losing key even in the usesDocumentViews case. (-[WebView _updateFocusedStateForFrame:]): Focused state updating is split into its own method now and called when WebHTMLViews gain and lose responder status. (-[WebView _windowDidBecomeKey:]): (-[WebView _windowDidResignKey:]): Make sure to call _updateActiveState as the window gains/loses key. (-[WebView _windowWillOrderOnScreen:]): Run this code now that WebHTMLView no longer does it. * WebView/WebViewInternal.h: * WebView/WebViewPrivate.h: Updating for the split of focused and active state updating into separate methods. 2009-06-04 Mark Rowe <mrowe@apple.com> Speculative Tiger build fix. * WebView/WebDelegateImplementationCaching.h: 2009-06-03 Sam Weinig <sam@webkit.org> Reviewed by Mark Rowe. Move delegate implementation caching logic into its own files. * WebView/WebDelegateImplementationCaching.h: Copied from mac/WebView/WebViewInternal.h. * WebView/WebDelegateImplementationCaching.mm: Copied from mac/WebView/WebView.mm. (WebViewGetResourceLoadDelegateImplementations): (WebViewGetFrameLoadDelegateImplementations): (WebViewGetScriptDebugDelegateImplementations): * WebView/WebView.mm: * WebView/WebViewInternal.h: 2009-06-03 Sam Weinig <sam@webkit.org> Reviewed by Mark Rowe. Move WebViewPrivate structure to WebViewInternal.h/mm. * WebView/WebView.mm: * WebView/WebViewInternal.h: * WebView/WebViewInternal.mm: Added. (+[WebViewPrivate initialize]): (-[WebViewPrivate init]): (-[WebViewPrivate dealloc]): (-[WebViewPrivate finalize]): 2009-06-03 Sam Weinig <sam@webkit.org> Reviewed by Darin Adler. Small cleanup in WebView. - Move global data initialization to WebView's initialization method. - Move _clearViewUpdateRunLoopObserver from WebViewPrivate to WebView (FileInternal) * WebView/WebView.mm: (-[WebViewPrivate init]): Remove global initializers. (-[WebViewPrivate dealloc]): Cleanup whitespace. (-[WebViewPrivate finalize]): Ditto. (-[WebView _close]): Call [self _clearViewUpdateRunLoopObserver] instead of [_private _clearViewUpdateRunLoopObserver] (+[WebView initialize]): Move global initializers here. (-[WebView _clearViewUpdateRunLoopObserver]): Moved from WebViewPrivate. (viewUpdateRunLoopObserverCallBack): Call [self _clearViewUpdateRunLoopObserver] instead of [_private _clearViewUpdateRunLoopObserver] 2009-06-03 Dan Bernstein <mitz@apple.com> Reviewed by Anders Carlsson. - WebKit part of eliminating WebCoreTextRenderer * Misc/WebKitNSStringExtras.m: (webkit_CGCeiling): Added. (-[NSString _web_drawAtPoint:font:textColor:]): Replaced the malloc()ed string buffer with a Vector. Moved code from WebCoreDrawTextAtPoint() to here. (-[NSString _web_drawDoubledAtPoint:withTopColor:bottomColor:font:]): (-[NSString _web_widthWithFont:]): Replaced the malloc()ed string buffer with a Vector. Moved code from WebCoreTextFloatWidth() to here. * WebView/WebHTMLView.mm: (-[WebHTMLView _addToStyle:fontA:fontB:]): Replaced call to WebCoreFindFont() with use of +[WebFontCache fontWithFamily:traits:weight:size:]. * WebView/WebView.mm: (+[WebView _setAlwaysUsesComplexTextCodePath:]): Changed to call Font::setCodePath() directly. (+[WebView _setShouldUseFontSmoothing:]): Changed to call Font::setShouldUseSmoothing(). (+[WebView _shouldUseFontSmoothing]): Changed to call Font::shouldUseSmoothing(). 2009-06-03 Dan Bernstein <mitz@apple.com> Rubber-stamped by Mark Rowe. - remove a private method that was used only by Safari 3.0. * WebView/WebView.mm: Removed +_minimumRequiredSafariBuildNumber. * WebView/WebViewPrivate.h: Ditto. 2009-06-03 Dan Bernstein <mitz@apple.com> - build fix * WebView/WebHTMLView.mm: 2009-06-03 Dan Bernstein <mitz@apple.com> Reviewed by Anders Carlsson. - build fix * WebView/WebHTMLView.mm: * WebView/WebView.mm: 2009-06-02 Darin Adler <darin@apple.com> Reviewed by David Hyatt. Bug 26112: viewless WebKit -- make events work https://bugs.webkit.org/show_bug.cgi?id=26112 One change here is to make the -[WebFrame frameView] function assert if ever called in viewless mode, and fix many callers that would trip that assertion. A major change is to put some methods and data in WebView that are currently in WebHTMLView, used only in viewless mode. A next step will be to use the WebView methods whenever possible, even when not in the viewless mode. Also fix FrameView to do normal reference counting instead of a strange model with an explicit deref near creation time. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::scrollRectIntoView): Add code to start in the appropriate place when dealing with viewless mode. This gets triggered when visiting the Google home page. (WebChromeClient::setToolTip): Changed to call WebView instead of WebHTMLView. (WebChromeClient::print): Changed to use a new selector that doesn't require a WebFrameView if present. Also don't even try to use the old selector in viewless mode. * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::respondToChangedSelection): Changed to call WebView instead of WebHTMLView. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::transitionToCommittedForNewPage): Added more code paths for viewless mode to skip things we can't do in that mode, with appropriate FIXME. Use Frame::create and RefPtr and eliminate the strange reference counting of FrameView. * WebView/WebDataSource.mm: (-[WebDataSource _receivedData:]): Added a _usesDocumentViews guard around code that's specific to document views. * WebView/WebFrame.mm: (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]): Added a _usesDocumentViews guard around code that's specific to document views. (-[WebFrame _hasSelection]): Added an implementation for viewless mode. (-[WebFrame _clearSelection]): Assert we're not in viewless mode; it doesn't really make sense to clear the selection in only one frame in viewless mode. Later we can decide what to do. (-[WebFrame _dragSourceMovedTo:]): Assert we're not in viewless mode; the dragging code for viewless mode shouldn't have to involve the WebFrame object at all. (-[WebFrame _dragSourceEndedAt:operation:]): Ditto. (-[WebFrame frameView]): Assert we're not in viewless mode. This assertion fires often, but it's a great pointer to code that needs to be changed. * WebView/WebHTMLView.mm: (-[WebHTMLView hitTest:]): Tweaked a comment. (-[WebHTMLView _updateMouseoverWithEvent:]): Fixed a bug where the fake event for moving the mouse out of the old view ended up overwriting the event for moving the mouse within the new view. (-[WebHTMLView mouseDown:]): Got rid of explicit conversion of event to PlatformMouseEvent in call to sendContextMenuEvent; that's no longer possible without passing another argument, and it's now handled in EventHandler. * WebView/WebTextCompletionController.h: Copied from WebKit/mac/WebView/WebHTMLView.mm. Removed everything except for the WebTextCompletionController class. * WebView/WebTextCompletionController.mm: Copied from WebKit/mac/WebView/WebHTMLView.mm. Ditto. * WebView/WebUIDelegatePrivate.h: Added webView:printFrame: method. * WebView/WebView.mm: Moved includes and fields in from WebHTMLView. (-[WebView _usesDocumentViews]): Updated for name change from useDocumentViews to usesDocumentViews. (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): Ditto. (-[WebView drawSingleRect:]): Ditto. (-[WebView isFlipped]): Ditto. (-[WebView setFrameSize:]): Ditto. Also changed to use _mainCoreFrame method. (-[WebView _viewWillDrawInternal]): Ditto. (-[WebView viewWillDraw]): Ditto. (-[WebView drawRect:]): Ditto. (-[WebView _close]): Added code to nil out the lastMouseoverView global. (-[WebView _dashboardRegions]): Use _mainCoreFrame. (-[WebView setProhibitsMainFrameScrolling:]): Ditto. (-[WebView _setInViewSourceMode:]): Ditto. (-[WebView _inViewSourceMode]): Ditto. (-[WebView _attachScriptDebuggerToAllFrames]): Ditto. (-[WebView _detachScriptDebuggerFromAllFrames]): Ditto. (-[WebView textIteratorForRect:]): Ditto. (-[WebView _executeCoreCommandByName:value:]): Ditto. (-[WebView addWindowObserversForWindow:]): Ditto. (-[WebView removeWindowObservers]): Ditto. (-[WebView _updateFocusedAndActiveState]): Ditto. (-[WebView _updateFocusedAndActiveStateForFrame:]): Turned into a class method. Added code to handle the viewless case without calling frameView. (-[WebView _windowDidBecomeKey:]): Updated for name change from useDocumentViews to usesDocumentViews. (-[WebView _windowDidResignKey:]): Ditto. (-[WebView _windowWillOrderOnScreen:]): Ditto. (-[WebView mainFrame]): Tweaked. (-[WebView selectedFrame]): Added a conditional to avoid trying to get at the frame view in viewless case. (-[WebView _setZoomMultiplier:isTextOnly:]): Use _mainCoreFrame. (-[WebView setCustomTextEncodingName:]): Ditto. (-[WebView windowScriptObject]): Ditto. (-[WebView setHostWindow:]): Ditto. Also put some code that's needed only for document views inside _private->usesDocumentViews. (-[WebView _hitTest:dragTypes:]): Tweaked. (-[WebView acceptsFirstResponder]): Added case for viewless mode along with a FIXME, since it's not complete. (-[WebView becomeFirstResponder]): Ditto. (-[WebView _webcore_effectiveFirstResponder]): Put the body of this inside a usesDocumentView check, because we don't need the first responder forwarding in viewless mode. (-[WebView setNextKeyView:]): Ditto. (-[WebView mouseDown:]): Added. Copied from WebHTMLView. FIXME in here suggests that we make WebHTMLView share this one soon, which I think is practical. (-[WebView mouseUp:]): Ditto. (-[WebView setHoverFeedbackSuspended:]): Added a code path for viewless mode. (-[WebView shouldClose]): Use _mainCoreFrame. (-[WebView aeDescByEvaluatingJavaScriptFromString:]): Ditto. (-[WebView setEditable:]): Ditto. (-[WebView _frameViewAtWindowPoint:]): Added an assertion that we're not in viewless mode since this method makes no sense in that mode. (-[WebView _setMouseDownEvent:]): Added. Copied from WebHTMLView. I plan to eliminate the one in WebHTMLView soon. (-[WebView _cancelUpdateMouseoverTimer]): Ditto. (-[WebView _stopAutoscrollTimer]): Ditto. (+[WebView _updateMouseoverWithEvent:]): Ditto. (-[WebView _updateMouseoverWithFakeEvent]): Ditto. (-[WebView _setToolTip:]): Added. Calls through to the WebHTMLView version. (-[WebView _selectionChanged]): Ditto. (-[WebView _mainCoreFrame]): Added. (-[WebView _needsOneShotDrawingSynchronization]): Moved into the WebInternal category. (-[WebView _setNeedsOneShotDrawingSynchronization:]): Ditto. (-[WebView _startedAcceleratedCompositingForFrame:]): Ditto. (-[WebView _stoppedAcceleratedCompositingForFrame:]): Ditto. (viewUpdateRunLoopObserverCallBack): Ditto. (-[WebView _scheduleViewUpdate]): Ditto. * WebView/WebViewInternal.h: Made most of the file not compile at all when included from non-C++ source files, elminating some excess declarations and typedefs. Moved more methods into the real internal category. Added new methods _setMouseDownEvent, _cancelUpdateMouseoverTimer, _stopAutoscrollTimer, _updateMouseoverWithFakeEvent, _selectionChanged, and _setToolTip:. 2009-06-02 Mark Rowe <mrowe@apple.com> Reviewed by Anders Carlsson. Remove workaround that was added to address <rdar://problem/5488678> as it no longer affects our Tiger builds. * Configurations/Base.xcconfig: 2009-06-01 Darin Adler <darin@apple.com> * WebView/WebTextCompletionController.mm: Fix Tiger build by adding import of WebTypesInternal.h. 2009-06-01 Darin Adler <darin@apple.com> Reviewed by Maciej Stachowiak. Bug 26113: break WebTextCompletionController out into its own source file https://bugs.webkit.org/show_bug.cgi?id=26113 * WebView/WebHTMLView.mm: (-[WebHTMLViewPrivate dealloc]): Updated for new name. (-[WebHTMLViewPrivate clear]): Ditto. (-[WebHTMLView _frameOrBoundsChanged]): Ditto. (-[WebHTMLView menuForEvent:]): Ditto. (-[WebHTMLView windowDidResignKey:]): Ditto. (-[WebHTMLView windowWillClose:]): Ditto. (-[WebHTMLView mouseDown:]): Ditto. (-[WebHTMLView resignFirstResponder]): Ditto. (-[WebHTMLView keyDown:]): Ditto. (-[WebHTMLView complete:]): Ditto. Also pass WebView to init method. (-[WebHTMLView _interceptEditingKeyEvent:shouldSaveCommand:]): Ditto. * WebView/WebTextCompletionController.h: Copied from mac/WebView/WebHTMLView.mm. * WebView/WebTextCompletionController.mm: Copied from mac/WebView/WebHTMLView.mm. Changed initializer to pass in a spearate WebView and WebHTMLView, to smooth the way for handling viewless mode properly in the future. 2009-05-30 David Kilzer <ddkilzer@apple.com> Add JSLock to -[WebScriptCallFrame scopeChain] Reviewed by Darin Adler. In Debug builds of WebKit, Dashcode launching MobileSafari could cause the ASSERT(JSLock::lockCount() > 0) assertion to fire in JSC::Heap::heapAllocate() because the JSLock wasn't taken. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame scopeChain]): Take JSLock before calling into JavaScriptCore. 2009-05-28 Mark Rowe <mrowe@apple.com> Rubber-stamped by Dan Bernstein. Build fix. Move off a deprecated NSFileManager method. * Misc/WebNSFileManagerExtras.h: * Misc/WebNSFileManagerExtras.m: (-[NSFileManager destinationOfSymbolicLinkAtPath:error:]): Implement a new-in-Leopard method for Tiger to use. (-[NSFileManager attributesOfItemAtPath:error:]): Ditto. * Plugins/WebNetscapePluginPackage.mm: (-[WebNetscapePluginPackage _initWithPath:]): Use the new non-deprecated methods. 2009-05-28 Dirk Schulze <krit@webkit.org> Reviewed by Nikolas Zimmermann. Added new build flag --filters. More details in WebCore/ChangeLog. * Configurations/FeatureDefines.xcconfig: 2009-05-27 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=26009 <rdar://problem/6925656> REGRESSION (r43973): Problems While Working With OpenVanilla * WebView/WebHTMLView.mm: (-[WebHTMLView _updateSelectionForInputManager]): Don't call updateWindows if the selection is None. This routinely happens during editing, and it doesn't mean that we left an editable area (in which case the selection changes to a non-editable one). 2009-05-26 Sam Weinig <sam@webkit.org> Reviewed by Brady Eidson. Fix for <rdar://problem/6916371> iWeb 'Announce' button does nothing after publishing to MobileMe Add linked-on-or-after check to allow older WebKit apps to use the old behavior of sniffing everything (including file: urls) * Misc/WebKitVersionChecks.h: * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): 2009-05-26 Stephanie Lewis <slewis@apple.com> Reviewed by Ada Chan and Oliver Hunt. Remove WebView observers in during fast teardown. <rdar://problem/6922619> REGRESSION (Tiger-only?): After restoring windows from the previous session, a crash occurs while attempting to quit Safari * WebView/WebView.mm: (-[WebView _closeWithFastTeardown]): 2009-05-26 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. <rdar://problem/6901751> REGRESSION (r35515): Tiger crash painting the selection on registration page of car2go.com Remove WKCGContextIsSafeToClip. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2009-05-26 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - fix <rdar://problem/6922371> REGRESSION (r43973): Can't type first character with an umlaut, circumflex, or accent in Mail or in a wiki * WebView/WebHTMLView.mm: (isTextInput): Moved here. (isInPasswordField): Moved here. (-[WebHTMLView becomeFirstResponder]): Update the exposeInputContext flag and let NSApplication update the input manager with the new input context if necessary. (-[WebHTMLView _updateSelectionForInputManager]): Changed to use the NSApp global instead of +[NSApplication sharedApplication]. 2009-05-26 Mark Rowe <mrowe@apple.com> Fix the Tiger build. * Misc/WebNSObjectExtras.mm: (-[NSInvocation _webkit_invokeAndHandleException:]): Rename the local variable so that it doesn't conflict with a member variable on Tiger. 2009-05-26 Darin Adler <darin@apple.com> Reviewed by Mark Rowe. <rdar://problem/6921835> REGRESSION (r44115): Crash in Leopard Mail viewing message Fix case where we autorelease an object on the main thread that we are returning to another thread when using our _webkit_invokeOnMainThread method. * Misc/WebNSObjectExtras.mm: (returnTypeIsObject): Added. (-[WebMainThreadInvoker forwardInvocation:]): Autorelease the object on the calling thread, balancing a retain done on the main thread. (-[NSInvocation _webkit_invokeAndHandleException:]): Retain the object on the main thread. 2009-05-26 David Hyatt <hyatt@apple.com> Back out the workaround for Mail crashing. Darin is working on the real fix. * Misc/WebNSObjectExtras.mm: (-[WebMainThreadInvoker forwardInvocation:]): 2009-05-26 David Hyatt <hyatt@apple.com> Reviewed by Darin Adler. Fix for https://bugs.webkit.org/show_bug.cgi?id=25969. Stop using notifications for boundsChanged, since the notifications are being sent too late. Since subviews get resized before parents do, the notification comes in telling the WebHTMLView that its size has changed *before* we've done setNeedsLayout in the WebView size change callback. Become more like the Windows platform and just do the bounds changed immediately as our size is being altered by subclassing setFrameSize in WebView. Also patch WebDynamicScrollbarsView to detect the case where neither axis is really spilling out past the viewport, so that in shrinking situations we figure out that we don't need scrollbars any more. * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): * WebView/WebView.mm: (-[WebView _boundsChangedToNewSize:]): (-[WebView setFrameSize:]): (-[WebView viewWillMoveToWindow:]): (-[WebView viewDidMoveToWindow]): 2009-05-25 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. - WebKit side of <rdar://problem/6914001>. * Plugins/Hosted/NetscapePluginHostManager.h: * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::didCreateWindow): Iterate over all plug-in hosts. If one is in full-screen mode, make sure to activate the WebKit app instead. * Plugins/Hosted/NetscapePluginHostProxy.h: (WebKit::NetscapePluginHostProxy::isMenuBarVisible): Add getter. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCEvaluate): Add allowPopups flag. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::PluginRequest::PluginRequest): (WebKit::NetscapePluginInstanceProxy::PluginRequest::allowPopups): (WebKit::NetscapePluginInstanceProxy::loadURL): (WebKit::NetscapePluginInstanceProxy::evaluateJavaScript): (WebKit::NetscapePluginInstanceProxy::loadRequest): (WebKit::NetscapePluginInstanceProxy::evaluate): Use "allowPopups" instead of "userGesture". * Plugins/Hosted/WebKitPluginClient.defs: Add allowPopups argument to Evaluate. * Plugins/Hosted/WebKitPluginHostTypes.h: Use "allowPopups" instead of "userGesture". * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::createWindow): Call didCreateWindow here. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchCreatePage): Ditto. 2009-05-25 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. - Fix <rdar://problem/6915849>. Release the placeholder window after -[NSApplication runModalForWindow] returns. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::beginModal): (WebKit::NetscapePluginHostProxy::endModal): 2009-05-24 Dan Bernstein <mitz@apple.com> - revert an accidental change from r43964. * WebView/WebView.mm: (+[WebView _setShouldUseFontSmoothing:]): 2009-05-24 Darin Adler <darin@apple.com> Reviewed by Dan Bernstein and Tim Hatcher. <rdar://problem/6913045> New console message spewed by automator CLI after installing JetstreamLeo40B21a * Misc/WebNSObjectExtras.mm: (-[WebMainThreadInvoker initWithTarget:]): Tweaked argument name. (-[WebMainThreadInvoker forwardInvocation:]): Removed call to retainArguments. This was unneeded and in the case of a newly created but not yet fully initialized NSView object it caused the abovementioned bug. (-[WebMainThreadInvoker handleException:]): Tweaked argument name. Added assertion. (-[NSInvocation _webkit_invokeAndHandleException:]): Tweaked name of local variable that holds the exception. 2009-05-23 David Kilzer <ddkilzer@apple.com> Part 2 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr <https://bugs.webkit.org/show_bug.cgi?id=25495> Reviewed by Oliver Hunt. * History/WebHistory.mm: (-[WebHistory _visitedURL:withTitle:method:wasFailure:]): Return 0 instead of an empty auto_ptr<>. * History/WebHistoryItem.mm: (-[WebHistoryItem initFromDictionaryRepresentation:]): Use OwnPtr<> instead of auto_ptr<> for stack variable. * WebCoreSupport/WebChromeClient.h: (WebChromeClient::createHTMLParserQuirks): Return a PassOwnPtr<> instead of a raw HTMLParserQuirks pointer. 2009-05-23 David Kilzer <ddkilzer@apple.com> Part 1 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr <https://bugs.webkit.org/show_bug.cgi?id=25495> Reviewed by Oliver Hunt. * ForwardingHeaders/wtf/OwnPtrCommon.h: Added. * ForwardingHeaders/wtf/PassOwnPtr.h: Added. 2009-05-22 Darin Adler <darin@apple.com> Reviewed by Dan Bernstein. - Fix <rdar://problem/6913765> REGRESSION (r42331-r42334): Extra scroll bars appearing on Welcome panels of iLife '09 apps * WebView/WebView.mm: (needsUnwantedScrollBarWorkaround): Added. Checks if this is a panel where scroll bars are unwanted. For safety, limited to only Apple applications. (-[WebView viewDidMoveToWindow]): If the workaround is needed, disallow scrolling the main frame. This prevents scroll bars from appearing. 2009-05-22 Adam Barth <abarth@webkit.org> Reviewed by Maciej Stachowiak. https://bugs.webkit.org/show_bug.cgi?id=25955 Remove the policyBaseURL parameter from setCookie. This parameter is redudant with the document parameter. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::setCookies): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView setVariable:forURL:value:length:]): 2009-05-21 Darin Fisher <darin@chromium.org> Fix-up coding style. * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::getAutoCorrectSuggestionForMisspelledWord): 2009-05-20 Siddhartha Chattopadhyaya <sidchat@google.com> Reviewed by Justin Garcia. Add automatic spell correction support in WebKit https://bugs.webkit.org/show_bug.cgi?id=24953 * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::getAutoCorrectSuggestionForMisspelledWord): 2009-05-21 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. <rdar://problem/6907542> REGRESSION (r43143): Hang in RenderLineBoxList::dirtyLinesFromChangedChild when clicking link to load Flash animation (http://www.roambi.com) * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::respondToChangedSelection): Don't call -[NSApplication updateWindows] here, WebHTMLView can take care of this. * WebView/WebHTMLView.mm: (-[WebHTMLView inputContext]): Use a precomputed boolean stored in WebHTMLViewPrivate, as calling isTextInput() is not always safe. (-[WebHTMLView textStorage]): Ditto. (-[WebHTMLView _updateSelectionForInputManager]): Update _private->exposeInputContext when selection changes, and let AppKit update its cache if necessary. 2009-05-21 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. <rdar://problem/5579292> REGRESSION (2-3): "Default default" encoding for Korean changed from Korean (Windows, DOS) to Korean (ISO 2022-KR), which breaks some sites * WebView/WebPreferences.mm: (+[WebPreferences _setInitialDefaultTextEncodingToSystemEncoding]): Update the existing fix for the changed result of CFStringConvertEncodingToIANACharSetName(). 2009-05-21 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. <rdar://problem/6883758> REGRESSION (r43143): First character typed with input method does not go into inline hole (seen with Chinese & Kotoeri on top Chinese website www.baidu.com) * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::respondToChangedSelection): Call -[NSApplication updateWindows] to make AppKit re-fetch the input context when selection changes. Since we use SelectionController to check whether the view is editable, it is important not to re-fetch the context too early, e.g. from a focus changed notification. 2009-05-21 Eric Seidel <eric@webkit.org> Reviewed by Alexey Proskuryakov. Rename DragController::dragOperation() to sourceDragOperation() for clarity * WebView/WebHTMLView.mm: (-[WebHTMLView draggingSourceOperationMaskForLocal:]): 2009-05-21 Dan Bernstein <mitz@apple.com> Reviewed by Anders Carlsson. - WebKit part of <rdar://problem/6901751> REGRESSION (r35515): Tiger crash painting the selection on registration page of car2go.com * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Added CGContextIsSafeToClip. 2009-05-20 Stephanie Lewis <slewis@apple.com> Update the order files. <rdar://problem/6881750> Generate new order files. * WebKit.order: 2009-05-20 Brady Eidson <beidson@apple.com> Reviewed by Darin Adler. <rdar://problem/6905336> REGRESSION: "Clear History" does not save empty history to disk * History/WebHistory.mm: (-[WebHistoryPrivate data]): If there are no entries, return an empty NSData instead of nil. 2009-05-20 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler and Kevin Decker. WebKit side of <rdar://problem/6895072> Pass the localization as a launch property. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::spawnPluginHost): 2009-05-20 Dan Bernstein <mitz@apple.com> - fix the build after r43918 * WebCoreSupport/WebChromeClient.h: (WebChromeClient::setCursor): 2009-05-20 Darin Adler <darin@apple.com> Reviewed by John Sullivan. <rdar://problem/4023899> Shift-Tab skips key views in toolbar in Safari, although Tab iterates through them properly * WebView/WebView.mm: (-[WebView previousValidKeyView]): Work around a bug in -[NSView previousValidKeyView]. 2009-05-19 Timothy Hatcher <timothy@apple.com> Add a new private API method that will dispatch pending loads that have been scheduled because of recent DOM additions or style changes. <rdar://problem/6889218> REGRESSION: Some iChat transcript resources are not loaded because willSendRequest doesn't happen immediately Reviewed by Antti Koivisto. * WebView/WebView.mm: (-[WebView _dispatchPendingLoadRequests]): Call Loader::servePendingRequests(). * WebView/WebViewPrivate.h: Added _dispatchPendingLoadRequests. 2009-05-18 Sam Weinig <sam@webkit.org> <rdar://problem/6899044> Can't see Apple ad on nytimes.com unless I spoof the user agent Add user agent hack for pointroll.com. Reviewed by Steve Falkenburg. * WebView/WebView.mm: (-[WebView WebCore::_userAgentForURL:WebCore::]): 2009-05-16 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig and Dan Bernstein. Fix <rdar://problem/6889644> * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::spawnPluginHost): 2009-05-16 Dan Bernstein <mitz@apple.com> - revert an accidental change from r43802. * WebInspector/WebInspector.mm: 2009-05-16 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. <rdar://problem/6895347> Mouse wheeling in the QuickTime plug-in (incorrectly) scrolls the page Fix logic. The plug-in returns true if it handled the event. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView sendEvent:isDrawRect:]): 2009-05-16 Dan Bernstein <mitz@apple.com> Reviewed by Alexey Proskuryakov. - fix <rdar://problem/6873305> Two distinct characters are not displayed correctly with 2 of the font selections from the stickies widget * WebView/WebHTMLView.mm: (-[WebHTMLView _plainTextFromPasteboard:]): Return precomposed text. This is consistent with -_documentFragmentFromPasteboard:forType:inContext:subresources:. 2009-05-15 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Fix <rdar://problem/6875398>. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::instantiatePlugin): If we failed to instantiate the plug-in, call cleanup() so that any streams created by the plug-in from its NPP_New callback are destroyed. * Plugins/Hosted/NetscapePluginInstanceProxy.h: Make cleanup() public. 2009-05-15 Darin Adler <darin@apple.com> Reviewed by Anders Carlsson. <rdar://problem/6889823> hash table iterator used after hash table modified in ProxyInstance::fieldNamed() when viewing movie trailer * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::methodsNamed): Move add call after the waitForReply call. Anders says that by the time we return someone else might have done the same add for us. (WebKit::ProxyInstance::fieldNamed): Ditto. 2009-05-15 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. <rdar://problem/6892055> Replace WKN_GetLocation with WKN_ResolveURL (WKN_GetLocation was confusing and did not take the base URL into account) * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCResolveURL): New MIG callback. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::resolveURL): Use FrameLoader::complete URL here. * Plugins/Hosted/WebKitPluginClient.defs: Add new MIG definition. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView resolvedURLStringForURL:target:]): * Plugins/WebNetscapeContainerCheckPrivate.h: * Plugins/WebNetscapeContainerCheckPrivate.mm: (browserContainerCheckFuncs): * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView resolveURL:forTarget:]): * Plugins/npapi.mm: (WKN_ResolveURL): 2009-05-15 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - fix <rdar://problem/6892052> WebTextIterator should not “emit characters between all visible positions†* WebView/WebTextIterator.mm: (-[WebTextIterator initWithRange:]): Changed to construct a TextIterator with emitCharactersBetweenAllVisiblePositions set to false. 2009-05-15 Mark Rowe <mrowe@apple.com> Reviewed by Dave Kilzer. Look for libWebKitSystemInterface.a in a more reasonable location. * Configurations/DebugRelease.xcconfig: 2009-05-14 David Hyatt <hyatt@apple.com> Reviewed by Tim Hatcher. Fix for <rdar://problem/6886217> REGRESSION (S4 beta-ToT): Adium chat window contents no longer resize. Technically this is a bug in Adium. It appears that Adium has subclassed the WebView and implemented viewDidMoveToWindow in its subclass improperly. It doesn't call up to the base class WebView like it should and so our boundsChanged notification never gets added. Reduce the dependence on viewDidMoveToWindow by moving the registration of observers into viewWillMoveToWindow instead. * WebView/WebView.mm: (-[WebView addSizeObserversForWindow:]): (-[WebView removeWindowObservers]): (-[WebView addWindowObserversForWindow:]): (-[WebView viewWillMoveToWindow:]): (-[WebView viewDidMoveToWindow]): (-[WebView viewDidMoveToSuperview]): 2009-05-14 David Levin <levin@chromium.org> Reviewed by Eric Seidel. https://bugs.webkit.org/show_bug.cgi?id=24704 Allow the local cache directory to be set using a defaults key. * Misc/WebKitNSStringExtras.h: * Misc/WebKitNSStringExtras.m: (+[NSString _webkit_localCacheDirectoryWithBundleIdentifier:]): * WebKit.exp: 2009-05-14 Darin Adler <darin@apple.com> Reviewed by Adam Roben. <rdar://problem/6879999> Automator actions that use WebKit on a background thread fail when run outside of Automator * WebView/WebView.mm: (clientNeedsWebViewInitThreadWorkaround): Added. Contains new broader rule. (needsWebViewInitThreadWorkaround): Changed to call clientNeedsWebViewInitThreadWorkaround. 2009-05-14 Darin Adler <darin@apple.com> Reviewed by John Sullivan. Bug 24049: Second right-click crashes safari when alert invoked https://bugs.webkit.org/show_bug.cgi?id=24049 rdar://problem/6878977 * WebView/WebHTMLView.mm: (-[WebHTMLView rightMouseUp:]): Added a retain/autorelease of the event. (-[WebHTMLView menuForEvent:]): Ditto. Also cleaned up the logic here and eliminated some use of pointers that might be invalid after calling through to WebCore. (-[WebHTMLView scrollWheel:]): Ditto. (-[WebHTMLView acceptsFirstMouse:]): Ditto. (-[WebHTMLView shouldDelayWindowOrderingForEvent:]): Ditto. (-[WebHTMLView mouseDown:]): Ditto. (-[WebHTMLView mouseDragged:]): Ditto. (-[WebHTMLView mouseUp:]): Ditto. (-[WebHTMLView keyDown:]): Ditto. (-[WebHTMLView keyUp:]): Ditto. (-[WebHTMLView flagsChanged:]): Ditto. (-[WebHTMLView performKeyEquivalent:]): Ditto. 2009-05-14 Mark Rowe <mrowe@apple.com> Rubber-stamped by Darin Adler. <rdar://problem/6681868> When building with Xcode 3.1.3 should be using gcc 4.2 The meaning of XCODE_VERSION_ACTUAL is more sensible in newer versions of Xcode. Update our logic to select the compiler version to use the more appropriate XCODE_VERSION_MINOR if the version of Xcode supports it, and fall back to XCODE_VERSION_ACTUAL if not. * Configurations/Base.xcconfig: 2009-05-13 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. WebKit side of <rdar://problem/6884476>. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCGetLocation): Forward this to the plug-in instance proxy. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::getLocation): Ask the plug-in view for the location. * Plugins/Hosted/WebKitPluginClient.defs: Add MIG definition. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView locationStringForTarget:]): Return the URL for a given frame. * Plugins/WebNetscapeContainerCheckPrivate.h: Bump version. Add new declaration to the vtable. * Plugins/WebNetscapeContainerCheckPrivate.mm: (browserContainerCheckFuncs): Add new declaration to the vtable. * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView locationForTarget:]): Call the base class method. * Plugins/npapi.mm: (WKN_GetLocation): Forward this to the plug-in view. 2009-05-13 Douglas R. Davidson <ddavidso@apple.com> Reviewed by Darin Adler. <rdar://problem/6871587> Smart Copy/Paste setting should persist as continuous spell checking setting does * WebView/WebPreferenceKeysPrivate.h: Added WebSmartInsertDeleteEnabled. * WebView/WebView.mm: (-[WebViewPrivate init]): Initialize based on WebSmartInsertDeleteEnabled default. (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): Removed code that initialized here. (-[WebView setSmartInsertDeleteEnabled:]): Set default here was with continuous spell checking setting. 2009-05-13 Darin Adler <darin@apple.com> Revert the parser arena change. It was a slowdown, not a speedup. Better luck next time (I'll break it up into pieces). 2009-05-13 Darin Adler <darin@apple.com> Reviewed by Cameron Zwarich. Bug 25674: syntax tree nodes should use arena allocation https://bugs.webkit.org/show_bug.cgi?id=25674 * Plugins/Hosted/NetscapePluginInstanceProxy.mm: Updated includes. New ones needed due to reducing includes of JSDOMBinding.h. * WebView/WebScriptDebugger.mm: Ditto. 2009-05-13 Douglas R. Davidson <ddavidso@apple.com> Reviewed by Darin Adler. <rdar://problem/6879145> Generate a contextual menu item allowing autocorrections to easily be changed back. Refrain from re-correcting items that have already been autocorrected once. * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory contextMenuItemTagChangeBack:]): * WebView/WebUIDelegatePrivate.h: 2009-05-12 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Fix <rdar://problem/6878105>. When instantiating the QT plug-in under Dashboard, force "kiosk mode". * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]): 2009-05-12 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - declare a forgotten method * DOM/WebDOMOperationsPrivate.h: Declare -[DOMNode markupString] in the WebDOMNodeOperationsPendingPublic category. 2009-05-10 Alexey Proskuryakov <ap@webkit.org> Reviewed by Dan Bernstein. <rdar://problem/6870383> Have to enter credentials twice when downloading from a protected page * Misc/WebDownload.m: Removed. * Misc/WebDownload.mm: Copied from WebKit/mac/Misc/WebDownload.m. (-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]): Try to use credentials from WebCore storage. 2009-05-08 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> Not reviewed. Fix clean builds, forgot to land name() -> formControlName() rename patch in WebKit. Only landed the WebCore side. * WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation elementWithName:inForm:]): 2009-05-08 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. - Fix <rdar://problem/6866712>. Instead of just caching whether a plug-in object _has_ a field or method, also add an entry to the cache if it _doesn't_ have a certain field or method. This way we have to make fewer calls to the plug-in host. * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::methodsNamed): (WebKit::ProxyInstance::fieldNamed): 2009-05-08 Douglas R. Davidson <ddavidso@apple.com> Reviewed by Darin Adler. Fixes for <rdar://problem/6852771>. Disable text checking menu items if view is not editable. * WebView/WebHTMLView.mm: (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): (-[WebHTMLView smartInsertDeleteEnabled]): (-[WebHTMLView setSmartInsertDeleteEnabled:]): (-[WebHTMLView toggleSmartInsertDelete:]): * WebView/WebHTMLViewInternal.h: 2009-05-08 Alexey Proskuryakov <ap@webkit.org> Reviewed by Maciej Stachowiak. <rdar://problem/6868773> NPN_GetAuthenticationInfo does not work with non-permanent credentials * Plugins/WebBaseNetscapePluginView.mm: (WebKit::getAuthenticationInfo): Ask WebCore for credentials first (but also ask NSURLCredentialStorage, because WebCore won't know about permanent credentials). 2009-05-05 Ben Murdoch <benm@google.com> Reviewed by Eric Seidel. Add #if ENABLE(DATABASE) guards around database code so toggling ENABLE_DATABASE off does not break builds. https://bugs.webkit.org/show_bug.cgi?id=24776 * Storage/WebDatabaseManager.mm: * Storage/WebDatabaseManagerInternal.h: * Storage/WebDatabaseManagerPrivate.h: * Storage/WebDatabaseTrackerClient.h: * Storage/WebDatabaseTrackerClient.mm: * Storage/WebSecurityOrigin.mm: (-[WebSecurityOrigin usage]): (-[WebSecurityOrigin quota]): (-[WebSecurityOrigin setQuota:]): * Storage/WebSecurityOriginPrivate.h: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): 2009-05-04 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Fix <rdar://problem/6797644>. Make sure to send a reply even when an instance proxy can't be found. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCEvaluate): (WKPCInvoke): (WKPCInvokeDefault): (WKPCGetProperty): (WKPCHasProperty): (WKPCHasMethod): (WKPCEnumerate): 2009-05-04 Darin Adler <darin@apple.com> Reviewed by Eric Seidel. Bug 24924: remove Document.h include of Attr.h and HTMLCollection.h, and NamedMappedAttrMap.h include of MappedAttribute.h https://bugs.webkit.org/show_bug.cgi?id=24924 * WebView/WebFrame.mm: Added include of CSSMutableStyleDeclaration.h and ScriptValue.h. 2009-05-02 Geoffrey Garen <ggaren@apple.com> Reviewed by Sam Weinig. Simplified null-ish JSValues. Replaced calls to noValue() with calls to JSValue() (which is what noValue() returned). Removed noValue(). Removed "JSValue()" initialiazers, since default construction happens... by default. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame evaluateWebScript:]): 2009-05-02 Alexey Proskuryakov <ap@webkit.org> Reviewed by Dan Bernstein. <rdar://problem/6741615> REGRESSION (r38629): Shortcut "Flag/Junk" in MobileMe does not work when Kotoeri is used. * WebView/WebHTMLView.mm: (-[WebHTMLView inputContext]): Return a nil input context when focus is not in editable content. 2009-05-01 Geoffrey Garen <ggaren@apple.com> Rubber Stamped by Sam Weinig. Renamed JSValuePtr => JSValue. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::evaluate): (WebKit::NetscapePluginInstanceProxy::invoke): (WebKit::NetscapePluginInstanceProxy::invokeDefault): (WebKit::NetscapePluginInstanceProxy::construct): (WebKit::NetscapePluginInstanceProxy::getProperty): (WebKit::NetscapePluginInstanceProxy::setProperty): (WebKit::NetscapePluginInstanceProxy::hasMethod): (WebKit::NetscapePluginInstanceProxy::addValueToArray): (WebKit::NetscapePluginInstanceProxy::marshalValue): (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray): (WebKit::NetscapePluginInstanceProxy::demarshalValue): (WebKit::NetscapePluginInstanceProxy::demarshalValues): * Plugins/Hosted/ProxyInstance.h: * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyField::valueFromInstance): (WebKit::ProxyField::setValueToInstance): (WebKit::ProxyInstance::invoke): (WebKit::ProxyInstance::invokeMethod): (WebKit::ProxyInstance::invokeDefaultMethod): (WebKit::ProxyInstance::invokeConstruct): (WebKit::ProxyInstance::defaultValue): (WebKit::ProxyInstance::stringValue): (WebKit::ProxyInstance::numberValue): (WebKit::ProxyInstance::booleanValue): (WebKit::ProxyInstance::valueOf): (WebKit::ProxyInstance::fieldValue): (WebKit::ProxyInstance::setFieldValue): * WebView/WebFrame.mm: (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame _convertValueToObjcValue:]): (-[WebScriptCallFrame exception]): (-[WebScriptCallFrame evaluateWebScript:]): * WebView/WebView.mm: (aeDescFromJSValue): (-[WebView aeDescByEvaluatingJavaScriptFromString:]): 2009-05-01 Pavel Feldman <pfeldman@chromium.org> Reviewed by Timothy Hatcher. Add a FrameLoaderClient callback for the ResourceRetrievedByXMLHttpRequest. https://bugs.webkit.org/show_bug.cgi?id=25347 * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest): 2009-04-30 David Kilzer <ddkilzer@apple.com> Provide a mechanism to create a quirks delegate for HTMLParser Reviewed by David Hyatt. * WebCoreSupport/WebChromeClient.h: (WebChromeClient::createHTMLParserQuirks): Added. The default implementation of this factory method returns 0. 2009-04-30 Dimitri Glazkov <dglazkov@chromium.org> Reviewed by Timothy Hatcher. https://bugs.webkit.org/show_bug.cgi?id=25470 Extend the cover of ENABLE_JAVASCRIPT_DEBUGGER to profiler. * Configurations/FeatureDefines.xcconfig: Added ENABLE_JAVASCRIPT_DEBUGGER define. 2009-04-30 Kevin Decker <kdecker@apple.com> Reviewed by Anders Carlson. <rdar://problem/6823049> Fix an issue where some plug-ins would cause the application icon to constantly bounce up and down in the Dock. * Plugins/Hosted/NetscapePluginHostProxy.h: Change m_placeholderWindow ivar to be a subclass of NSWindow, WebPlaceholderModalWindow. * Plugins/Hosted/NetscapePluginHostProxy.mm: Added WebPlaceholderModalWindow NSWindow subclass. (-[WebPlaceholderModalWindow _wantsUserAttention]): Prevent NSApp from calling requestUserAttention: when the window is shown modally, even if the app is inactive. (WebKit::NetscapePluginHostProxy::beginModal): NSWindow -> WebPlaceholderModalWindow. 2009-04-30 Pavel Feldman <pfeldman@chromium.org> Reviewed by Dimitri Glazkov. https://bugs.webkit.org/show_bug.cgi?id=25342 Add MessageSource and MessageLevel parameters to the ChromeClient::addMessageToConsole. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::addMessageToConsole): 2009-04-29 Mark Rowe <mrowe@apple.com> More build fixing after r43037. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::invoke): (WebKit::NetscapePluginInstanceProxy::invokeDefault): (WebKit::NetscapePluginInstanceProxy::construct): (WebKit::NetscapePluginInstanceProxy::demarshalValues): 2009-04-29 Dan Bernstein <mitz@apple.com> Reviewed by Simon Fraser. - WebKit part of <rdar://problem/6609509> Select All and then Delete should put Mail editing back into the same state as a new message * WebView/WebView.mm: (-[WebView _selectionIsCaret]): Added. (-[WebView _selectionIsAll]): Added. Returns whether the selection encompasses the entire document. * WebView/WebViewPrivate.h: 2009-04-29 Douglas Davidson <ddavidso@apple.com> Reviewed by Justin Garcia. <rdar://problem/6836921> Mail exhibits issues with text checking, e.g. menu items not always validated correctly * WebView/WebHTMLView.mm: (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): (-[WebHTMLView orderFrontSubstitutionsPanel:]): * WebView/WebView.mm: (-[WebView validateUserInterfaceItemWithoutDelegate:]): 2009-04-29 David Hyatt <hyatt@apple.com> Reviewed by Dan Bernstein. Fix a bug in the bounds checking for setNeedsLayout dirtying when a WebView's size changes. The superview of the WebView was being incorrectly checked instead of the WebView itself. * WebView/WebView.mm: (-[WebView _boundsChanged]): 2009-04-29 Kevin Decker <kdecker@apple.com> Reviewed by Anders Carlson. Allow WKN_CheckIfAllowedToLoadURL() to take an optional void* context parameter. * Plugins/WebNetscapeContainerCheckContextInfo.h: * Plugins/WebNetscapeContainerCheckContextInfo.mm: (-[WebNetscapeContainerCheckContextInfo initWithCheckRequestID:callbackFunc:context:]): (-[WebNetscapeContainerCheckContextInfo callback]): (-[WebNetscapeContainerCheckContextInfo context]): * Plugins/WebNetscapeContainerCheckPrivate.h: * Plugins/WebNetscapeContainerCheckPrivate.mm: (browserContainerCheckFuncs): * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView checkIfAllowedToLoadURL:frame:callbackFunc:context:]): (-[WebNetscapePluginView _containerCheckResult:contextInfo:]): * Plugins/npapi.mm: (WKN_CheckIfAllowedToLoadURL): 2009-04-29 David Hyatt <hyatt@apple.com> Reviewed by John Sullivan. Fix for <rdar://problem/6835573>, Find Banner turns invisible when WebView is resized. Make sure not to resize the interior views of a WebView in response to its bounds changing when not using viewless WebKit. Auto-resizing rules were already in place to handle size adjustments for us. Just mark as needing layout and do nothing else. This does mean viewless WebKit is broken with the Find Banner, and that will likely require a Safari change (using a new API that will enable clients to define the edges of the content area as offsets from the sides of the WebView). * WebView/WebView.mm: (-[WebView _boundsChanged]): 2009-04-28 Geoffrey Garen <ggaren@apple.com> Rubber stamped by Beth Dakin. Removed scaffolding supporting dynamically converting between 32bit and 64bit value representations. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::marshalValues): 2009-04-28 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker and Darin Adler. Fix <rdar://problem/6836132>. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCCheckIfAllowedToLoadURL): Call the instance proxy. (WKPCCancelCheckIfAllowedToLoadURL): Ditto. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): Initialize the check ID counter. (WebKit::NetscapePluginInstanceProxy::checkIfAllowedToLoadURL): Create a WebPluginContainerCheck, add it to the map, and start it. (WebKit::NetscapePluginInstanceProxy::cancelCheckIfAllowedToLoadURL): Remove the check from the map. (WebKit::NetscapePluginInstanceProxy::checkIfAllowedToLoadURLResult): Call the WKPH MIG callback. * Plugins/Hosted/WebHostedNetscapePluginView.h: * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView _webPluginContainerCancelCheckIfAllowedToLoadRequest:]): Call the instance proxy. (-[WebHostedNetscapePluginView _containerCheckResult:contextInfo:]): Ditto. * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHost.defs: Add MIG declarations. 2009-04-28 Dan Bernstein <mitz@apple.com> Reviewed by John Sullivan. - fix <rdar://problem/6786360> Make PDF an insertable pasteboard type * WebCoreSupport/WebPasteboardHelper.mm: (WebPasteboardHelper::insertablePasteboardTypes): * WebView/WebHTMLView.mm: (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:]): (+[WebHTMLView _insertablePasteboardTypes]): (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]): 2009-04-27 Douglas R. Davidson <ddavidso@apple.com> Add the various switches and context menu items needed for <rdar://problem/6724106> WebViews need to implement text checking and adopt updatePanels in place of old SPI _updateGrammar. Reviewed by Justin Garcia. * WebCoreSupport/WebContextMenuClient.mm: (fixMenusReceivedFromOldClients): * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::uppercaseWord): (WebEditorClient::lowercaseWord): (WebEditorClient::capitalizeWord): (WebEditorClient::showSubstitutionsPanel): (WebEditorClient::substitutionsPanelIsShowing): (WebEditorClient::toggleSmartInsertDelete): (WebEditorClient::isAutomaticQuoteSubstitutionEnabled): (WebEditorClient::toggleAutomaticQuoteSubstitution): (WebEditorClient::isAutomaticLinkDetectionEnabled): (WebEditorClient::toggleAutomaticLinkDetection): (WebEditorClient::isAutomaticDashSubstitutionEnabled): (WebEditorClient::toggleAutomaticDashSubstitution): (WebEditorClient::isAutomaticTextReplacementEnabled): (WebEditorClient::toggleAutomaticTextReplacement): (WebEditorClient::isAutomaticSpellingCorrectionEnabled): (WebEditorClient::toggleAutomaticSpellingCorrection): (WebEditorClient::checkTextOfParagraph): * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory contextMenuItemTagShowColors]): (-[WebViewFactory contextMenuItemTagCorrectSpellingAutomatically]): (-[WebViewFactory contextMenuItemTagSubstitutionsMenu]): (-[WebViewFactory contextMenuItemTagShowSubstitutions:]): (-[WebViewFactory contextMenuItemTagSmartCopyPaste]): (-[WebViewFactory contextMenuItemTagSmartQuotes]): (-[WebViewFactory contextMenuItemTagSmartDashes]): (-[WebViewFactory contextMenuItemTagSmartLinks]): (-[WebViewFactory contextMenuItemTagTextReplacement]): (-[WebViewFactory contextMenuItemTagTransformationsMenu]): (-[WebViewFactory contextMenuItemTagMakeUpperCase]): (-[WebViewFactory contextMenuItemTagMakeLowerCase]): (-[WebViewFactory contextMenuItemTagCapitalize]): * WebView/WebHTMLView.mm: (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): (-[WebHTMLView isAutomaticQuoteSubstitutionEnabled]): (-[WebHTMLView setAutomaticQuoteSubstitutionEnabled:]): (-[WebHTMLView toggleAutomaticQuoteSubstitution:]): (-[WebHTMLView isAutomaticLinkDetectionEnabled]): (-[WebHTMLView setAutomaticLinkDetectionEnabled:]): (-[WebHTMLView toggleAutomaticLinkDetection:]): (-[WebHTMLView isAutomaticDashSubstitutionEnabled]): (-[WebHTMLView setAutomaticDashSubstitutionEnabled:]): (-[WebHTMLView toggleAutomaticDashSubstitution:]): (-[WebHTMLView isAutomaticTextReplacementEnabled]): (-[WebHTMLView setAutomaticTextReplacementEnabled:]): (-[WebHTMLView toggleAutomaticTextReplacement:]): (-[WebHTMLView isAutomaticSpellingCorrectionEnabled]): (-[WebHTMLView setAutomaticSpellingCorrectionEnabled:]): (-[WebHTMLView toggleAutomaticSpellingCorrection:]): * WebView/WebHTMLViewInternal.h: * WebView/WebPreferenceKeysPrivate.h: * WebView/WebUIDelegatePrivate.h: * WebView/WebView.mm: (-[WebViewPrivate init]): (-[WebView validateUserInterfaceItemWithoutDelegate:]): (-[WebView setGrammarCheckingEnabled:]): (-[WebView isAutomaticQuoteSubstitutionEnabled]): (-[WebView isAutomaticLinkDetectionEnabled]): (-[WebView isAutomaticDashSubstitutionEnabled]): (-[WebView isAutomaticTextReplacementEnabled]): (-[WebView isAutomaticSpellingCorrectionEnabled]): (-[WebView setAutomaticQuoteSubstitutionEnabled:]): (-[WebView toggleAutomaticQuoteSubstitution:]): (-[WebView setAutomaticLinkDetectionEnabled:]): (-[WebView toggleAutomaticLinkDetection:]): (-[WebView setAutomaticDashSubstitutionEnabled:]): (-[WebView toggleAutomaticDashSubstitution:]): (-[WebView setAutomaticTextReplacementEnabled:]): (-[WebView toggleAutomaticTextReplacement:]): (-[WebView setAutomaticSpellingCorrectionEnabled:]): (-[WebView toggleAutomaticSpellingCorrection:]): * WebView/WebViewPrivate.h: 2009-04-27 David Kilzer <ddkilzer@apple.com> Consolidate runtime application checks for Apple Mail and Safari Reviewed by Mark Rowe and Darin Adler. * WebCoreSupport/WebContextMenuClient.mm: (isAppleMail): Removed. (fixMenusToSendToOldClients): Switched to use applicationIsAppleMail(). * WebView/WebFrame.mm: (-[WebFrame reload]): Switched to use applicationIsSafari(). * WebView/WebPDFView.mm: (-[WebPDFView menuForEvent:]): Ditto. * WebView/WebResource.mm: (+[WebResource _needMailThreadWorkaroundIfCalledOffMainThread]): Switched to use applicationIsAppleMail(). * WebView/WebView.mm: (runningLeopardMail): Ditto. (runningTigerMail): Ditto. (-[WebView _needsKeyboardEventDisambiguationQuirks]): Switched to use applicationIsSafari(). 2009-04-27 Kevin Decker <kdecker@apple.com> Fix the Tiger build. * Plugins/WebNetscapePluginView.mm: The base class of WebNetscapePluginView.mm, WebBaseNetscapePluginView, already implemented the two methods below. But the Tiger compiler didn't know that. (-[WebNetscapePluginView webView]): (-[WebNetscapePluginView webFrame]): 2009-04-27 Kevin Decker <kdecker@apple.com> Reviewed by Anders Carlsson. <rdar://problem/6352982> * Plugins/WebBaseNetscapePluginView.mm: Removed checkIfAllowedToLoadURL:frame:callbackFunc, cancelCheckIfAllowedToLoadURL, and _webPluginContainerCancelCheckIfAllowedToLoadRequest from the base class. These methods now exist in the subclass WebNetscapePluginView. Added WebNetscapeContainerCheckContextInfo, which is used as a "contextInfo" object in -[WebNetscapePluginView checkIfAllowedToLoadURL:frame:callbackFunc:] * Plugins/WebNetscapeContainerCheckContextInfo.h: Added. * Plugins/WebNetscapeContainerCheckContextInfo.mm: Added. (-[WebNetscapeContainerCheckContextInfo initWithCheckRequestID:callbackFunc:]): Added desiginated initializer. (-[WebNetscapeContainerCheckContextInfo checkRequestID]): Added. Returns the checkRequestID. (-[WebNetscapeContainerCheckContextInfo callback]): Added. Returns the callback. * Plugins/WebNetscapePluginView.h: Added two new ivars: _containerChecksInProgress and _currentContainerCheckRequestID. * Plugins/WebNetscapePluginView.mm: #import both WebPluginContainerCheck.h and WebNetscapeContainerCheckContextInfo.h (-[WebNetscapePluginView checkIfAllowedToLoadURL:frame:callbackFunc:]): Added. This is the implementation of WKN_CheckIfAllowedToLoadURL. Here, we increment the request ID and start the container check. (-[WebNetscapePluginView _containerCheckResult:contextInfo:]): Added. This is a callback method for WebPluginContainerCheck. It's where we actually call into the plug-in and provide the allow-or-deny result. (-[WebNetscapePluginView cancelCheckIfAllowedToLoadURL:]): Added. This is the implementation of WKN_CancelCheckIfAllowedToLoadURL. Here we lookup the check, cancel it, and remove it from _containerChecksInProgress. (-[WebNetscapePluginView _webPluginContainerCancelCheckIfAllowedToLoadRequest:]): Added. WebPluginContainerCheck automatically calls this method after invoking our _containerCheckResult: selector. It works this way because calling -[WebPluginContainerCheck cancel] allows it to do it's teardown process. (-[WebNetscapePluginView fini]): Release _containerChecksInProgress ivar. * Plugins/WebPluginContainerCheck.h: Removed initWithRequest: method from header; no client was using this method directly. * Plugins/WebPluginContainerCheck.mm: (+[WebPluginContainerCheck checkWithRequest:target:resultObject:selector:controller:contextInfo:]): Added optional contextInfo parameter. (-[WebPluginContainerCheck _continueWithPolicy:]): If there's a contextInfo object, pass it as a parameter to resultSelector. (-[WebPluginContainerCheck cancel]): Release _contextInfo ivar. (-[WebPluginContainerCheck contextInfo]): Added new method. Returns the contextInfo object, if one so exists. * Plugins/WebPluginController.mm: (-[WebPluginController _webPluginContainerCheckIfAllowedToLoadRequest:inFrame:resultObject:selector:]): Pass nil for contextInfo. WebKit-style plug-ins do not need additional context information. 2009-04-25 Brady Eidson <beidson@apple.com> Reviewed by Sam Weinig Some *obvious* style cleanup in my last patch. * History/WebBackForwardList.mm: (bumperCarBackForwardHackNeeded): 2009-04-25 Brady Eidson <beidson@apple.com> Reviewed by Oliver Hunt <rdar://problem/6817607> BumperCar 2.2 crashes going back (invalid WebHistoryItem) BumperCar was holding a pointer to a WebHistoryItem they never retain, then later tried to go to it. In some cases it would be dealloc'ed first. When WebHistoryItems were pure Objective-C they probably got away with this more often. With the WebCore/Obj-C mixed WebHistoryItems it's more likely to crash. * History/WebBackForwardList.mm: (bumperCarBackForwardHackNeeded): (-[WebBackForwardList backListWithLimit:]): If this is BumperCar, hang on to the NSArray of WebHistoryItems until the next time this method is called. (-[WebBackForwardList forwardListWithLimit:]): Ditto. * Misc/WebKitVersionChecks.h: Added WEBKIT_FIRST_VERSION_WITHOUT_BUMPERCAR_BACK_FORWARD_QUIRK. 2009-04-24 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Fix <rdar://problem/6761635>. Make sure to keep an extra reference to the instance proxy in case the plug-in host crashes while we're waiting for a reply. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::destroy): 2009-04-24 Brady Eidson <beidson@apple.com> Reviewed by Dan Bernstein Currently working on a bug where a WebHistoryItem was being used after being dealloc'ed. I added this assertion to help catch the case as soon as it happens instead of random issues downstream. Figured it's worth checking in by itself. * History/WebHistoryItem.mm: (core): ASSERT that the WebCore::HistoryItem inside this WebHistoryItem is supposed to have this WebHistoryItem as a wrapper. 2009-04-23 Beth Dakin <bdakin@apple.com> Reviewed by Darin Adler. Fix for <rdar://problem/6333461> REGRESSION (r36864-r36869): Dragging stocks widget scrollbar drags the whole widget Look for our new WebCore scrollbars in the WebHTMLView and add proper Dashboard regions for them. * WebView/WebView.mm: (-[WebView _addScrollerDashboardRegionsForFrameView:dashboardRegions:]): (-[WebView _addScrollerDashboardRegions:from:]): 2009-04-23 John Sullivan <sullivan@apple.com> fixed <rdar://problem/6822479> Assertion failure after Reset Safari in new history-writing code Reviewed by Oliver Hunt * History/WebHistory.mm: (-[WebHistoryPrivate data]): Return nil immediately if there are no entries; this matches a recent Windows-platform fix. 2009-04-23 Dimitri Glazkov <dglazkov@chromium.org> Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=25313 Missing scroll bars in GMail. * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): Added check for the ScrollbarAlwaysOn scroll mode. 2009-04-23 Kevin Decker <kdecker@apple.com> * Plugins/WebPluginContainerCheck.h: Fix the Tiger build. 2009-04-23 Anders Carlsson <andersca@apple.com> Reviewed by Geoffrey Garen. Fix <rdar://problem/6821992> Add a new m_inDestroy member variable. Set it to true when in destroy, and have all NPRuntime functions return false when m_inDestroy is true. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): (WebKit::NetscapePluginInstanceProxy::destroy): (WebKit::NetscapePluginInstanceProxy::invoke): (WebKit::NetscapePluginInstanceProxy::invokeDefault): (WebKit::NetscapePluginInstanceProxy::construct): (WebKit::NetscapePluginInstanceProxy::getProperty): (WebKit::NetscapePluginInstanceProxy::setProperty): (WebKit::NetscapePluginInstanceProxy::removeProperty): (WebKit::NetscapePluginInstanceProxy::hasProperty): (WebKit::NetscapePluginInstanceProxy::hasMethod): (WebKit::NetscapePluginInstanceProxy::enumerate): 2009-04-23 David Hyatt <hyatt@apple.com> Reviewed by Maciej. Fix for <rdar://problem/6789879> REGRESSION (42464): Hitting assertion when loading message in Mail + TOT WebKit Make the Mac platform the same as all the other platforms. Instead of (incorrectly) marking a FrameView for layout when its underlying document view changes, just mark the outermost frame view for layout when the WebView's size changes. * WebView/WebHTMLView.mm: (-[WebHTMLView _frameOrBoundsChanged]): (-[WebHTMLView addSuperviewObservers]): * WebView/WebView.mm: (-[WebView _boundsChanged]): (-[WebView removeSizeObservers]): (-[WebView addSizeObservers]): 2009-04-23 Kevin Decker <kdecker@apple.com> Reviewed by Tim Hatcher. Second part of the fix for <rdar://problem/6352982> * Plugins/WebBaseNetscapePluginView.h: Make this class conform to WebPluginContainerCheckController * Plugins/WebBaseNetscapePluginView.mm: Likewise. (-[WebBaseNetscapePluginView _webPluginContainerCancelCheckIfAllowedToLoadRequest:]): Added skeleton method. * Plugins/WebPluginContainerCheck.h: Added protocol for <WebPluginContainerCheckController> * Plugins/WebPluginContainerCheck.mm: (-[WebPluginContainerCheck initWithRequest:target:resultObject:selector:controller:]): * Plugins/WebPluginController.h: Make this class conform to WebPluginContainerCheckController 2009-04-23 Kevin Decker <kdecker@apple.com> Reviewed by Anders Carlsson. First part of <rdar://problem/6352982> * Plugins/WebBaseNetscapePluginView.h: Imported #WebNetscapeContainerCheckPrivate.h; Added two new method: checkIfAllowedToLoadURL:url:frame:callbackFunc: and cancelCheckIfAllowedToLoadURL: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView checkIfAllowedToLoadURL:frame:callbackFunc:]): Added skeleton method, does nothing interesting yet. (-[WebBaseNetscapePluginView cancelCheckIfAllowedToLoadURL:]): Likewise. * Plugins/WebNetscapeContainerCheckPrivate.h: Added. * Plugins/WebNetscapeContainerCheckPrivate.mm: Added. (browserContainerCheckFuncs): Added. * Plugins/WebNetscapePluginView.h: Imported #WebNetscapeContainerCheckPrivate.h; * Plugins/WebNetscapePluginView.mm: Imported #WebNetscapeContainerCheckPrivate.h; added WKN_CheckIfAllowedToLoadURL and WKN_CancelCheckIfAllowedToLoadURL functions. (-[WebNetscapePluginView getVariable:value:]): Return vtable for container check functions. * Plugins/npapi.mm: (WKN_CheckIfAllowedToLoadURL): Added new private function. (WKN_CancelCheckIfAllowedToLoadURL): Ditto. 2009-04-22 Oliver Hunt <oliver@apple.com> Reviewed by Darin Adler. <rdar://problem/6757346> SAP: Prevent default on mouseDown does not stop iframe from capturing subsequent mouse moves Make mouseUP forward to the root view as we do for mouseMoves and mouseDragged:. * WebView/WebHTMLView.mm: (-[WebHTMLView mouseUp:]): 2009-04-22 Oliver Hunt <oliver@apple.com> Reviewed by Darin Adler. <rdar://problem/6757346> SAP: Prevent default on mouseDown does not stop iframe from capturing subsequent mouse moves Make mouseDragged forward to the root view as we do for mouseMoves. * WebView/WebHTMLView.mm: (-[WebHTMLView mouseDragged:]): 2009-04-22 Anders Carlsson <andersca@apple.com> Reviewed by Oliver Hunt. Fix <rdar://problem/6792694> When we're trying to instantiate a plug-in and the plug-in host has died, we need to invalidate the instance so that it doesn't stick around and do bad things. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::instantiatePlugin): 2009-04-22 Sam Weinig <sam@webkit.org> Rubber-stamped by Darin Adler. Fix for <rdar://problem/6816957> Turn off Geolocation by default * Configurations/FeatureDefines.xcconfig: 2009-04-21 Dan Bernstein <mitz@apple.com> Reviewed by Jon Honeycutt. - Mac part of fixing for <rdar://problem/6755137> Action dictionary for policy decision is missing keys when full-page zoom is used * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::actionDictionary): Use absoluteLocation() instead of pageX() and pageY(), which are adjusted for zoom. 2009-04-21 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler and Kevin Decker. WebKit side of <rdar://problem/6781642>. When we call resize with an actual changed size, block until the plug-in host is done. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::resize): * Plugins/Hosted/WebHostedNetscapePluginView.h: * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView updateAndSetWindow]): * Plugins/Hosted/WebKitPluginHost.defs: 2009-04-17 Timothy Hatcher <timothy@apple.com> Change how sudden termination works with WebView teardown. <rdar://problem/6383352&6383379&6383940> Reviewed by Darin Adler. * WebCoreSupport/WebChromeClient.h: Remove disableSuddenTermination/enableSuddenTermination. * WebCoreSupport/WebChromeClient.mm: Ditto. * WebView/WebFrame.mm: (-[WebFrame _pendingFrameUnloadEventCount]): Ask the DOMWindow. * WebView/WebView.mm: (+[WebView canCloseAllWebViews]): Call DOMWindow::dispatchAllPendingBeforeUnloadEvents. (+[WebView closeAllWebViews]): Call DOMWindow::dispatchAllPendingUnloadEvents and call close on all the WebViews. (-[WebView _closeWithFastTeardown]): Remove code for unload event dispatch. (-[WebView _close]): Correct a comment. (+[WebView _applicationWillTerminate]): Call closeAllWebViews. * WebView/WebViewPrivate.h: Add canCloseAllWebViews and closeAllWebViews. 2009-04-21 Geoffrey Garen <ggaren@apple.com> Reviewed by Mark Rowe. Tiger crash fix: Put VM tags in their own header file, and fixed up the #ifdefs so they're not used on Tiger. * ForwardingHeaders/wtf/VMTags.h: Copied from ForwardingHeaders/wtf/HashTraits.h. 2009-04-17 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. <rdar://problem/6722845> In the Cocoa event model, NPWindow's window field should be null * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCConvertPoint): Get the instance proxy and call it's convertPoint function. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::convertPoint): Call convertPoint on the plug-in view. * Plugins/Hosted/WebKitPluginClient.defs: Add PCConvertPoint. * Plugins/WebBaseNetscapePluginView.h: Add a declaration for convertFromX:andY:space:toX:andY:space:. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView convertFromX:andY:space:toX:andY:space:]): Convert a point from one coordinate system to another. * Plugins/WebNetscapePluginEventHandler.h: * Plugins/WebNetscapePluginEventHandlerCarbon.h: * Plugins/WebNetscapePluginEventHandlerCarbon.mm: (WebNetscapePluginEventHandlerCarbon::drawRect): * Plugins/WebNetscapePluginEventHandlerCocoa.h: Add CGContextRef to drawRect. * Plugins/WebNetscapePluginEventHandlerCocoa.mm: (WebNetscapePluginEventHandlerCocoa::drawRect): Set the passed in context. * Plugins/WebNetscapePluginPackage.mm: (-[WebNetscapePluginPackage _tryLoad]): Add NPN_ConvertPoint to the browserFuncs vtable. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]): Only set the window for the Carbon event model. (-[WebNetscapePluginView restorePortState:]): It's OK for the window context to be null. (-[WebNetscapePluginView sendDrawRectEvent:]): Pass the CGContextRef to drawRect. * Plugins/npapi.mm: (NPN_ConvertPoint): Call the plug-in view method. 2009-04-20 Sam Weinig <sam@webkit.org> Rubber-stamped by Tim Hatcher. Add licenses for xcconfig files. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/FeatureDefines.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKit.xcconfig: 2009-04-20 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. WebKit side of <rdar://problem/6781302> * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::keyEvent): Pass the event keyChar. (WebKit::NetscapePluginInstanceProxy::syntheticKeyDownWithCommandModifier): Ditto. (WebKit::NetscapePluginInstanceProxy::flagsChanged): Pass a 0 keyChar. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView flagsChanged:]): Call NetscapePluginInstanceProxy::flagsChanged. * Plugins/Hosted/WebKitPluginHost.defs: Add a keyChar argument. 2009-04-19 Adele Peterson <adele@apple.com> Reviewed by Darin Adler. Fix for <rdar://problem/6804809> REGRESSION: In Mail, Home and End do not scroll message If no scrolling occurs, call tryToPerform on the next responder. Then our WebResponderChainSink will correctly detect if no responders handle the selector. * WebView/WebFrameView.mm: (-[WebFrameView _scrollToBeginningOfDocument]): (-[WebFrameView _scrollToEndOfDocument]): (-[WebFrameView scrollToBeginningOfDocument:]): (-[WebFrameView scrollToEndOfDocument:]): (-[WebFrameView scrollLineUp:]): (-[WebFrameView scrollLineDown:]): 2009-04-19 David Kilzer <ddkilzer@apple.com> Make FEATURE_DEFINES completely dynamic Reviewed by Darin Adler. Make FEATURE_DEFINES depend on individual ENABLE_FEATURE_NAME variables for each feature, making it possible to remove all knowledge of FEATURE_DEFINES from build-webkit. * Configurations/FeatureDefines.xcconfig: Extract a variable from FEATURE_DEFINES for each feature setting. 2009-04-18 Pierre d'Herbemont <pdherbemont@apple.com> Reviewed by Mark Rowe. <rdar://problem/6781295> video.buffered and video.seekable are not the same. video.buffered should return only what is buffered and not what is seekable * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Add wkQTMovieMaxTimeSeekable. 2009-04-18 Pierre d'Herbemont <pdherbemont@apple.com> Reviewed by Adele Peterson. <rdar://problem/6747241> work around QTKit no longer reaching QTMovieLoadStateComplete * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Init the new WKSI exported symbol. 2009-04-17 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. <rdar://problem/6714488> REGRESSION (Safari 3-4): Edit menu commands (cut/copy/paste/select all) do not work on Flash content * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::syntheticKeyDownWithCommandModifier): Send a keyDown event to the plug-in host. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView sendModifierEventWithKeyCode:character:]): Call the plug-in instance proxy. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView sendModifierEventWithKeyCode:character:]): Add this. Subclasses are required to override it. (-[WebBaseNetscapePluginView cut:]): (-[WebBaseNetscapePluginView copy:]): (-[WebBaseNetscapePluginView paste:]): (-[WebBaseNetscapePluginView selectAll:]): Call sendModifierEventWithKeyCode. * Plugins/WebNetscapePluginEventHandler.h: Add syntheticKeyDownWithCommandModifier. * Plugins/WebNetscapePluginEventHandlerCarbon.h: * Plugins/WebNetscapePluginEventHandlerCarbon.mm: (WebNetscapePluginEventHandlerCarbon::syntheticKeyDownWithCommandModifier): Send the synthetic event. * Plugins/WebNetscapePluginEventHandlerCocoa.h: * Plugins/WebNetscapePluginEventHandlerCocoa.mm: (WebNetscapePluginEventHandlerCocoa::syntheticKeyDownWithCommandModifier): Send the synthetic event. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView sendModifierEventWithKeyCode:character:]): Call the event handler. 2009-04-17 David Kilzer <ddkilzer@apple.com> Simplify FEATURE_DEFINES definition Reviewed by Darin Adler. This moves FEATURE_DEFINES and its related ENABLE_FEATURE_NAME variables to their own FeatureDefines.xcconfig file. It also extracts a new ENABLE_GEOLOCATION variable so that FEATURE_DEFINES only needs to be defined once. * Configurations/FeatureDefines.xcconfig: Added. * Configurations/WebKit.xcconfig: Removed definition of ENABLE_SVG_DOM_OBJC_BINDINGS and FEATURE_DEFINES. Added include of FeatureDefines.xcconfig. 2009-04-17 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Fix crashes seen in regression tests with hosted plug-ins. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::cancelStreamLoad): Check the stream for 0, not the stream ID. 2009-04-17 Darin Adler <darin@apple.com> Reviewed by Antti Koivisto. Bug 25210: don't use ObjC methods to wrap/unwrap DOM objects with ObjC https://bugs.webkit.org/show_bug.cgi?id=25210 * DOM/WebDOMOperations.mm: (-[DOMNode markupString]): Use the core function instead of an Objective-C method. (-[DOMNode _subresourceURLs]): Ditto. (-[DOMDocument _focusableNodes]): Ditto. (-[DOMRange webArchive]): Ditto. (-[DOMRange markupString]): Ditto. * Misc/WebElementDictionary.mm: Added now-needed include since the core and kit functions now come from the internal headers from DOM bindings. * Misc/WebNSPasteboardExtras.mm: Ditto. * Plugins/WebNullPluginView.mm: Ditto. * Plugins/WebPluginController.mm: Ditto. * WebCoreSupport/WebChromeClient.mm: Ditto. * WebCoreSupport/WebInspectorClient.mm: Ditto. * WebCoreSupport/WebPasteboardHelper.mm: Ditto. * WebView/WebHTMLView.mm: Ditto. * WebCoreSupport/WebEditorClient.mm: Made kit function have internal linkage since it's only used in this file. Someone had instead added a declaration to suppress the warning you would otherwise get. Removed the core function. (WebEditorClient::textFieldDidBeginEditing): Added correct type checking. Previously the function would check only that something was an HTMLElement, but then cast it to HTMLInputElement. Also call kit instead of old wrap method. (WebEditorClient::textFieldDidEndEditing): Ditto. (WebEditorClient::textDidChangeInTextField): Ditto. (WebEditorClient::doTextFieldCommandFromEvent): Ditto. (WebEditorClient::textWillBeDeletedInTextField): Ditto. (WebEditorClient::textDidChangeInTextArea): Ditto, but for HTMLTextAreaElement. * WebView/WebFrame.mm: Removed the core and kit functions here which are no longer needed since they're automatically generated now. (-[WebFrame _nodesFromList:]): Use kit. (-[WebFrame _markupStringFromRange:nodes:]): Use core. (-[WebFrame _stringForRange:]): More of the same. (-[WebFrame _caretRectAtNode:offset:affinity:]): Ditto. (-[WebFrame _firstRectForDOMRange:]): Ditto. (-[WebFrame _scrollDOMRangeToVisible:]): Ditto. (-[WebFrame _rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]): Ditto. (-[WebFrame _convertNSRangeToDOMRange:]): Ditto. (-[WebFrame _convertDOMRangeToNSRange:]): Ditto. (-[WebFrame _markDOMRange]): Ditto. (-[WebFrame _smartDeleteRangeForProposedRange:]): Ditto. (-[WebFrame _smartInsertForString:replacingRange:beforeString:afterString:]): Ditto. (-[WebFrame _documentFragmentWithMarkupString:baseURLString:]): Ditto. (-[WebFrame _documentFragmentWithNodesAsParagraphs:]): Ditto. (-[WebFrame _replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]): Ditto. (-[WebFrame _characterRangeAtPoint:]): Ditto. (-[WebFrame _typingStyle]): Ditto. (-[WebFrame _setTypingStyle:withUndoAction:]): Ditto. (-[WebFrame _pauseAnimation:onNode:atTime:]): Ditto. (-[WebFrame _pauseTransitionOfProperty:onNode:atTime:]): Ditto. (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): Ditto. * WebView/WebFrameInternal.h: Removed the core and kit functions here which are no longer needed since they're automatically generated now. * WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation attributedStringFrom:startOffset:to:endOffset:]): Use core. (formElementFromDOMElement): Ditto. (inputElementFromDOMElement): Ditto. * WebView/WebTextIterator.mm: (-[WebTextIterator initWithRange:]): Ditto. (-[WebTextIterator currentRange]): Ditto. (-[WebTextIterator currentNode]): Ditto. * WebView/WebView.mm: (-[WebView textIteratorForRect:]): Ditto. (-[WebView setSelectedDOMRange:affinity:]): Ditto. 2009-04-17 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. WebKit side of <rdar://problem/6449642>. * Plugins/Hosted/HostedNetscapePluginStream.h: (WebKit::HostedNetscapePluginStream::create): New function that creates a stream from a frame loader. * Plugins/Hosted/HostedNetscapePluginStream.mm: (WebKit::HostedNetscapePluginStream::HostedNetscapePluginStream): Add the constructor that takes a frame loader. * Plugins/Hosted/NetscapePluginHostManager.h: * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::instantiatePlugin): Pass "fullFrame" to the plug-in host. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCCancelLoadURL): Call NetscapePluginInstanceProxy::cancelStreamLoad. * Plugins/Hosted/NetscapePluginInstanceProxy.h: (WebKit::NetscapePluginInstanceProxy::create): Pass "fullFrame" to the constructor. (WebKit::NetscapePluginInstanceProxy::manualStream): New getter for the manual stream. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): Take the implicit request into account if we have a full frame plug-in. (WebKit::NetscapePluginInstanceProxy::setManualStream): Setter for the manual stream. (WebKit::NetscapePluginInstanceProxy::cancelStreamLoad): Cancel the manual stream if necessary. * Plugins/Hosted/WebHostedNetscapePluginView.h: WebHostedNetscapePluginView now conforms to the WebPluginManualLoader protocol. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView createPlugin]): Pass "fullFrame" to instantiatePlugin. (-[WebHostedNetscapePluginView pluginView:receivedResponse:]): (-[WebHostedNetscapePluginView pluginView:receivedData:]): (-[WebHostedNetscapePluginView pluginView:receivedError:]): (-[WebHostedNetscapePluginView pluginViewFinishedLoading:]): Call the equivalent manual stream functions. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createPlugin): Use a macro for getting the plug-in view type. 2009-04-14 Simon Fraser <simon.fraser@apple.com> Reviewed by Dan Bernstein https://bugs.webkit.org/show_bug.cgi?id=25157 Move the run loop observer cleanup from -close to -_close. * WebView/WebView.mm: (-[WebView _close]): (-[WebView close]): 2009-04-14 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. - Speculative fix for <rdar://problem/6781422> Protect the plug-in instance proxy in case it's deleted while waiting for a reply. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::wheelEvent): 2009-04-14 Adele Peterson <adele@apple.com> Reviewed by Darin. Initialize WebKitSystemInterface in class methods that could get called before a WebView/WebFrame is set up. This was causing Mail to crash on launch. * Misc/WebCache.mm: (+[WebCache initialize]): * WebView/WebView.mm: (+[WebView initialize]): 2009-04-13 Kevin Decker <kdecker@apple.com> Reviewed by Darin. <rdar://problem/6784955> REGRESSION: closing a tab containing a PDF causes world leaks Simplify the _trackFirstResponder method by just caching the value instead of retaining a Cocoa object. * WebView/WebPDFView.h: Eliminated trackedFirstResponder object and replaced it with a firstResponderIsPDFDocumentView boolean. * WebView/WebPDFView.mm: (-[WebPDFView dealloc]): Removed no longer necessary ASSERT. (-[WebPDFView viewWillMoveToWindow:]): Removed call to release and nil-out trackedFirstResponder, which no longer exists. In the new code all we do now is set firstResponderIsPDFDocumentView to NO. (-[WebPDFView _trackFirstResponder]): Rewrote this method to just cache the value instead of retaining an object. 2009-04-13 David Hyatt <hyatt@apple.com> Reviewed by Sam Weinig. Fix for https://bugs.webkit.org/show_bug.cgi?id=25125. Rework scrolling so that a layout happens first when it's already needed so that the code doesn't end up making bad decisions based off invalid document sizes. This patch also eliminates WebHTMLView's separate notion of needing a layout and just consolidates it with WebCore's notion of needing layout. * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): * WebView/WebHTMLView.mm: (-[WebHTMLView _frameOrBoundsChanged]): (-[WebHTMLView initWithFrame:]): (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): (-[WebHTMLView setNeedsLayout:]): (-[WebHTMLView _layoutIfNeeded]): (-[WebHTMLView _needsLayout]): * WebView/WebHTMLViewInternal.h: 2009-04-13 Darin Adler <darin@apple.com> * WebView/WebViewPrivate.h: Updated comments. 2009-04-13 Antti Koivisto <antti@apple.com> Reviewed by Darin Adler. <rdar://problem/6740294> Increase the connection count per host * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2009-04-13 Brady Eidson <beidson@apple.com> Reviewed by Tim Hatcher Tweak my last check-in, moving the thread violation check up to the API-level calls so the logging is more useful to developers/users. * WebView/WebFrame.mm: (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): If not on the main thread, only perform the "call on main thead" workaround, as the log/exception raising is now up at the API level. (-[WebFrame loadData:MIMEType:textEncodingName:baseURL:]): Perform a thread violation check here so logging is more meaningful. (-[WebFrame loadHTMLString:baseURL:]): Ditto. (-[WebFrame loadAlternateHTMLString:baseURL:forUnreachableURL:]): Ditto. 2009-04-13 Brady Eidson <beidson@apple.com> Reviewed by Kevin Decker <rdar://problem/6712063> Garmin WebUpdater crashes * WebView/WebFrame.mm: (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): If not called on the main thread, add a ThreadViolationCheckRoundTwo() call to either log or raise an exception. In the case where it's only a log, reschedule the _loadData call to occur on the main thread. 2009-04-10 Dan Bernstein <mitz@apple.com> Reviewed by Jon Honeycutt. - fix <rdar://problem/6752340> Light blue-green background in content area in Mail * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): Use device white, rather than calibrated white, as the default background color. 2009-04-10 Darin Adler <darin@apple.com> Reviewed by Brady Eidson. <rdar://problem/6773515> crash in push_heap inside WebCore when printing The crash was due to manipulating a timer on a different thread than the one it was created on. * History/WebHistoryItem.mm: (-[WebWindowWatcher windowWillClose:]): Call later on main thread, if called on non-main thread. * WebView/WebHTMLView.mm: (-[WebHTMLView windowDidBecomeKey:]): Ditto. (-[WebHTMLView windowDidResignKey:]): Ditto. (-[WebHTMLView windowWillClose:]): Ditto. (-[WebHTMLView _updateControlTints]): Added. Factored out the non-thread-safe part of our override of _windowChangedKeyState. (-[WebHTMLView _windowChangedKeyState]): Call _updateControlTints later on main thread, if called on non-main thread. * WebView/WebPreferences.mm: (-[WebPreferences _postPreferencesChangesNotification]): Call later on main thread, if called on non-main thread 2009-04-10 Timothy Hatcher <timothy@apple.com> Remove DOMDocumentPrivate.h now that <rdar://problem/6730996> is fixed. Rubber-stamped by Mark Rowe. * Misc/DOMDocumentPrivate.h: Removed. 2009-04-10 Pierre d'Herbemont <pdherbemont@apple.com> Reviewed by Adele Peterson. <rdar://problem/6646998> Avoid starting QTKitServer if possible Add the requires symbol in the WebSystemInterface. It is used by WebCore. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Add wkQTIncludeOnlyModernMediaFileTypes. 2009-04-09 Kevin Decker <kdecker@apple.com> Reviewed by Hyatt. <rdar://problem/4680397> tearing seen because deferred updates are disabled * WebView/WebFrameView.mm: (-[WebFrameView initWithFrame:]): Don't call WKDisableCGDeferredUpdates on post-Leopard if NSAppKitVersionNumberWithDeferredWindowDisplaySupport is defined. 2009-04-09 John Sullivan <sullivan@apple.com> <rdar://problem/6775682> WebKit's support for SnowLeopard sudden termination for downloads is broken and should be removed Reviewed by Darin Adler * Misc/WebDownload.m: (-[WebDownloadInternal downloadDidBegin:]): remove disableSuddenTermination call (-[WebDownloadInternal downloadDidFinish:]): remove enableSuddenTermination call (-[WebDownloadInternal download:didFailWithError:]): remove enableSuddenTermination call 2009-04-09 Darin Adler <darin@apple.com> Reviewed by Anders Carlsson and Sam Weinig. Part of <rdar://problem/5438063> Saving history containing 100,000 entries causes pauses of 2s while browsing Longer term solution is to change the design so Safari doesn't read and write all of history. This patch is step one: Do the serializing, which is done on the main thread, much faster. * History/WebHistory.mm: (-[WebHistoryPrivate data]): Added. Returns the NSData object containing serialized history. For creating new SPI so you can get the data in memory instead of on disk. Uses WebHistoryWriter. (-[WebHistoryPrivate saveToURL:error:]): Changed to call [self data (-[WebHistory _data]): Added. (WebHistoryWriter::WebHistoryWriter): Added. (WebHistoryWriter::writeHistoryItems): Added. * History/WebHistoryPrivate.h: Added a new _data method. 2009-04-09 Mike Thole <mthole@apple.com> Rubber-stamped by Mark Rowe. Fix 64-bit build * Panels/WebAuthenticationPanel.h: Declare the 'separateRealmLabel' IBOutlet as an NSTextField instead of 'id'. This fixes a duplicate method warning (setAutoresizingMask: on NSView and CALayer) 2009-04-09 Mike Thole <mthole@apple.com> Reviewed by Ada Chan. <rdar://problem/5697111> Basic authentication dialog spoofing vulnerability * Panels/WebAuthenticationPanel.h: Added IBOutlet for separateRealmLabel * Panels/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForChallenge:]): In the realm case, decide if it is a simple or complex realm name. A realm name is considered complex if it has any whitespace or newline characters. Present alternative text and layout for the complex case, where the realm name isn't inline with the rest of the sheet's text. * Panels/English.lproj/WebAuthenticationPanel.nib/designable.nib: * Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib: Updated the nib with a new 'separateRealmLabel' outlet. Updated the File's Owner to correctly be WebAuthenticationPanel. Fixed springs on the sheet's icon to keep it from moving during a resize. 2009-04-09 David Kilzer <ddkilzer@apple.com> Reinstating <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings Rolled r42345 back in. The build failure was caused by an internal script which had not been updated the same way that build-webkit was updated. * Configurations/WebKit.xcconfig: * DOM/WebDOMOperations.mm: * MigrateHeaders.make: 2009-04-09 Alexey Proskuryakov <ap@webkit.org> Reverting <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings. It broke Mac build, and I don't know how to fix it. * Configurations/WebKit.xcconfig: * DOM/WebDOMOperations.mm: * MigrateHeaders.make: 2009-04-08 David Kilzer <ddkilzer@apple.com> <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings Reviewed by Darin Adler and Maciej Stachowiak. Introduce the ENABLE_SVG_DOM_OBJC_BINDINGS feature define so that SVG DOM Objective-C bindings may be optionally disabled. * Configurations/WebKit.xcconfig: Added ENABLE_SVG_DOM_OBJC_BINDINGS variable and use it in FEATURE_DEFINES. * DOM/WebDOMOperations.mm: Removed unused header. * MigrateHeaders.make: Switched from using ENABLE_SVG to using ENABLE_SVG_DOM_OBJC_BINDINGS. 2009-04-08 David Hyatt <hyatt@apple.com> Reviewed by Adam Roben and Darin Adler Fix for https://bugs.webkit.org/show_bug.cgi?id=12440, fixed positioned elements end up in inconsistent positions. Rewrite updateScrollers to improve the correctness. * WebView/WebDynamicScrollBarsView.h: * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): 2009-04-07 Anders Carlsson <andersca@apple.com> Fix Tiger build for real this time. * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView getVariable:forURL:value:length:]): (-[WebNetscapePluginView setVariable:forURL:value:length:]): (-[WebNetscapePluginView getAuthenticationInfoWithProtocol:host:port:scheme:realm:username:usernameLength:password:passwordLength:]): * Plugins/npapi.mm: (NPN_GetValueForURL): (NPN_SetValueForURL): 2009-04-07 David Hyatt <hyatt@apple.com> Reviewed by Adam Roben Mac portion of fix to make DumpRenderTree always produce accurate scrollbar results. Change updateScrollers to call minimumContentsSize when a WebHTMLView is inside the WebDynamicScrollbarsView. * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): 2009-04-07 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> Reviewed by Anders Carlsson. Trying to fix Tiger build. * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView getAuthenticationInfoWithProtocol:host:port:scheme:realm:username:usernameLength:password:passwordLength:]): 2009-04-07 Anders Carlsson <andersca@apple.com> Try to fix the Leopard build once more. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView getVariable:forURL:value:length:]): 2009-04-07 Anders Carlsson <andersca@apple.com> ...and try to fix the Leopard build. * Plugins/npapi.mm: (NPN_GetAuthenticationInfo): 2009-04-07 Anders Carlsson <andersca@apple.com> Try to fix the Tiger build. * Plugins/WebBaseNetscapePluginView.mm: 2009-04-07 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. <rdar://problem/6667001> NPAPI: need NPN_Get/SetValueForURL() and NPN_GetAuthenticationInfo() * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCGetCookies): (WKPCGetProxy): (WKPCSetCookies): (WKPCGetAuthenticationInfo): New MIG functions to be used by the plug-in host. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::getCookies): (WebKit::NetscapePluginInstanceProxy::setCookies): (WebKit::NetscapePluginInstanceProxy::getProxy): (WebKit::NetscapePluginInstanceProxy::getAuthenticationInfo): Implement these. * Plugins/Hosted/WebKitPluginClient.defs: Add callbacks. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView URLWithCString:]): Factor this out of URLWithCString. (-[WebBaseNetscapePluginView requestWithURLCString:]): Call URLWithCString. (WebKit::proxiesForURL): Return a string representation of proxies for a given URL. (WebKit::getAuthenticationInfo): Get the authentication info for a given host/protocol/scheme/realm/port combination. * Plugins/WebNetscapePluginPackage.mm: (-[WebNetscapePluginPackage _tryLoad]): Initialize the new vtable functions. * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView getVariable:forURL:value:length:]): (-[WebNetscapePluginView setVariable:forURL:value:length:]): (-[WebNetscapePluginView getAuthenticationInfoWithProtocol:host:port:scheme:realm:username:usernameLength:password:passwordLength:]): Implement these. * Plugins/npapi.mm: (NPN_GetValueForURL): (NPN_SetValueForURL): (NPN_GetAuthenticationInfo): Call the plug-in view functions. 2009-04-03 Kevin Decker <kdecker@apple.com> Reviewed by Anders Carlsson. <rdar://problem/6756512> * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::spawnPluginHost): Tweaked the visibleName property. 2009-04-03 John Sullivan <sullivan@apple.com> Reviewed by Ada Chan <rdar://problem/6755838> Removing all icons can delete other items from disk. * Misc/WebIconDatabase.mm: (importToWebCoreFormat): When snooping around in various directories looking for a directory full of Safari-2-style icon database information to convert and delete, bail out without doing the delete part if we didn't actually find any Safari-2-style icon database information. 2009-04-03 John Sullivan <sullivan@apple.com> fixed <rdar://problem/6355573> [WebView _setCacheModel:] leaks the result of _CFURLCacheCopyCacheDirectory Reviewed by Adam Roben * WebView/WebView.mm: (+[WebView _setCacheModel:]): use WebCFAutorelease rather than autorelease on result of method that returns CFStringRef 2009-04-03 Chris Marrin <cmarrin@apple.com> Reviewed by David Hyatt. Fixed https://bugs.webkit.org/show_bug.cgi?id=24941 This fix essentially does a -viewWillDraw call for layout. It adds a CFRunLoopObserver which performs layout just before drawing on the Mac platform. This makes sure layout is complete before rendering and avoids a flash. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::attachRootGraphicsLayer): (WebChromeClient::setNeedsOneShotDrawingSynchronization): (WebChromeClient::scheduleViewUpdate): * WebView/WebView.mm: (-[WebViewPrivate _clearViewUpdateRunLoopObserver]): (-[WebView _viewWillDrawInternal]): (-[WebView viewWillDraw]): (-[WebView close]): (viewUpdateRunLoopObserverCallBack): (-[WebView _scheduleViewUpdate]): * WebView/WebViewInternal.h: 2009-04-03 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. WebKit side of <rdar://problem/6752953>. Pass the clip rect to the plug-in host. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::resize): * Plugins/Hosted/WebKitPluginHost.defs: 2009-04-02 Mark Rowe <mrowe@apple.com> Reviewed by Dan Bernstein and Timothy Hatcher. <rdar://problem/6684745> Crash in -[WebView removeSizeObservers] when loading NIB file The implementation of -[NSView initWithCoder:] can result in -viewWillMoveToSuperview:/-viewDidMoveToSuperview: being sent to our view before we've had a chance to initialize _private, so we need to ensure it is non-nil before dereferencing it in those methods. * WebView/WebView.mm: (-[WebView removeSizeObservers]): Nil-check _private before dereferencing it. (-[WebView addSizeObservers]): Ditto. 2009-04-02 Adele Peterson <adele@apple.com> Reviewed by Darin Adler. Add a way to get a list of focusable nodes. * DOM/WebDOMOperations.mm: (-[DOMDocument _focusableNodes]): * DOM/WebDOMOperationsInternal.h: Added. * DOM/WebDOMOperationsPrivate.h: Make this a private header. Move old methods to WebDOMOperationsInternal.h * WebView/WebHTMLView.mm: Use methods from WebDOMOperationsInternal.h 2009-04-01 Darin Adler <darin@apple.com> Reviewed by Geoff Garen. Bug 22378: Crash submitting a form when parsing an XHTML document https://bugs.webkit.org/show_bug.cgi?id=22378 rdar://problem/6388377 * History/WebHistoryItem.mm: (-[WebHistoryItem targetItem]): Call targetItem directly instead of callling isTargetItem, hasChildren, and recurseToFindTargetItem. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchWillSubmitForm): Updated for the new textFieldValues function in FormState. * WebView/WebPDFView.mm: (-[WebPDFView PDFViewWillClickOnLink:withURL:]): Updated for name and argument change of loadFrameRequest. 2009-04-01 Greg Bolsinga <bolsinga@apple.com> Reviewed by Mark Rowe. https://bugs.webkit.org/show_bug.cgi?id=24990 Put SECTORDER_FLAGS into xcconfig files. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: 2009-03-31 Anders Carlsson <andersca@apple.com> Reviewed by Adam Roben. WebKit side of <rdar://problem/6500266>. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::wheelEvent): Send the event. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView scrollWheel:]): Call NetscapePluginInstanceProxy::wheelEvent. If the plug-in processed the event, don't call super. * Plugins/Hosted/WebKitPluginHost.defs: Add definition. 2009-03-31 Darin Adler <darin@apple.com> Reviewed by Adele Peterson. <rdar://problem/6740581> REGRESSION (r41793): Page Down and Page Up don’t work in Leopard Mail * WebView/WebHTMLView.mm: (-[WebResponderChainSink tryToPerform:with:]): Added. Without this we would think we had handled an event when we actually hadn't. Specifically, when -[WebFrameView scrollPageDown:] calls tryToPerform on the next responder. 2009-03-30 Greg Bolsinga <bolsinga@apple.com> Reviewed by Simon Fraser. https://bugs.webkit.org/show_bug.cgi?id=24938 Build fixes when building --no-svg DOMHTMLFrameElementPrivate.h and DOMHTMLIFrameElementPrivate.h are only available with ENABLE_SVG. * MigrateHeaders.make: 2009-03-29 Darin Adler <darin@apple.com> Reviewed by Cameron Zwarich. * Plugins/WebNullPluginView.mm: Added now-needed includes. * WebView/WebHTMLRepresentation.mm: Ditto. * WebView/WebHTMLView.mm: Ditto. 2009-03-27 Timothy Hatcher <timothy@apple.com> * MigrateHeaders.make: Remove DOMHTMLBodyElementPrivate.h since it is not generated anymore. 2009-03-27 Adam Roben <aroben@apple.com> Don't include substitute data URLs in global history redirect chains <rdar://6690169> Reviewed by Darin Adler. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::updateGlobalHistory): Don't call updateGlobalHistoryRedirectLinks. FrameLoader calls this for us now. (WebFrameLoaderClient::updateGlobalHistoryRedirectLinks): Added an assertion to help catch cases where we might be adding a substitute data URL into a redirect chain. 2009-03-27 Darin Adler <darin@apple.com> Reviewed by Adam Roben. <rdar://problem/6541923> REGRESSION (r38629): Tab cycle in empty tab is broken * WebView/WebHTMLView.mm: (-[WebHTMLView _wantsKeyDownForEvent:]): Only return YES when we have a Frame. 2009-03-27 Darin Adler <darin@apple.com> Reviewed by John Sullivan and Anders Carlsson. <rdar://problem/5987442> Pasteboard not exposed to WebEditingDelegate for WebViewInsertActionPasted (needed for system services) Added SPI to tell which pasteboard is currently being inserted. I chose to put it on WebView to be forward-looking since we're migrating things from WebHTMLView to WebView in the future. * WebView/WebHTMLView.mm: (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]): Add calls to _setInsertionPasteboard. (-[WebHTMLView _pasteAsPlainTextWithPasteboard:]): Ditto. * WebView/WebView.mm: (-[WebViewPrivate dealloc]): Assert the pasteboard is nil. (-[WebViewPrivate finalize]): Ditto. (-[WebView _insertionPasteboard]): Return the pastebaord. (-[WebView _setInsertionPasteboard:]): Set the pasteboard. * WebView/WebViewInternal.h: Added _setInsertionPasteboard. * WebView/WebViewPrivate.h: Added _insertionPasteboard. 2009-03-25 Timothy Hatcher <timothy@apple.com> Expose new DOM methods as public Objective-C API. <rdar://problem/5837350> Expose new DOM classes and methods as public API (match the additions to the JavaScript DOM) Reviewed by Mark Rowe and Darin Adler. * MigrateHeaders.make: * Misc/DOMDocumentPrivate.h: Added. Forwarding header for <rdar://problem/6730996>. 2009-03-26 Jungshik Shin <jshin@chromium.org> Reviewed by Alexey Proskuryakov. Add WebPreferences for encoding autodetection on Mac. http://bugs.webkit.org/show_bug.cgi?id=16482 * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences usesEncodingDetector]): (-[WebPreferences setUsesEncodingDetector:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2009-03-26 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. - Fix <rdar://problem/6687055> and <rdar://problem/6713639>. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCInvalidateRect): Call NetscapePluginInstanceProxy::invalidateRect. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::cleanup): Stop the request timer, set m_pluginView to nil. (WebKit::NetscapePluginInstanceProxy::pluginHostDied): No need to set m_pluginView to nil here anymore, it's now done in cleanup(). (WebKit::NetscapePluginInstanceProxy::performRequest): (WebKit::NetscapePluginInstanceProxy::requestTimerFired): Assert that the plug-in view is not nil. (WebKit::NetscapePluginInstanceProxy::invalidateRect): Call setNeedsDisplayInRect here. 2009-03-25 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. <rdar://problem/6714964> CrashTracer: [REGRESSION] 51 crashes in Safari at com.apple.WebKit • WebNetscapePluginStream::deliverData + 775 Don't release m_deliveryData since it's a RetainPtr. Also, use adoptNS instead of releasing newDeliveryData manually. * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::deliverData): 2009-03-25 Mike Thole <mthole@apple.com> Reviewed by Kevin Decker. <rdar://problem/6453738> call SetWindow when user creates a new tab CoreGraphics plug-ins now receive an NPP_SetWindow call when moving to a background tab. Flash is excluded from this change in behavior, as it has historical WebKit-specific code that isn't compatible with this change. * Plugins/WebNetscapePluginView.h: Added an _isFlash ivar. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView _createPlugin]): Set the new _isFlash ivar based on the bundle identifier. (-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]): When using the CG drawing model and in a non-drawable state, set the portState to NULL and return early. (-[WebNetscapePluginView updateAndSetWindow]): When using the CG drawing model, call -setWindowIfNecessary even if the portState is NULL. Flash is an exception to this, due to its historical behavior. (-[WebNetscapePluginView setWindowIfNecessary]): Removed an assertion that was no longer true. The [NSView focus] view is no longer guaranteed to be 'self' at this point. Also modified the debug logging for CG plug-ins to include the size of the window's clipRect, which was useful in verifying the correct behavior of this patch. 2009-03-24 Dan Bernstein <mitz@apple.com> Reviewed by Oliver Hunt. - speculative fix for <rdar://problem/6630134> Crash at Editor::compositionRange() * WebView/WebHTMLView.mm: (-[WebHTMLView markedRange]): Null-check the Frame like most other methods in this class. 2009-03-23 Sam Weinig <sam@webkit.org> Reviewed by Dan Bernstein. Fix for <rdar://problem/6140966> Empty Caches does not clear the Cross-site XMLHttpRequest preflight cache * Misc/WebCache.mm: (+[WebCache empty]): 2009-03-23 Adele Peterson <adele@apple.com> Reviewed by Mark Rowe & Dave Hyatt. Merge some of the individual Mail quirks into two settings that we can check for future quirks. * WebView/WebView.mm: (runningLeopardMail): (runningTigerMail): (-[WebView _preferencesChangedNotification:]): 2009-03-23 Darin Adler <darin@apple.com> * WebView/WebTextIterator.h: Fixed a spelling error in a comment. 2009-03-22 Dan Bernstein <mitz@apple.com> Reviewed by John Sullivan. - fix <rdar://problem/6640741> Messages not displaying after the Safari 4 beta was installed Mail assumes that if -[WebArchive subresources] is not nil, then it contains at least one object. * WebView/WebArchive.mm: (-[WebArchive subresources]): Preserve the behavior of returning nil if there are no subresources. 2009-03-20 Adele Peterson <adele@apple.com> Build fix. Reviewed by Darin Adler. * WebView/WebFrameView.mm: (-[WebFrameView initWithFrame:]): 2009-03-20 Timothy Hatcher <timothy@apple.com> Change how threading exceptions are checked so they are reported by what round they were added. That way WebKit can decided the behavior per-round based on linked-on-or-after checks. <rdar://problem/6626741&6648478&6635474&6674079> Reviewed by Darin Adler. * History/WebBackForwardList.mm: Use the new WebCoreThreadViolationCheckRoundOne macro. * History/WebHistoryItem.mm: Ditto. * Misc/WebIconDatabase.mm: Ditto. * WebView/WebArchive.mm: Use the new WebCoreThreadViolationCheckRoundTwo macro. * WebView/WebResource.mm: Ditto. (+[WebResource _needMailThreadWorkaroundIfCalledOffMainThread]): Check Mail's bundle version to truly decide if it is an old Mail client. * WebView/WebView.mm: Ditto. * Misc/WebKitVersionChecks.h: Add a new linked-on-or-after version define. * WebView/WebFrameView.mm: (-[WebFrameView initWithFrame:]): Set the default thread violation behavior per-round based on difference version checks and the Mail workaround check. 2009-03-20 Darin Adler <darin@apple.com> Reviewed by Timothy Hatcher. * WebView/WebTextIterator.h: Improved comments to point out some of the pitfalls of this SPI. 2009-03-20 Darin Adler <darin@apple.com> Reviewed by Adele Peterson. Use a better technique to handle finding out if something responds to a selector in WebHTMLView's doCommandBySelector method. * WebView/WebHTMLView.mm: (-[WebHTMLView doCommandBySelector:]): Removed unneeded check for 0 coreFrame; this is already handled by coreCommandBySelector: so doesn't need to be checked twice. Got rid of initial value for eventWasHandled boolean to make it more clear. Use WebResponderChainSink to find out if a command is handled rather than walking the responder chain explicitly. (-[WebResponderChainSink initWithResponderChain:]): Added. (-[WebResponderChainSink detach]): Added. (-[WebResponderChainSink receivedUnhandledCommand]): Added. (-[WebResponderChainSink noResponderFor:]): Added. (-[WebResponderChainSink doCommandBySelector:]): Added. 2009-03-19 Timothy Hatcher <timothy@apple.com> Remove #ifndef BUILDING_ON_TIGER around code that schedules runloop modes for Page, so the new RunLoopTimer in WebCore always gets a default mode. Fixes the layout test failures on the Tiger build bots. Reviewed by Mark Rowe. * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): (-[WebView scheduleInRunLoop:forMode:]): (-[WebView unscheduleFromRunLoop:forMode:]): 2009-03-18 Anders Carlsson <andersca@apple.com> Reviewed by Oliver Hunt. WebKit side of <rdar://problem/6688244>. Try reinitializing the vendor port if it's invalid. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::spawnPluginHost): 2009-03-18 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. <rdar://problem/6504776> CrashTracer: [USER] 188 crashes in Safari at com.apple.WebCore • WTF::HashTableIterator<WTF::RefPtr<WebCore::ResourceLoader>, ... If the m_pluginView member was zeroed out as a result of making a call into the plug-in, the pluginFunctionCallDepth would be off causing the plug-in never to be stopped. Simplify the code by using a RAII object. * Plugins/WebBaseNetscapePluginStream.mm: (PluginStopDeferrer::PluginStopDeferrer): (PluginStopDeferrer::~PluginStopDeferrer): (WebNetscapePluginStream::startStream): (WebNetscapePluginStream::wantsAllStreams): (WebNetscapePluginStream::destroyStream): 2009-03-17 Darin Adler <darin@apple.com> Reviewed by Adele Peterson. <rdar://problem/6687005> Need support for new move-left/right selectors. * WebView/WebHTMLView.mm: Added the four new selectors to the command-forwarding list. * WebView/WebView.mm: Ditto. 2009-03-17 Darin Adler <darin@apple.com> Reviewed by Adele Peterson. Bug 24477: REGRESSION (r41467): Page Down key scrolls two pages https://bugs.webkit.org/show_bug.cgi?id=24477 rdar://problem/6674184 * WebView/WebHTMLView.mm: (responderChainRespondsToSelector): Added. (-[WebHTMLView doCommandBySelector:]): Set eventWasHandled based on whether we can find a responder that responds to this selector rather than always assuming the selector will not be handled. 2009-03-17 Mark Rowe <mrowe@apple.com> Fix the build. * Plugins/Hosted/HostedNetscapePluginStream.mm: 2009-03-17 David Kilzer <ddkilzer@apple.com> Use -[NSURLResponse(WebCoreURLResponse) _webcore_MIMEType] consistently Reviewed by Darin Adler. WebKit r30323 added -_webcore_MIMEType to fix issues with incorrect MIME types in NS[HTTP]URLResponse objects. However, uses of -[NSURLResponse MIMEType] still persist in WebKit that should be switched to use -_webcore_MIMEType. Note that -[WebDataSource _responseMIMEType] calls back into WebCore to get the MIME type from the ResourceResponse object, which has already retrieved it via -_webcore_MIMEType. * Plugins/Hosted/HostedNetscapePluginStream.mm: (WebKit::HostedNetscapePluginStream::didReceiveResponse): Use -_webcore_MIMEType. * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::didReceiveResponse): Ditto. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView pluginView:receivedData:]): Ditto. * Plugins/WebPluginController.mm: (-[WebPluginController pluginView:receivedResponse:]): Ditto. * WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation _isDisplayingWebArchive]): Use -[WebDataSource _responseMIMEType] instead. * WebView/WebPDFRepresentation.m: (-[WebPDFRepresentation finishedLoadingWithDataSource:]): Ditto. * WebView/WebPDFView.mm: (-[WebPDFView menuForEvent:]): Ditto. 2009-03-17 Simon Fraser <simon.fraser@apple.com> Reviewed by Darin Adler https://bugs.webkit.org/show_bug.cgi?id=24396 Add WTF_USE_ACCELERATED_COMPOSITING, defined to 0 for now. * WebKitPrefix.h: 2009-03-17 Kevin Ollivier <kevino@theolliviers.com> Reviewed by Mark Rowe. Get BUILDING_ON_* defines from Platform.h. https://bugs.webkit.org/show_bug.cgi?id=24630 * WebKitPrefix.h: 2009-03-16 Darin Adler <darin@apple.com> Reviewed by Dan Bernstein. <rdar://problem/6577174> Rename the text directionality submenus to “Paragraph Direction†and “Selection Direction†* WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory contextMenuItemTagParagraphDirectionMenu]): Changed string here, but only post-Leopard, since we want this to match the Mac OS X menu on Tiger and Leopard. (-[WebViewFactory contextMenuItemTagSelectionDirectionMenu]): Changed string here. 2009-03-16 Anders Carlsson <andersca@apple.com> Reviewed by Oliver Hunt. Don't mig_deallocate random data in case an instance proxy method returns false. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCEvaluate): (WKPCInvoke): (WKPCInvokeDefault): (WKPCGetProperty): (WKPCEnumerate): 2009-03-16 Anders Carlsson <andersca@apple.com> Reviewed by Oliver Hunt. <rdar://problem/6633944> REGRESSION (Safari 4 PB): Many crashes in Flip4Mac involving loading the plugin Defer loading while calling webPlugInInitialize since it can end up spinning the run loop. * Plugins/WebPluginController.mm: (-[WebPluginController addPlugin:]): 2009-03-16 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Fix <rdar://problem/6622601> Make sure to update both the window frame and the plug-in frame. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView addWindowObservers]): 2009-03-15 Dan Bernstein <mitz@apple.com> Reviewed by Adele Peterson. - fix <rdar://problem/6607773> WebKit should support the "Default" paragraph writing direction -- or at least validate the menu item appropriately Made WebHTMLView validate user interface items with the selector -makeBaseWritingDirectionNatural: by returning NO and, if the item is a menu item, setting its state to "off". Strictly speaking, since -makeBaseWritingDirectionNatural: is never valid for WebViews, WebHTMLView should not need to respond to it and validate it, however because other responders respond to all three -makeBaseWritingDirection*: messages and set the menu item state, having WebHTMLView do the same makes application developers' lives easier. * WebView/WebHTMLView.mm: (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): (-[WebHTMLView makeBaseWritingDirectionNatural:]): 2009-03-13 Mark Rowe <mrowe@apple.com> Rubber-stamped by Dan Bernstein. Take advantage of the ability of recent versions of Xcode to easily switch the active architecture. * Configurations/DebugRelease.xcconfig: 2009-03-13 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker and Geoffrey Garen. <rdar://problem/6590384> REGRESSION (Safari 3-4): Tiger-only Crash occurs at WebView hostWindow () after reloading a set of tabs then quitting When we're doing fast teardown, plug-in views can be destroyed from -[WebView dealloc]'s [super dealloc] call, and thus calling -[WebView hostWindow] will crash since _private is nil. * WebView/WebView.mm: (-[WebView hostWindow]): 2009-03-13 Anders Carlsson <andersca@apple.com> And yet another attempt... * Plugins/WebNetscapePluginEventHandlerCocoa.h: (WebNetscapePluginEventHandlerCocoa::installKeyEventHandler): (WebNetscapePluginEventHandlerCocoa::removeKeyEventHandler): * Plugins/WebNetscapePluginEventHandlerCocoa.mm: 2009-03-13 Anders Carlsson <andersca@apple.com> Another attempt at fixing the build. * Plugins/WebNetscapePluginEventHandlerCocoa.mm: (WebNetscapePluginEventHandlerCocoa::WebNetscapePluginEventHandlerCocoa): 2009-03-13 Anders Carlsson <andersca@apple.com> Try to fix the SL build. * Plugins/WebNetscapePluginEventHandlerCocoa.h: * Plugins/WebNetscapePluginEventHandlerCocoa.mm: (WebNetscapePluginEventHandlerCocoa::keyDown): 2009-03-13 Greg Bolsinga <bolsinga@apple.com> Reviewed by Simon Fraser. Update Geolocation perimission dialogs to be asynchronous. https://bugs.webkit.org/show_bug.cgi?id=24505 WebGeolocation is a wrapper around WebCore::Geolocation. It mimics the coding style set by WebSecurityOrigin. WebChromeClient now calls the private UI delegate method -webView:frame:requestGeolocationPermission:securityOrigin: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::requestGeolocationPermissionForFrame): * WebCoreSupport/WebGeolocation.mm: Added. (WebCore::if): (-[WebGeolocation shouldClearCache]): (-[WebGeolocation setIsAllowed:]): (-[WebGeolocation dealloc]): * WebCoreSupport/WebGeolocationInternal.h: Added. * WebCoreSupport/WebGeolocationPrivate.h: Added. * WebView/WebUIDelegatePrivate.h: 2009-03-13 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. <rdar://problem/6610666> Revise the Cocoa event model text API Replace the text input API with a simpler API that uses a separate text input window. * Plugins/WebNetscapePluginEventHandlerCocoa.h: * Plugins/WebNetscapePluginEventHandlerCocoa.mm: (WebNetscapePluginEventHandlerCocoa::WebNetscapePluginEventHandlerCocoa): Initialize m_keyEventHandler to 0. (WebNetscapePluginEventHandlerCocoa::keyDown): If the plug-in returns 0 from NPP_HandleEvent, pass the event to the TSM machinery. (WebNetscapePluginEventHandlerCocoa::focusChanged): Install/remove the key event handler as needed. (WebNetscapePluginEventHandlerCocoa::handleTSMEvent): Get the text and send a TextInput event. * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: Remove the old text input API. (-[WebNetscapePluginView inputContext]): Always return nil here. * Plugins/npapi.mm: * Plugins/nptextinput.h: Removed. 2009-03-12 Anders Carlsson <andersca@apple.com> Reviewed by Mike Thole and Mark Rowe. Fix <rdar://problem/6624105>. Make sure to process incoming messages for the NSEventTrackingRunLoopMode as well. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): 2009-03-12 Anders Carlsson <andersca@apple.com> Reviewed by Geoffrey Garen. WebKit side of <rdar://problem/6607801> * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::destroy): Pass a requestID to _WKPCDestroyPluginInstance and wait until we get a reply back. * Plugins/Hosted/WebKitPluginHost.defs: Add requestID parameter. 2009-03-12 Kevin Decker <kdecker@apple.com> Reviewed by Anders Carlsson. * Plugins/WebNetscapePluginPackage.mm: (-[WebNetscapePluginPackage _unloadWithShutdown:]): Simply a small SUPPORT_CFM code block. 2009-03-12 Kevin Decker <kdecker@apple.com> Reviewed by Anders Carlsson. Fixed: <rdar://problem/5815862> Opening a subclassed NSWindow from a Safari plugin causes Safari to crash on Quit This fix addresses crashes in both Silverlight and ChemDraw. This type of crash would occur because AppKit still had a reference to open windows that the plugin created (which no longer exist). * Plugins/WebNetscapePluginPackage.mm: (-[WebNetscapePluginPackage _unloadWithShutdown:]): Do not unload the plug-in bundle on browser shutdown. 2009-03-11 David Kilzer <ddkilzer@apple.com> Remove duplicate header include Rubber-stamped by Mark Rowe. * WebView/WebView.mm: Remove duplicate #include <runtime/InitializeThreading.h>. Also realphabetized lowercase #include statements. 2009-03-11 David Kilzer <ddkilzer@apple.com> Clarify comments regarding order of FEATURE_DEFINES Rubber-stamped by Mark Rowe. * Configurations/WebKit.xcconfig: Added warning about the consequences when FEATURE_DEFINES are not kept in sync. 2009-03-11 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. WebKit side of <rdar://problem/6656147>. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::instantiatePlugin): Pass the requestID to _WKPHInstantiatePlugin. * Plugins/Hosted/NetscapePluginHostProxy.mm: Pass the requestID to setCurrentReply. * Plugins/Hosted/NetscapePluginInstanceProxy.h: (WebKit::NetscapePluginInstanceProxy::setCurrentReply): Store the reply in a map with the requestID as the key. (WebKit::NetscapePluginInstanceProxy::waitForReply): Wait for a reply that matches the given requestID. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): Initialize member variables. (WebKit::NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy): Delete all requests. (WebKit::NetscapePluginInstanceProxy::print): Pass the requestID to _WKPHPluginInstancePrint. (WebKit::NetscapePluginInstanceProxy::loadRequest): Rename m_currentRequestID to m_currentURLRequestID. (WebKit::NetscapePluginInstanceProxy::processRequestsAndWaitForReply): Process requests until we find a reply with the right requestID. (WebKit::NetscapePluginInstanceProxy::createBindingsInstance): Pass a requestID to the _WKPH function. (WebKit::NetscapePluginInstanceProxy::nextRequestID): Ditto. * Plugins/Hosted/ProxyInstance.mm: Pass a requestID to the _WKPH functions. * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHost.defs: Add requestID parameters. 2009-03-11 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Fix <rdar://problem/6620064>. * Plugins/WebPluginContainerPrivate.h: 2009-03-10 Xan Lopez <xlopez@igalia.com> Build fix, no review. * WebView/WebFrame.mm: (-[WebFrame _smartDeleteRangeForProposedRange:]): 2009-03-09 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. WebKit side of <rdar://problem/6530007> * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCEnumerate): Call NetscapePluginInstanceProxy::enumerate. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::enumerate): Enumerate the JS object and serialize its values. * Plugins/Hosted/ProxyInstance.h: * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::getPropertyNames): Ask the plug-in host to get the property names and deserialize them. * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHost.defs: 2009-03-09 Simon Fraser <simon.fraser@apple.com> Reviewed by Oliver Hunt and Cameron Zwarich https://bugs.webkit.org/show_bug.cgi?id=24440 The sublayer added to WebHTMLView to host accelerated compositing layers needs to be a subclass of NSView which allows context menu clicks through. * WebView/WebHTMLView.mm: (-[WebLayerHostingView rightMouseDown:]): (-[WebHTMLView attachRootLayer:]): 2009-03-08 Mark Rowe <mrowe@apple.com> Reviewed by Oliver Hunt. Split ScrollAlignment and ScrollBehavior out of RenderLayer.h so that Frame.h no longer needs to include it. This cuts the size of the symbols for a debug build by around 3%. * Plugins/WebNetscapePluginView.mm: * WebView/WebFrame.mm: (-[WebFrame _scrollDOMRangeToVisible:]): (-[WebFrame _insertParagraphSeparatorInQuotedContent]): (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): * WebView/WebHTMLView.mm: (-[WebHTMLView jumpToSelection:]): (-[WebHTMLView centerSelectionInVisibleArea:]): 2009-03-07 Dan Bernstein <mitz@apple.com> Reviewed by Alexey Proskuryakov. - fix a bug where debug builds were clearing the HTML5 application cache on application termination * WebView/WebView.mm: (-[WebView _close]): Call -[WebCache setDisabled:YES] instead of -[WebCache empty]. 2009-03-06 Douglas R. Davidson <ddavidso@apple.com> Reviewed by Justin Garcia. https://bugs.webkit.org/show_bug.cgi?id=24108 Update spelling and grammar checking to use the new combined text checking (with automatic language identification) on Snow Leopard. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::checkSpellingAndGrammarOfParagraph): 2009-03-05 Adele Peterson <adele@apple.com> Reviewed by Darin Adler. Fix for https://bugs.webkit.org/show_bug.cgi?id=24079 <rdar://problem/6611233> REGRESSION (r39549): Page loads cannot be interrupted with Command-. or Escape <rdar://problem/6636563> Ctrl-tab shortcut doesn't switch tabs when focus is in text field * WebView/WebHTMLView.mm: (-[WebHTMLView doCommandBySelector:]): If WebKit does not support the command, we need to pass the selector to super. In this case, we'll consider the event not to be handled. This is not perfect because in theory, [super doCommandBySelector:] can do some action that would cause WebKit to need to consider the event handled. But in practice, I've found no example of that happening and causing broken behavior. 2009-03-04 Mark Rowe <mrowe@apple.com> Reviewed by Dan Bernstein. <rdar://problem/6206172> Adoption of new Cocoa API for dictionary contextual menu * WebView/WebHTMLView.mm: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): 2009-03-04 Adam Barth <abath@webkit.org> Reviewed by Alexey Proskuryakov. https://bugs.webkit.org/show_bug.cgi?id=24356 Fix WebKit style for allowUniversalAccessFromFileURLs. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences allowUniversalAccessFromFileURLs]): (-[WebPreferences setAllowUniversalAccessFromFileURLs:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2009-03-03 David Kilzer <ddkilzer@apple.com> <rdar://problem/6581203> WebCore and WebKit should install the same set of headers during installhdrs phase as build phase Reviewed by Mark Rowe. The fix is to add INSTALLHDRS_COPY_PHASE = YES and INSTALLHDRS_SCRIPT_PHASE = YES to WebKit.xcconfig, then to make sure various build phase scripts work with the installhdrs build phase. * Configurations/Base.xcconfig: Defined REAL_PLATFORM_NAME based on PLATFORM_NAME to work around the missing definition on Tiger. * Configurations/WebKit.xcconfig: Added WEBCORE_PRIVATE_HEADERS_DIR variable to remove definition of UMBRELLA_FRAMEWORKS_DIR for Debug and Release builds in the Xcode project file. Added INSTALLHDRS_COPY_PHASE = YES and INSTALLHDRS_SCRIPT_PHASE = YES. 2009-03-03 David Kilzer <ddkilzer@apple.com> Remove last vestiges of JAVASCRIPTCORE_PRIVATE_HEADERS_DIR from WebKit Reviewed by Adam Roben. Use of JAVASCRIPTCORE_PRIVATE_HEADERS_DIR was removed in r37465 since NPAPI headers had migrated from JavaScriptCore to WebCore before that. * Configurations/WebKit.xcconfig: Removed definition of JAVASCRIPTCORE_PRIVATE_HEADERS_DIR used in Production builds. 2009-03-03 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Fix <rdar://problem/6633834>. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::instantiatePlugin): Create a new plug-in instance if the plug-in host has crashed. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::invalidate): Add a null check for the plug-in host proxy. 2009-03-02 Sam Weinig <sam@webkit.org> Reviewed by Mark Rowe. Enable Geolocation (except on Tiger and Leopard). * Configurations/WebKit.xcconfig: 2009-03-02 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. WebKit part of <rdar://problem/6638658>. * Plugins/Hosted/NetscapePluginHostManager.h: * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::createPropertyListFile): Spawn the plug-in host and wait for it to create the property list. * Plugins/WebBasePluginPackage.mm: (-[WebBasePluginPackage createPropertyListFile]): Factor code out into a new method. (-[WebBasePluginPackage pListForPath:createFile:]): Call the newly added createPropertyListFile method. * Plugins/WebNetscapePluginPackage.mm: (-[WebNetscapePluginPackage createPropertyListFile]): Tell the plug-in host manager to create a property list file for us. 2009-03-02 Sam Weinig <sam@webkit.org> Reviewed by Geoffrey Garen. Fix for <rdar://problem/6507404> Add Geolocation support. This is not yet turned on for any Mac platform. Add SPI to ask the embedding application whether to allow Geolocation for an origin. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::shouldAllowGeolocationForFrame): * WebView/WebUIDelegatePrivate.h: 2009-03-02 Anders Carlsson <andersca@apple.com> Fix PowerPC build. * Plugins/WebNetscapePluginPackage.mm: (-[WebNetscapePluginPackage _tryLoad]): 2009-03-02 Anders Carlsson <andersca@apple.com> Reviewed by John Sullivan, Ada Chan. Factor loading code out into its own method and get rid of a bunch of gotos. * Plugins/WebNetscapePluginPackage.mm: (-[WebNetscapePluginPackage _tryLoad]): (-[WebNetscapePluginPackage load]): 2009-03-02 Anders Carlsson <andersca@apple.com> Build fix. * Plugins/WebNetscapeDeprecatedFunctions.h: 2009-03-02 Anders Carlsson <andersca@apple.com> Reviewed by John Sullivan. Rename WebNetscapePluginPackage.m to WebNetscapePluginPackage.mm * Plugins/WebNetscapePluginPackage.m: Removed. * Plugins/WebNetscapePluginPackage.mm: Copied from mac/Plugins/WebNetscapePluginPackage.m. 2009-03-01 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. WebKit side of <rdar://problem/6449689> Pass the visible name to the plug-in host. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::spawnPluginHost): 2009-02-27 Alice Liu <alice.liu@apple.com> Fix <rdar://problem/6531265> REGRESSION (r39185): adding ".jpeg" extension to images that already have .jpg extension Reviewed by Oliver Hunt. * WebView/WebHTMLView.mm: (-[NSString matchesExtensionEquivalent:]): (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Relax the check for the proper extension to allow for known equivalents, special-cased in matchesExtensionEquivalent function. 2009-02-27 Anders Carlsson <andersca@apple.com> Reviewed by Geoffrey Garen. <rdar://problem/6631436> CrashTracer: [USER] 1 crash in Safari at com.apple.WebKit • WebKit::NetscapePluginInstanceProxy::addValueToArray + 55 Port the NPN_Evaluate code over from WebCore instead of using the frame loader. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::evaluate): 2009-02-27 Anders Carlsson <andersca@apple.com> Reviewed by Geoffrey Garen. WebKit side of <rdar://problem/6626814>. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCInvokeDefault): Make InvokeDefault async. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::addValueToArray): Handle passing NPObjects back to the plug-in host. * Plugins/Hosted/ProxyInstance.h: (WebKit::ProxyInstance::objectID): Add objectID getter. * Plugins/Hosted/WebKitPluginClient.defs: Make InvokeDefault a simpleroutine. 2009-02-27 Timothy Hatcher <timothy@apple.com> Fixes an exception by null checking the WebResource before adding it to the subresources array. <rdar://problem/5950769> Bug in [WebDataSource subresources] can throw an exception Reviewed by Geoff Garen and Anders Carlsson. * WebView/WebDataSource.mm: (-[WebDataSource subresources]): Null check the WebResource before adding it. 2009-02-27 Timothy Hatcher <timothy@apple.com> Adds a workaround for Automator creating a WebView from a secondary thread. <rdar://problem/6631951> REGRESSION (Safari 4 Beta): Automator crash on secondary thread beneath -[WebView initWithFrame:frameName:groupName:] Reviewed by Geoff Garen. * WebView/WebView.mm: (needsWebViewInitThreadWorkaround): Check for com.apple.Automator. 2009-02-27 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Add a preference to reduce the power of file:// URLs. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences allowUniversalAccessFromFileUrls]): (-[WebPreferences setAllowUniversalAccessFromFileUrls:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2009-02-27 Simon Fraser <simon.fraser@apple.com> Reviewed by Anders Carlsson https://bugs.webkit.org/show_bug.cgi?id=24242 setCursor(), and resetCursorRects() on Tiger, were using global, not local coordinates for elementAtPoint: * WebView/WebHTMLView.mm: (resetCursorRects): (setCursor): 2009-02-27 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Add a preference to reduce the power of file:// URLs. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences allowUniversalAccessFromFileUrls]): (-[WebPreferences setAllowUniversalAccessFromFileUrls:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2009-02-26 Adele Peterson <adele@apple.com> Reviewed by Geoff Garen. Fix for <rdar://problem/6618166> https://bugs.webkit.org/show_bug.cgi?id=24216 (REGRESSION r36919) Safari 4 Beta causes MSN Messenger's text entry field to lose focus after entering a message During a series of firstResponder changes, at some point while the WebHTMLView was losing first responder status, we incorrectly marked the page as active, and then when the WebHTMLView became first responder again, setActive did nothing. This change restores behavior from before r36919 to check if the WebHTMLView is in the middle of losing first responder when calling setActive. In addition to updating editing/selection/designmode-no-caret.html results, I also made sure the test cases that were fixed in r36919 and r38570 are still fixed. * WebView/WebHTMLView.mm: (-[WebHTMLView resignFirstResponder]): Keep track if we're in the process of resigning first responder. (-[WebHTMLView _isResigningFirstResponder]): Added. * WebView/WebHTMLViewInternal.h: * WebView/WebView.mm: (-[WebView _updateFocusedAndActiveStateForFrame:]): Don't set the page to be active if the document view is currently resigning first responder. 2009-02-25 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Fix <rdar://problem/6623697>. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::print): Ask the plug-in host to print, create a CGImage of the returned bytes and draw the image into the passed in context. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView drawRect:]): When printing, call NetscapePluginInstanceProxy::print. * Plugins/Hosted/WebKitPluginHost.defs: 2009-02-19 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=24024 REGRESSION (r39845): Assertion failure in -[WebHistoryItem dictionaryRepresentation] when archiving a submission to about:blank I don't know how to make an automated test for this bug. * History/WebHistory.mm: (-[WebHistory _visitedURL:withTitle:method:wasFailure:]): Account for the fact that HTTP method may be non-empty for non-HTTP requests. 2009-02-25 Chris Fleizach <cfleizach@apple.com> Reviewed by Beth Dakin. Naming change from Bug 24143: Crash occurs at WebCore::AccessibilityTable::isTableExposableThroughAccessibility() when applying a link in GMail https://bugs.webkit.org/show_bug.cgi?id=24143 * WebView/WebFrame.mm: (-[WebFrame _accessibilityTree]): 2009-02-25 Simon Fraser <simon.fraser@apple.com> Build fix with ACCELERATED_COMPOSITING turned on. I missed a spot in my last commit in renaming to _stoppedAcceleratedCompositingForFrame: * WebView/WebHTMLView.mm: (-[WebHTMLView close]): 2009-02-25 Simon Fraser <simon.fraser@apple.com> Reviewed by Dan Bernstein https://bugs.webkit.org/show_bug.cgi?id=23854 Make an observable property, _isUsingAcceleratedCompositing, on WebView that DumpRenderTree can use to specialize behavior. This is implemented via a count of Frames that are using accelerated compositing. * WebView/WebHTMLView.mm: (-[WebHTMLViewPrivate clear]): (-[WebHTMLView close]): (-[WebHTMLView attachRootLayer:]): (-[WebHTMLView detachRootLayer]): * WebView/WebView.mm: (+[WebView automaticallyNotifiesObserversForKey:]): (-[WebView _startedAcceleratedCompositingForFrame:]): (-[WebView _stoppedAcceleratedCompositingForFrame:]): (-[WebView _isUsingAcceleratedCompositing]): * WebView/WebViewInternal.h: * WebView/WebViewPrivate.h: 2009-02-24 Sam Weinig <sam@webkit.org> Reviewed by Geoffrey Garen. Related to <rdar://problem/6590295> Allow disabling javascript: urls. * WebView/WebView.mm: (-[WebView _setJavaScriptURLsAreAllowed:]): * WebView/WebViewPrivate.h: 2009-02-24 Mark Rowe <mrowe@apple.com> Reviewed by Oliver Hunt. <rdar://problem/6259220> Rename AVAILABLE_AFTER_WEBKIT_VERSION_3_1 (etc.) to match the other macros * Carbon/CarbonUtils.h: * Carbon/HIWebView.h: * Plugins/WebPlugin.h: * Plugins/WebPluginViewFactory.h: * WebView/WebUIDelegate.h: 2009-02-24 Peter Ammon <pammon@apple.com> Reviewed by Mark Rowe. Fix <rdar://problem/6251410> Services can modify non-editable content in Safari * WebView/WebHTMLView.mm: (-[WebHTMLView validRequestorForSendType:returnType:]): Return self only if we can handle both the send and return type. We should also handle a nil send or return type by ignoring the argument and returning whether we can handle the other type passed in. 2009-02-23 Anders Carlsson <andersca@apple.com> Reviewed by Geoffrey Garen and Darin Adler. WebKit side of <rdar://problem/6613151>. Make sure to vm_deallocate all memory we get from MIG callbacks. * Plugins/Hosted/NetscapePluginHostProxy.mm: (DataDeallocator::DataDeallocator): (DataDeallocator::~DataDeallocator): Add a simple deallocator class. (WKPCStatusText): (WKPCLoadURL): (WKPCBooleanAndDataReply): (WKPCEvaluate): (WKPCGetStringIdentifier): (WKPCInvoke): (WKPCInvokeDefault): (WKPCConstruct): (WKPCSetProperty): Use the new deallocator class. 2009-02-23 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Fix <rdar://problem/6450656>. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::insertText): Add insert text which just calls the new WKPH function. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView inputContext]): Get the input context from the shared input panel. (-[WebHostedNetscapePluginView keyDown:]): Let the shared input panel have a go at the event first. * Plugins/Hosted/WebKitPluginHost.defs: Add new InsertText function. 2009-02-23 Mark Rowe <mrowe@apple.com> Fix the build after r41126. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::invoke): (WebKit::NetscapePluginInstanceProxy::invokeDefault): (WebKit::NetscapePluginInstanceProxy::construct): 2009-02-22 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - fix <rdar://problem/5966123> REGRESSION (r30741): Generic Sun Applet loading logo appears half off screen * WebCoreSupport/WebFrameLoaderClient.mm: Correct a copy & paste error in r30741, and assign the height value, rather than the width, to the "height" parameter. 2009-02-21 Anders Carlsson <andersca@apple.com> Fix build. * Plugins/Hosted/WebTextInputWindowController.m: 2009-02-20 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Add a shared floating text input window implementation, to be used by the hosted plug-in view. * Plugins/Hosted/WebTextInputWindowController.h: Added. * Plugins/Hosted/WebTextInputWindowController.m: Added. 2009-02-20 Kevin Decker <kdecker@apple.com> Reviewed by andersca. <rdar://problem/6496140> Safari sometimes hangs in WKSetMetadataURL for several seconds after downloading a file Spawn a background thread for WKSetMetadataURL because this function will not return until mds has journaled the data we are trying to set. Depending on what other I/O is going on, it can take some time. * Misc/WebNSFileManagerExtras.m: Import pthread.h and FoundationExtras.h (setMetaData): Added. Calls WKSetMetadataURL(). (-[NSFileManager _webkit_setMetadataURL:referrer:atPath:]): Call setMetaData on a background thread 2009-02-19 Dan Bernstein <mitz@apple.com> Reviewed by Sam Weinig. - WebKit part of fixing https://bugs.webkit.org/show_bug.cgi?id=24027 Do not send loader callbacks during CSS styling * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Reverted the iChat-specific quirk added in <http://trac.webkit.org/changeset/41071>. 2009-02-18 Dan Bernstein <mitz@apple.com> Reviewed by Brady Eidson. - WebKit part of fixing <rdar://problem/6507512> Crash in iChat at CSSStyleSelector::adjustRenderStyle * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Activate the WebCore workaround for this crash in iChat. 2009-02-18 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Fix for <rdar://problem/6542390> There's no need to call setDefersLoading here - we already defer anything a plug-in can do that would cause a load to begin. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView sendEvent:isDrawRect:]): 2009-02-18 Adam Roben <aroben@apple.com> Add SPI to get WebKit's custom pointing-hand cursor Reviewed by John Sullivan. * WebView/WebView.mm: (+[WebView _pointingHandCursor]): Added. Returns the custom pointing-hand cursor that WebKit uses. * WebView/WebViewPrivate.h: Added +_pointingHandCursor. 2009-02-17 Eric Carlson <eric.carlson@apple.com> Reviewed by Antti Koivisto. https://bugs.webkit.org/show_bug.cgi?id=23917 Allow a WebKit plug-in to act as a proxy for the <audio> and <video> element. * Plugins/WebPluginContainerPrivate.h: * Plugins/WebPluginController.mm: (mediaProxyClient): New, cast to HTMLMediaElement if it is a video or audio element (-[WebPluginController _setMediaPlayerProxy:forElement:]): New, pass proxy to HTMLMediaElement (-[WebPluginController _postMediaPlayerNotification:forElement:]): New, deliver event to HTMLMediaElement * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createPlugin): Don't allow a media player proxy plug-in to be chosen by file extension, only want a match for the new MIME type proxy plug-ins should have. 2009-02-13 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. <rdar://problem/6584834> ESPN radio live stream link hangs Safari When a plug-in invokes JavaScript code that will destroy the plug-in, we need to defer destruction until we're done executing the script. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::PluginDestroyDeferrer::PluginDestroyDeferrer): (WebKit::PluginDestroyDeferrer::~PluginDestroyDeferrer): Add a simple RAII object for deferring destruction of the plug-in instance. (WKPCEvaluate): (WKPCInvoke): (WKPCInvokeDefault): (WKPCConstruct): (WKPCGetProperty): (WKPCSetProperty): (WKPCRemoveProperty): (WKPCHasProperty): (WKPCHasMethod): Use the PluginDestroyDeferrer. * Plugins/Hosted/NetscapePluginInstanceProxy.h: (WebKit::NetscapePluginInstanceProxy::pluginID): Assert that the plug-in ID is not 0 here. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): Initialize the call depth. (WebKit::NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy): Set the plug-in ID to 0 to aid debugging. (WebKit::NetscapePluginInstanceProxy::willCallPluginFunction): Increment the call depth. (WebKit::NetscapePluginInstanceProxy::didCallPluginFunction): Decrement the call depth, if it's 0 and we should stop the plug-in, do so. (WebKit::NetscapePluginInstanceProxy::shouldStop): If we're called this with a non-zero call depth, set shouldStopSoon to true. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView shouldStop]): Call the proxy. 2009-02-12 Brady Eidson <beidson@apple.com> Reviewed by Kevin Decker <rdar://problem/6582180> - Wrong HTTP method applied to history item. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::updateGlobalHistory): Check the original request, not any redirected request. 2009-02-12 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. <rdar://problem/6579412> REGRESSION (3.2.1-ToT): Crash in Silverlight viewing streaming lecture * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView userAgent]): Apply workaround for Silverlight workaround. (-[WebNetscapePluginView _createPlugin]): Check if the plug-in that we're creating is the silverlight plug-in. 2009-02-12 Brady Eidson <beidson@apple.com> Reviewed by Darin Adler Fix potential ref-count or null-deref problems with C++ objects as Obj-C members. * History/WebBackForwardList.mm: (-[WebBackForwardList dealloc]): Null check before deref()'ing. (-[WebBackForwardList finalize]): Ditto. * Misc/WebIconFetcher.mm: (-[WebIconFetcher dealloc]): Null check before deref()'ing. (-[WebIconFetcher finalize]): Ditto. * WebCoreSupport/WebEditorClient.mm: Change to use RefPtr<> instead of ref()/deref(). (-[WebEditCommand initWithEditCommand:]): (-[WebEditCommand dealloc]): (-[WebEditCommand finalize]): (-[WebEditCommand command]): * WebView/WebArchive.mm: Change to use RefPtr<> instead of ref()/deref(). (-[WebArchivePrivate init]): (-[WebArchivePrivate initWithCoreArchive:]): (-[WebArchivePrivate coreArchive]): (-[WebArchivePrivate setCoreArchive:]): (-[WebArchivePrivate dealloc]): (-[WebArchivePrivate finalize]): * WebView/WebDataSource.mm: (-[WebDataSourcePrivate dealloc]): Null check before deref()'ing. (-[WebDataSourcePrivate finalize]): Ditto. 2009-02-12 Brady Eidson <beidson@apple.com> Reviewed by Kevin Decker <rdar://problem/6579750> - Crash in WebArchivePrivate in Tiger TextEdit NSHTMLReader tries to create a WebArchive from a random chunk of data. Previously, WebArchive creation would fail and return nil and NSHTMLReader would try something else. When we changed the behavior to return an invalid WebArchive object, things started getting weird. * WebView/WebArchive.mm: (-[WebArchivePrivate setCoreArchive:]): Null check the pointer before calling ->deref() (-[WebArchivePrivate dealloc]): Remove the ASSERT which is now invalid, and null check the pointer before ->deref(). (-[WebArchivePrivate finalize]): Ditto (-[WebArchive initWithData:]): If the LegacyWebArchive cannot be created, return nil instead of an invalid object. 2009-02-11 Mark Rowe <mrowe@apple.com> Fix the build. * History/WebHistory.mm: (-[WebHistoryPrivate visitedURL:withTitle:]): Use ASSERT_UNUSED in a manner that makes sense. 2009-02-11 Brady Eidson <beidson@apple.com> Reviewed by Mark Rowe <rdar://problem/6570573> Some visit counts in History.plist have insanely high values, can roll over to negative Remove the item from the date caches before registering the visit. Otherwise it might not be successfully removed and when we add it back later it will exist in the list twice. This will cause the entry to be written out twice, which would lead to doubling (or more!) the visit count on next launch when these multiple items are merged. * History/WebHistory.mm: (-[WebHistoryPrivate visitedURL:withTitle:]): Swap the removeItemFromDateCaches and visitedWithTitle calls. (-[WebHistoryPrivate addItem:discardDuplicate:]): Add a mode that allows the entry being added to be discarded if an entry for the URL already exists. Use that mode when reading the History.plist so only the most recent entry for a given URL will be used. (-[WebHistoryPrivate addItems:]): (-[WebHistoryPrivate loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]): 2009-02-11 Dimitri Dupuis-latour <dupuislatour@apple.com> Added a preference to disable some Inspector's panels (rdar://6419624, rdar://6419645). This is controlled via the 'WebKitInspectorHiddenPanels' key; if nothing is specified, all panels are shown. Reviewed by Timothy Hatcher. * WebCoreSupport/WebInspectorClient.h: * WebCoreSupport/WebInspectorClient.mm: (WebInspectorClient::hiddenPanels): 2009-02-11 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. <rdar://problem/6562920> Pasted text should be normalized to NFC * Misc/WebNSURLExtras.mm: (-[NSURL _web_userVisibleString]): Route the URL string through -[NSString precomposedStringWithCanonicalMapping]. * WebCoreSupport/WebPasteboardHelper.mm: (WebPasteboardHelper::plainTextFromPasteboard): Ditto. * WebView/WebHTMLView.mm: (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]): Ditto. The affected cases are all plain text ones - RTF, RTFD and HTML are assumed to be precomposed already, and the conversion is performed outside WebKit for those anyway. 2009-02-10 John Sullivan <sullivan@apple.com> Reviewed by Dan Bernstein <https://bugs.webkit.org/show_bug.cgi?id=23889>, <rdar://problem/6572300> Negative visit counts stored in History.plist aren't corrected. It's not clear how a huge negative visit count ended up in History.plist, but we can't trust data read from disk so we can at least reset this to something sane. WebCore has no guard against a visit count overflowing an int, but that seems very unlikely to have caused this. * History/WebHistoryItem.mm: (-[WebHistoryItem initFromDictionaryRepresentation:]): If a negative visit count is in the dictionary, replace it with 1. If a negative daily or weekly visit count is in the dictionary, replace it with 0. 2009-02-10 John Sullivan <sullivan@apple.com> Reviewed by Dan Bernstein <https://bugs.webkit.org/show_bug.cgi?id=23891> [WebHistoryItem _setVisitCount:] is unused and should be removed * History/WebHistoryItem.mm: (-[WebHistoryItem _setVisitCount:]): removed this unused method, which is a synonym for setVisitCount: that was introduced recently and abandoned even more recently * History/WebHistoryItemInternal.h: removed declaration of _setVisitCount: 2009-02-10 Anders Carlsson <andersca@apple.com> Reviewed by Mark Rowe. <rdar://problem/6573916> CrashTracer: [USER] 1 crash in Safari at com.apple.WebKit • WebKit::NetscapePluginInstanceProxy::pluginHostDied + 25. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::instantiatePlugin): If we failed to instantiate the plug-in, invalidate the instance proxy. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::invalidate): Remove the instance from the plug-in host's set. (WebKit::NetscapePluginInstanceProxy::destroy): Call invalidate(). 2009-02-09 Mark Rowe <mrowe@apple.com> Reviewed by Dan Bernstein. Fix <https://bugs.webkit.org/show_bug.cgi?id=23863> / <rdar://problem/6571390>. Bug 23863: Reproducible crash in Mail with TOT WebKit when creating a new message * WebView/WebHTMLView.mm: (-[WebHTMLView _removeMouseMovedObserverUnconditionally]): Nil-check _private as it may have not yet been initialized if this WebHTMLView was loaded from a nib. (-[WebHTMLView _removeSuperviewObservers]): Ditto. 2009-02-09 Eric Seidel <eric@webkit.org> Reviewed by Dave Hyatt. Rename Selection to VisibleSelection to allow us to separate the selections the user works with from the ones used by the JS editing APIs. https://bugs.webkit.org/show_bug.cgi?id=23852 * WebView/WebFrame.mm: (-[WebFrame _selectNSRange:]): * WebView/WebView.mm: (-[WebView textIteratorForRect:]): 2009-02-06 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Fix crash when plug-in host dies. * Plugins/Hosted/HostedNetscapePluginStream.mm: (WebKit::HostedNetscapePluginStream::didFail): 2009-02-05 Eric Seidel <eric@webkit.org> Reviewed by Justin Garcia. DOMSelection.getRangeAt() returns a different range than the selection https://bugs.webkit.org/show_bug.cgi?id=23601 Rename toRange to toNormalizedRange and add new firstRange which returns an unmodified range * WebView/WebFrame.mm: (-[WebFrame _rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]): (-[WebFrame _markDOMRange]): (-[WebFrame _replaceSelectionWithText:selectReplacement:smartReplace:]): (-[WebFrame _selectedNSRange]): * WebView/WebHTMLView.mm: (-[WebHTMLView _selectedRange]): (-[WebTextCompleteController doCompletion]): (-[WebHTMLView selectedAttributedString]): * WebView/WebView.mm: (-[WebView textIteratorForRect:]): (-[WebView selectedDOMRange]): 2009-02-06 Geoffrey Garen <ggaren@apple.com> Reviewed by Sam Weinig. Part III of <rdar://problem/6552272>. Refactored to use the redirect data WebCore makes available, instead of tracking loading state in WebKit. * History/WebHistory.mm: (-[WebHistoryPrivate dealloc]): (-[WebHistory _visitedURL:withTitle:method:wasFailure:]): (-[WebHistory _visitedURLForRedirectWithoutHistoryItem:]): * History/WebHistoryInternal.h: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::updateGlobalHistory): (WebFrameLoaderClient::updateGlobalHistoryRedirectLinks): 2009-02-06 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. <rdar://problem/6562220> CrashTracer: [USER] 21 crashes in Safari at com.apple.WebKit • WebKit::NetscapePluginHostProxy::port Make the handling of crashes in the plug-in host more robust. * Plugins/Hosted/NetscapePluginHostProxy.h: Add m_portSet. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): Initialize m_portSet. (WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy): Free m_portSet. (WebKit::NetscapePluginHostProxy::processRequests): Listen for messages on the port set. If we get a message to the port death notification port, then call pluginHostDied. Otherwise, process the message. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::cleanup): Factor code that should be shared between destroy() and pluginHostDied() into cleanup. (WebKit::NetscapePluginInstanceProxy::destroy): Call cleanup(). (WebKit::NetscapePluginInstanceProxy::pluginHostDied): Call cleanup(). (WebKit::NetscapePluginInstanceProxy::processRequestsAndWaitForReply): Call NetscapePluginHostProxy::processRequests. * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::invalidate): Add a null check for the host proxy. 2009-02-06 Dan Bernstein <mitz@apple.com> - try to fix the Tiger build * Misc/WebNSArrayExtras.h: 2009-02-06 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. <rdar://problem/6563650> Add Netscape plug-in API to tell the browser not to load streams (some plug-ins handle network loading manually) * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView loadStream]): (-[WebNetscapePluginView pluginView:receivedData:]): (-[WebNetscapePluginView _shouldCancelSrcStream]): 2009-02-05 Maciej Stachowiak <mjs@apple.com> and Brady Eidson <beidson@apple.com> Reviewed by Dan Bernstein and Geoff Garen. - WebKit code to track per-day and per-week visit counts in history For now this data is only exposed via SPI for performance reasons. * History/WebHistoryItem.mm: (-[WebHistoryItem initFromDictionaryRepresentation:]): Add parsing support for new data. (-[WebHistoryItem _recordInitialVisit]): Tell WebCore to record an initial visit. (-[WebHistoryItem dictionaryRepresentation]): Add saving support for new data. (-[WebHistoryItem _getDailyVisitCounts:]): SPI accessor. (-[WebHistoryItem _getWeeklyVisitCounts:]): SPI accessor. * History/WebHistoryItemInternal.h: Declare new methods. * History/WebHistoryItemPrivate.h: Ditto. * History/WebHistory.mm: (-[WebHistoryPrivate visitedURL:withTitle:]): For the initial visit, use the new _recordInitialVisit method instead of setting visit count to 1. * Misc/WebNSArrayExtras.h: * Misc/WebNSArrayExtras.m: (-[NSArray _webkit_numberAtIndex:]): Helper to retrieve an NSNumber or nil from an NSArray (-[NSArray _webkit_stringAtIndex:]): Helper to retrieve an NSString of nil from an NSArray 2009-02-05 Aaron Boodman <aa@chromium.org> Reviewed by Dave Hyatt. https://bugs.webkit.org/show_bug.cgi?id=23708 Adds documentElementAvailable() callback to FrameLoaderClient. * WebCoreSupport/WebFrameLoaderClient.h: Stub out documentElementAvailable(). * WebCoreSupport/WebFrameLoaderClient.mm: Ditto. 2009-02-05 Dan Bernstein <mitz@apple.com> - build fix * WebView/WebScriptDebugger.mm: (WebScriptDebugger::initGlobalCallFrame): 2009-02-05 Beth Dakin <bdakin@apple.com> Reviewed by John Sullivan and Brady Eidson. Fix for <rdar://problem/6557595> REGRESSION: In Mail, selecting a mail note message doesn't display it in Mail's preview pane This was failing because revision 36962 removed a version of setVerticalScrollingMode that mail calls. This patch simply adds that method back. * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView setVerticalScrollingMode:]): 2009-02-04 Anders Carlsson <andersca@apple.com> Build fix fix. * WebView/WebScriptDebugger.mm: (WebScriptDebugger::initGlobalCallFrame): 2009-02-04 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Change PCHasProperty, PCHasMethod and PCGetProperty into simpleroutines. Rename PHEvaluateReply to PHBooleanAndDataReply and add PHBooleanReply. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCEvaluate): (WKPCInvoke): (WKPCGetProperty): (WKPCHasProperty): (WKPCHasMethod): * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHost.defs: 2009-02-04 Anders Carlsson <andersca@apple.com> Reviewed by Mark Rowe. Fix 64-bit build. * WebView/WebScriptDebugger.mm: (WebScriptDebugger::initGlobalCallFrame): 2009-02-04 Geoffrey Garen <ggaren@apple.com> Reviewed by Mark Rowe. Part I of <rdar://problem/6552272>. Clear the redirectURLs entry when first visiting a site, so sites that only redirect you the first time you visit them can later learn that they don't redirect. * History/WebHistory.mm: (-[WebHistory _visitedURL:withTitle:method:wasFailure:serverRedirectURL:isClientRedirect:]): 2009-02-04 Timothy Hatcher <timothy@apple.com> Change the WebSourceId typedef from int to intptr_t now that <rdar://problem/6263297> is fixed. <rdar://problem/6263293> WebScriptDebugDelegate should use intptr_t for sourceId, not int Reviewed by Oliver Hunt. * WebView/WebScriptDebugDelegate.h: 2009-02-04 Timothy Hatcher <timothy@apple.com> Switched over from using the WebSafeForwarder for the Script Debug delegate and added high performance CallScriptDebugDelegate functions. <rdar://problem/6508457> Launching widget in Dashcode debugger is super-slow due forwardInvocation: calling debug delegate Reviewed by Oliver Hunt. * DefaultDelegates/WebDefaultScriptDebugDelegate.h: Removed. * DefaultDelegates/WebDefaultScriptDebugDelegate.m: Removed. * WebView/WebScriptDebugger.mm: (WebScriptDebugger::initGlobalCallFrame): Use CallScriptDebugDelegate. (WebScriptDebugger::sourceParsed): Ditto. (WebScriptDebugger::callEvent): Ditto. (WebScriptDebugger::atStatement): Ditto. (WebScriptDebugger::returnEvent): Ditto. (WebScriptDebugger::exception): Ditto. * WebView/WebView.mm: (-[WebViewPrivate dealloc]): Removed scriptDebugDelegateForwarder. (-[WebView _cacheScriptDebugDelegateImplementations]): Added. Gets the method implementations for the script debug delegate. Also caches what didParseSource method to use. (WebViewGetScriptDebugDelegateImplementations): Added. Returns the WebScriptDebugDelegateImplementations structure. (-[WebView setScriptDebugDelegate:]): Call _cacheScriptDebugDelegateImplementations. (CallDelegate): Added more overloaded versions that take different arguments. (CallScriptDebugDelegate): Added overloaded versions that take different arguments. * WebView/WebViewInternal.h: 2009-02-03 Simon Fraser <simon.fraser@apple.com> Reviewed by Dave Hyatt https://bugs.webkit.org/show_bug.cgi?id=23365 Hook up accelerated compositing layers the native view system on Mac. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::attachRootGraphicsLayer): (WebChromeClient::setNeedsOneShotDrawingSynchronization): New methods to hook up the root GraphicsLayer to the native view system, and to synchronize layer changes with view-based drawing when layers come and go. * WebView/WebHTMLView.mm: (-[WebHTMLViewPrivate clear]): Clear the pointer to layerHostingView. (-[WebHTMLView _setAsideSubviews]): (-[WebHTMLView willRemoveSubview:]): Keep the special layer-hosting view in the subviews even when the rest of the subviews are ripped out for painting. (-[WebHTMLView _isUsingAcceleratedCompositing]): New utility method for DumpRenderTree to know if we're hosting layers. (-[WebHTMLView drawRect:]): Call -disableScreenUpdatesUntilFlush if we have to synchronize layer changes with painting. (-[WebHTMLView attachRootLayer:]): (-[WebHTMLView detachRootLayer]): Attach and detach the root GraphicsLayer. * WebView/WebViewInternal.h: * WebView/WebHTMLViewInternal.h: * WebView/WebHTMLViewPrivate.h: New method declarations. * WebView/WebView.mm: (-[WebView _needsOneShotDrawingSynchronization]): (-[WebView _setNeedsOneShotDrawingSynchronization:]): Set the flag to say if we need to synchronize layer changes and painting on the next -drawRect: call. (-[WebView viewWillMoveToWindow:]): (-[WebView viewDidMoveToWindow]): Call new notifications that the view was added to or removed from the window, which are required by the layer hosting mechanism. 2009-02-02 Geoffrey Garen <ggaren@apple.com> Build fix. * Plugins/WebPluginController.mm: (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]): 2009-02-02 Geoffrey Garen <ggaren@apple.com> Reviewed by Sam Weinig. Track redirects in global history. * History/WebHistory.mm: (-[WebHistoryPrivate dealloc]): (-[WebHistoryPrivate lastVisitedEntry]): (-[WebHistoryPrivate setLastVisitedEntry:]): Remember the last global history entry in case we're asked to add redirect information to it later. (-[WebHistory _visitedURL:withTitle:method:wasFailure:serverRedirectURL:isClientRedirect:]): (-[WebHistory _visitedURLForRedirectWithoutHistoryItem:]): Record redirect information in global history. * History/WebHistoryInternal.h: * WebCoreSupport/WebFrameLoaderClient.h: See above and below. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::updateGlobalHistory): (WebFrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem): Record redirect information in global history. * WebView/WebFrame.mm: (-[WebFrame loadRequest:]): (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): * WebView/WebFramePrivate.h: Updated for rename and extra parameter. 2009-02-02 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Work around a limitation in MIG where two functions can't have the same name even if they're not in the same subsystem. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::processRequestsAndWaitForReply): * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHost.defs: 2009-02-02 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Implement WKPCGetPluginElementObject. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCGetPluginElementNPObject): * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::getPluginElementNPObject): * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView WebCore::]): 2009-02-02 Anders Carlsson <andersca@apple.com> Build fix. * WebView/WebHTMLView.mm: 2009-02-02 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Make WebBaseNetscapePluginView hold a reference to a HTMLPlugInElement instead of a DOMElement. * Plugins/Hosted/WebHostedNetscapePluginView.h: * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]): * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]): (-[WebBaseNetscapePluginView _windowClipRect]): (-[WebBaseNetscapePluginView visibleRect]): (-[WebBaseNetscapePluginView dataSource]): * Plugins/WebKitPluginContainerView.h: Removed. * Plugins/WebKitPluginContainerView.mm: Removed. * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]): (-[WebNetscapePluginView getVariable:value:]): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createPlugin): 2009-02-02 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Update for changes to WebCore. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createPlugin): 2009-02-02 Anders Carlsson <andersca@apple.com> Reviewed by Oliver Hunt. When a new Web View was not created, report back to the plug-in host. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::performRequest): * Plugins/Hosted/WebKitPluginHost.defs: 2009-02-02 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Draw the regular missing plug-in icon instead of a red rect when a plug-in has crashed. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView drawRect:]): 2009-02-02 Holger Hans Peter Freyther <zecke@selfish.org> Reviewed by Darin Adler. Move Frame::forceLayout, Frame::adjustPageHeight and Frame::forceLayoutWithPageWidthRange to FrameView https://bugs.webkit.org/show_bug.cgi?id=23428 FrameView::forceLayout could be killed but the comment might contain a value over the the plain FrameView::layout... Adjust the WebCore/WebKit consumers of these methods. * WebView/WebFrame.mm: (-[WebFrame _computePageRectsWithPrintWidthScaleFactor:printHeight:]): * WebView/WebHTMLView.mm: (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): 2009-01-31 John Sullivan <sullivan@apple.com> https://bugs.webkit.org/show_bug.cgi?id=23665 Cleaned up code to add/remove NSNotification observers, to avoid performance hit of calling removeObserver with unspecified notifications, or calling removeObserver multiple times for the same notification. Reviewed by Darin Adler * WebView/WebHTMLView.mm: added observingMouseMovedNotifications, observingSuperviewNotifications, and observingWindowNotifications as BOOL ivars of _private object (-[WebHTMLView _removeMouseMovedObserverUnconditionally]): moved to file-internal section of file, added leading underscore, now bails out if we aren't observing the relevant notifications, now records that we are no longer observing the relevant notifications (-[WebHTMLView _removeSuperviewObservers]): ditto, also stores [NSNoticationCenter defaultCenter] in local var to avoid objc dispatch (-[WebHTMLView _removeWindowObservers]): ditto (-[WebHTMLView close]): replace general removeObserver: call with three specific calls for all the notifications that this class actually observes (-[WebHTMLView addMouseMovedObserver]): bail out if already observing relevant notifications, now records that we are observing the relevant notifications (-[WebHTMLView removeMouseMovedObserver]): updated for name change (-[WebHTMLView addSuperviewObservers]): bail out if already observing relevant notifications, now records that we are observing the relevant notifications; also stores [NSNoticationCenter defaultCenter] in local var to avoid objc dispatch (-[WebHTMLView addWindowObservers]): ditto (-[WebHTMLView viewWillMoveToSuperview:]): updated for name change (-[WebHTMLView viewWillMoveToWindow:]): updated for name changes 2009-01-31 Darin Adler <darin@apple.com> Reviewed by Mark Rowe. Fix code that assumes all command selectors end in colons. rdar://problem/6545874 * WebView/WebHTMLView.mm: (commandNameForSelector): Don't assert, just return a null string, when the selector doesn't end in a colon. 2009-01-30 Adam Barth <abarth@webkit.org> Reviewed by Sam Weinig. Add a pref to disable web security. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferencesPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences isWebSecurityEnabled]): (-[WebPreferences setWebSecurityEnabled:]): * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2009-01-30 Holger Hans Peter Freyther <zecke@selfish.org> Reviewed by Darin Adler. Move Frame::sendResizeEvent and Frame::sendScrollEvent to EventHandler Carry out the move and catch up in two call sites. * WebView/WebHTMLView.mm: (-[WebHTMLView _frameOrBoundsChanged]): 2009-01-30 Holger Hans Peter Freyther <zecke@selfish.org> Reviewed by Darin Adler. isFrameSet was moved from Frame to Document. Update the WebKit usage. * WebView/WebFrame.mm: (-[WebFrame _isFrameSet]): * WebView/WebHTMLView.mm: (-[WebHTMLView knowsPageRange:]): 2009-01-30 Geoffrey Garen <ggaren@apple.com> Build fix. * WebView/WebFramePrivate.h: 2009-01-30 Geoffrey Garen <ggaren@apple.com> Reviewed by Sam Weinig. Split "lockHistory" into "lockHistory" and "lockBackForwardList" in preparation for setting them differently during a redirect. * WebView/WebPDFView.mm: (-[WebPDFView PDFViewWillClickOnLink:withURL:]): 2009-01-30 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Fix <rdar://problem/6544048> Have NetscapePluginInstanceProxy keep track of all the ProxyInstance objects associated. When the plug-in instance is destroyed, invalidate all proxy instances. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::destroy): (WebKit::NetscapePluginInstanceProxy::addInstance): (WebKit::NetscapePluginInstanceProxy::removeInstance): * Plugins/Hosted/ProxyInstance.h: * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::ProxyInstance): (WebKit::ProxyInstance::~ProxyInstance): (WebKit::ProxyInstance::invalidate): 2009-01-30 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Fix <rdar://problem/6490778>. Change the NPRuntime related functions to use IdentifierRep directly, and make sure to always validate IdentifierReps before dereferencing them. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCEvaluate): (WKPCGetStringIdentifier): (WKPCGetIntIdentifier): (identifierFromIdentifierRep): (WKPCInvoke): (WKPCGetProperty): (WKPCSetProperty): (WKPCRemoveProperty): (WKPCHasProperty): (WKPCHasMethod): (WKPCIdentifierInfo): 2009-01-30 Brady Eidson <beidson@apple.com> Reviewed by Sam Weinig Remove FrameLoaderClient code that is now handled by FrameLoader itself * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::frameLoadCompleted): 2009-01-29 Stephanie Lewis <slewis@apple.com> RS by Oliver Hunt. Update the order files. * WebKit.order: 2009-01-29 Sam Weinig <sam@webkit.org> Reviewed by Anders Carlsson. Second step in tracking the urls a HistoryItem was redirected through Add SPI to access the array of redirect urls associated with a HistoryItem. * History/WebHistoryItem.mm: (-[WebHistoryItem dictionaryRepresentation]): (-[WebHistoryItem _redirectURLs]): * History/WebHistoryItemPrivate.h: 2009-01-29 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Always activate the plug-in host process if we're in "modal mode" and are being told to activate. * Plugins/Hosted/NetscapePluginHostProxy.h: * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::pluginHostDied): Call endModal here. (WebKit::NetscapePluginHostProxy::applicationDidBecomeActive): If we're modal, we should always bring the plug-in host process to the front. (WebKit::NetscapePluginHostProxy::beginModal): Add an observer for the NSApplicationWillBecomeActiveNotification callback. (WebKit::NetscapePluginHostProxy::endModal): Remove the observer. 2009-01-29 Sam Weinig <sam@webkit.org> Reviewed by Mark Rowe. First step in tracking the urls a HistoryItem was redirected through. * History/WebHistoryItem.mm: (-[WebHistoryItem initFromDictionaryRepresentation:]): (-[WebHistoryItem dictionaryRepresentation]): * Misc/WebNSDictionaryExtras.h: * Misc/WebNSDictionaryExtras.m: (-[NSDictionary _webkit_arrayForKey:]): Add helper. 2009-01-29 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Pass the PSN of the client to the host, and get the PSN of the host back when checking in. * Plugins/Hosted/NetscapePluginHostManager.h: * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::hostForPackage): Get the current PSN and pass it to spawnPluginHost. (WebKit::NetscapePluginHostManager::spawnPluginHost): Pass the PSN to the "check in" function. * Plugins/Hosted/NetscapePluginHostProxy.h: * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): (WebKit::NetscapePluginHostProxy::pluginHostDied): Fix a bug noticed by Julien Chaffraix. Call endModal if necessary. (WebKit::NetscapePluginHostProxy::beginModal): (WebKit::NetscapePluginHostProxy::endModal): (WebKit::NetscapePluginHostProxy::setModal): Split out the code that does all of the work into beginModal and endModal methods. * Plugins/Hosted/WebKitPluginHost.defs: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView loadStream]): 2009-01-29 David Kilzer <ddkilzer@apple.com> Remove semi-colons from the end of ObjC method implementations Rubber-stamped by Adam Roben. $ find WebKit -name \*.m -o -name \*.mm -exec perl -e 'undef $/; $s = <>; while ($s =~ m/[\n\r][-+].*;[\s\r\n]+\{/g) { print "$ARGV: $&\n"; }' {} \; * DefaultDelegates/WebDefaultUIDelegate.m: (-[WebDefaultUIDelegate webView:setResizable:]): (-[WebDefaultUIDelegate webView:dragDestinationActionMaskForDraggingInfo:]): (-[WebDefaultUIDelegate webView:dragSourceActionMaskForPoint:]): (-[WebDefaultUIDelegate webView:willPerformDragSourceAction:fromPoint:withPasteboard:]): * History/WebBackForwardList.mm: (-[WebBackForwardList addItem:]): (-[WebBackForwardList backListWithLimit:]): (-[WebBackForwardList forwardListWithLimit:]): * History/WebHistoryItem.mm: (-[WebHistoryItem alternateTitle]): (-[WebHistoryItem setViewState:]): * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging:]): * Misc/WebKitNSStringExtras.m: (-[NSString _web_drawAtPoint:font:textColor:]): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView setAttributeKeys:andValues:]): * WebCoreSupport/WebEditorClient.mm: (-[WebEditCommand command]): * WebView/WebFrame.mm: (-[WebFrame _getVisibleRect:]): * WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation _redirectDataToManualLoader:forPluginView:]): * WebView/WebHTMLView.mm: (-[WebHTMLView elementAtPoint:allowShadowContent:]): * WebView/WebPreferences.mm: (-[WebPreferences setAllowsAnimatedImages:]): (-[WebPreferences setAutosaves:]): (-[WebPreferences PDFDisplayMode]): * WebView/WebView.mm: (+[WebView _viewClass:andRepresentationClass:forMIMEType:]): (-[WebView _viewClass:andRepresentationClass:forMIMEType:]): (+[WebView _unregisterViewClassAndRepresentationClassForMIMEType:]): (+[WebView _registerViewClass:representationClass:forURLScheme:]): (-[WebView _shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:]): (-[WebView _insertNewlineInQuotedContent]): 2009-01-28 Geoffrey Garen <ggaren@apple.com> Reviewed by Sam Weinig. Updated for WebCore rename. * WebView/WebView.mm: (-[WebView setCustomTextEncodingName:]): 2009-01-28 David Kilzer <ddkilzer@apple.com> Add missing declaration for -[NSURL(WebNSURLExtras) _webkit_isFileURL] Reviewed by Dan Bernstein. * Misc/WebNSURLExtras.h: (-[NSURL(WebNSURLExtras) _webkit_isFileURL]): Added missing declaration after the implementation was added in r9258. 2009-01-28 Sam Weinig <sam@webkit.org> Reviewed by Geoff Garen. Fix for <rdar://problem/6129678> REGRESSION (Safari 3-4): Local variable not accessible from Dashcode console or variables view * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame scopeChain]): Wrap JSActivations in DebuggerActivations. 2009-01-27 Anders Carlsson <andersca@apple.com> Reviewed by Oliver Hunt. Fix two bugs with Core Animation based plug-ins. 1. The plug-in view was marked as opaque even though it's not. (This would leave garbage in the plug-in view). 2. The plug-in layer needs to have autoresizing turned on. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView setLayer:]): 2009-01-27 Brady Eidson <beidson@apple.com> Reviewed by Dan Bernstein Rework FrameLoaderClient to work on a CachedFrame basis instead of CachedPage * History/WebHistoryItem.mm: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::savePlatformDataToCachedFrame): (WebFrameLoaderClient::transitionToCommittedFromCachedFrame): * WebKit.order: 2009-01-26 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Add the ability for plug-ins to make WebKit operate in "modal mode" * Plugins/Hosted/NetscapePluginHostProxy.h: * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): (WebKit::NetscapePluginHostProxy::pluginHostDied): If the plug-in crashes while we're modal, make sure to leave the modal mode. (WebKit::NetscapePluginHostProxy::setModal): (WKPCSetModal): * Plugins/Hosted/WebKitPluginClient.defs: 2009-01-26 John Sullivan <sullivan@apple.com> fixed <rdar://problem/6530053> REGRESSION (Leopard): Shift-tab in http authentication window gets stuck in the Name field rather than cycling around Reviewed by Dan Bernstein * Panels/English.lproj/WebAuthenticationPanel.nib/designable.nib: * Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib: The two static text fields and the last button all had their "next key view" outlets set to the name field, which caused shift-tab from the name field to do the wrong thing. Fixed by making each selectable view have exactly one "next key view" set to it. 2009-01-26 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Add the ability for a plug-in to show or hide the menu bar. * Plugins/Hosted/NetscapePluginHostProxy.h: * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): (WebKit::NetscapePluginHostProxy::pluginHostDied): (WebKit::NetscapePluginHostProxy::setMenuBarVisible): (WKPCSetMenuBarVisible): * Plugins/Hosted/WebKitPluginClient.defs: 2009-01-26 Cameron Zwarich <cwzwarich@uwaterloo.ca> Reviewed by Gavin Barraclough. Bug 23552: Dashcode evaluator no longer works after making ExecStates actual call frames <https://bugs.webkit.org/show_bug.cgi?id=23552> <rdar://problem/6398839> Dashcode will crash when using the evaluator because it saves a global call frame, even after global code has finished executing, and then uses this as a launching pad to execute new JS in the evaluator. The fix is to detect when Dashcode is attempting to do this and execute code from a global call frame instead. * ForwardingHeaders/runtime/Protect.h: Added. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame _initWithGlobalObject:debugger:caller:debuggerCallFrame:]): Added debugger, a WebScriptDebugger* argument. (-[WebScriptCallFrame evaluateWebScript:]): Detect when Dashcode is using a stale WebScriptCallFrame to execute new JS and evaluate it starting from the global object's global call frame instead. * WebView/WebScriptDebugger.h: (WebScriptDebugger::globalObject): Added. (WebScriptDebugger::globalCallFrame): Added. * WebView/WebScriptDebugger.mm: (WebScriptDebugger::WebScriptDebugger): Initialize m_globalObject. (WebScriptDebugger::initGlobalCallFrame): Created as a clone of callEvent so that the global call frame can be saved immediately after being created. (WebScriptDebugger::callEvent): Pass 'this' as the debugger argument of WebScriptCallFrame's _initWithGlobalObject method. 2009-01-26 Anders Carlsson <andersca@apple.com> Reviewed by Oliver Hunt. Make WKPCInvoke a simpleroutine. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCInvoke): * Plugins/Hosted/WebKitPluginClient.defs: 2009-01-26 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Implement using plug-in objects as constructors, and setting and getting properties from a plug-in object. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCBooleanAndDataReply): * Plugins/Hosted/NetscapePluginInstanceProxy.h: (WebKit::NetscapePluginInstanceProxy::Reply::): (WebKit::NetscapePluginInstanceProxy::BooleanAndDataReply::BooleanAndDataReply): Rename NPObjectInvokeReply to BooleanAndDataReply. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::addValueToArray): Fix a cut and paste error. (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray): Handle NPObjects. * Plugins/Hosted/ProxyInstance.h: * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyField::valueFromInstance): (WebKit::ProxyField::setValueToInstance): Call the ProxyInstance method. (WebKit::ProxyInstance::~ProxyInstance): Release the NPObject. (WebKit::ProxyInstance::supportsConstruct): Ask the plug-in host if an instance supports construct. (WebKit::ProxyInstance::fieldValue): (WebKit::ProxyInstance::setFieldValue): Call the plug-in host methods. * Plugins/Hosted/WebKitPluginHostTypes.h: Rename ObjectValueType to JSObjectValueType, and add NPObjectValueType. 2009-01-26 Mark Rowe <mrowe@apple.com> Fix the build. Remove -Wformat=2 from the warning flags as newer versions of GCC emit warnings about non-literal format strings for uses of our UI_STRING macro. * Configurations/Base.xcconfig: 2009-01-26 Mark Rowe <mrowe@apple.com> Rubber-stamped by Sam Weinig. Clean up after r40240. * Configurations/Base.xcconfig: Don't dead code strip in debug builds for now as it leads to link errors. * Plugins/Hosted/HostedNetscapePluginStream.mm: Revert change that is no longer needed now that WebKitPluginHost.defs is back in the build. 2009-01-25 Darin Adler <darin@apple.com> * Plugins/Hosted/HostedNetscapePluginStream.mm: Added a missing extern "C". 2009-01-25 Darin Adler <darin@apple.com> Discussed with Mark Rowe; not sure he reviewed it. * Configurations/Base.xcconfig: Add all the same warnings as in WebCore except for -Wcast-qual and -Wunused-parameter, which both need to be off at least for now. 2009-01-25 Mark Rowe <mrowe@apple.com> Rubber-stamped by Dan Bernstein. Improve the consistency of settings in our .xcconfig files. * Configurations/Base.xcconfig: Only dead code strip the normal variant. Handle all cases in GCC_GENERATE_DEBUGGING_SYMBOLS. 2009-01-25 Darin Adler <darin@apple.com> Reviewed by Sam Weinig. Bug 23522: use checked casts for render tree https://bugs.webkit.org/show_bug.cgi?id=23522 Step one: RenderText. * WebView/WebRenderNode.mm: (copyRenderNode): Use toRenderText. 2009-01-23 Brady Eidson <beidson@apple.com> Rubberstamped by Darin Adler Rename CachedPagePlatformData to CachedFramePlatformData to more accurately reflect its true role. * WebCoreSupport/WebCachedFramePlatformData.h: Copied from WebKit/mac/WebCoreSupport/WebCachedPagePlatformData.h. (WebCachedFramePlatformData::WebCachedFramePlatformData): * WebCoreSupport/WebCachedPagePlatformData.h: Removed. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::savePlatformDataToCachedPage): (WebFrameLoaderClient::transitionToCommittedFromCachedPage): * WebKit.order: 2009-01-23 Adele Peterson <adele@apple.com> Build fix. Use new linesBoundingBox method instead of boundingBoxWidth and boundingBoxHeight for RenderText objects. * WebView/WebRenderNode.mm: (copyRenderNode): 2009-01-23 Anders Carlsson <andersca@apple.com> Fix 64-bit build. * Plugins/Hosted/ProxyInstance.mm: (WebKit::proxyClass): 2009-01-23 Anders Carlsson <andersca@apple.com> Fix GCC 4.0 build. * Configurations/Base.xcconfig: 2009-01-23 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Turn on -Wmissing-prototypes and fix the resulting warnings. * Configurations/Base.xcconfig: * History/WebHistory.mm: (timeIntervalForBeginningOfDay): * History/WebHistoryItem.mm: (historyItemWrappers): * Misc/WebNSPasteboardExtras.mm: (imageFromElement): * WebView/WebFrame.mm: * WebView/WebScriptDebugger.mm: (toNSString): 2009-01-22 Mark Rowe <mrowe@apple.com> Rubber-stamped by Anders Carlsson. Disable GCC_WARN_ABOUT_MISSING_PROTOTYPES temporarily. Current versions of Xcode only respect it for C and Objective-C files, and our code doesn't currently compile if it is applied to C++ and Objective-C++ files. * Configurations/Base.xcconfig: 2009-01-22 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Add support for Invoke and InvokeDefault. Clean up code. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCBooleanReply): * Plugins/Hosted/NetscapePluginInstanceProxy.h: (WebKit::NetscapePluginInstanceProxy::Reply::): (WebKit::NetscapePluginInstanceProxy::BooleanReply::BooleanReply): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray): * Plugins/Hosted/ProxyInstance.h: * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyInstance::invoke): (WebKit::ProxyInstance::invokeMethod): (WebKit::ProxyInstance::supportsInvokeDefaultMethod): (WebKit::ProxyInstance::invokeDefaultMethod): (WebKit::ProxyInstance::methodsNamed): (WebKit::ProxyInstance::fieldNamed): * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHost.defs: * Plugins/Hosted/WebKitPluginHostTypes.h: 2009-01-22 Eric Roman <eroman@chromium.og> Reviewed by Eric Seidel. https://bugs.webkit.org/show_bug.cgi?id=20806 Deprecate RSSFeedReferrer() and setRSSFeedReferrer(). * History/WebHistoryItem.mm: (-[WebHistoryItem RSSFeedReferrer]): (-[WebHistoryItem setRSSFeedReferrer:]): 2009-01-22 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Don't crash or hang when we fail to instantiate a plug-in. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::instantiatePlugin): Return 0 on failure. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView JSC::Bindings::createPluginBindingsInstance:JSC::Bindings::]): Null check for the proxy member. 2009-01-21 David Hyatt <hyatt@apple.com> Devirtualize width/height/x/y on RenderObject and move the methods to RenderBox. Reviewed by Eric Seidel and Darin Adler * WebView/WebRenderNode.mm: (copyRenderNode): 2009-01-21 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. More browser->plug-in scripting support. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCNPObjectHasPropertyReply): (WKPCNPObjectHasMethodReply): (WKPCNPObjectInvokeReply): MIG reply functions. (WKPCIdentifierInfo): Return information about an identifier given its 64-bit value. * Plugins/Hosted/NetscapePluginInstanceProxy.h: Add new reply structs. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::addValueToArray): Split out code that adds values to the arrays from marshalValue. (WebKit::NetscapePluginInstanceProxy::marshalValue): Call addValueToArray. (WebKit::NetscapePluginInstanceProxy::marshalValues): Marshal a list of values. (WebKit::NetscapePluginInstanceProxy::createBindingsInstance): Actually create a proxy instance. * Plugins/Hosted/ProxyInstance.h: * Plugins/Hosted/ProxyInstance.mm: (WebKit::ProxyClass::methodsNamed): (WebKit::ProxyClass::fieldNamed): Add a proxy ProxyClass class that just forwards everything to the ProxyInstance class. (WebKit::proxyClass): Shared proxyClass getter. (WebKit::ProxyField::ProxyField): (WebKit::ProxyField::valueFromInstance): (WebKit::ProxyField::setValueToInstance): Add a proxy ProxyField class that just forwards everything to the ProxyInstance class. (WebKit::ProxyMethod::ProxyMethod): (WebKit::ProxyMethod::serverIdentifier): (WebKit::ProxyMethod::numParameters): Add a dummy ProxyMethod class. (WebKit::ProxyInstance::invokeMethod): Call _WKPHNPObjectInvoke. (WebKit::ProxyInstance::defaultValue): (WebKit::ProxyInstance::stringValue): (WebKit::ProxyInstance::numberValue): (WebKit::ProxyInstance::booleanValue): (WebKit::ProxyInstance::valueOf): Add dummy implementations (taken from CInstance). (WebKit::ProxyInstance::methodsNamed): Call _WKPHNPObjectHasMethod to determine whether a method with the given name exists. (WebKit::ProxyInstance::fieldNamed): Call _WKPHNPObjectHasProperty to determine whether a property with the given name exists. * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHost.defs: Add new MIG definitions. 2009-01-21 Mark Rowe <mrowe@apple.com> Reviewed by Tim Hatcher. Clean up how we force invocations of API that happened on background threads over to the main thread. This was previously accomplished in a somewhat ad-hoc manner using a mutable dictionary to pass arguments and return values back from the function. The new approach is to use a proxy object that forwards an NSInvocation over to the main thread and applies it to the target object, which leads to a much cleaner call site. * Misc/WebNSObjectExtras.h: * Misc/WebNSObjectExtras.mm: (-[WebMainThreadInvoker initWithTarget:]): (-[WebMainThreadInvoker forwardInvocation:]): (-[WebMainThreadInvoker methodSignatureForSelector:]): (-[WebMainThreadInvoker handleException:]): (-[NSInvocation _webkit_invokeAndHandleException:]): Execute the invocation and forward any exception that was raised back to the WebMainThreadInvoker. (-[NSObject _webkit_invokeOnMainThread]): The following methods are updated to use the proxy object to forward methods to the main thread: * WebView/WebArchive.mm: (-[WebArchive initWithMainResource:subresources:subframeArchives:]): (-[WebArchive mainResource]): (-[WebArchive subresources]): (-[WebArchive subframeArchives]): * WebView/WebResource.mm: (-[WebResource data]): (-[WebResource URL]): (-[WebResource MIMEType]): (-[WebResource textEncodingName]): (-[WebResource frameName]): (-[WebResource _ignoreWhenUnarchiving]): (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]): (-[WebResource _initWithData:URL:response:]): (-[WebResource _suggestedFilename]): (-[WebResource _response]): (-[WebResource _stringValue]): * WebView/WebView.mm: (-[WebView initWithFrame:frameName:groupName:]): (-[WebView initWithCoder:]): 2009-01-20 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com> Reviewed by George Staikos. Fixes: https://bugs.webkit.org/show_bug.cgi?id=23434 (Add WML <input> element support) Protect text field related WebEditorClient.mm methods against non-HTMLElement callers. WebEditorClient.mm relies on HTMLInputElement as input element. Ignore calls from non-HTMLElement elements. * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::textFieldDidBeginEditing): (WebEditorClient::textFieldDidEndEditing): (WebEditorClient::textDidChangeInTextField): (WebEditorClient::doTextFieldCommandFromEvent): (WebEditorClient::textWillBeDeletedInTextField): (WebEditorClient::textDidChangeInTextArea): 2009-01-19 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Add and implement GetScriptableNPObject. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCGetScriptableNPObjectReply): Create a new reply struct and set it as the current reply. (WKPCEvaluate): Get rid of an unused variable. * Plugins/Hosted/NetscapePluginInstanceProxy.h: (WebKit::NetscapePluginInstanceProxy::Reply::): (WebKit::NetscapePluginInstanceProxy::GetScriptableNPObjectReply::GetScriptableNPObjectReply): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::createBindingsInstance): Call _WKPHGetScriptableNPObject and wait for a reply. * Plugins/Hosted/ProxyInstance.h: Added. * Plugins/Hosted/ProxyInstance.mm: Added. Add empty files. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView JSC::Bindings::createPluginBindingsInstance:JSC::Bindings::]): Call NetscapePluginInstanceProxy::createBindingsInstance. * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHost.defs: Add new declarations. 2009-01-19 Sam Weinig <sam@webkit.org> Rubber-stamped by Gavin Barraclough. Remove temporary operator-> from JSValuePtr. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::invoke): (WebKit::NetscapePluginInstanceProxy::hasMethod): (WebKit::NetscapePluginInstanceProxy::marshalValue): * WebView/WebFrame.mm: (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): * WebView/WebView.mm: (aeDescFromJSValue): 2009-01-19 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Make Evaluate an asynchronous method that has a reply method. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCEvaluate): * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHost.defs: 2009-01-19 Brady Eidson <beidson@apple.com> Rubberstamped by Tim Hatcher Fix long standing typo. * History/WebBackForwardList.h: 2009-01-19 Mark Rowe <mrowe@apple.com> Fix the build! * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::demarshalValue): (WebKit::NetscapePluginInstanceProxy::demarshalValues): 2009-01-18 Mark Rowe <mrowe@apple.com> Reviewed by Anders Carlsson. Fix <https://bugs.webkit.org/show_bug.cgi?id=23414>. Bug 23414: Reproducible crash accessing View menu with plugins disabled * WebView/WebFrame.mm: (-[WebFrame _canProvideDocumentSource]): Null-check the PluginData before using it. 2009-01-17 David Hyatt <hyatt@apple.com> Eliminate dependencies on "backslashAsCurrencySymbol()" from WebKit, and make sure these alterations are done in WebCore instead. Reviewed by Oliver Hunt * WebView/WebFrame.mm: (-[WebFrame _selectedString]): (-[WebFrame _stringForRange:]): 2009-01-17 Eric Carlson <eric.carlson@apple.com> Reviewed by Adele Peterson Complete <rdar://problem/6293969> * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Remove UseSharedMediaUI 2009-01-15 Brady Eidson <beidson@apple.com> Reviewed by Dan Bernstein Fix problem where a URL visited as non-GET once is flagged as non-GET forever. * History/WebHistory.mm: (-[WebHistory _visitedURL:withTitle:method:wasFailure:]): Always update the HTTPNonGet flag for all loads with an HTTP Method 2009-01-14 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Implement InvokeDefault, Construct, GetProperty and SetProperty. Fully implement marshalValue. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCInvokeDefault): (WKPCConstruct): (WKPCGetProperty): (WKPCSetProperty): * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::evaluate): (WebKit::NetscapePluginInstanceProxy::invoke): (WebKit::NetscapePluginInstanceProxy::invokeDefault): (WebKit::NetscapePluginInstanceProxy::construct): (WebKit::NetscapePluginInstanceProxy::getProperty): (WebKit::NetscapePluginInstanceProxy::setProperty): (WebKit::NetscapePluginInstanceProxy::marshalValue): (WebKit::NetscapePluginInstanceProxy::demarshalValue): * Plugins/Hosted/WebKitPluginClient.defs: 2009-01-14 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Demarshal arguments and pass them to the JS call. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCInvoke): * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::invoke): (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray): (WebKit::NetscapePluginInstanceProxy::demarshalValues): 2009-01-14 Mark Rowe <mrowe@apple.com> Reviewed by Timothy Hatcher. <rdar://problem/6496520> REGRESSION: In Mail, a crash occurs when attempting to display a mail message Move WebArchive and WebResource to use the same approach for initializing themselves on the main thread that WebView uses. * WebView/WebArchive.mm: (-[WebArchive initWithMainResource:subresources:subframeArchives:]): Use _webkit_performSelectorOnMainThread:withObject:. (-[WebArchive _initWithArguments:]): * WebView/WebResource.mm: (-[WebResource _initWithArguments:]): Unbox the BOOL argument. 2009-01-14 Darin Adler <darin@apple.com> Reviewed by Oliver Hunt. Fix crash I ran into while printing. I was unable to reproduce it, but also, it's clear there's no guarantee that the frame will be non-zero in this case, so it seems fine to check it. * WebView/WebHTMLView.mm: (-[WebHTMLView reapplyStyles]): Check frame for zero and don't do anything with it if it's zero. 2009-01-14 Dan Bernstein <mitz@apple.com> Reviewed by John Sullivan. - update copyright * Info.plist: 2009-01-12 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Add a bunch of methods to WebKitPluginClient.defs, and implement them. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::fromUTF8WithLatin1Fallback): If the length isn't specified, get it by calling strlen. (WKPCEvaluate): Evaluate doesn't take any arguments. (WKPCGetIntIdentifier): Call _NPN_GetIntIdentifier. (identifierFromServerIdentifier): New helper function that returns a JSC Identifier from an NPIdentifier. (WKPCInvoke): Call identifierFromServerIdentifier. (WKPCRemoveProperty): (WKPCHasProperty): (WKPCHasMethod): Call NetscapePluginInstanceProxy. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::removeProperty): (WebKit::NetscapePluginInstanceProxy::hasProperty): (WebKit::NetscapePluginInstanceProxy::hasMethod): * Plugins/Hosted/WebKitPluginClient.defs: Add new definitions. 2009-01-13 Anders Carlsson <andersca@apple.com> Fix build. * WebView/WebView.mm: (-[WebView _initWithArguments:]): 2009-01-13 Timothy Hatcher <timothy@apple.com> Adds a workaround for the flip4mac installer plugin decoding a WebView from a NIB on a secondary thread. <rdar://problem/6489788> New WebKit thread checks break installation of flip4mac (thread violation) Reviewed by Darin Adler. * Misc/WebKitVersionChecks.h: Add WEBKIT_FIRST_VERSION_WITHOUT_WEBVIEW_INIT_THREAD_WORKAROUND. * Misc/WebNSObjectExtras.h: Add _webkit_performSelectorOnMainThread:withObject:. * Misc/WebNSObjectExtras.mm: (-[NSObject _webkit_performSelectorWithArguments:]): Renamed from _webkit_getPropertyWithArguments. Passes the optional object to the selector. (-[NSObject _webkit_performSelectorOnMainThread:withObject:]): Renamed from _webkit_getPropertyOnMainThread:. Put the optional object into the arguments dictionary. (-[NSObject _webkit_getPropertyOnMainThread:]): Call _webkit_performSelectorOnMainThread with a nil object. * WebView/WebResource.mm: (-[WebResource _ignoreWhenUnarchiving]): Use _cmd instead of making the selector again. (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]): Use the new _webkit_performSelectorOnMainThread:withObject: method instead of performSelectorOnMainThread. * WebView/WebView.mm: (-[WebView _initWithArguments:]): Added. Pulls arguments out of the dictionary and calls the right init method. (needsWebViewInitThreadWorkaround): Checks if the thead is not the main thread and if we are in the Installer bundle. (-[WebView initWithFrame:frameName:groupName:]): Call needsWebViewInitThreadWorkaround and use _webkit_performSelectorOnMainThread to call _initWithArguments: passing the frame, frameName and groupName. (-[WebView initWithCoder:]): Ditto, except pass the coder to _initWithArguments:. 2009-01-12 Gavin Barraclough <barraclough@apple.com> Reviewed by Oliver Hunt. Deprecate JSValuePtr::getNumber() - two ways to get a number should be enough. * WebView/WebView.mm: (aeDescFromJSValue): 2009-01-12 Brady Eidson <beidson@apple.com> Reviewed by Darin Adler <rdar://problem/6468274> - Track Non-get requests in global history * History/WebHistory.mm: (-[WebHistory _visitedURL:withTitle:method:wasFailure:]): * History/WebHistoryInternal.h: * History/WebHistoryItem.mm: (-[WebHistoryItem initFromDictionaryRepresentation:]): (-[WebHistoryItem dictionaryRepresentation]): (-[WebHistoryItem _lastVisitWasHTTPNonGet]): * History/WebHistoryItemPrivate.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::updateGlobalHistory): Only pass the method through if it was an HTTP load 2009-01-12 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Move marshalling into NetscapePluginInstanceProxy. Add support for marshallin strings. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCEvaluate): (WKPCInvoke): * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::evaluate): (WebKit::NetscapePluginInstanceProxy::invoke): (WebKit::NetscapePluginInstanceProxy::marshalValue): * Plugins/Hosted/WebKitPluginHostTypes.h: 2009-01-12 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Implement WKPCInvoke. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCEvaluate): (WKPCInvoke): * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::idForObject): (WebKit::NetscapePluginInstanceProxy::invoke): * Plugins/Hosted/WebKitPluginClient.defs: 2009-01-12 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Move marshalling code to NetscapePluginInstanceProxy. Add support for marshalling JS objects. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCEvaluate): * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::marshalValue): * Plugins/Hosted/WebKitPluginHostTypes.h: 2009-01-12 Julien Chaffraix <jchaffraix@pleyo.com> Reviewed by Darin Adler. Bug 22861: Turn the FontCache into a singleton https://bugs.webkit.org/show_bug.cgi?id=22861 * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics cachedFontDataCount]): (+[WebCoreStatistics cachedFontDataInactiveCount]): (+[WebCoreStatistics purgeInactiveFontData]): Redirected all the static calls to the global FontCache instance. 2009-01-11 Dmitry Titov <dimich@chromium.org> Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=23207 Moved currentTime() to from WebCore to WTF. * WebView/WebFrame.mm: a different header file included. 2009-01-10 Darin Adler <darin@apple.com> Reviewed by Sam Weinig. <rdar://problem/5845089> REGRESSION (r30044): Mail custom stationery missing images because of change to -[HTMLObjectElement data] * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): Added a thread violation check because I saw this being done off the main thread while testing Mail, and it caused problems. Put all the one time initialization under a single guard to make things just a little faster other times, and to make it clearer which things are one-time. Added a call to the new patchMailRemoveAttributesMethod function. (-[WebView initWithFrame:frameName:groupName:]): Added a thread violation check here too, because I assumed it would be slightly better to have a public method name in the violation message. This calls commonInitialization later, so it will hit that one eventually. (objectElementDataAttribute): Added. Just returns the value of the "data" attribute. (recursivelyRemoveMailAttributes): Added. Patch to an internal Mail method that in turn patches a WebKit method and removes the patch again on the way out. (patchMailRemoveAttributesMethod): Added. On Leopard only, checks the Mail version, and then applies the patch that fixes this bug. 2009-01-09 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - fixed <rdar://problem/6234347> Add/change conditional key bindings for changing paragraph- and character-level writing direction (to match NSTextView) * WebView/WebHTMLView.mm: (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): Added code to validate makeBaseWritingDirectionLeftToRight: and makeBaseWritingDirectionRightToLeft:. (writingDirectionKeyBindingsEnabled): Changed this function to always return YES, except on Tiger and Leopard. (-[WebHTMLView makeBaseWritingDirectionLeftToRight:]): Renamed changeBaseWritingDirectionToLTR: to this. (-[WebHTMLView makeBaseWritingDirectionRightToLeft:]): Renamed changeBaseWritingDirectionToRTL: to this. (-[WebHTMLView changeBaseWritingDirectionToLTR:]): Now calls makeBaseWritingDirectionLeftToRight:. (-[WebHTMLView changeBaseWritingDirectionToRTL:]): Now calls makeBaseWritingDirectionRightToLeft:. * WebView/WebView.mm: Added makeBaseWritingDirectionLeftToRight and makeBaseWritingDirectionRightToLeft to FOR_EACH_RESPONDER_SELECTOR. 2009-01-08 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Add and implement WKPCGetStringIdentifier. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCGetStringIdentifier): * Plugins/Hosted/WebKitPluginClient.defs: 2009-01-08 Stephanie Lewis <slewis@gmail.com> Fix Tiger build. * WebView/WebTextIterator.mm: 2009-01-08 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Add basic support for evaluating scripts. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::fromUTF8WithLatin1Fallback): (WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy): (WKPCReleaseObject): (marshalValue): (WKPCEvaluate): * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::releaseObject): (WebKit::NetscapePluginInstanceProxy::evaluate): * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHostTypes.h: 2009-01-08 David Hyatt <hyatt@apple.com> Fix for <rdar://problem/6465682> REGRESSION: In Mail, can't force a message to auto scroll Add a new ChromeClient method for handling exposure of scrolled rects. Reviewed by Oliver Hunt * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::scrollRectIntoView): 2009-01-08 Darin Adler <darin@apple.com> Reviewed by Tim Hatcher. Bug 23185: add a currentRange method to the WebTextIterator SPI https://bugs.webkit.org/show_bug.cgi?id=23185 rdar://problem/6455834 I also noticed a garbage-collection-related threading issue that I fixed, and that the SPI for getting text was unnecessarily inefficient, so I fixed that too. * WebView/WebTextIterator.h: Moved currentNode and currentText into a "deprecated" category. Added currentTextPointer and currentTextLength. * WebView/WebTextIterator.mm: Changed m_textIterator into an OwnPtr, and also used _textIterator to be consistent with ObjC rather than C++ naming. (+[WebTextIteratorPrivate initialize]): Added. Calls WebCoreObjCFinalizeOnMainThread, since the finalize method here works with main-thread only WebCore objects. (-[WebTextIterator initWithRange:]): Changed since _textIterator is an OwnPtr now. (-[WebTextIterator advance]): Changed name of m_textIterator. Removed null assertion, since I don't think it provides much value. (-[WebTextIterator atEnd]): Ditto. (-[WebTextIterator currentRange]): Added. (-[WebTextIterator currentTextPointer]): Added. (-[WebTextIterator currentTextLength]): Added. (-[WebTextIterator currentNode]): Did same as above, but also put into new category. (-[WebTextIterator currentText]): Ditto. 2009-01-08 Eric Carlson <eric.carlson@apple.com> Reviewed by Adele Peterson. Simplify Mac interfaces for drawing media controller elements <rdar://problem/6293969> * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Update for changes to media controller functions 2009-01-07 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Fix build. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::idForObject): 2009-01-07 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Add a way for a plug-in to get a reference to the Window JS object. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCGetWindowNPObject): Call the appropriate instance. * Plugins/Hosted/NetscapePluginInstanceProxy.h: Add object ID counter. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::destroy): Clear the object ID map. (WebKit::NetscapePluginInstanceProxy::idForObject): New method that returns a unique ID for a given JS object. (WebKit::NetscapePluginInstanceProxy::getWindowNPObject): Return the object ID for the window JS object. * Plugins/Hosted/WebKitPluginClient.defs: Add GetWindowNPObject. 2009-01-07 Darin Adler <darin@apple.com> Reviewed by Oliver Hunt. Bug 23160: add setMemoryCacheClientCallsEnabled SPI so Safari can be faster with activity window closed https://bugs.webkit.org/show_bug.cgi?id=23160 * WebView/WebView.mm: (-[WebView setMemoryCacheDelegateCallsEnabled:]): Added. (-[WebView areMemoryCacheDelegateCallsEnabled]): Added * WebView/WebViewPrivate.h: Ditto. 2009-01-05 Gavin Barraclough <baraclough@apple.com> Rubber Stamped by Oliver Hunt. Replace all uses of JSValue* with new wrapper class, JSValuePtr. See JavaScriptCore/ChangeLog for more detailed description. * WebView/WebFrame.mm: (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame _convertValueToObjcValue:]): (-[WebScriptCallFrame exception]): (-[WebScriptCallFrame evaluateWebScript:]): * WebView/WebView.mm: (aeDescFromJSValue): (-[WebView aeDescByEvaluatingJavaScriptFromString:]): 2009-01-06 Pierre-Olivier Latour <pol@apple.com> Reviewed by Darin Adler. Exposed through WebFrame private interface the new WebCore API AnimationController::numberOfActiveAnimations() to be used by DRT. https://bugs.webkit.org/show_bug.cgi?id=23126 * WebView/WebFrame.mm: (-[WebFrame _numberOfActiveAnimations]): * WebView/WebFramePrivate.h: 2009-01-05 David Kilzer <ddkilzer@apple.com> Add SPI to enable, disable and check state of WebIconDatabase Reviewed by Darin Adler & Timothy Hatcher. Add -[WebIconDatabase isEnabled] and -[WebIconDatabase setEnabled:] SPI to make it possible to enable, disable and check the state of the icon database. * Misc/WebIconDatabase.mm: (-[WebIconDatabase init]): Extracted code into -_startUpIconDatabase. (-[WebIconDatabase iconForURL:withSize:cache:]): Switched to use -isEnabled instead of -_isEnabled. (-[WebIconDatabase iconURLForURL:]): Ditto. (-[WebIconDatabase retainIconForURL:]): Ditto. (-[WebIconDatabase releaseIconForURL:]): Ditto. (-[WebIconDatabase isEnabled]): Renamed from -_isEnabled in WebInternal category. (-[WebIconDatabase setEnabled:]): Added. Takes care of changing the enabled/disabled state of the icon database. (-[WebIconDatabase removeAllIcons]): Switched to use -isEnabled instead of -_isEnabled. (-[WebIconDatabase _startUpIconDatabase]): Added. Extrated from -init. (-[WebIconDatabase _shutDownIconDatabase]): Added. Remove observers when the icon database is disabled. * Misc/WebIconDatabaseInternal.h: Added declarations for -_startUpIconDatabase and -_shutDownIconDatabase. * Misc/WebIconDatabasePrivate.h: Added declarations for -isEnabled and -setEnabled:. 2009-01-05 Brady Eidson <beidson@apple.com> Reviewed by Jon Honeycutt Expose setting the last-visit-was-failure flag on a history items in preparation for <rdar://problem/6173319> * History/WebHistoryItem.mm: (-[WebHistoryItem _setLastVisitWasFailure:]): * History/WebHistoryItemPrivate.h: 2009-01-05 Adam Treat <adam.treat@torchmobile.com> Another blind mac build fix * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::contentsSizeChanged): 2009-01-05 Adam Treat <adam.treat@torchmobile.com> Blind mac build fix * WebCoreSupport/WebChromeClient.mm: 2009-01-05 Adam Treat <adam.treat@torchmobile.com> Fix mac build * WebCoreSupport/WebChromeClient.h: 2009-01-05 Adam Treat <adam.treat@torchmobile.com> Reviewed by George Staikos. Build fix for contentsSizeChanged * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::contentsSizeChanged): 2009-01-02 Darin Adler <darin@apple.com> Reviewed by Sam Weinig. Bug 23072: REGRESSION (r37371): In the Dictionary application, scroll bar appears inside its web view when resizing its window https://bugs.webkit.org/show_bug.cgi?id=23072 rdar://problem/6368028 The first attempt at fixing this did not work. This time I was able to reproduce the bug and test the fix. * WebCoreSupport/WebFrameLoaderClient.mm: (applyAppleDictionaryApplicationQuirkNonInlinePart): Changed the arguments and function names around a bit to make even less code at the call site. (applyAppleDictionaryApplicationQuirk): Put the check for whether this is the Dictionary application in here. (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache): Put a call to applyAppleDictionaryApplicationQuirk here. This was a case I had missed before, when the script is cached. This fixes one of the two problems with the initial patch; the other fix is in WebCore. (WebFrameLoaderClient::dispatchWillSendRequest): Changed the applyAppleDictionaryApplicationQuirk call here to work the new simpler way. * WebView/WebView.mm: Had to add an include due to changes in WebCore header includes. 2009-01-02 Cameron Zwarich <cwzwarich@uwaterloo.ca> Reviewed by Darin Adler. Bug 23060: REGRESSION (r38629): Cannot scroll a WebHTMLView using Home/End/Page up/Page down <https://bugs.webkit.org/show_bug.cgi?id=23060> <rdar://problem/6467830> After r38629, all keyboard events get sent by Editor to the EditorClient, even if the selection is not editable. If the event's command is unsupported by WebHTMLView, WebHTMLView mistakenly thinks that the event was handled when it was not. When using the page up / page down keys, the events generated are of the form scrollPageUp rather than movePageUp, so they are unsupported by WebHTMLView and cause this bug to occur. * WebView/WebHTMLView.mm: (-[WebHTMLView doCommandBySelector:]): 2009-01-02 Darin Adler <darin@apple.com> Reviewed by Oliver Hunt. Bug 23072: REGRESSION (r37371): In the Dictionary application, scroll bar appears inside its web view when resizing its window https://bugs.webkit.org/show_bug.cgi?id=23072 rdar://problem/6368028 * WebCoreSupport/WebFrameLoaderClient.mm: (isAppleDictionaryApplication): Added. (applyAppleDictionaryApplicationQuirk): Added. Under the right conditions, sets a flag to ask HTMLFrameElementBase to ignore the scrolling attribute. (WebFrameLoaderClient::dispatchWillSendRequest): Call the two functions above to apply the quirk when the relevant script is loaded. 2008-12-26 Dan Bernstein <mitz@apple.com> Reviewed by Sam Weinig. - fix <rdar://problem/6467608> lastVisitWasFailure flag persists in global history after a successful visit * History/WebHistory.mm: (-[WebHistory _visitedURL:withTitle:wasFailure:]): Changed to always update the wasFailure flag on the HistoryItem. 2008-12-23 Darin Adler <darin@apple.com> Reviewed by Alexey Proskuryakov (a slightly earlier version). - fix https://bugs.webkit.org/show_bug.cgi?id=22976 crash due to Mail's use of WebArchive and WebResource on non-main thread * Misc/WebKitLogging.h: Improved comments for ASSERT_MAIN_THREAD. Got rid of WebKitRunningOnMainThread function, which was just a cover for pthread_main_np. * Misc/WebKitLogging.m: Ditto. * Misc/WebKitVersionChecks.h: Added a version after which we won't do the main thread workaround. * Misc/WebNSObjectExtras.h: Added a new method, _webkit_getPropertyOnMainThread:, which performs a selector on the main thread, waits for it to complete, and then returns the value on the caller thread. * Misc/WebNSObjectExtras.mm: Added. * WebView/WebArchive.mm: (-[WebArchive init]): Added WebCoreThreadViolationCheck. (-[WebArchive initWithMainResource:subresources:subframeArchives:]): Perform initialization on main thread if needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck. (-[WebArchive initWithData:]): Added WebCoreThreadViolationCheck. (-[WebArchive mainResource]): Get property on main thread if needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck. (-[WebArchive subresources]): Ditto. (-[WebArchive subframeArchives]): Ditto. (-[WebArchive data]): Ditto. (-[WebArchive _initWithCoreLegacyWebArchive:]): Added WebCoreThreadViolationCheck. (-[WebArchive _coreLegacyWebArchive]): Ditto. (-[WebArchive _initWithArguments:]): Added. Used to implement the cross-thread version of initWithMainResource above. * WebView/WebResource.mm: (-[WebResource initWithCoder:]): Added WebCoreThreadViolationCheck. (-[WebResource data]): Get property on main thread if needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck. (-[WebResource URL]): Ditto. (-[WebResource MIMEType]): Ditto. (-[WebResource textEncodingName]): Ditto. (-[WebResource frameName]): Ditto. (-[WebResource _ignoreWhenUnarchiving]): Ditto. (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]): Perform initialization on main thread if needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck. (-[WebResource _suggestedFilename]): Added. Helper for _fileWrapperRepresentation. (-[WebResource _fileWrapperRepresentation]): Rewrote to use methods instead of getting at coreResource directly. (-[WebResource _response]): Get property on main thread if needMailThreadWorkaround is true. Also added WebCoreThreadViolationCheck. (-[WebResource _stringValue]): Ditto. (+[WebResource _needMailThreadWorkaroundIfCalledOffMainThread]): Added. (-[WebResource _initWithArguments:]): Added. Used to implement the cross-thread version of _initWithData above. * WebView/WebResourceInternal.h: Changed to include WebResourcePrivate.h since internal clients have access to the SPI as well as the API. Added definition of MAIL_THREAD_WORKAROUND and the needMainThreadWorkaround helper function. * Misc/WebIconDatabase.mm: Removed include of now-defunct FoundationExtras.h file. This probably fixes clean builds. * WebCoreSupport/WebIconDatabaseClient.mm: Ditto. * WebCoreSupport/WebFrameLoaderClient.mm: Removed include of WebResourcePrivate.h, since it's not actually used. * WebView/WebDataSource.mm: Ditto. * WebView/WebHTMLRepresentation.mm: Ditto. 2008-12-23 Darin Adler <darin@apple.com> Reviewed by Dan Bernstein. - fix https://bugs.webkit.org/show_bug.cgi?id=22979 crash seen in -[WebView drawsBackground] when quitting <rdar://problem/6464601> * WebView/WebView.mm: (-[WebView drawsBackground]): Added comment and a null check for _private. 2008-12-22 Kevin Decker <kdecker@apple.com> Reviewed by Anders Carlsson. <rdar://problem/6449588> REGRESSION (r38279-r38280): Minimize them remaximize a window with a flash plugin, plugin doesn't resume at full speed * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView windowDidDeminiaturize:]): Deminiaturizing should restart timers, not stop timers. 2008-12-19 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler, Adele Peterson, Brady Eidson. Added SPI for getting an unsorted vector of all items in history. * History/WebHistory.h: * History/WebHistory.mm: (-[WebHistory allItems]): 2008-12-18 Dan Bernstein <mitz@apple.com> Reviewed by Sam Weinig. - implement FrameLoaderClient::shouldUseCredentialStorage() by calling a new resource load delegae method. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::shouldUseCredentialStorage): Added. Calls the delegate method. If the method is unimplemented, returns true for backwards compatibility. * WebView/WebView.mm: (-[WebView _cacheResourceLoadDelegateImplementations]): Initialize the shouldUseCredentialStorageFunc member. (CallResourceLoadDelegateReturningBoolean): Added. * WebView/WebViewInternal.h: * WebView/WebResourceLoadDelegatePrivate.h: Declared the delegate method -webView:resource:shouldUseCredentialStorageForDataSource:. 2008-12-18 Cameron Zwarich <zwarich@apple.com> Reviewed by Jonathan Honeycutt. Fix an apparent typo in r39385 that is causing lots of crashes. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout): 2008-12-18 Brady Eidson <beidson@apple.com> Reviewed by John Sullivan Initial visit to a website creates history items that start with a visit count of zero instead of one * History/WebHistory.mm: (-[WebHistoryPrivate visitedURL:withTitle:]): Set the visit count on new items * History/WebHistoryItem.mm: (-[WebHistoryItem _setVisitCount:]): Call through to the WebCore item * History/WebHistoryItemInternal.h: 2008-12-18 Sam Weinig <sam@webkit.org> Reviewed by John Sullivan. Implement FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout() by calling a new private frame load delegate method. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout): * WebView/WebView.mm: (-[WebView _cacheFrameLoadDelegateImplementations]): * WebView/WebViewInternal.h: * WebView/WebViewPrivate.h: 2008-12-16 Antti Koivisto <antti@apple.com> Reviewed by John Sullivan. Add version check for shift-reload behavior. * Misc/WebKitVersionChecks.h: * WebView/WebFrame.mm: (-[WebFrame reload]): 2008-12-16 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Start sending keyboard events to the plug-in host. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::keyEvent): * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView keyDown:]): (-[WebHostedNetscapePluginView keyUp:]): * Plugins/Hosted/WebKitPluginHost.defs: 2008-12-16 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. <rdar://problem/6450538> Fix flag enumeration. * Plugins/Hosted/WebKitPluginHostTypes.h: 2008-12-16 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Instead of passing a gazillion booleans to WKPCLoadURL, pass a single set of flags. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCLoadURL): * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::loadURL): * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHostTypes.h: 2008-12-16 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Add trailing null to headers to avoid a crash in the plug-in host. * Plugins/Hosted/HostedNetscapePluginStream.mm: (WebKit::HostedNetscapePluginStream::didReceiveResponse): 2008-12-15 Mark Rowe <mrowe@apple.com> Rubber-stamped by Cameron Zwarich. <rdar://problem/6289933> Change WebKit-related projects to build with GCC 4.2 on Leopard. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: 2008-12-15 Stephanie Lewis <slewis@apple.com> Fix build. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: 2008-12-15 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Change InstantiatePlugin to be asynchronous so we won't deadlock if the plug-in tries to call back into us while it's being instantiated. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::instantiatePlugin): * Plugins/Hosted/NetscapePluginHostProxy.h: (WebKit::NetscapePluginHostProxy::clientPort): * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCInstantiatePluginReply): * Plugins/Hosted/NetscapePluginInstanceProxy.h: (WebKit::NetscapePluginInstanceProxy::Reply::): (WebKit::NetscapePluginInstanceProxy::Reply::Reply): (WebKit::NetscapePluginInstanceProxy::Reply::~Reply): (WebKit::NetscapePluginInstanceProxy::InstantiatePluginReply::InstantiatePluginReply): (WebKit::NetscapePluginInstanceProxy::setCurrentReply): (WebKit::NetscapePluginInstanceProxy::waitForReply): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): (WebKit::NetscapePluginInstanceProxy::processRequestsAndWaitForReply): * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHost.defs: 2008-12-15 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Let WebKit generate a plug-in ID instead of having the plug-in host do it. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::instantiatePlugin): Create the plug-in proxy before instantiating the plug-in. * Plugins/Hosted/NetscapePluginInstanceProxy.h: (WebKit::NetscapePluginInstanceProxy::create): (WebKit::NetscapePluginInstanceProxy::setRenderContextID): (WebKit::NetscapePluginInstanceProxy::setUseSoftwareRenderer): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): * Plugins/Hosted/WebKitPluginHost.defs: 2008-12-15 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. LoadURL doesn't need to be asynchronous. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCLoadURL): * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHost.defs: 2008-12-15 Antti Koivisto <antti@apple.com> Reviewed by Darin Adler. - Add [WebFrame reloadFromOrigin] for performing end-to-end reload. - Add corresponding IBAction to WebView. - Temporarily make [WebFrame reload] trigger end-to-end reload if shift modifier is pressed when it is called. * WebView/WebFrame.h: * WebView/WebFrame.mm: (-[WebFrame reload]): (-[WebFrame reloadFromOrigin]): * WebView/WebFramePrivate.h: Match the FrameLoadType enum in WebCore. * WebView/WebView.h: * WebView/WebView.mm: (-[WebView reloadFromOrigin:]): 2008-12-14 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - fix <rdar://problem/3258561> WebHistoryAllItemsRemovedNotification should add items to userInfo * History/WebHistory.mm: (-[WebHistoryPrivate allItems]): Added this helper method, which returns all values in the _entriesByURL dictionary. (-[WebHistory removeAllItems]): Changed to send the array of all items in the notification. 2008-12-13 Darin Adler <darin@apple.com> - <rdar://problem/6441035> WebTextIterator class not exported in WebKit * WebKit.exp: Added the class. We forgot to export it when we added the WebTextIterator SPI. 2008-12-12 Darin Adler <darin@apple.com> Rubber stamped by Adam Roben. - fix <rdar://problem/5648301> Can't tab around to text fields in Safari login sheet after clicking static text, due to AppKit key loop change * Panels/English.lproj/WebAuthenticationPanel.nib/classes.nib: Removed. * Panels/English.lproj/WebAuthenticationPanel.nib/designable.nib: Added. * Panels/English.lproj/WebAuthenticationPanel.nib/info.nib: Removed. * Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib: Set nextKeyView of the selectable static texts to the editable text. Updated nib format. 2008-12-12 Stephanie Lewis <slewis@apple.com> Reviewed by Geoff Garen. Shrink Cache Sizes. * WebView/WebView.mm: (+[WebView _setCacheModel:]): 2008-12-12 Anders Carlsson <andersca@apple.com> Reviewed by Tim Hatcher. Don't try to free the dummy "1" port state. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView sendEvent:isDrawRect:]): (-[WebNetscapePluginView updateAndSetWindow]): 2008-12-11 Cameron Zwarich <zwarich@apple.com> Rubber-stamped by Mark Rowe. Roll out r39212 due to assertion failures during layout tests, multiple layout test failures, memory leaks, and obvious incorrectness. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (-[WebPreferences fullDocumentTeardownEnabled]): * WebView/WebPreferencesPrivate.h: 2008-12-11 Stephanie Lewis <slewis@apple.com> Fix build. * WebView/WebView.mm: 2008-12-11 Stephanie Lewis <slewis@apple.com> Reviewed by Oliver Hunt. Empty Web cache before quitting a debug build in order to report accurate CachedResource leaks. * WebView/WebView.mm: (-[WebView _close]): 2008-12-11 Anders Carlsson <andersca@apple.com> Fix Tiger build. * Misc/WebNSDataExtras.h: 2008-12-11 Anders Carlsson <andersca@apple.com> Reviewed by Cameron Zwarich. https://bugs.webkit.org/show_bug.cgi?id=22797 REGRESSION: Crash at http://news.cnet.com/8301-17939_109-10119149-2.html Make sure to protect the stream because destroyStream can otherwise cause it to be deleted. * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::destroyStreamWithReason): 2008-12-10 Glenn Wilson <gwilson@google.com> Reviewed by Adam Roben. Added new methods for overriding default WebPreference values and for resetting preferences to their defaults. https://bugs.webkit.org/show_bug.cgi?id=20534 * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (-[WebPreferences resetToDefaults]): new method (-[WebPreferences overridePreference:flag:]): new method * WebView/WebPreferencesPrivate.h: new method signatures 2008-12-10 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Implement support for NPN_PostURL/NPN_PostURLNotify in WebKit. * Plugins/Hosted/NetscapePluginInstanceProxy.h: Add stopAllStreams. * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::stopAllStreams): Factored out this from ::destroy. (WebKit::NetscapePluginInstanceProxy::destroy): Call stopAllStreams(). (WebKit::NetscapePluginInstanceProxy::pluginHostDied): Ditto. (WebKit::NetscapePluginInstanceProxy::loadURL): Handle post being true. This code has been copied from WebNetscapePluginView.mm (for now). 2008-12-10 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Move two NSData category methods to WebNSDataExtras.m. * Misc/WebNSDataExtras.h: * Misc/WebNSDataExtras.m: (-[NSData _web_startsWithBlankLine]): (-[NSData _web_locationAfterFirstBlankLine]): * Plugins/WebNetscapePluginView.mm: 2008-12-10 Alice Liu <alice.liu@apple.com> fixed https://bugs.webkit.org/show_bug.cgi?id=20685 Reviewed by Darin Adler. * Misc/WebNSPasteboardExtras.mm: Ask image for its file extension instead of falling back on MIME type and file path. Also moved this code to before setting the pasteboard data so as not to set any if no extension can be determined. (-[NSPasteboard _web_declareAndWriteDragImageForElement:URL:title:archive:source:]): * WebView/WebHTMLView.mm: Fixed a separate but related long-standing bug of how the filename for the promised drag data is determined by asking the image for a proper file extension. (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): 2008-12-09 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Fix typecast. * WebView/WebHTMLView.mm: (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]): 2008-12-09 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Implement software rendering of hosted plug-ins. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCInvalidateRect): New MiG function. This is called by the plug-in host when it has drawn something. * Plugins/Hosted/WebHostedNetscapePluginView.h: * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView createPlugin]): Create a software renderer. (-[WebHostedNetscapePluginView destroyPlugin]): Destroy the software renderer. (-[WebHostedNetscapePluginView drawRect:]): Draw using the software renderer. * Plugins/Hosted/WebKitPluginClient.defs: Add InvalidateRect. 2008-12-09 Brett Wilson <brettw@chromium.org> Reviewed by Dave Hyatt. https://bugs.webkit.org/show_bug.cgi?id=22177 Add a callback on ChromeClient that the state of form elements on the page has changed. This is to allow clients implementing session saving to know when the current state is dirty. * WebCoreSupport/WebChromeClient.h: (WebChromeClient::formStateDidChange): 2008-12-09 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Make sure to pause null events for hosted plug-ins as well. * WebView/WebHTMLView.mm: (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]): 2008-12-09 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. * Plugins/Hosted/NetscapePluginHostProxy.h: * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): (WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy): Unfortunately we can't use a libdispatch source right now, because of <rdar://problem/6393180>. 2008-12-09 Timothy Hatcher <timothy@apple.com> Implement a few methods needed to keep Dictionary.app working on Leopard. <rdar://problem/6002160> Internal changes to WebKit in Safari 4 Developer Preview might break Dictionary Reviewed by Dan Bernstein. * WebView/WebFrame.mm: (-[WebFrame convertNSRangeToDOMRange:]): Added. Calls _convertNSRangeToDOMRange. (-[WebFrame convertDOMRangeToNSRange:]): Added. Calls _convertDOMRangeToNSRange. * WebView/WebHTMLView.mm: (-[WebHTMLView _bridge]): Added. Returns the WebFrame, which has the methods that Dictionary.app is using. 2008-12-08 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. More work towards getting NPN_GetURL working. * Plugins/Hosted/HostedNetscapePluginStream.h: Inherit from NetscapePlugInStreamLoaderClient. (WebKit::HostedNetscapePluginStream::streamID): * Plugins/Hosted/HostedNetscapePluginStream.mm: (WebKit::HostedNetscapePluginStream::startStream): Keep track of the resposne URL and the MIME type. Pass the response URL to the plug-in host. (WebKit::HostedNetscapePluginStream::didFinishLoading): Disconnect the stream. (WebKit::HostedNetscapePluginStream::start): Create a plug-in stream loader and start loading. (WebKit::HostedNetscapePluginStream::stop): Cancel the load. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCLoadURL): Fix the parameter order. (WKPCCancelLoadURL): New function that cancels a load of a stream with a given reason. * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::destroy): Stop the streams. (WebKit::NetscapePluginInstanceProxy::pluginStream): Return a plug-in stream given a stream ID. (WebKit::NetscapePluginInstanceProxy::disconnectStream): Remove the stream from the streams map. (WebKit::NetscapePluginInstanceProxy::loadRequest): Create a stream and load it. * Plugins/Hosted/WebKitPluginClient.defs: Add CancelLoadURL. * Plugins/Hosted/WebKitPluginHost.defs: Add responseURL to StartStream. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView pluginPackage]): Move this down to the base class from WebNetscapePluginView. * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: 2008-12-08 Dan Bernstein <mitz@apple.com> Reviewed by John Sullivan. - WebKit/mac part of tracking the global history item for a WebView * WebView/WebView.mm: (-[WebView _globalHistoryItem]): Added. Returns the page's global history item. * WebView/WebViewPrivate.h: 2008-12-06 Simon Fraser <simon.fraser@apple.com> Reviewed by Dave Hyatt https://bugs.webkit.org/show_bug.cgi?id=15671 VisiblePosition::caretRect() was renaemd to absoluteCaretBounds(). * WebView/WebFrame.mm: (-[WebFrame _caretRectAtNode:offset:affinity:]): 2008-12-06 David Kilzer <ddkilzer@apple.com> Bug 22666: Clean up data structures used when collecting URLs of subresources for webarchives <https://bugs.webkit.org/show_bug.cgi?id=22666> Reviewed by Darin Adler. * DOM/WebDOMOperations.mm: (-[DOMNode _subresourceURLs]): Changed from using Vector<KURL> to ListHashSet<KURL> when calling WebCore::Node::getSubresourceURLs(). 2008-12-05 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. <rdar://problem/6405599> Tiger Mail crashes when using "Mail Contents of This Page" in Safari before opening a mail message in Mail * Carbon/CarbonWindowAdapter.m: Removed. * Carbon/CarbonWindowAdapter.mm: Copied from WebKit/mac/Carbon/CarbonWindowAdapter.m. (+[CarbonWindowAdapter initialize]): * History/WebBackForwardList.mm: (+[WebBackForwardList initialize]): * History/WebHistoryItem.mm: (+[WebHistoryItem initialize]): * Misc/WebElementDictionary.mm: (+[WebElementDictionary initialize]): * Plugins/Hosted/WebHostedNetscapePluginView.mm: (+[WebHostedNetscapePluginView initialize]): * Plugins/WebBaseNetscapePluginView.mm: * Plugins/WebBasePluginPackage.m: Removed. * Plugins/WebBasePluginPackage.mm: Copied from WebKit/mac/Plugins/WebBasePluginPackage.m. (+[WebBasePluginPackage initialize]): * Plugins/WebNetscapePluginView.mm: (+[WebNetscapePluginView initialize]): * WebCoreSupport/WebEditorClient.mm: (+[WebEditCommand initialize]): * WebCoreSupport/WebFrameLoaderClient.mm: * WebView/WebArchive.mm: (+[WebArchivePrivate initialize]): * WebView/WebDataSource.mm: (+[WebDataSourcePrivate initialize]): * WebView/WebHTMLView.mm: (+[WebHTMLViewPrivate initialize]): (+[WebHTMLView initialize]): * WebView/WebResource.mm: (+[WebResourcePrivate initialize]): * WebView/WebView.mm: (+[WebViewPrivate initialize]): Call JSC::initializeThreading(); 2008-12-04 Stephanie Lewis <slewis@apple.com> Fix build. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCLoadURL): 2008-12-04 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. More work on streams. * Plugins/Hosted/HostedNetscapePluginStream.h: Added. (WebKit::HostedNetscapePluginStream::create): * Plugins/Hosted/HostedNetscapePluginStream.mm: Added. (WebKit::HostedNetscapePluginStream::HostedNetscapePluginStream): (WebKit::HostedNetscapePluginStream::startStreamWithResponse): (WebKit::HostedNetscapePluginStream::startStream): (WebKit::HostedNetscapePluginStream::didReceiveData): (WebKit::HostedNetscapePluginStream::didFinishLoading): (WebKit::HostedNetscapePluginStream::didReceiveResponse): * Plugins/Hosted/NetscapePluginInstanceProxy.h: (WebKit::NetscapePluginInstanceProxy::pluginView): (WebKit::NetscapePluginInstanceProxy::hostProxy): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::PluginRequest::PluginRequest): (WebKit::NetscapePluginInstanceProxy::PluginRequest::requestID): (WebKit::NetscapePluginInstanceProxy::PluginRequest::request): (WebKit::NetscapePluginInstanceProxy::PluginRequest::frameName): (WebKit::NetscapePluginInstanceProxy::PluginRequest::didStartFromUserGesture): (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): (WebKit::NetscapePluginInstanceProxy::performRequest): (WebKit::NetscapePluginInstanceProxy::evaluateJavaScript): (WebKit::NetscapePluginInstanceProxy::requestTimerFired): (WebKit::NetscapePluginInstanceProxy::loadRequest): * Plugins/Hosted/WebKitPluginHost.defs: 2008-12-04 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Start implementing WKPCLoadURL. Currently this has copied a lot of code from WebNetscapePluginView but once we have a more complete implementation of NPStreams we can start refactoring things so that the implementations can share more code. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WKPCLoadURL): * Plugins/Hosted/NetscapePluginInstanceProxy.h: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): (WebKit::NetscapePluginInstanceProxy::loadURL): (WebKit::NetscapePluginInstanceProxy::performRequest): (WebKit::NetscapePluginInstanceProxy::requestTimerFired): (WebKit::NetscapePluginInstanceProxy::loadRequest): * Plugins/Hosted/WebKitPluginClient.defs: * Plugins/Hosted/WebKitPluginHost.defs: 2008-12-04 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Move requestWithURLCString to WebBaseNetscapePluginView. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView requestWithURLCString:]): * Plugins/WebNetscapePluginView.mm: 2008-12-03 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Move WebPluginRequest to its own file. * Plugins/WebNetscapePluginView.mm: * Plugins/WebPluginRequest.h: Added. * Plugins/WebPluginRequest.m: Added. (-[WebPluginRequest initWithRequest:frameName:notifyData:sendNotification:didStartFromUserGesture:]): (-[WebPluginRequest dealloc]): (-[WebPluginRequest request]): (-[WebPluginRequest frameName]): (-[WebPluginRequest isCurrentEventUserGesture]): (-[WebPluginRequest sendNotification]): (-[WebPluginRequest notifyData]): 2008-12-03 Anders Carlsson <andersca@apple.com> Handle the CA model. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView setWindowIfNecessary]): 2008-12-03 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. <rdar://problem/6412293> Call NPP_SetWindow for CA plug-ins. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebNetscapePluginView restorePortState:]): (-[WebNetscapePluginView isNewWindowEqualToOldWindow]): (-[WebNetscapePluginView updateAndSetWindow]): (-[WebNetscapePluginView setWindowIfNecessary]): 2008-12-03 Anders Carlsson <andersca@apple.com> Fix the release build. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::deadNameNotificationCallback): 2008-12-03 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. <rdar://problem/6412234> Don't crash if we can't launch the plug-in host. * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::instantiatePlugin): 2008-12-02 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Start processing messages sent to the client port. * Plugins/Hosted/NetscapePluginHostProxy.h: * Plugins/Hosted/NetscapePluginHostProxy.mm: Add a map from ports to plug-in proxies. Turn the set of instances into a map from pluginID to instance proxy. (WKPCStatusText): Look up the right instance proxy and call status(). * Plugins/Hosted/NetscapePluginInstanceProxy.h: (WebKit::NetscapePluginInstanceProxy::pluginID): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::status): Implement this. * Plugins/Hosted/WebKitPluginClient.defs: Add the plug-in ID to StatusText. 2008-12-02 Gregory Hughes <ghughes@apple.com> Reviewed by Beth Dakin. Bug 22513: ZOOM: text selection does not send correct zoom bounds When zoomed, text selection must send the zoom bounds in flipped screen coordinates. * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory accessibilityConvertScreenRect:]): 2008-12-02 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Create a client mach port and pass it to the plug-in host. * Plugins/Hosted/NetscapePluginHostManager.h: * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::hostForPackage): (WebKit::NetscapePluginHostManager::spawnPluginHost): * Plugins/Hosted/NetscapePluginHostProxy.h: * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): * Plugins/Hosted/WebKitPluginHost.defs: 2008-12-02 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Let the plug-in views know if the plug-in host crashes. * Plugins/Hosted/NetscapePluginHostManager.h: * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::instantiatePlugin): * Plugins/Hosted/NetscapePluginHostProxy.h: * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::pluginHostDied): (WebKit::NetscapePluginHostProxy::addPluginInstance): (WebKit::NetscapePluginHostProxy::removePluginInstance): * Plugins/Hosted/NetscapePluginInstanceProxy.h: (WebKit::NetscapePluginInstanceProxy::create): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: Keep a pointer to the host proxy. (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): Add the instance to the host set. (WebKit::NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy): Remove the instance form the host set. (WebKit::NetscapePluginInstanceProxy::pluginHostDied): Tell the plug-in view that the plug-in died. * Plugins/Hosted/WebHostedNetscapePluginView.h: * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView createPlugin]): Pass the plug-in view to the instantiatePlugin. (-[WebHostedNetscapePluginView pluginHostDied]): Handle the plug-in host crashing. (-[WebHostedNetscapePluginView drawRect:]): Fill the plug-in view with a nice red shade if the plug-in crashes. 2008-12-01 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Recover if the plug-in host dies and we try to instantiate another plugin before we get the port death notification * Plugins/Hosted/NetscapePluginHostManager.h: * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::pluginHostDied): Remove the plug-in host from the map. (WebKit::NetscapePluginHostManager::instantiatePlugin): NetscapePluginHostProxy is no longer refcounted. * Plugins/Hosted/NetscapePluginHostProxy.h: This is no longer refcounted. Add a set of plug-in instances (unused for now). * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): Create a death notification port. (WebKit::NetscapePluginHostProxy::pluginHostDied): Tell the manager that we're gone and delete ourselves. (WebKit::NetscapePluginHostProxy::deathPortCallback): New CFMachPort callback. 2008-12-01 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Move instantiatePlugin to NetscapePluginHostManager. * Plugins/Hosted/NetscapePluginHostManager.h: * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::instantiatePlugin): * Plugins/Hosted/NetscapePluginHostProxy.h: * Plugins/Hosted/NetscapePluginHostProxy.mm: * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView createPlugin]): 2008-12-01 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Pass the plug-in host port directly to the instance proxy. * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::instantiatePlugin): * Plugins/Hosted/NetscapePluginInstanceProxy.h: (WebKit::NetscapePluginInstanceProxy::create): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): (WebKit::NetscapePluginInstanceProxy::resize): (WebKit::NetscapePluginInstanceProxy::destroy): (WebKit::NetscapePluginInstanceProxy::focusChanged): (WebKit::NetscapePluginInstanceProxy::windowFocusChanged): (WebKit::NetscapePluginInstanceProxy::windowFrameChanged): (WebKit::NetscapePluginInstanceProxy::startTimers): (WebKit::NetscapePluginInstanceProxy::mouseEvent): (WebKit::NetscapePluginInstanceProxy::stopTimers): 2008-12-01 Anders Carlsson <andersca@apple.com> Try to fix the Tiger build. * Plugins/WebNetscapePluginView.mm: 2008-12-01 Anders Carlsson <andersca@apple.com> Rename _layer to _pluginLayer where I forgot to do so. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView destroyPlugin]): * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView createPlugin]): (-[WebNetscapePluginView setLayer:]): (-[WebNetscapePluginView destroyPlugin]): 2008-12-01 Anders Carlsson <andersca@apple.com> Reviewed by Adam Roben. Make sure to re-insert layers as needed so they won't be lost when the layer backed view is removed from the view hierarchy. * Plugins/Hosted/WebHostedNetscapePluginView.h: Add _pluginLayer ivar. * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView createPlugin]): Don't add the layer here. (-[WebHostedNetscapePluginView setLayer:]): Instead, add it here. (-[WebHostedNetscapePluginView destroyPlugin]): Set _pluginLayer to 0. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView createPlugin]): Don't add the layer here. (-[WebNetscapePluginView setLayer:]): Do it here. 2008-11-30 Antti Koivisto <antti@apple.com> Reviewed by Mark Rowe. https://bugs.webkit.org/show_bug.cgi?id=22557 Report free size in central and thread caches too. * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics memoryStatistics]): 2008-11-29 Antti Koivisto <antti@apple.com> Reviewed by Dan Bernstein. https://bugs.webkit.org/show_bug.cgi?id=22557 Add statistics for JavaScript GC heap. * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptObjectsCount]): (+[WebCoreStatistics memoryStatistics]): 2008-11-29 Antti Koivisto <antti@apple.com> Reviewed by Alexey Proskuryakov. https://bugs.webkit.org/show_bug.cgi?id=22557 - Add purgeable memory statistics to cache statistics. - Add method for getting fastMalloc statistics. - Add method to force returning free memory back to system. * Misc/WebCache.mm: (+[WebCache statistics]): * Misc/WebCoreStatistics.h: * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics stopIgnoringWebCoreNodeLeaks]): (+[WebCoreStatistics memoryStatistics]): (+[WebCoreStatistics returnFreeMemoryToSystem]): 2008-11-26 Mark Rowe <mrowe@apple.com> Fix the Tiger build. mig.h does not always define __MigTypeCheck on Tiger, which leads to problems when the generated code is built with -Wundef. * Plugins/Hosted/WebKitPluginHostTypes.h: 2008-11-26 Anders Carlsson <andersca@apple.com> Fix build. * Configurations/Base.xcconfig: 2008-11-26 Anders Carlsson <andersca@apple.com> Reviewed by Mark Rowe. Move WebHostedNetscapePluginView.{h|mm} to Plugins/Hosted. (-[WebHostedNetscapePluginView handleMouseMoved:]): (-[WebHostedNetscapePluginView setAttributeKeys:andValues:]): Fix a leak. (-[WebHostedNetscapePluginView createPlugin]): Instantiate the plug-in, store the plug-in proxy in the _proxy ivar. (-[WebHostedNetscapePluginView loadStream]): (-[WebHostedNetscapePluginView shouldStop]): Add stubs for these. (-[WebHostedNetscapePluginView updateAndSetWindow]): (-[WebHostedNetscapePluginView windowFocusChanged:]): (-[WebHostedNetscapePluginView destroyPlugin]): (-[WebHostedNetscapePluginView startTimers]): (-[WebHostedNetscapePluginView stopTimers]): (-[WebHostedNetscapePluginView focusChanged]): (-[WebHostedNetscapePluginView windowFrameDidChange:]): (-[WebHostedNetscapePluginView mouseDown:]): (-[WebHostedNetscapePluginView mouseUp:]): (-[WebHostedNetscapePluginView mouseDragged:]): (-[WebHostedNetscapePluginView mouseEntered:]): (-[WebHostedNetscapePluginView mouseExited:]): Call the proxy. (-[WebHostedNetscapePluginView addWindowObservers]): (-[WebHostedNetscapePluginView removeWindowObservers]): Add/remove observers for when the window frame changes. * Plugins/WebHostedNetscapePluginView.h: Removed. * Plugins/WebHostedNetscapePluginView.mm: Removed. 2008-11-26 Anders Carlsson <andersca@apple.com> Reviewed by Mark Rowe. Add the plug-in host proxy and plug-in instance proxy objects. These are just simple objects that forward their calls to the plug-in host. * Plugins/Hosted/NetscapePluginHostProxy.h: Added. (WebKit::NetscapePluginHostProxy::create): (WebKit::NetscapePluginHostProxy::port): * Plugins/Hosted/NetscapePluginHostProxy.mm: Added. (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): (WebKit::NetscapePluginHostProxy::instantiatePlugin): * Plugins/Hosted/NetscapePluginInstanceProxy.h: Added. (WebKit::NetscapePluginInstanceProxy::create): (WebKit::NetscapePluginInstanceProxy::renderContextID): (WebKit::NetscapePluginInstanceProxy::useSoftwareRenderer): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: Added. (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): (WebKit::NetscapePluginInstanceProxy::resize): (WebKit::NetscapePluginInstanceProxy::destroy): (WebKit::NetscapePluginInstanceProxy::focusChanged): (WebKit::NetscapePluginInstanceProxy::windowFocusChanged): (WebKit::NetscapePluginInstanceProxy::windowFrameChanged): (WebKit::NetscapePluginInstanceProxy::startTimers): (WebKit::NetscapePluginInstanceProxy::mouseEvent): (WebKit::NetscapePluginInstanceProxy::stopTimers): 2008-11-26 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein, Mark Rowe and Kevin Decker. Add the plug-in host manager singleton. * Plugins/Hosted/NetscapePluginHostManager.h: Added. * Plugins/Hosted/NetscapePluginHostManager.mm: Added. (WebKit::NetscapePluginHostManager::hostForPackage): If there's an existing host proxy available, just return it. Otherwise spawn a new plug-in host and create a new plug-in host proxy from the new plug-in host port. (WebKit::NetscapePluginHostManager::spawnPluginHost): Pass the plug-in host path and the preferred CPU type to the plug-in agent. When the plug-in host has finished launching, pass it the path to the plug-in bundle. (WebKit::NetscapePluginHostManager::initializeVendorPort): Check in with the plug-in agent and get the new plug-in vendor port back. 2008-11-26 Anders Carlsson <andersca@apple.com> Reviewed by Mark Rowe. * Plugins/Hosted/WebKitPluginHostTypes.h: Add copyright headers and fix the spacing around the *'s. 2008-11-26 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. * Plugins/Hosted/WebKitPluginHost.defs: Add copyright headers. * Plugins/Hosted/WebKitPluginHostTypes.h: Added. Forgot to add this. 2008-11-26 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Add plug-in host .defs. * Plugins/Hosted/WebKitPluginAgent.defs: Added. * Plugins/Hosted/WebKitPluginAgentReply.defs: Added. * Plugins/Hosted/WebKitPluginClient.defs: Added. * Plugins/Hosted/WebKitPluginHost.defs: Added. * Plugins/Hosted/WebKitPluginHostTypes.defs: Added. 2008-11-26 Anders Carlsson <andersca@apple.com> Reviewed by Mark Rowe and Kevin Decker. Minor plug-in changes. * Plugins/WebBaseNetscapePluginView.h: Add add/remove observer method declarations. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView isFlipped]): Move this down from WebNetscapePluginView. * Plugins/WebNetscapePluginPackage.h: * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage pluginHostArchitecture]): Getter for the plug-in host architecture. * Plugins/WebNetscapePluginView.mm: 2008-11-25 Dan Bernstein <mitz@apple.com> Reviewed by Mark Rowe. - include the text direction submenu in context menus when appropriate * WebView/WebPreferences.mm: (+[WebPreferences initialize]): Changed the default textDirectionSubmenuInclusionBehavior to "automatically", which includes the menu when the selection is confined to a single paragraph the either has right-to-left base writing direction or contains right-to-left or embedded text. Left the default for Tiger and Leopard to be "never". 2008-11-24 Darin Fisher <darin@chromium.org> Fix bustage. * History/WebHistory.mm: 2008-11-24 Glenn Wilson <gwilson@chromium.org> Reviewed by Alexey Proskuryakov. http://bugs.webkit.org/show_bug.cgi?id=15643 Added API support for the "trailing whitespace" work-around. This includes an APIs to get and set the state of this configuration variable. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::selectTrailingWhitespaceEnabled): * WebView/WebView.mm: (-[WebView setSelectTrailingWhitespaceEnabled:]): (-[WebView isSelectTrailingWhitespaceEnabled]): (-[WebView setSmartInsertDeleteEnabled:]): * WebView/WebViewPrivate.h: 2008-11-24 Darin Adler <darin@apple.com> Reviewed by Dan Bernstein. - https://bugs.webkit.org/show_bug.cgi?id=22470 remove unneeded URL argument from FrameLoaderClient::updateGlobalHistory * WebCoreSupport/WebFrameLoaderClient.h: Remove argument. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::updateGlobalHistory): Get the URL from the DocumentLoader, just as we do the title and the failure flag. 2008-11-24 Darin Adler <darin@apple.com> Reviewed by Dan Bernstein. - finish https://bugs.webkit.org/show_bug.cgi?id=22295 track which history items are from page load failures Last time around I did this only for the back/forward list and missed the global history list. * History/WebHistory.mm: (-[WebHistory _visitedURL:withTitle:wasFailure:]): Added wasFailure argument. Set the flag on the newly created history item. Also eliminated the use of autorelease on the added-items array. * History/WebHistoryInternal.h: Ditto. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::updateGlobalHistory): Added code to check for failure and pass the argument in to WebHistory. Given that this function gets other data from the DocumentLoader, I think we should get rid of the KURL argument, but that's a separate issue so I don't do it in this patch. 2008-11-24 Simon Fraser <simon.fraser@apple.com> Fix call to Frame::selectionBounds in Tiger build. * WebView/WebHTMLView.mm: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): 2008-11-24 Simon Fraser <simon.fraser@apple.com> Reviewed by Dan Bernstein Via: https://bugs.webkit.org/show_bug.cgi?id=22433 Rename RenderView::selectionRect() to selectionBounds(), to remove longstanding ambiguity with the base class selectionRect() method. Do the same on Frame for consistency with RenderView. * WebView/WebHTMLView.mm: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): (-[WebHTMLView selectionRect]): (-[WebHTMLView selectionImageRect]): 2008-11-20 Pierre-Olivier Latour <pol@apple.com> Reviewed by Dan Bernstein. WebKit should be using Device RGB colorspace everywhere for consistency. https://bugs.webkit.org/show_bug.cgi?id=22300 * WebView/WebHTMLView.mm: (-[WebHTMLView _dragImageForURL:withLabel:]): (-[WebHTMLView _colorAsString:]): 2008-11-20 Darin Adler <darin@apple.com> Earlier version reviewed by Justin Garcia. - part of fix for <rdar://problem/4108572> REGRESSION: Can't extend selection with shift-arrow in read only mode Also resolves <rdar://problem/5000134>. * WebView/WebHTMLView.mm: Removed some unused code, and made the Tiger workaround for bug 3789278 be Tiger-only. (-[WebHTMLView resignFirstResponder]): Removed code setting unused resigningFirstResponder flag. (-[WebHTMLView _wantsKeyDownForEvent:]): Added. Returns YES. (-[WebHTMLView insertText:]): Don't try to insert text if the selection is not editable. We used to prevent even processing the input, but that's not practical since some commands need to work even in non-editable regions. 2008-11-20 Anders Carlsson <andersca@apple.com> Reviewed by Jon Honeycutt. Move some frame/page checking code down to the base class. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView start]): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView _createPlugin]): 2008-11-19 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Test: plugins/netscape-plugin-setwindow-size-2.html Fix bug where NPP_SetWindow wasn't getting called for some plug-ins. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView updateAndSetWindow]): Don't bail if the drawing model is not the CA drawing model. Remove some code that was doing the wrong thing. 2008-11-19 Darin Fisher <darin@chromium.org> Reviewed by Geoff Garen. https://bugs.webkit.org/show_bug.cgi?id=22345 Define ScriptValue as a thin container for a JSC::Value*. * WebView/WebFrame.mm: (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): * WebView/WebView.mm: (-[WebView aeDescByEvaluatingJavaScriptFromString:]): 2008-11-19 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. <rdar://problem/6383762> WebKit r38340 crash on key press in plugin Set the value to 0 before calling NPP_GetValue, in case the plug-in returns NPERR_NO_ERROR but does not update the value. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView createPlugin]): 2008-11-19 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Make sure to copy the MIME type. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): 2008-11-19 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler. First step toward fixing <rdar://problem/6263293> WebScriptDebugDelegate should use intptr_t for sourceId, not int Added a conditional typedef (currently disabled) to switch sourceId to intptr_t in non-Tiger, non-Leopard builds. * DefaultDelegates/WebDefaultScriptDebugDelegate.m: (-[WebDefaultScriptDebugDelegate webView:didParseSource:fromURL:sourceId:forWebFrame:]): (-[WebDefaultScriptDebugDelegate webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:]): (-[WebDefaultScriptDebugDelegate webView:didEnterCallFrame:sourceId:line:forWebFrame:]): (-[WebDefaultScriptDebugDelegate webView:willExecuteStatement:sourceId:line:forWebFrame:]): (-[WebDefaultScriptDebugDelegate webView:willLeaveCallFrame:sourceId:line:forWebFrame:]): (-[WebDefaultScriptDebugDelegate webView:exceptionWasRaised:sourceId:line:forWebFrame:]): * WebView/WebScriptDebugDelegate.h: * WebView/WebScriptDebugger.mm: (WebScriptDebugger::sourceParsed): (WebScriptDebugger::callEvent): (WebScriptDebugger::atStatement): (WebScriptDebugger::returnEvent): (WebScriptDebugger::exception): 2008-11-18 Dan Bernstein <mitz@apple.com> Reviewed by Mark Rowe. - fix https://bugs.webkit.org/show_bug.cgi?id=22331 <rdar://problem/6381657> REGRESSION: Contextual menu no longer has an "Inspect Element" item * WebView/WebUIDelegatePrivate.h: Reorder new enum values after existing ones. 2008-11-17 Beth Dakin <bdakin@apple.com> Reviewed by Adele Peterson. Fix for <rdar://problem/6373102> REGRESSION (r36919): In a new mail message, the caret appears in message body by default This fixes a regression caused by http://trac.webkit.org/changeset/36919. That change was too sweeping; we do not want to unconditionally set the page to be active, but we can be looser than the original constraints. This patch set the window active if the first responder is or is a descendant of the main frame's frame view. * WebView/WebView.mm: (-[WebView _updateFocusedAndActiveStateForFrame:]): 2008-11-18 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=22337 Enable workers by default * Configurations/WebKit.xcconfig: Define ENABLE_WORKERS (change from ENABLE_WORKER_THREADS, which was accidentally committed before). 2008-11-17 Geoffrey Garen <ggaren@apple.com> Not reviewed. Try to fix Mac build. * WebView/WebScriptDebugDelegate.mm: 2008-11-17 Pierre-Olivier Latour <pol@apple.com> Reviewed by Sam Weinig. Added SPI to allow pausing a running CSS transition or animation at a given time for testing purposes. https://bugs.webkit.org/show_bug.cgi?id=21261 * WebView/WebFrame.mm: (-[WebFrame _pauseAnimation:onNode:atTime:]): (-[WebFrame _pauseTransitionOfProperty:onNode:atTime:]): * WebView/WebFramePrivate.h: 2008-11-17 Geoffrey Garen <ggaren@apple.com> Reviewed by Sam Weinig. Updated for JavaScriptCore renames. * ForwardingHeaders/runtime/Completion.h: Copied from ForwardingHeaders/runtime/Interpreter.h. * ForwardingHeaders/runtime/Interpreter.h: Removed. * WebView/WebScriptDebugDelegate.mm: 2008-11-16 Greg Bolsinga <bolsinga@apple.com> Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=21810 Remove use of static C++ objects that are destroyed at exit time (destructors) Use DEFINE_STATIC_LOCAL for static RetainPtr<T> * Misc/WebNSPasteboardExtras.mm: Use DEFINE_STATIC_LOCAL (+[NSPasteboard _web_writableTypesForURL]): (_createWritableTypesForImageWithoutArchive): Created so accessor has one line initialization (_writableTypesForImageWithoutArchive): Use create function for one line initialization (_createWritableTypesForImageWithArchive): Created so accessor has one line initialization (_writableTypesForImageWithArchive): Use create function for one line initialization * WebCoreSupport/WebPasteboardHelper.mm: Use DEFINE_STATIC_LOCAL (WebPasteboardHelper::insertablePasteboardTypes): * WebView/WebHTMLRepresentation.mm: Use DEFINE_STATIC_LOCAL (+[WebHTMLRepresentation supportedMIMETypes]): (+[WebHTMLRepresentation supportedNonImageMIMETypes]): (+[WebHTMLRepresentation supportedImageMIMETypes]): 2008-11-16 Darin Adler <darin@apple.com> Reviewed by Dan Bernstein. - https://bugs.webkit.org/show_bug.cgi?id=22295 track which history items are from page load failures * History/WebHistoryItem.mm: Added lastVisitWasFailureKey. (-[WebHistoryItem initFromDictionaryRepresentation:]): Set the lastVisitWasFailure flag in the history item if the dictionary had lastVisitWasFailureKey true. (-[WebHistoryItem dictionaryRepresentation]): Set the lastVisitWasFailureKey boolean in the dictionary if the history item had the lastVisitWasFailure flag. (-[WebHistoryItem lastVisitWasFailure]): Added. * History/WebHistoryItemInternal.h: Moved include of WebBackForwardList here from WebHistoryItemPrivate.h; removed other unneeded includes. * History/WebHistoryItemPrivate.h: Added lastVisitWasFailure method. Removed unneeded includes. * Misc/WebNSDictionaryExtras.h: Added _webkit_boolForKey. * Misc/WebNSDictionaryExtras.m: (-[NSDictionary _webkit_boolForKey:]): Added. 2008-11-14 Greg Bolsinga <bolsinga@apple.com> Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=21810 Remove use of static C++ objects that are destroyed at exit time (destructors) Create DEFINE_STATIC_LOCAL macro. Change static local objects to leak to avoid exit-time destructor. Update code that was changed to fix this issue that ran into a gcc bug (<rdar://problem/6354696> Codegen issue with C++ static reference in gcc build 5465). Also typdefs for template types needed to be added in some cases so the type could make it through the macro successfully. Basically code of the form: static T m; becomes: DEFINE_STATIC_LOCAL(T, m, ()); Also any code of the form: static T& m = *new T; also becomes: DEFINE_STATIC_LOCAL(T, m, ()); * ForwardingHeaders/wtf/StdLibExtras.h: Added. * History/WebBackForwardList.mm: (backForwardLists): * History/WebHistoryItem.mm: (historyItemWrappers): * Misc/WebStringTruncator.m: (fontFromNSFont): * Plugins/WebBaseNetscapePluginStream.mm: (streams): * WebView/WebView.mm: (aeDescFromJSValue): 2008-11-14 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - <rdar://problem/6234333> Implement action methods for setting and clearing character-level directionality - part of <rdar://problem/6234337> Add a Text Direction menu to the default context menu when appropriate * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory contextMenuItemTagTextDirectionMenu]): Added. * WebView/WebFrame.mm: (core): Added a convertor from WebTextDirectionSubmenuInclusionBehavior to WebCore::TextDirectionSubmenuInclusionBehavior. * WebView/WebFrameInternal.h: * WebView/WebHTMLView.mm: Added makeTextWritingDirectionLeftToRight:, makeTextWritingDirectionNatural: and makeTextWritingDirectionRightToLeft: using the WEBCORE_COMMAND macro. * WebView/WebPreferenceKeysPrivate.h: Added WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey. * WebView/WebPreferences.mm: (+[WebPreferences initialize]): Set the default Text Direction submenu inclusion behavior to never include. (-[WebPreferences textDirectionSubmenuInclusionBehavior]): Added this accessor. (-[WebPreferences setTextDirectionSubmenuInclusionBehavior:]): Ditto. * WebView/WebPreferencesPrivate.h: Defined the WebTextDirectionSubmenuInclusionBehavior enum and declared accessors. * WebView/WebUIDelegatePrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Added code to transfer the Text Direction submenu inclusion behavior preference to WebCore settings. 2008-11-14 Darin Adler <darin@apple.com> Reviewed by Mark Rowe. - fix https://bugs.webkit.org/show_bug.cgi?id=22222 selectKeyViewPrecedingView: with document view that can't be first responder makes WebFrameView be first responder * WebView/WebFrameView.mm: (-[WebFrameView becomeFirstResponder]): Moved the acceptsFirstResponder special case inside the if statement so it won't run in the "selecting previous" case. Also removed the "just before shipping Tiger" code that doesn't need to be here any more. 2008-11-13 Mark Rowe <mrowe@apple.com> Fix the build. Don't use NSPICTPboardType on systems where it is deprecated. The system will take care of converting from this format to a format that we can understand. * WebCoreSupport/WebPasteboardHelper.mm: (WebPasteboardHelper::insertablePasteboardTypes): * WebView/WebHTMLView.mm: (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:]): (+[WebHTMLView _insertablePasteboardTypes]): (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]): 2008-11-13 John Sullivan <sullivan@apple.com> fixed <rdar://problem/6361578> Web Kit UI strings: a few edits Reviewed by Tim Hatcher * Misc/WebKitErrors.m: "Cannot show content with specified mime type" -> "Content with specified MIME type can't be shown" "Cannot show URL" -> "The URL can't be shown" "Cannot find plug-in" -> "The plug-in can't be found" "Cannot load plug-in" -> "The plug-in can't be loaded" * Panels/English.lproj/WebAuthenticationPanel.nib/classes.nib: * Panels/English.lproj/WebAuthenticationPanel.nib/info.nib: * Panels/English.lproj/WebAuthenticationPanel.nib/keyedobjects.nib: Added. * Panels/English.lproj/WebAuthenticationPanel.nib/objects.nib: Removed. Changed placeholder fine print in the nib to match one of the two strings it might be replaced by. This automagically updated the nib to a newer format, hence the objects -> keyedobjects change. I could have changed the placeholder fine print to be empty but this lets localizers understand the dialog layout better. * Panels/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForChallenge:]): "you need to log in" -> "you must log in" "Your log-in information" -> "Your login information" "The name or password entered" -> "The user name or password you entered" "Please try again." -> "Make sure you're entering them correctly, and then try again." 2008-11-12 Stephanie Lewis <slewis@apple.com> Fix Mac build. * Panels/WebAuthenticationPanel.m: 2008-11-12 John Sullivan <sullivan@apple.com> fixed <rdar://problem/3839110> Authentication dialogs talk about passwords being sent "in the clear" Reviewed by Tim Hatcher * Panels/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForChallenge:]): use "unencrypted" instead of "in the clear". Also, use the "Your log-in information will be sent securely" version when the receiving server is https, regardless of whether it uses basic or digest authentication. 2008-11-12 Darin Adler <darin@apple.com> Reviewed by Mark Rowe. - fix https://bugs.webkit.org/show_bug.cgi?id=22223 <rdar://problem/6366864> REGRESSION(r38245): "View Source" crashes the browser * WebView/WebFrameView.mm: (-[WebFrameView viewDidMoveToWindow]): Add missing null check. 2008-11-12 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Fix stupid bug. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView createPlugin]): 2008-11-10 Tor Arne Vestbø <tavestbo@trolltech.com> Reviewed by Simon Hausmann. Move _web_encodingForResource from WebKit into WebCore and change return type This change is needed to implement NSAPI in WebCore for Mac, see: https://bugs.webkit.org/show_bug.cgi?id=21427 * Misc/WebKitNSStringExtras.m: (+[NSString _web_encodingForResource:]): 2008-11-10 Tor Arne Vestbø <tavestbo@trolltech.com> Reviewed by Simon Hausmann. Moved the implementation of _webkit_isCaseInsensitiveEqualToString to WebCore's WebCoreNSStringExtras as _stringIsCaseInsensitiveEqualToString. This change is needed to implement NSAPI in WebCore for Mac, see: https://bugs.webkit.org/show_bug.cgi?id=21427 * Misc/WebKitNSStringExtras.m: (-[NSString _webkit_isCaseInsensitiveEqualToString:]): 2008-11-11 Dan Bernstein <mitz@apple.com> Reviewed by Adam Roben. WebKit/mac part of adding a master volume control for media elements in a WebView * WebView/WebView.mm: (-[WebView setMediaVolume:]): Added. (-[WebView mediaVolume]): Added. * WebView/WebViewPrivate.h: 2008-11-11 Aaron Golden <agolden@apple.com> Bug 22134: -[WebHistoryItem dictionaryRepresentation] accesses past the end of a vector <https://bugs.webkit.org/show_bug.cgi?id=22134> Reviewed by Geoff Garen. * History/WebHistoryItem.mm: (-[WebHistoryItem initFromDictionaryRepresentation:]): (-[WebHistoryItem dictionaryRepresentation]): 2008-11-10 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Move renewGState to the base class. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView renewGState]): * Plugins/WebNetscapePluginView.mm: 2008-11-10 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Move start, stop and all the related methods down to WebBaseNetscapePluginView. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView updateAndSetWindow]): (-[WebBaseNetscapePluginView addWindowObservers]): (-[WebBaseNetscapePluginView removeWindowObservers]): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView stop]): (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): (-[WebBaseNetscapePluginView viewWillMoveToSuperview:]): (-[WebBaseNetscapePluginView viewDidMoveToWindow]): (-[WebBaseNetscapePluginView viewWillMoveToHostWindow:]): (-[WebBaseNetscapePluginView viewDidMoveToHostWindow]): (-[WebBaseNetscapePluginView windowWillClose:]): (-[WebBaseNetscapePluginView windowBecameKey:]): (-[WebBaseNetscapePluginView windowResignedKey:]): (-[WebBaseNetscapePluginView windowDidMiniaturize:]): (-[WebBaseNetscapePluginView windowDidDeminiaturize:]): (-[WebBaseNetscapePluginView loginWindowDidSwitchFromUser:]): (-[WebBaseNetscapePluginView loginWindowDidSwitchToUser:]): (-[WebBaseNetscapePluginView preferencesHaveChanged:]): * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: 2008-11-10 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Move rightMouseDown, rightMouseUp and sendActivateEvent to the base plugin view. Add stubs for createPlugin, loadStream, shouldStop and destroyPlugin. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView windowFocusChanged:]): (-[WebBaseNetscapePluginView createPlugin]): (-[WebBaseNetscapePluginView loadStream]): (-[WebBaseNetscapePluginView destroyPlugin]): (-[WebBaseNetscapePluginView sendActivateEvent:]): (-[WebBaseNetscapePluginView rightMouseDown:]): (-[WebBaseNetscapePluginView rightMouseUp:]): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView windowFocusChanged:]): 2008-11-10 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Factor plug-in type specific code out to three new methods, createPlugin, destroyPlugin and loadStream. * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView createPlugin]): (-[WebNetscapePluginView loadStream]): (-[WebNetscapePluginView start]): (-[WebNetscapePluginView shouldStop]): (-[WebNetscapePluginView destroyPlugin]): (-[WebNetscapePluginView stop]): 2008-11-10 Anders Carlsson <andersca@apple.com> Fix Tiger build. * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): 2008-11-10 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Move even more code down to WebBaseNetscapePluginView, get rid of some unnecessary methods. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView focusChanged]): (-[WebBaseNetscapePluginView visibleRect]): (-[WebBaseNetscapePluginView acceptsFirstResponder]): (-[WebBaseNetscapePluginView setHasFocus:]): (-[WebBaseNetscapePluginView becomeFirstResponder]): (-[WebBaseNetscapePluginView resignFirstResponder]): * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView focusChanged]): (-[WebNetscapePluginView tellQuickTimeToChill]): (-[WebNetscapePluginView updateAndSetWindow]): (-[WebNetscapePluginView start]): (-[WebNetscapePluginView stop]): (-[WebNetscapePluginView viewWillMoveToWindow:]): (-[WebNetscapePluginView createPluginScriptableObject]): (-[WebNetscapePluginView pluginView:receivedData:]): (-[WebNetscapePluginView pluginView:receivedError:]): (-[WebNetscapePluginView pluginViewFinishedLoading:]): (-[WebNetscapePluginView inputContext]): (-[WebNetscapePluginView hasMarkedText]): (-[WebNetscapePluginView insertText:]): (-[WebNetscapePluginView markedRange]): (-[WebNetscapePluginView selectedRange]): (-[WebNetscapePluginView setMarkedText:selectedRange:]): (-[WebNetscapePluginView unmarkText]): (-[WebNetscapePluginView validAttributesForMarkedText]): (-[WebNetscapePluginView attributedSubstringFromRange:]): (-[WebNetscapePluginView characterIndexForPoint:]): (-[WebNetscapePluginView doCommandBySelector:]): (-[WebNetscapePluginView firstRectForCharacterRange:]): (-[WebNetscapePluginView _viewHasMoved]): (-[WebNetscapePluginView _redeliverStream]): 2008-11-10 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Move timer handling code down to WebBaseNetscapePluginView. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView stopTimers]): (-[WebBaseNetscapePluginView startTimers]): (-[WebBaseNetscapePluginView restartTimers]): * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView stopTimers]): (-[WebNetscapePluginView startTimers]): (-[WebNetscapePluginView scheduleTimerWithInterval:repeat:timerFunc:]): * WebView/WebHTMLView.mm: (-[WebHTMLView _resumeNullEventsForAllNetscapePlugins]): 2008-11-10 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Move a bunch of methods and ivars up to WebBaseNetscapePluginView. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView dealloc]): (-[WebBaseNetscapePluginView finalize]): (-[WebBaseNetscapePluginView removeTrackingRect]): (-[WebBaseNetscapePluginView resetTrackingRect]): (-[WebBaseNetscapePluginView dataSource]): (-[WebBaseNetscapePluginView webFrame]): (-[WebBaseNetscapePluginView webView]): (-[WebBaseNetscapePluginView currentWindow]): * Plugins/WebNetscapePluginEventHandlerCarbon.mm: (WebNetscapePluginEventHandlerCarbon::windowFocusChanged): * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView sendEvent:isDrawRect:]): (-[WebNetscapePluginView sendActivateEvent:]): (-[WebNetscapePluginView restartTimers]): (-[WebNetscapePluginView setHasFocus:]): (-[WebNetscapePluginView mouseDown:]): (-[WebNetscapePluginView mouseUp:]): (-[WebNetscapePluginView mouseEntered:]): (-[WebNetscapePluginView mouseExited:]): (-[WebNetscapePluginView handleMouseMoved:]): (-[WebNetscapePluginView mouseDragged:]): (-[WebNetscapePluginView scrollWheel:]): (-[WebNetscapePluginView keyUp:]): (-[WebNetscapePluginView keyDown:]): (-[WebNetscapePluginView flagsChanged:]): (-[WebNetscapePluginView updateAndSetWindow]): (-[WebNetscapePluginView setWindowIfNecessary]): (-[WebNetscapePluginView start]): (-[WebNetscapePluginView stop]): (-[WebNetscapePluginView isStarted]): (-[WebNetscapePluginView dealloc]): (-[WebNetscapePluginView finalize]): (-[WebNetscapePluginView drawRect:]): (-[WebNetscapePluginView windowBecameKey:]): (-[WebNetscapePluginView preferencesHaveChanged:]): (-[WebNetscapePluginView evaluateJavaScriptPluginRequest:]): (-[WebNetscapePluginView webFrame:didFinishLoadWithReason:]): (-[WebNetscapePluginView scheduleTimerWithInterval:repeat:timerFunc:]): (-[WebNetscapePluginView _viewHasMoved]): 2008-11-10 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker and Mark Rowe. Add a WebHostedNetscapePluginView class. * Plugins/WebHostedNetscapePluginView.h: Added. * Plugins/WebHostedNetscapePluginView.mm: Added. * Plugins/WebNetscapePluginPackage.h: Use the right define. * Plugins/WebPluginDatabase.mm: (-[WebPluginDatabase removePluginInstanceViewsFor:]): Check for WebBaseNetscapePluginView. (-[WebPluginDatabase destroyAllPluginInstanceViews]): Check for WebBaseNetscapePluginView. * WebCoreSupport/WebFrameLoaderClient.mm: (NetscapePluginWidget::NetscapePluginWidget): (NetscapePluginWidget::handleEvent): Use WebBaseNetscapePluginView. (netscapePluginViewClass): New function that returns the right netscape plugin view type to use. (WebFrameLoaderClient::createPlugin): Get the right class. * WebKitPrefix.h: Prefix the #define with WTF_. * WebView/WebHTMLView.mm: (-[NSArray _web_makePluginViewsPerformSelector:withObject:]): Check for WebBaseNetscapePluginView. * WebView/WebView.mm: Remove an unnecessary include. 2008-11-10 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Don't use individual ivars for each plug-in vtable function. Instead, get them from the plugin package. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): * Plugins/WebNetscapePluginPackage.h: * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): (-[WebNetscapePluginPackage _unloadWithShutdown:]): * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView sendEvent:isDrawRect:]): (-[WebNetscapePluginView setWindowIfNecessary]): (-[WebNetscapePluginView start]): (-[WebNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): (-[WebNetscapePluginView createPluginScriptableObject]): (-[WebNetscapePluginView evaluateJavaScriptPluginRequest:]): (-[WebNetscapePluginView webFrame:didFinishLoadWithReason:]): (-[WebNetscapePluginView loadPluginRequest:]): (-[WebNetscapePluginView _createPlugin]): (-[WebNetscapePluginView _destroyPlugin]): (-[WebNetscapePluginView _printedPluginBitmap]): 2008-11-10 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Add a new WebBaseNetscapePluginView class. * Plugins/WebBaseNetscapePluginView.h: Added. * Plugins/WebBaseNetscapePluginView.mm: Added. (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): (-[WebBaseNetscapePluginView setAttributeKeys:andValues:]): (-[WebBaseNetscapePluginView handleMouseMoved:]): * Plugins/WebNetscapePluginView.h: * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView cut:]): (-[WebNetscapePluginView copy:]): (-[WebNetscapePluginView paste:]): (-[WebNetscapePluginView selectAll:]): (-[WebNetscapePluginView start]): (-[WebNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): 2008-11-10 Anders Carlsson <andersca@apple.com> Reviewed by Adam Roben. Rename WebBaseNetscapePluginView to WebNetscapePluginView. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::WebNetscapePluginStream): (WebNetscapePluginStream::setPlugin): * Plugins/WebBaseNetscapePluginView.h: Removed. * Plugins/WebBaseNetscapePluginView.mm: Removed. * Plugins/WebNetscapePluginEventHandler.h: (WebNetscapePluginEventHandler::WebNetscapePluginEventHandler): * Plugins/WebNetscapePluginEventHandler.mm: (WebNetscapePluginEventHandler::create): * Plugins/WebNetscapePluginEventHandlerCarbon.h: * Plugins/WebNetscapePluginEventHandlerCarbon.mm: (WebNetscapePluginEventHandlerCarbon::WebNetscapePluginEventHandlerCarbon): * Plugins/WebNetscapePluginEventHandlerCocoa.h: * Plugins/WebNetscapePluginEventHandlerCocoa.mm: (WebNetscapePluginEventHandlerCocoa::WebNetscapePluginEventHandlerCocoa): * Plugins/WebNetscapePluginView.h: Copied from mac/Plugins/WebBaseNetscapePluginView.h. * Plugins/WebNetscapePluginView.mm: Copied from mac/Plugins/WebBaseNetscapePluginView.mm. (+[WebNetscapePluginView setCurrentPluginView:]): (+[WebNetscapePluginView currentPluginView]): (-[WebNetscapePluginView loadPluginRequest:]): * Plugins/WebPluginDatabase.mm: (-[WebPluginDatabase removePluginInstanceViewsFor:]): (-[WebPluginDatabase destroyAllPluginInstanceViews]): * Plugins/npapi.mm: (pluginViewForInstance): (NPN_MarkedTextAbandoned): (NPN_MarkedTextSelectionChanged): * WebCoreSupport/WebFrameLoaderClient.mm: (NetscapePluginWidget::NetscapePluginWidget): (NetscapePluginWidget::handleEvent): (WebFrameLoaderClient::createPlugin): * WebView/WebHTMLView.mm: (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]): (-[WebHTMLView _resumeNullEventsForAllNetscapePlugins]): (-[NSArray _web_makePluginViewsPerformSelector:withObject:]): * WebView/WebView.mm: 2008-11-09 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - fix https://bugs.webkit.org/show_bug.cgi?id=15063 <rdar://problem/5452227> REGRESSION (r25151): Switching to a tab waiting for first data does not clear the window * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::frameLoadCompleted): Added comments, and got rid of a local variable to make this code match the code in the function below more closely. (WebFrameLoaderClient::provisionalLoadStarted): Added comments. * WebView/WebFrame.mm: (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]): Improved comment. * WebView/WebFrameView.mm: (-[WebFrameView _scrollView]): Tweaked formatting. (-[WebFrameView initWithFrame:]): Ditto. (-[WebFrameView setFrameSize:]): Added a comment and tweaked formatting. (-[WebFrameView viewDidMoveToWindow]): Added. This is the change that fixes the bug. Calls setDrawsBackground:YES as appropriate since moving the view out of the window to switch to another view disrupts the special technique for showing the old page during the start of loading. This is the identical reason for the setFrameSize: method above, and the code is almost the same. 2008-11-08 David Kilzer <ddkilzer@apple.com> Bug 22137: PLATFORM(MAC) build broken with HAVE(ACCESSIBILITY) disabled <https://bugs.webkit.org/show_bug.cgi?id=22137> Reviewed by Darin Adler. * WebView/WebFrame.mm: (-[WebFrame _accessibilityTree]): Return nil if HAVE(ACCESSIBILITY) is false. 2008-11-08 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - WebKit/mac part of adding WebPreferences for controlling databases and local storage * WebView/WebPreferenceKeysPrivate.h: Added WebKitDatabasesEnabledPreferenceKey and WebKitLocalStorageEnabledPreferenceKey. * WebView/WebPreferences.mm: (+[WebPreferences initialize]): Made databases and local storage enabled by default. (-[WebPreferences databasesEnabled]): Added. (-[WebPreferences setDatabasesEnabled:]): Added. (-[WebPreferences localStorageEnabled]): Added. (-[WebPreferences setLocalStorageEnabled:]): Added. * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Transfer the databases and local storage preferences to WebCore settings. 2008-11-06 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. https://bugs.webkit.org/show_bug.cgi?id=22115 NPN_HasPropertyUPP and NPN_HasMethodUPP entries in NPNetscapeFuncs are NULL Initialize the browser funcs correctly. * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): 2008-11-06 David Kilzer <ddkilzer@apple.com> BUILD FIX: Backed out r38189 (and r38203) for Xcode 3.0. Apparently older versions of gcc have issues with this patch. Backing out a second time until the issues are resolved. 2008-11-06 Cameron Zwarich <zwarich@apple.com> Reviewed by Geoff Garen. Move the remaining files in the kjs subdirectory of JavaScriptCore to a new parser subdirectory, and remove the kjs subdirectory entirely. The header SavedBuiltins.h was removed in r32587, so it no longer needs a forwarding header. * ForwardingHeaders/kjs: Removed. * ForwardingHeaders/kjs/SavedBuiltins.h: Removed. 2008-11-06 David Kilzer <ddkilzer@apple.com> BUILD WAS NOT BROKEN: Rolling r38189 back in. Please perform a clean build if you see crashes. 2008-11-06 David Kilzer <ddkilzer@apple.com> BUILD FIX: Backed out r38189 since it apparently broke the world. 2008-11-06 John Sullivan <sullivan@apple.com> Fixed problem with switching between text-only zoom and full-content zoom There were two booleans tracking whether zoom was text-only, one in WebCore settings and one in WebViewPrivate. Fixed by eliminating the one in WebViewPrivate. Reviewed by Adam Roben * WebView/WebView.mm: remove declaration of zoomMultiplierIsTextOnly instance variable in WebViewPrivate (-[WebViewPrivate init]): removed initialization of zoomMultiplierIsTextOnly (-[WebView textSizeMultiplier]): call [self _realZoomMultiplierIsTextOnly] instead of accessing WebViewPrivate instance variable (-[WebView _setZoomMultiplier:isTextOnly:]): update WebCore settings rather than WebViewPrivate instance variable (-[WebView _zoomMultiplier:]): call [self _realZoomMultiplierIsTextOnly] instead of accessing WebViewPrivate instance variable (-[WebView _realZoomMultiplierIsTextOnly]): return value from WebCore settings instead of accessing WebViewPrivate instance variable (-[WebView pageSizeMultiplier]): call [self _realZoomMultiplierIsTextOnly] instead of accessing WebViewPrivate instance variable 2008-11-06 Greg Bolsinga <bolsinga@apple.com> Reviewed by Darin Adler. Bug 21810: Remove use of static C++ objects that are destroyed at exit time (destructors) https://bugs.webkit.org/show_bug.cgi?id=21810 * History/WebBackForwardList.mm: (backForwardLists): Changed to leak an object to avoid an exit-time destructor. * History/WebHistoryItem.mm: (historyItemWrappers): Ditto * Misc/WebStringTruncator.m: (fontFromNSFont): Ditto * Plugins/WebBaseNetscapePluginStream.mm: (streams): Ditto * WebView/WebView.mm: (aeDescFromJSValue): Ditto 2008-11-05 Anders Carlsson <andersca@apple.com> Reviewed by Mark Rowe. Keep track of which plug-in host architecture would be needed for a given plug-in package. * Plugins/WebNetscapePluginPackage.h: * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage _initWithPath:]): * WebKitPrefix.h: 2008-11-05 Cameron Zwarich <zwarich@apple.com> Rubber-stamped by Sam Weinig. Correct forwarding headers for files moved to the runtime subdirectory of JavaScriptCore and remove unused forwarding headers. * ForwardingHeaders/kjs/collector.h: Removed. * ForwardingHeaders/kjs/identifier.h: Removed. * ForwardingHeaders/kjs/interpreter.h: Removed. * ForwardingHeaders/kjs/lookup.h: Removed. * ForwardingHeaders/kjs/operations.h: Removed. * ForwardingHeaders/kjs/protect.h: Removed. * ForwardingHeaders/runtime/Interpreter.h: Copied from ForwardingHeaders/kjs/interpreter.h. * WebView/WebScriptDebugDelegate.mm: 2008-11-05 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Remove WebPlugInStreamLoaderDelegate.h * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebPlugInStreamLoaderDelegate.h: Removed. 2008-11-05 Dan Bernstein <mitz@apple.com> - Tiger build fix * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView stop]): 2008-11-04 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Don't leak the CALayer. * Plugins/WebBaseNetscapePluginView.h: Make the layer a RetainPtr. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView stop]): Make sure to clear out the layer here. 2008-11-04 Cameron Zwarich <zwarich@apple.com> Rubber-stamped by Sam Weinig. Remove the unused kjs/dtoa.h forwarding header. * ForwardingHeaders/kjs/dtoa.h: Removed. 2008-11-04 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. More cleanup. Make a bunch of instance variables RetainPtrs. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView visibleRect]): (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebBaseNetscapePluginView sendActivateEvent:]): (-[WebBaseNetscapePluginView sendDrawRectEvent:]): (-[WebBaseNetscapePluginView stopTimers]): (-[WebBaseNetscapePluginView restartTimers]): (-[WebBaseNetscapePluginView setHasFocus:]): (-[WebBaseNetscapePluginView mouseDown:]): (-[WebBaseNetscapePluginView mouseUp:]): (-[WebBaseNetscapePluginView mouseEntered:]): (-[WebBaseNetscapePluginView mouseExited:]): (-[WebBaseNetscapePluginView handleMouseMoved:]): (-[WebBaseNetscapePluginView mouseDragged:]): (-[WebBaseNetscapePluginView scrollWheel:]): (-[WebBaseNetscapePluginView keyUp:]): (-[WebBaseNetscapePluginView keyDown:]): (-[WebBaseNetscapePluginView flagsChanged:]): (-[WebBaseNetscapePluginView cut:]): (-[WebBaseNetscapePluginView copy:]): (-[WebBaseNetscapePluginView paste:]): (-[WebBaseNetscapePluginView selectAll:]): (-[WebBaseNetscapePluginView didStart]): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView stop]): (-[WebBaseNetscapePluginView dataSource]): (-[WebBaseNetscapePluginView pluginPackage]): (-[WebBaseNetscapePluginView setPluginPackage:]): (-[WebBaseNetscapePluginView setAttributeKeys:andValues:]): (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): (-[WebBaseNetscapePluginView fini]): (-[WebBaseNetscapePluginView dealloc]): (-[WebBaseNetscapePluginView pluginView:receivedError:]): (-[WebBaseNetscapePluginView requestWithURLCString:]): (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]): (-[WebBaseNetscapePluginView loadPluginRequest:]): (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): (-[WebBaseNetscapePluginView userAgent]): (-[WebBaseNetscapePluginView getVariable:value:]): (-[WebBaseNetscapePluginView setVariable:value:]): (-[WebBaseNetscapePluginView _createPlugin]): (-[WebBaseNetscapePluginView _redeliverStream]): 2008-11-04 Brady Eidson <beidson@apple.com> Reviewed by John Sullivan Cleanup global history a tad. Used to _addItemForURL always create a new item and merge it with a previous item if one existed. It is more efficient and less complicated to update the previous item if one exists. * History/WebHistory.mm: (-[WebHistoryPrivate visitedURL:withTitle:]): (-[WebHistory _visitedURL:withTitle:]): Instead of calling the general purpose [WebHistoryPrivate addItem:] with a new history item, call the new special purposed visitedURL:withTitle: * History/WebHistoryInternal.h: * History/WebHistoryItem.mm: (-[WebHistoryItem _visitedWithTitle:]): Call "visited()" on the WebCore history item with the pertinent info. * History/WebHistoryItemInternal.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::updateGlobalHistory): 2008-11-04 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. https://bugs.webkit.org/show_bug.cgi?id=22065 Only create the plug-in stream loader when the stream is started. * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::WebNetscapePluginStream): (WebNetscapePluginStream::start): 2008-11-04 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. https://bugs.webkit.org/show_bug.cgi?id=22065 Remove some old, unused plug-in code. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView setVariable:value:]): 2008-11-04 Simon Fraser <simon.fraser@apple.com> Reviewed by Dave Hyatt https://bugs.webkit.org/show_bug.cgi?id=21941 Rename absolutePosition() to localToAbsolute(), and add the ability to optionally take transforms into account (which will eventually be the default behavior). * WebView/WebRenderNode.mm: (copyRenderNode): 2008-11-01 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=22030 Make EventNames usable from multiple threads * WebView/WebHTMLView.mm: * WebView/WebPDFView.mm: (-[WebPDFView PDFViewWillClickOnLink:withURL:]): Access event names via eventNames() function. 2008-11-04 Cameron Zwarich <zwarich@apple.com> Reviewed by Mark Rowe. Delete a forwarding header for a file that no longer exists. * ForwardingHeaders/kjs/string_object.h: Removed. 2008-11-03 Cameron Zwarich <zwarich@apple.com> Rubber-stamped by Maciej Stachowiak. Move more files into the runtime subdirectory of JavaScriptCore. * ForwardingHeaders/kjs/JSLock.h: Removed. * ForwardingHeaders/kjs/SymbolTable.h: Removed. * ForwardingHeaders/runtime/JSLock.h: Copied from ForwardingHeaders/kjs/JSLock.h. * ForwardingHeaders/runtime/SymbolTable.h: Copied from ForwardingHeaders/kjs/SymbolTable.h. * Misc/WebCoreStatistics.mm: * Plugins/WebBaseNetscapePluginStream.mm: * Plugins/WebBaseNetscapePluginView.mm: * Plugins/WebPluginController.mm: * WebView/WebFrame.mm: * WebView/WebScriptDebugDelegate.mm: * WebView/WebView.mm: 2008-11-03 Mark Rowe <mrowe@apple.com> Fix the 64-bit build. Pull the frequently-made check for drawingModel == NPDrawingModelQuickDraw out into a helper function to avoid #ifdef'ing all of the new places that this check is made. A few other #ifdef's are moved inside functions to allow their call sites to remain #ifdef-free, and we rely on the compiler to optimise out the check (which will always be false in 64-bit) instead. * Plugins/WebBaseNetscapePluginView.mm: (isDrawingModelQuickDraw): (-[WebBaseNetscapePluginView fixWindowPort]): (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): (-[WebBaseNetscapePluginView updateAndSetWindow]): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView tellQuickTimeToChill]): (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): (-[WebBaseNetscapePluginView _viewHasMoved]): 2008-11-03 Maciej Stachowiak <mjs@apple.com> Reviewed by Kevin Decker. - fix release build (and unitialized variable for CG drawing model!) * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): initialize portState in all code paths 2008-11-03 Kevin Decker <kdecker@apple.com> Reviewed by Anders Carlsson. https://bugs.webkit.org/show_bug.cgi?id=22053 This patch adds initial support for the NPDrawingModelCoreAnimation drawing model. * Plugins/WebBaseNetscapePluginView.h: Added _layer ivar. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): ASSERT this is not a plug-in using NPDrawingModelCoreAnimation. (-[WebBaseNetscapePluginView restorePortState:]): Ditto. (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): Slightly refactored a small block of code which with the PortState. Plug-ins using the NPDrawingModelCoreAnimation drawing model have no PortState. (-[WebBaseNetscapePluginView isNewWindowEqualToOldWindow]): ASSERT this is not a plug-in using NPDrawingModelCoreAnimation (-[WebBaseNetscapePluginView updateAndSetWindow]): Ditto. (-[WebBaseNetscapePluginView setWindowIfNecessary]): Ditto. (-[WebBaseNetscapePluginView start]): If the plug-in is a plug-in using the Core Animation model, request a layer from it. (-[WebBaseNetscapePluginView drawRect:]): Return early for NPDrawingModelCoreAnimation plug-ins. (-[WebBaseNetscapePluginView getVariable:value:]): Tell plug-ins running on post-Tiger systems WebKit supports NPDrawingModelCoreAnimation. (-[WebBaseNetscapePluginView setVariable:value:]): Added the new NPDrawingModelCoreAnimation case, which initializes drawingMode. (-[WebBaseNetscapePluginView _viewHasMoved]): Reworded the conditional call to updateAndSetWindow to be specific to CoreGraphics and QuickDraw plug-ins. 2008-10-31 Cameron Zwarich <zwarich@apple.com> Reviewed by Darin Adler. Bug 22019: Move JSC::Interpreter::shouldPrintExceptions() to WebCore::Console <https://bugs.webkit.org/show_bug.cgi?id=22019> * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics shouldPrintExceptions]): (+[WebCoreStatistics setShouldPrintExceptions:]): 2008-10-31 Dan Bernstein <mitz@apple.com> Reviewed by John Sullivan. - WebKit/mac part of <rdar://problem/6334641> Add WebView SPI for disabling document.cookie * WebView/WebView.mm: (-[WebView _cookieEnabled]): (-[WebView _setCookieEnabled:]): * WebView/WebViewPrivate.h: 2008-10-31 Brady Eidson <beidson@apple.com> Reviewed by Darin Adler [WebHistory setLastVisitedTimeInterval:forItem] was internal to WebHistory.mm and completely unused. Nuke it! * History/WebHistory.mm: 2008-10-31 Chris Fleizach <cfleizach@apple.com> Reviewed by Darin Adler. <rdar://problem/4361197> Screen Reader's Item Chooser shows scroll area for WebKit Application window If a WebFrameView does not allow scrolling, its scrollbars should not appear in the accessibility hierarchy. * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView accessibilityIsIgnored]): 2008-10-30 Mark Rowe <mrowe@apple.com> Reviewed by Jon Homeycutt. Explicitly default to building for only the native architecture in debug and release builds. * Configurations/DebugRelease.xcconfig: 2008-10-30 Cameron Zwarich <zwarich@apple.com> Rubber-stamped by Sam Weinig. Create a debugger directory in JavaScriptCore and move the relevant files to it. * ForwardingHeaders/debugger: Added. * ForwardingHeaders/debugger/DebuggerCallFrame.h: Copied from ForwardingHeaders/kjs/DebuggerCallFrame.h. * ForwardingHeaders/kjs/DebuggerCallFrame.h: Removed. * WebView/WebScriptDebugDelegate.mm: * WebView/WebScriptDebugger.h: * WebView/WebScriptDebugger.mm: 2008-10-29 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::WebNetscapePluginStream): (WebNetscapePluginStream::~WebNetscapePluginStream): (WebNetscapePluginStream::start): 2008-10-29 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Remove an unused forward class declaration. * Plugins/WebBaseNetscapePluginView.h: 2008-10-29 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Remove WebBaseNetscapePluginViewInternal.h and WebBaseNetscapePluginViewPrivate.h. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginViewInternal.h: Removed. * Plugins/WebBaseNetscapePluginViewPrivate.h: Removed. * Plugins/WebNetscapePluginEventHandler.mm: * Plugins/WebNetscapePluginEventHandlerCarbon.mm: * Plugins/WebNetscapePluginEventHandlerCocoa.mm: * Plugins/npapi.mm: * WebView/WebHTMLView.mm: 2008-10-29 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Remove WebNetscapePluginEmbeddedView, it adds nothing extra now. Remove WebNetscapePlugInStreamLoaderClient since WebNetscapePluginStream is the client now. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebKitPluginContainerView.h: * Plugins/WebNetscapePluginEmbeddedView.h: Removed. * Plugins/WebNetscapePluginEmbeddedView.mm: Removed. * Plugins/WebNetscapePluginEventHandler.h: * WebCoreSupport/WebFrameLoaderClient.mm: (NetscapePluginWidget::NetscapePluginWidget): (NetscapePluginWidget::handleEvent): (WebFrameLoaderClient::createPlugin): * WebCoreSupport/WebNetscapePlugInStreamLoaderClient.h: Removed. * WebCoreSupport/WebNetscapePlugInStreamLoaderClient.mm: Removed. * WebView/WebHTMLView.mm: (-[NSArray _web_makePluginViewsPerformSelector:withObject:]): 2008-10-29 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Remove the WebBaseNetscapePluginStream Objective-C object. * Plugins/WebBaseNetscapePluginStream.h: (WebNetscapePluginStream::create): * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::WebNetscapePluginStream): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView pluginView:receivedResponse:]): (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): 2008-10-29 Brady Eidson <beidson@apple.com> Reviewed by Sam Weinig https://bugs.webkit.org/show_bug.cgi?id=21952 Address an outstanding FIXME by removing unused SPI * History/WebHistory.mm: (-[WebHistory _addItemForURL:title:]): Fold addItem: into this method * History/WebHistoryPrivate.h: Removed unused/unneccessary SPI 2008-10-28 Justin Garcia <justin.garcia@apple.com> Reviewed by Darin Adler. <rdar://problem/5188560> REGRESSION: Spell checker doesn't clear spelling/grammar marker after error is marked as Ignored * WebView/WebHTMLView.mm: IgnoreSpelling is now a WebCore command. That command handles calling back into WebKit to perform the cross platform work that was removed in this change. 2008-10-28 Cameron Zwarich <zwarich@apple.com> Reviewed by Mark Rowe. Move ForwardingHeaders to their correct location after the creation of the runtime directory in JavaScriptCore. * ForwardingHeaders/kjs/JSFunction.h: Removed. * ForwardingHeaders/kjs/JSObject.h: Removed. * ForwardingHeaders/kjs/JSString.h: Removed. * ForwardingHeaders/kjs/JSValue.h: Removed. * ForwardingHeaders/runtime: Added. * ForwardingHeaders/runtime/JSFunction.h: Copied from ForwardingHeaders/kjs/JSFunction.h. * ForwardingHeaders/runtime/JSObject.h: Copied from ForwardingHeaders/kjs/JSObject.h. * ForwardingHeaders/runtime/JSString.h: Copied from ForwardingHeaders/kjs/JSString.h. * ForwardingHeaders/runtime/JSValue.h: Copied from ForwardingHeaders/kjs/JSValue.h. * WebView/WebScriptDebugDelegate.mm: * WebView/WebScriptDebugger.mm: * WebView/WebView.mm: 2008-10-28 Adele Peterson <adele@apple.com> Reviewed by John Sullivan. Fix for https://bugs.webkit.org/show_bug.cgi?id=21880 "files" string for multifile uploads needs to be localized * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory multipleFileUploadTextForNumberOfFiles:]): Added. 2008-10-28 Timothy Hatcher <timothy@apple.com> Add WebInspector methods to enable the profiler. https://bugs.webkit.org/show_bug.cgi?id=21927 <rdar://problem/6211578> Make the JavaScript profiler opt-in, so it does not slow down JavaScript all the time Reviewed by Darin Adler and Kevin McCullough. * WebInspector/WebInspector.h: * WebInspector/WebInspector.mm: (-[WebInspector isJavaScriptProfilingEnabled]): Added. Calls InspectorController::profilerEnabled. (-[WebInspector setJavaScriptProfilingEnabled:]): Added. Call InspectorController's disableProfiler or enableProfiler methods. 2008-10-27 Timothy Hatcher <timothy@apple.com> Rename a few methods related to attaching and detaching the debugger. * Rename attachDebugger to enableDebugger. * Rename detachDebugger to disableDebugger. * Rename the debuggerAttached getter to debuggerEnabled. Reviewed by Darin Adler. * WebInspector/WebInspector.mm: (-[WebInspector isDebuggingJavaScript]): (-[WebInspector startDebuggingJavaScript:]): (-[WebInspector stopDebuggingJavaScript:]): 2008-10-27 Anders Carlsson <andersca@apple.com> Reviewed by Maciej Stachowiak. Use the C++ stream object for JS requests as well. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): (-[WebBaseNetscapePluginView destroyStream:reason:]): 2008-10-27 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Use the C++ stream object in WebBaseNetscapePluginView. Use a HashSet of RefPtrs to keep track of the streams. * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::~WebNetscapePluginStream): (WebNetscapePluginStream::setPlugin): (WebNetscapePluginStream::startStream): (WebNetscapePluginStream::destroyStream): (WebNetscapePluginStream::destroyStreamWithReason): (WebNetscapePluginStream::cancelLoadAndDestroyStreamWithError): (WebNetscapePluginStream::deliverData): * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView stop]): (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): (-[WebBaseNetscapePluginView disconnectStream:]): (-[WebBaseNetscapePluginView dealloc]): (-[WebBaseNetscapePluginView pluginView:receivedResponse:]): (-[WebBaseNetscapePluginView pluginView:receivedData:]): (-[WebBaseNetscapePluginView pluginView:receivedError:]): (-[WebBaseNetscapePluginView pluginViewFinishedLoading:]): (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): 2008-10-27 Anders Carlsson <andersca@apple.com> Reviewed by Dan Bernstein. Move code from dealloc and finalize to the WebNetscapePluginStream destructor. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::~WebNetscapePluginStream): (-[WebBaseNetscapePluginStream dealloc]): (-[WebBaseNetscapePluginStream finalize]): 2008-10-27 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Get rid of WebNetscapePlugInStreamLoaderClient, the plug-in stream is its own client. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::WebNetscapePluginStream): (-[WebBaseNetscapePluginStream dealloc]): (-[WebBaseNetscapePluginStream finalize]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView pluginView:receivedError:]): (-[WebBaseNetscapePluginView pluginViewFinishedLoading:]): (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): (-[WebBaseNetscapePluginView destroyStream:reason:]): 2008-10-27 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Change the Obj-C init methods to simply call WebNetscapePluginStream::create. * Plugins/WebBaseNetscapePluginStream.h: (WebNetscapePluginStream::create): * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream initWithFrameLoader:]): (WebNetscapePluginStream::WebNetscapePluginStream): (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]): 2008-10-27 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Convert more code over to C++. * Plugins/WebBaseNetscapePluginStream.h: (WebNetscapePluginStream::plugin): (WebNetscapePluginStream::setRequestURL): Convert to C++. * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::start): (WebNetscapePluginStream::stop): Ditto. (WebNetscapePluginStream::startStreamWithResponse): Ditto. (-[WebBaseNetscapePluginStream startStreamWithResponse:]): Call the C++ version. (-[WebBaseNetscapePluginStream impl]): New accessor for the C++ class. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView pluginView:receivedData:]): (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): (-[WebBaseNetscapePluginView destroyStream:reason:]): Call the C++ methods. 2008-10-24 Sam Weinig <sam@webkit.org> Reviewed by Dan Bernstein. Fix https://bugs.webkit.org/show_bug.cgi?id=21759 Layering violation: FileChooser should not depend on Document/Frame/Page * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::runOpenPanel): 2008-10-24 Anders Carlsson <andersca@apple.com> Fix Tiger build. * WebView/WebUIDelegate.h: 2008-10-24 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. <rdar://problem/5440917> Support NPN_Construct Set construct. * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): 2008-10-24 Mark Rowe <mrowe@apple.com> Rubber-stamped by Tim Hatcher. <rdar://problem/6119711> Remove the dependency on Foundation's private __COCOA_FORMAL_PROTOCOLS__ define. * Misc/EmptyProtocolDefinitions.h: 2008-10-24 Adele Peterson <adele@apple.com> Reviewed by Sam Weinig. WebKit part of fix for <rdar://problem/5839256> FILE CONTROL: multi-file upload. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::runOpenPanel): (-[WebOpenPanelResultListener chooseFilenames:]): * WebView/WebUIDelegate.h: 2008-10-24 Timothy Hatcher <timothy@apple.com> Implement new InspectorClient methods to work with Settings. https://bugs.webkit.org/show_bug.cgi?id=21856 Reviewed by Darin Adler. * WebCoreSupport/WebInspectorClient.h: Add the new methods and guard the ObjC parts of the header. 2008-10-24 Darin Adler <darin@apple.com> - finish rolling out https://bugs.webkit.org/show_bug.cgi?id=21732 * WebView/WebFrame.mm: (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame _convertValueToObjcValue:]): (-[WebScriptCallFrame exception]): (-[WebScriptCallFrame evaluateWebScript:]): * WebView/WebView.mm: (aeDescFromJSValue): (-[WebView aeDescByEvaluatingJavaScriptFromString:]): Use JSValue* instead of JSValuePtr. 2008-10-23 Mark Rowe <mrowe@apple.com> Build fix. * Misc/WebKitErrors.m: (-[NSError _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:]): 2008-10-20 Sam Weinig <sam@webkit.org> Reviewed by Anders Carlsson. Remove FrameLoaderClient::detachedFromParent4. It is no longer used by any port. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: 2008-10-20 Alexey Proskuryakov <ap@webkit.org> Reviewed by Oliver Hunt. <rdar://problem/6277777> REGRESSION (r36954): XMLHttpRequest not working when certain WebView delegate actions are taken * WebView/WebFrame.mm: (-[WebFrame _attachScriptDebugger]): Don't accidentally create a window shell if there is none yet. 2008-10-19 Darin Adler <darin@apple.com> Reviewed by Oliver Hunt. - next step of https://bugs.webkit.org/show_bug.cgi?id=21732 improve performance by eliminating JSValue as a base class for JSCell Remove most uses of JSValue, which will be removed in a future patch. * WebView/WebFrame.mm: (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): Use JSValuePtr instead of JSValue. * WebView/WebScriptDebugger.h: Removed declaration of JSValue. 2008-10-18 Darin Adler <darin@apple.com> Reviewed by Oliver Hunt. - next step of https://bugs.webkit.org/show_bug.cgi?id=21732 improve performance by eliminating JSValue as a base class for JSCell Tweak a little more to get closer to where we can make JSValuePtr a class. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame _convertValueToObjcValue:]): Use JSValuePtr. (-[WebScriptCallFrame exception]): Ditto. (-[WebScriptCallFrame evaluateWebScript:]): Ditto. And noValue. * WebView/WebScriptDebugger.mm: (WebScriptDebugger::WebScriptDebugger): Use new DebuggerCallFrame constructor that doesn't require explicitly passing an exception. * WebView/WebView.mm: (aeDescFromJSValue): Use JSValuePtr. (-[WebView aeDescByEvaluatingJavaScriptFromString:]): Ditto. 2008-10-18 Dan Bernstein <mitz@apple.com> Reviewed by Sam Weinig. - WebKit/mac part of https://bugs.webkit.org/show_bug.cgi?id=21736 Long-dead decoded image data make up for most of the object cache's memory use over time * WebView/WebView.mm: (+[WebView _setCacheModel:]): In the primary web browser model, set the cache's dead decoded data deletion interval to 60 seconds. 2008-10-15 Mark Rowe <mrowe@apple.com> Reviewed by Jon Honeycutt. Fix a leak of a CFStringRef reported by the build bot. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): Use a autoreleased NSString rather than manually releasing a CFStringRef when we're done with it. 2008-10-15 Kenneth Russell <kenneth.russell@sun.com> Reviewed and landed by Anders Carlsson. https://bugs.webkit.org/show_bug.cgi?id=21572 Initialize pluginFunc.size to the correct size before calling NP_GetEntryPoints. * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): 2008-10-15 Mark Rowe <mrowe@apple.com> Reviewed by Dan Bernstein. <rdar://problem/6272508> Crash occurs after loading flash content at http://www.macrumors.com/ Restore some code related to the CoreGraphics drawing model that was misplaced in r37131. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView invalidateRegion:]): (-[WebBaseNetscapePluginView setVariable:value:]): 2008-10-15 Geoffrey Garen <ggaren@apple.com> Reviewed by Cameron Zwarich. Fixed https://bugs.webkit.org/show_bug.cgi?id=21345 Start the debugger without reloading the inspected page * WebInspector/WebInspector.mm: (-[WebInspector startDebuggingJavaScript:]): Updated for rename. 2008-10-14 Maxime Britto <britto@apple.com> Reviewed by Darin Adler. Added SPI to use WebCore's TextIterator with WebKit. * WebView/WebTextIterator.h: Added. * WebView/WebTextIterator.mm: Added. (-[WebTextIteratorPrivate dealloc]): (-[WebTextIterator dealloc]): (-[WebTextIterator initWithRange:]): Creates a TextIterator instance (-[WebTextIterator advance]): Asks the iterator to advance() . (-[WebTextIterator currentNode]): Returns the current DOMNode from the iterator (-[WebTextIterator currentText]): Returns the current text from the iterator (-[WebTextIterator atEnd]): Indicated whether the iterator has reached the end of the range. * WebView/WebView.h: * WebView/WebView.mm: (-[WebView textIteratorForRect:]): Returns a WebTextIterator with the DOMRange contained in the rectangle given as a parameter. 2008-10-15 Timothy Hatcher <timothy@apple.com> Clean up user agent generation to simplify the _standardUserAgentWithApplicationName: class method to not require a WebKit version. Reviewed by Darin Adler. * WebView/WebView.mm: (+[WebView _standardUserAgentWithApplicationName:]): Create the WebKit version. (-[WebView WebCore::_userAgentForURL:]): Use the simplified _standardUserAgentWithApplicationName:. Remove code that created the WebKit version. * WebView/WebViewPrivate.h: Change the method name of _standardUserAgentWithApplicationName:. 2008-10-14 Timothy Hatcher <timothy@apple.com> Make the user agent generation method a class method and cache the WebKit version in a static to prevent generating it every time. This is needed clean up to fix <rdar://problem/6292331>. Moved all code to WebPrivate so the class method can be in the WebViewPrivate.h header. Reviewed by John Sullivan. * WebView/WebView.mm: (callGestalt): Moved. Same code. (createMacOSXVersionString): Moved. Same code. (createUserVisibleWebKitVersionString): Moved from _userVisibleBundleVersionFromFullVersion: and returns a copied string. (+[WebView _standardUserAgentWithApplicationName:andWebKitVersion:]): Made into a class method. (-[WebView WebCore::_userAgentForURL:]): Changed to cache the WebKit version. * WebView/WebViewPrivate.h: Added +_standardUserAgentWithApplicationName:andWebKitVersion:. 2008-10-13 Maciej Stachowiak <mjs@apple.com> Rubber stamped by Mark Rowe. - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default * Configurations/DebugRelease.xcconfig: 2008-10-11 Dan Bernstein <mitz@apple.com> Reviewed by Sam Weinig. - rename _setAlwaysUseATSU to _setAlwaysUsesComplexTextCodePath and update it for the renamed WebCoreTextRenderer method; keep the old method around for clients that use it * WebView/WebView.mm: (+[WebView _setAlwaysUseATSU:]): (+[WebView _setAlwaysUsesComplexTextCodePath:]): * WebView/WebViewPrivate.h: 2008-10-09 Timothy Hatcher <timothy@apple.com> Don't convert JavaScriptCore header include paths to WebKit paths. This was needed back when NPAPI and WebScriptObject migrated from JavaScriptCore. Also remove JavaScriptCore from the VPATH. Reviewed by Sam Weinig. * MigrateHeaders.make: 2008-10-08 Darin Adler <darin@apple.com> Reviewed by Cameron Zwarich. - https://bugs.webkit.org/show_bug.cgi?id=21403 Bug 21403: use new CallFrame class rather than Register* for call frame manipulation * WebView/WebScriptDebugger.mm: (WebScriptDebugger::WebScriptDebugger): Update since DebuggerCallFrame is simpler now. 2008-10-08 Timothy Hatcher <timothy@apple.com> Roll out r37427 because it causes an infinite recursion loading about:blank. https://bugs.webkit.org/show_bug.cgi?id=21476 2008-10-08 Darin Adler <darin@apple.com> Reviewed by Cameron Zwarich. - https://bugs.webkit.org/show_bug.cgi?id=21403 Bug 21403: use new CallFrame class rather than Register* for call frame manipulation * WebView/WebScriptDebugger.mm: (WebScriptDebugger::WebScriptDebugger): Update since DebuggerCallFrame is simpler now. 2008-10-07 David Hyatt <hyatt@apple.com> Move viewless WebKit methods that Safari needs from WebViewInternal to WebViewPrivate. Reviewed by Tim Hatcher * WebView/WebView.mm: (WebKitInitializeApplicationCachePathIfNecessary): (-[WebView _registerDraggedTypes]): (-[WebView _usesDocumentViews]): (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): (-[WebView _initWithFrame:frameName:groupName:usesDocumentViews:]): (-[WebView isFlipped]): (-[WebView viewWillDraw]): * WebView/WebViewInternal.h: * WebView/WebViewPrivate.h: 2008-10-07 David Hyatt <hyatt@apple.com> Fix crash in isFlipped. Null check _private since isFlipped can get called from within AppKit machinery during teardown of the WebView. Reviewed by Adam Roben * WebView/WebView.mm: (-[WebView isFlipped]): 2008-10-07 David Hyatt <hyatt@apple.com> Make viewless WebKit update focused and active state when the window becomes and loses key. The focus controller has been patched to understand that in viewless mode it can recur down and update all of the frames, which is why this code works now when placed just on the WebView. Reviewed by Adam Roben * WebView/WebView.mm: (-[WebView addWindowObservers]): (-[WebView removeWindowObservers]): (-[WebView viewWillMoveToWindow:]): (-[WebView viewDidMoveToWindow]): (-[WebView _updateFocusedAndActiveState]): (-[WebView _windowDidBecomeKey:]): (-[WebView _windowDidResignKey:]): (-[WebView _windowWillOrderOnScreen:]): 2008-10-07 David Hyatt <hyatt@apple.com> Make sure the parent visibility state is set up properly on the outermost ScrollView widget. This fixes the repainting issues with viewless WebKit on Mac. Reviewed by Sam Weinig * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::transitionToCommittedForNewPage): 2008-10-07 David Hyatt <hyatt@apple.com> Make sure viewless Mac WebKit does a layout if needed before drawing. Reviewed by Sam Weinig * WebView/WebView.mm: (-[WebView viewWillDraw]): 2008-10-07 David Hyatt <hyatt@apple.com> Make sure observers get hooked up to watch for size changes in viewless WebKit mode. Reviewed by Sam Weinig * ChangeLog: * WebView/WebFrame.mm: (-[WebFrame _drawRect:contentsOnly:]): * WebView/WebView.mm: (-[WebView viewWillDraw]): (-[WebView _boundsChanged]): (-[WebView addSizeObservers]): (-[WebView viewDidMoveToWindow]): (-[WebView viewDidMoveToSuperview]): 2008-10-07 David Hyatt <hyatt@apple.com> Make sure WebView listens for size changes and resizes the frame view in viewless mode. Reviewed by Sam Weinig * WebView/WebView.mm: (-[WebView addSizeObservers]): (-[WebView viewDidMoveToWindow]): (-[WebView viewDidMoveToSuperview]): 2008-10-06 David Hyatt <hyatt@apple.com> Enable viewless Mac WebKit to paint some basic pages. Reviewed by Sam Weinig * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::windowResizerRect): (WebChromeClient::repaint): (WebChromeClient::screenToWindow): (WebChromeClient::windowToScreen): (WebChromeClient::platformWindow): * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::forceLayoutForNonHTML): (WebFrameLoaderClient::dispatchDidCommitLoad): (WebFrameLoaderClient::transitionToCommittedForNewPage): (WebFrameLoaderClient::createFrame): * WebView/WebFrame.mm: (-[WebFrame _drawRect:contentsOnly:]): * WebView/WebFrameInternal.h: * WebView/WebFrameView.mm: * WebView/WebFrameViewInternal.h: * WebView/WebHTMLView.mm: (-[WebHTMLView drawSingleRect:]): (-[WebHTMLView drawRect:]): * WebView/WebView.mm: (-[WebView isFlipped]): (-[WebView _boundsChanged]): (-[WebView _mustDrawUnionedRect:singleRects:count:]): (-[WebView drawSingleRect:]): (-[WebView drawRect:]): (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): (-[WebView initWithFrame:frameName:groupName:]): (-[WebView _initWithFrame:frameName:groupName:usesDocumentViews:]): (-[WebView initWithCoder:]): (-[WebView removeSizeObservers]): (-[WebView viewWillMoveToWindow:]): (-[WebView viewWillMoveToSuperview:]): (-[WebView _usesDocumentViews]): * WebView/WebViewInternal.h: 2008-10-06 Kevin Decker <kdecker@apple.com> Rubber-stamped by Anders Carlsson. Rename _webkit_applicationCacheDirectoryWithBundleIdentifier to _webkit_localCacheDirectoryWithBundleIdentifier. * Misc/WebKitNSStringExtras.h: * Misc/WebKitNSStringExtras.m: (+[NSString _webkit_localCacheDirectoryWithBundleIdentifier:]): * WebView/WebDataSource.mm: (-[WebDataSource _transferApplicationCache:]): * WebView/WebView.mm: (WebKitInitializeApplicationCachePathIfNecessary): 2008-10-06 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Make WebNetscapePluginStream a WebCore::NetscapePlugInStreamLoaderClient. * Plugins/WebBaseNetscapePluginStream.h: (WebNetscapePluginStream::~WebNetscapePluginStream): * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::didReceiveResponse): (-[WebBaseNetscapePluginStream startStreamWithResponse:]): (WebNetscapePluginStream::wantsAllStreams): (-[WebBaseNetscapePluginStream wantsAllStreams]): (WebNetscapePluginStream::didFail): (-[WebBaseNetscapePluginStream destroyStreamWithError:]): (WebNetscapePluginStream::didFinishLoading): (-[WebBaseNetscapePluginStream finishedLoading]): (WebNetscapePluginStream::didReceiveData): (-[WebBaseNetscapePluginStream receivedData:]): 2008-10-06 Anders Carlsson <andersca@apple.com> Bring back the stop method. It was called through performSelector, which is why I couldn't find any references to it. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream stop]): 2008-10-06 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. More conversion and cleanup. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::startStream): (-[WebBaseNetscapePluginStream startStreamWithResponse:]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): 2008-10-06 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Fold initWithRequestURL into initWithRequest. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]): 2008-10-06 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. Change the init methods not to return nil on failures. (These failures never occur anyway) Use initWithRequest as the initializer, initWithRequestURL is going to be merged with it. * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]): (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): 2008-10-06 Anders Carlsson <andersca@apple.com> Reviewed by David Hyatt. Convert more methods over to C++. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::ownerForStream): (WebNetscapePluginStream::pluginCancelledConnectionError): (WebNetscapePluginStream::errorForReason): (-[WebBaseNetscapePluginStream errorForReason:]): (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]): (WebNetscapePluginStream::cancelLoadAndDestroyStreamWithError): (-[WebBaseNetscapePluginStream cancelLoadAndDestroyStreamWithError:]): (WebNetscapePluginStream::deliverData): (WebNetscapePluginStream::deliverDataTimerFired): (WebNetscapePluginStream::deliverDataToFile): (-[WebBaseNetscapePluginStream finishedLoading]): (-[WebBaseNetscapePluginStream receivedData:]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView destroyStream:reason:]): 2008-10-06 David Hyatt <hyatt@apple.com> Add SPI for a new viewless WebKit mode. The idea is that when this flag is set there will be no views created except for the outermost WebView. Reviewed by Tim Hatcher * WebView/WebView.mm: * WebView/WebViewInternal.h: 2008-10-06 Anders Carlsson <andersca@apple.com> Reviewed by David Hyatt. Convert more methods over to C++. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::reasonForError): (WebNetscapePluginStream::destroyStreamWithReason): (WebNetscapePluginStream::cancelLoadWithError): (-[WebBaseNetscapePluginStream cancelLoadWithError:]): (WebNetscapePluginStream::destroyStreamWithError): (-[WebBaseNetscapePluginStream destroyStreamWithError:]): (-[WebBaseNetscapePluginStream cancelLoadAndDestroyStreamWithError:]): (-[WebBaseNetscapePluginStream _deliverDataToFile:]): (-[WebBaseNetscapePluginStream finishedLoading]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithError:]): 2008-10-04 Darin Adler <darin@apple.com> Reviewed by Cameron Zwarich. - https://bugs.webkit.org/show_bug.cgi?id=21295 Bug 21295: Replace ExecState with a call frame Register pointer * WebView/WebScriptDebugger.mm: (WebScriptDebugger::WebScriptDebugger): Remove 0 passed for ExecState. 2008-10-03 John Sullivan <sullivan@apple.com> Fixed Release build * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::destroyStream): added !LOG_DISABLED guard around declaration of npErr used only in LOG 2008-10-03 Anders Carlsson <andersca@apple.com> Reviewed by David Hyatt. Convert destroyStream over to C++. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (WebNetscapePluginStream::destroyStream): (-[WebBaseNetscapePluginStream _destroyStreamWithReason:]): (-[WebBaseNetscapePluginStream _deliverData]): 2008-10-03 Anders Carlsson <andersca@apple.com> Reviewed by David Hyatt. Use a Timer instead of -[NSObject performSelector:withObject:afterDelay]; * Plugins/WebBaseNetscapePluginStream.h: (WebNetscapePluginStream::WebNetscapePluginStream): * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream _destroyStream]): (-[WebBaseNetscapePluginStream _deliverData]): (WebNetscapePluginStream::deliverDataTimerFired): 2008-10-03 Anders Carlsson <andersca@apple.com> Reviewed by David Hyatt. More plug-in stream cleanup. * Plugins/WebBaseNetscapePluginStream.h: (WebNetscapePluginStream::create): (WebNetscapePluginStream::WebNetscapePluginStream): * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream initWithFrameLoader:]): (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]): (-[WebBaseNetscapePluginStream dealloc]): (-[WebBaseNetscapePluginStream finalize]): (-[WebBaseNetscapePluginStream setPlugin:]): (WebNetscapePluginStream::setPlugin): (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]): (-[WebBaseNetscapePluginStream _destroyStream]): 2008-10-03 David Hyatt <hyatt@apple.com> Remove addToDirtyRegion. Reviewed by Oliver Hunt * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: 2008-10-02 David Hyatt <hyatt@apple.com> https://bugs.webkit.org/show_bug.cgi?id=21328 Make widget invalidation more cross-platform. (1) Make invalidateRect a pure virtual function on Widget. All leaf widgets must now implement this function. (2) Scrollbars now send invalidations through the ScrollbarClient. windowClipRect on ScrollbarClient has been removed and replaced with this invalidation call. This allows all scrollbar invalidations to go through the render tree so that transforms and reflections will be respected. (3) Plugins now have the native window invalidation code for windowed plugins. Windowless plugins do a repaintRectangle on the plugin's renderer. (4) FrameViews now do a repaintRectangle on their owner element's renderer. Reviewed by Sam Weinig * WebCoreSupport/WebFrameLoaderClient.mm: (PluginWidget::PluginWidget): (PluginWidget::invalidateRect): (NetscapePluginWidget::NetscapePluginWidget): (WebFrameLoaderClient::createPlugin): 2008-10-02 Darin Adler <darin@apple.com> Reviewed by Geoff Garen. - https://bugs.webkit.org/show_bug.cgi?id=21321 Bug 21321: speed up JavaScriptCore by inlining Heap in JSGlobalData * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptObjectsCount]): Use heap. instead of heap-> to work with the heap. (+[WebCoreStatistics javaScriptGlobalObjectsCount]): Ditto. (+[WebCoreStatistics javaScriptProtectedObjectsCount]): Ditto. (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]): Ditto. (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): Ditto. (+[WebCoreStatistics javaScriptReferencedObjectsCount]): Ditto. 2008-10-02 David Hyatt <hyatt@apple.com> https://bugs.webkit.org/show_bug.cgi?id=21314 Make scrollBackingStore cross-platform. Reviewed by Sam Weinig * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::repaint): (WebChromeClient::scroll): 2008-10-01 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler and Cameron Zwarich. Updated for JavaScriptCore API changes: use a SourceCode instead of broken out parameters; treat sourceId as intptr_t. We still treat sourceId as int in some cases because of DashCode. See <rdar://problem/6263293> WebScriptDebugDelegate should use intptr_t for sourceId, not int. * WebView/WebScriptDebugger.h: * WebView/WebScriptDebugger.mm: (toNSString): (WebScriptDebugger::sourceParsed): (WebScriptDebugger::callEvent): (WebScriptDebugger::atStatement): (WebScriptDebugger::returnEvent): (WebScriptDebugger::exception): (WebScriptDebugger::willExecuteProgram): (WebScriptDebugger::didExecuteProgram): (WebScriptDebugger::didReachBreakpoint): 2008-10-01 David Hyatt <hyatt@apple.com> Move prohibitsScrolling from the Frame to the ScrollView. Reviewed by Sam Weinig * WebView/WebView.mm: (-[WebView setProhibitsMainFrameScrolling:]): 2008-10-01 David Hyatt <hyatt@apple.com> https://bugs.webkit.org/show_bug.cgi?id=21282 Make contentsToScreen/screenToContents cross-platform. Only implemented by Mac/Win right now. Reviewed by Adam Roben * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::repaint): (WebChromeClient::screenToWindow): (WebChromeClient::windowToScreen): 2008-09-30 Dave Hyatt <hyatt@apple.com> https://bugs.webkit.org/show_bug.cgi?id=21269 This patch makes the ScrollView::paint method cross-platform. The paint method calls the base class Widget paint on platforms with native widgets (Mac and wx). Otherwise it calls a virtual function, paintContents, to paint the ScrollView's contents, and then it paints each of the two scrollbars and the scrollbar corner. The scrollbar themes are now responsible for painting scrollbar corners. At the moment ScrollbarThemeWin still paints white (which is incorrect), so a future patch will actually implement proper native scroll corner painting for Windows. paintContents is implemented by FrameView, and replaces Frame::paint. All of the FramePrivate member variables used by Frame::paint have moved to FrameViewPrivate instead. All callers of Frame::paint have been patched to use FrameView::paintContents instead. Reviewed by Darin Adler * WebView/WebFrame.mm: (-[WebFrame _drawRect:]): 2008-09-30 Kevin Decker <kdecker@apple.com> Reviewed by Anders Carlsson. Remove the NPDrawingModelOpenGL entirely. To my knowledge no shipping plug-in ever used it, and no other browser engine ever supported it. * Plugins/WebBaseNetscapePluginView.h: Removed AGL.h import and OpenGL related ivars. * Plugins/WebBaseNetscapePluginView.mm: Removed soft linking for OpenGL and AGL frameworks. Also removed many methods AGL/CGL support methods that are no longer necessary. (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): Removed NPDrawingModelOpenGL related code. (-[WebBaseNetscapePluginView restorePortState:]): Ditto. (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): Ditto. (-[WebBaseNetscapePluginView isNewWindowEqualToOldWindow]): Ditto. (-[WebBaseNetscapePluginView setWindowIfNecessary]): Ditto. (-[WebBaseNetscapePluginView stop]): Ditto. (-[WebBaseNetscapePluginView dealloc]): Ditto. (-[WebBaseNetscapePluginView drawRect:]): (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): Ditto. (-[WebBaseNetscapePluginView invalidateRegion:]): Ditto. (-[WebBaseNetscapePluginView getVariable:value:]): Tell plug-ins WebKit does not support NPDrawingModelOpenGL. (-[WebBaseNetscapePluginView setVariable:value:]): Removed NPDrawingModelOpenGL related code. (-[WebBaseNetscapePluginView _viewHasMoved]): Ditto. 2008-09-30 Dave Hyatt <hyatt@apple.com> http://bugs.webkit.org/show_bug.cgi?id=21250 Rename updateContents to repaintContentRectangle and make it cross-platform by always sending repaints up through the ChromeClient. Reviewed by Darin Adler * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::repaint): 2008-09-30 Anders Carlsson <andersca@apple.com> Reviewed by Mark Rowe and Adam Roben. No need to use pointers to store C++ objects as pointers in WebViewPrivate, we can just store them directly. * Configurations/Base.xcconfig: Set GCC_OBJC_CALL_CXX_CDTORS to YES. * WebView/WebView.mm: (-[WebViewPrivate init]): (-[WebViewPrivate dealloc]): (-[WebViewPrivate finalize]): (-[WebView _preferencesChangedNotification:]): (-[WebView setApplicationNameForUserAgent:]): (-[WebView setCustomUserAgent:]): (-[WebView customUserAgent]): (-[WebView WebCore::_userAgentForURL:WebCore::]): (-[WebView _addObject:forIdentifier:]): (-[WebView _objectForIdentifier:]): (-[WebView _removeObjectForIdentifier:]): 2008-09-29 Thiago Macieira <thiago.macieira@nokia.com> Reviewed by Simon. Changed copyright from Trolltech ASA to Nokia. Nokia acquired Trolltech ASA, assets were transferred on September 26th 2008. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: 2008-09-28 Timothy Hatcher <timothy@apple.com> Improves the Web Inspector node highlight so it does not scroll to reveal the node in the page. This makes the highlight less invasive and causes less things to change on screen. Also makes the highlight redraw when the WebView draws, so it stays current if the node changes on the page for any reason. <rdar://problem/6115804> Don't scroll when highlighting (21000) https://bugs.webkit.org/show_bug.cgi?id=21000 Reviewed by Dan Bernstein. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController highlightNode:]): Call setNeedsDisplay:YES if there is an existing highlight. (-[WebInspectorWindowController didAttachWebNodeHighlight:]): Set the current highlight node on the inspected WebView. (-[WebInspectorWindowController willDetachWebNodeHighlight:]): Set the current highlight node on the inspected WebView to nil. * WebInspector/WebNodeHighlight.m: (-[WebNodeHighlight setNeedsUpdateInTargetViewRect:]): Disable screen updates until flush for the inspected window. Invalidate the whole highlight view since we don't know the rect that needs updated since the highlight can be larger than the highlighted element due to the margins and other factors. * WebInspector/WebNodeHighlightView.m: * WebView/WebHTMLView.mm: (-[WebHTMLView drawSingleRect:]): Call setNeedsUpdateInTargetViewRect: on the current highlight node. * WebView/WebView.mm: (-[WebViewPrivate dealloc]): Release the current highlight node. (-[WebView setCurrentNodeHighlight:]): Set the current highlight node. (-[WebView currentNodeHighlight]): Return the current highlight node. * WebView/WebViewInternal.h: 2008-09-28 David Kilzer <ddkilzer@apple.com> Fix build warning in WebDefaultUIDelegate.m Reviewed by Dan Bernstein. This fixes a warning noticed by the clang static analyzer: .../WebDefaultUIDelegate.m: In function ‘-[WebDefaultUIDelegate webViewFirstResponder:]’: .../WebDefaultUIDelegate.m:92: warning: initialization from distinct Objective-C type Note that this doesn't actually cause any change in behavior since the gcc compiler ignores the semi-colon anyway. * DefaultDelegates/WebDefaultUIDelegate.m: (-[WebDefaultUIDelegate webViewFirstResponder:]): Removed semi-colon from method signature. 2008-09-27 David Hyatt <hyatt@apple.com> Fix for https://bugs.webkit.org/show_bug.cgi?id=21182 Make sure Mac null checks the view like the other platforms do now that Mac goes through WebCore to call setAllowsScrolling. Reviewed by Mark Rowe * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createFrame): 2008-09-27 Anders Carlsson <andersca@apple.com> Reviewed by Sam Weinig. https://bugs.webkit.org/show_bug.cgi?id=21178 <rdar://problem/6248651> Check if the plug-in is allowed to load the resource. This matches Firefox. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): 2008-09-26 Matt Lilek <webkit@mattlilek.com> Reviewed by Tim Hatcher. Update FEATURE_DEFINES after ENABLE_CROSS_DOCUMENT_MESSAGING was removed. * Configurations/WebKit.xcconfig: 2008-09-26 David Hyatt <hyatt@apple.com> https://bugs.webkit.org/show_bug.cgi?id=21164 Rework concept of allowsScrolling/setAllowsScrolling to be cross-platform. Reviewed by Sam Weinig * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createFrame): * WebView/WebDynamicScrollBarsView.h: * WebView/WebDynamicScrollBarsView.m: * WebView/WebDynamicScrollBarsViewInternal.h: * WebView/WebFrameView.mm: (-[WebFrameView setAllowsScrolling:]): (-[WebFrameView allowsScrolling]): 2008-09-26 David Hyatt <hyatt@apple.com> https://bugs.webkit.org/show_bug.cgi?id=21149 More refactoring to make scrollbar modes cross-platform. Reduce the protocol that WebDynamicScrollBarsView has to implement for communicating with WebCore to just three methods. Reviewed by Sam Weinig * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView scrollingModes:WebCore::vertical:WebCore::]): (-[WebDynamicScrollBarsView setHorizontalScrollingMode:andLock:]): (-[WebDynamicScrollBarsView setVerticalScrollingMode:andLock:]): (-[WebDynamicScrollBarsView setScrollingModes:vertical:andLock:]): * WebView/WebDynamicScrollBarsViewInternal.h: * WebView/WebFrameView.mm: (-[WebFrameView setAllowsScrolling:]): * WebView/WebView.mm: (-[WebView setAlwaysShowVerticalScroller:]): (-[WebView setAlwaysShowHorizontalScroller:]): 2008-09-26 David Kilzer <ddkilzer@apple.com> Fix Mac build with XSLT disabled Reviewed by Alexey. * Misc/WebCache.mm: (+[WebCache statistics]): Populate xslStyleSheet statistics with zeros if XSLT is disabled. 2008-09-25 David Hyatt <hyatt@apple.com> https://bugs.webkit.org/show_bug.cgi?id=21101 Fix the updating of the active state to not be dumb, so that viewless scrollbars repaint properly. Reviewed by Tim Hatcher * WebView/WebHTMLView.mm: (-[WebHTMLView _updateFocusedAndActiveState]): 2008-09-24 Darin Adler <darin@apple.com> Reviewed by Dan Bernstein. - https://bugs.webkit.org/show_bug.cgi?id=21079 <rdar://problem/6203938> Disallow embedding Safari-generated pages (e.g bookmarks collection) in subframes * DefaultDelegates/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]): Use the new +[WebView _canHandleRequest:forMainFrame:] so we can give a different answer for the main frame and subframes. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::canHandleRequest): Ditto. * WebView/WebView.mm: (+[WebView _canHandleRequest:forMainFrame:]): Added forMainFrame. Only look for scheme-specific representations for the main frame, not subframes. (+[WebView _canHandleRequest:]): Give answer for main frame -- calls the method above with YES for main frame. * WebView/WebViewInternal.h: Added _canHandleRequest:forMainFrame:. 2008-09-23 David Hyatt <hyatt@apple.com> https://bugs.webkit.org/show_bug.cgi?id=21039 Teach the viewless Mac scrollbar how to avoid the NSWindow resizer. Reviewed by Sam Weinig * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::windowResizerRect): 2008-09-23 Dan Bernstein <mitz@apple.com> Reviewed by Beth Dakin. - fix <rdar://problem/6233388> Crash beneath -[WebFrameView keyDown:] Test: fast/events/keydown-remove-frame.html * WebView/WebFrameView.mm: (-[WebFrameView keyDown:]): Added a null check. 2008-09-21 Dirk Schulze <vbs85@gmx.de> Reviewed and landed by Eric Seidel. Moved CGFloat definition to WebKitPrefix so CGFloat can be used more freely throughout WebCore without worrying about breaking Tiger. * Misc/WebTypesInternal.h: Removed it from here. * WebKitPrefix.h: Added it here. 2008-09-20 Matt Lilek <webkit@mattlilek.com> Reviewed by Tim Hatcher. Revert r35688. We use a textured window on Leopard, which does not have the square corners of the standard Aqua window on Tiger. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController window]): Add back the call to WKNSWindowMakeBottomCornersSquare. 2008-09-19 Darin Adler <darin@apple.com> Reviewed by Dan Bernstein. - speculative fix for https://bugs.webkit.org/show_bug.cgi?id=20943 Assertion failure in RefCountedLeakCounter::cancelMessageSuppression() when closing a window * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Moved call to RefCountedLeakCounter::suppressMessages in here. (-[WebView initWithFrame:frameName:groupName:]): Moved it out of here. 2008-09-18 Mark Rowe <mrowe@apple.com> Reviewed by Dan Bernstein. Add SPI to WebView to allow DRT to clear the main frame's name between tests. * WebView/WebView.mm: (-[WebView _clearMainFrameName]): * WebView/WebViewPrivate.h: 2008-09-18 Darin Adler <darin@apple.com> Reviewed by Sam Weinig. - fix https://bugs.webkit.org/show_bug.cgi?id=20925 LEAK messages appear every time I quit * WebView/WebPreferences.mm: (-[WebPreferences setFullDocumentTeardownEnabled:]): Removed unneeded call to setLogLeakMessages. * WebView/WebView.mm: (-[WebView _closeWithFastTeardown]): Call RefCountedLeakCounter::suppressMessages, telling it that we can't track leaks because at least one WebView was closed with fast teardown. (-[WebView _close]): Removed unneeded call to setLogLeakMessages. Added a call to cancelMessageSuppression since the WebView is no longer open. Added an explicit garbage collect to help with the case where we're closing during the quit process -- the garbageCollectSoon() calls done inside WebCore won't help us in that case. (-[WebView initWithFrame:frameName:groupName:]): Call RefCountedLeakCounter::suppressMessages telling it that we can't track leaks because at least one WebView is currently open. 2008-09-18 Anders Carlsson <andersca@apple.com> Reviewed by Adam Roben. Move the remainder of the stream ivars to the C++ object. * Plugins/WebBaseNetscapePluginStream.h: (WebNetscapePluginStream::WebNetscapePluginStream): * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream _pluginCancelledConnectionError]): (-[WebBaseNetscapePluginStream initWithFrameLoader:]): (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]): (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]): (-[WebBaseNetscapePluginStream dealloc]): (-[WebBaseNetscapePluginStream finalize]): (-[WebBaseNetscapePluginStream setPlugin:]): (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]): (-[WebBaseNetscapePluginStream start]): (-[WebBaseNetscapePluginStream stop]): (-[WebBaseNetscapePluginStream wantsAllStreams]): (-[WebBaseNetscapePluginStream _destroyStream]): (-[WebBaseNetscapePluginStream _destroyStreamWithReason:]): (-[WebBaseNetscapePluginStream cancelLoadWithError:]): (-[WebBaseNetscapePluginStream _deliverData]): 2008-09-17 David Hyatt <hyatt@apple.com> Make the notion of Widget having an underlying native widget cross-platform. Reviewed by Sam Weinig * WebCoreSupport/WebFrameLoaderClient.mm: (NetscapePluginWidget::handleEvent): * WebView/WebFrame.mm: (-[WebFrame _dragSourceMovedTo:]): (-[WebFrame _dragSourceEndedAt:operation:]): * WebView/WebFrameView.mm: (-[WebFrameView _install]): * WebView/WebRenderNode.mm: (copyRenderNode): 2008-09-16 Anders Carlsson <andersca@apple.com> Reviewed by Cameron Zwarich. Move more instance variables down to the C++ class. * Plugins/WebBaseNetscapePluginStream.h: (WebNetscapePluginStream::WebNetscapePluginStream): * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]): (-[WebBaseNetscapePluginStream dealloc]): (-[WebBaseNetscapePluginStream finalize]): (-[WebBaseNetscapePluginStream transferMode]): (-[WebBaseNetscapePluginStream plugin]): (-[WebBaseNetscapePluginStream setPlugin:]): (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]): (-[WebBaseNetscapePluginStream wantsAllStreams]): (-[WebBaseNetscapePluginStream _destroyStream]): (-[WebBaseNetscapePluginStream _destroyStreamWithReason:]): (-[WebBaseNetscapePluginStream _deliverData]): (-[WebBaseNetscapePluginStream _deliverDataToFile:]): (-[WebBaseNetscapePluginStream finishedLoading]): (-[WebBaseNetscapePluginStream receivedData:]): 2008-09-16 Anders Carlsson <andersca@apple.com> Reviewed by Dave Hyatt. Move a bunch of instance variables into the C++ class. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream _pluginCancelledConnectionError]): (-[WebBaseNetscapePluginStream errorForReason:]): (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]): (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]): (-[WebBaseNetscapePluginStream dealloc]): (-[WebBaseNetscapePluginStream setRequestURL:]): (-[WebBaseNetscapePluginStream setResponseURL:]): (-[WebBaseNetscapePluginStream setMIMEType:]): (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]): (-[WebBaseNetscapePluginStream _destroyStream]): (-[WebBaseNetscapePluginStream _destroyStreamWithReason:]): (-[WebBaseNetscapePluginStream _deliverData]): (-[WebBaseNetscapePluginStream receivedData:]): 2008-09-16 Anders Carlsson <andersca@apple.com> Reviewed by Dave Hyatt. Add a new WebNetscapePluginStream C++ class. The idea is that it is supposed to replace the Obj-C WebBaseNetscapePluginStream class. The plan is to gradually move/rewrite code from the Obj-C class to the C++ class until the C++ class can replace the Obj-C class. * Plugins/WebBaseNetscapePluginStream.h: (WebNetscapePluginStream::create): (WebNetscapePluginStream::WebNetscapePluginStream): * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream initWithFrameLoader:]): (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]): (-[WebBaseNetscapePluginStream dealloc]): (-[WebBaseNetscapePluginStream finalize]): 2008-09-16 Anders Carlsson <andersca@apple.com> Reviewed by Dave Hyatt. Instead of storing a pointer to NPP method individually, just store a pointer to the NPNetscapeFuncs vtable. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream setPlugin:]): (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]): (-[WebBaseNetscapePluginStream wantsAllStreams]): (-[WebBaseNetscapePluginStream _destroyStream]): (-[WebBaseNetscapePluginStream _deliverData]): * Plugins/WebNetscapePluginPackage.h: * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage pluginFuncs]): 2008-09-16 Anders Carlsson <andersca@apple.com> Reviewed by Dave Hyatt. Remove references to WebNetscapePluginStream. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebNetscapePluginEmbeddedView.h: 2008-09-15 Dan Bernstein <mitz@apple.com> Reviewed by Dave Hyatt. - fix https://bugs.webkit.org/show_bug.cgi?id=20860 REGRESSION: Crash in RenderLayer::hasVisibleContent() loading wavy.com * WebView/WebFrame.mm: (-[WebFrame _getVisibleRect:]): Changed to check if the RenderPart has layout before accessing it, instead of checking if the frame inside it has layout. 2008-09-15 Chris Fleizach <cfleizach@apple.com> Reviewed by Darin Adler, Beth Dakin Support strings for AXLists * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory AXDefinitionListTermText]): (-[WebViewFactory AXDefinitionListDefinitionText]): 2008-09-15 Anders Carlsson <andersca@apple.com> Reviewed by Mitz. Merge WebNetscapePluginStream into WebBaseNetscapePluginStream. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream initWithFrameLoader:]): (-[WebBaseNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]): (-[WebBaseNetscapePluginStream dealloc]): (-[WebBaseNetscapePluginStream finalize]): (-[WebBaseNetscapePluginStream start]): (-[WebBaseNetscapePluginStream stop]): (-[WebBaseNetscapePluginStream cancelLoadWithError:]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView pluginView:receivedResponse:]): (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): * Plugins/WebNetscapePluginEmbeddedView.mm: * Plugins/WebNetscapePluginStream.h: Removed. * Plugins/WebNetscapePluginStream.mm: Removed. 2008-09-12 John Sullivan <sullivan@apple.com> Fixed <rdar://problem/6110941> Clicking the print button in PDF content does nothing Reviewed by Darin Adler * WebView/WebPDFView.mm: (-[WebPDFView PDFViewPerformPrint:]): Implemented PDFKit delegate method that's called after a Print action in the PDF content 2008-09-12 Dan Bernstein <mitz@apple.com> Reviewed by John Sullivan. - fix a crash in -visibleRect when it is called during WebFrameView deallocation * WebView/WebFrameView.mm: (-[WebFrameView visibleRect]): Added an early return if _private is 0. 2008-09-11 Dan Bernstein <mitz@apple.com> Reviewed by John Sullivan. - eliminate excessive repainting when a clipped iframe is moved (noticed in <rdar://problem/6204032>) * WebView/WebFrame.mm: (-[WebFrame _getVisibleRect:]): Added. If the frame is in a RenderPart and has layout, gets the visible rect of the RenderPart and returns YES. Returns NO otherwise. * WebView/WebFrameInternal.h: * WebView/WebFrameView.mm: (-[WebFrameView visibleRect]): Added. Overrides this NSView method to take clipping in the render tree into account. 2008-09-09 Dan Bernstein <mitz@apple.com> - Tiger build fix * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2008-09-09 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - WebKit part of <rdar://problem/6206244> Use alternate character-to-glyph interface on Leopard * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca> Reviewed by Maciej Stachowiak. Bug 20704: Replace the KJS namespace <https://bugs.webkit.org/show_bug.cgi?id=20704> Rename the KJS namespace to JSC. * Misc/WebCoreStatistics.mm: * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream wantsAllStreams]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): (-[WebBaseNetscapePluginView setWindowIfNecessary]): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView createPluginScriptableObject]): (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]): (-[WebBaseNetscapePluginView loadPluginRequest:]): (-[WebBaseNetscapePluginView _printedPluginBitmap]): * Plugins/WebPluginController.mm: (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]): (-[WebPluginController startAllPlugins]): (-[WebPluginController stopAllPlugins]): (-[WebPluginController addPlugin:]): (-[WebPluginController destroyPlugin:]): (-[WebPluginController destroyAllPlugins]): * WebView/WebFrame.mm: * WebView/WebScriptDebugDelegate.mm: * WebView/WebScriptDebugger.h: * WebView/WebScriptDebugger.mm: * WebView/WebView.mm: (-[WebViewPrivate init]): 2008-09-05 Timothy Hatcher <timothy@apple.com> Correct a typo in the setApplicationChromeModeEnabledEnabled: method name, remove the extra "Enabled". * WebView/WebPreferences.mm: * WebView/WebPreferencesPrivate.h: 2008-09-04 Mark Rowe <mrowe@apple.com> Reviewed by Eric Seidel. Fix https://bugs.webkit.org/show_bug.cgi?id=20639. Bug 20639: ENABLE_DASHBOARD_SUPPORT does not need to be a FEATURE_DEFINE * Configurations/WebKit.xcconfig: Remove ENABLE_DASHBOARD_SUPPORT from FEATURE_DEFINES. 2008-09-03 Eric Seidel <eric@webkit.org> Reviewed by Sam. Clean up Platform.h and add PLATFORM(CHROMIUM), PLATFORM(SKIA) and USE(V8_BINDINGS) * Configurations/WebKit.xcconfig: * WebKitPrefix.h: add rules for V8_BINDINGS 2008-09-01 Adam Barth <abarth@webkit.org> Reviewed by Sam Weinig. https://bugs.webkit.org/show_bug.cgi?id=19760 Add a linked-on-or-after check to prevent substitute data from loading local resources on newer users of WebKit. * Misc/WebKitVersionChecks.h: * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): 2008-08-29 Brady Eidson <beidson@apple.com> Reviewed by Anders Fix regression I introducted in 35946 Already covered by media/video-click-dlbclick-standalone.html * WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation receivedData:withDataSource:]): Cancel the load here after calling [WebFrame _receivedData:] which more closely follows the path taken by PluginDocuments 2008-08-28 Kevin McCullough <kmccullough@apple.com> Reviewed by Geoff. <rdar://problem/6095949> REGRESSION (5525.8-6527.1?): "this" is null when you first hit a breakpoint in Dashcode - We wanted to reset the callframe whenever eval() was called but dashcode uses eval() when broken to evaluate the state of the current call frame. * WebView/WebScriptDebugger.mm: (WebScriptDebugger::willExecuteProgram): (WebScriptDebugger::didExecuteProgram): 2008-08-27 Robert Kroeger <rjkroege@liqui.org> Tweaked by Sam Weinig. Reviewed by Eric Seidel. Fix https://bugs.webkit.org/show_bug.cgi?id=6595 <rdar://problem/4432150> Right-click does not fire mouseup event Adds a rightMouseUp handler to the WebHTMLView. The added method generates mouseup events for button 2. The result is that webkit will deliver mousedown and mouseup events for button 2 in a fashion identical to FireFox and will retain event ordering identical to Internet Explorer. Test: fast/events/mouseup-from-button2.html * WebView/WebHTMLView.mm: (-[WebHTMLView rightMouseUp:]): 2008-08-27 Timothy Hatcher <timothy@apple.com> Add support for support for -webkit-appearance: default-button on the Mac platform. <rdar://problem/6173530> Reviewed by Dave Hyatt. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Init AdvanceDefaultButtonPulseAnimation. * WebView/WebPreferenceKeysPrivate.h: Added WebKitApplicationChromeModeEnabledPreferenceKey. * WebView/WebPreferences.mm: (+[WebPreferences initialize]): Set WebKitApplicationChromeModeEnabledPreferenceKey to NO. (-[WebPreferences applicationChromeModeEnabled]): Added. (-[WebPreferences setApplicationChromeModeEnabledEnabled:]): Added. * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Call Settings::setApplicationChromeMode with the value of -[WebPreferences applicationChromeModeEnabled]. 2008-08-27 Brady Eidson <beidson@apple.com> Reviewed by Anders <rdar://problem/6134133> - Crash when loading large movie as a standalone document * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::pluginWillHandleLoadError): 2008-08-20 Dan Bernstein <mitz@apple.com> Rubber-stamped by John Sullivan. - rename shouldUpdateWhileHidden to shouldUpdateWhileOffscreen, rename related methods and variables accordingly, and make -setShouldUpdateWhileOffscreen: and -shouldUpdateWhileOffscreen WebView API. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::transitionToCommittedForNewPage): * WebView/WebFrame.mm: (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]): * WebView/WebFrameInternal.h: * WebView/WebHTMLView.mm: (-[WebHTMLView windowWillOrderOnScreen:]): * WebView/WebView.h: * WebView/WebView.mm: (-[WebViewPrivate init]): (-[WebView setBackgroundColor:]): (-[WebView setDrawsBackground:]): (-[WebView setShouldUpdateWhileOffscreen:]): (-[WebView shouldUpdateWhileOffscreen]): * WebView/WebViewPrivate.h: 2008-08-18 Mark Rowe <mrowe@apple.com> Reviewed by Darin Adler. Switch to non-deprecated NSFileManager API. In order to minimize #if's the new NSFileManager APIs have been implemented for Tiger and call sites updated to use the new methods. * Misc/WebIconDatabase.mm: (importToWebCoreFormat): * Misc/WebKitNSStringExtras.m: (-[NSString _webkit_fixedCarbonPOSIXPath]): * Misc/WebKitSystemBits.m: * Misc/WebNSFileManagerExtras.h: * Misc/WebNSFileManagerExtras.m: Remove implementations of methods that are not used. (-[NSFileManager _webkit_backgroundRemoveFileAtPath:]): (-[NSFileManager attributesOfFileSystemForPath:error:]): Implement new API for Tiger in terms of Tiger API. (-[NSFileManager contentsOfDirectoryAtPath:error:]): Ditto. (-[NSFileManager moveItemAtPath:toPath:error:]): Ditto. (-[NSFileManager removeItemAtPath:error:]): Ditto. * Plugins/WebPluginDatabase.mm: (-[WebPluginDatabase _scanForNewPlugins]): 2008-08-20 Josh Aas <joshmoz@gmail.com> Reviewed and landed by Anders. <rdar://problem/6163636> rename NPCocoaEvent's "event" struct to "data" (20446) * Plugins/WebNetscapePluginEventHandlerCocoa.mm: (WebNetscapePluginEventHandlerCocoa::drawRect): (WebNetscapePluginEventHandlerCocoa::sendMouseEvent): (WebNetscapePluginEventHandlerCocoa::flagsChanged): (WebNetscapePluginEventHandlerCocoa::sendKeyEvent): (WebNetscapePluginEventHandlerCocoa::windowFocusChanged): (WebNetscapePluginEventHandlerCocoa::focusChanged): 2008-08-20 Beth Dakin <bdakin@apple.com> Reviewed by Darin Adler. Fix for <rdar://problem/6145626> Allows a WebKit client to mark a frame as not-text-searchable through SPI. * WebView/WebFrame.mm: (-[WebFrame _setExcludeFromTextSearch:]): * WebView/WebFramePrivate.h: 2008-08-19 Alexey Proskuryakov <ap@webkit.org> Reviewed by Geoff Garen. Bring back shared JSGlobalData and implicit locking, because too many clients rely on it. * ForwardingHeaders/runtime/JSLock.h: Added. * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptObjectsCount]): (+[WebCoreStatistics javaScriptGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectsCount]): (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics shouldPrintExceptions]): (+[WebCoreStatistics setShouldPrintExceptions:]): (+[WebCoreStatistics javaScriptReferencedObjectsCount]): * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream wantsAllStreams]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): (-[WebBaseNetscapePluginView setWindowIfNecessary]): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView createPluginScriptableObject]): (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]): (-[WebBaseNetscapePluginView loadPluginRequest:]): (-[WebBaseNetscapePluginView _printedPluginBitmap]): * Plugins/WebPluginController.mm: (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]): (-[WebPluginController startAllPlugins]): (-[WebPluginController stopAllPlugins]): (-[WebPluginController addPlugin:]): (-[WebPluginController destroyPlugin:]): (-[WebPluginController destroyAllPlugins]): * WebView/WebFrame.mm: (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame evaluateWebScript:]): * WebView/WebView.mm: (-[WebView aeDescByEvaluatingJavaScriptFromString:]): 2008-08-19 Timothy Hatcher <timothy@apple.com> Fixes the Web Inspector flashing white while resizing after highlighting a page element. Calling disableScreenUpdatesUntilFlush when attaching and detaching the Inspector page highlight is bad, since the browser window might not flush again for a while. So screen updates could be disabled for long periods of time, causing backing store flashing while resizing. There is no need to call disableScreenUpdatesUntilFlush when attaching or detaching the child window. Reviewed by John Sullivan and Kevin McCullough. * WebInspector/WebNodeHighlight.m: (-[WebNodeHighlight attach]): Remove the call to disableScreenUpdatesUntilFlush. (-[WebNodeHighlight detach]): Ditto. 2008-08-19 Timothy Hatcher <timothy@apple.com> Correctly remembers the attached state of the Web Inspector so it opens in that state for the next window, or next launch. Reviewed by Kevin McCullough. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController attach]): Set WebKitInspectorAttachedKey to YES in the user defaults. (-[WebInspectorWindowController detach]): Set WebKitInspectorAttachedKey to NO in the user defaults. 2008-08-18 Alexey Proskuryakov <ap@webkit.org> Reviewed by Dan Bernstein. https://bugs.webkit.org/show_bug.cgi?id=19347 <rdar://problem/5977562> Input methods do not work after switching to a password field and back. Fix <rdar://problem/5522011> (The content of the password field of Safari is displayed by reconversion) in a different way which doesn't conflict with context caching performed by AppKit. This original bug does not really occur in ToT or shipping Safari under Mac OS X 10.5.4, because input methods are disabled in password fields. Attempting to reconvert text typed with Romaji only yields a string of bullets. Still, it is probably better to match Cocoa password field behavior and disable reconversion completely. * WebView/WebHTMLView.mm: (isInPasswordField): Factored out code to determine that the current selection is in a password field. (inputContext): Removed a hack that was breaking TSMGetActiveDocument(). (-[WebHTMLView attributedSubstringFromRange:]): Check for password fields. (-[WebHTMLView textStorage]): Ditto. 2008-08-12 Darin Adler <darin@apple.com> Reviewed by Geoff. - eliminate JSValue::type() * WebView/WebView.mm: (aeDescFromJSValue): Rewrite to use the JSValue::is functions instead of a switch on JSValue::type(). 2008-08-17 Geoffrey Garen <ggaren@apple.com> Reviewed by Cameron Zwarich. Made room for a free word in JSCell. (Updated for JavaScriptCore changes.) 2008-08-15 Mark Rowe <mrowe@apple.com> Rubber-stamped by Geoff Garen. <rdar://problem/6139914> Please include a _debug version of JavaScriptCore framework * Configurations/Base.xcconfig: Factor out the debug-only settings so that they can shared between the Debug configuration and debug Production variant. 2008-08-14 Sam Weinig <sam@webkit.org> Reviewed by Geoffrey Garen and Timothy Hatcher. Add WebView SPI to set HTMLTokenizer yielding parameters. * WebView/WebView.mm: (-[WebView _setCustomHTMLTokenizerTimeDelay:]): (-[WebView _setCustomHTMLTokenizerChunkSize:]): * WebView/WebViewPrivate.h: 2008-08-13 Timothy Hatcher <timothy@apple.com> Fixes a bug where Safari's find banner would be permanently hidden when attaching or closing the Web Inspector while attached. https://bugs.webkit.org/show_bug.cgi?id=20376 Reviewed by Kevin McCullough. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController close]): Carefully manipulate the WebFrameView's frame when closing to not assume the WebFrameView's frame fills the inspected WebView. (-[WebInspectorWindowController setAttachedWindowHeight:]): Carefully manipulate the WebFrameView's frame when docking to not assume the WebFrameView plus the Web Inspector WebViews fills the full inspected WebView. 2008-08-13 Stephanie Lewis <slewis@apple.com> fix 64bit build * WebCoreSupport/WebInspectorClient.mm: 2008-08-13 Timothy Hatcher <timothy@apple.com> Remember the docked state of the Web Inspector, so it can be reopened docked if it was last docked. https://bugs.webkit.org/show_bug.cgi?id=14271 Reviewed by Kevin McCullough. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController init]): Initialize _shouldAttach to the value stored in the user defaults. If there has never been a value stored, default to being attached. (-[WebInspectorWindowController showWindow:]): Pass the attached state to InspectorController::setWindowVisible. 2008-08-12 Timothy Hatcher <timothy@apple.com> Remove the Inspector's WebView for the view hierarchy when closed while attached. This prevents it from showing in the background while the page changes. Reviewed by Kevin McCullough. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController close:]): Call removeFromSuperview on the Inspector's WebView if it isn't attached, so it will not be visible when navigating pages while closed. 2008-08-12 Timothy Hatcher <timothy@apple.com> Make the docked Web Inspector resizable. https://bugs.webkit.org/show_bug.cgi?id=14282 Reviewed by Kevin McCullough. * WebCoreSupport/WebInspectorClient.h: * WebCoreSupport/WebInspectorClient.mm: (WebInspectorClient::setAttachedWindowHeight): Call setAttachedWindowHeight: on the WebInspectorWindowController. (-[WebInspectorWindowController showWindow:]): Call setAttachedWindowHeight:. (-[WebInspectorWindowController setAttachedWindowHeight:]): Moved code from showWindow: and generalized to allow being called multiple times. Remembers the last height passed, which is used by showWindow: the next time the Inspector attaches. 2008-08-12 Timothy Hatcher <timothy@apple.com> Remove unneeded header imports from some Web Inspector files. Reviewed by Adam Roben. * WebCoreSupport/WebInspectorClient.mm: * WebInspector/WebInspector.mm: * WebInspector/WebNodeHighlightView.m: 2008-08-12 Timothy Hatcher <timothy@apple.com> Remove the call to WKNSWindowMakeBottomCornersSquare on the Web Inspector's window. This isn't needed anymore since the window style masks used always have square bottom corners. Reviewed by Adam Roben. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController window]): Remove the call to WKNSWindowMakeBottomCornersSquare. 2008-08-12 Timothy Hatcher <timothy@apple.com> Make attaching and detaching the Web Inspector instantaneous. This also preserves the current view, other state, and keeps the script debugger attached. https://bugs.webkit.org/show_bug.cgi?id=19301 Reviewed by Adam Roben. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController close]): Only call setWindowVisible(false) when not moving windows. 2008-08-12 Dan Bernstein <mitz@apple.com> Reviewed by John Sullivan. - replace -[WebPreferences updatesWhenOffscreen] with -[WebView shouldUpdateWhileHidden] * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::transitionToCommittedForNewPage): * WebView/WebFrame.mm: (-[WebFrame _updateBackgroundAndUpdatesWhileHidden]): * WebView/WebFrameInternal.h: * WebView/WebHTMLView.mm: (-[WebHTMLView windowWillOrderOnScreen:]): * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebViewPrivate init]): (-[WebView _preferencesChangedNotification:]): (-[WebView setBackgroundColor:]): (-[WebView setDrawsBackground:]): (-[WebView shouldUpdateWhileHidden]): (-[WebView setShouldUpdateWhileHidden:]): * WebView/WebViewPrivate.h: 2008-08-08 Dan Bernstein <mitz@apple.com> Reviewed by John Sullivan. - fix <rdar://problem/6130216> Exception "windowRegionBeingDrawn != nil" in NSView when caching image of a subframe This change reintroduces <https://bugs.webkit.org/show_bug.cgi?id=5195> on Leopard. * WebView/WebHTMLView.mm: (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:topView:]): Removed an unsuccessful workaround for <rdar://problem/5668489>, because invoking layout may change the view hierarchy during the drawing operation, which is not supported on Leopard. 2008-08-08 Maxime Britto <britto@apple.com> Reviewed by Adele. * WebView/WebFrame.mm: (-[WebFrame _scrollDOMRangeToVisible:]): 2008-08-08 Brady Eidson <beidson@apple.com> Reviewed by Sam Weinig Fix for <rdar://problem/5865504> This bug was actually *largely* fixed by http://trac.webkit.org/changeset/35538. But with that same patch, it became possible for a WebResource to fail to initialize. Therefore we were trying to add nil to an NSCFArray for certain situations, which is bad. Lets fix that, shall we? * WebView/WebArchive.mm: (-[WebArchive subresources]): 2008-08-06 Eric Seidel <eric@webkit.org> Reviewed by Cameron Zwarich. Move more methods from Frame into ScriptController https://bugs.webkit.org/show_bug.cgi?id=20294 The WebKit side of this move. Calls to frame() are now frame()->script() * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView getVariable:value:]): (-[WebBaseNetscapePluginView _destroyPlugin]): * Plugins/WebPluginController.mm: (-[WebPluginController destroyPlugin:]): (-[WebPluginController destroyAllPlugins]): * WebCoreSupport/WebFrameLoaderClient.mm: * WebView/WebFrame.mm: (-[WebFrame windowObject]): * WebView/WebScriptDebugger.mm: (WebScriptDebugger::callEvent): * WebView/WebView.mm: (-[WebView windowScriptObject]): 2008-08-06 Dan Bernstein <mitz@apple.com> Reviewed by Mark Rowe. - fix an assertion failure in Cache::setCapacities() * Misc/WebKitSystemBits.h: Changed the return type of WebMemorySize() to uint64_t. * Misc/WebKitSystemBits.m: (WebMemorySize): * WebView/WebView.mm: (+[WebView _setCacheModel:]): 2008-08-05 Anders Carlsson <andersca@apple.com> Pass in the correct class here. * WebView/WebResource.mm: (-[WebResourcePrivate dealloc]): 2008-08-05 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. <rdar://problem/6037398> ER: Deallocate WebKit objects on the main thread, even if released on secondary thread Add calls to WebCoreObjCScheduleDeallocateOnMainThread in dealloc methods of objects we expose. * Carbon/CarbonWindowAdapter.m: (-[CarbonWindowAdapter dealloc]): * History/WebBackForwardList.mm: (-[WebBackForwardList dealloc]): * History/WebHistoryItem.mm: (-[WebHistoryItem dealloc]): * Misc/WebElementDictionary.mm: (+[WebElementDictionary initialize]): (-[WebElementDictionary dealloc]): * WebCoreSupport/WebEditorClient.mm: (-[WebEditCommand dealloc]): * WebCoreSupport/WebFrameLoaderClient.mm: * WebView/WebArchive.mm: (-[WebArchivePrivate dealloc]): * WebView/WebDataSource.mm: (-[WebDataSourcePrivate dealloc]): * WebView/WebHTMLView.mm: (-[WebHTMLViewPrivate dealloc]): (-[WebHTMLView dealloc]): * WebView/WebResource.mm: (-[WebResourcePrivate dealloc]): 2008-08-05 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Remove MainThreadObjectDeallocator.{h|mm}. * WebView/MainThreadObjectDeallocator.h: Removed. * WebView/MainThreadObjectDeallocator.mm: Removed. * WebView/WebView.mm: (-[WebView dealloc]): Call WebCoreObjCScheduleDeallocateOnMainThread instead. 2008-08-05 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Make the main thread object deallocator work with subclasses. * WebView/MainThreadObjectDeallocator.h: * WebView/MainThreadObjectDeallocator.mm: (deallocCallback): Call the correct dealloc method. (scheduleDeallocateOnMainThread): Store both the class and the instance, so we know which dealloc method to call. * WebView/WebView.mm: (-[WebViewPrivate dealloc]): Schedule deallocation on the main thread. 2008-08-05 Dan Bernstein <mitz@apple.com> Reviewed by Mark Rowe and Anders Carlsson. - fix WebMemorySize() reporting a value capped at 2GB * misc/WebKitSystemBits.m: (WebMemorySize): Changed to return the max_mem field, which, unlike memory_size, is not capped at 2GB. * WebView/WebView.mm: (+[WebView _setCacheModel:]): Made the cache sizes for over 2GB RAM the same as for 2GB, so that behavior on machines that have more than 2GB RAM is not affected by the fix to WebMemorySize(). 2008-08-04 Mark Rowe <mrowe@apple.com> Build fix. * WebView/WebHTMLView.mm: 2008-08-04 Mark Rowe <mrowe@apple.com> Reviewed by Kevin Decker. Adopt the formal protocols where necessary. Final part of fix for <rdar://problem/5853147>. * WebCoreSupport/WebInspectorClient.mm: * WebView/WebHTMLView.mm: * WebView/WebView.mm: (-[WebView _openFrameInNewWindowFromMenu:]): 2008-08-04 Mark Rowe <mrowe@apple.com> Reviewed by Darin Adler. Declare empty protocols when using versions of AppKit that do not use formal protocols for delegates and data sources. Part one of fix for <rdar://problem/5853147>. * Misc/EmptyProtocolDefinitions.h: * WebKitPrefix.h: 2008-08-04 Brady Eidson <beidson@apple.com> Reviewed by Mitz Pettel Fix <rdar://problem/5820157> - Saving WebArchives of Mail attachments broken. This broke in r31355 when we stopped returning nil WebResources when there was nil resource data. * WebView/WebResource.mm: (-[WebResource _initWithCoreResource:]): Restore previous behavior of returning nil when the resource data is null. 2008-08-02 Matt Lilek <webkit@mattlilek.com> Reviewed by Tim Hatcher. Update the window gradient offset to match the inspector toolbar's new height. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController window]): 2008-08-01 Anders Carlsson <andersca@apple.com> Reviewed by Jon. <rdar://problem/6120206> Crash when plug-in queries for NPPVpluginWantsAllNetworkStreams. Pass in a pointer to a void* to make sure that plug-ins don't overwrite the stack. * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream wantsAllStreams]): 2008-07-31 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. <rdar://problem/5949410> Add the ability to transfer a given application cache to a new database. * Misc/WebKitNSStringExtras.h: * Misc/WebKitNSStringExtras.m: (+[NSString _webkit_applicationCacheDirectoryWithBundleIdentifier:]): New method which returns the appopriate cache directory for a given bundle identifier. * WebView/WebDataSource.mm: (-[WebDataSource _transferApplicationCache:]): Transfer the application cache. * WebView/WebDataSourcePrivate.h: * WebView/WebView.mm: (WebKitInitializeApplicationCachePathIfNecessary): Change this to use _webkit_applicationCacheDirectoryWithBundleIdentifier. 2008-07-31 John Sullivan <sullivan@apple.com> WebKit part of <rdar://problem/6116650> Text-only zoom setting should be stored in WebKit prefs Reviewed by Hyatt * WebView/WebPreferenceKeysPrivate.h: added WebKitZoomsTextOnlyPreferenceKey * WebView/WebPreferences.mm: (+[WebPreferences initialize]): default value of YES for WebKitZoomsTextOnlyPreferenceKey (-[WebPreferences zoomsTextOnly]): getter for WebKitZoomsTextOnlyPreferenceKey (-[WebPreferences setZoomsTextOnly:]): setter for WebKitZoomsTextOnlyPreferenceKey * WebView/WebPreferencesPrivate.h: declare zoomsTextOnly/setZoomsTextOnly: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): update WebCore::Settings value for zoomsTextOnly 2008-07-31 David D. Kilzer <ddkilzer@webkit.org> Fix layout test results for webarchive/test-xml-stylesheet.xml Reviewed by Darin Adler. Needed to expose -[WebHTMLRepresentation supportedNonImageMIMETypes] for DumpRenderTree. * WebView/WebHTMLRepresentationInternal.h: Added. 2008-07-31 Alexey Proskuryakov <ap@webkit.org> Release build fix. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView setWindowIfNecessary]): Don't define to npErr in release builds, as it is only used for logging. 2008-07-31 John Sullivan <sullivan@apple.com> Fixed <https://bugs.webkit.org/show_bug.cgi?id=5195> drawing with cacheDisplayInRect:toBitmapImageRep: doesn't trigger layout on Leopard Reviewed by Dan * WebView/WebHTMLView.mm: (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:topView:]): include Leopard in the #ifdef that forces a layout if needed 2008-07-30 Brady Eidson <beidson@apple.com> Reviewed by Adam and Hyatt Fix for <rdar://problem/6099748> * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Set the "don't enforce CSS mime type in strict mode" quirk when running under iWeb 2 2008-07-31 Alexey Proskuryakov <ap@webkit.org> Rubber-stamped by Maciej. Eliminate JSLock (it was already disabled, removing the stub implementaion and all call sites now). * ForwardingHeaders/runtime/JSLock.h: Removed. * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptObjectsCount]): (+[WebCoreStatistics javaScriptGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectsCount]): (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics shouldPrintExceptions]): (+[WebCoreStatistics setShouldPrintExceptions:]): (+[WebCoreStatistics javaScriptReferencedObjectsCount]): * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream wantsAllStreams]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): (-[WebBaseNetscapePluginView setWindowIfNecessary]): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView createPluginScriptableObject]): (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]): (-[WebBaseNetscapePluginView loadPluginRequest:]): (-[WebBaseNetscapePluginView _printedPluginBitmap]): * Plugins/WebPluginController.mm: (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]): (-[WebPluginController startAllPlugins]): (-[WebPluginController stopAllPlugins]): (-[WebPluginController addPlugin:]): (-[WebPluginController destroyPlugin:]): (-[WebPluginController destroyAllPlugins]): * WebView/WebFrame.mm: (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame evaluateWebScript:]): * WebView/WebView.mm: (-[WebView aeDescByEvaluatingJavaScriptFromString:]): 2008-07-30 Beth Dakin <bdakin@apple.com> Reviewed by Anders Carlsson. Fixes <rdar://problem/6041390> Adds the ability to have a frame that is "disconnected" from the main frame from the perspective of top and parent in Javascript. * WebView/WebFrame.mm: (-[WebFrame _setIsDisconnectedFrame]): * WebView/WebFramePrivate.h: 2008-07-29 Mark Rowe <mrowe@apple.com> Tweak to the build fix to keep Dan happy. * Plugins/WebBaseNetscapePluginView.mm: * WebView/WebHTMLView.mm: 2008-07-29 Mark Rowe <mrowe@apple.com> Build fix. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView inputContext]): * WebView/WebHTMLView.mm: 2008-07-28 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. Based on a patch by Dimcho Balev. https://bugs.webkit.org/show_bug.cgi?id=18676 <rdar://problem/6106578> Plug-In API Proposal: Enable plugins to receive response body when an HTTP error occurs * Plugins/WebBaseNetscapePluginStream.h: Add NPP_GetValue pointer. * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream setPlugin:]): Initialize NPP_GetValue. (-[WebBaseNetscapePluginStream wantsAllStreams]): Call NPP_GetValue. * Plugins/WebPlugInStreamLoaderDelegate.h: * WebCoreSupport/WebNetscapePlugInStreamLoaderClient.h: * WebCoreSupport/WebNetscapePlugInStreamLoaderClient.mm: (WebNetscapePlugInStreamLoaderClient::wantsAllStreams): Implement this and call down to the stream. 2008-07-28 Anders Carlsson <andersca@apple.com> Reviewed by Adam. <rdar://problem/6105529> https://bugs.webkit.org/show_bug.cgi?id=19659 Turning off plugins causes crash When an active page has plug-ins, and plug-ins are disabled, they will be stopped and will end up in a state where they don't have an event handler. Because of this, we need to check that the plug-in has been started before calling the event handler. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView sendActivateEvent:]): (-[WebBaseNetscapePluginView sendDrawRectEvent:]): (-[WebBaseNetscapePluginView setHasFocus:]): (-[WebBaseNetscapePluginView mouseDown:]): (-[WebBaseNetscapePluginView mouseUp:]): (-[WebBaseNetscapePluginView mouseEntered:]): (-[WebBaseNetscapePluginView mouseExited:]): (-[WebBaseNetscapePluginView handleMouseMoved:]): (-[WebBaseNetscapePluginView mouseDragged:]): (-[WebBaseNetscapePluginView scrollWheel:]): (-[WebBaseNetscapePluginView keyUp:]): (-[WebBaseNetscapePluginView keyDown:]): (-[WebBaseNetscapePluginView flagsChanged:]): (-[WebBaseNetscapePluginView cut:]): (-[WebBaseNetscapePluginView copy:]): (-[WebBaseNetscapePluginView paste:]): (-[WebBaseNetscapePluginView selectAll:]): (-[WebBaseNetscapePluginView drawRect:]): (-[WebBaseNetscapePluginView inputContext]): 2008-07-26 Daniel Jalkut <jalkut@red-sweater.com> Reviewed by Geoff Garen. Changes to accommodate newly named/signatured loading methods in WebCore. * Plugins/WebNetscapePluginStream.mm: (-[WebNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]): * Plugins/WebPluginContainerCheck.mm: (-[WebPluginContainerCheck _isForbiddenFileLoad]): * WebView/WebPDFView.mm: (-[WebPDFView PDFViewWillClickOnLink:withURL:]): 2008-07-21 Mark Rowe <mrowe@apple.com> Reviewed by Sam Weinig. <rdar://problem/6091287> Revamp the handling of CFBundleShortVersionString to be fixed at the major component of the version number. * Configurations/Version.xcconfig: * Info.plist: 2008-07-21 Anders Carlsson <andersca@apple.com> Reviewed by Geoff. <rdar://problem/5820667> CrashTracer: [USER] 3759 crashes in Safari at FrameLoader::activeDocumentLoader const + 6 while canceling plug-in load Don't allow URLs to be loaded in response to an NPP_DestroyStream that happens when tearing down the plug-in. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): 2008-07-21 Mark Rowe <mrowe@apple.com> Reviewed by Adam Roben. <rdar://problem/5624143> WebView printing doesn't work correctly in x86_64 Fix the return type of an NSView method that we override so that the correct data type is used in 64-bit. This prevents a garbage value being used for the scale factor that the NSView print machinery applies. * WebView/WebHTMLView.mm: 2008-07-21 Mark Rowe <mrowe@apple.com> Reviewed by Adam Roben. Fix CallDelegateReturningFloat for x86_64. The x86_64 Objective-C runtime only uses objc_msgSend_fpret for long double return values. For float return values the standard objc_msgSend is used, as on ppc and ppc64. * WebView/WebView.mm: Use objc_msgSend_float_return as the name of our version of objc_msgSend with the correct return type. We can no longer call it objc_msgSend_fpret as that method is defined by the Objective-C runtime for x86_64. (CallDelegateReturningFloat): 2008-07-14 Dan Bernstein <mitz@apple.com> Reviewed by John Sullivan. - WebKit part of fixing <rdar://problem/6071850> Subviews not drawn correctly when using -cacheDisplayInRect:toBitmapImageRep: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): Changed to account for the case of being drawn into a bitmap context that is not a window's backing store. In that case, there are no valid "rects being drawn" to clip to. * WebView/WebHTMLView.mm: (-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:topView:]): Added an override of this NSView method which is used in for -cacheDisplayInRect:toBitmapImageRep:. Like two existing NSView drawing machinery overrides, it sets subviews aside before invoking the superclass implementation. On Tiger, it also updates the layout. 2008-07-14 Alexey Proskuryakov <ap@webkit.org> Reviewed by Geoff Garen. Eliminate per-thread JavaScript global data instance support and make arbitrary global data/global object combinations possible. * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptObjectsCount]): (+[WebCoreStatistics javaScriptGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectsCount]): (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics javaScriptReferencedObjectsCount]): Ask WebCore for its instance of JSGlobalData, now that it is not in per-thread storage. 2008-07-11 Stephanie Lewis <slewis@apple.com> Reviewed by Darin Adler. Disable WTF leak messages when using fast teardown. Use full document teardown while running in debug. * WebView/WebPreferences.m: Removed. * WebView/WebPreferences.mm: Copied from http:/svn.webkit.org/repository/webkit/trunk/WebKit/mac/WebView/WebPreferences.m. (+[WebPreferences initialize]): if running in Default enable full document teardown (-[WebPreferences editableLinkBehavior]): (-[WebPreferences setFullDocumentTeardownEnabled:]): * WebView/WebView.mm: (-[WebView _close]): disable leak messages if using fast teardown 2008-07-10 Mark Rowe <mrowe@apple.com> Reviewed by Sam Weinig. Define WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST when building WebKit to ensure that no symbols end up with the weak_import attribute. * Configurations/WebKit.xcconfig: 2008-07-10 Mark Rowe <mrowe@apple.com> Reviewed by Sam Weinig. Fix the Tiger build by omitting annotations from methods declared in categories when using old versions of GCC. * Plugins/WebPlugin.h: Wrap annotations on methods declared in categories in the WEBKIT_CATEGORY_METHOD_ANNOTATION macro. * WebView/WebFrameLoadDelegate.h: Ditto. * WebView/WebUIDelegate.h: Ditto. 2008-07-10 Anders Carlsson <andersca@apple.com> Reviewed by Mark. Add availability macros for the new WebPlugin methods. * Plugins/WebPlugin.h: * Plugins/WebPluginViewFactory.h: 2008-07-09 Mark Rowe <mrowe@apple.com> Reviewed by Geoff Garen. Don't warn about deprecated functions in production builds. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: 2008-07-09 Brady Eidson <beidson@apple.com> Reviewed by Darin <rdar://problem/5823684> - Crash manipulating frame tree of a new frame before the new frame has been installed in a frame tree. The root of this problem was that calling init() on a new frame could end up calling arbitrary javascript that might end up removing the frame from the tree. This opened up a small can of worms such as the frame not having yet been installed in its frame tree, and other assumed behavior while destroying the frame. Note that each platforms WebKit API layer needs to make this new guarantee: "The new Frame must be installed in its FrameTree before newCoreFrame->init() is called" I am fixing Mac, and Windows and GTK already have this property. Wx currently has subframes disabled but will need to add this guarantee when re-enabling, and Qt is currently vulnerable to this same bug. Alternately, the way frames are created right now is roundabout and asinine, and this is a key architectural improvement we can make in the future so the individual platform clients are no longer vulnerable to this problem, which should really have been a WebCore issue. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createFrame): Don't bother null checking the newCoreFrame - can't be NULL. Don't appendChild() the new frame here. Null-check the new frame's page before loading the URL into it, as it might already have been removed from the page. * WebView/WebFrame.mm: (+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]): If there is an ownerElement, go ahead and install the new frame in the frame tree *before* calling init() on it. 2008-07-09 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Make some WebPlugin and WebPluginFactory SPI public. * Plugins/WebPlugin.h: * Plugins/WebPluginPrivate.h: * Plugins/WebPluginViewFactory.h: * Plugins/WebPluginViewFactoryPrivate.h: 2008-07-08 Jon Honeycutt <jhoneycutt@apple.com> Reviewed by Anders. Port r34988 to Mac: don't call NPP_DestroyStream if NPP_NewStream was unsuccessful. * Plugins/WebBaseNetscapePluginStream.h: Added new member, newStreamSuccessful. * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]): Initialize new member. (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]): If NPP_NewStream is successful, set newStreamSuccessful to YES. (-[WebBaseNetscapePluginStream _destroyStream]): Only call NPP_DestroyStream if newStreamSuccessful is true. 2008-07-08 Dan Bernstein <mitz@apple.com> Reviewed by John Sullivan. - WebKit part of <rdar://problem/6008409> Need a way to disable updates in offscreen views * WebView/WebHTMLView.mm: (-[WebHTMLView addWindowObservers]): Added code to observe when the window goes onscreen. (-[WebHTMLView removeWindowObservers]): Added. (-[WebHTMLView windowWillOrderOnScreen:]): Added. If the view is set to not update when offscreen, calls -setNeedsDisplay: just before it comes onscreen. * WebView/WebPreferenceKeysPrivate.h: Added preference key. * WebView/WebPreferences.m: (+[WebPreferences initialize]): Made updates when offscreen on by default. (-[WebPreferences updatesWhenOffscreen]): Added. (-[WebPreferences setUpdatesWhenOffscreen:]): Added. * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Added code to update the updatesWhenOffscreen setting in WebCore. 2008-07-07 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Speculative fix for <rdar://problem/5839800> CrashTracer: [USER] 5802 crashes in Safari at com.apple.WebKit: -[WebHTMLView(WebPrivate) _updateMouseoverWithFakeEvent] + 389 Set _private->closed to YES before calling -[WebPluginController destroyAllPlugins]. My theory is that the plug-in destruction callbacks could end up rescheduling timers or re-adding notifications. This is usually protected by _private->closed, but in this case it might still be false. * WebView/WebHTMLView.mm: (-[WebHTMLView close]): 2008-07-05 Mark Rowe <mrowe@apple.com> Reviewed by John Sullivan. Remove WebSearchableTextView as it has been unused for some time now. * Misc/WebSearchableTextView.h: Removed. * Misc/WebSearchableTextView.m: Removed. 2008-07-05 Mark Rowe <mrowe@apple.com> Reviewed by John Sullivan. Don't leak the result of WKCopyCFLocalizationPreferredName when running under GC. * Misc/WebNSUserDefaultsExtras.m: (-[NSString _webkit_HTTPStyleLanguageCode]): 2008-07-02 Alexey Proskuryakov <ap@webkit.org> Inspired and reviewed by Mark Rowe. Change non-API includes from JavaScriptCore/ to kjs/ and wtf/ to match prevalent style. * Carbon/HIViewAdapter.m: * DOM/WebDOMOperations.mm: * DefaultDelegates/WebDefaultContextMenuDelegate.mm: * DefaultDelegates/WebDefaultPolicyDelegate.m: * History/WebBackForwardList.mm: * History/WebHistory.mm: * History/WebHistoryItem.mm: * History/WebHistoryItemInternal.h: * Misc/WebCoreStatistics.mm: * Misc/WebDownload.m: * Misc/WebGraphicsExtras.c: * Misc/WebKitLogging.h: * Misc/WebKitSystemBits.m: * Misc/WebLocalizableStrings.m: * Misc/WebNSArrayExtras.m: * Misc/WebNSDataExtras.m: * Misc/WebNSDictionaryExtras.m: * Misc/WebNSFileManagerExtras.m: * Misc/WebNSPasteboardExtras.mm: * Misc/WebNSURLExtras.mm: * Misc/WebNSUserDefaultsExtras.m: * Panels/WebAuthenticationPanel.m: * Panels/WebPanelAuthenticationHandler.m: * Plugins/WebBaseNetscapePluginView.mm: * Plugins/WebBasePluginPackage.m: * Plugins/WebNetscapePluginEmbeddedView.mm: * Plugins/WebPluginContainerCheck.mm: * Plugins/WebPluginController.mm: * Plugins/WebPluginDatabase.mm: * WebCoreSupport/WebJavaScriptTextInputPanel.m: * WebCoreSupport/WebKeyGenerator.m: * WebCoreSupport/WebViewFactory.mm: * WebKitPrefix.h: * WebView/WebHTMLRepresentation.mm: * WebView/WebPDFRepresentation.m: * WebView/WebPDFView.mm: * WebView/WebScriptDebugger.mm: 2008-07-01 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. Disable JSLock for per-thread contexts. * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptObjectsCount]): (+[WebCoreStatistics javaScriptGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectsCount]): (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics shouldPrintExceptions]): (+[WebCoreStatistics setShouldPrintExceptions:]): (+[WebCoreStatistics javaScriptReferencedObjectsCount]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): (-[WebBaseNetscapePluginView setWindowIfNecessary]): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView createPluginScriptableObject]): (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]): (-[WebBaseNetscapePluginView loadPluginRequest:]): (-[WebBaseNetscapePluginView _printedPluginBitmap]): * Plugins/WebPluginController.mm: (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]): (-[WebPluginController startAllPlugins]): (-[WebPluginController stopAllPlugins]): (-[WebPluginController addPlugin:]): (-[WebPluginController destroyPlugin:]): (-[WebPluginController destroyAllPlugins]): * WebView/WebFrame.mm: (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame evaluateWebScript:]): * WebView/WebView.mm: (-[WebView aeDescByEvaluatingJavaScriptFromString:]): Pass a parameter (always false) to JSLock and JSLock::DropAllLocks to indicate that WebKit doesn't need locking. In the future, it may be possible to remove some of these if we establish that this won't make JSC assertions fail (and that we don't want to add such assertions either). Added includes that are now needed. 2008-07-01 Kevin McCullough <kmccullough@apple.com> Build fix. * WebView/WebView.mm: 2008-07-01 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Use the PluginMainThreadScheduler, and implement NPN_PluginThreadAsyncCall. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView _createPlugin]): Register the plug-in instance. (-[WebBaseNetscapePluginView _destroyPlugin]): Unegister the plug-in instance. * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): Set NPN_PluginThreadAsyncCall. * Plugins/npapi.mm: (NPN_PluginThreadAsyncCall): Implement this. 2008-07-01 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - WebKit part of moving the method to set the base writing direction from Frame to Editor * WebView/WebHTMLView.mm: (-[WebHTMLView toggleBaseWritingDirection:]): Changed back to call the Editor method. (-[WebHTMLView changeBaseWritingDirection:]): Ditto. (-[WebHTMLView _changeBaseWritingDirectionTo:]): Ditto. 2008-07-01 Geoffrey Garen <ggaren@apple.com> Build fix: forgot to check in this file. * WebView/WebScriptDebugger.mm: (WebScriptDebugger::WebScriptDebugger): 2008-06-30 Dan Bernstein <mitz@apple.com> Reviewed by Adele Peterson. - WebKit/mac part of <rdar://problem/3881497> Writing direction context menu item has no effect on text typed in Safari * WebView/WebHTMLView.mm: (-[WebHTMLView toggleBaseWritingDirection:]): Changed to call WebCore::Frame::setSelectionBaseWritingDirection() instead of WebCore::Editor::setBaseWritingDirection(). (-[WebHTMLView changeBaseWritingDirection:]): Ditto. (-[WebHTMLView _changeBaseWritingDirectionTo:]): Ditto. 2008-06-28 Darin Adler <darin@apple.com> - fix build * WebView/WebView.mm: (aeDescFromJSValue): Use get instead of getItem, which no longer exists. 2008-06-26 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Add a new MainThreadObjectDeallocator which can schedule dealloc calls on the main thread if necessary. Use this for the WebView class. * WebView/MainThreadObjectDeallocator.h: Added. * WebView/MainThreadObjectDeallocator.mm: Added. (deallocCallback): (scheduleDeallocateOnMainThread): * WebView/WebView.mm: (-[WebViewPrivate dealloc]): (+[WebView initialize]): 2008-06-25 Anders Carlsson <andersca@apple.com> Reviewed by Mark. <rdar://problem/5984270> REGRESSION (Tiger only) : Mail crashes because message load is being processed on a secondary thread * WebView/WebView.mm: (tigerMailReleaseIMP): New method that makes sure that the final release happens on the main thread. (-[WebView release]): New method that just calls [super release]; (+[WebView initialize]): When running under Tiger mail, replace the release method with tigerMailReleaseIMP. 2008-06-19 Alexey Proskuryakov <ap@webkit.org> Reviewed by Geoff. Make Machine per-JSGlobalData. * WebView/WebScriptDebugger.mm: (WebScriptDebugger::WebScriptDebugger): 2008-06-17 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. Prepare JavaScript heap for being per-thread. * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptObjectsCount]): (+[WebCoreStatistics javaScriptGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectsCount]): (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics javaScriptReferencedObjectsCount]): Use JSGlobalData::threadInstance()->heap instead of static Collector calls. 2008-06-17 Darin Adler <darin@apple.com> Reviewed by Sam. * WebView/WebHTMLView.mm: (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): Use create instead of new to create a CSSMutableStyleDeclaration. 2008-06-16 Mark Rowe <mrowe@apple.com> Reviewed by Darin Adler. <rdar://problem/5951874> WebHTMLHighlighter mistakenly gained two new methods, causing compile warnings _pauseNullEventsForAllNetscapePlugins and _resumeNullEventsForAllNetscapePlugins ended up being declared both in WebHTMLViewInternal.h and as members of the WebHTMLHighlighter protocol in WebHTMLViewPrivate.h. They don't belong in the protocol, but they do need to be available outside of WebKit so they're being moved to the correct location in WebHTMLViewPrivate.h and removed from WebHTMLViewInternal.h. * WebView/WebHTMLView.mm: (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]): (-[WebHTMLView _resumeNullEventsForAllNetscapePlugins]): * WebView/WebHTMLViewInternal.h: * WebView/WebHTMLViewPrivate.h: 2008-06-15 Darin Adler <darin@apple.com> - give Frame object functions shorter names: scriptProxy() -> script(), selectionController() -> selection(), animationController() -> animation() * Plugins/WebPluginController.mm: (-[WebPluginController webPlugInContainerSelectionColor]): * WebView/WebFrame.mm: (-[WebFrame _attachScriptDebugger]): (-[WebFrame _hasSelection]): (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): (-[WebFrame _rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]): (-[WebFrame _convertToNSRange:]): (-[WebFrame _convertToDOMRange:]): (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): (-[WebFrame _replaceSelectionWithText:selectReplacement:smartReplace:]): (-[WebFrame _insertParagraphSeparatorInQuotedContent]): (-[WebFrame _selectedNSRange]): (-[WebFrame _selectNSRange:]): (-[WebFrame globalContext]): * WebView/WebHTMLView.mm: (-[WebHTMLView _selectedRange]): (-[WebHTMLView _hasSelection]): (-[WebHTMLView _hasSelectionOrInsertionPoint]): (-[WebHTMLView _hasInsertionPoint]): (-[WebHTMLView _isEditable]): (-[WebHTMLView _updateFocusedAndActiveState]): (-[WebHTMLView readSelectionFromPasteboard:]): (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): (-[WebHTMLView maintainsInactiveSelection]): (-[WebHTMLView paste:]): (isTextInput): (-[WebHTMLView inputContext]): (-[WebTextCompleteController doCompletion]): (-[WebHTMLView selectAll]): (-[WebHTMLView deselectAll]): (-[WebHTMLView selectedAttributedString]): * WebView/WebView.mm: (-[WebView aeDescByEvaluatingJavaScriptFromString:]): (-[WebView setSelectedDOMRange:affinity:]): (-[WebView selectedDOMRange]): (-[WebView selectionAffinity]): 2008-06-15 Darin Adler <darin@apple.com> - rename KJS::List to KJS::ArgList * WebView/WebScriptDebugger.h: 2008-06-15 Darin Adler <darin@apple.com> - new names for more JavaScriptCore files * WebView/WebView.mm: 2008-06-15 Darin Adler <darin@apple.com> - new names for a few key JavaScriptCore files * ForwardingHeaders/kjs/JSFunction.h: Copied from WebKit/mac/ForwardingHeaders/kjs/function.h. * ForwardingHeaders/kjs/JSObject.h: Copied from WebKit/mac/ForwardingHeaders/kjs/object.h. * ForwardingHeaders/kjs/JSString.h: Copied from WebKit/mac/ForwardingHeaders/kjs/internal.h. * ForwardingHeaders/kjs/JSValue.h: Copied from WebKit/mac/ForwardingHeaders/kjs/value.h. * ForwardingHeaders/kjs/function.h: Removed. * ForwardingHeaders/kjs/internal.h: Removed. * ForwardingHeaders/kjs/object.h: Removed. * ForwardingHeaders/kjs/value.h: Removed. * WebView/WebScriptDebugDelegate.mm: 2008-06-15 Darin Adler <darin@apple.com> Rubber stamped by Sam. - use JS prefix and simpler names for basic JavaScriptCore types, to complement JSValue and JSObject * WebView/WebView.mm: (aeDescFromJSValue): 2008-06-14 Darin Adler <darin@apple.com> Rubber stamped by Sam. - new names for kjs_binding.h and kjs_proxy.h * WebView/WebFrame.mm: * WebView/WebScriptDebugDelegate.mm: * WebView/WebView.mm: 2008-06-14 Darin Adler <darin@apple.com> Rubber stamped by Sam. - renamed HTMLGenericFormElement to HTMLFormControlElement * WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation elementWithName:inForm:]): (-[WebHTMLRepresentation controlsInForm:]): 2008-06-14 Darin Adler <darin@apple.com> Reviewed by Sam. - more of https://bugs.webkit.org/show_bug.cgi?id=17257 start ref counts at 1 instead of 0 for speed * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createDocumentLoader): Use create instead of new. (WebFrameLoaderClient::createFrame): Remove now-obsolete adoptRef that was balanced by a ref call inside the Frame constructor. The lifetime rules for Frame are now the conventional ones without a special case. * WebView/WebDataSource.mm: (-[WebDataSource _initWithDocumentLoader:]): Changed argument to be a PassRefPtr, since this function takes ownership of the DocumentLoader. (-[WebDataSource initWithRequest:]): Use create instead of new. * WebView/WebDataSourceInternal.h: Changed _initWithDocumentLoader argument to be a PassRefPtr and also cleaned up the header a bit. * WebView/WebDocumentLoaderMac.h: (WebDocumentLoaderMac::create): Added. Also made the constructor and a couple of virtual functions private. * WebView/WebFrame.mm: (+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]): Use create instead of new. 2008-06-14 Darin Adler <darin@apple.com> Reviewed by Sam. - more work on https://bugs.webkit.org/show_bug.cgi?id=17257 start ref counts at 1 instead of 0 for speed * WebView/WebFrame.mm: (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): * WebView/WebPDFView.mm: (-[WebPDFView PDFViewWillClickOnLink:withURL:]): 2008-06-13 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - updated for addition of FormState argument to action policy functions - added WebActionFormKey * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): (WebFrameLoaderClient::actionDictionary): * WebKit.exp: * WebView/WebPolicyDelegate.mm: * WebView/WebPolicyDelegatePrivate.h: 2008-06-12 John Sullivan <sullivan@apple.com> Reviewed by Dan and Darin Clear up the confusion about _close (older private method) vs -close (newer public method). * WebView/WebView.mm: (-[WebView _isClosed]): simplified style (-[WebView _close]): added a comment about how clients and subclasses should use -close instead (-[WebView dealloc]): call -close instead of _close, so subclasses that override the public method will have the intended behavior (-[WebView close]): added a comment (-[WebView _windowWillClose:]): call -close instead of _close, so subclasses that override the public method will have the intended behavior * WebView/WebViewPrivate.h: added a comment about how clients and subclasses should use -close instead 2008-06-07 Darin Adler <darin@apple.com> Reviewed by Mitz. - work on https://bugs.webkit.org/show_bug.cgi?id=17257 start ref counts at 1 instead of 0 for speed * History/WebHistoryItem.mm: (-[WebHistoryItem init]): (-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]): (-[WebHistoryItem initWithURL:target:parent:title:]): (-[WebHistoryItem initWithURLString:title:displayTitle:lastVisitedTimeInterval:]): * WebView/WebView.mm: (+[WebView _decodeData:]): 2008-06-03 Oliver Hunt <oliver@apple.com> Reviewed by Tim. Bug 12983: Web Inspector break on the debugger keyword <https://bugs.webkit.org/show_bug.cgi?id=12983> Add stubs to allow old webkit debugger interface to build. * WebView/WebScriptDebugger.h: * WebView/WebScriptDebugger.mm: 2008-06-03 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. <rdar://problem/5980961> In 64-bit Web Kit, converting between float and double, can cause rounding errors which in turn causes newBottom to be larger than oldBottom which is illegal. * WebView/WebHTMLView.mm: (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): 2008-06-02 Anders Carlsson <andersca@apple.com> Reviewed by Mitz. Speculative fix for <rdar://problem/5661112> CrashTracer: [USER] 49 crashes in DashboardClient at com.apple.WebCore: WebCore::RenderPart::setWidget + 62 Defer loads while calling NPP_New. Some plug-ins start a run-loop inside NPP_New and finished loads could cause layouts to be triggered. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView _createPlugin]): 2008-05-29 Justin Garcia <justin.garcia@apple.com> Reviewed by Darin Adler. <rdar://problem/5949462> REGRESSION: Can't paste screen captures into Mail AppKit started putting PNG instead of PICT onto the pasteboard for screen captures. Added support for PNG with kUTTypePNG. Tiger doesn't support setting and retrieving pasteboard types with UTIs, but we don't know of any applications on Tiger that put only PNG on the pasteboard. * WebView/WebHTMLView.mm: (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:]): (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]): 2008-05-29 Anders Carlsson <andersca@apple.com> Reviewed by Brady. <rdar://problem/5970312> icon file specified for stand alone web app causes crash if the icon can't be found Handle the case where iconData is null. * Misc/WebIconFetcher.mm: (WebIconFetcherClient::finishedFetchingIcon): 2008-05-29 Anders Carlsson <andersca@apple.com> Reviewed by Mitz. <rdar://problem/5971845> https://bugs.webkit.org/show_bug.cgi?id=19313 Add version member to NPCocoaEvent Initialize the version member to 0 for all events. * Plugins/WebNetscapePluginEventHandlerCocoa.mm: (initializeEvent): (WebNetscapePluginEventHandlerCocoa::drawRect): (WebNetscapePluginEventHandlerCocoa::sendMouseEvent): (WebNetscapePluginEventHandlerCocoa::flagsChanged): (WebNetscapePluginEventHandlerCocoa::sendKeyEvent): (WebNetscapePluginEventHandlerCocoa::windowFocusChanged): (WebNetscapePluginEventHandlerCocoa::focusChanged): 2008-05-29 Dan Bernstein <mitz@apple.com> Reviewed by Jessica Kahn. - fix <rdar://problem/5965013> Page 2 does not print correctly When printing, _recursiveDisplayRectIfNeededIgnoringOpacity:... and _recursiveDisplayAllDirtyWithLockFocus:... can be invoked without -viewWillDraw being sent first, which could lead to painting without valid layout. The fix is to ensure up-to-date layout in those methods when printing. * WebView/WebHTMLView.mm: (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]): (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): 2008-05-28 Anders Carlsson <andersca@apple.com> Reviewed by Jon. Remove workaround, this is no longer a problem. * WebView/WebView.mm: (-[WebView _removeObjectForIdentifier:]): 2008-05-27 Geoffrey Garen <ggaren@apple.com> Reviewed by Tim Hatcher. Fixed https://bugs.webkit.org/show_bug.cgi?id=19183 REGRESSION (r33979): Crash in DebuggerCallFrame::functionName when clicking button in returnEvent-crash.html Added implementations for willExecuteProgram and didExecuteProgram, which take care of making sure we're not hanging on to stale data. 2008-05-27 Timothy Hatcher <timothy@apple.com> Fixes a bug where unplugging the monitor from a video card and moving it to another video card would no longer show OpenGL plugins until you relaunched Safari. <rdar://problem/5790983> Add AllowOfflineDisplays pixel format attribute to OpenGL contexts Reviewed by Kevin Decker. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView _createWindowedAGLContext]): Added AGL_ALLOW_OFFLINE_RENDERERS for non-Tiger builds. (-[WebBaseNetscapePluginView _createWindowlessAGLContext]): Ditto. 2008-05-25 Mark Rowe <mrowe@apple.com> Reviewed by Darin Adler. <rdar://problem/5840884> _recursive_resumeNullEventsForAllNetscapePlugins and _pauseNullEvents not defined Follow-up for r33052. _recursive_resumeNullEventsForAllNetscapePlugins and _recursive_pauseNullEventsForAllNetscapePlugins need to be declared in WebFramePrivate.h rather than WebFrameInternal.h so they can be used from outside of WebKit. * WebView/WebFrame.mm: (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]): (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]): * WebView/WebFrameInternal.h: * WebView/WebFramePrivate.h: 2008-05-23 Timothy Hatcher <timothy@apple.com> Fix attaching and detaching the Web Inspector. This change removes the clunky animation that never looked right and was causing issues where the inspected WebView would get into a no useable state. <rdar://problem/5958812> Attaching and Detaching the Web Inspector can cause the inspected WebVIew to be unusable Reviewed by Adam Roben. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController close]): Removes animation code. Sets the frame directly and does a displayIfNeeded to prevent showing the Inspector in the page and in the Inspector window. (-[WebInspectorWindowController showWindow:]): Removes animation code. Sets the frame directly. (-[WebInspectorWindowController attach]): Simplified. (-[WebInspectorWindowController detach]): Ditto. 2008-05-22 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - fix broken documentation of webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame: * WebView/WebUIDelegate.h: Fixed method name in HeaderDoc for -webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame: 2008-05-22 Timothy Hatcher <timothy@apple.com> <rdar://problem/5956403> Update the Develop menu to match the new Inspector items Reviewed by Adam Roben. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController showWebInspector:]): (-[WebInspectorWindowController showErrorConsole:]): (-[WebInspectorWindowController toggleDebuggingJavaScript:]): (-[WebInspectorWindowController toggleProfilingJavaScript:]): (-[WebInspectorWindowController validateUserInterfaceItem:]): * WebInspector/WebInspector.h: * WebInspector/WebInspector.mm: (-[WebInspector showConsole:]): (-[WebInspector showTimeline:]): (-[WebInspector isDebuggingJavaScript]): (-[WebInspector toggleDebuggingJavaScript:]): (-[WebInspector startDebuggingJavaScript:]): (-[WebInspector stopDebuggingJavaScript:]): (-[WebInspector isProfilingJavaScript]): (-[WebInspector toggleProfilingJavaScript:]): (-[WebInspector startProfilingJavaScript:]): (-[WebInspector stopProfilingJavaScript:]): 2008-05-22 Josh Aas <joshmoz@gmail.com> Reviewed by Anders. <rdar://problem/5956429> https://bugs.webkit.org/show_bug.cgi?id=19192 remove NPNVpluginEventModel, fix example plugin * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView getVariable:value:]): 2008-05-21 Anders Carlsson <andersca@apple.com> Reviewed by Maciej. Add WebIconFetcher. * Misc/WebIconFetcher.h: Added. * Misc/WebIconFetcher.mm: Added. (WebIconFetcherClient::WebIconFetcherClient): (WebIconFetcherClient::finishedFetchingIcon): (WebIconFetcherClient::setFetcher): (-[WebIconFetcher init]): (-[WebIconFetcher dealloc]): (-[WebIconFetcher finalize]): (-[WebIconFetcher cancel]): (-[WebIconFetcher _initWithIconFetcher:client:]): (+[WebIconFetcher _fetchApplicationIconForFrame:target:selector:]): * Misc/WebIconFetcherInternal.h: Added. * WebView/WebFrame.mm: (-[WebFrame fetchApplicationIcon:selector:]): * WebView/WebFramePrivate.h: === End merge of squirrelfish === 2008-05-21 Geoffrey Garen <ggaren@apple.com> Reviewed by Tim Hatcher. Updated for API changes from merging with trunk WebCore's new debugger. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame evaluateWebScript:]): Explicitly check for an exception return, since the DebuggerCallFrame no longer automatically substitutes the exception for the return value. * WebView/WebScriptDebugger.mm: Use the dynamic global object, not the lexical global object, since the debugger attaches based on dynamic global object. 2008-05-17 Geoffrey Garen <ggaren@apple.com> Reviewed by Oliver Hunt. Re-enabled previously disabled debugging functionality. There are two major changes from how the WebKit debugger used to work: (1) All the interesting bits are implemented down in JavaScriptCore. The debugger just calls through to KJS::DebuggerCallFrame for everything. (2) Instead of copyihng a pointer to an ExecState once, the debugger copies the DebuggerCallFrame passed to it in each callback. This is because the VM no longer maintains a fully transparent execution state to which you can hold a pointer, and the DebuggerCallFrames it vends are temporaries. Also, we NULL out a WebScriptCallFrame's DebuggerCallFrame upon return from its function. This is safer than the old method, which was to hold a stale ExecState* and hope for the best. 2008-05-13 Geoffrey Garen <ggaren@apple.com> Reviewed by Oliver Hunt. Updated for API changes in KJS::Debugger. * WebView/WebFrame.mm: (-[WebFrame _attachScriptDebugger]): Changed the order of operations to fix an ASSERT that can happen when re-entering _attachScriptDebugger. 2008-05-13 Geoffrey Garen <ggaren@apple.com> Reviewed by Oliver Hunt. Updated WebScriptDebugger API to accept a SourceProvider instead of a WebCore::String, to avoid copying. (WebScriptDebugger::sourceParsed): Updated this function not to return a value. 2008-04-30 Geoffrey Garen <ggaren@apple.com> Build fix: #ifdef'd out some code that doesn't work anymore. 2008-04-30 Geoffrey Garen <ggaren@apple.com> Reviewed by Oliver Hunt. #ifdef'd out some debugger code that doesn't work anymore. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame scopeChain]): 2008-04-21 Geoffrey Garen <ggaren@apple.com> Build fix. * ChangeLog: * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame scopeChain]): 2008-03-30 Geoffrey Garen <ggaren@apple.com> Reviewed by Oliver Hunt. Build fix. === Start merge of squirrelfish === 2008-05-21 Darin Adler <darin@apple.com> - fix build * WebView/WebViewPrivate.h: Remove declaration of closeWithFastTeardown. We can add it back later if we want, but if we do, we should probably make some refinements like checking _private->closed and applicationIsTerminating. 2008-05-21 Darin Adler <darin@apple.com> Reviewed by Anders and Kevin Decker. - fix <rdar://problem/5951130> REGRESSION: crash on quit after reopening windows from previous session * WebView/WebView.mm: (-[WebViewPrivate dealloc]): Fix assertions to not complain when fast teardown is used. (-[WebView _closePluginDatabases]): Factored out some common code from both versions of close. (-[WebView _closeWithFastTeardown]): Added an underscore to this method's name, since it's internal. Streamlined the code a bit. Added a line of code to set _private->closed (this is the bug fix). (-[WebView _close]): Changed for new method name and to use _closePluginDatabases. 2008-05-19 Stephanie Lewis <slewis@apple.com> Reviewed by Darin Adler. more fast teardown performance work * Misc/WebDownload.m: (-[WebDownloadInternal downloadDidBegin:]): (-[WebDownloadInternal downloadDidFinish:]): (-[WebDownloadInternal download:didFailWithError:]): * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::disableSuddenTermination): (WebChromeClient::enableSuddenTermination): 2008-05-18 Dan Bernstein <mitz@apple.com> Reviewed by Sam Weinig. - fix <rdar://problem/5944596> IDNs are displayed as punycode in the authentication panel * Panels/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForChallenge:]): 2008-05-16 Timothy Hatcher <timothy@apple.com> Removes WebScriptDebugServer files and related calls. This removes the hooks that Drosera uses for debugging. Now that the Web Inspector has a better debugger, we don't need these anymore. Reviewed by Sam Weinig. * DefaultDelegates/WebScriptDebugServer.h: Removed. * DefaultDelegates/WebScriptDebugServer.m: Removed. * DefaultDelegates/WebScriptDebugServerPrivate.h: Removed. * WebCoreSupport/WebFrameLoaderClient.mm: * WebKit.exp: * WebView/WebScriptDebugDelegate.mm: * WebView/WebScriptDebugger.mm: (WebScriptDebugger::sourceParsed): (WebScriptDebugger::callEvent): (WebScriptDebugger::atStatement): (WebScriptDebugger::returnEvent): (WebScriptDebugger::exception): * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): * WebView/WebViewPrivate.h: 2008-05-16 Brady Eidson <beidson@apple.com> Reviewed by Anders <rdar://problem/5942616> - Need to standardize LocalStorage persistence path Took the opportunity to touch up another pref that needs the same standardization. That pref is currently not in use on Mac. * WebView/WebPreferences.m: (-[WebPreferences _setFTPDirectoryTemplatePath:]): (-[WebPreferences _localStorageDatabasePath]): (-[WebPreferences _setLocalStorageDatabasePath:]): (-[WebPreferences _ftpDirectoryTemplatePath]): 2008-05-16 Chris Fleizach <cfleizach@apple.com> Reviewed by Alice Liu <rdar://problem/5710317> REGRESSION:Selecting ranges of text should be possible using the keyboard (15310) * WebView/WebFrame.mm: (-[WebFrame _accessibilityTree]): 2008-05-15 Stephanie Lewis <slewis@apple.com> fix mac build * WebView/WebView.mm: (-[WebView closeWithFastTeardown]): 2008-05-15 Stephanie Lewis <slewis@apple.com> Reviewed by Anders. Turn on fast teardown. I added a preference for using full teardown because the LEAKS output will be useless without a full teardown. preference for fullteardown * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.m: (-[WebPreferences setFullDocumentTeardownEnabled:]): (-[WebPreferences fullDocumentTeardownEnabled]): * WebView/WebPreferencesPrivate.h: on application quit dispatch unload events and destroy plugins then exit * WebView/WebView.mm: (-[WebView closeWithFastTeardown]): (-[WebView _close]): * WebView/WebViewPrivate.h: 2008-05-15 Stephanie Lewis <slewis@apple.com> Reviewed by Anders. get the pending frame unload count from WebCore * WebView/WebFrame.mm: (-[WebFrame _pendingFrameUnloadEventCount]): * WebView/WebFramePrivate.h: 2008-05-15 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker - fixed <rdar://problem/5940275> Inspector highlighting moves to bottom-left corner of screen when new tab appears The highlight should go away entirely, but this simple patch just makes it not jump away. The issue with it not going away entirely is harder to fix and covered by <rdar://problem/5322306> * WebInspector/WebNodeHighlight.m: (-[WebNodeHighlight _repositionHighlightWindow]): Bail out if target view isn't in a window 2008-05-15 Stephanie Lewis <slewis@apple.com> Reviewed by Anders. Track views that contain plugin instances so that they can be destroyed at application quit without walking the entire document tree. Add/Remove Netscape plugin views from instance list. Start/stop are when netscape plugins are created and destroyed * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView stop]): Add/remove WebKit plugin views from instance list * Plugins/WebPluginController.mm: (-[WebPluginController addPlugin:]): (-[WebPluginController destroyPlugin:]): (-[WebPluginController destroyAllPlugins]): Add a set of views with plugin instances to the WebPluginDatabase * Plugins/WebPluginDatabase.h: * Plugins/WebPluginDatabase.mm: (-[WebPluginDatabase init]): (-[WebPluginDatabase dealloc]): (-[WebPluginDatabase addPluginInstanceView:]): (-[WebPluginDatabase removePluginInstanceView:]): (-[WebPluginDatabase removePluginInstanceViewsFor:]): (-[WebPluginDatabase destroyAllPluginInstanceViews]): Handle cases where plugin views are detached before the plugin is destroyed. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::detachedFromParent2): (WebFrameLoaderClient::transitionToCommittedFromCachedPage): (WebFrameLoaderClient::transitionToCommittedForNewPage): Add plugin instances to the set in the WebPluginDatabase by way of the WebView * WebView/WebHTMLView.mm: (-[WebHTMLView _destroyAllWebPlugins]): * WebView/WebHTMLViewInternal.h: * WebView/WebView.mm: (-[WebView addPluginInstanceView:]): (-[WebView removePluginInstanceView:]): (-[WebView removePluginInstanceViewsFor:]): * WebView/WebViewInternal.h: 2008-05-15 Brady Eidson <beidson@apple.com> Reviewed by Tim Hatcher Until the settings/preferences equation can be reworked, we'll need to manually set the local storage path before setting the page group of the new page. * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Set the LocalStorage path immediately after creating the page so it is in place for initializing the LocalStorageThread 2008-05-15 Timothy Hatcher <timothy@apple.com> Fixes the bug where the Web Inspector would flash white while resizing. This was cause by deferring the window creation. <rdar://problem/5873549> REGRESSION: Inspector flickers horribly while resizing (17979) Reviewed by Darin Adler. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController window]): Don't defer the window creation. 2008-05-15 Alexey Proskuryakov <ap@webkit.org> Tiger build fix. * Misc/WebNSAttributedStringExtras.mm: Import WebTypesInternal.h for NSUInteger. 2008-05-15 Adele Peterson <adele@apple.com> Reviewed and landed by Alexey. Use TextIterator in +[NSAttributedString _web_attributedStringFromRange:]. * Misc/WebNSAttributedStringExtras.mm: (+[NSAttributedString _web_attributedStringFromRange:]): 2008-05-14 Eric Seidel <eric@webkit.org> Reviewed by Oliver. Add missing NULL check to match rest of file, this was found by the editing fuzzer. * WebView/WebResource.mm: (-[WebResource data]): 2008-05-14 Alexey Proskuryakov <ap@webkit.org> Reviewed by Dan Bernstein. NPP_ValidAttributesForMarkedText should return NSArray*, not NSArray. * Plugins/nptextinput.h: 2008-05-13 Anders Carlsson <andersca@apple.com> Reviewed by Sam. Don't empty the application cache in _setCacheModel, since it will be called during initialization. Instead, do it in [WebCache empty]. * Misc/WebCache.mm: (+[WebCache empty]): * WebView/WebView.mm: (+[WebView _setCacheModel:]): 2008-05-13 chris fleizach <cfleizach@apple.com> Reviewed by Beth Dakin <rdar://problem/4780592> WebKit application has its window announced as HTML content * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory AXWebAreaText]): 2008-05-13 Timothy Hatcher <timothy@apple.com> Fixes a crash seen in Xcode where CallUIDelegateReturningBoolean was referencing a nil WebView under validateUserInterfaceItem. The validateUserInterfaceItem methods was being called at a time when the WebHTMLView is being torndown. <rdar://problem/5806229> A crash occurs at CallUIDelegateReturningBoolean() while mousing down on menu bar after Xcode News window is opened Reviewed by Ada Chan. * WebView/WebHTMLView.mm: (-[WebHTMLView validateUserInterfaceItem:]): NULL check the WebView and return NO when it is nil. Adds a comment. * WebView/WebPDFView.mm: (-[WebPDFView validateUserInterfaceItem:]): Ditto. 2008-05-13 Mark Rowe <mrowe@apple.com> Reviewed by John Sullivan. <rdar://problem/5926425> HIWebViewCreateWithClass declared as API in HIWebView.h but never exported from WebKit.framework * Carbon/HIWebView.h: Remove HIWebViewCreateWithClass. * Carbon/HIWebView.m: Ditto. (HIWebViewCreate): (HIWebViewConstructor): 2008-05-12 Dan Bernstein <mitz@apple.com> Reviewed by Ada Chan. - WebKit/mac changes for https://bugs.webkit.org/show_bug.cgi?id=17097 <rdar://problem/5715471> CGFontRefs (and HFONTs on Windows) leak because FontCache grows without bound Added font cache statistics and a function to purge inactive font data. * Misc/WebCoreStatistics.h: * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics cachedFontDataCount]): (+[WebCoreStatistics cachedFontDataInactiveCount]): (+[WebCoreStatistics purgeInactiveFontData]): (+[WebCoreStatistics glyphPageCount]): 2008-05-12 Mark Rowe <mrowe@apple.com> Reviewed by Tim Hatcher. Decorate some deprecated delegate methods with the availability macros. The compiler doesn't appear to warn if a delegate implements these methods, but using the availability macros is good for consistency and documentation. * WebView/WebFrameLoadDelegate.h: * WebView/WebUIDelegate.h: 2008-05-12 Mark Rowe <mrowe@apple.com> Reviewed by Tim Hatcher. <rdar://problem/5835604> Deprecate HIWebView Use of HIWebView is deprecated in favor of embedding a WebView in a HICocoaView. * Carbon/CarbonUtils.h: Include the availability macro header and decorate the functions appropriately. * Carbon/HIWebView.h: Ditto. 2008-05-12 Kevin Decker <kdecker@apple.com> Reviewed by Anders. Fixed: <rdar://problem/5840884>_recursive_resumeNullEventsForAllNetscapePlugins and _pauseNullEvents not defined Re-added these SPI methods because they are needed by some clients. They were accidentally removed in changeset <http://trac.webkit.org/changeset/31028> * Plugins/WebBaseNetscapePluginView.h: Added stopTimers, restartTimers to the header. * WebView/WebFrame.mm: (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]): Re-addd. (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]): Ditto. * WebView/WebFrameInternal.h: Ditto. * WebView/WebHTMLView.mm: Ditto. (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]): Ditto. (-[WebHTMLView _resumeNullEventsForAllNetscapePlugins]): Ditto. * WebView/WebHTMLViewInternal.h: Ditto. * WebView/WebHTMLViewPrivate.h: Ditto. 2008-05-12 Anders Carlsson <andersca@apple.com> Reviewed by Alexey. Empty the application cache when changing the cache model. * WebView/WebView.mm: (+[WebView _setCacheModel:]): 2008-05-12 Anders Carlsson <andersca@apple.com> Reviewed by Oliver. <rdar://problem/5774495> Make Unicode text input possible in Netscape-style plug-ins * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView start]): Get the plug-in text input vtable pointer. (-[WebBaseNetscapePluginView stop]): Set the plug-in text input vtable pointer to 0. (-[WebBaseNetscapePluginView inputContext]): Return 0 for Carbon plug-ins since we don't want Cocoa to handle text input for them. (-[WebBaseNetscapePluginView hasMarkedText]): (-[WebBaseNetscapePluginView insertText:]): (-[WebBaseNetscapePluginView markedRange]): (-[WebBaseNetscapePluginView selectedRange]): (-[WebBaseNetscapePluginView setMarkedText:selectedRange:]): (-[WebBaseNetscapePluginView unmarkText]): (-[WebBaseNetscapePluginView validAttributesForMarkedText]): (-[WebBaseNetscapePluginView attributedSubstringFromRange:]): (-[WebBaseNetscapePluginView characterIndexForPoint:]): (-[WebBaseNetscapePluginView doCommandBySelector:]): (-[WebBaseNetscapePluginView firstRectForCharacterRange:]): (-[WebBaseNetscapePluginView conversationIdentifier]): Implement NSTextInput and call into the plug-in text input vtable. (browserTextInputFuncs): New method which returns the browser input vtable. (-[WebBaseNetscapePluginView getVariable:value:]): Support getting the browser input vtable pointer. * Plugins/WebNetscapePluginEventHandlerCocoa.h: * Plugins/WebNetscapePluginEventHandlerCocoa.mm: (WebNetscapePluginEventHandlerCocoa::keyDown): (WebNetscapePluginEventHandlerCocoa::sendKeyEvent): If the plug-in returns 0 when a NPCocoaEventKeyDown is passed to NPP_HandleEvent, it means that the event should be passed on to the input manager. * Plugins/npapi.mm: (NPN_MarkedTextAbandoned): (NPN_MarkedTextSelectionChanged): Add implementations of browser input method methods. * Plugins/nptextinput.h: Added. Add file with new text input API. 2008-05-12 Alexey Proskuryakov <ap@webkit.org> Roll out recent threading changes (r32807, r32810, r32819, r32822) to simplify SquirrelFish merging. * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptObjectsCount]): (+[WebCoreStatistics javaScriptGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectsCount]): (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics javaScriptReferencedObjectsCount]): * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame evaluateWebScript:]): 2008-05-07 Anders Carlsson <andersca@apple.com> Reviewed by Mitz. REGRESSION (3.1.1-TOT): Arrow keys are sticky in Google Maps street view https://bugs.webkit.org/show_bug.cgi?id=18880 <rdar://problem/5909513> Stop suspending key up events before calling handleEvent. * Plugins/WebNetscapePluginEventHandlerCarbon.mm: (WebNetscapePluginEventHandlerCarbon::sendEvent): 2008-05-06 Stephanie Lewis <slewis@apple.com> Reviewed by Andersca. prepare for plugin fast teardown work - make WebPluginDatabase a objective C++ file. * Plugins/WebPluginDatabase.m: Removed. * Plugins/WebPluginDatabase.mm: Copied from WebKit/mac/Plugins/WebPluginDatabase.m. * Plugins/npapi.m: Removed. * Plugins/npapi.mm: Copied from WebKit/mac/Plugins/npapi.m. 2008-05-06 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Initialize numArchs to 0. * Plugins/WebBasePluginPackage.m: (-[WebBasePluginPackage isNativeLibraryData:]): 2008-05-06 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Add implementation of NPN_PopUpContextMenu. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView popUpContextMenu:]): * Plugins/WebBaseNetscapePluginViewPrivate.h: * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): * Plugins/npapi.m: (NPN_PopUpContextMenu): 2008-05-06 Anders Carlsson <andersca@apple.com> Fix typo (don't read random memory). * Plugins/WebBasePluginPackage.m: (-[WebBasePluginPackage isNativeLibraryData:]): 2008-05-05 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Change the isNativeLibraryData: method to handle universal binaries. * Plugins/WebBasePluginPackage.m: (swapIntsInHeader): (-[WebBasePluginPackage isNativeLibraryData:]): 2008-05-06 Brady Eidson <beidson@apple.com> Reviewed by Darin Adler Preparation for upcoming work making LocalStorage persistent. When the application terminates, all LocalStorage areas must be sync'ed out to disk first. * WebView/WebView.mm: (+[WebView _applicationWillTerminate]): Close all LocalStorage areas before quitting. 2008-05-05 Sam Weinig <sam@webkit.org> Reviewed by Darin Adler. Fix for <rdar://problem/5884383> Escape look-a-like characters from the the entire url. * Misc/WebNSURLExtras.mm: (escapeUnsafeCharacters): (-[NSURL _web_userVisibleString]): 2008-05-05 Justin Garcia <justin.garcia@apple.com> Reviewed by Darin Adler. <rdar://problem/5865171> REGRESSION: Creating a new quote places caret at beginning of quote instead of the end * WebView/WebView.mm: (-[WebView _updateSettingsFromPreferences:]): Disable Range mutation on changes to the document for Tiger and Leopard Mail. There is code in Mail that does it, and the two interfere. 2008-05-05 Sam Weinig <sam@webkit.org> Reviewed by Tim Hatcher. Make the Inspector's localizable strings file match the format used by Dashboard widgets. * WebCoreSupport/WebInspectorClient.mm: (WebInspectorClient::localizedStringsURL): 2008-05-05 Anders Carlsson <andersca@apple.com> Reviewed by Jess. Apparently preflighting can cause hangs for some reason. Revert this for now. * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage _initWithPath:]): * Plugins/WebPluginPackage.m: (-[WebPluginPackage initWithPath:]): 2008-05-05 Darin Adler <darin@apple.com> Reviewed by Mitz. - https://bugs.webkit.org/show_bug.cgi?id=18789 fix some shouldCloseWithWindow edge cases * WebView/WebView.mm: (-[WebView viewWillMoveToWindow:]): Fix bug where we would stop observing the NSWindowWillCloseNotification if the view was moved out of the window but still had that window set as the host window. Also make sure this function doesn't do anything if the WebView is already closed. (-[WebView setHostWindow:]): Ditto. 2008-05-04 David Kilzer <ddkilzer@apple.com> Make parameters match for WebChromeClient::addMessageToConsole() Reviewed by John. * WebCoreSupport/WebChromeClient.h: (WebChromeClient::addMessageToConsole): Renamed sourceID parameter to sourceURL to match implementation in WebChromeClient.mm. 2008-05-02 Anders Carlsson <andersca@apple.com> Reviewed by Mark. Various Cocoa event model and 64-bit plug-in fixes. * Plugins/WebNetscapePluginEventHandlerCocoa.mm: (WebNetscapePluginEventHandlerCocoa::sendMouseEvent): Set click count. (WebNetscapePluginEventHandlerCocoa::flagsChanged): (WebNetscapePluginEventHandlerCocoa::sendKeyEvent): Don't try to get the mouse location for keyboard events. * Plugins/WebPluginPackage.m: (-[WebPluginPackage initWithPath:]): Preflight the bundle so we won't show 32-bit WebKit plug-ins when running as 64-bit. 2008-05-02 Anders Carlsson <andersca@apple.com> Reviewed by Sam. The event union is now named. * Plugins/WebNetscapePluginEventHandlerCocoa.mm: (WebNetscapePluginEventHandlerCocoa::drawRect): (WebNetscapePluginEventHandlerCocoa::sendMouseEvent): (WebNetscapePluginEventHandlerCocoa::flagsChanged): (WebNetscapePluginEventHandlerCocoa::sendKeyEvent): (WebNetscapePluginEventHandlerCocoa::windowFocusChanged): (WebNetscapePluginEventHandlerCocoa::focusChanged): 2008-05-02 Anders Carlsson <andersca@apple.com> Reviewed by Mark. Make sure that 32-bit only plug-ins aren't shown when running as 64-bit. Call preflightAndReturnError on the bundle, which will check if any of the architectures in the bundle match the current architecture. * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage _initWithPath:]): 2008-05-02 Alexey Proskuryakov <ap@webkit.org> Reviewed by Geoffrey Garen. https://bugs.webkit.org/show_bug.cgi?id=18826 Make JavaScript heap per-thread * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptObjectsCount]): (+[WebCoreStatistics javaScriptGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectsCount]): (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics javaScriptReferencedObjectsCount]): Replaced static Collector calls with calls to a current thread's instance. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame evaluateWebScript:]): Pass ExecState to jsString(). 2008-05-01 Anders Carlsson <andersca@apple.com> Reviewed by Mark. 64-bit NPAPI plugin build fixes. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebBaseNetscapePluginView updateAndSetWindow]): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView windowBecameKey:]): * Plugins/WebNetscapeDeprecatedFunctions.c: * Plugins/WebNetscapeDeprecatedFunctions.h: * Plugins/WebNetscapePluginEventHandler.mm: (WebNetscapePluginEventHandler::create): * Plugins/WebNetscapePluginEventHandlerCarbon.h: * Plugins/WebNetscapePluginEventHandlerCarbon.mm: * Plugins/WebPluginDatabase.m: (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): 2008-05-01 Anders Carlsson <andersca@apple.com> Reviewed by Tim. Remove duplicate npfunctions.h header from WebKit. * MigrateHeaders.make: Migrate npfunctions.h * Plugins/npfunctions.h: Removed. 2008-05-01 Anders Carlsson <andersca@apple.com> Reviewed by John. Add null checks for the event handler. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView stopTimers]): (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): 2008-05-01 Anders Carlsson <andersca@apple.com> Fix 64-bit build. * Plugins/WebNetscapePluginEventHandlerCocoa.h: * Plugins/WebNetscapePluginEventHandlerCocoa.mm: * WebCoreSupport/WebFrameLoaderClient.mm: 2008-05-01 Anders Carlsson <andersca@apple.com> Fix build. * Plugins/npfunctions.h: 2008-05-01 Anders Carlsson <andersca@apple.com> Reviewed by Adam. Forward mouse move events to the Netscape plug-in view. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView handleMouseMoved:]): New method that just calls the current event handler. * Plugins/WebNetscapePluginEventHandlerCocoa.mm: (WebNetscapePluginEventHandlerCocoa::flagsChanged): NSFlagsChanged is not a regular keyboard event and some of the NSEvent accessors don't work on it so don't call them. * WebCoreSupport/WebFrameLoaderClient.mm: (NetscapePluginWidget::NetscapePluginWidget): New Widget subclass to be used for Netscape plug-ins. (NetscapePluginWidget::handleEvent): Forward NSMouseMoved events to the plug-in. (WebFrameLoaderClient::createPlugin): Wrap the plug-in view in a NetscapePluginWidget. 2008-05-01 Alp Toker <alp@nuanti.com> Rubber-stamped by Anders. GTK+ build fix for changes in r32752. Use int32, not int32_t types in npapi.h. Additional fix to use same signedness in npapi.h and Mac for the interval parameter. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (PluginTimer::PluginTimer): (-[WebBaseNetscapePluginView stopTimers]): (-[WebBaseNetscapePluginView restartTimers]): (-[WebBaseNetscapePluginView scheduleTimerWithInterval:repeat:timerFunc:]): (-[WebBaseNetscapePluginView unscheduleTimer:]): * Plugins/WebBaseNetscapePluginViewPrivate.h: * Plugins/npapi.m: (NPN_ScheduleTimer): (NPN_UnscheduleTimer): * Plugins/npfunctions.h: 2008-04-30 Anders Carlsson <andersca@apple.com> Reviewed by Adam. Add new Cocoa event model and the NPN_ScheduleTimer/NPN_UnscheduleTimer methods. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (PluginTimer::PluginTimer): (PluginTimer::start): (PluginTimer::fired): (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebBaseNetscapePluginView stopTimers]): (-[WebBaseNetscapePluginView restartTimers]): (-[WebBaseNetscapePluginView scrollWheel:]): (-[WebBaseNetscapePluginView flagsChanged:]): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView eventModel]): (-[WebBaseNetscapePluginView fini]): (-[WebBaseNetscapePluginView getVariable:value:]): (-[WebBaseNetscapePluginView setVariable:value:]): (-[WebBaseNetscapePluginView scheduleTimerWithInterval:repeat:timerFunc:]): (-[WebBaseNetscapePluginView unscheduleTimer:]): * Plugins/WebBaseNetscapePluginViewInternal.h: * Plugins/WebBaseNetscapePluginViewPrivate.h: * Plugins/WebNetscapePluginEventHandler.h: * Plugins/WebNetscapePluginEventHandler.mm: (WebNetscapePluginEventHandler::create): * Plugins/WebNetscapePluginEventHandlerCarbon.h: * Plugins/WebNetscapePluginEventHandlerCarbon.mm: (WebNetscapePluginEventHandlerCarbon::scrollWheel): (WebNetscapePluginEventHandlerCarbon::flagsChanged): (WebNetscapePluginEventHandlerCarbon::platformWindow): * Plugins/WebNetscapePluginEventHandlerCocoa.h: Added. (WebNetscapePluginEventHandlerCocoa::startTimers): (WebNetscapePluginEventHandlerCocoa::stopTimers): * Plugins/WebNetscapePluginEventHandlerCocoa.mm: Added. (WebNetscapePluginEventHandlerCocoa::WebNetscapePluginEventHandlerCocoa): (WebNetscapePluginEventHandlerCocoa::drawRect): (WebNetscapePluginEventHandlerCocoa::mouseDown): (WebNetscapePluginEventHandlerCocoa::mouseDragged): (WebNetscapePluginEventHandlerCocoa::mouseEntered): (WebNetscapePluginEventHandlerCocoa::mouseExited): (WebNetscapePluginEventHandlerCocoa::mouseMoved): (WebNetscapePluginEventHandlerCocoa::mouseUp): (WebNetscapePluginEventHandlerCocoa::scrollWheel): (WebNetscapePluginEventHandlerCocoa::sendMouseEvent): (WebNetscapePluginEventHandlerCocoa::keyDown): (WebNetscapePluginEventHandlerCocoa::keyUp): (WebNetscapePluginEventHandlerCocoa::flagsChanged): (WebNetscapePluginEventHandlerCocoa::sendKeyEvent): (WebNetscapePluginEventHandlerCocoa::windowFocusChanged): (WebNetscapePluginEventHandlerCocoa::focusChanged): (WebNetscapePluginEventHandlerCocoa::platformWindow): (WebNetscapePluginEventHandlerCocoa::sendEvent): * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): * Plugins/npapi.m: (NPN_ScheduleTimer): (NPN_UnscheduleTimer): * Plugins/npfunctions.h: 2008-04-30 Brady Eidson <beidson@apple.com> Fix my WebPreferences revert check-in * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2008-04-30 Brady Eidson <beidson@apple.com> Rubberstamped by John Sullivan Revert the remainder of my original preferences changes from last week. They caused a massive PLT regression (too many notifications being sent out or listened to that weren't previously) and it's not in my schedule to refine the preferences code instead of working on my feature! * WebView/WebView.mm: (-[WebView _updateSettingsFromPreferences:]): (-[WebView _commonInitializationWithFrameName:groupName:]): 2008-04-30 Anders Carlsson <andersca@apple.com> Fix the 64-bit build. * Plugins/WebNetscapePluginEventHandler.h: * Plugins/WebNetscapePluginEventHandler.mm: * Plugins/WebNetscapePluginEventHandlerCarbon.h: * Plugins/WebNetscapePluginEventHandlerCarbon.mm: 2008-04-29 David D. Kilzer <ddkilzer@apple.com> BUILD FIX for Release build. * Plugins/WebNetscapePluginEventHandlerCarbon.mm: (WebNetscapePluginEventHandlerCarbon::drawRect): Declare acceptedEvent separately so the compiler doesn't complain about an unused variable. (WebNetscapePluginEventHandlerCarbon::TSMEventHandler): Ditto. 2008-04-29 Anders Carlsson <andersca@apple.com> Reviewed by Adam. Refactor the Carbon event handling code out into a separate class in preparation for adding the Cocoa event handling code. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): (-[WebBaseNetscapePluginView sendActivateEvent:]): (-[WebBaseNetscapePluginView sendDrawRectEvent:]): (-[WebBaseNetscapePluginView stopTimers]): (-[WebBaseNetscapePluginView restartTimers]): (-[WebBaseNetscapePluginView setHasFocus:]): (-[WebBaseNetscapePluginView mouseDown:]): (-[WebBaseNetscapePluginView mouseUp:]): (-[WebBaseNetscapePluginView mouseEntered:]): (-[WebBaseNetscapePluginView mouseExited:]): (-[WebBaseNetscapePluginView mouseDragged:]): (-[WebBaseNetscapePluginView keyUp:]): (-[WebBaseNetscapePluginView keyDown:]): (-[WebBaseNetscapePluginView cut:]): (-[WebBaseNetscapePluginView copy:]): (-[WebBaseNetscapePluginView paste:]): (-[WebBaseNetscapePluginView selectAll:]): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView stop]): (-[WebBaseNetscapePluginView fini]): (-[WebBaseNetscapePluginView drawRect:]): (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): (-[WebBaseNetscapePluginView viewDidMoveToWindow]): (-[WebBaseNetscapePluginView windowBecameKey:]): (-[WebBaseNetscapePluginView windowResignedKey:]): (-[WebBaseNetscapePluginView windowDidMiniaturize:]): (-[WebBaseNetscapePluginView windowDidDeminiaturize:]): (-[WebBaseNetscapePluginView loginWindowDidSwitchFromUser:]): (-[WebBaseNetscapePluginView loginWindowDidSwitchToUser:]): (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): (-[WebBaseNetscapePluginView _viewHasMoved]): * Plugins/WebBaseNetscapePluginViewInternal.h: * Plugins/WebNetscapePluginEmbeddedView.h: * Plugins/WebNetscapePluginEventHandler.h: Added. (WebNetscapePluginEventHandler::~WebNetscapePluginEventHandler): (WebNetscapePluginEventHandler::currentEventIsUserGesture): (WebNetscapePluginEventHandler::WebNetscapePluginEventHandler): * Plugins/WebNetscapePluginEventHandler.mm: Added. (WebNetscapePluginEventHandler::create): * Plugins/WebNetscapePluginEventHandlerCarbon.h: Added. * Plugins/WebNetscapePluginEventHandlerCarbon.mm: Added. (WebNetscapePluginEventHandlerCarbon::WebNetscapePluginEventHandlerCarbon): (getCarbonEvent): (modifiersForEvent): (WebNetscapePluginEventHandlerCarbon::sendNullEvent): (WebNetscapePluginEventHandlerCarbon::drawRect): (WebNetscapePluginEventHandlerCarbon::mouseDown): (WebNetscapePluginEventHandlerCarbon::mouseUp): (WebNetscapePluginEventHandlerCarbon::mouseEntered): (WebNetscapePluginEventHandlerCarbon::mouseExited): (WebNetscapePluginEventHandlerCarbon::mouseDragged): (WebNetscapePluginEventHandlerCarbon::mouseMoved): (WebNetscapePluginEventHandlerCarbon::keyDown): (keyMessageForEvent): (WebNetscapePluginEventHandlerCarbon::keyUp): (WebNetscapePluginEventHandlerCarbon::focusChanged): (WebNetscapePluginEventHandlerCarbon::windowFocusChanged): (WebNetscapePluginEventHandlerCarbon::TSMEventHandler): (WebNetscapePluginEventHandlerCarbon::installKeyEventHandler): (WebNetscapePluginEventHandlerCarbon::removeKeyEventHandler): (WebNetscapePluginEventHandlerCarbon::nullEventTimerFired): (WebNetscapePluginEventHandlerCarbon::startTimers): (WebNetscapePluginEventHandlerCarbon::stopTimers): (WebNetscapePluginEventHandlerCarbon::sendEvent): 2008-04-29 Mark Rowe <mrowe@apple.com> Reviewed by David Harrison. Ensure that WebDynamicScrollBarsView defines WebCoreScrollbarAlwaysOn to keep Mail building. * WebKit.exp: * WebView/WebDynamicScrollBarsView.h: * WebView/WebDynamicScrollBarsView.m: 2008-04-29 Greg Bolsinga <bolsinga@apple.com> Reviewed by Darin Adler. Wrapped Dashboard code with ENABLE(DASHBOARD_SUPPORT) * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: * WebView/WebClipView.m: (-[WebClipView scrollWheel:]): * WebView/WebHTMLView.mm: (-[WebHTMLView addMouseMovedObserver]): (-[WebHTMLView removeMouseMovedObserver]): (-[WebHTMLView acceptsFirstMouse:]): * WebView/WebUIDelegatePrivate.h: * WebView/WebView.mm: (-[WebViewPrivate init]): * WebView/WebViewPrivate.h: 2008-04-28 Rob Buis <buis@kde.org> Reviewed by Maciej. Build fix for Tiger. * WebView/WebView.mm: (WebKitInitializeApplicationCachePathIfNecessary): 2008-04-28 Adele Peterson <adele@apple.com> Reviewed by Dan Bernstein, Tim Hatcher, Anders Carlsson, and Darin Adler. WebKit part of fix for <rdar://problem/3709505> Safari should have a way to upload bundles from the file upload control (as zip) Added UIDelegate methods to let the application handle generating replacement files for uploads. In this case, Safari will create archived files for bundles so they can be uploaded properly. * DefaultDelegates/WebDefaultUIDelegate.m: (-[WebDefaultUIDelegate webView:shouldReplaceUploadFile:usingGeneratedFilename:]): (-[WebDefaultUIDelegate webView:generateReplacementFile:]): * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::shouldReplaceWithGeneratedFileForUpload): (WebChromeClient::generateReplacementFile): * WebView/WebUIDelegatePrivate.h: 2008-04-28 Anders Carlsson <andersca@apple.com> Reviewed by Sam, Mark, Adele and Darin. Initialize the application cache path. * WebView/WebView.mm: (WebKitInitializeApplicationCachePathIfNecessary): (-[WebView _commonInitializationWithFrameName:groupName:]): 2008-04-28 Alice Liu <alice.liu@apple.com> Reviewed by Darin Adler. Fix <rdar://problem/4911289> Add tabindex property to all children of HTMLElement (7138) http://bugs.webkit.org/show_bug.cgi?id=7138 * MigrateHeaders.make: Removing DOMHTMLLabelElementPrivate.h and DOMHTMLLegendElementPrivate.h because now that focus() has been moved to DOMHTMLElement.h, these files are no longer needed. 2008-04-25 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. Fix run-webkit-tests --threading and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661> Proxy server issue in Sunday's Nightly * WebView/WebView.mm: (-[WebViewPrivate init]): Initialize threading. Previously, this was only done from icon database code, which is not robust enough. 2008-04-20 Adam Barth <hk9565@gmail.com> Reviewed by Adam Roben and Sam Weinig. Updated WebSecurityOrigin to match new SecurityOrigin API. Collin Jackson <collinj-webkit@collinjackson.com> also contributed to this patch. * Storage/WebSecurityOrigin.mm: (-[WebSecurityOrigin host]): (-[WebSecurityOrigin domain]): * Storage/WebSecurityOriginPrivate.h: 2008-04-25 Mark Rowe <mrowe@apple.com> Rubber-stamped by Sam Weinig. Add some content to an empty ICU header file to prevent verification errors. * icu/unicode/utf_old.h: 2008-04-25 Anders Carlsson <andersca@apple.com> Reviewed by Sam. Add offlineWebApplicationCacheEnabled preference. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.m: (+[WebPreferences initialize]): (-[WebPreferences offlineWebApplicationCacheEnabled]): (-[WebPreferences setOfflineWebApplicationCacheEnabled:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _updateSettingsFromPreferences:]): 2008-04-24 Mark Rowe <mrowe@apple.com> Reviewed by Sam Weinig. Remove code for calculating the glyph cache size. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Remove unused symbol. 2008-04-24 Mark Rowe <mrowe@apple.com> Reviewed by Sam Weinig. Add a definition of BUILDING_ON_LEOPARD to complement BUILDING_ON_TIGER. * WebKitPrefix.h: 2008-04-24 Brady Eidson <beidson@apple.com> Reviewed by Darin Fix layout test regressions from my earlier preferences/settings tweak. * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Even if we're not posting the notification to update the settings, each WebView still needs to register for the notification - restore that behavior. 2008-04-24 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - preparation for https://bugs.webkit.org/show_bug.cgi?id=3729 <rdar://problem/4036353> REGRESSION: arrow keys move insertion bar backwards in RTL text * WebView/WebFrame.mm: (-[WebFrame _caretRectAtNode:offset:affinity:]): Changed to use VisiblePosition::caretRect() instead of the RenderObject method which was removed. 2008-04-24 Brady Eidson <beidson@apple.com> Reviewed by Darin Rework the Settings population again. * WebView/WebView.mm: (-[WebView _updateSettingsFromPreferences:]): This method is called both from _preferencesChangedNotification and directly from WebView's common init function. (-[WebView _preferencesChangedNotification:]): (-[WebView _commonInitializationWithFrameName:groupName:]): Call _updateSettingsFromPreferences immediately after creating the new Page 2008-04-24 Darin Adler <darin@apple.com> Reviewed by Geoff. - fix crash in regression test where we'd ask a frame for a user agent string after the WebView was already closed * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::userAgent): Assert that the WebView is not nil. Also added some code to prevent the crash in release builds if this problem happens again. 2008-04-24 Anders Carlsson <andersca@apple.com> Reviewed by Sam. Change some String arguments to be const references instead. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::shouldInsertText): 2008-04-24 John Sullivan <sullivan@apple.com> Mac build fix * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory AXButtonActionVerb]): implement this method using the text in WebCoreLocalizedStrings.cpp (-[WebViewFactory AXRadioButtonActionVerb]): ditto (-[WebViewFactory AXTextFieldActionVerb]): ditto (-[WebViewFactory AXCheckedCheckBoxActionVerb]): ditto (-[WebViewFactory AXUncheckedCheckBoxActionVerb]): ditto (-[WebViewFactory AXLinkActionVerb]): ditto 2008-04-23 Brady Eidson <beidson@apple.com> Reviewed by Sam Weinig In some current work I noticed that when a new Page is created, it is possible that it requires info from its Settings object before the Settings object is initialized. It seems quite prudent to post the preferences changed notification, thereby populating the Settings object, immediately after the Page is created. * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Post the notification right after the Page is created 2008-04-24 John Sullivan <sullivan@apple.com> Reviewed by Jess - fixed <rdar://problem/5886655> JavaScript input panel automatic resizing doesn't work right with HiDPI * Misc/WebNSControlExtras.m: (-[NSControl sizeToFitAndAdjustWindowHeight]): deploy userSpaceScaleFactor when using view distances on the window 2008-04-22 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Add NPN_Construct and NPN_PluginThreadAsyncCall declarations. * Plugins/npfunctions.h: 2008-04-20 Matt Lilek <webkit@mattlilek.com> Mysteriously reviewed by mitz|away. Bug 18111: Closing a tab while dragging crashes Safari https://bugs.webkit.org/show_bug.cgi?id=18111 Null check the page before handling drag events. * WebView/WebView.mm: (-[WebView draggingUpdated:]): (-[WebView draggingExited:]): 2008-04-19 Brady Eidson <beidson@apple.com> Reviewed by Tim Hatcher Add a WebPreference for the path of the local storage persistent store. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.m: (-[WebPreferences _localStorageDatabasePath]): (-[WebPreferences _setLocalStorageDatabasePath:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2008-04-18 Brady Eidson <beidson@apple.com> Reviewed by Sam Weinig Don't clear the PageGroup on _close, as the WebCore::Page destructor already does this. No reason to do the work twice... * WebView/WebView.mm: (-[WebView _close]): 2008-04-17 Eric Seidel <eric@webkit.org> Reviewed by beth. Rename Frame::renderer() to contentRenderer() and fix uses. * Misc/WebCoreStatistics.mm: * WebView/WebRenderNode.mm: (-[WebRenderNode initWithWebFrameView:]): 2008-04-17 Jon Honeycutt <jhoneycutt@apple.com> Reviewed by mrowe. * WebView/WebFrame.mm: Remove temporary build fix. 2008-04-17 Mark Rowe <mrowe@apple.com> Reviewed by Dan Bernstein. Fix <rdar://problem/5863552> REGRESSION (r30741): Attachments don't appear in the iChat message window after sending The order of arguments to -[NSDictionary initWithObjects:andKeys:] had been transposed accidentally during refactoring. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createPlugin): Pass the arguments in the correct order. 2008-04-17 Mark Rowe <mrowe@apple.com> Rubber-stamped by Dan Bernstein. Fix the Mac build. * WebView/WebFrame.mm: Define HAVE_ACCESSIBILITY before including AccessibilityObject.h and AXObjectCache.h to get things building for now. This comes from config.h in WebCore but we don't have an equivalent in WebKit so we'll need to work out the correct place for this to live going forward. 2008-04-15 Kevin Decker <kdecker@apple.com> Reviewed by Anders. <rdar://problem/5412759> CrashTracer: [USER] 22 crashes in Safari at com.apple.quicktime.webplugin: NPN_SetValue + 15403 In certain situations, code in WebBasePluginPackage would load a plug-in only for the explicit reason of asking it to create a preference file, but wouldn't actually unload the bundle. This created problems for the QuickTime WebKit plug-in by unloading a bundle out from underneath itself. * Plugins/WebBasePluginPackage.h: Added unload method. * Plugins/WebBasePluginPackage.m: (-[WebBasePluginPackage unload]): Added new method. Currently, only Netscape plug-ins support unload. (-[WebBasePluginPackage pListForPath:createFile:]): Added a call to unload. * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage unload]): Added. 2008-04-15 Anders Carlsson <andersca@apple.com> Reviewed by Adam. Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES. * Configurations/WebKit.xcconfig: 2008-04-15 Brady Eidson <beidson@apple.com> Reviewed by John Sullivan Do a more complete job adding the "WebArchiveDebugMode" pref * WebView/WebPreferences.m: Add both getter *and* setter (-[WebPreferences webArchiveDebugModeEnabled]): (-[WebPreferences setWebArchiveDebugModeEnabled:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Call the renamed getter 2008-04-14 Brady Eidson <beidson@apple.com> Reviewed by Anders Add a hidden pref to debug WebArchive loading. With this pref on, when loading a WebArchive, if the resource isn't in the ArchiveResourceCollection, the loader will not fall back to the network and will instead fail the load as "cancelled." * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.m: (+[WebPreferences initialize]): (-[WebPreferences _webArchiveDebugModeEnabled]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): 2008-04-11 David Hyatt <hyatt@apple.com> Rename CachedResource ref/deref methods to addClient/removeClient. Reviewed by olliej * WebView/WebHTMLView.mm: (-[WebHTMLViewPrivate dealloc]): (-[WebHTMLViewPrivate finalize]): (-[WebHTMLViewPrivate clear]): (-[WebHTMLView setPromisedDragTIFFDataSource:WebCore::]): 2008-04-07 Brady Eidson <beidson@apple.com> Add "ENABLE_DOM_STORAGE" to keep in sync with the rest of the project * Configurations/WebKit.xcconfig: 2008-04-04 Adam Roben <aroben@apple.com> Use WebCore's ICU headers instead of our own copy Rubberstamped by Tim Hatcher. * Configurations/WebKit.xcconfig: Pick up ICU headers from WebCore's PrivateHeaders. 2008-04-04 Adam Roben <aroben@apple.com> Fix <rdar://problem/5804776> Would like to use WebCore's ForwardingHeaders in WebKit without manually creating copies Patch by Tim Hatcher, typed by me. * Configurations/WebKit.xcconfig: Use the copy of ForwardingHeaders in WebCore's PrivateHeaders instead of our own copy. 2008-04-04 Ada Chan <adachan@apple.com> Now we pass width and height directly as integers to format the window title for a standalone image. Reviewed by Dan. * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory imageTitleForFilename:width:height:]): 2008-04-03 Nicholas Shanks <webkit@nickshanks.com> Updated by Dan Bernstein. Reviewed by Dave Hyatt. - WebKit part of fixing http://bugs.webkit.org/show_bug.cgi?id=6484 font-weight does not properly support graded weights * WebView/WebHTMLView.mm: (-[WebHTMLView _styleFromFontAttributes:]): (-[WebHTMLView _originalFontB]): (-[WebHTMLView _addToStyle:fontA:fontB:]): 2008-04-02 Mark Rowe <mrowe@apple.com> Reviewed by Oliver Hunt. Ensure that debug symbols are generated for x86_64 and ppc64 builds. * Configurations/Base.xcconfig: 2008-03-31 Alice Liu <alice.liu@apple.com> Reviewed by Darin Adler. * WebView/WebFrame.mm: (-[WebFrame _accessibilityTree]): The syntax for fetching an object from the AXObjectCache changed slightly 2008-03-31 Brady Eidson <beidson@apple.com> Reviewed by Jon Honeycutt Move a WebArchive loading check into WebCore * WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation receivedData:withDataSource:]): Don't check "isDisplayingWebArchive" as WebCore is now responsible for checking that state 2008-03-31 Brady Eidson <beidson@apple.com> Reviewed by Darin and Mitz's rubber stamp Remove dataForArchivedSelection(WebCore::Frame*) from the EditorClient - only usage is now directly in WebCore * WebCoreSupport/WebEditorClient.mm: * WebCoreSupport/WebEditorClient.h: 2008-03-28 Brady Eidson <beidson@apple.com> Rubberstamped by Darin Adler Remove WebArchiver.h/mm * WebView/WebArchiver.h: Removed. * WebView/WebArchiver.mm: Removed. * DOM/WebDOMOperations.mm: * WebCoreSupport/WebDragClient.mm: * WebCoreSupport/WebEditorClient.mm: * WebView/WebDataSource.mm: * WebView/WebHTMLView.mm: 2008-03-28 Brady Eidson <beidson@apple.com> Reviewed by Darin Adler Now that WebCore can create archives from a frame selection directly, we don't need it in WebArchiver anymore * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::dataForArchivedSelection): * WebView/WebArchiver.h: Nuke archiveSelectionInFrame, as there are no remaining users * WebView/WebArchiver.mm: Ditto * WebView/WebHTMLView.mm: (-[WebHTMLView _writeSelectionWithPasteboardTypes:toPasteboard:cachedAttributedString:]): 2008-03-28 Brady Eidson <beidson@apple.com> Reviewed by Darin Adler More Kit->Core WebArchive changes. Create an archive from the current selection in a frame * WebView/WebArchiver.mm: Remove one more *undeclared* method, the last method will drop off easily in a followup 2008-03-28 Brady Eidson <beidson@apple.com> Reviewed by Sam Weinig WebArchive saga continues - Can now make archives from ranges in WebCore * DOM/WebDOMOperations.mm: (-[DOMRange webArchive]): (-[DOMRange markupString]): * WebView/WebArchiver.h: Remove newly obsolete [WebArchiver archiveRange:] * WebView/WebArchiver.mm: 2008-03-28 Brady Eidson <beidson@apple.com> Reviewed by Sam Weinig More Kit->Core webarchive code movement * DOM/WebDOMOperations.mm: (-[DOMNode markupString]): Call createFullMarkup() instead * WebView/WebFrame.mm: Remove obsolete _markupStringFromNode * WebView/WebFrameInternal.h: Ditto 2008-03-28 Brady Eidson <beidson@apple.com> Reviewed by Sam Weinig Fold [WebArchiver archiveFrame:] into WebDataSource - the last remaining caller * WebView/WebArchiver.h: * WebView/WebArchiver.mm: * WebView/WebDataSource.mm: (-[WebDataSource webArchive]): 2008-03-28 Brady Eidson <beidson@apple.com> Reviewed by Sam Weinig Remove unused [WebArchiver archiveNode:], made obsolete in r31400 * WebView/WebArchiver.h: * WebView/WebArchiver.mm: 2008-03-28 Brady Eidson <beidson@apple.com> Reviewed by Darin "Yet another transitional step" to empty out WebKit-based code for archiving. With this patch, the key operation of "Creating a WebArchive rooted at a single Node" takes place entirely within WebCore, and opens the door to saving WebArchives on Windows. * DOM/WebDOMOperations.mm: * WebView/WebArchiver.mm: (+[WebArchiver _archiveWithMarkupString:fromFrame:nodes:]): 2008-03-27 Brady Eidson <beidson@apple.com> Reviewed by Adam Roben Move [WebDataSource mainResource] and [WebDataSource subresources] down into WebCore as the push to core-ify WebArchives continues. This patch also introduces a behavior change. WebCore allows ArchiveResources with null or empty data. WebKit has had the inexplicable distinction of allowing empty Data in a WebResource, but not null. Since WebResource is API, I decided to leave it be to avoid a behavior change. But internally created resources (as in "while archiving a page") are accepting of null or empty data. This actually fixes a bug where not all subframes are archived, and resulted in a layout test change. * WebView/WebDataSource.mm: (-[WebDataSource mainResource]): Call DocumentLoader implementation (-[WebDataSource subresources]): Ditto * WebView/WebFrame.mm: Remove [WebFrame _getAllResourceDatas:andResponses:] as its only caller is obsolete * WebView/WebFrameInternal.h: 2008-03-27 Brady Eidson <beidson@apple.com> Reviewed by Adam Change the "init from WebCore resource" version of WebResource to take PassRefPtr (more efficient) * WebView/WebResource.mm: (-[WebResource _initWithCoreResource:]): * WebView/WebResourceInternal.h: 2008-03-26 Brady Eidson <beidson@apple.com> Build fix - accidentally checked in this change which was work in progress * DOM/WebDOMOperations.mm: 2008-03-26 Brady Eidson <beidson@apple.com> Reviewed by Darin When we create a WebArchive, we walk every node from some starting point, asking each node along the way "What are your subresource URLs?" That logic is currently in DOMNode in WebKitMac - this patch moves that ability down into WebCore::Node * DOM/WebDOMOperations.mm: (-[DOMNode _subresourceURLs]): One generic DOMNode method can now handle all DOMNodes by calling into individual WebCore::Node implementations * DOM/WebDOMOperationsPrivate.h: 2008-03-26 Brady Eidson <beidson@apple.com> Reviewed by Mark Rowe Part of the continued push to move WebArchive-related code down to WebCore, this moves [WebDataSource subresourceForURL:] down to DocumentLoader->subresource() * WebView/WebDataSource.mm: (-[WebDataSource subresourceForURL:]): Call through to the DocumentLoader * WebView/WebFrame.mm: Remove [WebFrame _getData:andResponse:forURL:], as its only use has now been ported down to WebCore * WebView/WebFrameInternal.h: 2008-03-26 Mark Rowe <mrowe@apple.com> Rubber-stamped by Brady Eidson. Update FEATURE_DEFINES to be consistent with the other locations in which it is defined. * Configurations/WebKit.xcconfig: 2008-03-26 Mark Rowe <mrowe@apple.com> Reviewed by David Hyatt. Make the Ahem font antialias correctly on Acid3 on Tiger. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2008-03-26 Mark Rowe <mrowe@apple.com> Fix the Mac build. * MigrateHeaders.make: Copy the newly generated header into the right place. 2008-03-25 Brady Eidson <beidson@apple.com> Reviewed by Beth Dakin Remove entirely unused internal method * WebView/WebArchiver.h: * WebView/WebArchiver.mm: 2008-03-25 Brady Eidson <beidson@apple.com> Reviewed by Adam Roben <rdar://problem/5819308> - View Source is empty when view webarchives * WebCore.base.exp: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::setParsedArchiveData): (WebCore::DocumentLoader::parsedArchiveData): * loader/DocumentLoader.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::finishedLoadingDocument): Set the archive's MainResource data as the parsedArchiveData in the DocumentLoader 2008-03-25 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=17933 Reopen All Windows From Last Session causes crash * WebView/WebHTMLView.mm: (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): Added null check. 2008-03-25 Brady Eidson <beidson@apple.com> Reviewed by Jon Honeycutt's rubberstamp Fix a leak with the new WebArchive setup * WebView/WebArchive.mm: (-[WebArchivePrivate setCoreArchive:]): Deref() the old WebArchive 2008-03-25 Brady Eidson <beidson@apple.com> Reviewed by Darin Removed the concept of "pending archive resources" and the "archive resources delivery timer" from WebFrameLoaderClient, as those concepts have been pushed into WebCore * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::WebFrameLoaderClient): 2008-03-25 Brady Eidson <beidson@apple.com> Reviewed by Darin Remove newly obsolete FrameLoaderClient methods * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: 2008-03-25 Brady Eidson <beidson@apple.com> Release build fix * WebView/WebArchive.mm: (-[WebArchive subresources]): (-[WebArchive subframeArchives]): 2008-03-25 Brady Eidson <beidson@apple.com> Reviewed by Darin <rdar://problem/4516169> - Support WebArchives on Windows And paves the way for many future WebArchive bug fixes and enhancements This change moves most of the real workhorse code about WebArchives into WebCore. It maintains 1-to-1 relationships between a few objects in WebCore and WebKit. Such as: * WebArchive <-> LegacyWebArchive * WebResource <-> ArchiveResource * WebUnarchivingState <-> ArchiveResourceCollection The other biggest changes involve many FrameLoaderClient methods that existed soley for WebArchives and now exist in WebCore * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::clearUnarchivingState): Emptied - to be removed in a followup patch (WebFrameLoaderClient::finalSetupForReplace): (WebFrameLoaderClient::setDefersLoading): (WebFrameLoaderClient::willUseArchive): (WebFrameLoaderClient::isArchiveLoadPending): (WebFrameLoaderClient::cancelPendingArchiveLoad): (WebFrameLoaderClient::clearArchivedResources): (WebFrameLoaderClient::createFrame): * WebView/WebArchive.mm: (+[WebArchivePrivate initialize]): (-[WebArchivePrivate init]): (-[WebArchivePrivate initWithCoreArchive:]): (-[WebArchivePrivate coreArchive]): (-[WebArchivePrivate setCoreArchive:]): (-[WebArchivePrivate dealloc]): (-[WebArchivePrivate finalize]): (-[WebArchive init]): (-[WebArchive initWithMainResource:subresources:subframeArchives:]): (-[WebArchive initWithData:]): (-[WebArchive initWithCoder:]): (-[WebArchive encodeWithCoder:]): (-[WebArchive mainResource]): (-[WebArchive subresources]): (-[WebArchive subframeArchives]): (-[WebArchive data]): (-[WebArchive _initWithCoreLegacyWebArchive:WebCore::]): (-[WebArchive WebCore::]): * WebView/WebArchiveInternal.h: Added. * WebView/WebDataSource.mm: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _addSubframeArchives:]): (-[WebDataSource _documentFragmentWithArchive:]): (-[WebDataSource subresourceForURL:]): (-[WebDataSource addSubresource:]): * WebView/WebDataSourceInternal.h: * WebView/WebFrame.mm: (-[WebFrame loadArchive:]): * WebView/WebFrameInternal.h: * WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): * WebView/WebResource.mm: (+[WebResourcePrivate initialize]): (-[WebResourcePrivate init]): (-[WebResourcePrivate initWithCoreResource:]): (-[WebResourcePrivate dealloc]): (-[WebResourcePrivate finalize]): (-[WebResource initWithCoder:]): (-[WebResource encodeWithCoder:]): (-[WebResource data]): (-[WebResource URL]): (-[WebResource MIMEType]): (-[WebResource textEncodingName]): (-[WebResource frameName]): (-[WebResource _initWithCoreResource:WebCore::]): (-[WebResource WebCore::]): (-[WebResource _ignoreWhenUnarchiving]): (-[WebResource _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:]): (-[WebResource _fileWrapperRepresentation]): (-[WebResource _response]): (-[WebResource _stringValue]): * WebView/WebResourceInternal.h: Added. * WebView/WebResourcePrivate.h: * WebView/WebUnarchivingState.h: Removed. * WebView/WebUnarchivingState.m: Removed. 2008-03-24 Oliver Hunt <oliver@apple.com> Reviewed by Mark Rowe. Bug 18030: REGRESSION(r31236): Space bar fails to scroll down page <http://bugs.webkit.org/show_bug.cgi?id=18030> Rollout keyDown changes from r31236 -- fix for keyDown behaviour is tracked by Bug 18057: keyDown incorrectly propagates up the frame tree <http://bugs.webkit.org/show_bug.cgi?id=18057> * WebView/WebHTMLView.mm: (-[WebHTMLView keyDown:]): 2008-03-24 Cameron Zwarich <cwzwarich@uwaterloo.ca> Reviewed by Maciej, landed by Brady Bug 3580: iFrames Appear to be Cached <http://bugs.webkit.org/show_bug.cgi?id=3580> Bug 15486: REGRESSION: Reload causes WebKit to *forget* fragment URLs <http://bugs.webkit.org/show_bug.cgi?id=15486> Bug 15554: Reload causes <object> to use old data <http://bugs.webkit.org/show_bug.cgi?id=15554> If a page is reloaded, a child frame's URL can not be taken from a history item. * WebView/WebFrame.mm: (-[WebFrame _loadURL:referrer:intoChild:]): 2008-03-24 Darin Adler <darin@apple.com> Reviewed by Beth. - fix <rdar://problem/5817067> -[WebDataSource unreachableURL] invokes KURL's copy constructor * History/WebHistoryItem.mm: (-[WebHistoryItem URL]): Use a reference to avoid making a copy. * WebView/WebDataSource.mm: (-[WebDataSource _URL]): Ditto. (-[WebDataSource unreachableURL]): Ditto. * WebView/WebHTMLView.mm: (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Ditto. * DefaultDelegates/WebDefaultContextMenuDelegate.mm: * History/WebHistory.mm: * Misc/WebElementDictionary.mm: * Misc/WebNSAttributedStringExtras.mm: Remove unneeded imports of KURL.h. 2008-03-24 Brady Eidson <beidson@apple.com> Reviewed by Darin's rubberstamp Rename this file for upcoming work. * WebView/WebArchive.m: Removed. * WebView/WebArchive.mm: Copied from WebKit/mac/WebView/WebArchive.m. 2008-03-24 Alexey Proskuryakov <ap@webkit.org> Build fix. * MigrateHeaders.make: Added DOMSVGAltGlyphElement.h and DOMSVGAltGlyphElementInternal.h. 2008-03-23 Oliver Hunt <oliver@apple.com> Reviewed by Maciej. Bug 17670: Key events may improperly propagate from iframe to parent frame <http://bugs.webkit.org/show_bug.cgi?id=17670> Bug 16381: REGRESSION: Shift, command, option, ctrl keys in Gmail Rich Text changes focus <http://bugs.webkit.org/show_bug.cgi?id=16381> Prevent the Cocoa event system from propagating key events to the parent WebHTMLView, as that results in us dispatching the key events for each frame going up the frame tree. * WebView/WebHTMLView.mm: (-[WebHTMLView keyDown:]): (-[WebHTMLView keyUp:]): (-[WebHTMLView flagsChanged:]): 2008-03-21 Timothy Hatcher <timothy@apple.com> Bug 17980: Regression: Inspector highlighting of webpage not cleared when going to new URL http://bugs.webkit.org/show_bug.cgi?id=17980 Reviewed by Adam. The new highlight drawing was not honoring the fade value, so it was always drawing at full opacity. The animation code didn't match Windows and the new highlight anyway, so it has been removed. The highlight how just detaches when it is hidden. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController windowShouldClose:]): Call hideHighlight. (-[WebInspectorWindowController close]): Ditto. (-[WebInspectorWindowController highlightNode:]): Call attach. (-[WebInspectorWindowController hideHighlight]): Call detach and release _currentHighlight. * WebInspector/WebNodeHighlight.h: * WebInspector/WebNodeHighlight.m: (-[WebNodeHighlight initWithTargetView:inspectorController:]): (-[WebNodeHighlight dealloc]): Assert we have no _highlightView. (-[WebNodeHighlight attach]): Renamed from attachHighlight. (-[WebNodeHighlight detach]): Renamed from detachHighlight. (-[WebNodeHighlight setNeedsUpdateInTargetViewRect:]): Renamed from setHolesNeedUpdateInTargetViewRect:. * WebInspector/WebNodeHighlightView.h: * WebInspector/WebNodeHighlightView.m: (-[WebNodeHighlightView setNeedsDisplayInRect:]): Renamed from setHolesNeedUpdateInRect:. 2008-03-20 Mark Rowe <mrowe@apple.com> Reviewed by Sam Weinig. Ensure that the defines in FEATURE_DEFINES are sorted so that they will match the default settings of build-webkit. This will prevent the world from being rebuilt if you happen to switch between building in Xcode and with build-webkit on the command-line. * Configurations/WebKit.xcconfig: 2008-03-20 Adam Roben <aroben@apple.com> Make WebNodeHighlightView use InspectorController to do its painting Reviewed by Tim Hatcher. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController highlightNode:]): Pass the InspectorController to the WebNodeHighlight, and don't call setHighlightedNode: (which has been removed). (-[WebInspectorWindowController hideHighlight]): Removed call to setHighlightedNode:. * WebInspector/WebNodeHighlight.h: - Replaced _highlightNode with _inspectorController - Removed _highlightedNode accessors - Added -inspectorController method * WebInspector/WebNodeHighlight.m: (-[WebNodeHighlight initWithTargetView:inspectorController:]): Now takes an InspectorController* and stores it in _inspectorController. (-[WebNodeHighlight dealloc]): Removed code dealing with _highlightedNode. (-[WebNodeHighlight inspectorController]): Added. * WebInspector/WebNodeHighlightView.m: Removed FileInternal category. (-[WebNodeHighlightView isFlipped]): Added. WebCore expects all GraphicsContexts to be based on a flipped CGContext, so we have to specify that this view is flipped. (-[WebNodeHighlightView drawRect:]): Changed to create a GraphicsContext and pass it to InspectorController::drawNodeHighlight. 2008-03-18 David Hyatt <hyatt@apple.com> Add support for a preference in WebKit that can be used in nightly builds to test full page zoom. Reviewed by Antti * WebView/WebPreferenceKeysPrivate.h: * WebView/WebView.mm: (-[WebView setTextSizeMultiplier:]): (-[WebView canMakeTextSmaller]): (-[WebView makeTextSmaller:]): (-[WebView canMakeTextLarger]): (-[WebView makeTextLarger:]): (-[WebView canMakeTextStandardSize]): (-[WebView makeTextStandardSize:]): 2008-03-17 Eric Seidel <eric@webkit.org> Reviewed by darin. Export _NPN_IntFromIdentifier as part of our NPAPI interface * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): 2008-03-14 Brady Eidson <beidson@apple.com> Reviewed by Brian Dash's rubberstamp Remove a class declaration for a class that has never existed * WebView/WebResource.h: 2008-03-14 David D. Kilzer <ddkilzer@apple.com> Unify concept of enabling the Mac Java bridge. Reviewed by Darin and Anders. * Plugins/WebPluginJava.h: Removed unused file. * WebCoreSupport/WebFrameLoaderClient.h: (WebFrameLoaderClient::javaApplet): Added #if ENABLE(MAC_JAVA_BRIDGE) guard. * WebCoreSupport/WebFrameLoaderClient.mm: Ditto for #import and NSView SPI method. (WebFrameLoaderClient::javaApplet): Ditto. 2008-03-13 Antti Koivisto <antti@apple.com> Reviewed by Darin Adler. * ForwardingHeaders/wtf/Deque.h: Added. 2008-03-13 Anders Carlsson <andersca@apple.com> Reviewed by Adam. Call originalRequest, not initialRequest. * WebView/WebDataSource.mm: (-[WebDataSource initialRequest]): 2008-03-12 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - cleanup after removing the bridge * DOM/WebDOMOperations.mm: (-[DOMDocument URLWithAttributeString:]): Call computeURL directly. * Misc/WebCoreStatistics.mm: (-[WebFrame renderTreeAsExternalRepresentation]): Call externalRepresentation directly. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView loadPluginRequest:]): Use core function instead of _frameLoader method. (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): Ditto. * Plugins/WebPluginController.mm: (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]): Ditto. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::frameLoaderDestroyed): Added a call to the new _clearCoreFrame method. Without this we could leave a stale frame pointer around. (WebFrameLoaderClient::dispatchDidReceiveIcon): Rewrote assertion so it's not the single caller of the _isMainFrame method. (WebFrameLoaderClient::transitionToCommittedForNewPage): Use core function instead of _frameLoader method. (WebFrameLoaderClient::createFrame): Moved code here from _addChild. * WebView/WebFrame.mm: Removed lots of methods. Some were moved elsewhere, others turned out to be unused. (core): Added overload for DocumentFragment. (kit): Ditto. (-[WebFrame _loadURL:referrer:intoChild:]): Get to Frame using _private->coreFrame and to FrameLoader with _private->coreFrame->loader(). (-[WebFrame _attachScriptDebugger]): Ditto. (-[WebFrame _clearCoreFrame]): Added. (-[WebFrame _updateBackground]): More of the same. (-[WebFrame _unmarkAllBadGrammar]): Ditto. (-[WebFrame _unmarkAllMisspellings]): Ditto. (-[WebFrame _hasSelection]): Ditto. (-[WebFrame _atMostOneFrameHasSelection]): Ditto. (-[WebFrame _findFrameWithSelection]): Ditto. (-[WebFrame _dataSource]): Ditto. (-[WebFrame _addData:]): Streamlined code a bit. (-[WebFrame _replaceSelectionWithText:selectReplacement:smartReplace:]): Ditto. (-[WebFrame _receivedData:textEncodingName:]): Ditto. (-[WebFrame _isDescendantOfFrame:]): Ditto. (-[WebFrame _bodyBackgroundColor]): Ditto. (-[WebFrame _isFrameSet]): Ditto. (-[WebFrame _firstLayoutDone]): Ditto. (-[WebFrame _loadType]): Ditto. (-[WebFrame _isDisplayingStandaloneImage]): Ditto. (-[WebFrame name]): Ditto. (-[WebFrame DOMDocument]): Ditto. (-[WebFrame frameElement]): Ditto. (-[WebFrame provisionalDataSource]): Ditto. (-[WebFrame dataSource]): Ditto. (-[WebFrame loadRequest:]): Ditto. (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): Ditto. (-[WebFrame loadArchive:]): Ditto. (-[WebFrame stopLoading]): Ditto. (-[WebFrame reload]): Ditto. (-[WebFrame findFrameNamed:]): Ditto. (-[WebFrame parentFrame]): Ditto. (-[WebFrame childFrames]): Ditto. (-[WebFrame windowObject]): Ditto. (-[WebFrame globalContext]): Ditto. * WebView/WebFrameInternal.h: Added overloads of core and kit. Removed method declarations. * WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation documentSource]): Moved code here from WebFrame. (formElementFromDOMElement): Ditto. (-[WebHTMLRepresentation elementWithName:inForm:]): Ditto. (inputElementFromDOMElement): Ditto. (-[WebHTMLRepresentation elementDoesAutoComplete:]): Ditto. (-[WebHTMLRepresentation elementIsPassword:]): Ditto. (-[WebHTMLRepresentation formForElement:]): Ditto. (-[WebHTMLRepresentation currentForm]): Ditto. (-[WebHTMLRepresentation controlsInForm:]): Ditto. (-[WebHTMLRepresentation searchForLabels:beforeElement:]): Ditto. (-[WebHTMLRepresentation matchLabels:againstElement:]): Ditto. * WebView/WebHTMLView.mm: (-[WebHTMLView _frameOrBoundsChanged]): Moved sendScrollEvent code here from WebFrame. (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]): Call createFragmentFromText directly instead of via WebFrame. (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): Moved layout calls here from WebFrame. (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto. (-[WebHTMLView _updateFontPanel]): Ditto, but with fontForSelection. (-[WebHTMLView _canSmartCopyOrDelete]): Ditto, but with selectionGranularity. (-[WebHTMLView markedRange]): Moved code here from _markedTextNSRange. (-[WebHTMLView attributedSubstringFromRange:]): Tweaked code a bit. (-[WebHTMLView searchFor:direction:caseSensitive:wrap:startInSelection:]): Moved code here from WebFrame. (-[WebHTMLView elementAtPoint:allowShadowContent:]): Ditto. (-[WebHTMLView markAllMatchesForText:caseSensitive:limit:]): Ditto. (-[WebHTMLView setMarkedTextMatchesAreHighlighted:]): Ditto. (-[WebHTMLView markedTextMatchesAreHighlighted]): Ditto. (-[WebHTMLView unmarkAllTextMatches]): Ditto. (-[WebHTMLView rectsForTextMatches]): Ditto. * WebView/WebHTMLViewInternal.h: Removed unused method declarations. * WebView/WebPDFView.mm: (-[WebPDFView PDFViewWillClickOnLink:withURL:]): Use core function instead of _frameLoader method. * WebView/WebRenderNode.mm: (copyRenderNode): Moved code here from WebFrame. (-[WebRenderNode initWithWebFrameView:]): Ditto. * WebView/WebResource.mm: (-[WebResource _stringValue]): Moved code here from WebFrame. * WebView/WebView.mm: (-[WebView _close]): Use core function intsead of _frameLoader method. (-[WebView setCustomTextEncodingName:]): Ditto. (-[WebView setHostWindow:]): Moved code here from WebFrame. (aeDescFromJSValue): Moved this here from WebFrame. (-[WebView aeDescByEvaluatingJavaScriptFromString:]): Moved code here from WebFrame. 2008-03-12 Darin Adler <darin@apple.com> Reviewed by Anders. - http://bugs.webkit.org/show_bug.cgi?id=17640 eliminate WebCoreFrameBridge Moved all the code from the bridge into WebFrame. This need not be the final home of these methods -- they can be moved closer to their callers and improved further -- but it eliminates the bridge without requiring a rewrite of the code. It's a fairly mechanical process (just adding underscores to method names really). There's even a chance that some of the methods are unused. Those we can remove after checking if that's so. * DOM/WebDOMOperations.mm: (-[DOMNode markupString]): Use WebFrame rather than bridge. (-[DOMDocument webFrame]): Changed to use the core and kit functions instead of using the bridge. (-[DOMDocument URLWithAttributeString:]): Use WebFrame rather than bridge. (-[DOMRange markupString]): Ditto. * DOM/WebDOMOperationsPrivate.h: Removed _bridge methods. * DefaultDelegates/WebDefaultContextMenuDelegate.mm: Removed unneeded import. * History/WebHistoryItem.mm: Ditto. * MigrateHeaders.make: Added DOMDocumentFragmentInternal.h. * Misc/WebCoreStatistics.mm: (-[WebFrame renderTreeAsExternalRepresentation]): Use WebFrame rather than bridge. * Misc/WebElementDictionary.mm: Removed unneeded import. * Misc/WebKitStatistics.m: (+[WebKitStatistics bridgeCount]): Removed WebBridgeCount and just return 0. * Misc/WebKitStatisticsPrivate.h: Ditto. * Misc/WebNSAttributedStringExtras.mm: Removed unneeded import. * Misc/WebNSPasteboardExtras.mm: Ditto. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): Use WebFrame rather than bridge. * Plugins/WebNetscapePluginEmbeddedView.mm: Removed unneeded import. * Plugins/WebNetscapePluginStream.mm: Ditto. * Plugins/WebPluginContainerCheck.mm: (-[WebPluginContainerCheck _isForbiddenFileLoad]): Use WebFrame rather than bridge to get to the WebCore::Frame. * Plugins/WebPluginController.h: Declare webFrame method and remove bridge method. * Plugins/WebPluginController.mm: (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]): Use WebFrame rather than bridge. * WebCoreSupport/WebEditorClient.mm: (selectorForKeyEvent): Tweaked comment. * WebCoreSupport/WebFrameBridge.h: Removed. * WebCoreSupport/WebFrameBridge.mm: Removed. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::frameLoaderDestroyed): Removed bridge assertion. (WebFrameLoaderClient::detachedFromParent4): Removed bridge teardown code. I could remove this function entirely, but it looks like the Qt port is using it. * WebCoreSupport/WebViewFactory.mm: Removed unneeded import. * WebView/WebArchiver.mm: (+[WebArchiver archiveRange:]): Use WebFrame rather than bridge. (+[WebArchiver archiveNode:]): Ditto. (+[WebArchiver archiveSelectionInFrame:]): Ditto. * WebView/WebDataSource.mm: (-[WebDataSource _replaceSelectionWithArchive:selectReplacement:]): Ditto. (-[WebDataSource _documentFragmentWithArchive:]): Ditto. (-[WebDataSource subresources]): Ditto. (-[WebDataSource subresourceForURL:]): Ditto. * WebView/WebDataSourceInternal.h: Removed _bridge method. * WebView/WebFrame.mm: (-[WebFramePrivate dealloc]): Removed code to release the bridge. (core): Go directly to the core frame, not via the bridge. (+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]): Remove the code to deal with the bridge. (-[WebFrame _initWithWebFrameView:webView:]): Ditto. Also added code to set the shouldCreateRenderers flag, formerly on the bridge. (-[WebFrame _updateBackground]): Change to call mehods on self, not bridge. (aeDescFromJSValue): Moved here from bridge. (-[WebFrame _domain]): Ditto. (-[WebFrame _addData:]): Ditto. (-[WebFrame _stringWithDocumentTypeStringAndMarkupString:]): Ditto. (-[WebFrame _nodesFromList:]): Ditto. (-[WebFrame _markupStringFromNode:nodes:]): Ditto. (-[WebFrame _markupStringFromRange:nodes:]): Ditto. (-[WebFrame _selectedString]): Ditto. (-[WebFrame _stringForRange:]): Ditto. (-[WebFrame _forceLayoutAdjustingViewSize:]): Ditto. (-[WebFrame _forceLayoutWithMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): Ditto. (-[WebFrame _sendScrollEvent]): Ditto. (-[WebFrame _drawRect:]): Ditto. (-[WebFrame _computePageRectsWithPrintWidthScaleFactor:printHeight:]): Ditto. (-[WebFrame _adjustPageHeightNew:top:bottom:limit:]): Ditto. (-[WebFrame _copyRenderNode:copier:]): Ditto. (-[WebFrame _copyRenderTree:]): Ditto. (inputElementFromDOMElement): Ditto. (formElementFromDOMElement): Ditto. (-[WebFrame _elementWithName:inForm:]): Ditto. (-[WebFrame _elementDoesAutoComplete:]): Ditto. (-[WebFrame _elementIsPassword:]): Ditto. (-[WebFrame _formForElement:]): Ditto. (-[WebFrame _currentForm]): Ditto. (-[WebFrame _controlsInForm:]): Ditto. (-[WebFrame _searchForLabels:beforeElement:]): Ditto. (-[WebFrame _matchLabels:againstElement:]): Ditto. (-[WebFrame _URLWithAttributeString:]): Ditto. (-[WebFrame _searchFor:direction:caseSensitive:wrap:startInSelection:]): Ditto. (-[WebFrame _markAllMatchesForText:caseSensitive:limit:]): Ditto. (-[WebFrame _markedTextMatchesAreHighlighted]): Ditto. (-[WebFrame _setMarkedTextMatchesAreHighlighted:]): Ditto. (-[WebFrame _unmarkAllTextMatches]): Ditto. (-[WebFrame _rectsForTextMatches]): Ditto. (-[WebFrame _stringByEvaluatingJavaScriptFromString:]): Ditto. (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): Ditto. (-[WebFrame _aeDescByEvaluatingJavaScriptFromString:]): Ditto. (-[WebFrame _caretRectAtNode:offset:affinity:]): Ditto. (-[WebFrame _firstRectForDOMRange:]): Ditto. (-[WebFrame _scrollDOMRangeToVisible:]): Ditto. (-[WebFrame _baseURL]): Ditto. (-[WebFrame _stringWithData:]): Ditto. (+[WebFrame _stringWithData:textEncodingName:]): Ditto. (-[WebFrame _needsLayout]): Ditto. (-[WebFrame _renderTreeAsExternalRepresentation]): Ditto. (-[WebFrame _accessibilityTree]): Ditto. (-[WebFrame _setBaseBackgroundColor:]): Ditto. (-[WebFrame _setDrawsBackground:]): Ditto. (-[WebFrame _rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]): Ditto. (-[WebFrame _selectionGranularity]): Ditto. (-[WebFrame _convertToNSRange:]): Ditto. (-[WebFrame _convertToDOMRange:]): Ditto. (-[WebFrame _convertNSRangeToDOMRange:]): Ditto. (-[WebFrame _convertDOMRangeToNSRange:]): Ditto. (-[WebFrame _markDOMRange]): Ditto. (-[WebFrame _markedTextNSRange]): Ditto. (-[WebFrame _smartDeleteRangeForProposedRange:]): Ditto. (-[WebFrame _smartInsertForString:replacingRange:beforeString:afterString:]): Ditto. (-[WebFrame _documentFragmentWithMarkupString:baseURLString:]): Ditto. (-[WebFrame _documentFragmentWithText:inContext:]): Ditto. (-[WebFrame _documentFragmentWithNodesAsParagraphs:]): Ditto. (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]): Ditto. (-[WebFrame _replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]): Ditto. (-[WebFrame _replaceSelectionWithMarkupString:baseURLString:selectReplacement:smartReplace:]): Ditto. (-[WebFrame _replaceSelectionWithText:selectReplacement:smartReplace:]): Ditto. (-[WebFrame _insertParagraphSeparatorInQuotedContent]): Ditto. (-[WebFrame _visiblePositionForPoint:]): Ditto. (-[WebFrame _characterRangeAtPoint:]): Ditto. (-[WebFrame _typingStyle]): Ditto. (-[WebFrame _setTypingStyle:withUndoAction:]): Ditto. (-[WebFrame _fontForSelection:]): Ditto. (-[WebFrame _dragSourceMovedTo:]): Ditto. (-[WebFrame _dragSourceEndedAt:operation:]): Ditto. (-[WebFrame _getData:andResponse:forURL:]): Ditto. (-[WebFrame _getAllResourceDatas:andResponses:]): Ditto. (-[WebFrame _canProvideDocumentSource]): Ditto. (-[WebFrame _canSaveAsWebArchive]): Ditto. (-[WebFrame _receivedData:textEncodingName:]): Ditto. (-[WebFrame _setShouldCreateRenderers:]): Put the code from the bridge in this preexisting function. Couldn't just keep the bridge method because this was already here with the same name. (-[WebFrame _selectedNSRange]): Ditto. (-[WebFrame _selectNSRange:]): Ditto. (-[WebFrame dealloc]): Remove bridge-related code. (-[WebFrame finalize]): Ditto. * WebView/WebFrameInternal.h: Added all the method declarations from the bridge. Removed the bridge parameter from the init method. Removed the #if blocks that tried to make this header work in non-C++ ObjC files -- they were broken and unused. Removed the _bridge method. * WebView/WebFrameView.mm: Removed the _bridge method. * WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation setDataSource:]): Removed the code to set up the bridge field. (-[WebHTMLRepresentation receivedData:withDataSource:]): Use WebFrame instead of bridge. (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): Ditto. (-[WebHTMLRepresentation canProvideDocumentSource]): Ditto. (-[WebHTMLRepresentation canSaveAsWebArchive]): Ditto. (-[WebHTMLRepresentation documentSource]): Ditto. (-[WebHTMLRepresentation DOMDocument]): Ditto. (-[WebHTMLRepresentation elementWithName:inForm:]): Ditto. (-[WebHTMLRepresentation elementDoesAutoComplete:]): Ditto. (-[WebHTMLRepresentation elementIsPassword:]): Ditto. (-[WebHTMLRepresentation formForElement:]): Ditto. (-[WebHTMLRepresentation currentForm]): Ditto. (-[WebHTMLRepresentation controlsInForm:]): Ditto. (-[WebHTMLRepresentation searchForLabels:beforeElement:]): Ditto. (-[WebHTMLRepresentation matchLabels:againstElement:]): Ditto. * WebView/WebHTMLRepresentationPrivate.h: Removed the _bridge method. * WebView/WebHTMLView.mm: (-[WebHTMLView _documentFragmentWithPaths:]): Use WebFrame instead of bridge. (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]): Ditto. (-[WebHTMLView _pasteAsPlainTextWithPasteboard:]): Ditto. (-[WebHTMLView _updateTextSizeMultiplier]): Ditto. (-[WebHTMLView _frameOrBoundsChanged]): Ditto. (-[WebHTMLView _smartInsertForString:replacingRange:beforeString:afterString:]): Ditto. (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]): Ditto. (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): Ditto. (-[WebHTMLView drawSingleRect:]): Ditto. (-[WebHTMLView draggedImage:movedTo:]): Ditto. (-[WebHTMLView draggedImage:endedAt:operation:]): Ditto. (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Ditto. (-[WebHTMLView knowsPageRange:]): Ditto. (-[WebHTMLView accessibilityAttributeValue:]): Ditto. (-[WebHTMLView accessibilityFocusedUIElement]): Ditto. (-[WebHTMLView accessibilityHitTest:]): Ditto. (-[WebHTMLView _accessibilityParentForSubview:]): Ditto. (-[WebHTMLView changeDocumentBackgroundColor:]): Ditto. (-[WebHTMLView _changeWordCaseWithSelector:]): Ditto. (-[WebHTMLView _changeSpellingToWord:]): Ditto. (-[WebHTMLView startSpeaking:]): Ditto. (-[WebHTMLView _updateFontPanel]): Ditto. (-[WebHTMLView _canSmartCopyOrDelete]): Ditto. (-[WebHTMLView _layoutIfNeeded]): Ditto. (-[WebHTMLView characterIndexForPoint:]): Ditto. (-[WebHTMLView firstRectForCharacterRange:]): Ditto. (-[WebHTMLView selectedRange]): Ditto. (-[WebHTMLView markedRange]): Ditto. (-[WebHTMLView attributedSubstringFromRange:]): Ditto. (-[WebHTMLView setMarkedText:selectedRange:]): Ditto. (-[WebHTMLView insertText:]): Ditto. (-[WebTextCompleteController _insertMatch:]): Ditto. (-[WebTextCompleteController doCompletion]): Ditto. (-[WebTextCompleteController endRevertingChange:moveLeft:]): Ditto. (-[WebHTMLView string]): Ditto. (-[WebHTMLView selectedString]): Ditto. (-[WebHTMLView searchFor:direction:caseSensitive:wrap:startInSelection:]): Ditto. (-[WebHTMLView markAllMatchesForText:caseSensitive:limit:]): Ditto. (-[WebHTMLView setMarkedTextMatchesAreHighlighted:]): Ditto. (-[WebHTMLView markedTextMatchesAreHighlighted]): Ditto. (-[WebHTMLView unmarkAllTextMatches]): Ditto. (-[WebHTMLView rectsForTextMatches]): Ditto. * WebView/WebRenderNode.mm: (-[WebRenderNode initWithWebFrameView:]): Ditto. * WebView/WebResource.mm: (-[WebResource _stringValue]): Ditto. * WebView/WebScriptDebugDelegate.mm: Removed unneeded include. * WebView/WebView.mm: (-[WebView _dashboardRegions]): Use WebFrame instead of bridge. (-[WebView setProhibitsMainFrameScrolling:]): Ditto. (-[WebView _setInViewSourceMode:]): Ditto. (-[WebView _inViewSourceMode]): Ditto. (-[WebView _executeCoreCommandByName:value:]): Ditto. (-[WebView stringByEvaluatingJavaScriptFromString:]): Ditto. (-[WebView aeDescByEvaluatingJavaScriptFromString:]): Ditto. (-[WebView scrollDOMRangeToVisible:]): Ditto. (-[WebView setSelectedDOMRange:affinity:]): Ditto. (-[WebView setEditable:]): Ditto. (-[WebView setTypingStyle:]): Ditto. (-[WebView typingStyle]): Ditto. (-[WebView replaceSelectionWithNode:]): Ditto. (-[WebView replaceSelectionWithText:]): Ditto. (-[WebView replaceSelectionWithMarkupString:]): Ditto. (-[WebView replaceSelectionWithArchive:]): Ditto. (-[WebView _insertNewlineInQuotedContent]): Ditto. (-[WebView _replaceSelectionWithNode:matchStyle:]): Ditto. 2008-03-12 David Hyatt <hyatt@apple.com> Make the zoom factor a float and not a percent. Reviewed by antti * WebView/WebView.mm: (-[WebView _setZoomMultiplier:isTextOnly:]): 2008-03-11 David Hyatt <hyatt@apple.com> This patch prepares Mac WebKit to handle two different zooming modes (full page zoom and text only zoom). New API is added that is parallel to the text zoom public API. You can get/set a pageSizeMultiplier and you can zoom the page in, out or reset it to the standard size. In the implementation only one zoom factor is stored, and setting one multiplier will shift you into that mode and set the common zoom factor. In other words you can't combine text zoom and page zoom. One will always win. Reviewed by Tim H. * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge finishInitializingWithPage:frameName:WebCore::frameView:ownerElement:]): * WebView/WebDocumentInternal.h: * WebView/WebHTMLView.mm: (-[WebHTMLView viewDidMoveToSuperview]): * WebView/WebPDFView.h: * WebView/WebPDFView.mm: (-[WebPDFView _zoomOut:]): (-[WebPDFView _zoomIn:]): (-[WebPDFView _resetZoom:]): (-[WebPDFView _canZoomOut]): (-[WebPDFView _canZoomIn]): (-[WebPDFView _canResetZoom]): * WebView/WebView.mm: (-[WebViewPrivate init]): (-[WebView setTextSizeMultiplier:]): (-[WebView textSizeMultiplier]): (-[WebView _setZoomMultiplier:isTextOnly:]): (-[WebView _zoomMultiplier:]): (-[WebView _realZoomMultiplier]): (-[WebView _realZoomMultiplierIsTextOnly]): (-[WebView _canZoomOut:]): (-[WebView _canZoomIn:]): (-[WebView _zoomOut:isTextOnly:]): (-[WebView _zoomIn:isTextOnly:]): (-[WebView _canResetZoom:]): (-[WebView _resetZoom:isTextOnly:]): (-[WebView canMakeTextSmaller]): (-[WebView makeTextSmaller:]): (-[WebView canMakeTextLarger]): (-[WebView makeTextLarger:]): (-[WebView canMakeTextStandardSize]): (-[WebView makeTextStandardSize:]): (-[WebView setPageSizeMultiplier:]): (-[WebView pageSizeMultiplier]): (-[WebView canZoomPageIn]): (-[WebView zoomPageIn:]): (-[WebView canZoomPageOut]): (-[WebView zoomPageOut:]): (-[WebView canResetPageZoom]): (-[WebView resetPageZoom:]): (-[WebView _searchWithSpotlightFromMenu:]): * WebView/WebViewInternal.h: * WebView/WebViewPrivate.h: 2008-03-12 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler and Sam Weinig. - <rdar://problem/4433248> use CoreText API instead of SPI on Leopard * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Made WKGetCGFontFromNSFont and WKGetNSFontATSUFontId Tiger-only. 2008-03-12 Darin Adler <darin@apple.com> - fix http://bugs.webkit.org/show_bug.cgi?id=17794 REGRESSION (r30980): 23 tests hanging on the Mac buildbot * WebView/WebFrame.mm: (-[WebFrame _initWithWebFrameView:webView:bridge:]): Added missing call to set up pointer from the bridge to the frame. (My next check-in removes the bridge entirely, but we need this until then.) 2008-03-11 Darin Adler <darin@apple.com> Reviewed by Sam. - remove all bridge-related things from WebCore except the bridge itself * DOM/WebDOMOperations.mm: (-[DOMNode _bridge]): Reimplemented to not use the bridgeForDOMDocument: method. * DefaultDelegates/WebDefaultContextMenuDelegate.mm: Removed unneeded include. * Plugins/WebPluginController.mm: Ditto. * WebCoreSupport/WebFrameBridge.h: Removed unneeded things, including the init and close methods. Added a setWebFrame: method. * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge setWebFrame:]): Added. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::frameLoaderDestroyed): Added an assertion. (WebFrameLoaderClient::detachedFromParent4): Moved the call to close on the bridge here. Soon we will be able to remove this entirely! (WebFrameLoaderClient::createFrame): Rewrote this to use the method moved into WebFrame from the bridge. * WebView/WebFrame.mm: (-[WebFramePrivate dealloc]): Added code to release the bridge, because it's now owned by the frame. (-[WebFramePrivate finalize]): Added this missing method. We'd leak the script debugger under GC without this! (kit): Rewrote the function that maps from a WebCore::Frame to a WebFrame to use WebFrameLoaderClient instead of the bridge. (+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]): Added. This is code that used to live in the bridge's init function. (+[WebFrame _createMainFrameWithPage:frameName:frameView:]): Ditto. (+[WebFrame WebCore::_createSubframeWithOwnerElement:frameName:frameView:]): Ditto. (-[WebFrame _initWithWebFrameView:webView:bridge:]): Retain the bridge, since the WebView is now the bridge's owner. (-[WebFrame _updateBackground]): Changed this one call site that was calling the WebCore::Frame::bridge function directly to use the kit function instead. (-[WebFrame dealloc]): Added code to clear the WebFrame pointer in the bridge. This code won't last long -- we're eliminating the bridge soon. (-[WebFrame finalize]): Ditto. * WebView/WebFrameInternal.h: Added a coreFrame backpointer and two new methods for creating frames. * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Rewrote this to use the method moved into WebFrame from the bridge. Gets rid of the unpleasant idiom where we have to allocate a WebFrameBridge and then immediately release it. 2008-03-11 Darin Adler <darin@apple.com> Reviewed by Anders. - remove code depending on the bridge to get from an NSView to a WebCore::Frame * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::transitionToCommittedForNewPage): Remove incorrect call to setView. A couple lines later, there is a call to _install, which sets the view to the scroll view. * WebCoreSupport/WebViewFactory.mm: Removed bridgeForView method. * WebView/WebDynamicScrollBarsView.h: Moved most of the declarations out of this file, since it's used by Safari. * WebView/WebDynamicScrollBarsViewInternal.h: Added. * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): Ditto. (-[WebDynamicScrollBarsView setAllowsScrolling:]): Ditto. (-[WebDynamicScrollBarsView allowsScrolling]): Ditto. (-[WebDynamicScrollBarsView setAllowsHorizontalScrolling:]): Ditto. (-[WebDynamicScrollBarsView setAllowsVerticalScrolling:]): Ditto. (-[WebDynamicScrollBarsView allowsHorizontalScrolling]): Ditto. (-[WebDynamicScrollBarsView allowsVerticalScrolling]): Ditto. (-[WebDynamicScrollBarsView horizontalScrollingMode]): Ditto. (-[WebDynamicScrollBarsView verticalScrollingMode]): Ditto. (-[WebDynamicScrollBarsView setHorizontalScrollingMode:]): Ditto. (-[WebDynamicScrollBarsView setHorizontalScrollingMode:andLock:]): Ditto. (-[WebDynamicScrollBarsView setVerticalScrollingMode:]): Ditto. (-[WebDynamicScrollBarsView setVerticalScrollingMode:andLock:]): Ditto. (-[WebDynamicScrollBarsView setScrollingMode:]): Ditto. (-[WebDynamicScrollBarsView setScrollingMode:andLock:]): Ditto. * WebView/WebFrameView.mm: (-[WebFrameView _web_frame]): Added. Replaces the webCoreBridge method. * WebView/WebView.mm: (-[WebView setAlwaysShowVerticalScroller:]): Updated for changes to WebCoreFrameView.h. (-[WebView alwaysShowVerticalScroller]): Ditto. (-[WebView setAlwaysShowHorizontalScroller:]): Ditto. (-[WebView alwaysShowHorizontalScroller]): Ditto. 2008-03-11 Darin Adler <darin@apple.com> Reviewed by Sam. - eliminate the remaining parts of WebCoreBridge used for calls to WebKit from WebCore * WebCoreSupport/WebChromeClient.h: Added new virtual functions that replace bridge methods. * WebCoreSupport/WebChromeClient.mm: Added lots of BEGIN_BLOCK_OBJC_EXCEPTIONS to recently-created functions. (WebChromeClient::firstResponder): Moved code here from the bridge. (WebChromeClient::makeFirstResponder): Ditto. (WebChromeClient::runOpenPanel): Ditto. (WebChromeClient::willPopUpMenu): Ditto. * WebCoreSupport/WebFrameBridge.h: Removed almost everything. What's left is related to creating the bridge and connecting it to WebCore, which will go next when I eliminate use of the bridge to get to/from the Frame*. * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge close]): Moved the code to track the bridge count here instead of the dealloc and finalize methods. 2008-03-11 Darin Adler <darin@apple.com> Reviewed by Mitz. - update code affected by Range changes * Misc/WebNSAttributedStringExtras.mm: (+[NSAttributedString _web_attributedStringFromRange:]): Update for name changes. * WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation attributedStringFrom:startOffset:to:endOffset:]): Use Range::create. * WebView/WebHTMLView.mm: (-[WebHTMLView attributedString]): Ditto. 2008-03-10 Darin Adler <darin@apple.com> Reviewed by Sam. - eliminate keyboard UI mode method from WebCoreFrameBridge * WebCoreSupport/WebChromeClient.h: Added keyboardUIMode function. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::keyboardUIMode): Ditto. Calls WebView. * WebCoreSupport/WebFrameBridge.h: Removed unused things, including the fields for keyboard UI mode. * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge dealloc]): Removed unneeded code; eliminated the fini method. (-[WebFrameBridge finalize]): Ditto. * WebView/WebView.mm: Moved the keyboard mode code in here. (-[WebView _close]): Remove observer from the distributed notification center as well as the normal one. (-[WebView _retrieveKeyboardUIModeFromPreferences:]): Added. Code moved here from the bridge. (-[WebView _keyboardUIMode]): Ditto. * WebView/WebViewInternal.h: Added _keyboardUIMode method. 2008-03-10 Darin Adler <darin@apple.com> Reviewed by Sam. - eliminate Java applet methods from WebCoreFrameBridge * WebCoreSupport/WebChromeClient.mm: Removed unneeded headers and declarations. * WebCoreSupport/WebFrameBridge.mm: Ditto. Also removed unneeded methods, including the ones that load Java applets. * WebCoreSupport/WebFrameLoaderClient.h: Added javaApplet function. * WebCoreSupport/WebFrameLoaderClient.mm: Ditto. 2008-03-07 Simon Hausmann <hausmann@webkit.org> Reviewed by Darin Adler. Done with Lars. Simplified WebViewFactory's refreshPlugins method to only refresh the plugins and not reload the frames anymore since that's now done in a platform independent manner by WebCore::Page. Also removed the now unused pluginNameForMIMEType and pluginSupportsMIMEType methods. * WebCoreSupport/WebViewFactory.mm: * WebView/WebFrame.mm: * WebView/WebFrameInternal.h: * WebView/WebView.mm: 2008-03-08 Mark Rowe <mrowe@apple.com> Reviewed by Darin Adler. Fix 64-bit build with GCC 4.2. * DefaultDelegates/WebDefaultScriptDebugDelegate.m: Use NSUInteger in place of unsigned where required. * DefaultDelegates/WebDefaultUIDelegate.m: Ditto. * History/WebHistoryItem.mm: Ditto. * Misc/WebElementDictionary.mm: Ditto. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::objectContentType): Move variable declaration outside of if to avoid warning about the variable being unused in 64-bit. * WebCoreSupport/WebInspectorClient.mm: Use NSUInteger in place of unsigned where required. * WebView/WebHTMLView.mm: (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): Use CGFloat in place of float where required. (-[WebTextCompleteController numberOfRowsInTableView:]): Use NSInteger in place of int where required. 2008-03-08 Darin Adler <darin@apple.com> Reviewed by Adele. - eliminate custom highlight methods from WebCoreFrameBridge * WebCoreSupport/WebChromeClient.h: Added custom highlight functions. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::customHighlightRect): Moved code here from bridge. (WebChromeClient::paintCustomHighlight): Ditto. * WebCoreSupport/WebFrameBridge.mm: Removed code here. 2008-03-07 David D. Kilzer <ddkilzer@apple.com> Unify concept of enabling Netscape Plug-in API (NPAPI). Reviewed by Darin Adler. * WebKit.exp: Removed unused class export for WebBaseNetscapePluginView. * WebKitPrefix.h: Removed WTF_USE_NPOBJECT since we now use ENABLE(NETSCAPE_PLUGIN_API) as defined in Platform.h. * Plugins/WebBaseNetscapePluginStream.h: Replaced #ifndef __LP64__ with #if ENABLE(NETSCAPE_PLUGIN_API). * Plugins/WebBaseNetscapePluginStream.mm: Ditto. * Plugins/WebBaseNetscapePluginView.h: Ditto. * Plugins/WebBaseNetscapePluginView.mm: Ditto. * Plugins/WebBaseNetscapePluginViewInternal.h: Ditto. * Plugins/WebBaseNetscapePluginViewPrivate.h: Ditto. * Plugins/WebBasePluginPackage.h: Ditto. * Plugins/WebBasePluginPackage.m: Ditto. (+[WebBasePluginPackage pluginWithPath:]): * Plugins/WebNetscapeDeprecatedFunctions.c: Ditto. * Plugins/WebNetscapeDeprecatedFunctions.h: Ditto. * Plugins/WebNetscapePluginEmbeddedView.h: Ditto. * Plugins/WebNetscapePluginEmbeddedView.mm: Ditto. * Plugins/WebNetscapePluginPackage.h: Ditto. * Plugins/WebNetscapePluginPackage.m: Ditto. * Plugins/WebNetscapePluginStream.h: Ditto. * Plugins/WebNetscapePluginStream.mm: Ditto. * Plugins/WebPluginDatabase.m: Ditto. (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): * Plugins/npapi.m: Ditto. * WebCoreSupport/WebFrameLoaderClient.mm: Ditto. (WebFrameLoaderClient::objectContentType): (WebFrameLoaderClient::createPlugin): * WebView/WebHTMLView.mm: Ditto. (-[NSArray _web_makePluginViewsPerformSelector:withObject:]): * WebView/WebHTMLViewInternal.h: Ditto. * WebView/WebFrame.mm: Replaced #ifndef __LP64__ with #if ENABLE(NETSCAPE_PLUGIN_API). Moved methods below from (WebPrivate) category to (WebInternal) category so we don't expose the ENABLE() macro from the private header. (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]): (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]): * WebView/WebFrameInternal.h: Ditto. * WebView/WebFramePrivate.h: Ditto. 2008-03-07 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. <rdar://problem/5579292> REGRESSION: (safari 2-3): "Default default" encoding for Korean changed from Korean (Windows, DOS) to Korean (ISO 2022-KR), which breaks some sites * WebView/WebPreferences.m: (+[WebPreferences _setInitialDefaultTextEncodingToSystemEncoding]): Make encoding name match the one used in Safari. 2008-03-07 Mark Rowe <mrowe@apple.com> Reviewed by Oliver Hunt. Fix WebKit build with GCC 4.2. * Plugins/WebBaseNetscapePluginView.mm: Use the correct return type in method signature. 2008-03-07 Darin Adler <darin@apple.com> Reviewed by Adam. - eliminated WebCoreFrameBridge runOpenPanel * WebCoreSupport/WebChromeClient.h: Added runOpenPanel. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::runOpenPanel): Added. (-[WebOpenPanelResultListener initWithChooser:]): Added. Used to wrap the FileChooser so it can get a result from the UI delegate. (-[WebOpenPanelResultListener dealloc]): Added. (-[WebOpenPanelResultListener finalize]): Added. (-[WebOpenPanelResultListener cancel]): Added. (-[WebOpenPanelResultListener chooseFilename:]): Added. 2008-03-06 Darin Adler <darin@apple.com> Reviewed by Mitz. - fix regression test failures from the visited-link change * History/WebHistory.mm: (+[WebHistory setOptionalSharedHistory:]): Call PageGroup::setShouldTrackVisitedLinks to turn off visited links if there is no history object. Also call removeAllVisitedLinks so we can start over from scratch with the new history. 2008-03-06 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - fix a regression from r30741: a crash under WebFrameLoaderClient::createPlugin() when showing a Mail message with an attachment * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createPlugin): 2008-03-06 Darin Adler <darin@apple.com> - fix Tiger build * History/WebHistory.mm: Added include of WebTypesInternal.h. 2008-03-06 Darin Adler <darin@apple.com> - fix Release build * History/WebHistory.mm: (-[WebHistoryPrivate setLastVisitedTimeInterval:forItem:]): Removed underscore. (-[WebHistoryPrivate loadFromURL:collectDiscardedItemsInto:error:]): Added #if. (-[WebHistoryPrivate saveToURL:error:]): Ditto. 2008-03-06 Darin Adler <darin@apple.com> Reviewed by Mitz. - fix http://bugs.webkit.org/show_bug.cgi?id=17526 REGRESSION: iframes are added to Safari's History menu by separating the visited link machinery from global history * History/WebHistory.mm: Moved WebHistoryPrivate inside this file. (-[WebHistoryPrivate removeItemFromDateCaches:]): Removed the underscore from this method name, since it's on a private object. (-[WebHistoryPrivate removeItemForURLString:]): Added a call to the PageGroup::removeAllVisitedLinks function if the last URL was removed. (-[WebHistoryPrivate addItemToDateCaches:]): Removed the underscore from this method name, since it's on a private object. (-[WebHistoryPrivate removeAllItems]): Call PageGroup::removeAllVisitedLinks. (-[WebHistoryPrivate ageLimitDate]): Removed the underscore from this method name, since it's on a private object. (-[WebHistoryPrivate loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]): Ditto. (-[WebHistoryPrivate saveHistoryGuts:URL:error:]): Ditto. Also changed this to correctly return the error by using the newer version of writeToURL: and removed the FIXME about that. (-[WebHistoryPrivate addVisitedLinksToPageGroup:]): Added. Calls addVisitedLink for every link in the history. (-[WebHistory saveToURL:error:]): Removed the FIXME, since we do get the error now. (-[WebHistory addItem:]): Moved into the WebPrivate category. (-[WebHistory addItemForURL:]): Ditto. (-[WebHistory _addItemForURL:title:]): Added. Used for the normal case where we create an item and already know its title. (-[WebHistory ageLimitDate]): Moved into the WebPrivate category. (-[WebHistory containsItemForURLString:]): Ditto. (-[WebHistory removeItem:]): Ditto. (-[WebHistory setLastVisitedTimeInterval:forItem:]): Ditto. (-[WebHistory _itemForURLString:]): Ditto. (-[WebHistory _addVisitedLinksToPageGroup:]): Added. For use only inside WebKit. * History/WebHistoryInternal.h: Added. * History/WebHistoryItemInternal.h: Tweaked formatting and includes. * History/WebHistoryPrivate.h: Moved the WebHistoryPrivate class out of this header. Also reorganized what was left behind. * WebCoreSupport/WebChromeClient.h: Added populateVisitedLinks. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::populateVisitedLinks): Added a call to the new -[WebHistory _addVisitedLinksToPageGroup:] method. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::updateGlobalHistory): Changed code to use the new -[WebHistory _addItemForURL:title:] method. 2008-03-05 Adam Roben <aroben@apple.com> Rename WebCoreScriptDebuggerImp.{h,mm} to WebScriptDebugger.{h,mm} Reviewed by Kevin M. * WebView/WebFrame.mm: * WebView/WebScriptDebugDelegate.mm: * WebView/WebScriptDebugger.h: Renamed from WebKit/mac/WebView/WebCoreScriptDebuggerImp.h. * WebView/WebScriptDebugger.mm: Renamed from WebKit/mac/WebView/WebCoreScriptDebuggerImp.mm. 2008-03-05 Adam Roben <aroben@apple.com> Rename WebCoreScriptDebuggerImp to WebScriptDebugger Reviewed by Kevin M. * WebView/WebCoreScriptDebuggerImp.h: * WebView/WebCoreScriptDebuggerImp.mm: * WebView/WebFrame.mm: (-[WebFrame _attachScriptDebugger]): * WebView/WebFrameInternal.h: 2008-03-05 Adam Roben <aroben@apple.com> Remove WebScriptDebugger Uses of WebScriptDebugger have been replaced with WebCoreScriptDebuggerImp. Reviewed by Kevin M. * WebView/WebFrame.mm: (-[WebFramePrivate dealloc]): Use delete instead of release since WebCoreScriptDebuggerImp is a C++ class. (-[WebFrame _attachScriptDebugger]): Updated to use early returns and WebCoreScriptDebuggerImp. (-[WebFrame _detachScriptDebugger]): Ditto. * WebView/WebFrameInternal.h: * WebView/WebScriptDebugDelegate.mm: Removed WebScriptDebugger * WebView/WebScriptDebugDelegatePrivate.h: Removed. * WebView/WebView.mm: 2008-03-05 Adam Roben <aroben@apple.com> Remove -webFrame and -globalObject from WebScriptDebugger WebCoreScriptDebuggerImp is now unaware of WebScriptDebugger Reviewed by Kevin M. * WebView/WebCoreScriptDebuggerImp.h: Removed WebScriptDebugger* parameter to the constructor. * WebView/WebCoreScriptDebuggerImp.mm: (toWebFrame): Added. (WebCoreScriptDebuggerImp::sourceParsed): Call toWebFrame. (WebCoreScriptDebuggerImp::callEvent): Ditto, and get the Frame's WindowScriptObject ourselves instead of asking WebScriptDebugger for it. (WebCoreScriptDebuggerImp::atStatement): Call toWebFrame. (WebCoreScriptDebuggerImp::returnEvent): Ditto. (WebCoreScriptDebuggerImp::exception): Ditto. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptDebugger initWithWebFrame:]): Updated for change to WebScriptDebuggerImp's constructor. * WebView/WebScriptDebugDelegatePrivate.h: Removed -webFrame/-globalObject. 2008-03-05 Adam Roben <aroben@apple.com> Remove -enterFrame: and -leaveFrame from WebScriptDebugger Reviewed by Kevin M. * WebView/WebCoreScriptDebuggerImp.h: Changed to store m_topCallFrame in a RetainPtr, now that WebCoreScriptDebuggerImp is in charge of its lifetime. * WebView/WebCoreScriptDebuggerImp.mm: - Added declaration of -[WebScriptCallFrame _initWithGlobalObject:caller:state:]. - Changed most uses of m_topCallFrame to m_topCallFrame.get() (WebCoreScriptDebuggerImp::WebCoreScriptDebuggerImp): Removed now-unnecessary initialization of m_topCallFrame. (WebCoreScriptDebuggerImp::callEvent): Replaced call to enterFrame: with its implementation. The one difference between this implementation and the old enterFrame: method is that we don't hand our reference to m_topCallFrame to _initWithGlobalObject: -- that method must now retain the passed-in WebScriptCallFrame manually. (WebCoreScriptDebuggerImp::atStatement): (WebCoreScriptDebuggerImp::returnEvent): Replaced call to leaveFrame with its implementation. (WebCoreScriptDebuggerImp::exception): * WebView/WebScriptDebugDelegate.mm: Removed declaration of -[WebScriptCallFrame _initWithGlobalObject:caller:state:]. (-[WebScriptCallFrame _initWithGlobalObject:caller:state:]): Changed to retain the passed-in caller. * WebView/WebScriptDebugDelegatePrivate.h: - Removed _current ivar - Removed enterFrame:/leaveFrame declarations. 2008-03-05 Adam Roben <aroben@apple.com> Remove -parsedSource: from WebScriptDebugger Reviewed by Kevin M. * WebView/WebCoreScriptDebuggerImp.mm: (WebCoreScriptDebuggerImp::sourceParsed): Moved code here from -[WebScriptDebugger parsedSource:fromURL:sourceId:startLine:errorLine:errorMessage:] * WebView/WebScriptDebugDelegate.mm: Removed -parsedSource:. * WebView/WebScriptDebugDelegatePrivate.h: Ditto. 2008-03-05 Adam Roben <aroben@apple.com> Remove -enteredFrame:, -leavingFrame:, and -exceptionRaised: from WebScriptDebugger Reviewed by Kevin M. * WebView/WebCoreScriptDebuggerImp.mm: (WebCoreScriptDebuggerImp::WebCoreScriptDebuggerImp): Changed to call trhough to callEvent instead of duplicating its code here. (WebCoreScriptDebuggerImp::callEvent): Moved code from -[WebScriptDebugger enteredFrame:sourceId:line:] here. (WebCoreScriptDebuggerImp::returnEvent): Moved code from -[WebScriptDebugger leavingFrame:sourceId:line:] here. (WebCoreScriptDebuggerImp::exception): Moved code from -[WebScriptDebugger exceptionRaised:sourceId:line:] here. * WebView/WebScriptDebugDelegate.mm: Removed -enteredFrame:, -leavingFrame:, and -exceptionRaised:. * WebView/WebScriptDebugDelegatePrivate.h: Ditto. 2008-03-05 Adam Roben <aroben@apple.com> Remove -[WebScriptDebugger hitStatement:sourceId:line:] Reviewed by Kevin M. * WebView/WebCoreScriptDebuggerImp.mm: (WebCoreScriptDebuggerImp::atStatement): Moved code here from -[WebScriptDebugger hitStatement:sourceId:line:]. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptDebugger webFrame]): Added. * WebView/WebScriptDebugDelegatePrivate.h: 2008-03-05 Adam Roben <aroben@apple.com> Remove WebCoreScriptDebugger Reviewed by Kevin M. * WebView/WebCoreScriptDebugger.h: Removed. * WebView/WebCoreScriptDebugger.mm: Removed. * WebView/WebCoreScriptDebuggerImp.h: Replaced WebCoreScriptDebugger with WebScriptDebugger. * WebView/WebCoreScriptDebuggerImp.mm: Ditto, and replaced [m_debugger delegate] with just m_debugger. (toNSString): Moved here from WebCoreScriptDebugger.mm. (toNSURL): Ditto. (WebCoreScriptDebuggerImp::WebCoreScriptDebuggerImp): (WebCoreScriptDebuggerImp::sourceParsed): (WebCoreScriptDebuggerImp::callEvent): (WebCoreScriptDebuggerImp::atStatement): (WebCoreScriptDebuggerImp::returnEvent): (WebCoreScriptDebuggerImp::exception): * WebView/WebScriptDebugDelegate.mm: (-[WebScriptDebugger initWithWebFrame:]): _debugger now holds a WebCoreScriptDebuggerImp, so initialize it properly. * WebView/WebScriptDebugDelegatePrivate.h: Changed _debugger to hold a WebCoreScriptDebuggerImp. 2008-03-05 Adam Roben <aroben@apple.com> Move WebCoreScriptDebuggerImp to its own source files Also changed WebCoreScriptDebuggerImp coding style to match our style guidelines. Reviewed by Kevin M. * WebView/WebCoreScriptDebugger.h: Added declaration of toNSURL function. * WebView/WebCoreScriptDebugger.mm: Removed WebCoreScriptDebuggerImp implementation. (toNSURL): Made no longer static. * WebView/WebCoreScriptDebuggerImp.h: Added. * WebView/WebCoreScriptDebuggerImp.mm: Added. Code was moved here from WebCoreScriptDebugger.mm and cleaned up. (WebCoreScriptDebuggerImp::WebCoreScriptDebuggerImp): (WebCoreScriptDebuggerImp::sourceParsed): (WebCoreScriptDebuggerImp::callEvent): (WebCoreScriptDebuggerImp::atStatement): (WebCoreScriptDebuggerImp::returnEvent): (WebCoreScriptDebuggerImp::exception): 2008-03-05 Adam Roben <aroben@apple.com> Move -_enterFrame and -_leaveFrame from WebCoreScriptDebugger to WebScriptDebugger Reviewed by Kevin M. * WebView/WebCoreScriptDebugger.h: - Removed newFrameWithGlobalObject:caller:state: from WebScriptDebugger protocol - Added enterFrame: and leaveFrame: to WebScriptDebugger protocol - Removed _current ivar from WebCoreScriptDebugger * WebView/WebCoreScriptDebugger.mm: (WebCoreScriptDebuggerImp::callEvent): Changed to call enterFrame on the delegate. (WebCoreScriptDebuggerImp::returnEvent): Ditto for leaveFrame. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptDebugger dealloc]): Added code to release _current. (-[WebScriptDebugger enterFrame:]): Added. Code came from WebCoreScriptDebugger. (-[WebScriptDebugger leaveFrame]): Ditto. * WebView/WebScriptDebugDelegatePrivate.h: Added _current ivar. 2008-03-05 Adam Roben <aroben@apple.com> Remove WebCoreScriptCallFrame Reviewed by Tim. * WebView/WebCoreScriptDebugger.h: - Replaced WebCoreScriptCallFrame with WebScriptCallFrame - Replaced -newWrapperForFrame: with -newFrameWithGlobalObject:caller:state: - Removed WebCoreScriptCallFrame interface. * WebView/WebCoreScriptDebugger.mm: Replaced WebCoreScriptCallFrame with WebScriptCallFrame. (-[WebCoreScriptDebugger _enterFrame:]): Changed to call -newFrameWithGlobalObject:caller:state. (-[WebCoreScriptDebugger _leaveFrame]): * WebView/WebScriptDebugDelegate.h: Changed WebScriptCallFrame's _private ivar to be of type WebScriptCallFramePrivate*. * WebView/WebScriptDebugDelegate.mm: - Replaced WebCoreScriptCallFrame with WebScriptCallFrame - Added WebScriptCallFramePrivate (-[WebScriptDebugger enteredFrame:sourceId:line:]): (-[WebScriptDebugger hitStatement:sourceId:line:]): (-[WebScriptDebugger leavingFrame:sourceId:line:]): (-[WebScriptDebugger exceptionRaised:sourceId:line:]): (-[WebScriptCallFramePrivate dealloc]): Added. (-[WebScriptCallFrame _initWithGlobalObject:caller:state:]): Added. Code came from WebCoreScriptCallFrame. (-[WebScriptCallFrame dealloc]): Added a call to release the _private ivar. (-[WebScriptCallFrame _convertValueToObjcValue:]): Replaced calls to _private with direct access of _private's ivars. (-[WebScriptCallFrame caller]): Ditto. (-[WebScriptCallFrame scopeChain]): Ditto. (-[WebScriptCallFrame evaluateWebScript:]): Ditto. 2008-03-05 Adam Roben <aroben@apple.com> Move -_convertValueToObjcValue to WebScriptCallFrame Reviewed by Darin Adler. * WebView/WebCoreScriptDebugger.h: Removed declaration of -_convertValueToObjcValue. * WebView/WebCoreScriptDebugger.mm: Removed -_convertValueToObjcValue. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame _convertValueToObjcValue:]): Added. Code came from -[WebCoreScriptCallFrame _convertValueToObjcValue]. (-[WebScriptCallFrame scopeChain]): Changed to call -_convertValueToObjcValue on self instead of _private. (-[WebScriptCallFrame exception]): Ditto. (-[WebScriptCallFrame evaluateWebScript:]): Ditto. 2008-03-05 Adam Roben <aroben@apple.com> Move -exception and -evaluateWebScript: to WebScriptCallFrame Reviewed by Darin Adler. * WebView/WebCoreScriptDebugger.h: Removed declarations of -exception and -evaluateWebScript:. * WebView/WebCoreScriptDebugger.mm: Removed -exception and -evaluateWebScript:. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame exception]): Added. Code came from -[WebCoreScriptCallFrame exception]. (-[WebScriptCallFrame evaluateWebScript:]): Added. Code came from -[WebCoreScriptCallFrame evaluateWebScript:]. 2008-03-05 Adam Roben <aroben@apple.com> Move -scopeChain to WebScriptCallFrame Reviewed by Darin Adler. * WebView/WebCoreScriptDebugger.h: - Added declarations of -globalObject and -_convertValueToObjcValue: to WebCoreScriptCallFrame - Removed declaration of -scopeChain. * WebView/WebCoreScriptDebugger.mm: Moved -_convertValueToObjcValue within the main WebCoreScriptCallFrame implementation. (-[WebCoreScriptCallFrame globalObject]): Added. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame scopeChain]): Added. Code came from -[WebCoreScriptCallFrame scopeChain]. 2008-03-05 Adam Roben <aroben@apple.com> Move -functionName from WebCoreScriptCallFrame to WebScriptCallFrame Reviewed by Darin Adler. * WebView/WebCoreScriptDebugger.h: - Removed #else case of #ifdef __cplusplus since this file is only ever used by C++ Objective-C files - Removed 'using KJS::ExecState' statement since we prefer not to have using statements in header files - Consequently prefixed uses of ExecState with KJS:: - Added declaration of toNSString method that takes a const UString& - Added declaration of -[WebCoreScriptCallFrame state] - Removed declaration of -[WebCoreScriptCallFrame functionName] * WebView/WebCoreScriptDebugger.mm: (toNSString): Made this no longer static. (-[WebCoreScriptCallFrame state]): Added. * WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame functionName]): Added. Code came from -[WebCoreScriptCallFrame functionName], though I changed some nested ifs into early returns. 2008-03-05 Adam Roben <aroben@apple.com> Move WebCoreScriptDebugger to WebKit Reviewed by Darin Adler. * WebView/WebCoreScriptDebugger.h: Renamed from WebCore/page/mac/WebCoreScriptDebugger.h. * WebView/WebCoreScriptDebugger.mm: Renamed from WebCore/page/mac/WebCoreScriptDebugger.mm. (toNSString): (toNSURL): (WebCoreScriptDebuggerImp::WebCoreScriptDebuggerImp): (WebCoreScriptDebuggerImp::sourceParsed): (WebCoreScriptDebuggerImp::callEvent): (WebCoreScriptDebuggerImp::atStatement): (WebCoreScriptDebuggerImp::returnEvent): (WebCoreScriptDebuggerImp::exception): (+[WebCoreScriptDebugger initialize]): (-[WebCoreScriptDebugger initWithDelegate:]): (-[WebCoreScriptDebugger dealloc]): (-[WebCoreScriptDebugger finalize]): (-[WebCoreScriptDebugger delegate]): (-[WebCoreScriptDebugger _enterFrame:]): (-[WebCoreScriptDebugger _leaveFrame]): (-[WebCoreScriptCallFrame _initWithGlobalObject:caller:state:]): (-[WebCoreScriptCallFrame _setWrapper:]): (-[WebCoreScriptCallFrame _convertValueToObjcValue:]): (-[WebCoreScriptCallFrame dealloc]): (-[WebCoreScriptCallFrame wrapper]): (-[WebCoreScriptCallFrame caller]): (-[WebCoreScriptCallFrame scopeChain]): (-[WebCoreScriptCallFrame functionName]): (-[WebCoreScriptCallFrame exception]): (-[WebCoreScriptCallFrame evaluateWebScript:]): * WebView/WebScriptDebugDelegate.mm: Updated header path. * WebView/WebScriptDebugDelegatePrivate.h: Ditto. 2008-03-05 Anders Carlsson <andersca@apple.com> Reviewed by Geoff. Include file changes. * Plugins/WebBaseNetscapePluginView.mm: * Plugins/WebNetscapePluginPackage.m: 2008-03-04 Timothy Hatcher <timothy@apple.com> Reviewed by Darin Adler. <rdar://problem/5720160> Browser windows "do nothing" while modal dialog or menu is up due to run loop modes (or while scrolling) Add new API that lets a WebView be scheduled with multiple runloops and modes. This lets loading continue when in a nested runloop or in a different mode. * Misc/WebKitVersionChecks.h: Add a new version define: WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES. * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Schedule in the main runloop and with the default runloop mode if we are linked on an earlier WebKit version, use common modes otherwise. (-[WebView scheduleInRunLoop:forMode:]): New API, that calls through to Page. (-[WebView unscheduleFromRunLoop:forMode:]): Ditto. * WebView/WebViewPrivate.h: Add the new pending API methods. 2008-03-04 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Fix crash that happens when trying to load a page with a Java applet. * WebCoreSupport/WebFrameLoaderClient.mm: Don't release the names and values array - the kit method returns an autoreleased array. 2008-03-04 Darin Adler <darin@apple.com> Reviewed by Adam. - fix 200+ failing regression tests - fix http://bugs.webkit.org/show_bug.cgi?id=17668 Vertical scrollbar at slashdot.org is randomly not shown * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::transitionToCommittedForNewPage): Changed the refcounting code here to exactly match the way it was before it was moved from WebCore. I had introduced a storage leak and that was causing problems with scroll bars! 2008-03-04 Darin Adler <darin@apple.com> Reviewed by Adam. - remove WebCoreFrameBridge reapplyStyles method * WebView/WebHTMLView.mm: (-[WebHTMLView reapplyStyles]): Moved code to reapply styles here from the bridge. 2008-03-04 Darin Adler <darin@apple.com> Reviewed by Adam. - eliminate WebCoreFrameBridge createFrameViewWithNSView * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::transitionToCommittedForNewPage): Moved code here from createFrameViewWithNSView. 2008-03-04 Darin Adler <darin@apple.com> Reviewed by Adam. - removed WebCoreFrameBridge scrollOverflowInDirection * WebView/WebFrameView.mm: (-[WebFrameView _scrollOverflowInDirection:granularity:]): Changed to call EventHandler directly instead of using the bridge. (-[WebFrameView scrollToBeginningOfDocument:]): Updated to use WebCore enums instead of the ones from the bridge. (-[WebFrameView scrollToEndOfDocument:]): Ditto. (-[WebFrameView _pageVertically:]): Ditto. (-[WebFrameView _pageHorizontally:]): Ditto. (-[WebFrameView _scrollLineVertically:]): Ditto. (-[WebFrameView _scrollLineHorizontally:]): Ditto. 2008-03-04 Darin Adler <darin@apple.com> Reviewed by Adam. - remove WebCoreFrameBridge installInFrame: method * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::transitionToCommittedForNewPage): Call -[WebFrameView _install] instead of -[WebCoreFrameBridge installInFrame:]. * WebView/WebFrameView.mm: (-[WebFrameView _install]): Added. Has code from -[WebCoreFrameBridge installInFrame:]. (-[WebFrameView _setCustomScrollViewClass:]): Used early return idiom so the entire method isn't nested inside an if statement. Call -[WebFrameView _install] instead of -[WebCoreFrameBridge installInFrame:]. * WebView/WebFrameViewInternal.h: Added declaration of _install method so it can be used in WebFrameLoaderClient.mm. 2008-03-04 Darin Adler <darin@apple.com> Reviewed by Adam. - remove WebCoreFrameBridge window method * WebCoreSupport/WebFrameBridge.mm: Removed window method. 2008-03-04 Darin Adler <darin@apple.com> Reviewed by Adam. - move code from WebFrameBridge into WebFrameLoaderClient * WebCoreSupport/WebFrameBridge.h: Removed unused fields, changed frame name parameters to use WebCore::String instead of NSString, add initSubframeWithOwnerElement declaration, removed viewForPluginWithFrame, viewForJavaAppletWithFrame, createChildFrameNamed, redirectDataToPlugin, determineObjectFromMIMEType, and windowObjectCleared methods. * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge finishInitializingWithPage:frameName:WebCore::frameView:ownerElement:]): Changed to use WebCore::String. (-[WebFrameBridge initMainFrameWithPage:frameName:WebCore::frameView:]): Ditto. (-[WebFrameBridge initSubframeWithOwnerElement:frameName:WebCore::frameView:]): Ditto. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::setOriginalURLForDownload): Removed some dead code I found here and added a FIXME. (WebFrameLoaderClient::createFrame): Moved the code from WebFrameBridge here. (WebFrameLoaderClient::objectContentType): Ditto. (parameterValue): Added. Helper function, based on code originally in WebFrameBridge. (pluginView): Ditto. (WebFrameLoaderClient::createPlugin): Moved the code from WebFrameBridge here. 2008-03-04 Darin Adler <darin@apple.com> Reviewed by Adam. - remove -[WebCoreFrameBridge dashboardRegionsChanged:] * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::dashboardRegionsChanged): Moved code here from the bridge. The WebCore side now calls this only when there's an actual change. * WebCoreSupport/WebFrameBridge.h: Removed lastDashboardRegions. * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge dealloc]): Removed code to release lastDashboardRegions. Removed _compareDashboardRegions: and dashboardRegionsChanged: methods. 2008-03-04 Darin Adler <darin@apple.com> Reviewed by Adam. - remove WebCoreFrameBridge issuePasteComand method * WebCoreSupport/WebFrameBridge.mm: Removed issuePasteCommand method. * WebView/WebHTMLViewInternal.h: Removed declaration of paste: method. 2008-03-03 Darin Adler <darin@apple.com> Reviewed by Adam. - some "cleanup" on the path to removing WebCoreFrameBridge * Storage/WebDatabaseManager.mm: Tweak includes. * Storage/WebDatabaseTrackerClient.mm: Ditto. * Storage/WebSecurityOrigin.mm: Ditto. * Storage/WebSecurityOriginInternal.h: Ditto. * WebView/WebFrame.mm: (core): Changed to get rid of the requirement that WebKitEditableLinkBehavior exactly match WebCore::EditableLinkBehavior. * WebView/WebFrameInternal.h: Removed unused kit function. * WebView/WebHTMLView.mm: Moved WebHTMLViewPrivate class in here. * WebView/WebHTMLViewInternal.h: Moved WebHTMLVewPrivate class out of here. * WebView/WebHTMLViewPrivate.h: Tweaked formatting and removed some unneeded declarations. * WebView/WebPreferencesPrivate.h: Removed a no-longer-needed comment. 2008-03-01 Mark Rowe <mrowe@apple.com> Reviewed by Tim Hatcher. Update Xcode configuration to support building debug and release from the mysterious future. * Configurations/DebugRelease.xcconfig: 2008-02-29 Mark Rowe <mrowe@apple.com> Reviewed by Anders Carlsson. Replace use of WKPathFromFont with implementation in terms of public API. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Remove unused symbol. 2008-02-29 Mark Rowe <mrowe@apple.com> Reviewed by Oliver Hunt. Fix spelling of "request" in name of WKNSURLProtocolClassForRequest. * Misc/WebNSURLExtras.mm: (-[NSURL _webkit_canonicalize]): * WebKit.order: 2008-02-29 Mark Rowe <mrowe@apple.com> Reviewed by Oliver Hunt. Don't use WKSupportsMultipartXMixedReplace on Leopard as multipart/x-mixed-replace is always handled by NSURLRequest. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2008-02-29 Mark Rowe <mrowe@apple.com> Reviewed by Oliver Hunt. Remove obsolete code that had been left intact to support users running WebKit with older versions of Safari. * Misc/WebNSViewExtras.m: Remove _web_superviewOfClass:stoppingAtClass:. * Misc/WebNSWindowExtras.m: Remove _webkit_displayThrottledWindows. * Misc/WebSearchableTextView.m: Remove selectionImageForcingWhiteText:. * WebCoreSupport/WebImageRendererFactory.m: Update comment to mention the last version of Safari that requires this class. * WebInspector/WebInspector.mm: Remove sharedWebInspector and update comments to mention the last version of Safari that calls other obsolete methods. * WebView/WebDocumentPrivate.h: Remove selectionImageForcingWhiteText:. * WebView/WebHTMLView.mm: Ditto. * WebView/WebPDFView.mm: Ditto. * WebView/WebView.mm: Update comment to mentoin the last version of Safari that requires the obsolete method. 2008-02-29 Mark Rowe <mrowe@apple.com> Rubber-stamped by Eric Seidel. Remove unneeded includes of WebKitSystemInterface.h. * History/WebHistoryItem.mm: * Misc/WebNSViewExtras.m: * WebCoreSupport/WebFrameLoaderClient.mm: * WebView/WebDataSource.mm: * WebView/WebPDFView.mm: 2008-02-29 Mark Rowe <mrowe@apple.com> Reviewed by Oliver Hunt and Oliver Hunt. <rdar://problem/4753845> WebKit should use CGEventSourceSecondsSinceLastEventType in place of WKSecondsSinceLastInputEvent SPI. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Remove unused symbol. * WebKit.order: Ditto. 2008-02-28 Mark Rowe <mrowe@apple.com> Reviewed by Dave Hyatt. Make use of new CGFont APIs on Leopard rather than making a WebKitSystemInterface call. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Only initialize wkGetFontMetrics on Tiger. 2008-02-27 Brady Eidson <beidson@apple.com> Reviewed by Mark Rowe (code) and Darin (concept) Much better fix for <rdar://problem/4930688> (see r19549) Original fix for <rdar://problem/3947312> (and 14 dupes) Let me tell you a story: A long time ago, in a cvs repository far, far away, loader code was almost all up in WebKit. WebArchive code was intertwined with that code in bizarre and complex ways. During the months long loader re-factoring where we pushed much loader code down into WebCore, many portions of the WebKit loader were thinned out until they ceased to exist. Others remained with a sole purpose. One such section of code whose lineage traces back from WebFrameLoaderClient to WebFrameLoader to WebLoader was originally rooted in the method [WebLoader loadRequest:]. This method was the single entry point for almost all loading (network or web archives) This method would check various headers and other fields on the NSURLRequest and NSURLResponse to make decisions about the load. If the cache control fields were expired or other conditions in the headers were met, the load would be forced to go out to the network. As the loader was moved and tweaked repeatedly, most of this code was pruned or re-factored. At some point, all that remained was the special cases for loading WebArchives. Somewhere in the r16,000s, this remaining responsibility was noticed and related methods we renamed to be WebArchive specific, further cementing the assumed design. Problem is, the design was bad. A WebArchive is meant to be a static snapshot of a WebPage at a specific point in time. Referring to the request to see if the resource should be reloaded seems nonsensical, as does referring to the response headers to see if the resource is "expired". In the context of loading a WebArchive, available data should *always* be loaded from the WebArchive, at least during the initial load! After discovering the secret to reproducing all of these bugs is both emptying our your Foundation cache and disconnecting your network, it was easy to reproduce the 16 individually reported cases that were all symptoms of this bug, and easy to verify that they are fixed with this patch. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::willUseArchive): Do not call either form of "canUseArchivedResource()" that inspect the request or response objects - We are loading from a WebArchive, and we should never make the decision to go out to the network when we actually have the resource available. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Remove two methods that are no longer used anywhere in WebKit 2008-02-27 Matt Lilek <webkit@mattlilek.com> Reviewed by Adam Roben. Bug 14348: Messing up the inspector by dragging an URL into it http://bugs.webkit.org/show_bug.cgi?id=14348 <rdar://problem/5283620> and <rdar://problem/5712808> * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController init]): Remove duplicate preference setting. (-[WebInspectorWindowController webView:dragDestinationActionMaskForDraggingInfo:]): 2008-02-25 Darin Adler <darin@apple.com> Reviewed by Adam. * WebView/WebArchiver.mm: (+[WebArchiver archiveSelectionInFrame:]): Use blankURL. * WebView/WebFrame.mm: (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): Avoid the variable name URL to avoid clashing with the renamed KURL in the future. Also use blankURL. (-[WebFrame loadData:MIMEType:textEncodingName:baseURL:]): Ditto. (-[WebFrame _loadHTMLString:baseURL:unreachableURL:]): Ditto. (-[WebFrame loadHTMLString:baseURL:]): Ditto. (-[WebFrame loadAlternateHTMLString:baseURL:forUnreachableURL:]): Ditto. 2008-02-24 Darin Adler <darin@apple.com> Reviewed by Sam. - remove separate client calls for "standard" and "reload' history * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::updateGlobalHistory): 2008-02-23 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. Move basic threading support from WebCore to WTF. * ForwardingHeaders/wtf/Threading.h: Added. * ForwardingHeaders/wtf/Locker.h: Added. 2008-02-23 David Kilzer <ddkilzer@apple.com> Please clarify licensing for some files <http://bugs.webkit.org/show_bug.cgi?id=14970> Reviewed by Darin Adler. * Plugins/WebNetscapeDeprecatedFunctions.c: Updated copyright statement and added Apple BSD-style license. * Plugins/WebNetscapeDeprecatedFunctions.h: Ditto. 2008-02-22 John Sullivan <sullivan@apple.com> Reviewed by Adam Roben Reverted the changed from yesterday to add pasteAndMatchStyle:, as the existing pasteAsPlainText: has the same behavior. * WebView/WebHTMLView.mm: (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]): (-[WebHTMLView readSelectionFromPasteboard:]): (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): (-[WebHTMLView pasteAsRichText:]): (-[WebHTMLView paste:]): * WebView/WebView.mm: * WebView/WebViewPrivate.h: 2008-02-21 Anders Carlsson <andersca@apple.com> Reviewed by Sam. Use BackForwardList::create instead. * History/WebBackForwardList.mm: (-[WebBackForwardList init]): 2008-02-21 John Sullivan <sullivan@apple.com> Reviewed by Jessica Kahn support for pasteAndMatchStyle: command (see <rdar://problem/5723952>) * WebView/WebHTMLView.mm: (-[WebHTMLView _pasteWithPasteboard:allowPlainText:matchStyle:]): added matchStyle parameter, passed along to bridge (formerly always passed NO to bridge) (-[WebHTMLView readSelectionFromPasteboard:]): pass NO for new matchStyle parameter to match old behavior (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): validate pasteAndMatchStyle the same way as pasteAsRichText (-[WebHTMLView pasteAndMatchStyle:]): just like pasteAsRichText but passes YES for matchStyle (-[WebHTMLView pasteAsRichText:]): pass NO for new matchStyle parameter to match old behavior (-[WebHTMLView paste:]): ditto * WebView/WebView.mm: added macro(pasteAndMatchStyle) * WebView/WebViewPrivate.h: added pasteAndMatchStyle: to WebViewEditingActionsPendingPublic category 2008-02-20 Sam Weinig <sam@webkit.org> Reviewed by Darin and Geoff. - WebKit part of <rdar://problem/5754378> work around missing video on YouTube front page with a site-specific hack * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Added a call to Settings::setNeedsSiteSpecificQuirks. There are currently no site-specific quirks on Mac, but we will propagate the state to WebCore to avoid possible mistakes later. 2008-02-19 Anders Carlsson <andersca@apple.com> Reviewed by Darin Adler. Move back WebKit methods that were unused in WebCore. * Misc/WebNSURLExtras.mm: (+[NSURL _web_URLWithData:]): (+[NSURL _web_URLWithData:relativeToURL:]): (-[NSURL _web_originalData]): (-[NSURL _web_originalDataAsString]): (-[NSURL _web_isEmpty]): (-[NSURL _webkit_canonicalize]): (-[NSURL _webkit_URLByRemovingComponent:]): (-[NSURL _webkit_URLByRemovingFragment]): (-[NSURL _webkit_URLByRemovingResourceSpecifier]): (-[NSURL _webkit_isFileURL]): (-[NSString _webkit_isFileURL]): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::setTitle): * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2008-02-18 Darin Adler <darin@apple.com> Reviewed by Sam. * Misc/WebNSAttributedStringExtras.mm: (+[NSAttributedString _web_attributedStringFromRange:]): Eliminate use of DeprecatedString. 2008-02-17 Sam Weinig <sam@webkit.org> Reviewed by Dan Bernstein. Fix for http://bugs.webkit.org/show_bug.cgi?id=17365 document.createEvent("MessageEvent") throws NOT_SUPPORTED_ERR * MigrateHeaders.make: Migrate DOMProgressEvent.h and DOMTextPrivate.h which were mistakenly not migrated. 2008-02-15 Dan Bernstein <mitz@apple.com> Reviewed by Alexey Proskuryakov. - WebKit part of fixing http://bugs.webkit.org/show_bug.cgi?id=17360 <rdar://problem/5743131> REGRESSION: mp4 file downloaded from server is downloaded as html * WebView/WebDataSource.mm: (+[WebDataSource _representationClassForMIMEType:]): (-[WebDataSource _responseMIMEType]): (-[WebDataSource subresources]): (-[WebDataSource subresourceForURL:]): * WebView/WebResource.mm: (-[WebResource _initWithData:URL:response:]): * WebView/WebResourcePrivate.h: 2008-02-15 Adam Roben <aroben@apple.com> Make WebKit's FEATURE_DEFINES match WebCore's Reviewed by Mark. * Configurations/WebKit.xcconfig: 2008-02-14 Darin Adler <darin@apple.com> Reviewed by Eric Seidel. - updated for WebCore KURL changes * History/WebHistoryItem.mm: (-[WebHistoryItem URL]): Removed getNSURL call. * Misc/WebElementDictionary.mm: (-[WebElementDictionary _absoluteImageURL]): Ditto. (-[WebElementDictionary _absoluteLinkURL]): Ditto. * Misc/WebNSAttributedStringExtras.mm: (fileWrapperForElement): Ditto. (+[NSAttributedString _web_attributedStringFromRange:]): Ditto. * Misc/WebNSURLExtras.mm: (-[NSString _webkit_stringByReplacingValidPercentEscapes]): Updated for function name change. * WebCoreSupport/WebContextMenuClient.mm: (WebContextMenuClient::downloadURL): Removed getNSURL call. * WebCoreSupport/WebDragClient.mm: (WebDragClient::createDragImageForLink): Ditto. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchWillPerformClientRedirect): Ditto. (WebFrameLoaderClient::startDownload): Ditto. (WebFrameLoaderClient::updateGlobalHistoryForStandardLoad): Ditto. (WebFrameLoaderClient::updateGlobalHistoryForReload): Ditto. (WebFrameLoaderClient::cancelledError): Ditto. (WebFrameLoaderClient::blockedError): Ditto. (WebFrameLoaderClient::cannotShowURLError): Ditto. (WebFrameLoaderClient::interruptForPolicyChangeError): Ditto. (WebFrameLoaderClient::cannotShowMIMETypeError): Ditto. (WebFrameLoaderClient::fileDoesNotExistError): Ditto. (WebFrameLoaderClient::willUseArchive): Ditto. (WebFrameLoaderClient::setTitle): Ditto. (WebFrameLoaderClient::actionDictionary): Ditto. (WebFrameLoaderClient::createFrame): Ditto. (WebFrameLoaderClient::objectContentType): Ditto. (WebFrameLoaderClient::createPlugin): Ditto. (WebFrameLoaderClient::createJavaAppletWidget): Ditto. * WebView/WebDataSource.mm: (-[WebDataSource _URL]): Ditto. (-[WebDataSource _initWithDocumentLoader:]): Ditto. (-[WebDataSource unreachableURL]): Ditto. * WebView/WebHTMLView.mm: (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Ditto. 2008-02-14 Stephanie Lewis <slewis@apple.com> Reviewed by Geoff. Update order files. * WebKit.order: 2008-02-14 Alexey Proskuryakov <ap@webkit.org> Reviewed by Adam Roben. http://bugs.webkit.org/show_bug.cgi?id=17207 Database example doesn't work (requires not-yet-released Safari) * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::exceededDatabaseQuota): Check Safari version, and allow 5 megabytes of storage if it's too old. 2008-02-11 Darin Adler <darin@apple.com> - roll out fix for <rdar://problem/5726016> REGRESSION: Xcode News window renders incorrectly due to visibility fix Removed the Xcode-specific quirk at the request of some folks on the Xcode team. * Misc/WebKitVersionChecks.h: Removed the constant. * WebView/WebView.mm: (-[WebView _needsXcodeVisibilityQuirk]): Removed. (-[WebView _preferencesChangedNotification:]): Removed call to setNeedsXcodeVisibilityQuirk. 2008-02-12 Anders Carlsson <andersca@apple.com> Reviewed by Mitz. * WebCoreSupport/WebFrameBridge.mm: * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory imageTitleForFilename:size:]): Move implementation from WebFrameBridge to WebViewFactory. 2008-02-11 Darin Adler <darin@apple.com> Reviewed by Mitz. - fix <rdar://problem/5726016> REGRESSION: Xcode News window renders incorrectly due to visibility fix Added an Xcode-specific quirk. * Misc/WebKitVersionChecks.h: Added a constant for the "linked on or after" part of the check. * WebView/WebView.mm: (-[WebView _needsXcodeVisibilityQuirk]): Added. (-[WebView _preferencesChangedNotification:]): Added a call to setNeedsXcodeVisibilityQuirk based on _needsXcodeVisibilityQuirk. 2008-02-10 Darin Adler <darin@apple.com> - fix http://bugs.webkit.org/show_bug.cgi?id=17274 REGRESSION: User Agent string broken in r30119 * WebView/WebView.mm: (-[WebView _userAgentWithApplicationName:andWebKitVersion:]): Fix wrong variable name. Doh! 2008-02-09 Darin Adler <darin@apple.com> Reviewed by Tim Hatcher. - fix <rdar://problem/5725996> crash every time you open the Xcode documentation window * WebView/WebView.mm: (-[WebView _userAgentWithApplicationName:andWebKitVersion:]): Work around a bug in the garbage collector's Objective C++ support by not initializing a static to an object that needs to be marked when running under GC. 2008-02-05 Dan Bernstein <mitz@apple.com> Reviewed by Darin Adler. - WebKit part of <rdar://problem/5724303> Should implement writing direction shortcuts The key bindings are Command-Control-left arrow and Command-Control-right arrow. To match AppKit, the bindings are enabled only when certain user defaults are set. * WebView/WebHTMLView.mm: (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): (-[WebHTMLView toggleBaseWritingDirection:]): Changed to call Frame::baseWritingDirectionForSelectionStart() and Editor::setBaseWritingDirection() directly. (-[WebHTMLView changeBaseWritingDirection:]): Ditto. (writingDirectionKeyBindingsEnabled): Added. (-[WebHTMLView _changeBaseWritingDirectionTo:]): Added this helper method. (-[WebHTMLView changeBaseWritingDirectionToLTR:]): Added. (-[WebHTMLView changeBaseWritingDirectionToRTL:]): Added. * WebView/WebView.mm: 2008-02-05 Mark Rowe <mrowe@apple.com> Unreviewed build fix. * WebView/WebView.mm: Add missing #import. 2008-02-05 Mark Rowe <mrowe@apple.com> Reviewed by Oliver Hunt. Update versioning to support the mysterious future. * Configurations/Version.xcconfig: Add SYSTEM_VERSION_PREFIX_1060. 2008-01-30 Justin Garcia <justin.garcia@apple.com> Reviewed by Darin Adler. <rdar://problem/5708115> REGRESSION: Words selected with a double click and copied won't paste into Mail * WebView/WebHTMLView.mm: (-[WebHTMLView _smartInsertForString:replacingRange:beforeString:afterString:]): Brought this back, it's used by Mail. (-[WebHTMLView _canSmartReplaceWithPasteboard:]): This WebInternal method is also used by Mail. Moved to WebPrivate. * WebView/WebHTMLViewPrivate.h: Expose two methods that Mail uses here, so that we don't accidently remove them in the future. 2008-01-30 Mark Rowe <mrowe@apple.com> Reviewed by Oliver Hunt. Move off deprecated NSTableView methods. * WebView/WebHTMLView.mm: (-[WebTextCompleteController _buildUI]): Switch from -setDrawsGrid: to -setGridStyleMask:. (-[WebTextCompleteController _placePopupWindow:]): Switch from -selectRow:byExtendingSelection: to -selectRowIndexes:byExtendingSelection:. (-[WebTextCompleteController filterKeyDown:]): Ditto. 2008-01-26 Mark Rowe <mrowe@apple.com> Reviewed by Darin Adler. Fix leaks seen after loading <http://www.funnyordie.com/videos/d70b5a11cb>. * Misc/WebNSDataExtras.m: (-[NSString _web_capitalizeRFC822HeaderFieldName]): Transfer ownerhip of the allocated buffers to the new CFString so that they will be freed when no longer needed. 2008-01-26 Greg Bolsinga <bolsinga@apple.com> <rdar://problem/5708388> WebDashboardRegion.h duplicated between WebCore / WebKit Reviewed by Darin Adler. * WebCoreSupport/WebDashboardRegion.h: Removed. * WebView/WebView.mm: Updated #import to use copy of WebDashboardRegion.h from WebCore. 2008-01-21 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - fix <rdar://problem/5644324> Delegate-less WebKit clients should have no databases - add a missing export of WebDatabaseExpectedSizeKey - implement deleteOrigin: and remove deleteDatabasesWithOrigin: * Storage/WebDatabaseManager.mm: (-[WebDatabaseManager detailsForDatabase:withOrigin:]): Updated to check for a null name instead of calling isValid(). (-[WebDatabaseManager deleteOrigin:]): Implemented. (WebKitInitializeDatabasesIfNecessary): Updated for name change. * Storage/WebDatabaseManagerPrivate.h: Removed deleteDatabasesWithOrigin:. * WebCoreSupport/WebChromeClient.h: Updated for changes to ChromeClient. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::exceededDatabaseQuota): Replaced the two different client functions we had before with a single one. * WebKit.exp: Added missing export for WebDatabaseExpectedSizeKey. * WebView/WebPreferenceKeysPrivate.h: Removed WebKitDefaultDatabaseQuotaKey. * WebView/WebPreferences.m: (+[WebPreferences initialize]): Removed the default for WebKitDefaultDatabaseQuotaKey. * WebView/WebPreferencesPrivate.h: Removed defaultDatabaseQuota and setDefaultDatabaseQuota:. * WebView/WebUIDelegatePrivate.h: Replaced the two different database quota delegate methods we had before with a single one. * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Removed the code to set the default database origin quota in WebCore::Settings based on WebPreferences. * WebView/WebViewInternal.h: Removed delegate method dispatch functions for unusual types of parameters that the database UI delegate methods had before. 2008-01-20 Mark Rowe <mrowe@apple.com> Reviewed by Dan Bernstein. Remove code bracketed by REMOVE_SAFARI_DOM_TREE_DEBUG_ITEM as we are no longer interested in supporting Safari 2 with TOT WebKit. * WebView/WebView.mm: (+[WebView initialize]): 2008-01-17 Timothy Hatcher <timothy@apple.com> Reviewed by Adam Roben. <rdar://problem/5693558> REGRESSION (r29581): no form field focus rings and inactive text selection after loading a page Bug 16917: REGRESSION (r29581/2): Google Maps search box loses focused appearance The problem was other frames were changing the FocusController's active status to false after the first responder frame set it to true. The last frame to call _updateActiveState would win. * WebView/WebHTMLView.mm: (-[WebHTMLView _updateActiveState]): Only call page->focusController()->setActive() if the first responder is the current WebHTMLView or the WebFrameView. (-[WebHTMLView _web_firstResponderCausesFocusDisplay]): Removed, inlined code in _updateActiveState. 2008-01-18 Adam Roben <aroben@apple.com> Rename _updateActiveState to _updateFocusedAndActiveState Also renamed any related methods/members similarly. Reviewed by Adele. * WebView/WebHTMLView.mm: (-[WebHTMLViewPrivate dealloc]): (-[WebHTMLView _cancelUpdateFocusedAndActiveStateTimer]): (-[WebHTMLView close]): (_updateFocusedAndActiveStateTimerCallback): (-[WebHTMLView viewWillMoveToWindow:]): (-[WebHTMLView viewDidMoveToWindow]): (-[WebHTMLView windowDidBecomeKey:]): (-[WebHTMLView windowDidResignKey:]): (-[WebHTMLView becomeFirstResponder]): (-[WebHTMLView resignFirstResponder]): * WebView/WebHTMLViewInternal.h: * WebView/WebHTMLViewPrivate.h: 2008-01-17 John Sullivan <sullivan@apple.com> Reviewed by Darin - fixed <rdar://problem/5692068> -1 WebFrameView world leaks reported after closing view source window * WebView/WebFrameView.mm: (-[WebFrameView initWithCoder:]): override to bump the global WebFrameView count 2008-01-16 Adam Roben <aroben@apple.com> Updated for renames/removal of WebCore methods. Reviewed by Darin Adler. * Plugins/WebPluginController.mm: (-[WebPluginController webPlugInContainerSelectionColor]): Changed to ask isFocusedAndActive directly, instead of going through the frame bridge. * WebView/WebHTMLView.mm: (-[WebHTMLView _updateActiveState]): Updated for method renames. 2008-01-16 John Sullivan <sullivan@apple.com> Reviewed by Adam and Dan - cleaned up some existing logging * WebView/WebHTMLView.mm: (-[WebHTMLView setNeedsDisplay:]): add method name to log, use "YES" and "NO" instead of (int)flag (-[WebHTMLView setNeedsLayout:]): ditto (-[WebHTMLView setNeedsToApplyStyles:]): ditto 2008-01-15 Geoffrey Garen <ggaren@apple.com> Reviewed by Andre Boule. Fixed <rdar://problem/5667627> [WebCache empty] implementation should not disable/enable the cache Toggle the cache model instead -- toggling disable/enable just causes the cache to forget about resources, not reclaim their memory. * Misc/WebCache.mm: (+[WebCache empty]): * WebView/WebView.mm: * WebView/WebViewInternal.h: 2008-01-15 Adele Peterson <adele@apple.com> Reviewed by Adam and Antti. WebKit part of fix for <rdar://problem/5619062> Add load progress indicator to video controls * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Removed initialization for GetMediaControlBackgroundImageData. Added initialization for DrawMediaSliderTrack. 2008-01-10 Geoffrey Garen <ggaren@apple.com> Reviewed by John Sullivan. Fixed some world leak reports: * <rdar://problem/5669436> PLT complains about world leak of 1 JavaScript Interpreter after running cvs-base suite * <rdar://problem/5669423> PLT complains about world leak if browser window is open when PLT starts These were both bugs in the reporting mechanism, so I took the opportunity to do some house cleaning there. * Misc/WebCoreStatistics.h: Did a little renaming, to match JavaScriptCore better. I kept the methods with the old names around, though, because old versions of Safari need them. * Misc/WebCoreStatistics.mm: Removed dependence on WebCore::JavaScriptStatistics, which is gone now. These two methods are now distinct, for the sake of world leak reporting: (+[WebCoreStatistics javaScriptGlobalObjectsCount]): (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]): 2008-01-10 Maciej Stachowiak <mjs@apple.com> Not reviewed. Build fix. - Attempt to fix mac build. * Storage/WebDatabaseManager.mm: 2008-01-10 Maciej Stachowiak <mjs@apple.com> Reviewed by Sam. - remove SecurityOriginData and fold its functionality into SecurityOrigin * Storage/WebDatabaseManager.mm: (-[WebDatabaseManager origins]): (-[WebDatabaseManager databasesWithOrigin:]): (-[WebDatabaseManager detailsForDatabase:withOrigin:]): (-[WebDatabaseManager deleteDatabasesWithOrigin:]): (-[WebDatabaseManager deleteDatabase:withOrigin:]): * Storage/WebDatabaseTrackerClient.h: * Storage/WebDatabaseTrackerClient.mm: (WebDatabaseTrackerClient::dispatchDidModifyOrigin): (WebDatabaseTrackerClient::dispatchDidModifyDatabase): * Storage/WebSecurityOrigin.mm: (-[WebSecurityOrigin initWithProtocol:domain:port:]): (-[WebSecurityOrigin protocol]): (-[WebSecurityOrigin domain]): (-[WebSecurityOrigin port]): (-[WebSecurityOrigin usage]): (-[WebSecurityOrigin quota]): (-[WebSecurityOrigin setQuota:]): (-[WebSecurityOrigin isEqual:]): (-[WebSecurityOrigin dealloc]): (-[WebSecurityOrigin finalize]): (-[WebSecurityOrigin _initWithWebCoreSecurityOrigin:]): (-[WebSecurityOrigin _core]): * Storage/WebSecurityOriginInternal.h: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::requestQuotaIncreaseForNewDatabase): (WebChromeClient::requestQuotaIncreaseForDatabaseOperation): 2008-01-10 Sam Weinig <sam@webkit.org> Reviewed by Anders Carlsson. Fixes: http://bugs.webkit.org/show_bug.cgi?id=16522 <rdar://problem/5657355> * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView loadPluginRequest:]): call findFrameForNavigation to ensure the shouldAllowNavigation check is made. 2008-01-07 Nikolas Zimmermann <zimmermann@kde.org> Reviewed by Mark. Enable SVG_FONTS by default. * Configurations/WebKit.xcconfig: 2008-01-07 Adele Peterson <adele@apple.com> Reviewed by Antti, Adam, and Mitz. WebKit part of fix for <rdar://problem/5619073> Updated look for <video> controls <rdar://problem/5619057> Add volume control to video controls * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2008-01-07 Dan Bernstein <mitz@apple.com> Reviewed by Dave Hyatt. - <rdar://problem/5665216> Support the unicode-range property in @font-face rules * Misc/WebNSAttributedStringExtras.mm: 2008-01-03 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. <rdar://problem/5463489> A number of layout tests should be using execCommand instead of textInputController * WebView/WebView.mm: (-[WebView _executeCoreCommandByName:value:]): * WebView/WebViewPrivate.h: Added an SPI to implement layoutTestController.execCommand. 2008-01-03 Kevin Decker <kdecker@apple.com> Reviewed by Darin Adler. Fixed: <rdar://problem/4106190> Include "Where from" metadata in drag-and-dropped images * Misc/WebNSFileManagerExtras.h: * Misc/WebNSFileManagerExtras.m: (-[NSFileManager _webkit_setMetadataURL:referrer:atPath:]): Added new method. Uses WebKitSystemInterface to set "Where from:" metadata information. * WebView/WebHTMLView.mm: (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Added "Where from:" metadata for drag and dropped images. 2008-01-03 Alice Liu <alice.liu@apple.com> Reviewed by Darin Adler. This fixes pageup/down in iframes. test for this is fast/frames/iframe-scroll-page-up-down.html * WebView/WebHTMLView.mm: (-[WebHTMLView doCommandBySelector:]): Have the editor handle all the commands it supports instead of just text commands. If not handled by the editor, the webview will handle the command. 2008-01-02 Kevin Decker <kdecker@apple.com> Reviewed by Darin Adler. Fixed: <rdar://problem/5660603> QuickDraw plug-ins can cause a 100% reproducible assertion failure in AppKit (breaks Safari UI) * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView updateAndSetWindow]): Simplified an early return for non-QuickDraw plug-ins and switched to using the more NSView friendly version of lockFocus, lockFocusIfCanDraw. 2008-01-01 David D. Kilzer <ddkilzer@webkit.org> Reviewed by Dan. - fix http://bugs.webkit.org/show_bug.cgi?id=16700 Fix -[WebDefaultPolicyDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:] * DefaultDelegates/WebDefaultPolicyDelegate.m: Check return value of -[NSFileManager fileExistsAtPath:isDirectory:] before using the value of isDirectory. 2007-12-29 Nikolas Zimmermann <zimmermann@kde.org> Reviewed by Eric. Add DOMSVGFontElement/DOMSVGGlyphElement/DOMSVGMissingGlyphElement to MigrateHeaders.make * MigrateHeaders.make: 2007-12-25 Dan Bernstein <mitz@apple.com> Reviewed by Oliver Hunt. - fix an assertion failure when pressing the num lock key * WebView/WebHTMLView.mm: (-[WebHTMLView flagsChanged:]): Avoid passing key code 10 down to WebCore. 2007-12-20 Darin Adler <darin@apple.com> Reviewed by Oliver. - fix <rdar://problem/5658787> Selector -[WebView insertLineBreak:] is not implemented * WebView/WebView.mm: Added all selectors implemented by WebHTMLView to the list of selectors to forward here. The new ones are: changeBaseWritingDirection:, changeSpelling:, deleteToMark:, insertLineBreak:, moveParagraphBackwardAndModifySelection:, moveParagraphForwardAndModifySelection:, pageDownAndModifySelection:, pageUpAndModifySelection:, selectToMark:, setMark:, swapWithMark:, takeFindStringFromSelection:, toggleBaseWritingDirection:, and transpose:. 2007-12-20 Kevin Decker <kdecker@apple.com> Reviewed by Anders. Fixed: <rdar://problem/5638288> REGRESSION: Flash movies show up in other tabs above the page (16373) * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView updateAndSetWindow]): QuickDraw plug-ins must manually be told when to stop writing to the window backing store. The problem was that change-set 28400 introduced an early return which prevented this necessary operation. The fix is to limit the scope of the early return to CG and GL plug-ins and to tweak the needsFocus check to prevent an exception from occurring in QuickDraw-based plug-ins. 2007-12-19 Geoffrey Garen <ggaren@apple.com> Reviewed by Oliver Hunt. Build fix. * ForwardingHeaders/kjs/SymbolTable.h: Added. * ForwardingHeaders/wtf/VectorTraits.h: Added. 2007-12-16 Mark Rowe <mrowe@apple.com> Reviewed by Maciej Stachowiak. Refactor Mac plugin stream code to use the shared NetscapePlugInStreamLoader implementation. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebNetscapePluginStream.h: * Plugins/WebNetscapePluginStream.mm: (-[WebNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]): (-[WebNetscapePluginStream dealloc]): (-[WebNetscapePluginStream finalize]): * Plugins/WebPlugInStreamLoaderDelegate.h: Moved from WebCore. * WebCoreSupport/WebNetscapePlugInStreamLoaderClient.h: Added. (WebNetscapePlugInStreamLoaderClient::WebNetscapePlugInStreamLoaderClient): * WebCoreSupport/WebNetscapePlugInStreamLoaderClient.mm: Added. (WebNetscapePlugInStreamLoaderClient::didReceiveResponse): Call through to the equivalent WebPlugInStreamLoaderDelegate method. (WebNetscapePlugInStreamLoaderClient::didReceiveData): Ditto. (WebNetscapePlugInStreamLoaderClient::didFail): Ditto. (WebNetscapePlugInStreamLoaderClient::didFinishLoading): Ditto. 2007-12-16 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=14140 <rdar://problem/5270958> REGRESSION: Complex system KeyBindings don't work properly * WebView/WebHTMLView.mm: (-[WebHTMLView _interceptEditingKeyEvent:shouldSaveCommand:]): Made command replaying work when handling keypress, too. (-[WebHTMLView doCommandBySelector:]): Adapted for the new way to store commands in events. (-[WebHTMLView insertText:]): Append a command, not replace the whole existing vector. Also, restore the state for additional commands to be saved correctly. 2007-12-14 David D. Kilzer <ddkilzer@apple.com> <rdar://problem/5647272> Remove user agent string hack for flickr.com Reviewed by Darin Adler. * WebView/WebView.mm: (-[WebView _userAgentForURL:]): Removed hack. 2007-12-14 David D. Kilzer <ddkilzer@apple.com> <rdar://problem/5647261> Remove user agent string hack for yahoo.com Reviewed by Darin Adler. * WebView/WebView.mm: (-[WebView _userAgentForURL:]): Removed hack. 2007-12-14 Darin Adler <darin@apple.com> Reviewed by Brady. - fix http://bugs.webkit.org/show_bug.cgi?id=16296 <rdar://problem/5635641> -[WebFrameLoadDelegate didReceiveIcon:forFrame:] never called * WebView/WebView.mm: (-[WebView setFrameLoadDelegate:]): Call [WebIconDatabase sharedIconDatabase] if the a didReceiveIcon method is present. 2007-12-14 Darin Adler <darin@apple.com> Reviewed by Alexey. - Changed a few more editing operations to use WebCore instead of WebKit. - Removed some obsolete unused code. * WebCoreSupport/WebFrameBridge.h: Moved declarations of methods that are both defined and used on the WebKit side to here. These no longer belong on the bridge and should be moved to the WebFrame class (or elsewhere). * WebCoreSupport/WebFrameBridge.mm: Removed some unused methods. * WebView/WebFrameView.mm: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): Fix typo in comment. * WebView/WebHTMLView.mm: (-[WebHTMLViewPrivate dealloc]): Removed unused firstResponderTextViewAtMouseDownTime. (-[WebHTMLViewPrivate clear]): Ditto. (-[WebHTMLView _setMouseDownEvent:]): Ditto. (commandNameForSelector): Added special cases for pageDown:, pageDownAndModifySelection:, pageUp:, and pageUpAndModifySelection:, since those names probably aren't specific enough to be used in WebCore (what AppKit calls scrollPageDown: vs. pageDown: needs to be disambiguated with the word "Move"). Added deleteBackward:, deleteBackwardByDecomposingPreviousCharacter:, deleteForward:, deleteToBeginningOfLine:, deleteToBeginningOfParagraph:, deleteToEndOfLine:, deleteToEndOfParagraph:, pageDown:, pageDownAndModifySelection:, pageUp:, pageUpAndModifySelection:, selectLine:, selectParagraph:, selectSentence:, and selectWord: to the list of commands that are forwarded to WebCore. (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): Eliminated the long list of operations that we forward to WebCore. Instead, look up any command that WebCore can handle, after any that we handle specially in WebHTMLView. Also fixed a bug where an item that's not a menu item with changeBaseWritingDirection:NSWritingDirectionNatural would end up enabled instead of disabled and streamlined the logic for toggleGrammarChecking:. (-[WebHTMLView mouseDown:]): Removed unused firstResponderTextViewAtMouseDownTime. (-[WebHTMLView becomeFirstResponder]): Removed unused willBecomeFirstResponderForNodeFocus. (-[WebHTMLView resignFirstResponder]): Ditto. (-[WebHTMLView checkSpelling:]): Took unneeded extra initialization of NSSpellChecker. * WebView/WebHTMLViewInternal.h: Removed unused willBecomeFirstResponderForNodeFocus, firstResponderTextViewAtMouseDownTime, _textViewWasFirstResponderAtMouseDownTime: and _willMakeFirstResponderForNodeFocus. 2007-12-13 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. Turn on keyboard event processing quirks for feed views and old applications on Mac OS X. * Misc/WebKitVersionChecks.h: * WebView/WebView.mm: (-[WebView _needsKeyboardEventHandlingQuirks]): (-[WebView _preferencesChangedNotification:]): 2007-12-12 Brady Eidson <beidson@apple.com> Reviewed by Sam Weinig Fix for <rdar://problem/4886844> and lay groundwork for <rdar://problem/4516170> (Back/Forward Cache on Windows) * WebCoreSupport/WebCachedPagePlatformData.h: Added. (WebCachedPagePlatformData::WebCachedPagePlatformData): Constructor takes a WebDocumentView for later restoration (WebCachedPagePlatformData::clear): (WebCachedPagePlatformData::webDocumentView): * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::savePlatformDataToCachedPage): (WebFrameLoaderClient::transitionToCommittedFromCachedPage): Don't set the DocumentLoader to the Frame here, because that is now done in WebCore. (WebFrameLoaderClient::transitionToCommittedForNewPage): 2007-12-12 Mark Rowe <mrowe@apple.com> Reviewed by Dave Kilzer. Remove abuse of projectDirPath from WebKit.xcodeproj to fix Production builds. * Configurations/WebKit.xcconfig: 2007-12-11 Sam Weinig <sam@webkit.org> Reviewed by Darin Adler. Scrub URL out of the tree in preparation for renaming KURL to URL. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::actionDictionary): * WebView/WebDataSource.mm: (-[WebDataSource _URL]): * WebView/WebView.mm: (-[WebView _dispatchDidReceiveIconFromWebFrame:]): 2007-12-11 Darin Adler <darin@apple.com> Reviewed by Geoff. - change more editing commands to use WebCore::Editor - change to use the new WebCore::Editor::command() function * WebView/WebHTMLView.mm: Changed alignCenter, alignJustified, alignLeft, alignRight, cut, copy, deleteToMark, indent, insertNewlineIgnoringFieldEditor, insertTabIgnoringFieldEditor, outdent, selectAll, selectToMark, setMark, subscript, superscript, swapWithMark, underline, unscript, yank, and yankAndSelect to use the "forward to WebCore" macro instead of having hand-written implementations. (kit): Added function to change a TriState to an AppKit-style tri-state value. (-[WebHTMLView coreCommandBySelector:]): Added. No longer converts case of the first character or copies the selector name, since the Editor commands are not case sensitive any more. Returns a command object. (-[WebHTMLView coreCommandByName:]): Added. (-[WebHTMLView executeCoreCommandBySelector:]): Renamed from callWebCoreCommand:, and changed to use the new coreCommandBySelector: method. (-[WebHTMLView executeCoreCommandByName:]): Added. (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): Changed all the methods that call through to WebCore to also use the state() and isEnabled() functions on the commands for the menu item state and user interface item enabling. (-[WebHTMLView _handleStyleKeyEquivalent:]): Use ToggleBold and ToggleItalic by name rather than having local methods for them; no need for methods with a single call site. (-[WebHTMLView insertParagraphSeparator:]): Use executeCoreCommandByName: rather than the deprecated execCommand(). (-[WebHTMLView doCommandBySelector:]): Changed to use command().execute() rather than the deprecated execCommand(). * WebView/WebHTMLViewInternal.h: Removed some unneeded method declarations. 2007-12-07 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. <rdar://problem/5535636> Have to press 4 times instead of 2 times to get the expected result of ^^ with german keyboard. http://bugs.webkit.org/show_bug.cgi?id=13916 JavaScript detects Tab as a character input on a textfield validation * WebCoreSupport/WebEditorClient.h: Renamed handleKeypress() to handleKeyboardEvent(), as it gets both keydowns and keypresses. Renamed handleInputMethodKeypress() to handleInputMethodKeydown(). * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::handleKeyboardEvent): This change makes sense only remotely, but it helped to get tests working. I guess Mac keyboard event handling needs further refactoring. * WebView/WebHTMLView.mm: (selectorToCommandName): Convert AppKit editing selector name to Editor command name - extracted from callWebCoreCommand:. (_interceptEditingKeyEvent:shouldSaveCommand:): Insert text from keypress. * WebView/WebPDFView.mm: (-[WebPDFView PDFViewWillClickOnLink:withURL:]): Convert incoming platform KeyDown into RawKeyDown, as this is what the view is interested in. 2007-12-10 Brady Eidson <beidson@apple.com> Reviewed by John Sullivan Fix for <rdar://problem/5640080> - Database UI delegate calls need to specify WebFrame This is because a common UI case is to want to know the originating URL of a Database * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::requestQuotaIncreaseForNewDatabase): (WebChromeClient::requestQuotaIncreaseForDatabaseOperation): * WebView/WebUIDelegatePrivate.h: * WebView/WebView.mm: (CallDelegateReturningUnsignedLongLong): (CallUIDelegateReturningUnsignedLongLong): * WebView/WebViewInternal.h: 2007-12-10 Timothy Hatcher <timothy@apple.com> Reviewed by Mark Rowe. <rdar://problem/5639463> Bundle versions on Tiger should be 4523.x not 523.x * Configurations/Version.xcconfig: Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR, so assume Tiger and use a 4 for the SYSTEM_VERSION_PREFIX. 2007-12-10 Kevin Decker <kdecker@apple.com> Reviewed by Darin Adler. Fixed: <rdar://problem/4290098> Right-mouse click on element doesn't call onmousedown handler * WebView/WebHTMLView.mm: (-[WebHTMLView menuForEvent:]): Match behavior of other browsers by sending an onmousedown event for right clicks. 2007-12-08 Oliver Hunt <oliver@apple.com> Reviewed by Sam W. Split the ENABLE_SVG_EXPERIMENTAL_FEATURES flag into separate flags. Fixes <rdar://problem/5620249> Must disable SVG animation <rdar://problem/5612772> Disable SVG filters on Mac to match Windows behavior Minor updates to the feature flags used. * Configurations/WebKit.xcconfig: * DOM/WebDOMOperations.mm: 2007-12-07 Darin Adler <darin@apple.com> Reviewed by Kevin Decker and Tim Hatcher. - speculative fix for <rdar://problem/5400159> CrashTracer: [USER] 726 crashes in Safari at com.apple.WebKit: -[WebHTMLView(WebPrivate) _updateMouseoverWithFakeEvent] + 389 * WebView/WebHTMLView.mm: (-[WebHTMLView _frameOrBoundsChanged]): Only schedule the mouseover timer if we are in a window and not closed. That's because viewDidMoveToWindow and close are the entry points for cancelling. (-[WebHTMLView close]): Add code to cancel both timers. Needed for the case where the entire window goes away, and the view is never removed from the window. (-[WebHTMLView viewDidMoveToWindow]): Don't do work if the view is closed. 2007-12-07 Darin Adler <darin@apple.com> Reviewed by Mitz. - http://bugs.webkit.org/show_bug.cgi?id=15981 speed up visited-link code a bit * History/WebHistory.mm: Removed unused Latin-1 code path. (-[_WebCoreHistoryProvider containsURL:length:]): Updated for method name change. 2007-12-07 Geoffrey Garen <ggaren@apple.com> Reviewed by Sam Weinig. Added a forwarding header, since we now #include nodes.h through some JavaScriptCore headers. * ForwardingHeaders/wtf/ListRefPtr.h: Added. 2007-12-06 Brady Eidson <beidson@apple.com> Reviewed by Oliver's rubber stamp Let's go ahead and call the correct UI Delegate method, shall we? * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::requestQuotaIncreaseForDatabaseOperation): Call the correct UI delegate 2007-12-06 Adam Roben <aroben@apple.com> Remove some assertions we know can fire and replace them with a FIXME Reviewed by Anders. * WebCoreSupport/WebFrameLoaderClient.mm: 2007-12-06 Timothy Hatcher <timothy@apple.com> Change the ASSERT added for the previous fix. The ASSERT was firing for 10.5.0. Only assert if the major version is zero, since zero is handled in the other cases. * WebView/WebView.mm: (callGestalt): Remove the ASSERT. (createMacOSXVersionString): ASSERT that major is not zero. 2007-12-06 Darin Adler <darin@apple.com> Reviewed by Tim Hatcher. - fix <rdar://problem/5513394> No way to detect Tiger vs Leopard from Safari's user agent string * WebView/WebView.mm: (callGestalt): Added. (createMacOSXVersionString): Added. (-[WebView _userAgentWithApplicationName:andWebKitVersion:]): Added Mac OS X version string, right after the string "Mac OS X", but with underscores instead of dots to avoid the dreaded "4." problem (old libraries that think a "4." anywhere in the user agent means Netscape 4). (-[WebView _userAgentForURL:]): Fixed incorrect bug numbers. 2007-12-04 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler. Third step in refactoring JSGlobalObject: Moved data members and data member access from Interpreter to JSGlobalObject. * WebView/WebFrame.mm: (-[WebFrame _attachScriptDebugger]): 2007-12-04 Kevin McCullough <kmccullough@apple.com> Reviewed by Darin Adler. - <rdar://5621435> - Security Fix. Instead of having it off by default, WebKit now must explicitly turn off local-resource restriction when needed for backwards coimpatibility reasons. * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): 2007-12-05 Brady Eidson <beidson@apple.com> Reviewed by Kevin Deckers rubberstamp Disclose and export the Databases Directory defaults key * Storage/WebDatabaseManager.mm: * Storage/WebDatabaseManagerPrivate.h: * WebKit.exp: 2007-12-04 Kevin Decker <kdecker@apple.com> Reviewed by Anders. <rdar://problem/5629125> PluginInfoStore needs the ability to return the name of a plug-in for a given MIME type * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory pluginNameForMIMEType:]): Added. 2007-12-04 Brady Eidson <beidson@apple.com> Reviewed by Mark Rowe Tweaked the way we typedef and cast these objc_msgSend calls * WebView/WebView.mm: (CallDelegateReturningUnsignedLongLong): 2007-12-04 John Sullivan <sullivan@apple.com> Reviewed by Brady Eidson (with help from Mark Rowe) Fixed return values for unsigned-long-long delegate methods * WebView/WebView.mm: (CallDelegateReturningUnsignedLongLong): redid the change that Brady did at home over the weekend but forgot to check in 2007-11-27 Adam Roben <aroben@apple.com> Remove -[WebFrameBridge setNeedsReapplyStyles] This functionality is now WebCore's responsibility. Reviewed by Hyatt. * WebCoreSupport/WebFrameBridge.mm: * WebKit.order: 2007-12-04 John Sullivan <sullivan@apple.com> Reviewed by Darin Added deleteOrigin: SPI, which isn't fully implemented * Storage/WebDatabaseManagerPrivate.h: * Storage/WebDatabaseManager.mm: (-[WebDatabaseManager deleteOrigin:]): just calls deleteDatabasesWithOrigin: for now, but needs to delete origin itself too 2007-12-04 Timothy Hatcher <timothy@apple.com> Reviewed by Mark Rowe. Remove a check for early versions of Leopard CFNetwork now that Leopard has shipped. * Misc/WebKitVersionChecks.h: Remove WEBKIT_FIRST_CFNETWORK_VERSION_WITH_LARGE_DISK_CACHE_FIX. * WebView/WebView.mm: (+[WebView _setCacheModel:]): Remove the early Leopard CFNetwork check. 2007-12-04 Kevin Decker <kdecker@apple.com> Reviewed by Darin Adler. Revised fix for: <rdar://problem/5586978> REGRESSION (Safari 2-3): WebKit sometimes doesn't invoke Flash's NPP_SetWindow function and causes a hang This fix is exactly the same as chageset 28359 with the exception of an added early return in updateAndSetWindow to cover the additional case of when a plug-in isn't drawable. The CG-based Flash player would sometimes hang because (for CoreGraphics-based plug-ins) our code would only call into the NPP_SetWindow() function when we tell the plug-in to draw. This created havoc with Flash because Flash expects the browser to call NPP_SetWindow() and provide a valid graphics context regardless of whether or not it actually needs to draw. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): Removed an incorrect comment and toned down an ASSERT that was too strict. (-[WebBaseNetscapePluginView updateAndSetWindow]): Removed an early return for CoreGraphics-based plug-ins which would sometimes altogether prevent updating the PortState and calling into a plug-ins NPP_SetWindow() function. Also tweaked a comment and added an early return if the plug-in can't draw. 2007-12-04 Darin Adler <darin@apple.com> Reviewed by Kevin Decker. * WebCoreSupport/WebFrameLoaderClient.h: Removed obsolete privateBrowsingEnabled. * WebCoreSupport/WebFrameLoaderClient.mm: Ditto. * WebKit.order: Ditto. 2007-12-03 Dan Bernstein <mitz@apple.com> Reviewed by Dave Hyatt. - fix <rdar://problem/5346452> Resize event doesn't fire on body element inside a frame * WebView/WebHTMLView.mm: (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): Removed the code that checked if the view had resized and sent the resize event, since FrameView sends resize events now. * WebView/WebHTMLViewInternal.h: 2007-12-03 Timothy Hatcher <timothy@apple.com> Reviewed by Darin Adler. Change WebViewGetResourceLoadDelegateImplementations and WebViewGetFrameLoadDelegateImplementations to return a pointer to the implementation struct instead of a copy of the struct. This changes all of the callers to dereference the pointer to access the struct fields. * Plugins/WebNullPluginView.mm: (-[WebNullPluginView reportFailure]): * WebCoreSupport/WebFrameBridge.mm: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache): (WebFrameLoaderClient::assignIdentifierToInitialRequest): (WebFrameLoaderClient::dispatchWillSendRequest): (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidReceiveResponse): (WebFrameLoaderClient::willCacheResponse): (WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebFrameLoaderClient::dispatchDidFinishLoading): (WebFrameLoaderClient::dispatchDidFailLoading): (WebFrameLoaderClient::dispatchDidHandleOnloadEvents): (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebFrameLoaderClient::dispatchDidCancelClientRedirect): (WebFrameLoaderClient::dispatchWillPerformClientRedirect): (WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): (WebFrameLoaderClient::dispatchWillClose): (WebFrameLoaderClient::dispatchDidStartProvisionalLoad): (WebFrameLoaderClient::dispatchDidReceiveTitle): (WebFrameLoaderClient::dispatchDidCommitLoad): (WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebFrameLoaderClient::dispatchDidFailLoad): (WebFrameLoaderClient::dispatchDidFinishDocumentLoad): (WebFrameLoaderClient::dispatchDidFinishLoad): (WebFrameLoaderClient::dispatchDidFirstLayout): * WebView/WebView.mm: (WebViewGetResourceLoadDelegateImplementations): (WebViewGetFrameLoadDelegateImplementations): (-[WebView _dispatchDidReceiveIconFromWebFrame:]): * WebView/WebViewInternal.h: 2007-12-03 Timothy Hatcher <timothy@apple.com> Reviewed by Brady Eidson. <rdar://problem/5539913> 188 crashes in WebViewGetFrameLoadDelegateImplementations <rdar://problem/5586095> CrashTracer: [USER] 5000+ crashes in Safari and Dashboard in dispatchDidFailLoading <rdar://problem/5607081> CrashTracer: [USER] 2150 crashes in Safari at com.apple.WebKit: WebViewGetResourceLoadDelegateImplementations + 28 * WebView/WebView.mm: (-[WebView _cacheResourceLoadDelegateImplementations]): If the delegate is nil, bzero the implementation cache. This just prevents us from calling getMethod() multiple times just to zero. (-[WebView _cacheFrameLoadDelegateImplementations]): Ditto. (WebViewGetResourceLoadDelegateImplementations): Return a zeroed implementations struct if the WebView is nil. This fixes the crashes. (WebViewGetFrameLoadDelegateImplementations): Ditto. 2007-12-02 Geoffrey Garen <ggaren@apple.com> Reviewed by Eric Seidel. Updated to match the JavaScriptCore change to move virtual methods from Interpreter to JSGlobalObject. * WebView/WebFrame.mm: (-[WebFrame globalContext]): Use the toRef function instead of manually casting. 2007-12-01 Brady Eidson <beidson@apple.com> Reviewed by Tim Added a default database quota of 5mb to the default WebPreferences * WebView/WebPreferences.m: (+[WebPreferences initialize]): 2007-11-30 John Sullivan <sullivan@apple.com> Reviewed by Geoff Garen Added another symbol for WebDatabaseManager clients * WebKit.exp: added .objc_class_name_WebSecurityOrigin 2007-11-30 Brady Eidson <beidson@apple.com> Reviewed by Geoff Add isEqual operator to WebSecurityOrigin * Storage/WebSecurityOrigin.mm: (-[WebSecurityOrigin isEqual:]): 2007-11-30 John Sullivan <sullivan@apple.com> Reviewed by Darin Tweaks to newly-declared NSString * constants to make them usable from clients * Storage/WebDatabaseManagerPrivate.h: * Storage/WebDatabaseManager.mm: removed "const" from new NSNotification names and userInfo keys; these generate compiler warnings when used * WebKit.exp: export new NSNotification names and userInfo keys so clients can use them 2007-11-29 Anders Carlsson <andersca@apple.com> Reviewed by John. Rename WebKitShrinksStandaloneImagesToFitKey to WebKitShrinksStandaloneImagesToFit. This is safe to do because the preference is off by default and Safari 3, which is the only client that turns it on, is using the setter and not messing around with NSUserDefaults. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.m: (+[WebPreferences initialize]): (-[WebPreferences shrinksStandaloneImagesToFit]): (-[WebPreferences setShrinksStandaloneImagesToFit:]): 2007-11-29 Brady Eidson <beidson@apple.com> Reviewed by Anders Support for <rdar://problem/5556381> and <rdar://problem/5556379> Hook up UI Delegate calls for the database engine feature and other small tweaks * Storage/WebDatabaseManager.mm: (-[WebDatabaseManager detailsForDatabase:withOrigin:]): Renamed databaseName parameter to databaseIdentifier for clarity (-[WebDatabaseManager deleteDatabase:withOrigin:]): Renamed databaseName parameter to databaseIdentifier for clarity * Storage/WebDatabaseManagerPrivate.h: * Storage/WebDatabaseTrackerClient.h: * Storage/WebDatabaseTrackerClient.mm: (WebDatabaseTrackerClient::dispatchDidModifyDatabase): Renamed databaseName parameter to databaseIdentifier for clarity * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::requestQuotaIncreaseForNewDatabase): Call through to the UI Delegate (WebChromeClient::requestQuotaIncreaseForDatabaseOperation): Ditto * WebView/WebUIDelegatePrivate.h: Added the two UI Delegate methods * WebView/WebView.mm: (CallDelegateReturningUnsignedLongLong): (CallUIDelegateReturningUnsignedLongLong): * WebView/WebViewInternal.h: 2007-11-28 Kevin McCullough <kmccullough@apple.com> Reviewed by Sam. - Added recursive runloop guards. * DefaultDelegates/WebScriptDebugServer.m: (-[WebScriptDebugServer suspendProcessIfPaused]): 2007-11-29 Mark Rowe <mrowe@apple.com> Reviewed by Oliver Hunt. Fix an assertion failure seen on the layout tests, and when closing the window after visiting <http://www.coudal.com/losalamos/>. * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream _destroyStream]): Unlink the file and close the file descriptor even when the stream is being destroyed without the load completing. This avoids leaking the path and file descriptor, and leaving the temporary file on disk. 2007-11-28 Adele Peterson <adele@apple.com> Reviewed by Darin Adler. Fix for <rdar://problem/5524216> CrashTracer: [USER] 496 crashes in Safari at com.apple.WebCore: WebCore::Frame::eventHandler const + 6 The CrashTracer shows a variety of crashes in different methods (including keyDown and keyUp). This change adds nil checks for the frame in WebHTMLView to prevent future problems in other methods as well. * WebView/WebHTMLView.mm: (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): (-[WebHTMLView keyDown:]): (-[WebHTMLView keyUp:]): (-[WebHTMLView flagsChanged:]): (-[WebHTMLView _selectionStartFontAttributesAsRTF]): (-[WebHTMLView _changeCSSColorUsingSelector:inRange:]): (-[WebHTMLView checkSpelling:]): (-[WebHTMLView showGuessPanel:]): (-[WebHTMLView indent:]): (-[WebHTMLView outdent:]): (-[WebHTMLView paste:]): (-[WebHTMLView _lookUpInDictionaryFromMenu:]): (-[WebHTMLView insertText:]): (-[WebHTMLView selectionTextRects]): 2007-11-28 Dan Bernstein <mitz@apple.com> Reviewed by Maciej Stachowiak. - fix <rdar://problem/5596160> fast/events/objc-event-api.html fails when run alone (or first) * WebView/WebHTMLView.mm: (-[WebHTMLView setDataSource:]): This method calls addMouseMovedObserver because addMouseMovedObserver returns early if the dataSource is not nil. But if the dataSource is already set (which happens when a WebHTMLView is being reused) then addMouseMovedObserver must not be called again. 2007-11-27 Anders Carlsson <andersca@apple.com> Reviewed by Brady. * Storage/WebDatabaseManager.mm: * Storage/WebDatabaseManagerPrivate.h: * Storage/WebDatabaseTrackerClient.mm: (WebDatabaseTrackerClient::dispatchDidModifyOrigin): (WebDatabaseTrackerClient::dispatchDidModifyDatabase): * Storage/WebSecurityOrigin.mm: (-[WebSecurityOrigin _initWithWebCoreSecurityOriginData:]): * Storage/WebSecurityOriginInternal.h: 2007-11-27 Kevin Decker <kdecker@apple.com> Reviewed by Darin, landed by Anders. Fixed: <rdar://problem/4610818> CrashTracer: 1533 crashes in Safari at com.macromedia.Flash Player.plugin: native_ShockwaveFlash_TCallLabel + 271131 The problem was that some Leopard users were still inadvertently using the old Flash 8 plug-in, even though Leopard shipped with Flash 9. To avoid loading an older version of a plug-in when a newer version is installed, the plug-in database will compare bundle versions and always load the latest version. * Plugins/WebBasePluginPackage.h: * Plugins/WebBasePluginPackage.m: (-[WebBasePluginPackage versionNumber]): New method. CFBundleGetVersionNumber doesn't work with all possible versioning schemes, but we think for now it's good enough for us. * Plugins/WebPluginDatabase.m: (considerCandidate): Added a C utility function which compares the current plug-in against a candidate plug-in's version number. If both plug-ins have the same bundle ID and the candiate is newer, the current plug-in becomes the candidate. (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): Calls the new considerCandidate() function. 2007-11-26 Timothy Hatcher <timothy@apple.com> Reviewed by Dave Hyatt. <rdar://problem/5569233> Add the ability to disable author and user CSS styles * WebView/WebPreferenceKeysPrivate.h: Define WebKitRespectStandardStyleKeyEquivalentsPreferenceKey. * WebView/WebPreferences.m: (+[WebPreferences initialize]): Default WebKitRespectStandardStyleKeyEquivalentsPreferenceKey to YES. (-[WebPreferences authorAndUserStylesEnabled]): Return the setting's BOOL value. (-[WebPreferences setAuthorAndUserStylesEnabled:]): Set the setting's BOOL value. * WebView/WebPreferencesPrivate.h: Add authorAndUserStylesEnabled and setAuthorAndUserStylesEnabled:. * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Update WebCore::Settings::authorAndUserStylesEnabled. 2007-11-26 Brady Eidson <beidson@apple.com> Reviewed by Mark Rowe Provide API for setting the default storage quota per database origin * Misc/WebNSDictionaryExtras.h: * Misc/WebNSDictionaryExtras.m: (-[NSMutableDictionary _webkit_setUnsignedLongLong:forKey:]): Helper for UINT64 preferences * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.m: (-[WebPreferences _unsignedLongLongValueForKey:]): Helper for UINT64 prefs (-[WebPreferences _setUnsignedLongLongValue:forKey:]): Ditto (-[WebPreferences defaultDatabaseQuota]): (-[WebPreferences setDefaultDatabaseQuota:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChangedNotification:]): Set the WebCore Settings version of the default storage pref 2007-11-26 Darin Adler <darin@apple.com> Reviewed by Adele. - some middle-mouse-button-related fixes These don't affect Safari since it maps the middle mouse button to the command key, but that might not always be the case for future versions. * WebView/WebHTMLView.mm: (-[WebHTMLView otherMouseDown:]): Pass through middle mouse down events to WebCore. (-[WebHTMLView otherMouseDragged:]): Ditto, for drag events. (-[WebHTMLView otherMouseUp:]): Ditto, for up events. * WebView/WebPolicyDelegate.h: Fixed inaccurate documentation of WebActionButtonKey. 2007-11-26 Anders Carlsson <andersca@apple.com> Reviewed by Brady. Get rid of the WebSecurityOriginPrivate object and store the WebCore::SecurityOriginData pointer in the _private field of the WebSecurityOrigin object instead. * Storage/WebDatabaseManager.mm: (-[WebDatabaseManager databasesWithOrigin:]): (-[WebDatabaseManager detailsForDatabase:withOrigin:]): (-[WebDatabaseManager deleteDatabasesWithOrigin:]): (-[WebDatabaseManager deleteDatabase:withOrigin:]): * Storage/WebSecurityOrigin.mm: (-[WebSecurityOrigin initWithProtocol:domain:port:]): (-[WebSecurityOrigin protocol]): (-[WebSecurityOrigin domain]): (-[WebSecurityOrigin port]): (-[WebSecurityOrigin usage]): (-[WebSecurityOrigin quota]): (-[WebSecurityOrigin setQuota:]): (-[WebSecurityOrigin dealloc]): (-[WebSecurityOrigin finalize]): (-[WebSecurityOrigin _initWithWebCoreSecurityOriginData:]): (-[WebSecurityOrigin _core]): * Storage/WebSecurityOriginInternal.h: 2007-11-26 Timothy Hatcher <timothy@apple.com> Reviewed by Adam Roben. Bug 16137: Web Inspector window on Leopard should have a unified toolbar and window title http://bugs.webkit.org/show_bug.cgi?id=16137 Create the Web Inspector window with the textured style. Set the content border thickness for the top of the window or the height of the toolbar. Also make the window's bottom corners square, since a normal textured window normally has rounded bottom corners. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController window]): 2007-11-24 Mark Rowe <mrowe@apple.com> Tiger build fix. * Plugins/WebBaseNetscapePluginStream.mm: (CarbonPathFromPOSIXPath): Use WebCFAutorelease as this also works on Tiger. 2007-11-24 Mark Rowe <mrowe@apple.com> Reviewed by Tim Hatcher. Fix <rdar://problem/5432686> 333MB RPRVT seems to leak @ www.43folders.com (1hr plug-in stream). http://bugs.webkit.org/show_bug.cgi?id=13705 Have NP_ASFILE and NP_ASFILEONLY streams write the data to disk as they receive it rather than dumping the data to disk in a single go when the stream has completed loading. On a test case involving a 150MB Flash movie being streamed from a local web server this reduces memory consumption on page load from around 400MB to 22MB. The only plugin I have found that uses NP_ASFILE or NP_ASFILEONLY on the Mac is our NetscapeMoviePlugin example code so the NP_ASFILE portion of this change has not had any testing with a real-world plugin. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]): (-[WebBaseNetscapePluginStream dealloc]): (-[WebBaseNetscapePluginStream finalize]): (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]): (-[WebBaseNetscapePluginStream _destroyStream]): Update to work with paths as NSStrings. (-[WebBaseNetscapePluginStream _deliverDataToFile:]): Open the file if it is not already open, and write any data to disk. (-[WebBaseNetscapePluginStream finishedLoading]): If the stream is NP_ASFILE or NP_ASFILEONLY we need to ensure that the file exists before _destroyStream passes it to the plugin. Simulating the arrival of an empty data block ensure that the file will be created if it has not already. (-[WebBaseNetscapePluginStream receivedData:]): (CarbonPathFromPOSIXPath): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView pluginViewFinishedLoading:]): Data is dealt with incrementally so there's no need to pass it to finishedLoading. (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): Ditto. 2007-11-23 Oliver Hunt <oliver@apple.com> Reviewed by Mark Rowe. Fixed <rdar://problem/3759190> allow input methods the option of processing mouse events themselves * WebView/WebHTMLView.mm: (-[WebHTMLView mouseDown:]): 2007-11-22 Dan Bernstein <mitz@apple.com> Reviewed by Antti Koivisto. - http://bugs.webkit.org/show_bug.cgi?id=15811 WebKit plug-ins can re-enter WebKit under attach() <rdar://problem/5577978> * Plugins/WebNullPluginView.mm: (-[WebNullPluginView viewDidMoveToWindow]): Removed workaround for the above bug that added as part of fixing <http://bugs.webkit.org/show_bug.cgi?id=15804>. 2007-11-21 Mark Rowe <mrowe@apple.com> Reviewed by Eric. Fix WebKit to build without warnings under GCC 4.2. * Configurations/Base.xcconfig: 2007-11-21 Mark Rowe <mrowe@apple.com> Reviewed by Tim Hatcher. Changes due to <rdar://problem/5602936> Need to resolve new GCC 4.2 warnings Update format strings to use format specifiers that match the argument types. * Misc/WebGraphicsExtras.c: (WebConvertBGRAToARGB): 2007-11-19 Brady Eidson <beidson@apple.com> Reviewed by Maciej Finished hooking up the WebKit API for database management. Most of the API is actually implemented in WebCore and some of those methods might only be stubs for now. * Storage/WebDatabaseManager.mm: (-[WebDatabaseManager origins]): Call through to the WebCore tracker and construct an API result (-[WebDatabaseManager databasesWithOrigin:]): Ditto (-[WebDatabaseManager detailsForDatabase:withOrigin:]): Ditto * Storage/WebSecurityOrigin.mm: (-[WebSecurityOrigin usage]): Call through to WebCore (-[WebSecurityOrigin quota]): Ditto (-[WebSecurityOrigin setQuota:]): Ditto (-[WebSecurityOrigin _core]): Get WebCore version of this object * Storage/WebSecurityOriginInternal.h: 2007-11-17 Timothy Hatcher <timothy@apple.com> Reviewed by Mark Rowe. Bug 13470: i18n: The Web Inspector is not localizable http://bugs.webkit.org/show_bug.cgi?id=13470 Implement the localizedStringsURL() client method to return the localized URL of InspectorLocalizedStrings.js in WebCore. * WebCoreSupport/WebInspectorClient.h: Added localizedStringsURL. * WebCoreSupport/WebInspectorClient.mm: (WebInspectorClient::localizedStringsURL): Added. (WebInspectorClient::updateWindowTitle): Localized the window title. (-[WebInspectorWindowController init]): Remove a FIXME that dosen't make sense anymore. (-[WebInspectorWindowController initWithInspectedWebView:]): Code style cleanup. 2007-11-17 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=15969 Eliminate Editor::deleteRange() * WebView/WebHTMLView.mm: (+[WebHTMLView initialize]): (-[WebHTMLView yank:]): (-[WebHTMLView yankAndSelect:]): (-[WebHTMLView setMark:]): (-[WebHTMLView deleteToMark:]): (-[WebHTMLView selectToMark:]): (-[WebHTMLView swapWithMark:]): Pushed all kill ring methods to WebCore. They were guilty of using Editor::deleteRange()! 2007-11-16 Mark Rowe <mrowe@apple.com> Reviewed by Tim Hatcher. Build WebCore as a sub-framework of WebKit in all configurations. * Configurations/WebKit.xcconfig: 2007-11-16 John Sullivan <sullivan@apple.com> Reviewed by Brady * WebKit.exp: Exported some new database-related symbols 2007-11-16 Brady Eidson <beidson@apple.com> Reviewed by John Database management API tweaks Fleshed out "WebSecurityOrigin" to be the API object representing an origin. This relieves some burden off WebDatabaseManager and allows usage/quota operations on the SecurityOrigin object itself Also added a new subdirectory for Storage related API - Why are we afraid to add new directories to the WebKit tree? * Misc/WebSecurityOrigin.mm: Removed. * Misc/WebSecurityOriginInternal.h: Removed. * Misc/WebSecurityOriginPrivate.h: Removed. * Storage/WebDatabaseManager.mm: Work in terms of WebSecurityOrigin * Storage/WebDatabaseManagerPrivate.h: * Storage/WebSecurityOrigin.mm: Added. (-[WebSecurityOriginPrivate initWithProtocol:domain:port:]): (-[WebSecurityOriginPrivate initWithWebCoreSecurityOrigin:]): (-[WebSecurityOriginPrivate finalize]): (-[WebSecurityOriginPrivate dealloc]): (-[WebSecurityOrigin initWithProtocol:domain:]): (-[WebSecurityOrigin initWithProtocol:domain:port:]): (-[WebSecurityOrigin protocol]): (-[WebSecurityOrigin domain]): (-[WebSecurityOrigin port]): (-[WebSecurityOrigin usage]): (-[WebSecurityOrigin quota]): (-[WebSecurityOrigin setQuota:]): Clients will set quotas on the WebSecurityOrigin object itself (-[WebSecurityOrigin dealloc]): (-[WebSecurityOrigin _initWithWebCoreSecurityOriginData:]): * Storage/WebSecurityOriginInternal.h: Added. * Storage/WebSecurityOriginPrivate.h: Added. 2007-11-15 Brady Eidson <beidson@apple.com> Reviewed by John Stubbing out everything required for a WebKit API for databases These interfaces seem to provide everything we need for UI and management at the browser level * Misc/WebDatabaseManager.h: Removed. * Misc/WebDatabaseManager.mm: Removed. * Misc/WebDatabaseManagerPrivate.h: Removed. * Misc/WebSecurityOrigin.mm: Added. Object that acts as a container for the "SecurityOrigin tuple" (protocol, domain, and port) (-[WebSecurityOriginPrivate initWithProtocol:domain:port:]): (-[WebSecurityOriginPrivate dealloc]): (-[WebSecurityOrigin initWithProtocol:domain:]): (-[WebSecurityOrigin initWithProtocol:domain:port:]): (-[WebSecurityOrigin protocol]): (-[WebSecurityOrigin domain]): (-[WebSecurityOrigin port]): (-[WebSecurityOrigin dealloc]): (-[WebSecurityOrigin _initWithWebCoreSecurityOriginData:WebCore::]): * Misc/WebSecurityOriginInternal.h: Added. * Misc/WebSecurityOriginPrivate.h: Added. * Storage/WebDatabaseManager.mm: Added. (+[WebDatabaseManager sharedWebDatabaseManager]): (-[WebDatabaseManager origins]): Get a list of all origins currently tracked (-[WebDatabaseManager detailsForOrigin:]): Get the current usage and current quota for the given origin (-[WebDatabaseManager databasesWithOrigin:]): Get all databases for a certain origin (-[WebDatabaseManager detailsForDatabase:withOrigin:]): Get all details about a specific database (-[WebDatabaseManager setQuota:forOrigin:]): Change origin-wide quota (-[WebDatabaseManager deleteAllDatabases]): (-[WebDatabaseManager deleteAllDatabasesWithOrigin:]): (-[WebDatabaseManager deleteDatabase:withOrigin:]): * Storage/WebDatabaseManagerPrivate.h: Added. * Storage/WebDatabaseManagerInternal.h: Added. (WebKitInitializeDatabasesIfNecessary): One-time initialization of database-related things * Storage/WebDatabaseTrackerClient.h: Added. Stubbed out client for notifications * Storage/WebDatabaseTrackerClient.mm: Added. (WebDatabaseTrackerClient::sharedWebDatabaseTrackerClient): (WebDatabaseTrackerClient::WebDatabaseTrackerClient): (WebDatabaseTrackerClient::~WebDatabaseTrackerClient): (WebDatabaseTrackerClient::dispatchDidModifyOrigin): (WebDatabaseTrackerClient::dispatchDidModifyDatabase): * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Do one-time initialization of Database-related things here 2007-11-13 Geoffrey Garen <ggaren@apple.com> Reviewed by Anders Carlsson. Renamed Shared to RefCounted. * ForwardingHeaders/wtf/RefCounted.h: Copied from WebKit/mac/ForwardingHeaders/wtf/Shared.h. * ForwardingHeaders/wtf/Shared.h: Removed. * WebCoreSupport/WebContextMenuClient.h: 2007-11-13 Geoffrey Garen <ggaren@apple.com> Reviewed by Sam Weinig. Moved Shared.h into wtf so it could be used in more places. * ChangeLog: * WebCoreSupport/WebContextMenuClient.h: 2007-11-13 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. removed recently-added PreferredType concept; we found a better way to do what ths was accomplishing * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::createWindow): removed use of PreferredType 2007-11-13 John Sullivan <sullivan@apple.com> Reviewed by Dan Bernstein. - fixed <rdar://problem/5567954> REGRESSION (Safari 2-3): Autofill no longer automatically fills in form fields other than the one you're typing into * WebCoreSupport/WebEditorClient.mm: (selectorForKeyEvent): correct the key identifier strings for Tab and Esc; these were updated in WebCore as part of r21445 but didn't get updated here. 2007-11-12 Josh Aas <joshmoz@gmail.com> Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=15946 add NPPValue NPPVpluginDrawingModel (Mozilla bug 403418 compat) * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView setVariable:value:]): 2007-11-12 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=15954 Move DOM Selection operations out of SelectionController * WebView/WebHTMLView.mm: (-[WebHTMLView _expandSelectionToGranularity:]): (-[WebHTMLView selectToMark:]): (-[WebHTMLView swapWithMark:]): * WebView/WebView.mm: (-[WebView setSelectedDOMRange:affinity:]): Adapted for SelectionController::setSelectedRange() now returning a bool. 2007-11-12 Oliver Hunt <oliver@apple.com> Reviewed by Darin and Geoff. <rdar://problem/5522011> The content of the password field of Safari is displayed by reconversion. Some input methods (notably Kotoeri) can incorrectly provide access to the raw text of a password field. To work around this we forcefully override the inputContext whenever a password field is active. * WebView/WebHTMLView.mm: (-[WebHTMLView inputContext]): 2007-11-12 John Sullivan <sullivan@apple.com> Reviewed by Tim Hatcher - speculative fix for <rdar://problem/5509989> CrashTracer: [USER] 1 crash in Safari at com.apple.WebKit: -[WebPDFView(FileInternal) _updatePreferencesSoon] + 56 The crash is probably due to messaging a dealloc'ed dataSource ivar. The dataSource ivar isn't retained by this class, but should be. (It is retained by WebHTMLView, e.g.). * WebView/WebPDFView.mm: (-[WebPDFView dealloc]): release dataSource ivar (-[WebPDFView setDataSource:]): retain dataSource ivar 2007-11-09 Tristan O'Tierney <tristan@apple.com> Reviewed by Timothy Hatcher. This patch is for the WebKit side of <rdar://problem/5591115>. We need a way to tell context menu navigations, such as "Open in New Window" to override any sort of browser preference for tab based navigation. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::createWindow): Pass up the new preferredType parameter as a string. 2007-11-09 Timothy Hatcher <timothy@apple.com> Reviewed by John. <rdar://problem/5103720> REGRESSION: [WebView stringByEvaluatingJavaScriptFromString:] fails if "return" is used Extend the linked on or after check to every application when a script passed to stringByEvaluatingJavaScriptFromString: has a return statement. Before the check was limited to VitalSource Bookshelf, but other developers are running into this. * Misc/WebKitVersionChecks.h: Add the WEBKIT_FIRST_VERSION_WITHOUT_JAVASCRIPT_RETURN_QUIRK define. * WebView/WebDocumentLoaderMac.mm: (needsDataLoadWorkaround): Use WEBKIT_FIRST_VERSION_WITHOUT_ADOBE_INSTALLER_QUIRK sicne the WebKitLinkedOnOrAfter check here was about the Adobe installer, not VitalSource. * WebView/WebView.mm: (-[WebView stringByEvaluatingJavaScriptFromString:]): Remove the bundle ID check and use WEBKIT_FIRST_VERSION_WITHOUT_JAVASCRIPT_RETURN_QUIRK for the WebKitLinkedOnOrAfter call. 2007-11-08 Kevin McCullough <kmccullough@apple.com> Build Fix. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::windowObjectCleared): 2007-11-07 Darin Adler <darin@apple.com> Reviewed by Steve. - removed some unused WebCore bridge methods * WebCoreSupport/WebFrameBridge.mm: Removed issueTransposeCommand and overrideMediaType. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::overrideMediaType): Changed to call WebView directly instead of using the bridge object. 2007-11-06 Mark Rowe <mrowe@apple.com> Rubber-stamped by Dave Kilzer. Move Mac files from WebKit into WebKit/mac. * Carbon: Copied from WebKit/Carbon. * ChangeLog: Copied from WebKit/ChangeLog. * ChangeLog-2002-12-03: Copied from WebKit/ChangeLog-2002-12-03. * ChangeLog-2006-02-09: Copied from WebKit/ChangeLog-2006-02-09. * ChangeLog-2007-10-14: Copied from WebKit/ChangeLog-2007-10-14. * Configurations: Copied from WebKit/Configurations. * DOM: Copied from WebKit/DOM. * DefaultDelegates: Copied from WebKit/DefaultDelegates. * ForwardingHeaders: Copied from WebKit/ForwardingHeaders. * History: Copied from WebKit/History. * Info.plist: Copied from WebKit/Info.plist. * MigrateHeaders.make: Copied from WebKit/MigrateHeaders.make. * Misc: Copied from WebKit/Misc. * Panels: Copied from WebKit/Panels. * Plugins: Copied from WebKit/Plugins. * PublicHeaderChangesFromTiger.txt: Copied from WebKit/PublicHeaderChangesFromTiger.txt. * Resources: Copied from WebKit/Resources. * WebCoreSupport: Copied from WebKit/WebCoreSupport. * WebInspector: Copied from WebKit/WebInspector. * WebKit.exp: Copied from WebKit/WebKit.exp. * WebKit.order: Copied from WebKit/WebKit.order. * WebKitPrefix.h: Copied from WebKit/WebKitPrefix.h. * WebView: Copied from WebKit/WebView. * icu: Copied from WebKit/icu. 2007-11-06 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=15847 Some editing cleanup No change in functionality. * WebView/WebHTMLView.mm: (-[WebHTMLView deleteToEndOfLine:]): (-[WebHTMLView deleteToEndOfParagraph:]): WebCore had a duplicate of the same logic already. We are passing a boundary value to a function that expects granularity, this may need to be straightened out in the future. 2007-11-05 John Sullivan <sullivan@apple.com> * WebView/WebView.mm: (-[WebView _searchWithSpotlightFromMenu:]): Teeny style tweak to test svn access on other machine 2007-11-05 John Sullivan <sullivan@apple.com> * WebView/WebView.mm: (-[WebView computedStyleForElement:pseudoElement:]): Teeny style tweak to test svn access 2007-11-02 Tristan O'Tierney <tristan@apple.com> Reviewed by Darin Adler. * DefaultDelegates/WebDefaultUIDelegate.m: (-[WebDefaultUIDelegate webView:createWebViewWithRequest:windowFeatures:]): Forward the UI delegate to call webView:createWebViewWithRequest: if this method doesn't exist. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchCreatePage): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView loadPluginRequest:]): * WebView/WebView.mm: (-[WebView _openNewWindowWithRequest:]): Revised to use new webView:createWebViewWithRequest:windowFeatures: callback. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::createWindow): Added a new createWindow that accepts 3 parameters, so we can pass up windowFeatures to the chrome. Removed createModalDialog to use new createWindow function. * WebView/WebUIDelegatePrivate.h: Added new webView:createWebViewWithRequest:windowFeatures: method. 2007-11-05 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=15835 Small adaptations to new KJS::List class. * ForwardingHeaders/kjs/value.h: Added. 2007-11-03 David D. Kilzer <ddkilzer@webkit.org> Sort files(...); sections of Xcode project files. Rubber-stamped by Darin Adler. * WebKit.xcodeproj/project.pbxproj: 2007-11-02 Antti Koivisto <antti@apple.com> Reviewed by Darin Adler. Add method to enable video composition. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2007-11-02 Darin Adler <darin@apple.com> Reviewed by Mitz. - fix problem I ran into while doing some testing on Mac for <rdar://problem/5530185> WebKit does not show <object> fallback content when both URL and MIME type is omitted I don't know how to reproduce this failure in DumpRenderTree, so there is no regression test. * Plugins/WebNullPluginView.h: Removed some unneeded declarations, including the didSendError local variable. Instead we just set the error to nil once we've sent it. * Plugins/WebNullPluginView.mm: (-[WebNullPluginView initWithFrame:error:DOMElement:]): Refactored so that the null plug-in image code is separate from the rest of the function and so that the whole thing is not inside an if statement. Also don't hold a reference to the DOM element if there is no error to report. (-[WebNullPluginView reportFailure]): Added. Does the actual delegate callback. Happens back at the top level of the run loop so it doesn't fire deep inside layout. Also wrote this so that it is guaranteed not to reenter and so that it can handle the case where the delegate destroys the world (including this object). NOTE: This is not a real, general solution to the problem of plug-ins that do work inside layout. We will need a more general fix that works for other plug-ins, and we'll track that with a separate bug report. (-[WebNullPluginView viewDidMoveToWindow]): Removed most of the code; changed so it just does a performSelector:afterDelay:0. 2007-11-02 Mark Rowe <mrowe@apple.com> Reviewed by Darin Adler. Fix http://bugs.webkit.org/show_bug.cgi?id=15780 Bug 15780: WebFrameLoaderClient: WebActionElementKey wrong if view is scrolled * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::actionDictionary): Retrieve the mouse event coordinates in the page coordinate system rather than the client area coordinate system. 2007-11-01 Dan Bernstein <mitz@apple.com> Reviewed by Oliver Hunt. - fix an assertion failure when Command-Tabbing out of Safari * WebView/WebHTMLView.mm: (-[WebHTMLView flagsChanged:]): Avoid passing key code 0 down to WebCore. 2007-11-01 Justin Garcia <justin.garcia@apple.com> Reviewed by Oliver Hunt. <rdar://problem/5195056> Huge plain text pastes are slow, time spent in ApplyStyleCommand::doApply No need to match style when pasting plain text, since the fragment we build for plain text won't have any style information on it. * WebView/WebHTMLView.mm: (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:]): There's no longer a need to know whether this function chosePlaintext. (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]): (-[WebHTMLView _documentFragmentFromPasteboard:]): 2007-10-31 Timothy Hatcher <timothy@apple.com> Reviewed by John Sullivan. Move the developer extras preference to WebPreferences. * WebView/WebPreferenceKeysPrivate.h: Add WebKitDeveloperExtrasEnabledPreferenceKey * WebView/WebPreferences.m: (+[WebPreferences initialize]): Initialize WebKitDeveloperExtrasEnabledPreferenceKey to NO. (-[WebPreferences developerExtrasEnabled]): Check DisableWebKitDeveloperExtras, WebKitDeveloperExtras and IncludeDebugMenu in addition to WebKitDeveloperExtrasEnabledPreferenceKey. (-[WebPreferences setDeveloperExtrasEnabled:]): Set WebKitDeveloperExtrasEnabledPreferenceKey. * WebView/WebPreferencesPrivate.h: Add developerExtrasEnabled and setDeveloperExtrasEnabled:. * WebView/WebView.mm: (+[WebView _developerExtrasEnabled]): Removed. (-[WebView _preferencesChangedNotification:]): Check the WebPreferences object for developerExtrasEnabled. * WebView/WebViewPrivate.h: Removed _developerExtrasEnabled. 2007-10-30 David D. Kilzer <ddkilzer@webkit.org> Generated files missing from WebCore's Xcode project file <http://bugs.webkit.org/show_bug.cgi?id=15406> Reviewed by Darin Adler. Added the following private header files to MigrateHeaders.make: - DOMCSSStyleSheetPrivate.h - DOMEventPrivate.h - DOMHTMLCollectionPrivate.h - DOMHTMLEmbedElementPrivate.h - DOMHTMLIFrameElementPrivate.h - DOMHTMLObjectElementPrivate.h - DOMHTMLSelectElementPrivate.h * MigrateHeaders.make: 2007-10-29 Antti Koivisto <antti@apple.com> Reviewed by Maciej. Some SPIs for media support. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2007-10-29 Timothy Hatcher <timothy@apple.com> Reviewed by John Sullivan. Various semi-related changes: - A WebView can now be asked for it's WebInspector. There is one WebInspector per WebView. - Refactor the WebInspector class and move obsolete methods to a special category. - Add new WebInspector methods to show, hide and show the console/timeline panels. - Add an isDisabled method to WebCache. - Allow WebLocalizableStrings.h to be used in C files. * Misc/WebCache.h: Add isDisabled. * Misc/WebCache.mm: (+[WebCache isDisabled]): New method. * Misc/WebLocalizableStrings.h: Changes to allow use in plain C files. * WebCoreSupport/WebInspectorClient.mm: (-[WebInspectorWindowController showWindow:]): Call super if already visible so the window will be ordered front. (-[WebInspectorWindowController showWebInspector:]): Method used by menu items, so they are enabled and work when the Inspector window is key. (-[WebInspectorWindowController showErrorConsole:]): Ditto. (-[WebInspectorWindowController showNetworkTimeline:]): Ditto. * WebInspector/WebInspector.h: Add and remove methods. * WebInspector/WebInspector.mm: (-[WebInspector webViewClosed]): Called when the WebView is closed/dealloced. Clears the _webView pointer. (-[WebInspector show:]): Calls thru to the Page's InspectorController. (-[WebInspector showConsole:]): Ditto. (-[WebInspector showTimeline:]): Ditto. (-[WebInspector close:]): Ditto. (-[WebInspector attach:]): Ditto. (-[WebInspector detach:]): Ditto. (+[WebInspector sharedWebInspector]): Moved to the obsolete category. (+[WebInspector webInspector]): Ditto. (-[WebInspector setWebFrame:]): Ditto. (-[WebInspector window]): Ditto. (-[WebInspector showWindow:]): Ditto. * WebView/WebView.mm: (-[WebViewPrivate dealloc]): Release the WebInspector. (-[WebView _close]): Call webViewClosed on the WebInspector. (-[WebView inspector]): Create a WebInspector if needed and return it. * WebView/WebViewPrivate.h: Add the inspector method. 2007-10-30 Adele Peterson <adele@apple.com> Reviewed by Darin Adler. WebKit part of fix for http://bugs.webkit.org/show_bug.cgi?id=10577 <rdar://problem/5103625> REGRESSION: Caps lock icon should show in password fields * WebView/WebHTMLView.mm: (-[WebHTMLView flagsChanged:]): Call capsLockStateMayHaveChanged so WebCore knows it may have to update a password field. (+[WebHTMLView _postFlagsChangedEvent:]): Added a comment with a Radar number for why this isn't just in flagsChanged. (-[WebHTMLView scrollWheel:]): Instead of calling the next responder explicitly, we can just call super, which will take care of this. 2007-10-27 Mark Ambachtsheer <mark.a@apple.com> Reviewed by Darin Adler. Fix for bug 15710, When QD plugins draw to an offscreen bitmap and the plugin is not at (0, 0) the clipping rectangle is not correct. Added the origin to the window clip rectangle coordinates to account for plugins that don't originate at (0,0); affects code for offscreen GWorlds only. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): 2007-10-26 Adele Peterson <adele@apple.com> Reviewed by Oliver. Adding WebKitSystemInterface support for the caps lock indicator * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2007-10-25 David Hyatt <hyatt@apple.com> Fix for bug 15672, backgrounds don't tile properly inside transforms. This patch fixes tiling of backgrounds inside CSS transforms and also of HTML content with background images inside SVG transforms. Reviewed by aroben and mmitz * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): * WebKit.xcodeproj/project.pbxproj: 2007-10-25 John Sullivan <sullivan@apple.com> Reviewed by Tim Hatcher Removed the support for toggling whether WebKit uses the 10.5 PDFKit improvements. Now it always does, when available. * WebView/WebPreferencesPrivate.h: removed _usePDFPreviewView and _setUsePDFPreviewView:. Note that these were guarded with a comment that says that they can be removed when no longer needed. That time is now. * WebView/WebPreferences.m: (+[WebPreferences initialize]): removed WebKitUsePDFPreviewViewPreferenceKey (-[WebPreferences _usePDFPreviewView]): removed (-[WebPreferences _setUsePDFPreviewView:]): removed * WebView/WebPDFView.mm: (-[WebPDFView initWithFrame:]): don't check _usePDFPreviewView * WebView/WebPreferenceKeysPrivate.h: removed WebKitUsePDFPreviewViewPreferenceKey 2007-10-24 Timothy Hatcher <timothy@apple.com> Reviewed by Mark Rowe. <rdar://problem/5069711> OpenSource version of libWebKitSystemInterface.a is Tiger only, causes issues if used on Leopard Use the WebKitSystemInterface that matches the system version. * Configurations/DebugRelease.xcconfig: * WebKit.xcodeproj/project.pbxproj: 2007-10-24 Brady Eidson <beidson@apple.com> Reviewed by Anders <rdar://problem/5554130> DatabaseTracker.o has a global initializer * Misc/WebDatabaseManager.mm: (WebKitSetWebDatabasesPathIfNecessary): Call the member function instead of a static one 2007-10-23 Mark Rowe <mrowe@apple.com> Build fix for Eric's build fix in r26916. * MigrateHeaders.make: 2007-10-22 Eric Seidel <eric@webkit.org> Reviewed by Maciej. * MigrateHeaders.make: copy over font-face related DOM headers 2007-10-22 Andrew Wellington <proton@wiretapped.net> Reviewed by Mark Rowe. Fix for local database support after r26879 Ensure that ENABLE_DATABASE and ENABLE_ICONDATABASE are correctly set * Configurations/WebKit.xcconfig: 2007-10-19 Brady Eidson <beidson@apple.com> Reviewed by Tim Hatcher Added support for Chrome prompts required by the Storage API Added support API for future managing of databases from the WebKit client Added preference and initialization for the databases path * Misc/WebDatabaseManager.h: Added. WebDatabaseManager is how a WebKit application can list and remove the current available databases * Misc/WebDatabaseManager.mm: Added. (+[WebDatabaseManager origins]): (+[WebDatabaseManager databasesWithOrigin:]): (+[WebDatabaseManager deleteAllDatabases]): (+[WebDatabaseManager deleteAllDatabasesWithOrigin:]): (+[WebDatabaseManager deleteDatabaseWithOrigin:named:]): (WebKitSetWebDatabasesPathIfNecessary): Setup the database path * Misc/WebDatabaseManagerPrivate.h: Added. * WebCoreSupport/WebChromeClient.h: Support for calling the delegate to run the prompt for an origin exceeding its size limit * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::runDatabaseSizeLimitPrompt): * WebKit.xcodeproj/project.pbxproj: * WebView/WebUIDelegate.h: * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Setup the database path * WebView/WebViewInternal.h: 2007-10-19 John Sullivan <sullivan@apple.com> Reviewed by Tim Hatcher - fixed <rdar://problem/5540325> REGRESSION (2.0.4-3): History menu looks odd after clearing history * History/WebHistory.mm: (-[WebHistoryPrivate removeAllItems]): This was fallout from r25275. We need to clear the orderedLastVisitedDays cache here, in addition to the other places where it's cleared. 2007-10-18 Dan Bernstein <mitz@apple.com> Tiger build fix. * WebView/WebDataSource.mm: (-[WebDataSource _MIMETypeOfResponse:]): 2007-10-18 Dan Bernstein <mitz@apple.com> Reviewed by Adam Roben. - fix <rdar://problem/5313523> REGRESSION(Leopard): http/tests/incremental/slow-utf8-text.pl fails on Leopard * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::makeDocumentView): Changed to use _responseMIMEType. * WebView/WebDataSource.mm: (-[WebDataSource _MIMETypeOfResponse:]): Added. Works around <rdar://problem/5321972> by testing for the case of an NSHTTPURLResponse with a MIMEType of application/octet-stream and a Content-Type header starting with text/plain and returning text/plain as the MIME type in that case. (-[WebDataSource _responseMIMEType]): Added. Used to get the correct response MIME type. (-[WebDataSource _isDocumentHTML]): Changed to use _responseMIMEType. (-[WebDataSource _makeRepresentation]): Ditto. (-[WebDataSource mainResource]): Ditto. (-[WebDataSource subresources]): Changed to use _MIMETypeOfResponse and pass the MIME type explicitly. (-[WebDataSource subresourceForURL:]): Ditto. * WebView/WebDataSourcePrivate.h: * WebView/WebFrameView.mm: (-[WebFrameView _makeDocumentViewForDataSource:]): Changed to use _responseMIMEType. * WebView/WebResource.mm: (-[WebResource _initWithData:URL:response:MIMEType:]): Changed this method to take a MIME type instead of extracting it from the response, so that WebDataSource could pass the correct MIME type. * WebView/WebResourcePrivate.h: 2007-10-17 Darin Adler <darin@apple.com> Reviewed by Mark Rowe. - fix <rdar://problem/5183775> Uninitialized memory in -[WebDynamicScrollBarsView updateScrollers] * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): Change code path so it doesn't dispatch a method that returns an NSSize passing a nil object. It's safe to do that for functions that return integers or pointers, but not structures. 2007-10-16 David Kilzer <ddkilzer@apple.com> Reviewed by Timothy. <rdar://problem/5544354> Wrong delegate method called in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad() * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): Fixed selector name. 2007-10-16 Darin Adler <darin@apple.com> Reviewed by Adele. - moved transpose command implementation into WebCore * WebView/WebHTMLView.mm: Removed transpose: and replaced it with standard WebCore forwarding. 2007-10-16 Darin Adler <darin@apple.com> Reviewed by Maciej and Geoff (and looked over by Eric). - http://bugs.webkit.org/show_bug.cgi?id=15519 eliminate use of <ctype.h> for processing ASCII * ForwardingHeaders/wtf/ASCIICType.h: Added. * ForwardingHeaders/wtf/DisallowCType.h: Added. * WebKitPrefix.h: Include DisallowCType.h. * Misc/WebNSURLExtras.mm: (-[NSURL _web_URLWithLowercasedScheme]): Use toASCIILower. * WebView/WebHTMLView.mm: (-[WebHTMLView callWebCoreCommand:]): Use toASCIIUpper. (-[WebTextCompleteController filterKeyDown:]): Add a list of specific character codes, instead of using ispunct. 2007-10-16 John Sullivan <sullivan@apple.com> Reviewed by Adam Roben Cleaned up localizable strings * English.lproj/Localizable.strings: updated * StringsNotToBeLocalized.txt: updated * WebKit.xcodeproj/project.pbxproj: StringsNotToBeLocalized.txt recently moved but project file wasn't updated to match; now it is 2007-10-15 Kevin Decker <kdecker@apple.com> Reviewed by Darin Adler. Fixed: <rdar://problem/5520541> REGRESSION: Broken image when forwarding certain email on Tiger * WebCoreSupport/WebFrameBridge.mm: The problem was that we were loading Mail's WebKit plug-in too soon, which borked some necessary housekeeping on behalf of Mail. The fix is to add a quirk that treats Tiger Mail's WebKit plug-in like a Netscape plug-in, thus ensuring the plug-in will load during first layout and not attach time. For this plug-in, loading at first layout is expected and is consistent with Safari 2 behavior. 2007-10-15 John Sullivan <sullivan@apple.com> Reviewed by Geoff Garen Replaced NS_DURING/NS_HANDLER with @try/@catch throughout WebKit I made the following changes: - replaced NS_DURING with @try, and added opening brace if there wasn't one - replaced NS_HANDLER with @catch (NSException *localException), and added braces if there weren't any - removed NS_ENDHANDLER, and added a closing brace if there wasn't one - in a couple of places, fixed indentation therein * Misc/WebIconDatabase.mm: (objectFromPathForKey): * WebView/WebHTMLView.mm: (-[WebHTMLView drawSingleRect:]): (-[WebHTMLView beginDocument]): (-[WebHTMLView deleteToMark:]): * WebView/WebView.mm: (-[WebView initWithCoder:]): == Rolled over to ChangeLog-2007-10-14 == �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/�����������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024250�014473� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/�������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024250�015273� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/unicode/�����������������������������������������������������������0000755�0001750�0001750�00000000000�11527024250�016721� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/unicode/icu/�������������������������������������������������������0000755�0001750�0001750�00000000000�11527024250�017501� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/unicode/icu/UnicodeIcu.h�������������������������������������������0000644�0001750�0001750�00000000047�10744307516�021713� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <JavaScriptCore/UnicodeIcu.h> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/unicode/Unicode.h��������������������������������������������������0000644�0001750�0001750�00000000044�10744307516�020467� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <JavaScriptCore/Unicode.h> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/Threading.h��������������������������������������������������������0000644�0001750�0001750�00000000045�10760074354�017360� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/Threading.h> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/RefCountedLeakCounter.h��������������������������������������������0000644�0001750�0001750�00000000063�11036043145�021635� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <JavaScriptCore/RefCountedLeakCounter.h> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/Deque.h������������������������������������������������������������0000644�0001750�0001750�00000000041�10766315237�016516� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/Deque.h> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/ListHashSet.h������������������������������������������������������0000644�0001750�0001750�00000000047�10560130401�017630� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/ListHashSet.h> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/ASCIICType.h�������������������������������������������������������0000644�0001750�0001750�00000000047�10705215544�017247� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <JavaScriptCore/ASCIICType.h> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/RefCounted.h�������������������������������������������������������0000644�0001750�0001750�00000000046�10744307516�017513� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/RefCounted.h> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/HashSet.h����������������������������������������������������������0000644�0001750�0001750�00000000043�10360512352�016777� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/HashSet.h> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/Vector.h�����������������������������������������������������������0000644�0001750�0001750�00000000042�10401534421�016676� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/Vector.h> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/HashCountedSet.h���������������������������������������������������0000644�0001750�0001750�00000000052�10360512352�020321� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/HashCountedSet.h> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/HashTraits.h�������������������������������������������������������0000644�0001750�0001750�00000000046�10415032175�017516� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/HashTraits.h> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/GetPtr.h�����������������������������������������������������������0000644�0001750�0001750�00000000042�10744307516�016656� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/GetPtr.h> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/StdLibExtras.h�����������������������������������������������������0000644�0001750�0001750�00000000050�11107577345�020023� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/StdLibExtras.h> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/PassOwnPtr.h�������������������������������������������������������0000644�0001750�0001750�00000000046�11206023270�017517� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/PassOwnPtr.h> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/UnusedParam.h������������������������������������������������������0000644�0001750�0001750�00000000047�11015145155�017671� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/UnusedParam.h> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/DisallowCType.h����������������������������������������������������0000644�0001750�0001750�00000000052�10705215544�020171� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <JavaScriptCore/DisallowCType.h> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/OwnPtrCommon.h�����������������������������������������������������0000644�0001750�0001750�00000000046�11206023270�020041� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/PassOwnPtr.h> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/FastMalloc.h�������������������������������������������������������0000644�0001750�0001750�00000000046�10360512352�017470� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/FastMalloc.h> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/OwnArrayPtr.h������������������������������������������������������0000644�0001750�0001750�00000000047�10370271627�017704� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/OwnArrayPtr.h> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/VectorTraits.h�����������������������������������������������������0000644�0001750�0001750�00000000051�10744307516�020102� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <JavaScriptCore/VectorTraits.h> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/OwnPtr.h�����������������������������������������������������������0000644�0001750�0001750�00000000042�10370271627�016700� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/OwnPtr.h> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/PassRefPtr.h�������������������������������������������������������0000644�0001750�0001750�00000000046�10360512352�017474� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/PassRefPtr.h> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/Assertions.h�������������������������������������������������������0000644�0001750�0001750�00000000046�10360512352�017575� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/Assertions.h> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/ListRefPtr.h�������������������������������������������������������0000644�0001750�0001750�00000000046�10744307516�017513� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/ListRefPtr.h> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/AlwaysInline.h�����������������������������������������������������0000644�0001750�0001750�00000000050�10360512352�020035� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/AlwaysInline.h> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/VMTags.h�����������������������������������������������������������0000644�0001750�0001750�00000000042�11173272136�016606� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/VMTags.h> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/RetainPtr.h��������������������������������������������������������0000644�0001750�0001750�00000000045�10744307516�017364� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/RetainPtr.h> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/RefPtr.h�����������������������������������������������������������0000644�0001750�0001750�00000000042�10360512352�016641� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/RefPtr.h> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/Forward.h����������������������������������������������������������0000644�0001750�0001750�00000000044�10416754635�017063� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <JavaScriptCore/Forward.h> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/Noncopyable.h������������������������������������������������������0000644�0001750�0001750�00000000047�10370271627�017725� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/Noncopyable.h> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/Locker.h�����������������������������������������������������������0000644�0001750�0001750�00000000042�10760074354�016667� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/Locker.h> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/MathExtras.h�������������������������������������������������������0000644�0001750�0001750�00000000046�10744307516�017535� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/MathExtras.h> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/HashMap.h����������������������������������������������������������0000644�0001750�0001750�00000000043�10360512352�016761� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/HashMap.h> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/wtf/Platform.h���������������������������������������������������������0000644�0001750�0001750�00000000044�10404365001�017221� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/Platform.h> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/runtime/���������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024250�016156� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/runtime/SymbolTable.h��������������������������������������������������0000644�0001750�0001750�00000000050�11225466207�020546� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <JavaScriptCore/SymbolTable.h> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/runtime/Completion.h���������������������������������������������������0000644�0001750�0001750�00000000046�11225466207�020447� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/Completion.h> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/runtime/JSValue.h������������������������������������������������������0000644�0001750�0001750�00000000043�11101741070�017627� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/JSValue.h> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/runtime/Protect.h������������������������������������������������������0000644�0001750�0001750�00000000043�11137447003�017746� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/Protect.h> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/runtime/JSFunction.h���������������������������������������������������0000644�0001750�0001750�00000000047�11101741070�020344� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <JavaScriptCore/JSFunction.h> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/runtime/JSObject.h�����������������������������������������������������0000644�0001750�0001750�00000000044�11101741070�017762� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/JSObject.h> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/runtime/JSString.h�����������������������������������������������������0000644�0001750�0001750�00000000044�11101741070�020022� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/JSString.h> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/runtime/JSLock.h�������������������������������������������������������0000644�0001750�0001750�00000000042�11225466207�017457� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/JSLock.h> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/debugger/��������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024250�016257� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/debugger/DebuggerCallFrame.h�������������������������������������������0000644�0001750�0001750�00000000055�11225466207�021732� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#import <JavaScriptCore/DebuggerCallFrame.h> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/pcre/������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024250�015424� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ForwardingHeaders/pcre/pcre.h������������������������������������������������������������0000644�0001750�0001750�00000000041�10401534421�016515� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include <JavaScriptCore/pcre.h> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebKitPrefix.h���������������������������������������������������������������������������0000644�0001750�0001750�00000005361�11256515431�013623� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #ifdef __cplusplus #define NULL __null #else #define NULL ((void *)0) #endif #import <stddef.h> #import <stdio.h> #import <fcntl.h> #import <errno.h> #import <unistd.h> #import <signal.h> #import <sys/types.h> #import <sys/time.h> #import <sys/resource.h> #import <pthread.h> #import <CoreGraphics/CoreGraphics.h> #ifdef __cplusplus #include <algorithm> // needed for exception_defines.h #include <cstddef> #include <new> #endif #import <ApplicationServices/ApplicationServices.h> #import <Carbon/Carbon.h> #ifndef CGFLOAT_DEFINED #ifdef __LP64__ typedef double CGFloat; #else typedef float CGFloat; #endif #define CGFLOAT_DEFINED 1 #endif #ifdef __OBJC__ #import <Cocoa/Cocoa.h> #endif #include <wtf/Platform.h> #include "EmptyProtocolDefinitions.h" /* WebKit has no way to pull settings from WebCore/config.h for now */ /* so we assume WebKit is always being compiled on top of JavaScriptCore */ #define WTF_USE_JSC 1 #define WTF_USE_V8 0 #ifdef __cplusplus #include <wtf/FastMalloc.h> #endif #include <wtf/DisallowCType.h> /* Work around bug with C++ library that screws up Objective-C++ when exception support is disabled. */ #undef try #undef catch #define JS_EXPORTDATA #define WEBKIT_EXPORTDATA �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/History/���������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024251�012537� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/History/WebBackForwardListPrivate.h������������������������������������������������������0000644�0001750�0001750�00000003556�10360512352�017731� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> #import <WebKit/WebBackForwardList.h> @interface WebBackForwardList (WebBackForwardListPrivate) /*! @method removeItem: @abstract Removes an entry from the list. @param entry The entry to remove. Cannot be the current item. */ - (void)removeItem:(WebHistoryItem *)item; @end ��������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/History/WebHistoryItemPrivate.h����������������������������������������������������������0000644�0001750�0001750�00000005465�11142767411�017200� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebHistoryItem.h> @interface WebHistoryItem (WebPrivate) + (void)_releaseAllPendingPageCaches; - (id)initWithURL:(NSURL *)URL title:(NSString *)title; - (NSURL *)URL; - (int)visitCount; - (BOOL)lastVisitWasFailure; - (void)_setLastVisitWasFailure:(BOOL)failure; - (BOOL)_lastVisitWasHTTPNonGet; - (NSString *)RSSFeedReferrer; - (void)setRSSFeedReferrer:(NSString *)referrer; - (NSCalendarDate *)_lastVisitedDate; - (NSArray *)_redirectURLs; - (WebHistoryItem *)targetItem; - (NSString *)target; - (BOOL)isTargetItem; - (NSArray *)children; - (NSDictionary *)dictionaryRepresentation; // This should not be called directly for WebHistoryItems that are already included // in WebHistory. Use -[WebHistory setLastVisitedTimeInterval:forItem:] instead. - (void)_setLastVisitedTimeInterval:(NSTimeInterval)time; // Transient properties may be of any ObjC type. They are intended to be used to store state per back/forward list entry. // The properties will not be persisted; when the history item is removed, the properties will be lost. - (id)_transientPropertyForKey:(NSString *)key; - (void)_setTransientProperty:(id)property forKey:(NSString *)key; - (size_t)_getDailyVisitCounts:(const int**)counts; - (size_t)_getWeeklyVisitCounts:(const int**)counts; @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/History/WebURLsWithTitles.m��������������������������������������������������������������0000644�0001750�0001750�00000007573�10562477145�016251� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebURLsWithTitles.h" #import <WebKit/WebNSURLExtras.h> #import <WebKit/WebKitNSStringExtras.h> @implementation WebURLsWithTitles + (NSArray *)arrayWithIFURLsWithTitlesPboardType { // Make a canned array so we don't construct it on the fly over and over. static NSArray *cannedArray = nil; if (cannedArray == nil) { cannedArray = [[NSArray arrayWithObject:WebURLsWithTitlesPboardType] retain]; } return cannedArray; } +(void)writeURLs:(NSArray *)URLs andTitles:(NSArray *)titles toPasteboard:(NSPasteboard *)pasteboard { NSMutableArray *URLStrings; NSMutableArray *titlesOrEmptyStrings; unsigned index, count; count = [URLs count]; if (count == 0) { return; } if ([pasteboard availableTypeFromArray:[self arrayWithIFURLsWithTitlesPboardType]] == nil) { return; } if (count != [titles count]) { titles = nil; } URLStrings = [NSMutableArray arrayWithCapacity:count]; titlesOrEmptyStrings = [NSMutableArray arrayWithCapacity:count]; for (index = 0; index < count; ++index) { [URLStrings addObject:[[URLs objectAtIndex:index] _web_originalDataAsString]]; [titlesOrEmptyStrings addObject:(titles == nil) ? @"" : [[titles objectAtIndex:index] _webkit_stringByTrimmingWhitespace]]; } [pasteboard setPropertyList:[NSArray arrayWithObjects:URLStrings, titlesOrEmptyStrings, nil] forType:WebURLsWithTitlesPboardType]; } +(NSArray *)titlesFromPasteboard:(NSPasteboard *)pasteboard { if ([pasteboard availableTypeFromArray:[self arrayWithIFURLsWithTitlesPboardType]] == nil) { return nil; } return [[pasteboard propertyListForType:WebURLsWithTitlesPboardType] objectAtIndex:1]; } +(NSArray *)URLsFromPasteboard:(NSPasteboard *)pasteboard { NSArray *URLStrings; NSMutableArray *URLs; unsigned index, count; if ([pasteboard availableTypeFromArray:[self arrayWithIFURLsWithTitlesPboardType]] == nil) { return nil; } URLStrings = [[pasteboard propertyListForType:WebURLsWithTitlesPboardType] objectAtIndex:0]; count = [URLStrings count]; URLs = [NSMutableArray arrayWithCapacity:count]; for (index = 0; index < count; ++index) { [URLs addObject:[NSURL _web_URLWithDataAsString:[URLStrings objectAtIndex:index]]]; } return URLs; } @end �������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/History/WebHistoryItemInternal.h���������������������������������������������������������0000644�0001750�0001750�00000005153�11225463311�017326� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebBackForwardList.h" #import "WebHistoryItemPrivate.h" #import <wtf/Forward.h> namespace WebCore { class HistoryItem; } WebCore::HistoryItem* core(WebHistoryItem *item); WebHistoryItem *kit(WebCore::HistoryItem* item); extern void WKNotifyHistoryItemChanged(); @interface WebHistoryItem (WebInternal) + (WebHistoryItem *)entryWithURL:(NSURL *)URL; + (void)initWindowWatcherIfNecessary; - (id)initWithURL:(NSURL *)URL target:(NSString *)target parent:(NSString *)parent title:(NSString *)title; - (id)initWithURLString:(NSString *)URLString title:(NSString *)title displayTitle:(NSString *)displayTitle lastVisitedTimeInterval:(NSTimeInterval)time; - (id)initFromDictionaryRepresentation:(NSDictionary *)dict; - (id)initWithWebCoreHistoryItem:(PassRefPtr<WebCore::HistoryItem>)item; - (void)_mergeAutoCompleteHints:(WebHistoryItem *)otherItem; - (void)setTitle:(NSString *)title; - (void)_visitedWithTitle:(NSString *)title increaseVisitCount:(BOOL)increaseVisitCount; - (void)_recordInitialVisit; @end @interface WebBackForwardList (WebInternal) - (void)_close; @end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/History/WebHistoryPrivate.h��������������������������������������������������������������0000644�0001750�0001750�00000004706�11167474505�016364� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2008, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebHistory.h> /* @constant WebHistoryItemsDiscardedWhileLoadingNotification Posted from loadFromURL:error:. This notification comes with a userInfo dictionary that contains the array of items discarded due to the date limit or item limit. The key for the array is WebHistoryItemsKey. */ // FIXME: This notification should become public API. extern NSString *WebHistoryItemsDiscardedWhileLoadingNotification; @interface WebHistory (WebPrivate) // FIXME: The following SPI is used by Safari. Should it be made into public API? - (WebHistoryItem *)_itemForURLString:(NSString *)URLString; /*! @method allItems @result Returns an array of all WebHistoryItems in WebHistory, in an undefined order. */ - (NSArray *)allItems; /*! @method _data @result A data object with the entire history in the same format used by the saveToURL:error: method. */ - (NSData *)_data; @end ����������������������������������������������������������WebKit/mac/History/WebBackForwardListInternal.h�����������������������������������������������������0000644�0001750�0001750�00000003636�10744307516�020104� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebBackForwardList.h> #import <wtf/PassRefPtr.h> namespace WebCore { class BackForwardList; } WebCore::BackForwardList* core(WebBackForwardList *); WebBackForwardList *kit(WebCore::BackForwardList*); @interface WebBackForwardList (WebBackForwardListInternal) - (id)initWithBackForwardList:(PassRefPtr<WebCore::BackForwardList>)backForwardList; @end ��������������������������������������������������������������������������������������������������WebKit/mac/History/WebHistoryInternal.h�������������������������������������������������������������0000644�0001750�0001750�00000003567�11225463311�016516� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebHistoryPrivate.h" namespace WebCore { class PageGroup; } @interface WebHistory (WebInternal) - (void)_visitedURL:(NSURL *)URL withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure increaseVisitCount:(BOOL)increaseVisitCount; - (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group; @end �����������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/History/WebHistoryItem.h�����������������������������������������������������������������0000644�0001750�0001750�00000011715�10360512352�015631� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> @class WebHistoryItemPrivate; @class NSURL; /* @discussion Notification sent when history item is modified. @constant WebHistoryItemChanged Posted from whenever the value of either the item's title, alternate title, url strings, or last visited interval changes. The userInfo will be nil. */ extern NSString *WebHistoryItemChangedNotification; /*! @class WebHistoryItem @discussion WebHistoryItems are created by WebKit to represent pages visited. The WebBackForwardList and WebHistory classes both use WebHistoryItems to represent pages visited. With the exception of the displayTitle, the properties of WebHistoryItems are set by WebKit. WebHistoryItems are normally never created directly. */ @interface WebHistoryItem : NSObject <NSCopying> { @private WebHistoryItemPrivate *_private; } /*! @method initWithURLString:title:lastVisitedTimeInterval: @param URLString The URL string for the item. @param title The title to use for the item. This is normally the <title> of a page. @param time The time used to indicate when the item was used. @abstract Initialize a new WebHistoryItem @discussion WebHistoryItems are normally created for you by the WebKit. You may use this method to prepopulate a WebBackForwardList, or create 'artificial' items to add to a WebBackForwardList. When first initialized the URLString and originalURLString will be the same. */ - (id)initWithURLString:(NSString *)URLString title:(NSString *)title lastVisitedTimeInterval:(NSTimeInterval)time; /*! @method originalURLString @abstract The string representation of the originial URL of this item. This value is normally set by the WebKit. @result The string corresponding to the initial URL of this item. */ - (NSString *)originalURLString; /*! @method URLString @abstract The string representation of the URL represented by this item. @discussion The URLString may be different than the originalURLString if the page redirected to a new location. This value is normally set by the WebKit. @result The string corresponding to the final URL of this item. */ - (NSString *)URLString; /*! @method title @abstract The title of the page represented by this item. @discussion This title cannot be changed by the client. This value is normally set by the WebKit when a page title for the item is received. @result The title of this item. */ - (NSString *)title; /*! @method lastVisitedTimeInterval @abstract The last time the page represented by this item was visited. The interval is since the reference date as determined by NSDate. This value is normally set by the WebKit. @result The last time this item was visited. */ - (NSTimeInterval)lastVisitedTimeInterval; /*! @method setAlternateTitle: @param alternateTitle The new display title for this item. @abstract A title that may be used by the client to display this item. */ - (void)setAlternateTitle:(NSString *)alternateTitle; /* @method title @abstract A title that may be used by the client to display this item. @result The alternate title for this item. */ - (NSString *)alternateTitle; /*! @method icon @abstract The favorite icon of the page represented by this item. @discussion This icon returned will be determined by the WebKit. @result The icon associated with this item's URL. */ - (NSImage *)icon; @end ���������������������������������������������������WebKit/mac/History/WebBackForwardList.h�������������������������������������������������������������0000644�0001750�0001750�00000014700�11135171776�016403� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 #define WebNSUInteger unsigned int #else #define WebNSUInteger NSUInteger #endif @class WebHistoryItem; @class WebBackForwardListPrivate; /*! @class WebBackForwardList WebBackForwardList holds an ordered list of WebHistoryItems that comprises the back and forward lists. Note that the methods which modify instances of this class do not cause navigation to happen in other layers of the stack; they are only for maintaining this data structure. */ @interface WebBackForwardList : NSObject { @private WebBackForwardListPrivate *_private; } /*! @method addItem: @abstract Adds an entry to the list. @param entry The entry to add. @discussion The added entry is inserted immediately after the current entry. If the current position in the list is not at the end of the list, elements in the forward list will be dropped at this point. In addition, entries may be dropped to keep the size of the list within the maximum size. */ - (void)addItem:(WebHistoryItem *)item; /*! @method goBack @abstract Move the current pointer back to the entry before the current entry. */ - (void)goBack; /*! @method goForward @abstract Move the current pointer ahead to the entry after the current entry. */ - (void)goForward; /*! @method goToItem: @abstract Move the current pointer to the given entry. @param item The history item to move the pointer to */ - (void)goToItem:(WebHistoryItem *)item; /*! @method backItem @abstract Returns the entry right before the current entry. @result The entry right before the current entry, or nil if there isn't one. */ - (WebHistoryItem *)backItem; /*! @method currentItem @abstract Returns the current entry. @result The current entry. */ - (WebHistoryItem *)currentItem; /*! @method forwardItem @abstract Returns the entry right after the current entry. @result The entry right after the current entry, or nil if there isn't one. */ - (WebHistoryItem *)forwardItem; /*! @method backListWithLimit: @abstract Returns a portion of the list before the current entry. @param limit A cap on the size of the array returned. @result An array of items before the current entry, or nil if there are none. The entries are in the order that they were originally visited. */ - (NSArray *)backListWithLimit:(int)limit; /*! @method forwardListWithLimit: @abstract Returns a portion of the list after the current entry. @param limit A cap on the size of the array returned. @result An array of items after the current entry, or nil if there are none. The entries are in the order that they were originally visited. */ - (NSArray *)forwardListWithLimit:(int)limit; /*! @method capacity @abstract Returns the list's maximum size. @result The list's maximum size. */ - (int)capacity; /*! @method setCapacity @abstract Sets the list's maximum size. @param size The new maximum size for the list. */ - (void)setCapacity:(int)size; /*! @method backListCount @abstract Returns the back list's current count. @result The number of items in the list. */ - (int)backListCount; /*! @method forwardListCount @abstract Returns the forward list's current count. @result The number of items in the list. */ - (int)forwardListCount; /*! @method containsItem: @param item The item that will be checked for presence in the WebBackForwardList. @result Returns YES if the item is in the list. */ - (BOOL)containsItem:(WebHistoryItem *)item; /*! @method itemAtIndex: @abstract Returns an entry the given distance from the current entry. @param index Index of the desired list item relative to the current item; 0 is current item, -1 is back item, 1 is forward item, etc. @result The entry the given distance from the current entry. If index exceeds the limits of the list, nil is returned. */ - (WebHistoryItem *)itemAtIndex:(int)index; @end @interface WebBackForwardList(WebBackForwardListDeprecated) // The following methods are deprecated, and exist for backward compatibility only. // Use -[WebPreferences setUsesPageCache] and -[WebPreferences usesPageCache] // instead. /*! @method setPageCacheSize: @abstract The size passed to this method determines whether the WebView associated with this WebBackForwardList will use the shared page cache. @param size If size is 0, the WebView associated with this WebBackForwardList will not use the shared page cache. Otherwise, it will. */ - (void)setPageCacheSize:(WebNSUInteger)size; /*! @method pageCacheSize @abstract Returns the size of the shared page cache, or 0. @result The size of the shared page cache (in pages), or 0 if the WebView associated with this WebBackForwardList will not use the shared page cache. */ - (WebNSUInteger)pageCacheSize; @end #undef WebNSUInteger ����������������������������������������������������������������WebKit/mac/History/WebHistory.h���������������������������������������������������������������������0000644�0001750�0001750�00000013751�10502101633�015006� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003, 2004 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> @class NSError; @class WebHistoryItem; @class WebHistoryPrivate; /* @discussion Notifications sent when history is modified. @constant WebHistoryItemsAddedNotification Posted from addItems:. This notification comes with a userInfo dictionary that contains the array of items added. The key for the array is WebHistoryItemsKey. @constant WebHistoryItemsRemovedNotification Posted from removeItems:. This notification comes with a userInfo dictionary that contains the array of items removed. The key for the array is WebHistoryItemsKey. @constant WebHistoryAllItemsRemovedNotification Posted from removeAllItems @constant WebHistoryLoadedNotification Posted from loadFromURL:error:. */ extern NSString *WebHistoryItemsAddedNotification; extern NSString *WebHistoryItemsRemovedNotification; extern NSString *WebHistoryAllItemsRemovedNotification; extern NSString *WebHistoryLoadedNotification; extern NSString *WebHistorySavedNotification; extern NSString *WebHistoryItemsKey; /*! @class WebHistory @discussion WebHistory is used to track pages that have been loaded by WebKit. */ @interface WebHistory : NSObject { @private WebHistoryPrivate *_historyPrivate; } /*! @method optionalSharedHistory @abstract Returns a shared WebHistory instance initialized with the default history file. @result A WebHistory object. */ + (WebHistory *)optionalSharedHistory; /*! @method setOptionalSharedHistory: @param history The history to use for the global WebHistory. */ + (void)setOptionalSharedHistory:(WebHistory *)history; /*! @method loadFromURL:error: @param URL The URL to use to initialize the WebHistory. @param error Set to nil or an NSError instance if an error occurred. @abstract The designated initializer for WebHistory. @result Returns YES if successful, NO otherwise. */ - (BOOL)loadFromURL:(NSURL *)URL error:(NSError **)error; /*! @method saveToURL:error: @discussion Save history to URL. It is the client's responsibility to call this at appropriate times. @param URL The URL to use to save the WebHistory. @param error Set to nil or an NSError instance if an error occurred. @result Returns YES if successful, NO otherwise. */ - (BOOL)saveToURL:(NSURL *)URL error:(NSError **)error; /*! @method addItems: @param newItems An array of WebHistoryItems to add to the WebHistory. */ - (void)addItems:(NSArray *)newItems; /*! @method removeItems: @param items An array of WebHistoryItems to remove from the WebHistory. */ - (void)removeItems:(NSArray *)items; /*! @method removeAllItems */ - (void)removeAllItems; /*! @method orderedLastVisitedDays @discussion Get an array of NSCalendarDates, each one representing a unique day that contains one or more history items, ordered from most recent to oldest. @result Returns an array of NSCalendarDates for which history items exist in the WebHistory. */ - (NSArray *)orderedLastVisitedDays; /*! @method orderedItemsLastVisitedOnDay: @discussion Get an array of WebHistoryItem that were last visited on the day represented by the specified NSCalendarDate, ordered from most recent to oldest. @param calendarDate A date identifying the unique day of interest. @result Returns an array of WebHistoryItems last visited on the indicated day. */ - (NSArray *)orderedItemsLastVisitedOnDay:(NSCalendarDate *)calendarDate; /*! @method itemForURL: @abstract Get an item for a specific URL @param URL The URL of the history item to search for @result Returns an item matching the URL */ - (WebHistoryItem *)itemForURL:(NSURL *)URL; /*! @method setHistoryItemLimit: @discussion Limits the number of items that will be stored by the WebHistory. @param limit The maximum number of items that will be stored by the WebHistory. */ - (void)setHistoryItemLimit:(int)limit; /*! @method historyItemLimit @result The maximum number of items that will be stored by the WebHistory. */ - (int)historyItemLimit; /*! @method setHistoryAgeInDaysLimit: @discussion setHistoryAgeInDaysLimit: sets the maximum number of days to be read from stored history. @param limit The maximum number of days to be read from stored history. */ - (void)setHistoryAgeInDaysLimit:(int)limit; /*! @method historyAgeInDaysLimit @return Returns the maximum number of days to be read from stored history. */ - (int)historyAgeInDaysLimit; @end �����������������������WebKit/mac/History/WebHistoryItem.mm����������������������������������������������������������������0000644�0001750�0001750�00000052617�11225463311�016022� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebHistoryItemInternal.h" #import "WebHistoryItemPrivate.h" #import "WebFrameInternal.h" #import "WebFrameView.h" #import "WebHTMLViewInternal.h" #import "WebIconDatabase.h" #import "WebKitLogging.h" #import "WebKitNSStringExtras.h" #import "WebNSArrayExtras.h" #import "WebNSDictionaryExtras.h" #import "WebNSObjectExtras.h" #import "WebNSURLExtras.h" #import "WebNSURLRequestExtras.h" #import "WebNSViewExtras.h" #import "WebPluginController.h" #import "WebTypesInternal.h" #import <WebCore/HistoryItem.h> #import <WebCore/Image.h> #import <WebCore/KURL.h> #import <WebCore/PageCache.h> #import <WebCore/PlatformString.h> #import <WebCore/ThreadCheck.h> #import <WebCore/WebCoreObjCExtras.h> #import <runtime/InitializeThreading.h> #import <wtf/Assertions.h> #import <wtf/StdLibExtras.h> // Private keys used in the WebHistoryItem's dictionary representation. // see 3245793 for explanation of "lastVisitedDate" static NSString *lastVisitedTimeIntervalKey = @"lastVisitedDate"; static NSString *visitCountKey = @"visitCount"; static NSString *titleKey = @"title"; static NSString *childrenKey = @"children"; static NSString *displayTitleKey = @"displayTitle"; static NSString *lastVisitWasFailureKey = @"lastVisitWasFailure"; static NSString *lastVisitWasHTTPNonGetKey = @"lastVisitWasHTTPNonGet"; static NSString *redirectURLsKey = @"redirectURLs"; static NSString *dailyVisitCountKey = @"D"; // short key to save space static NSString *weeklyVisitCountKey = @"W"; // short key to save space // Notification strings. NSString *WebHistoryItemChangedNotification = @"WebHistoryItemChangedNotification"; using namespace WebCore; using namespace std; typedef HashMap<HistoryItem*, WebHistoryItem*> HistoryItemMap; static inline WebHistoryItemPrivate* kitPrivate(WebCoreHistoryItem* list) { return (WebHistoryItemPrivate*)list; } static inline WebCoreHistoryItem* core(WebHistoryItemPrivate* list) { return (WebCoreHistoryItem*)list; } static HistoryItemMap& historyItemWrappers() { DEFINE_STATIC_LOCAL(HistoryItemMap, historyItemWrappers, ()); return historyItemWrappers; } void WKNotifyHistoryItemChanged() { [[NSNotificationCenter defaultCenter] postNotificationName:WebHistoryItemChangedNotification object:nil userInfo:nil]; } @implementation WebHistoryItem + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif } - (id)init { return [self initWithWebCoreHistoryItem:HistoryItem::create()]; } - (id)initWithURLString:(NSString *)URLString title:(NSString *)title lastVisitedTimeInterval:(NSTimeInterval)time { WebCoreThreadViolationCheckRoundOne(); return [self initWithWebCoreHistoryItem:HistoryItem::create(URLString, title, time)]; } - (void)dealloc { if (WebCoreObjCScheduleDeallocateOnMainThread([WebHistoryItem class], self)) return; if (_private) { HistoryItem* coreItem = core(_private); coreItem->deref(); historyItemWrappers().remove(coreItem); } [super dealloc]; } - (void)finalize { WebCoreThreadViolationCheckRoundOne(); // FIXME: ~HistoryItem is what releases the history item's icon from the icon database // It's probably not good to release icons from the database only when the object is garbage-collected. // Need to change design so this happens at a predictable time. if (_private) { HistoryItem* coreItem = core(_private); coreItem->deref(); historyItemWrappers().remove(coreItem); } [super finalize]; } - (id)copyWithZone:(NSZone *)zone { WebCoreThreadViolationCheckRoundOne(); WebHistoryItem *copy = (WebHistoryItem *)NSCopyObject(self, 0, zone); RefPtr<HistoryItem> item = core(_private)->copy(); copy->_private = kitPrivate(item.get()); historyItemWrappers().set(item.release().releaseRef(), copy); return copy; } // FIXME: Need to decide if this class ever returns URLs and decide on the name of this method - (NSString *)URLString { ASSERT_MAIN_THREAD(); return nsStringNilIfEmpty(core(_private)->urlString()); } // The first URL we loaded to get to where this history item points. Includes both client // and server redirects. - (NSString *)originalURLString { ASSERT_MAIN_THREAD(); return nsStringNilIfEmpty(core(_private)->originalURLString()); } - (NSString *)title { ASSERT_MAIN_THREAD(); return nsStringNilIfEmpty(core(_private)->title()); } - (void)setAlternateTitle:(NSString *)alternateTitle { core(_private)->setAlternateTitle(alternateTitle); } - (NSString *)alternateTitle { return nsStringNilIfEmpty(core(_private)->alternateTitle()); } - (NSImage *)icon { return [[WebIconDatabase sharedIconDatabase] iconForURL:[self URLString] withSize:WebIconSmallSize]; // FIXME: Ideally, this code should simply be the following - // return core(_private)->icon()->getNSImage(); // Once radar - // <rdar://problem/4906567> - NSImage returned from WebCore::Image may be incorrect size // is resolved } - (NSTimeInterval)lastVisitedTimeInterval { ASSERT_MAIN_THREAD(); return core(_private)->lastVisitedTime(); } - (NSUInteger)hash { return [(NSString*)core(_private)->urlString() hash]; } - (BOOL)isEqual:(id)anObject { ASSERT_MAIN_THREAD(); if (![anObject isMemberOfClass:[WebHistoryItem class]]) { return NO; } return core(_private)->urlString() == core(((WebHistoryItem*)anObject)->_private)->urlString(); } - (NSString *)description { ASSERT_MAIN_THREAD(); HistoryItem* coreItem = core(_private); NSMutableString *result = [NSMutableString stringWithFormat:@"%@ %@", [super description], (NSString*)coreItem->urlString()]; if (coreItem->target()) { NSString *target = coreItem->target(); [result appendFormat:@" in \"%@\"", target]; } if (coreItem->isTargetItem()) { [result appendString:@" *target*"]; } if (coreItem->formData()) { [result appendString:@" *POST*"]; } if (coreItem->children().size()) { const HistoryItemVector& children = coreItem->children(); int currPos = [result length]; unsigned size = children.size(); for (unsigned i = 0; i < size; ++i) { WebHistoryItem *child = kit(children[i].get()); [result appendString:@"\n"]; [result appendString:[child description]]; } // shift all the contents over. A bit slow, but hey, this is for debugging. NSRange replRange = {currPos, [result length]-currPos}; [result replaceOccurrencesOfString:@"\n" withString:@"\n " options:0 range:replRange]; } return result; } @end @interface WebWindowWatcher : NSObject @end @implementation WebHistoryItem (WebInternal) HistoryItem* core(WebHistoryItem *item) { if (!item) return 0; ASSERT(historyItemWrappers().get(core(item->_private)) == item); return core(item->_private); } WebHistoryItem *kit(HistoryItem* item) { if (!item) return nil; WebHistoryItem *kitItem = historyItemWrappers().get(item); if (kitItem) return kitItem; return [[[WebHistoryItem alloc] initWithWebCoreHistoryItem:item] autorelease]; } + (WebHistoryItem *)entryWithURL:(NSURL *)URL { return [[[self alloc] initWithURL:URL title:nil] autorelease]; } static WebWindowWatcher *_windowWatcher = nil; + (void)initWindowWatcherIfNecessary { if (_windowWatcher) return; _windowWatcher = [[WebWindowWatcher alloc] init]; [[NSNotificationCenter defaultCenter] addObserver:_windowWatcher selector:@selector(windowWillClose:) name:NSWindowWillCloseNotification object:nil]; } - (id)initWithURL:(NSURL *)URL target:(NSString *)target parent:(NSString *)parent title:(NSString *)title { return [self initWithWebCoreHistoryItem:HistoryItem::create(URL, target, parent, title)]; } - (id)initWithURLString:(NSString *)URLString title:(NSString *)title displayTitle:(NSString *)displayTitle lastVisitedTimeInterval:(NSTimeInterval)time { return [self initWithWebCoreHistoryItem:HistoryItem::create(URLString, title, displayTitle, time)]; } - (id)initWithWebCoreHistoryItem:(PassRefPtr<HistoryItem>)item { WebCoreThreadViolationCheckRoundOne(); // Need to tell WebCore what function to call for the // "History Item has Changed" notification - no harm in doing this // everytime a WebHistoryItem is created // Note: We also do this in [WebFrameView initWithFrame:] where we do // other "init before WebKit is used" type things WebCore::notifyHistoryItemChanged = WKNotifyHistoryItemChanged; self = [super init]; _private = kitPrivate(item.releaseRef()); ASSERT(!historyItemWrappers().get(core(_private))); historyItemWrappers().set(core(_private), self); return self; } - (void)setTitle:(NSString *)title { core(_private)->setTitle(title); } - (void)setVisitCount:(int)count { core(_private)->setVisitCount(count); } - (void)setViewState:(id)statePList { core(_private)->setViewState(statePList); } - (void)_mergeAutoCompleteHints:(WebHistoryItem *)otherItem { ASSERT_ARG(otherItem, otherItem); core(_private)->mergeAutoCompleteHints(core(otherItem->_private)); } - (id)initFromDictionaryRepresentation:(NSDictionary *)dict { ASSERT_MAIN_THREAD(); NSString *URLString = [dict _webkit_stringForKey:@""]; NSString *title = [dict _webkit_stringForKey:titleKey]; // Do an existence check to avoid calling doubleValue on a nil string. Leave // time interval at 0 if there's no value in dict. NSString *timeIntervalString = [dict _webkit_stringForKey:lastVisitedTimeIntervalKey]; NSTimeInterval lastVisited = timeIntervalString == nil ? 0 : [timeIntervalString doubleValue]; self = [self initWithURLString:URLString title:title displayTitle:[dict _webkit_stringForKey:displayTitleKey] lastVisitedTimeInterval:lastVisited]; // Check if we've read a broken URL from the file that has non-Latin1 chars. If so, try to convert // as if it was from user typing. if (![URLString canBeConvertedToEncoding:NSISOLatin1StringEncoding]) { NSURL *tempURL = [NSURL _web_URLWithUserTypedString:URLString]; ASSERT(tempURL); NSString *newURLString = [tempURL _web_originalDataAsString]; core(_private)->setURLString(newURLString); core(_private)->setOriginalURLString(newURLString); } int visitCount = [dict _webkit_intForKey:visitCountKey]; // Can't trust data on disk, and we've had at least one report of this (<rdar://6572300>). if (visitCount < 0) { LOG_ERROR("visit count for history item \"%@\" is negative (%d), will be reset to 1", URLString, visitCount); visitCount = 1; } core(_private)->setVisitCount(visitCount); if ([dict _webkit_boolForKey:lastVisitWasFailureKey]) core(_private)->setLastVisitWasFailure(true); BOOL lastVisitWasHTTPNonGet = [dict _webkit_boolForKey:lastVisitWasHTTPNonGetKey]; NSString *tempURLString = [URLString lowercaseString]; if (lastVisitWasHTTPNonGet && ([tempURLString hasPrefix:@"http:"] || [tempURLString hasPrefix:@"https:"])) core(_private)->setLastVisitWasHTTPNonGet(lastVisitWasHTTPNonGet); if (NSArray *redirectURLs = [dict _webkit_arrayForKey:redirectURLsKey]) { NSUInteger size = [redirectURLs count]; OwnPtr<Vector<String> > redirectURLsVector(new Vector<String>(size)); for (NSUInteger i = 0; i < size; ++i) (*redirectURLsVector)[i] = String([redirectURLs _webkit_stringAtIndex:i]); core(_private)->setRedirectURLs(redirectURLsVector.release()); } NSArray *dailyCounts = [dict _webkit_arrayForKey:dailyVisitCountKey]; NSArray *weeklyCounts = [dict _webkit_arrayForKey:weeklyVisitCountKey]; if (dailyCounts || weeklyCounts) { Vector<int> coreDailyCounts([dailyCounts count]); Vector<int> coreWeeklyCounts([weeklyCounts count]); // Daily and weekly counts < 0 are errors in the data read from disk, so reset to 0. for (size_t i = 0; i < coreDailyCounts.size(); ++i) coreDailyCounts[i] = max([[dailyCounts _webkit_numberAtIndex:i] intValue], 0); for (size_t i = 0; i < coreWeeklyCounts.size(); ++i) coreWeeklyCounts[i] = max([[weeklyCounts _webkit_numberAtIndex:i] intValue], 0); core(_private)->adoptVisitCounts(coreDailyCounts, coreWeeklyCounts); } NSArray *childDicts = [dict objectForKey:childrenKey]; if (childDicts) { for (int i = [childDicts count] - 1; i >= 0; i--) { WebHistoryItem *child = [[WebHistoryItem alloc] initFromDictionaryRepresentation:[childDicts objectAtIndex:i]]; core(_private)->addChildItem(core(child->_private)); [child release]; } } return self; } - (NSPoint)scrollPoint { ASSERT_MAIN_THREAD(); return core(_private)->scrollPoint(); } - (void)_visitedWithTitle:(NSString *)title increaseVisitCount:(BOOL)increaseVisitCount { core(_private)->visited(title, [NSDate timeIntervalSinceReferenceDate], increaseVisitCount ? IncreaseVisitCount : DoNotIncreaseVisitCount); } - (void)_recordInitialVisit { core(_private)->recordInitialVisit(); } @end @implementation WebHistoryItem (WebPrivate) - (id)initWithURL:(NSURL *)URL title:(NSString *)title { return [self initWithURLString:[URL _web_originalDataAsString] title:title lastVisitedTimeInterval:0]; } - (NSDictionary *)dictionaryRepresentation { ASSERT_MAIN_THREAD(); NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:8]; HistoryItem* coreItem = core(_private); if (!coreItem->urlString().isEmpty()) [dict setObject:(NSString*)coreItem->urlString() forKey:@""]; if (!coreItem->title().isEmpty()) [dict setObject:(NSString*)coreItem->title() forKey:titleKey]; if (!coreItem->alternateTitle().isEmpty()) [dict setObject:(NSString*)coreItem->alternateTitle() forKey:displayTitleKey]; if (coreItem->lastVisitedTime() != 0.0) { // Store as a string to maintain backward compatibility. (See 3245793) [dict setObject:[NSString stringWithFormat:@"%.1lf", coreItem->lastVisitedTime()] forKey:lastVisitedTimeIntervalKey]; } if (coreItem->visitCount()) [dict setObject:[NSNumber numberWithInt:coreItem->visitCount()] forKey:visitCountKey]; if (coreItem->lastVisitWasFailure()) [dict setObject:[NSNumber numberWithBool:YES] forKey:lastVisitWasFailureKey]; if (coreItem->lastVisitWasHTTPNonGet()) { ASSERT(coreItem->urlString().startsWith("http:", false) || coreItem->urlString().startsWith("https:", false)); [dict setObject:[NSNumber numberWithBool:YES] forKey:lastVisitWasHTTPNonGetKey]; } if (Vector<String>* redirectURLs = coreItem->redirectURLs()) { size_t size = redirectURLs->size(); ASSERT(size); NSMutableArray *result = [[NSMutableArray alloc] initWithCapacity:size]; for (size_t i = 0; i < size; ++i) [result addObject:(NSString*)redirectURLs->at(i)]; [dict setObject:result forKey:redirectURLsKey]; [result release]; } const Vector<int>& dailyVisitCounts = coreItem->dailyVisitCounts(); if (dailyVisitCounts.size()) { NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:13]; for (size_t i = 0; i < dailyVisitCounts.size(); ++i) [array addObject:[NSNumber numberWithInt:dailyVisitCounts[i]]]; [dict setObject:array forKey:dailyVisitCountKey]; [array release]; } const Vector<int>& weeklyVisitCounts = coreItem->weeklyVisitCounts(); if (weeklyVisitCounts.size()) { NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:5]; for (size_t i = 0; i < weeklyVisitCounts.size(); ++i) [array addObject:[NSNumber numberWithInt:weeklyVisitCounts[i]]]; [dict setObject:array forKey:weeklyVisitCountKey]; [array release]; } if (coreItem->children().size()) { const HistoryItemVector& children = coreItem->children(); NSMutableArray *childDicts = [NSMutableArray arrayWithCapacity:children.size()]; for (int i = children.size() - 1; i >= 0; i--) [childDicts addObject:[kit(children[i].get()) dictionaryRepresentation]]; [dict setObject: childDicts forKey:childrenKey]; } return dict; } - (NSString *)target { ASSERT_MAIN_THREAD(); return nsStringNilIfEmpty(core(_private)->target()); } - (BOOL)isTargetItem { return core(_private)->isTargetItem(); } - (int)visitCount { ASSERT_MAIN_THREAD(); return core(_private)->visitCount(); } - (NSString *)RSSFeedReferrer { return nsStringNilIfEmpty(core(_private)->referrer()); } - (void)setRSSFeedReferrer:(NSString *)referrer { core(_private)->setReferrer(referrer); } - (NSArray *)children { ASSERT_MAIN_THREAD(); const HistoryItemVector& children = core(_private)->children(); if (!children.size()) return nil; unsigned size = children.size(); NSMutableArray *result = [[[NSMutableArray alloc] initWithCapacity:size] autorelease]; for (unsigned i = 0; i < size; ++i) [result addObject:kit(children[i].get())]; return result; } - (void)setAlwaysAttemptToUsePageCache:(BOOL)flag { // Safari 2.0 uses this for SnapBack, so we stub it out to avoid a crash. } - (NSURL *)URL { ASSERT_MAIN_THREAD(); const KURL& url = core(_private)->url(); if (url.isEmpty()) return nil; return url; } // This should not be called directly for WebHistoryItems that are already included // in WebHistory. Use -[WebHistory setLastVisitedTimeInterval:forItem:] instead. - (void)_setLastVisitedTimeInterval:(NSTimeInterval)time { core(_private)->setLastVisitedTime(time); } // FIXME: <rdar://problem/4880065> - Push Global History into WebCore // Once that task is complete, this accessor can go away - (NSCalendarDate *)_lastVisitedDate { ASSERT_MAIN_THREAD(); return [[[NSCalendarDate alloc] initWithTimeIntervalSinceReferenceDate:core(_private)->lastVisitedTime()] autorelease]; } - (WebHistoryItem *)targetItem { ASSERT_MAIN_THREAD(); return kit(core(_private)->targetItem()); } + (void)_releaseAllPendingPageCaches { pageCache()->releaseAutoreleasedPagesNow(); } - (id)_transientPropertyForKey:(NSString *)key { return core(_private)->getTransientProperty(key); } - (void)_setTransientProperty:(id)property forKey:(NSString *)key { core(_private)->setTransientProperty(key, property); } - (BOOL)lastVisitWasFailure { return core(_private)->lastVisitWasFailure(); } - (void)_setLastVisitWasFailure:(BOOL)failure { core(_private)->setLastVisitWasFailure(failure); } - (BOOL)_lastVisitWasHTTPNonGet { return core(_private)->lastVisitWasHTTPNonGet(); } - (NSArray *)_redirectURLs { Vector<String>* redirectURLs = core(_private)->redirectURLs(); if (!redirectURLs) return nil; size_t size = redirectURLs->size(); ASSERT(size); NSMutableArray *result = [[NSMutableArray alloc] initWithCapacity:size]; for (size_t i = 0; i < size; ++i) [result addObject:(NSString*)redirectURLs->at(i)]; return [result autorelease]; } - (size_t)_getDailyVisitCounts:(const int**)counts { HistoryItem* coreItem = core(_private); *counts = coreItem->dailyVisitCounts().data(); return coreItem->dailyVisitCounts().size(); } - (size_t)_getWeeklyVisitCounts:(const int**)counts { HistoryItem* coreItem = core(_private); *counts = coreItem->weeklyVisitCounts().data(); return coreItem->weeklyVisitCounts().size(); } @end // FIXME: <rdar://problem/4886761>. // This is a bizarre policy. We flush the page caches ANY time ANY window is closed? @implementation WebWindowWatcher - (void)windowWillClose:(NSNotification *)notification { if (!pthread_main_np()) { [self performSelectorOnMainThread:_cmd withObject:notification waitUntilDone:NO]; return; } pageCache()->releaseAutoreleasedPagesNow(); } @end �����������������������������������������������������������������������������������������������������������������WebKit/mac/History/WebBackForwardList.mm������������������������������������������������������������0000644�0001750�0001750�00000021002�11174716457�016562� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebBackForwardList.h" #import "WebBackForwardListInternal.h" #import "WebFrameInternal.h" #import "WebHistoryItemInternal.h" #import "WebHistoryItemPrivate.h" #import "WebKitLogging.h" #import "WebKitVersionChecks.h" #import "WebNSObjectExtras.h" #import "WebPreferencesPrivate.h" #import "WebTypesInternal.h" #import "WebViewPrivate.h" #import <WebCore/BackForwardList.h> #import <WebCore/HistoryItem.h> #import <WebCore/Page.h> #import <WebCore/PageCache.h> #import <WebCore/Settings.h> #import <WebCore/ThreadCheck.h> #import <WebCore/WebCoreObjCExtras.h> #import <runtime/InitializeThreading.h> #import <wtf/Assertions.h> #import <wtf/RetainPtr.h> #import <wtf/StdLibExtras.h> using namespace WebCore; typedef HashMap<BackForwardList*, WebBackForwardList*> BackForwardListMap; static BackForwardListMap& backForwardLists() { DEFINE_STATIC_LOCAL(BackForwardListMap, staticBackForwardLists, ()); return staticBackForwardLists; } @implementation WebBackForwardList (WebBackForwardListInternal) BackForwardList* core(WebBackForwardList *webBackForwardList) { if (!webBackForwardList) return 0; return reinterpret_cast<BackForwardList*>(webBackForwardList->_private); } WebBackForwardList *kit(BackForwardList* backForwardList) { if (!backForwardList) return nil; if (WebBackForwardList *webBackForwardList = backForwardLists().get(backForwardList)) return webBackForwardList; return [[[WebBackForwardList alloc] initWithBackForwardList:backForwardList] autorelease]; } - (id)initWithBackForwardList:(PassRefPtr<BackForwardList>)backForwardList { WebCoreThreadViolationCheckRoundOne(); self = [super init]; if (!self) return nil; _private = reinterpret_cast<WebBackForwardListPrivate*>(backForwardList.releaseRef()); backForwardLists().set(core(self), self); return self; } @end @implementation WebBackForwardList + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif } - (id)init { return [self initWithBackForwardList:BackForwardList::create(0)]; } - (void)dealloc { if (WebCoreObjCScheduleDeallocateOnMainThread([WebBackForwardList class], self)) return; BackForwardList* backForwardList = core(self); ASSERT(backForwardList); if (backForwardList) { ASSERT(backForwardList->closed()); backForwardLists().remove(backForwardList); backForwardList->deref(); } [super dealloc]; } - (void)finalize { WebCoreThreadViolationCheckRoundOne(); BackForwardList* backForwardList = core(self); ASSERT(backForwardList); if (backForwardList) { ASSERT(backForwardList->closed()); backForwardLists().remove(backForwardList); backForwardList->deref(); } [super finalize]; } - (void)_close { core(self)->close(); } - (void)addItem:(WebHistoryItem *)entry { core(self)->addItem(core(entry)); // Since the assumed contract with WebBackForwardList is that it retains its WebHistoryItems, // the following line prevents a whole class of problems where a history item will be created in // a function, added to the BFlist, then used in the rest of that function. [[entry retain] autorelease]; } - (void)removeItem:(WebHistoryItem *)item { core(self)->removeItem(core(item)); } - (BOOL)containsItem:(WebHistoryItem *)item { return core(self)->containsItem(core(item)); } - (void)goBack { core(self)->goBack(); } - (void)goForward { core(self)->goForward(); } - (void)goToItem:(WebHistoryItem *)item { core(self)->goToItem(core(item)); } - (WebHistoryItem *)backItem { return [[kit(core(self)->backItem()) retain] autorelease]; } - (WebHistoryItem *)currentItem { return [[kit(core(self)->currentItem()) retain] autorelease]; } - (WebHistoryItem *)forwardItem { return [[kit(core(self)->forwardItem()) retain] autorelease]; } static NSArray* vectorToNSArray(HistoryItemVector& list) { unsigned size = list.size(); NSMutableArray *result = [[[NSMutableArray alloc] initWithCapacity:size] autorelease]; for (unsigned i = 0; i < size; ++i) [result addObject:kit(list[i].get())]; return result; } static bool bumperCarBackForwardHackNeeded() { static bool hackNeeded = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.freeverse.bumpercar"] && !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_BUMPERCAR_BACK_FORWARD_QUIRK); return hackNeeded; } - (NSArray *)backListWithLimit:(int)limit { HistoryItemVector list; core(self)->backListWithLimit(limit, list); NSArray *result = vectorToNSArray(list); if (bumperCarBackForwardHackNeeded()) { static NSArray *lastBackListArray = nil; [lastBackListArray release]; lastBackListArray = [result retain]; } return result; } - (NSArray *)forwardListWithLimit:(int)limit { HistoryItemVector list; core(self)->forwardListWithLimit(limit, list); NSArray *result = vectorToNSArray(list); if (bumperCarBackForwardHackNeeded()) { static NSArray *lastForwardListArray = nil; [lastForwardListArray release]; lastForwardListArray = [result retain]; } return result; } - (int)capacity { return core(self)->capacity(); } - (void)setCapacity:(int)size { core(self)->setCapacity(size); } -(NSString *)description { NSMutableString *result; result = [NSMutableString stringWithCapacity:512]; [result appendString:@"\n--------------------------------------------\n"]; [result appendString:@"WebBackForwardList:\n"]; BackForwardList* backForwardList = core(self); HistoryItemVector& entries = backForwardList->entries(); unsigned size = entries.size(); for (unsigned i = 0; i < size; ++i) { if (entries[i] == backForwardList->currentItem()) { [result appendString:@" >>>"]; } else { [result appendString:@" "]; } [result appendFormat:@"%2d) ", i]; int currPos = [result length]; [result appendString:[kit(entries[i].get()) description]]; // shift all the contents over. a bit slow, but this is for debugging NSRange replRange = {currPos, [result length]-currPos}; [result replaceOccurrencesOfString:@"\n" withString:@"\n " options:0 range:replRange]; [result appendString:@"\n"]; } [result appendString:@"\n--------------------------------------------\n"]; return result; } - (void)setPageCacheSize:(NSUInteger)size { [kit(core(self)->page()) setUsesPageCache:size != 0]; } - (NSUInteger)pageCacheSize { return [kit(core(self)->page()) usesPageCache] ? pageCache()->capacity() : 0; } - (int)backListCount { return core(self)->backListCount(); } - (int)forwardListCount { return core(self)->forwardListCount(); } - (WebHistoryItem *)itemAtIndex:(int)index { return [[kit(core(self)->itemAtIndex(index)) retain] autorelease]; } @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/History/WebHistory.mm��������������������������������������������������������������������0000644�0001750�0001750�00000066227�11256537131�015213� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2008, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebHistoryInternal.h" #import "WebHistoryItemInternal.h" #import "WebKitLogging.h" #import "WebNSURLExtras.h" #import "WebTypesInternal.h" #import <WebCore/HistoryItem.h> #import <WebCore/HistoryPropertyList.h> #import <WebCore/PageGroup.h> using namespace WebCore; using namespace std; typedef int64_t WebHistoryDateKey; typedef HashMap<WebHistoryDateKey, RetainPtr<NSMutableArray> > DateToEntriesMap; NSString *WebHistoryItemsAddedNotification = @"WebHistoryItemsAddedNotification"; NSString *WebHistoryItemsRemovedNotification = @"WebHistoryItemsRemovedNotification"; NSString *WebHistoryAllItemsRemovedNotification = @"WebHistoryAllItemsRemovedNotification"; NSString *WebHistoryLoadedNotification = @"WebHistoryLoadedNotification"; NSString *WebHistoryItemsDiscardedWhileLoadingNotification = @"WebHistoryItemsDiscardedWhileLoadingNotification"; NSString *WebHistorySavedNotification = @"WebHistorySavedNotification"; NSString *WebHistoryItemsKey = @"WebHistoryItems"; static WebHistory *_sharedHistory = nil; NSString *FileVersionKey = @"WebHistoryFileVersion"; NSString *DatesArrayKey = @"WebHistoryDates"; #define currentFileVersion 1 class WebHistoryWriter : public HistoryPropertyListWriter { public: WebHistoryWriter(DateToEntriesMap*); private: virtual void writeHistoryItems(BinaryPropertyListObjectStream&); DateToEntriesMap* m_entriesByDate; Vector<int> m_dateKeys; }; @interface WebHistoryPrivate : NSObject { @private NSMutableDictionary *_entriesByURL; DateToEntriesMap* _entriesByDate; NSMutableArray *_orderedLastVisitedDays; BOOL itemLimitSet; int itemLimit; BOOL ageInDaysLimitSet; int ageInDaysLimit; } - (WebHistoryItem *)visitedURL:(NSURL *)url withTitle:(NSString *)title increaseVisitCount:(BOOL)increaseVisitCount; - (BOOL)addItem:(WebHistoryItem *)entry discardDuplicate:(BOOL)discardDuplicate; - (void)addItems:(NSArray *)newEntries; - (BOOL)removeItem:(WebHistoryItem *)entry; - (BOOL)removeItems:(NSArray *)entries; - (BOOL)removeAllItems; - (NSArray *)orderedLastVisitedDays; - (NSArray *)orderedItemsLastVisitedOnDay:(NSCalendarDate *)calendarDate; - (BOOL)containsURL:(NSURL *)URL; - (WebHistoryItem *)itemForURL:(NSURL *)URL; - (WebHistoryItem *)itemForURLString:(NSString *)URLString; - (NSArray *)allItems; - (BOOL)loadFromURL:(NSURL *)URL collectDiscardedItemsInto:(NSMutableArray *)discardedItems error:(NSError **)error; - (BOOL)saveToURL:(NSURL *)URL error:(NSError **)error; - (NSCalendarDate *)ageLimitDate; - (void)setHistoryItemLimit:(int)limit; - (int)historyItemLimit; - (void)setHistoryAgeInDaysLimit:(int)limit; - (int)historyAgeInDaysLimit; - (void)addVisitedLinksToPageGroup:(PageGroup&)group; @end @implementation WebHistoryPrivate #pragma mark OBJECT FRAMEWORK + (void)initialize { [[NSUserDefaults standardUserDefaults] registerDefaults: [NSDictionary dictionaryWithObjectsAndKeys: @"1000", @"WebKitHistoryItemLimit", @"7", @"WebKitHistoryAgeInDaysLimit", nil]]; } - (id)init { if (![super init]) return nil; _entriesByURL = [[NSMutableDictionary alloc] init]; _entriesByDate = new DateToEntriesMap; return self; } - (void)dealloc { [_entriesByURL release]; [_orderedLastVisitedDays release]; delete _entriesByDate; [super dealloc]; } - (void)finalize { delete _entriesByDate; [super finalize]; } #pragma mark MODIFYING CONTENTS static void getDayBoundaries(NSTimeInterval interval, NSTimeInterval& beginningOfDay, NSTimeInterval& beginningOfNextDay) { CFTimeZoneRef timeZone = CFTimeZoneCopyDefault(); CFGregorianDate date = CFAbsoluteTimeGetGregorianDate(interval, timeZone); date.hour = 0; date.minute = 0; date.second = 0; beginningOfDay = CFGregorianDateGetAbsoluteTime(date, timeZone); date.day += 1; beginningOfNextDay = CFGregorianDateGetAbsoluteTime(date, timeZone); CFRelease(timeZone); } static inline NSTimeInterval beginningOfDay(NSTimeInterval date) { static NSTimeInterval cachedBeginningOfDay = NAN; static NSTimeInterval cachedBeginningOfNextDay; if (!(date >= cachedBeginningOfDay && date < cachedBeginningOfNextDay)) getDayBoundaries(date, cachedBeginningOfDay, cachedBeginningOfNextDay); return cachedBeginningOfDay; } static inline WebHistoryDateKey dateKey(NSTimeInterval date) { // Converting from double (NSTimeInterval) to int64_t (WebHistoryDateKey) is // safe here because all sensible dates are in the range -2**48 .. 2**47 which // safely fits in an int64_t. return beginningOfDay(date); } // Returns whether the day is already in the list of days, // and fills in *key with the key used to access its location - (BOOL)findKey:(WebHistoryDateKey*)key forDay:(NSTimeInterval)date { ASSERT_ARG(key, key); *key = dateKey(date); return _entriesByDate->contains(*key); } - (void)insertItem:(WebHistoryItem *)entry forDateKey:(WebHistoryDateKey)dateKey { ASSERT_ARG(entry, entry != nil); ASSERT(_entriesByDate->contains(dateKey)); NSMutableArray *entriesForDate = _entriesByDate->get(dateKey).get(); NSTimeInterval entryDate = [entry lastVisitedTimeInterval]; unsigned count = [entriesForDate count]; // The entries for each day are stored in a sorted array with the most recent entry first // Check for the common cases of the entry being newer than all existing entries or the first entry of the day if (!count || [[entriesForDate objectAtIndex:0] lastVisitedTimeInterval] < entryDate) { [entriesForDate insertObject:entry atIndex:0]; return; } // .. or older than all existing entries if (count > 0 && [[entriesForDate objectAtIndex:count - 1] lastVisitedTimeInterval] >= entryDate) { [entriesForDate insertObject:entry atIndex:count]; return; } unsigned low = 0; unsigned high = count; while (low < high) { unsigned mid = low + (high - low) / 2; if ([[entriesForDate objectAtIndex:mid] lastVisitedTimeInterval] >= entryDate) low = mid + 1; else high = mid; } // low is now the index of the first entry that is older than entryDate [entriesForDate insertObject:entry atIndex:low]; } - (BOOL)removeItemFromDateCaches:(WebHistoryItem *)entry { WebHistoryDateKey dateKey; BOOL foundDate = [self findKey:&dateKey forDay:[entry lastVisitedTimeInterval]]; if (!foundDate) return NO; DateToEntriesMap::iterator it = _entriesByDate->find(dateKey); NSMutableArray *entriesForDate = it->second.get(); [entriesForDate removeObjectIdenticalTo:entry]; // remove this date entirely if there are no other entries on it if ([entriesForDate count] == 0) { _entriesByDate->remove(it); // Clear _orderedLastVisitedDays so it will be regenerated when next requested. [_orderedLastVisitedDays release]; _orderedLastVisitedDays = nil; } return YES; } - (BOOL)removeItemForURLString:(NSString *)URLString { WebHistoryItem *entry = [_entriesByURL objectForKey:URLString]; if (!entry) return NO; [_entriesByURL removeObjectForKey:URLString]; #if ASSERT_DISABLED [self removeItemFromDateCaches:entry]; #else BOOL itemWasInDateCaches = [self removeItemFromDateCaches:entry]; ASSERT(itemWasInDateCaches); #endif if (![_entriesByURL count]) PageGroup::removeAllVisitedLinks(); return YES; } - (void)addItemToDateCaches:(WebHistoryItem *)entry { WebHistoryDateKey dateKey; if ([self findKey:&dateKey forDay:[entry lastVisitedTimeInterval]]) // other entries already exist for this date [self insertItem:entry forDateKey:dateKey]; else { // no other entries exist for this date NSMutableArray *entries = [[NSMutableArray alloc] initWithObjects:&entry count:1]; _entriesByDate->set(dateKey, entries); [entries release]; // Clear _orderedLastVisitedDays so it will be regenerated when next requested. [_orderedLastVisitedDays release]; _orderedLastVisitedDays = nil; } } - (WebHistoryItem *)visitedURL:(NSURL *)url withTitle:(NSString *)title increaseVisitCount:(BOOL)increaseVisitCount { ASSERT(url); ASSERT(title); NSString *URLString = [url _web_originalDataAsString]; WebHistoryItem *entry = [_entriesByURL objectForKey:URLString]; if (entry) { LOG(History, "Updating global history entry %@", entry); // Remove the item from date caches before changing its last visited date. Otherwise we might get duplicate entries // as seen in <rdar://problem/6570573>. BOOL itemWasInDateCaches = [self removeItemFromDateCaches:entry]; ASSERT_UNUSED(itemWasInDateCaches, itemWasInDateCaches); [entry _visitedWithTitle:title increaseVisitCount:increaseVisitCount]; } else { LOG(History, "Adding new global history entry for %@", url); entry = [[WebHistoryItem alloc] initWithURLString:URLString title:title lastVisitedTimeInterval:[NSDate timeIntervalSinceReferenceDate]]; [entry _recordInitialVisit]; [_entriesByURL setObject:entry forKey:URLString]; [entry release]; } [self addItemToDateCaches:entry]; return entry; } - (BOOL)addItem:(WebHistoryItem *)entry discardDuplicate:(BOOL)discardDuplicate { ASSERT_ARG(entry, entry); ASSERT_ARG(entry, [entry lastVisitedTimeInterval] != 0); NSString *URLString = [entry URLString]; WebHistoryItem *oldEntry = [_entriesByURL objectForKey:URLString]; if (oldEntry) { if (discardDuplicate) return NO; // The last reference to oldEntry might be this dictionary, so we hold onto a reference // until we're done with oldEntry. [oldEntry retain]; [self removeItemForURLString:URLString]; // If we already have an item with this URL, we need to merge info that drives the // URL autocomplete heuristics from that item into the new one. [entry _mergeAutoCompleteHints:oldEntry]; [oldEntry release]; } [self addItemToDateCaches:entry]; [_entriesByURL setObject:entry forKey:URLString]; return YES; } - (BOOL)removeItem:(WebHistoryItem *)entry { NSString *URLString = [entry URLString]; // If this exact object isn't stored, then make no change. // FIXME: Is this the right behavior if this entry isn't present, but another entry for the same URL is? // Maybe need to change the API to make something like removeEntryForURLString public instead. WebHistoryItem *matchingEntry = [_entriesByURL objectForKey:URLString]; if (matchingEntry != entry) return NO; [self removeItemForURLString:URLString]; return YES; } - (BOOL)removeItems:(NSArray *)entries { NSUInteger count = [entries count]; if (!count) return NO; for (NSUInteger index = 0; index < count; ++index) [self removeItem:[entries objectAtIndex:index]]; return YES; } - (BOOL)removeAllItems { if (_entriesByDate->isEmpty()) return NO; _entriesByDate->clear(); [_entriesByURL removeAllObjects]; // Clear _orderedLastVisitedDays so it will be regenerated when next requested. [_orderedLastVisitedDays release]; _orderedLastVisitedDays = nil; PageGroup::removeAllVisitedLinks(); return YES; } - (void)addItems:(NSArray *)newEntries { // There is no guarantee that the incoming entries are in any particular // order, but if this is called with a set of entries that were created by // iterating through the results of orderedLastVisitedDays and orderedItemsLastVisitedOnDayy // then they will be ordered chronologically from newest to oldest. We can make adding them // faster (fewer compares) by inserting them from oldest to newest. NSEnumerator *enumerator = [newEntries reverseObjectEnumerator]; while (WebHistoryItem *entry = [enumerator nextObject]) [self addItem:entry discardDuplicate:NO]; } #pragma mark DATE-BASED RETRIEVAL - (NSArray *)orderedLastVisitedDays { if (!_orderedLastVisitedDays) { Vector<int> daysAsTimeIntervals; daysAsTimeIntervals.reserveCapacity(_entriesByDate->size()); DateToEntriesMap::const_iterator end = _entriesByDate->end(); for (DateToEntriesMap::const_iterator it = _entriesByDate->begin(); it != end; ++it) daysAsTimeIntervals.append(it->first); sort(daysAsTimeIntervals.begin(), daysAsTimeIntervals.end()); size_t count = daysAsTimeIntervals.size(); _orderedLastVisitedDays = [[NSMutableArray alloc] initWithCapacity:count]; for (int i = count - 1; i >= 0; i--) { NSTimeInterval interval = daysAsTimeIntervals[i]; NSCalendarDate *date = [[NSCalendarDate alloc] initWithTimeIntervalSinceReferenceDate:interval]; [_orderedLastVisitedDays addObject:date]; [date release]; } } return _orderedLastVisitedDays; } - (NSArray *)orderedItemsLastVisitedOnDay:(NSCalendarDate *)date { WebHistoryDateKey dateKey; if (![self findKey:&dateKey forDay:[date timeIntervalSinceReferenceDate]]) return nil; return _entriesByDate->get(dateKey).get(); } #pragma mark URL MATCHING - (WebHistoryItem *)itemForURLString:(NSString *)URLString { return [_entriesByURL objectForKey:URLString]; } - (BOOL)containsURL:(NSURL *)URL { return [self itemForURLString:[URL _web_originalDataAsString]] != nil; } - (WebHistoryItem *)itemForURL:(NSURL *)URL { return [self itemForURLString:[URL _web_originalDataAsString]]; } - (NSArray *)allItems { return [_entriesByURL allValues]; } #pragma mark ARCHIVING/UNARCHIVING - (void)setHistoryAgeInDaysLimit:(int)limit { ageInDaysLimitSet = YES; ageInDaysLimit = limit; } - (int)historyAgeInDaysLimit { if (ageInDaysLimitSet) return ageInDaysLimit; return [[NSUserDefaults standardUserDefaults] integerForKey:@"WebKitHistoryAgeInDaysLimit"]; } - (void)setHistoryItemLimit:(int)limit { itemLimitSet = YES; itemLimit = limit; } - (int)historyItemLimit { if (itemLimitSet) return itemLimit; return [[NSUserDefaults standardUserDefaults] integerForKey:@"WebKitHistoryItemLimit"]; } // Return a date that marks the age limit for history entries saved to or // loaded from disk. Any entry older than this item should be rejected. - (NSCalendarDate *)ageLimitDate { return [[NSCalendarDate calendarDate] dateByAddingYears:0 months:0 days:-[self historyAgeInDaysLimit] hours:0 minutes:0 seconds:0]; } - (BOOL)loadHistoryGutsFromURL:(NSURL *)URL savedItemsCount:(int *)numberOfItemsLoaded collectDiscardedItemsInto:(NSMutableArray *)discardedItems error:(NSError **)error { *numberOfItemsLoaded = 0; NSDictionary *dictionary = nil; // Optimize loading from local file, which is faster than using the general URL loading mechanism if ([URL isFileURL]) { dictionary = [NSDictionary dictionaryWithContentsOfFile:[URL path]]; if (!dictionary) { #if !LOG_DISABLED if ([[NSFileManager defaultManager] fileExistsAtPath:[URL path]]) LOG_ERROR("unable to read history from file %@; perhaps contents are corrupted", [URL path]); #endif // else file doesn't exist, which is normal the first time return NO; } } else { NSData *data = [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:URL] returningResponse:nil error:error]; if (data && [data length] > 0) { dictionary = [NSPropertyListSerialization propertyListFromData:data mutabilityOption:NSPropertyListImmutable format:nil errorDescription:nil]; } } // We used to support NSArrays here, but that was before Safari 1.0 shipped. We will no longer support // that ancient format, so anything that isn't an NSDictionary is bogus. if (![dictionary isKindOfClass:[NSDictionary class]]) return NO; NSNumber *fileVersionObject = [dictionary objectForKey:FileVersionKey]; int fileVersion; // we don't trust data obtained from elsewhere, so double-check if (!fileVersionObject || ![fileVersionObject isKindOfClass:[NSNumber class]]) { LOG_ERROR("history file version can't be determined, therefore not loading"); return NO; } fileVersion = [fileVersionObject intValue]; if (fileVersion > currentFileVersion) { LOG_ERROR("history file version is %d, newer than newest known version %d, therefore not loading", fileVersion, currentFileVersion); return NO; } NSArray *array = [dictionary objectForKey:DatesArrayKey]; int itemCountLimit = [self historyItemLimit]; NSTimeInterval ageLimitDate = [[self ageLimitDate] timeIntervalSinceReferenceDate]; NSEnumerator *enumerator = [array objectEnumerator]; BOOL ageLimitPassed = NO; BOOL itemLimitPassed = NO; ASSERT(*numberOfItemsLoaded == 0); NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSDictionary *itemAsDictionary; while ((itemAsDictionary = [enumerator nextObject]) != nil) { WebHistoryItem *item = [[WebHistoryItem alloc] initFromDictionaryRepresentation:itemAsDictionary]; // item without URL is useless; data on disk must have been bad; ignore if ([item URLString]) { // Test against date limit. Since the items are ordered newest to oldest, we can stop comparing // once we've found the first item that's too old. if (!ageLimitPassed && [item lastVisitedTimeInterval] <= ageLimitDate) ageLimitPassed = YES; if (ageLimitPassed || itemLimitPassed) [discardedItems addObject:item]; else { if ([self addItem:item discardDuplicate:YES]) ++(*numberOfItemsLoaded); if (*numberOfItemsLoaded == itemCountLimit) itemLimitPassed = YES; // Draining the autorelease pool every 50 iterations was found by experimentation to be optimal if (*numberOfItemsLoaded % 50 == 0) { [pool drain]; pool = [[NSAutoreleasePool alloc] init]; } } } [item release]; } [pool drain]; return YES; } - (BOOL)loadFromURL:(NSURL *)URL collectDiscardedItemsInto:(NSMutableArray *)discardedItems error:(NSError **)error { #if !LOG_DISABLED double start = CFAbsoluteTimeGetCurrent(); #endif int numberOfItems; if (![self loadHistoryGutsFromURL:URL savedItemsCount:&numberOfItems collectDiscardedItemsInto:discardedItems error:error]) return NO; #if !LOG_DISABLED double duration = CFAbsoluteTimeGetCurrent() - start; LOG(Timing, "loading %d history entries from %@ took %f seconds", numberOfItems, URL, duration); #endif return YES; } - (NSData *)data { if (_entriesByDate->isEmpty()) { static NSData *emptyHistoryData = (NSData *)CFDataCreate(0, 0, 0); return emptyHistoryData; } // Ignores the date and item count limits; these are respected when loading instead of when saving, so // that clients can learn of discarded items by listening to WebHistoryItemsDiscardedWhileLoadingNotification. WebHistoryWriter writer(_entriesByDate); writer.writePropertyList(); return [[(NSData *)writer.releaseData().get() retain] autorelease]; } - (BOOL)saveToURL:(NSURL *)URL error:(NSError **)error { #if !LOG_DISABLED double start = CFAbsoluteTimeGetCurrent(); #endif BOOL result = [[self data] writeToURL:URL options:0 error:error]; #if !LOG_DISABLED double duration = CFAbsoluteTimeGetCurrent() - start; LOG(Timing, "saving history to %@ took %f seconds", URL, duration); #endif return result; } - (void)addVisitedLinksToPageGroup:(PageGroup&)group { NSEnumerator *enumerator = [_entriesByURL keyEnumerator]; while (NSString *url = [enumerator nextObject]) { size_t length = [url length]; const UChar* characters = CFStringGetCharactersPtr(reinterpret_cast<CFStringRef>(url)); if (characters) group.addVisitedLink(characters, length); else { Vector<UChar, 512> buffer(length); [url getCharacters:buffer.data()]; group.addVisitedLink(buffer.data(), length); } } } @end @implementation WebHistory + (WebHistory *)optionalSharedHistory { return _sharedHistory; } + (void)setOptionalSharedHistory:(WebHistory *)history { if (_sharedHistory == history) return; // FIXME: Need to think about multiple instances of WebHistory per application // and correct synchronization of history file between applications. [_sharedHistory release]; _sharedHistory = [history retain]; PageGroup::setShouldTrackVisitedLinks(history); PageGroup::removeAllVisitedLinks(); } - (id)init { self = [super init]; if (!self) return nil; _historyPrivate = [[WebHistoryPrivate alloc] init]; return self; } - (void)dealloc { [_historyPrivate release]; [super dealloc]; } #pragma mark MODIFYING CONTENTS - (void)_sendNotification:(NSString *)name entries:(NSArray *)entries { NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:entries, WebHistoryItemsKey, nil]; [[NSNotificationCenter defaultCenter] postNotificationName:name object:self userInfo:userInfo]; } - (void)removeItems:(NSArray *)entries { if ([_historyPrivate removeItems:entries]) { [self _sendNotification:WebHistoryItemsRemovedNotification entries:entries]; } } - (void)removeAllItems { NSArray *entries = [_historyPrivate allItems]; if ([_historyPrivate removeAllItems]) [self _sendNotification:WebHistoryAllItemsRemovedNotification entries:entries]; } - (void)addItems:(NSArray *)newEntries { [_historyPrivate addItems:newEntries]; [self _sendNotification:WebHistoryItemsAddedNotification entries:newEntries]; } #pragma mark DATE-BASED RETRIEVAL - (NSArray *)orderedLastVisitedDays { return [_historyPrivate orderedLastVisitedDays]; } - (NSArray *)orderedItemsLastVisitedOnDay:(NSCalendarDate *)date { return [_historyPrivate orderedItemsLastVisitedOnDay:date]; } #pragma mark URL MATCHING - (BOOL)containsURL:(NSURL *)URL { return [_historyPrivate containsURL:URL]; } - (WebHistoryItem *)itemForURL:(NSURL *)URL { return [_historyPrivate itemForURL:URL]; } #pragma mark SAVING TO DISK - (BOOL)loadFromURL:(NSURL *)URL error:(NSError **)error { NSMutableArray *discardedItems = [[NSMutableArray alloc] init]; if (![_historyPrivate loadFromURL:URL collectDiscardedItemsInto:discardedItems error:error]) { [discardedItems release]; return NO; } [[NSNotificationCenter defaultCenter] postNotificationName:WebHistoryLoadedNotification object:self]; if ([discardedItems count]) [self _sendNotification:WebHistoryItemsDiscardedWhileLoadingNotification entries:discardedItems]; [discardedItems release]; return YES; } - (BOOL)saveToURL:(NSURL *)URL error:(NSError **)error { if (![_historyPrivate saveToURL:URL error:error]) return NO; [[NSNotificationCenter defaultCenter] postNotificationName:WebHistorySavedNotification object:self]; return YES; } - (void)setHistoryItemLimit:(int)limit { [_historyPrivate setHistoryItemLimit:limit]; } - (int)historyItemLimit { return [_historyPrivate historyItemLimit]; } - (void)setHistoryAgeInDaysLimit:(int)limit { [_historyPrivate setHistoryAgeInDaysLimit:limit]; } - (int)historyAgeInDaysLimit { return [_historyPrivate historyAgeInDaysLimit]; } @end @implementation WebHistory (WebPrivate) - (WebHistoryItem *)_itemForURLString:(NSString *)URLString { return [_historyPrivate itemForURLString:URLString]; } - (NSArray *)allItems { return [_historyPrivate allItems]; } - (NSData *)_data { return [_historyPrivate data]; } @end @implementation WebHistory (WebInternal) - (void)_visitedURL:(NSURL *)url withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure increaseVisitCount:(BOOL)increaseVisitCount { WebHistoryItem *entry = [_historyPrivate visitedURL:url withTitle:title increaseVisitCount:increaseVisitCount]; HistoryItem* item = core(entry); item->setLastVisitWasFailure(wasFailure); if ([method length]) item->setLastVisitWasHTTPNonGet([method caseInsensitiveCompare:@"GET"] && (![[url scheme] caseInsensitiveCompare:@"http"] || ![[url scheme] caseInsensitiveCompare:@"https"])); item->setRedirectURLs(0); NSArray *entries = [[NSArray alloc] initWithObjects:entry, nil]; [self _sendNotification:WebHistoryItemsAddedNotification entries:entries]; [entries release]; } - (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group { [_historyPrivate addVisitedLinksToPageGroup:group]; } @end WebHistoryWriter::WebHistoryWriter(DateToEntriesMap* entriesByDate) : m_entriesByDate(entriesByDate) { m_dateKeys.reserveCapacity(m_entriesByDate->size()); DateToEntriesMap::const_iterator end = m_entriesByDate->end(); for (DateToEntriesMap::const_iterator it = m_entriesByDate->begin(); it != end; ++it) m_dateKeys.append(it->first); sort(m_dateKeys.begin(), m_dateKeys.end()); } void WebHistoryWriter::writeHistoryItems(BinaryPropertyListObjectStream& stream) { for (int dateIndex = m_dateKeys.size() - 1; dateIndex >= 0; dateIndex--) { NSArray *entries = m_entriesByDate->get(m_dateKeys[dateIndex]).get(); NSUInteger entryCount = [entries count]; for (NSUInteger entryIndex = 0; entryIndex < entryCount; ++entryIndex) writeHistoryItem(stream, core([entries objectAtIndex:entryIndex])); } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/History/WebURLsWithTitles.h��������������������������������������������������������������0000644�0001750�0001750�00000006000�10361675702�016220� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> #define WebURLsWithTitlesPboardType @"WebURLsWithTitlesPboardType" // Convenience class for getting URLs and associated titles on and off an NSPasteboard @interface WebURLsWithTitles : NSObject // Writes parallel arrays of URLs and titles to the pasteboard. These items can be retrieved by // calling URLsFromPasteboard and titlesFromPasteboard. URLs must consist of NSURL objects. // titles must consist of NSStrings, or be nil. If titles is nil, or if titles is a different // length than URLs, empty strings will be used for all titles. If URLs is nil, this method // returns without doing anything. You must declare an WebURLsWithTitlesPboardType data type // for pasteboard before invoking this method, or it will return without doing anything. + (void)writeURLs:(NSArray *)URLs andTitles:(NSArray *)titles toPasteboard:(NSPasteboard *)pasteboard; // Reads an array of NSURLs off the pasteboard. Returns nil if pasteboard does not contain // data of type WebURLsWithTitlesPboardType. This array consists of the URLs that correspond to // the titles returned from titlesFromPasteboard. + (NSArray *)URLsFromPasteboard:(NSPasteboard *)pasteboard; // Reads an array of NSStrings off the pasteboard. Returns nil if pasteboard does not contain // data of type WebURLsWithTitlesPboardType. This array consists of the titles that correspond to // the URLs returned from URLsFromPasteboard. + (NSArray *)titlesFromPasteboard:(NSPasteboard *)pasteboard; @end WebKit/mac/DefaultDelegates/������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024251�014300� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/DefaultDelegates/WebDefaultContextMenuDelegate.mm����������������������������������������0000644�0001750�0001750�00000017544�11032666713�022523� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebDefaultContextMenuDelegate.h" #import "WebDOMOperations.h" #import "WebDataSourcePrivate.h" #import "WebDefaultUIDelegate.h" #import "WebFrameInternal.h" #import "WebFrameView.h" #import "WebHTMLViewPrivate.h" #import "WebLocalizableStrings.h" #import "WebNSPasteboardExtras.h" #import "WebNSURLRequestExtras.h" #import "WebPolicyDelegate.h" #import "WebUIDelegate.h" #import "WebUIDelegatePrivate.h" #import "WebViewInternal.h" #import <Foundation/NSURLConnection.h> #import <Foundation/NSURLRequest.h> #import <WebCore/Editor.h> #import <WebCore/Frame.h> #import <WebCore/FrameLoader.h> #import <WebKit/DOM.h> #import <WebKit/DOMPrivate.h> #import <wtf/Assertions.h> @implementation WebDefaultUIDelegate (WebContextMenu) - (NSMenuItem *)menuItemWithTag:(int)tag target:(id)target representedObject:(id)representedObject { NSMenuItem *menuItem = [[[NSMenuItem alloc] init] autorelease]; [menuItem setTag:tag]; [menuItem setTarget:target]; // can be nil [menuItem setRepresentedObject:representedObject]; NSString *title = nil; SEL action = NULL; switch(tag) { case WebMenuItemTagCopy: title = UI_STRING("Copy", "Copy context menu item"); action = @selector(copy:); break; case WebMenuItemTagGoBack: title = UI_STRING("Back", "Back context menu item"); action = @selector(goBack:); break; case WebMenuItemTagGoForward: title = UI_STRING("Forward", "Forward context menu item"); action = @selector(goForward:); break; case WebMenuItemTagStop: title = UI_STRING("Stop", "Stop context menu item"); action = @selector(stopLoading:); break; case WebMenuItemTagReload: title = UI_STRING("Reload", "Reload context menu item"); action = @selector(reload:); break; case WebMenuItemTagSearchInSpotlight: title = UI_STRING("Search in Spotlight", "Search in Spotlight context menu item"); action = @selector(_searchWithSpotlightFromMenu:); break; case WebMenuItemTagSearchWeb: title = UI_STRING("Search in Google", "Search in Google context menu item"); action = @selector(_searchWithGoogleFromMenu:); break; case WebMenuItemTagLookUpInDictionary: title = UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item"); action = @selector(_lookUpInDictionaryFromMenu:); break; case WebMenuItemTagOpenFrameInNewWindow: title = UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item"); action = @selector(_openFrameInNewWindowFromMenu:); break; default: ASSERT_NOT_REACHED(); return nil; } if (title) [menuItem setTitle:title]; [menuItem setAction:action]; return menuItem; } - (void)appendDefaultItems:(NSArray *)defaultItems toArray:(NSMutableArray *)menuItems { ASSERT_ARG(menuItems, menuItems != nil); if ([defaultItems count] > 0) { ASSERT(![[menuItems lastObject] isSeparatorItem]); if (![[defaultItems objectAtIndex:0] isSeparatorItem]) { [menuItems addObject:[NSMenuItem separatorItem]]; NSEnumerator *e = [defaultItems objectEnumerator]; NSMenuItem *item; while ((item = [e nextObject]) != nil) { [menuItems addObject:item]; } } } } - (NSArray *)webView:(WebView *)wv contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems { // The defaultMenuItems here are ones supplied by the WebDocumentView protocol implementation. WebPDFView is // one case that has non-nil default items here. NSMutableArray *menuItems = [NSMutableArray array]; WebFrame *webFrame = [element objectForKey:WebElementFrameKey]; if ([[element objectForKey:WebElementIsSelectedKey] boolValue]) { // The Spotlight and Google items are implemented in WebView, and require that the // current document view conforms to WebDocumentText ASSERT([[[webFrame frameView] documentView] conformsToProtocol:@protocol(WebDocumentText)]); [menuItems addObject:[self menuItemWithTag:WebMenuItemTagSearchInSpotlight target:nil representedObject:element]]; [menuItems addObject:[self menuItemWithTag:WebMenuItemTagSearchWeb target:nil representedObject:element]]; [menuItems addObject:[NSMenuItem separatorItem]]; // FIXME 4184640: The Look Up in Dictionary item is only implemented in WebHTMLView, and so is present but // dimmed for other cases where WebElementIsSelectedKey is present. It would probably // be better not to include it in the menu if the documentView isn't a WebHTMLView, but that could break // existing clients that have code that relies on it being present (unlikely for clients outside of Apple, // but Safari has such code). [menuItems addObject:[self menuItemWithTag:WebMenuItemTagLookUpInDictionary target:nil representedObject:element]]; [menuItems addObject:[NSMenuItem separatorItem]]; [menuItems addObject:[self menuItemWithTag:WebMenuItemTagCopy target:nil representedObject:element]]; } else { WebView *wv = [webFrame webView]; if ([wv canGoBack]) { [menuItems addObject:[self menuItemWithTag:WebMenuItemTagGoBack target:wv representedObject:element]]; } if ([wv canGoForward]) { [menuItems addObject:[self menuItemWithTag:WebMenuItemTagGoForward target:wv representedObject:element]]; } if ([wv isLoading]) { [menuItems addObject:[self menuItemWithTag:WebMenuItemTagStop target:wv representedObject:element]]; } else { [menuItems addObject:[self menuItemWithTag:WebMenuItemTagReload target:wv representedObject:element]]; } if (webFrame != [wv mainFrame]) { [menuItems addObject:[self menuItemWithTag:WebMenuItemTagOpenFrameInNewWindow target:wv representedObject:element]]; } } // Add the default items at the end, if any, after a separator [self appendDefaultItems:defaultMenuItems toArray:menuItems]; return menuItems; } @end ������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.h��������������������������������������������������0000644�0001750�0001750�00000003323�10372606410�020365� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> @interface WebDefaultUIDelegate : NSObject { IBOutlet NSMenu *defaultMenu; } + (WebDefaultUIDelegate *)sharedUIDelegate; @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.h����������������������������������������������0000644�0001750�0001750�00000003562�10372606410�021314� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> /*! @class WebDefaultPolicyDelegate @discussion WebDefaultPolicyDelegate will be used as a WebView's default policy delegate. It can be subclassed to modify policies. */ @interface WebDefaultPolicyDelegate : NSObject + (WebDefaultPolicyDelegate *)sharedPolicyDelegate; @end ����������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.m��������������������������������������������������0000644�0001750�0001750�00000016435�11140347501�020377� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> #import <Foundation/NSURLRequest.h> #import <WebKit/WebDefaultUIDelegate.h> #import <WebKit/WebJavaScriptTextInputPanel.h> #import <WebKit/WebView.h> #import <WebKit/WebUIDelegatePrivate.h> #import <WebKit/DOM.h> #import "WebTypesInternal.h" @interface NSApplication (DeclarationStolenFromAppKit) - (void)_cycleWindowsReversed:(BOOL)reversed; @end @implementation WebDefaultUIDelegate static WebDefaultUIDelegate *sharedDelegate = nil; // Return a object with vanilla implementations of the protocol's methods // Note this feature relies on our default delegate being stateless. This // is probably an invalid assumption for the WebUIDelegate. // If we add any real functionality to this default delegate we probably // won't be able to use a singleton. + (WebDefaultUIDelegate *)sharedUIDelegate { if (!sharedDelegate) { sharedDelegate = [[WebDefaultUIDelegate alloc] init]; } return sharedDelegate; } - (WebView *)webView: (WebView *)wv createWebViewWithRequest:(NSURLRequest *)request windowFeatures:(NSDictionary *)features { // If the new API method doesn't exist, fallback to the old version of createWebViewWithRequest // for backwards compatability if (![[wv UIDelegate] respondsToSelector:@selector(webView:createWebViewWithRequest:windowFeatures:)] && [[wv UIDelegate] respondsToSelector:@selector(webView:createWebViewWithRequest:)]) return [[wv UIDelegate] webView:wv createWebViewWithRequest:request]; return nil; } - (void)webViewShow: (WebView *)wv { } - (void)webViewClose: (WebView *)wv { [[wv window] close]; } - (void)webViewFocus: (WebView *)wv { [[wv window] makeKeyAndOrderFront:wv]; } - (void)webViewUnfocus: (WebView *)wv { if ([[wv window] isKeyWindow] || [[[wv window] attachedSheet] isKeyWindow]) { [NSApp _cycleWindowsReversed:FALSE]; } } - (NSResponder *)webViewFirstResponder: (WebView *)wv { return [[wv window] firstResponder]; } - (void)webView: (WebView *)wv makeFirstResponder:(NSResponder *)responder { [[wv window] makeFirstResponder:responder]; } - (void)webView: (WebView *)wv setStatusText:(NSString *)text { } - (NSString *)webViewStatusText: (WebView *)wv { return nil; } - (void)webView: (WebView *)wv mouseDidMoveOverElement:(NSDictionary *)elementInformation modifierFlags:(NSUInteger)modifierFlags { } - (BOOL)webViewAreToolbarsVisible: (WebView *)wv { return NO; } - (void)webView: (WebView *)wv setToolbarsVisible:(BOOL)visible { } - (BOOL)webViewIsStatusBarVisible: (WebView *)wv { return NO; } - (void)webView: (WebView *)wv setStatusBarVisible:(BOOL)visible { } - (BOOL)webViewIsResizable: (WebView *)wv { return [[wv window] showsResizeIndicator]; } - (void)webView: (WebView *)wv setResizable:(BOOL)resizable { // FIXME: This doesn't actually change the resizability of the window, // only visibility of the indicator. [[wv window] setShowsResizeIndicator:resizable]; } - (void)webView: (WebView *)wv setFrame:(NSRect)frame { [[wv window] setFrame:frame display:YES]; } - (NSRect)webViewFrame: (WebView *)wv { NSWindow *window = [wv window]; return window == nil ? NSZeroRect : [window frame]; } - (void)webView: (WebView *)wv runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame { // FIXME: We want a default here, but that would add localized strings. } - (BOOL)webView: (WebView *)wv runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame { // FIXME: We want a default here, but that would add localized strings. return NO; } - (NSString *)webView: (WebView *)wv runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText initiatedByFrame:(WebFrame *)frame { WebJavaScriptTextInputPanel *panel = [[WebJavaScriptTextInputPanel alloc] initWithPrompt:prompt text:defaultText]; [panel showWindow:nil]; NSString *result; if ([NSApp runModalForWindow:[panel window]]) { result = [panel text]; } else { result = nil; } [[panel window] close]; [panel release]; return result; } - (void)webView: (WebView *)wv runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener { // FIXME: We want a default here, but that would add localized strings. } - (void)webView:(WebView *)sender printFrameView:(WebFrameView *)frameView { } - (BOOL)webView:(WebView *)webView shouldBeginDragForElement:(NSDictionary *)element dragImage:(NSImage *)dragImage mouseDownEvent:(NSEvent *)mouseDownEvent mouseDraggedEvent:(NSEvent *)mouseDraggedEvent { return YES; } - (NSUInteger)webView:(WebView *)webView dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo { return WebDragDestinationActionAny; } - (void)webView:(WebView *)webView willPerformDragDestinationAction:(WebDragDestinationAction)action forDraggingInfo:(id <NSDraggingInfo>)draggingInfo { } - (NSUInteger)webView:(WebView *)webView dragSourceActionMaskForPoint:(NSPoint)point { return WebDragSourceActionAny; } - (void)webView:(WebView *)webView willPerformDragSourceAction:(WebDragSourceAction)action fromPoint:(NSPoint)point withPasteboard:(NSPasteboard *)pasteboard { } - (void)webView:(WebView *)sender didDrawRect:(NSRect)rect { } - (void)webView:(WebView *)sender didScrollDocumentInFrameView:(WebFrameView *)frameView { } - (void)webView:(WebView *)sender willPopupMenu:(NSMenu *)menu { } - (void)webView:(WebView *)sender contextMenuItemSelected:(NSMenuItem *)item forElement:(NSDictionary *)element { } - (BOOL)webView:(WebView *)sender shouldReplaceUploadFile:(NSString *)path usingGeneratedFilename:(NSString **)filename { return NO; } - (NSString *)webView:(WebView *)sender generateReplacementFile:(NSString *)path { return nil; } @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/DefaultDelegates/WebDefaultEditingDelegate.h���������������������������������������������0000644�0001750�0001750�00000003274�10372606410�021440� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> @interface WebDefaultEditingDelegate : NSObject + (WebDefaultEditingDelegate *)sharedEditingDelegate; @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m����������������������������������������������0000644�0001750�0001750�00000011363�11066562160�021323� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebDefaultPolicyDelegate.h" #import "WebDataSource.h" #import "WebFrame.h" #import "WebPolicyDelegatePrivate.h" #import "WebViewInternal.h" #import <Foundation/NSURLConnection.h> #import <Foundation/NSURLRequest.h> #import <Foundation/NSURLResponse.h> #import <wtf/Assertions.h> @implementation WebDefaultPolicyDelegate static WebDefaultPolicyDelegate *sharedDelegate = nil; // Return a object with vanilla implementations of the protocol's methods // Note this feature relies on our default delegate being stateless + (WebDefaultPolicyDelegate *)sharedPolicyDelegate { if (!sharedDelegate) { sharedDelegate = [[WebDefaultPolicyDelegate alloc] init]; } return sharedDelegate; } - (void)webView: (WebView *)wv unableToImplementPolicyWithError:(NSError *)error frame:(WebFrame *)frame { LOG_ERROR("called unableToImplementPolicyWithError:%@ inFrame:%@", error, frame); } - (void)webView: (WebView *)wv decidePolicyForMIMEType:(NSString *)type request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id <WebPolicyDecisionListener>)listener; { if ([[request URL] isFileURL]) { BOOL isDirectory = NO; BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:[[request URL] path] isDirectory:&isDirectory]; if (exists && !isDirectory && [WebView canShowMIMEType:type]) [listener use]; else [listener ignore]; } else if ([WebView canShowMIMEType:type]) [listener use]; else [listener ignore]; } - (void)webView: (WebView *)wv decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id <WebPolicyDecisionListener>)listener { WebNavigationType navType = [[actionInformation objectForKey:WebActionNavigationTypeKey] intValue]; if ([WebView _canHandleRequest:request forMainFrame:frame == [wv mainFrame]]) { [listener use]; } else if (navType == WebNavigationTypePlugInRequest) { [listener use]; } else { // A file URL shouldn't fall through to here, but if it did, // it would be a security risk to open it. if (![[request URL] isFileURL]) { [[NSWorkspace sharedWorkspace] openURL:[request URL]]; } [listener ignore]; } } - (void)webView: (WebView *)wv decidePolicyForNewWindowAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request newFrameName:(NSString *)frameName decisionListener:(id <WebPolicyDecisionListener>)listener { [listener use]; } // Temporary SPI needed for <rdar://problem/3951283> can view pages from the back/forward cache that should be disallowed by Parental Controls - (BOOL)webView:(WebView *)webView shouldGoToHistoryItem:(WebHistoryItem *)item { return YES; } @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/DefaultDelegates/WebDefaultEditingDelegate.m���������������������������������������������0000644�0001750�0001750�00000010155�10653426417�021452� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> #import <WebKit/WebDefaultEditingDelegate.h> #import <WebKit/DOM.h> #import <WebKit/WebEditingDelegate.h> #import <WebKit/WebEditingDelegatePrivate.h> #import <WebKit/WebView.h> @implementation WebDefaultEditingDelegate static WebDefaultEditingDelegate *sharedDelegate = nil; + (WebDefaultEditingDelegate *)sharedEditingDelegate { if (!sharedDelegate) { sharedDelegate = [[WebDefaultEditingDelegate alloc] init]; } return sharedDelegate; } - (BOOL)webView:(WebView *)webView shouldShowDeleteInterfaceForElement:(DOMHTMLElement *)element { return NO; } - (BOOL)webView:(WebView *)webView shouldBeginEditingInDOMRange:(DOMRange *)range { return YES; } - (BOOL)webView:(WebView *)webView shouldEndEditingInDOMRange:(DOMRange *)range { return YES; } - (BOOL)webView:(WebView *)webView shouldInsertNode:(DOMNode *)node replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action { return YES; } - (BOOL)webView:(WebView *)webView shouldInsertText:(NSString *)text replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action { return YES; } - (BOOL)webView:(WebView *)webView shouldDeleteDOMRange:(DOMRange *)range { return YES; } - (BOOL)webView:(WebView *)webView shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag { return YES; } - (BOOL)webView:(WebView *)webView shouldApplyStyle:(DOMCSSStyleDeclaration *)style toElementsInDOMRange:(DOMRange *)range { return YES; } - (BOOL)webView:(WebView *)webView shouldMoveRangeAfterDelete:(DOMRange *)range replacingRange:(DOMRange *)rangeToBeReplaced { return YES; } - (BOOL)webView:(WebView *)webView shouldChangeTypingStyle:(DOMCSSStyleDeclaration *)currentStyle toStyle:(DOMCSSStyleDeclaration *)proposedStyle { return YES; } - (BOOL)webView:(WebView *)webView doCommandBySelector:(SEL)selector { return NO; } - (void)webView:(WebView *)webView didWriteSelectionToPasteboard:(NSPasteboard *)pasteboard { } - (void)webView:(WebView *)webView didSetSelectionTypesForPasteboard:(NSPasteboard *)pasteboard { } - (void)webViewDidBeginEditing:(NSNotification *)notification { } - (void)webViewDidChange:(NSNotification *)notification { } - (void)webViewDidEndEditing:(NSNotification *)notification { } - (void)webViewDidChangeTypingStyle:(NSNotification *)notification { } - (void)webViewDidChangeSelection:(NSNotification *)notification { } - (NSUndoManager *)undoManagerForWebView:(WebView *)webView { return nil; } @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/DefaultDelegates/WebDefaultContextMenuDelegate.h�����������������������������������������0000644�0001750�0001750�00000003260�10372606410�022321� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> #import <WebKit/WebDefaultUIDelegate.h> @interface WebDefaultUIDelegate (WebContextMenu) @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebKit.order�����������������������������������������������������������������������������0000644�0001750�0001750�00000376350�11205135350�013332� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������+[WebPreferences initialize] __ZL23cacheModelForMainBundlev __ZL8containsPKPKciS0_ _WebKitLinkedOnOrAfter _WebKitLinkTimeVersion +[WebPreferences standardPreferences] -[WebPreferences initWithIdentifier:] +[WebPreferences(WebInternal) _IBCreatorID] +[WebPreferences(WebPrivate) _getInstanceForIdentifier:] +[WebPreferences(WebPrivate) _setInstance:forIdentifier:] -[WebPreferences(WebPrivate) _postPreferencesChangesNotification] -[WebPreferences setAutosaves:] +[NSString(WebKitExtras) _webkit_localCacheDirectoryWithBundleIdentifier:] -[NSString(WebKitExtras) _web_stringByAbbreviatingWithTildeInPath] +[WebIconDatabase delayDatabaseCleanup] +[WebIconDatabase sharedIconDatabase] -[WebIconDatabase init] -[WebIconDatabase(WebInternal) _startUpIconDatabase] __ZL13defaultClientv -[WebIconDatabase(WebInternal) _databaseDirectory] -[WebPreferences privateBrowsingEnabled] -[WebPreferences _boolValueForKey:] -[WebPreferences _integerValueForKey:] -[WebPreferences _valueForKey:] +[WebView initialize] _InitWebCoreSystemInterface +[WebView(WebPrivate) _registerViewClass:representationClass:forURLScheme:] +[WebView(WebPrivate) _generatedMIMETypeForURLScheme:] +[WebView registerViewClass:representationClass:forMIMEType:] +[WebFrameView(WebInternal) _viewTypesAllowImageTypeOmission:] +[WebHTMLView initialize] +[WebHTMLView(WebPrivate) _insertablePasteboardTypes] +[WebHTMLView(WebPrivate) _selectionPasteboardTypes] +[WebHTMLView(WebPrivate) supportedNonImageMIMETypes] +[WebHTMLRepresentation supportedNonImageMIMETypes] __ZN21WebIconDatabaseClient13performImportEv __Z21importToWebCoreFormatv +[ThreadEnabler enableThreading] -[ThreadEnabler threadEnablingSelector:] __ZL20objectFromPathForKeyP8NSStringP11objc_object __ZL11stringArrayRKN3WTF7HashSetIN7WebCore6StringENS1_10StringHashENS_10HashTraitsIS2_EEEE +[WebPDFView supportedMIMETypes] +[WebPDFRepresentation supportedMIMETypes] +[WebPDFRepresentation postScriptMIMETypes] +[WebDataSource(WebInternal) _repTypesAllowImageTypeOmission:] _WebLocalizedString -[NSURL(WebNSURLExtras) _web_originalDataAsString] -[NSURL(WebNSURLExtras) _web_originalData] -[WebIconDatabase retainIconForURL:] -[WebIconDatabase(WebPendingPublic) isEnabled] +[WebView registerURLSchemeAsLocal:] +[NSURL(WebNSURLExtras) _web_URLWithDataAsString:] +[NSURL(WebNSURLExtras) _web_URLWithDataAsString:relativeToURL:] -[NSString(WebKitExtras) _webkit_stringByTrimmingWhitespace] +[NSURL(WebNSURLExtras) _web_URLWithData:relativeToURL:] -[NSURL(WebNSURLExtras) _webkit_canonicalize] _WKNSURLProtocolClassForRequest -[WebView(WebPrivate) _initWithFrame:frameName:groupName:usesDocumentViews:] +[WebViewPrivate initialize] -[WebViewPrivate .cxx_construct] -[WebViewPrivate init] -[WebView(WebPrivate) _commonInitializationWithFrameName:groupName:usesDocumentViews:] -[WebPreferences(WebPrivate) willAddToWebView] -[WebFrameView initWithFrame:] +[WebViewFactory createSharedFactory] +[WebKeyGenerator createSharedGenerator] -[WebClipView initWithFrame:] -[WebFrameView visibleRect] -[WebFrameView webFrame] _WebKitInitializeLoggingChannelsIfNecessary _initializeLogChannel +[WebHistoryItem initialize] +[WebHistoryItem(WebInternal) initWindowWatcherIfNecessary] __Z36WebKitInitializeDatabasesIfNecessaryv __ZN24WebDatabaseTrackerClient30sharedWebDatabaseTrackerClientEv __ZN24WebDatabaseTrackerClientC1Ev __ZN24WebDatabaseTrackerClientC2Ev __ZL47WebKitInitializeApplicationCachePathIfNecessaryv __ZN15WebChromeClientC1EP7WebView __ZN15WebChromeClientC2EP7WebView __ZN20WebContextMenuClientC1EP7WebView __ZN20WebContextMenuClientC2EP7WebView __ZN15WebEditorClientC1EP7WebView __ZN15WebEditorClientC2EP7WebView __ZN13WebDragClientC1EP7WebView __ZN13WebDragClientC2EP7WebView __ZN18WebInspectorClientC1EP7WebView __ZN18WebInspectorClientC2EP7WebView -[WebView preferences] -[WebPreferences(WebPrivate) _localStorageDatabasePath] -[WebPreferences _stringValueForKey:] +[WebFrame(WebInternal) _createMainFrameWithPage:frameName:frameView:] +[WebFrame(WebInternal) _createFrameWithPage:frameName:frameView:ownerElement:] __Z3kitPN7WebCore4PageE -[WebFrame(WebInternal) _initWithWebFrameView:webView:] -[WebFramePrivate setWebFrameView:] -[WebFrameView(WebInternal) _setWebFrame:] __ZN20WebFrameLoaderClientC1EP8WebFrame __ZN20WebFrameLoaderClientC2EP8WebFrame __ZN20WebFrameLoaderClient20createDocumentLoaderERKN7WebCore15ResourceRequestERKNS0_14SubstituteDataE __ZN20WebDocumentLoaderMacC1ERKN7WebCore15ResourceRequestERKNS0_14SubstituteDataE __ZN20WebDocumentLoaderMacC2ERKN7WebCore15ResourceRequestERKNS0_14SubstituteDataE -[WebDataSource(WebInternal) _initWithDocumentLoader:] +[WebDataSourcePrivate initialize] __Z10getWebViewP8WebFrame __Z4coreP8WebFrame __ZN20WebDocumentLoaderMac13setDataSourceEP13WebDataSourceP7WebView __ZN20WebDocumentLoaderMac16retainDataSourceEv -[WebView resourceLoadDelegate] -[WebView downloadDelegate] __ZN20WebDocumentLoaderMac13attachToFrameEv __ZN20WebFrameLoaderClient22provisionalLoadStartedEv -[WebFrameView(WebInternal) _scrollView] __ZN20WebFrameLoaderClient25setMainFrameDocumentReadyEb -[WebView(WebPendingPublic) setMainFrameDocumentReady:] __ZN20WebFrameLoaderClient17setCopiesOnScrollEv __ZN20WebFrameLoaderClient31prepareForDataSourceReplacementEv -[WebFrame(WebInternal) _dataSource] __ZN20WebFrameLoaderClient31transitionToCommittedForNewPageEv __ZNK20WebDocumentLoaderMac10dataSourceEv -[WebDataSource(WebPrivate) _responseMIMEType] -[WebDataSource response] +[WebFrameView(WebInternal) _viewClassForMIMEType:] +[WebView(WebPrivate) _viewClass:andRepresentationClass:forMIMEType:] -[NSDictionary(WebNSDictionaryExtras) _webkit_objectForMIMEType:] +[WebHTMLView(WebPrivate) unsupportedTextMIMETypes] -[WebView removePluginInstanceViewsFor:] -[WebView(WebPrivate) _usesDocumentViews] -[WebFrameView(WebInternal) _makeDocumentViewForDataSource:] -[WebDataSource representation] -[WebHTMLView initWithFrame:] +[WebHTMLViewPrivate initialize] -[WebPluginController initWithDocumentView:] -[WebFrameView(WebInternal) _setDocumentView:] -[WebFrameView(WebInternal) _webView] -[WebFrame webView] __Z4coreP7WebView -[WebView(WebPrivate) page] -[WebDynamicScrollBarsView(WebInternal) setSuppressLayout:] -[WebHTMLView viewWillMoveToSuperview:] -[WebHTMLView(WebHTMLViewFileInternal) _removeSuperviewObservers] -[WebHTMLView setNeedsDisplay:] -[WebHTMLView visibleRect] -[WebClipView hasAdditionalClip] -[WebFrame(WebInternal) _getVisibleRect:] -[WebHTMLView viewDidMoveToSuperview] -[WebHTMLView addSuperviewObservers] -[WebHTMLView isFlipped] -[WebDynamicScrollBarsView(WebInternal) reflectScrolledClipView:] -[WebFrame(WebInternal) _updateBackgroundAndUpdatesWhileOffscreen] -[WebView drawsBackground] -[WebView(WebPrivate) backgroundColor] __Z3kitPN7WebCore5FrameE -[WebFrame frameView] -[WebFrameView documentView] -[WebView shouldUpdateWhileOffscreen] -[WebFrameView(WebInternal) _install] -[WebDynamicScrollBarsView(WebInternal) scrollingModes:vertical:] -[WebHTMLView setDataSource:] -[WebPluginController setDataSource:] -[WebHTMLView addMouseMovedObserver] -[WebHTMLView(WebHTMLViewFileInternal) _isTopHTMLView] -[WebHTMLView(WebHTMLViewFileInternal) _topHTMLView] -[WebDataSource(WebInternal) _webView] -[WebDataSource webFrame] -[WebView mainFrame] -[WebHTMLView(WebHTMLViewFileInternal) _webView] -[WebView(WebPrivate) _dashboardBehavior:] __ZN15WebEditorClient23clearUndoRedoOperationsEv __ZN20WebFrameLoaderClient15finishedLoadingEPN7WebCore14DocumentLoaderE -[WebDataSource(WebInternal) _finishedLoading] __ZNK7WebCore17FrameLoaderClient23shouldUsePluginDocumentERKNS_6StringE _WKInitializeMaximumHTTPConnectionCountPerHost __ZNK20WebFrameLoaderClient17overrideMediaTypeEv -[WebView mediaStyle] __ZN15WebChromeClient22createHTMLParserQuirksEv __ZNK15WebChromeClient19contentsSizeChangedEPN7WebCore5FrameERKNS0_7IntSizeE __ZN20WebFrameLoaderClient24documentElementAvailableEv __ZN20WebFrameLoaderClient18frameLoadCompletedEv __ZN20WebFrameLoaderClient21forceLayoutForNonHTMLEv -[WebDataSource(WebInternal) _isDocumentHTML] +[WebView canShowMIMETypeAsHTML:] +[WebFrameView(WebInternal) _canShowMIMETypeAsHTML:] -[WebView _realZoomMultiplierIsTextOnly] -[WebView _realZoomMultiplier] -[WebView _setZoomMultiplier:isTextOnly:] -[WebView(WebPendingPublic) scheduleInRunLoop:forMode:] -[WebView(AllWebViews) _addToAllWebViewsSet] -[WebView setGroupName:] -[WebView(WebPrivate) _registerDraggedTypes] +[NSPasteboard(WebExtras) _web_dragTypesForURL] -[WebIconDatabase(WebInternal) _resetCachedWebPreferences:] +[WebView(WebFileInternal) _preferencesChangedNotification:] -[WebPreferences cacheModel] +[WebView(WebFileInternal) _didSetCacheModel] +[WebView(WebFileInternal) _setCacheModel:] _WKCopyFoundationCacheDirectory _WebMemorySize _initCapabilities _WebVolumeFreeSize -[WebView(WebPrivate) _preferencesChangedNotification:] -[WebPreferences(WebPrivate) _useSiteSpecificSpoofing] -[WebPreferences cursiveFontFamily] __ZNK20WebFrameLoaderClient11hasHTMLViewEv -[WebPreferences defaultFixedFontSize] -[WebPreferences defaultFontSize] -[WebPreferences defaultTextEncodingName] -[WebPreferences(WebPrivate) usesEncodingDetector] -[WebPreferences fantasyFontFamily] -[WebPreferences fixedFontFamily] -[WebPreferences(WebPrivate) _forceFTPDirectoryListings] -[WebPreferences(WebPrivate) _ftpDirectoryTemplatePath] -[WebPreferences isJavaEnabled] -[WebPreferences isJavaScriptEnabled] -[WebPreferences(WebPrivate) isWebSecurityEnabled] -[WebPreferences(WebPrivate) allowUniversalAccessFromFileURLs] -[WebPreferences javaScriptCanOpenWindowsAutomatically] -[WebPreferences minimumFontSize] -[WebPreferences minimumLogicalFontSize] -[WebPreferences arePlugInsEnabled] -[WebPreferences(WebPrivate) databasesEnabled] -[WebPreferences(WebPrivate) localStorageEnabled] -[WebPreferences sansSerifFontFamily] -[WebPreferences serifFontFamily] -[WebPreferences standardFontFamily] -[WebPreferences loadsImagesAutomatically] -[WebPreferences shouldPrintBackgrounds] -[WebPreferences(WebPrivate) textAreasAreResizable] -[WebPreferences(WebPrivate) shrinksStandaloneImagesToFit] -[WebPreferences(WebPrivate) editableLinkBehavior] __Z4core26WebKitEditableLinkBehavior -[WebPreferences(WebPrivate) textDirectionSubmenuInclusionBehavior] __Z4core40WebTextDirectionSubmenuInclusionBehavior -[WebPreferences(WebPrivate) isDOMPasteAllowed] -[WebView(WebPrivate) usesPageCache] -[WebPreferences usesPageCache] -[WebPreferences(WebPrivate) showsURLsInToolTips] -[WebPreferences(WebPrivate) developerExtrasEnabled] -[WebPreferences(WebPrivate) authorAndUserStylesEnabled] -[WebPreferences(WebPrivate) applicationChromeModeEnabled] -[WebPreferences userStyleSheetEnabled] -[WebView(WebPrivate) _needsAdobeFrameReloadingQuirk] _WKAppVersionCheckLessThan -[WebView(WebPrivate) _needsKeyboardEventDisambiguationQuirks] -[WebPreferences(WebPrivate) webArchiveDebugModeEnabled] -[WebPreferences(WebPrivate) offlineWebApplicationCacheEnabled] -[WebPreferences(WebPrivate) zoomsTextOnly] -[WebView setMaintainsBackForwardList:] -[WebView setUIDelegate:] -[WebView(WebPrivate) setMemoryCacheDelegateCallsEnabled:] -[WebView backForwardList] __Z3kitPN7WebCore15BackForwardListE __ZL16backForwardListsv __ZNK3WTF7HashMapIPN7WebCore15BackForwardListEP18WebBackForwardListNS_7PtrHashIS3_EENS_10HashTraitsIS3_EENS8_IS5_EEE3getERKS3_ +[WebBackForwardList initialize] -[WebBackForwardList(WebBackForwardListInternal) initWithBackForwardList:] __Z4coreP18WebBackForwardList __ZN3WTF7HashMapIPN7WebCore15BackForwardListEP18WebBackForwardListNS_7PtrHashIS3_EENS_10HashTraitsIS3_EENS8_IS5_EEE3setERKS3_RK __ZN3WTF9HashTableIPN7WebCore15BackForwardListESt4pairIS3_P18WebBackForwardListENS_18PairFirstExtractorIS7_EENS_7PtrHashIS3_EEN -[WebBackForwardList setCapacity:] -[WebView setFrameLoadDelegate:] -[WebView(WebPrivate) _cacheFrameLoadDelegateImplementations] -[WebView setPolicyDelegate:] -[WebView(WebViewEditing) setEditingDelegate:] -[WebView(WebViewEditing) registerForEditingDelegateNotification:selector:] -[WebView setResourceLoadDelegate:] -[WebView(WebPrivate) _cacheResourceLoadDelegateImplementations] -[WebView setDownloadDelegate:] -[WebView setApplicationNameForUserAgent:] -[WebView setHostWindow:] -[WebView(WebPrivate) _setFormDelegate:] -[WebView setShouldUpdateWhileOffscreen:] -[WebIconDatabase defaultIconWithSize:] +[WebStringTruncator initialize] +[WebStringTruncator centerTruncateString:toWidth:withFont:] __ZL14fontFromNSFontP6NSFont _WKGetGlyphsForCharacters _WKGetGlyphTransformedAdvances -[WebView viewWillMoveToSuperview:] -[WebView removeSizeObservers] -[WebView viewDidMoveToSuperview] -[WebView addSizeObserversForWindow:] -[WebFrameView setFrameSize:] -[WebView(WebPrivate) isFlipped] -[WebFrame dataSource] -[WebView viewWillMoveToWindow:] _WKSetNSWindowShouldPostEventNotifications -[WebView removeWindowObservers] -[WebView(WebPrivate) _boundsChanged] -[WebView addWindowObserversForWindow:] -[WebHTMLView viewWillMoveToWindow:] -[WebHTMLView(WebHTMLViewFileInternal) _removeMouseMovedObserverUnconditionally] -[WebHTMLView(WebHTMLViewFileInternal) _removeWindowObservers] -[WebHTMLView(WebHTMLViewFileInternal) _cancelUpdateMouseoverTimer] -[WebHTMLView(WebHTMLViewFileInternal) _cancelUpdateFocusedAndActiveStateTimer] -[WebHTMLView(WebPrivate) _pluginController] -[WebPluginController stopAllPlugins] -[WebHTMLView viewDidMoveToWindow] -[WebHTMLView(WebPrivate) _stopAutoscrollTimer] -[WebHTMLView addWindowObservers] _WKWindowWillOrderOnScreenNotification -[WebHTMLView(WebPrivate) _frameOrBoundsChanged] -[WebPluginController startAllPlugins] -[WebFrameView viewDidMoveToWindow] -[WebView viewDidMoveToWindow] -[NSString(WebKitExtras) _web_widthWithFont:] _canUseFastRenderer -[WebFrame provisionalDataSource] -[WebIconDatabase iconForURL:withSize:] -[WebIconDatabase iconForURL:withSize:cache:] -[NSString(WebNSURLExtras) _webkit_isFileURL] __Z13webGetNSImagePN7WebCore5ImageE6CGSize -[WebHTMLView(WebPrivate) hitTest:] -[WebView setNextKeyView:] -[WebFrameView setNextKeyView:] -[NSView(WebExtras) _web_superviewOfClass:] -[WebFrame loadRequest:] __ZN20WebFrameLoaderClient9userAgentERKN7WebCore4KURLE -[WebView(WebViewInternal) _userAgentForURL:] +[WebView(WebPrivate) _standardUserAgentWithApplicationName:] +[NSUserDefaults(WebNSUserDefaultsExtras) _webkit_preferredLanguageCode] +[NSUserDefaults(WebNSUserDefaultsExtras) _webkit_ensureAndLockPreferredLanguageLock] _makeLock -[NSString(WebNSUserDefaultsPrivate) _webkit_HTTPStyleLanguageCode] _WKCopyCFLocalizationPreferredName +[NSUserDefaults(WebNSUserDefaultsExtras) _webkit_addDefaultsChangeObserver] _addDefaultsChangeObserver __ZN20WebFrameLoaderClient17cancelPolicyCheckEv __ZN20WebFrameLoaderClient39dispatchDecidePolicyForNavigationActionEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEERKNS0_16Navig -[WebView(WebPrivate) _policyDelegateForwarder] +[WebDefaultPolicyDelegate sharedPolicyDelegate] -[_WebSafeForwarder initWithTarget:defaultTarget:catchExceptions:] __ZN20WebFrameLoaderClient19setUpPolicyListenerEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEE +[WebFramePolicyListener initialize] -[WebFramePolicyListener initWithWebCoreFrame:] __ZNK20WebFrameLoaderClient16actionDictionaryERKN7WebCore16NavigationActionEN3WTF10PassRefPtrINS0_9FormStateEEE -[_WebSafeForwarder methodSignatureForSelector:] -[_WebSafeForwarder forwardInvocation:] +[WebView(WebPrivate) _canHandleRequest:] +[WebView(WebPrivate) _canHandleRequest:forMainFrame:] -[WebFramePolicyListener use] -[WebFramePolicyListener receivedPolicyDecision:] __ZN20WebFrameLoaderClient21receivedPolicyDecisonEN7WebCore12PolicyActionE __ZNK20WebFrameLoaderClient16canHandleRequestERKN7WebCore15ResourceRequestE __ZN15WebChromeClient30canRunBeforeUnloadConfirmPanelEv -[WebView UIDelegate] __ZN20WebFrameLoaderClient27willChangeEstimatedProgressEv -[WebView(WebPrivate) _willChangeValueForKey:] -[WebView(WebPrivate) observationInfo] __ZN20WebFrameLoaderClient31postProgressStartedNotificationEv __ZN20WebFrameLoaderClient26didChangeEstimatedProgressEv -[WebView(WebPrivate) _didChangeValueForKey:] __ZN20WebFrameLoaderClient31dispatchDidStartProvisionalLoadEv -[WebView(WebPrivate) _didStartProvisionalLoadForFrame:] -[WebView(WebPrivate) _willChangeBackForwardKeys] __Z42WebViewGetFrameLoadDelegateImplementationsP7WebView __Z21CallFrameLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_ -[WebDataSource isLoading] -[WebDataSource request] -[NSURL(WebNSURLExtras) _web_hostString] -[NSURL(WebNSURLExtras) _web_hostData] -[NSURL(WebNSURLExtras) _web_dataForURLComponentType:] -[NSURL(WebNSURLExtras) _web_schemeData] -[NSData(WebNSDataExtras) _web_isCaseInsensitiveEqualToCString:] -[NSString(WebNSURLExtras) _web_decodeHostName] -[NSString(WebNSURLExtras) _web_mapHostNameWithRange:encode:makeString:] -[NSString(WebKitExtras) _webkit_isCaseInsensitiveEqualToString:] -[WebDataSource unreachableURL] -[NSURL(WebNSURLExtras) _web_userVisibleString] __ZL12mapHostNamesP8NSStringa __ZN3WTF6VectorItLm2048EE6shrinkEm -[WebView mainFrameURL] -[WebBackForwardList currentItem] __Z3kitPN7WebCore11HistoryItemE -[WebView(WebPrivate) setDefersCallbacks:] __ZN20WebFrameLoaderClient32assignIdentifierToInitialRequestEmPN7WebCore14DocumentLoaderERKNS0_15ResourceRequestE __Z45WebViewGetResourceLoadDelegateImplementationsP7WebView __Z24CallResourceLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_S0_ -[WebView(WebViewInternal) _addObject:forIdentifier:] __ZN3WTF7HashMapImNS_9RetainPtrIP11objc_objectEENS_7IntHashImEENS_10HashTraitsImEENS7_IS4_EEE3setERKmRKS4_ -[WebFramePolicyListener dealloc] __ZN7WebCore19ResourceRequestBaseD2Ev -[WebView(WebIBActions) canGoBack] -[WebView(WebIBActions) canGoForward] -[WebFrameView isOpaque] -[WebHTMLView windowDidBecomeKey:] _WKMouseMovedNotification -[WebHTMLView(WebPrivate) _updateFocusedAndActiveState] -[WebHTMLView(WebInternal) _frame] -[WebView _updateFocusedAndActiveStateForFrame:] -[WebHTMLView(WebInternal) _isResigningFirstResponder] -[WebHTMLView _windowChangedKeyState] -[WebHTMLView _updateControlTints] -[WebHTMLView windowWillOrderOnScreen:] -[WebView(WebPrivate) viewWillDraw] -[WebFrameView drawRect:] -[WebHTMLView(WebPrivate) _recursiveDisplayAllDirtyWithLockFocus:visRect:] -[WebHTMLView(WebPrivate) _setAsideSubviews] -[WebHTMLView(WebPrivate) _restoreSubviews] -[WebHTMLView viewWillMoveToHostWindow:] -[NSArray(WebHTMLView) _web_makePluginViewsPerformSelector:withObject:] -[WebHTMLView viewDidMoveToHostWindow] -[WebPreferences(WebPrivate) setRespectStandardStyleKeyEquivalents:] -[WebPreferences _setBoolValue:forKey:] -[NSMutableDictionary(WebNSDictionaryExtras) _webkit_setBool:forKey:] +[NSUserDefaults(WebNSUserDefaultsExtras) _webkit_defaultsDidChange] +[WebView(WebFileInternal) _cacheModel] -[WebPreferences setPrivateBrowsingEnabled:] -[WebPreferences(WebPrivate) setDOMPasteAllowed:] -[WebPreferences setCacheModel:] -[WebPreferences _setIntegerValue:forKey:] -[WebPreferences(WebPrivate) setAutomaticallyDetectsCacheModel:] +[WebPreferences(WebPrivate) _setInitialDefaultTextEncodingToSystemEncoding] +[WebPreferences(WebPrivate) _systemCFStringEncoding] _WKGetWebDefaultCFStringEncoding -[WebHistory init] +[WebHistoryPrivate initialize] -[WebHistoryPrivate init] -[WebHistory setHistoryAgeInDaysLimit:] -[WebHistoryPrivate setHistoryAgeInDaysLimit:] -[WebHistory setHistoryItemLimit:] -[WebHistoryPrivate setHistoryItemLimit:] -[WebHistory loadFromURL:error:] -[WebHistoryPrivate loadFromURL:collectDiscardedItemsInto:error:] -[WebHistoryPrivate loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:] +[WebHistory setOptionalSharedHistory:] +[WebIconDatabase allowDatabaseCleanup] -[WebBackForwardList dealloc] __ZL9setCursorP8NSWindowP13objc_selector7CGPoint -[NSWindow(BorderViewAccess) _web_borderView] __ZN20WebFrameLoaderClient23dispatchWillSendRequestEPN7WebCore14DocumentLoaderEmRNS0_15ResourceRequestERKNS0_16ResourceResponse __ZN20WebDocumentLoaderMac17increaseLoadCountEm __ZNK3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E8containsImNS_22IdentityHashTranslatorImm __ZN3WTF7HashSetImNS_7IntHashImEENS_10HashTraitsImEEE3addERKm __ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E6expandEv __ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E6rehashEi __ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E13allocateTableEi __ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E15deallocateTableEPmi -[WebView(WebViewInternal) _objectForIdentifier:] __ZNK3WTF7HashMapImNS_9RetainPtrIP11objc_objectEENS_7IntHashImEENS_10HashTraitsImEENS7_IS4_EEE3getERKm __Z24CallResourceLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_S0_S0_S0_ __ZN3WTF9HashTableIN7WebCore12AtomicStringESt4pairIS2_NS1_6StringEENS_18PairFirstExtractorIS5_EENS1_15CaseFoldingHashENS_14Pair __ZN3WTF6VectorIN7WebCore6StringELm0EEaSERKS3_ __ZN3WTF6VectorIN7WebCore6StringELm0EE6shrinkEm __ZNK20WebFrameLoaderClient32representationExistsForURLSchemeERKN7WebCore6StringE +[WebView(WebPrivate) _representationExistsForURLScheme:] _WKCreateNSURLConnectionDelegateProxy __ZN20WebFrameLoaderClient26shouldUseCredentialStorageEPN7WebCore14DocumentLoaderEm __ZL29_updateMouseoverTimerCallbackP16__CFRunLoopTimerPv -[WebHTMLView(WebPrivate) _updateMouseoverWithFakeEvent] -[WebHTMLView(WebPrivate) _updateMouseoverWithEvent:] -[WebView estimatedProgress] -[WebIconDatabase defaultIconForURL:withSize:] +[WebView(WebPrivate) _shouldUseFontSmoothing] +[WebView(WebPrivate) _setShouldUseFontSmoothing:] -[NSString(WebKitExtras) _web_drawDoubledAtPoint:withTopColor:bottomColor:font:] -[NSString(WebKitExtras) _web_drawAtPoint:font:textColor:] _WKCGContextGetShouldSmoothFonts _WKSetCGFontRenderingMode -[NSString(WebKitExtras) _webkit_hasCaseInsensitivePrefix:] +[NSURL(WebNSURLExtras) _web_URLWithUserTypedString:] +[NSURL(WebNSURLExtras) _web_URLWithUserTypedString:relativeToURL:] -[WebHistoryPrivate historyItemLimit] -[WebHistoryPrivate ageLimitDate] -[WebHistoryPrivate historyAgeInDaysLimit] -[WebHistoryItem(WebInternal) initFromDictionaryRepresentation:] -[NSDictionary(WebNSDictionaryExtras) _webkit_stringForKey:] -[WebHistoryItem(WebInternal) initWithURLString:title:displayTitle:lastVisitedTimeInterval:] -[WebHistoryItem(WebInternal) initWithWebCoreHistoryItem:] __ZL19historyItemWrappersv __ZN3WTF7HashMapIPN7WebCore11HistoryItemEP14WebHistoryItemNS_7PtrHashIS3_EENS_10HashTraitsIS3_EENS8_IS5_EEE3setERKS3_RKS5_ __ZN3WTF9HashTableIPN7WebCore11HistoryItemESt4pairIS3_P14WebHistoryItemENS_18PairFirstExtractorIS7_EENS_7PtrHashIS3_EENS_14Pair -[NSDictionary(WebNSDictionaryExtras) _webkit_intForKey:] -[NSDictionary(WebNSDictionaryExtras) _webkit_numberForKey:] -[NSDictionary(WebNSDictionaryExtras) _webkit_boolForKey:] -[NSDictionary(WebNSDictionaryExtras) _webkit_arrayForKey:] -[NSArray(WebNSArrayExtras) _webkit_numberAtIndex:] -[WebHistoryItem URLString] -[WebHistoryItem lastVisitedTimeInterval] -[WebHistoryPrivate addItem:discardDuplicate:] -[WebHistoryPrivate addItemToDateCaches:] -[WebHistoryPrivate findKey:forDay:] __ZNK3WTF9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsI __ZN3WTF7HashMapIxNS_9RetainPtrI14NSMutableArrayEENS_7IntHashIyEENS_10HashTraitsIxEENS6_IS3_EEE3setERKxRKS3_ -[WebHistoryPrivate insertItem:forDateKey:] __ZNK3WTF7HashMapIxNS_9RetainPtrI14NSMutableArrayEENS_7IntHashIyEENS_10HashTraitsIxEENS6_IS3_EEE3getERKx -[NSArray(WebNSArrayExtras) _webkit_stringAtIndex:] +[WebCoreStatistics setShouldPrintExceptions:] -[WebHistory itemForURL:] -[WebHistoryPrivate itemForURL:] -[WebHistoryPrivate itemForURLString:] __ZN21WebIconDatabaseClient28dispatchDidAddIconForPageURLERKN7WebCore6StringE -[WebIconDatabase(WebInternal) _sendNotificationForURL:] -[NSNotificationCenter(WebNSNotificationCenterExtras) postNotificationOnMainThreadWithName:object:userInfo:] -[NSNotificationCenter(WebNSNotificationCenterExtras) postNotificationOnMainThreadWithName:object:userInfo:waitUntilDone:] +[NSNotificationCenter(WebNSNotificationCenterExtras) _postNotificationName:] __ZN20WebFrameLoaderClient31dispatchDecidePolicyForMIMETypeEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEERKNS0_6StringERKNS0_1 +[WebView canShowMIMEType:] __ZNK20WebFrameLoaderClient15canShowMIMETypeERKN7WebCore6StringE __ZN20WebFrameLoaderClient26dispatchDidReceiveResponseEPN7WebCore14DocumentLoaderEmRKNS0_16ResourceResponseE __Z24CallResourceLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_S0_S0_ __ZN20WebFrameLoaderClient17dispatchWillCloseEv __ZN20WebFrameLoaderClient18makeRepresentationEPN7WebCore14DocumentLoaderE -[WebDataSource(WebInternal) _makeRepresentation] +[WebDataSource(WebFileInternal) _representationClassForMIMEType:] -[WebHTMLRepresentation init] -[WebDataSource(WebFileInternal) _setRepresentation:] -[WebHTMLRepresentation setDataSource:] __ZN20WebDocumentLoaderMac15detachFromFrameEv __ZN20WebDocumentLoaderMac17releaseDataSourceEv __Z26WKNotifyHistoryItemChangedv __ZN20WebFrameLoaderClient19updateGlobalHistoryEv +[WebHistory optionalSharedHistory] -[WebHistory(WebInternal) _visitedURL:withTitle:method:wasFailure:] -[WebHistoryPrivate visitedURL:withTitle:] -[WebHistoryPrivate removeItemFromDateCaches:] __ZN3WTF9HashTableIxSt4pairIxNS_9RetainPtrI14NSMutableArrayEEENS_18PairFirstExtractorIS5_EENS_7IntHashIyEENS_14PairHashTraitsIN -[WebHistoryItem(WebInternal) _visitedWithTitle:] __Z4coreP14WebHistoryItem -[WebHistory _sendNotification:entries:] -[WebHistoryItem originalURLString] __ZN20WebFrameLoaderClient32updateGlobalHistoryRedirectLinksEv -[WebDynamicScrollBarsView(WebInternal) setScrollBarsSuppressed:repaintOnUnsuppress:] -[WebDataSource dealloc] -[WebDataSourcePrivate dealloc] __ZN20WebDocumentLoaderMac16detachDataSourceEv __ZN20WebDocumentLoaderMacD0Ev __ZN15WebChromeClient16setStatusbarTextERKN7WebCore6StringE __Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_object __ZN20WebFrameLoaderClient13committedLoadEPN7WebCore14DocumentLoaderEPKci -[WebDataSource(WebInternal) _receivedData:] -[WebHTMLRepresentation receivedData:withDataSource:] -[WebFrame(WebInternal) _receivedData:textEncodingName:] __ZN20WebFrameLoaderClient21dispatchDidCommitLoadEv -[WebView(WebPrivate) _didCommitLoadForFrame:] -[WebDataSource pageTitle] -[WebHTMLRepresentation title] -[WebDataSource(WebInternal) _documentLoader] -[WebView(WebPrivate) _setJavaScriptURLsAreAllowed:] __ZNK3WTF7HashMapIPN7WebCore11HistoryItemEP14WebHistoryItemNS_7PtrHashIS3_EENS_10HashTraitsIS3_EENS8_IS5_EEE3getERKS3_ -[WebFrameView becomeFirstResponder] -[WebHTMLView acceptsFirstResponder] -[WebHTMLView becomeFirstResponder] -[WebView(WebPrivate) _isPerformingProgrammaticFocus] __ZN15WebEditorClient10isEditableEv -[WebView(WebViewEditing) isEditable] -[WebHTMLView(WebInternal) _updateFontPanel] -[WebHTMLView(WebPrivate) _canEdit] -[WebFrame(WebInternal) _addData:] __ZN20WebFrameLoaderClient15willChangeTitleEPN7WebCore14DocumentLoaderE __ZN20WebFrameLoaderClient14didChangeTitleEPN7WebCore14DocumentLoaderE __ZN20WebFrameLoaderClient8setTitleERKN7WebCore6StringERKNS0_4KURLE -[WebHistoryItem(WebInternal) setTitle:] __ZN20WebFrameLoaderClient23dispatchDidReceiveTitleERKN7WebCore6StringE __Z21CallFrameLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_S0_ __ZN20WebFrameLoaderClient19windowObjectClearedEv -[WebView(WebPendingPublic) scriptDebugDelegate] __ZN15WebChromeClient18formStateDidChangeEPKN7WebCore4NodeE -[WebHTMLView dataSourceUpdated:] __ZN20WebFrameLoaderClient39postProgressEstimateChangedNotificationEv __ZN20WebFrameLoaderClient31dispatchDidReceiveContentLengthEPN7WebCore14DocumentLoaderEmi __Z24CallResourceLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_lS0_ __ZNK20WebFrameLoaderClient17willCacheResponseEPN7WebCore14DocumentLoaderEmP19NSCachedURLResponse -[WebHTMLRepresentation finishedLoadingWithDataSource:] -[WebHTMLRepresentation _isDisplayingWebArchive] __ZN20WebFrameLoaderClient29dispatchDidFinishDocumentLoadEv __ZN20WebFrameLoaderClient27dispatchDidLoadMainResourceEPN7WebCore14DocumentLoaderE __ZN20WebFrameLoaderClient24dispatchDidFinishLoadingEPN7WebCore14DocumentLoaderEm -[WebView(WebViewInternal) _removeObjectForIdentifier:] __ZN3WTF9HashTableImSt4pairImNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashImEENS_14PairHashTraitsINS_ __ZN20WebDocumentLoaderMac17decreaseLoadCountEm __ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E4findImNS_22IdentityHashTranslatorImmS4_EE __ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E47removeAndInvalidateWithoutEntryConsisten __ZN3WTF9HashTableImmNS_17IdentityExtractorImEENS_7IntHashImEENS_10HashTraitsImEES6_E6removeEPm -[WebHTMLView(WebNSTextInputSupport) inputContext] __ZL11isTextInputPN7WebCore5FrameE __ZN15WebChromeClient20populateVisitedLinksEv -[WebHistory(WebInternal) _addVisitedLinksToPageGroup:] -[WebHistoryPrivate addVisitedLinksToPageGroup:] __ZN3WTF6VectorItLm512EE6shrinkEm _WKSetUpFontCache _WKGetFontInLanguageForRange -[WebDynamicScrollBarsView(WebInternal) setScrollingModes:vertical:andLock:] -[WebDynamicScrollBarsView(WebInternal) updateScrollers] _WKGetFontInLanguageForCharacter -[WebHTMLView(WebInternal) _needsLayout] -[WebFrame(WebInternal) _needsLayout] __ZN20WebFrameLoaderClient22dispatchDidFirstLayoutEv __ZN20WebFrameLoaderClient38dispatchDidFirstVisuallyNonEmptyLayoutEv -[WebHTMLView(WebPrivate) viewWillDraw] -[WebHTMLView(WebInternal) _web_layoutIfNeededRecursive] -[WebHTMLView(WebInternal) _layoutIfNeeded] -[NSView(WebHTMLViewFileInternal) _web_addDescendantWebHTMLViewsToArray:] -[WebHTMLView isOpaque] -[WebHTMLView drawRect:] -[WebView(WebPrivate) _mustDrawUnionedRect:singleRects:count:] -[WebHTMLView drawSingleRect:] -[WebClipView setAdditionalClip:] -[WebHTMLView(WebPrivate) _transparentBackground] -[WebFrame(WebInternal) _drawRect:contentsOnly:] _WKDrawBezeledTextFieldCell -[WebView(WebPrivate) _UIDelegateForwarder] +[WebDefaultUIDelegate sharedUIDelegate] -[WebView currentNodeHighlight] -[WebClipView resetAdditionalClip] __ZN20WebFrameLoaderClient22dispatchDidReceiveIconEv -[WebView(WebViewInternal) _dispatchDidReceiveIconFromWebFrame:] -[WebView(WebViewInternal) _registerForIconNotification:] __ZN15WebChromeClient14firstResponderEv __ZN15WebEditorClient19setInputMethodStateEb __ZN15WebEditorClient32isContinuousSpellCheckingEnabledEv -[WebView(WebViewEditing) isContinuousSpellCheckingEnabled] -[WebView(WebFileInternal) _continuousCheckingAllowed] __ZN15WebEditorClient24isGrammarCheckingEnabledEv -[WebView(WebViewGrammarChecking) isGrammarCheckingEnabled] __ZN15WebEditorClient25respondToChangedSelectionEv -[WebView selectedFrame] -[WebView(WebFileInternal) _focusedFrame] __ZL19containingFrameViewP6NSView -[WebHTMLView(WebInternal) _selectionChanged] -[WebHTMLView(WebNSTextInputSupport) _updateSelectionForInputManager] -[WebHTMLView(WebHTMLViewFileInternal) _frameView] -[WebHTMLView(WebPrivate) _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] _WKDrawFocusRing __ZNK15WebChromeClient18scrollRectIntoViewERKN7WebCore7IntRectEPKNS0_10ScrollViewE -[WebViewFactory defaultLanguageCode] __ZN20WebFrameLoaderClient29dispatchDidHandleOnloadEventsEv __ZN20WebFrameLoaderClient21dispatchDidFinishLoadEv -[WebView(WebPrivate) _didFinishLoadForFrame:] -[WebView(WebPrivate) _didChangeBackForwardKeys] -[WebFrame DOMDocument] -[WebHistoryItem(WebPrivate) _transientPropertyForKey:] __ZN20WebFrameLoaderClient32postProgressFinishedNotificationEv __ZL17isInPasswordFieldPN7WebCore5FrameE -[WebHTMLView(WebNSTextInputSupport) validAttributesForMarkedText] -[WebHTMLRepresentation currentForm] -[WebHTMLRepresentation controlsInForm:] __ZL25formElementFromDOMElementP10DOMElement -[WebHTMLRepresentation elementIsPassword:] __ZL26inputElementFromDOMElementP10DOMElement -[WebHTMLRepresentation elementDoesAutoComplete:] -[WebView(WebPrivate) _globalHistoryItem] -[WebHTMLView(WebDocumentPrivateProtocols) selectionView] -[WebHTMLView(WebPrivate) _recursive:displayRectIgnoringOpacity:inContext:topView:] -[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:] -[WebHistoryItem(WebInternal) _recordInitialVisit] -[WebHistory(WebPrivate) allItems] -[WebHistoryPrivate allItems] -[WebHistoryItem(WebPrivate) visitCount] -[WebHistory(WebPrivate) _itemForURLString:] -[WebFrame(WebPrivate) _isFrameSet] -[WebHTMLView(WebDocumentPrivateProtocols) string] -[WebHTMLView(WebHTMLViewFileInternal) _documentRange] -[DOMDocument(WebDOMDocumentOperationsInternal) _documentRange] -[DOMDocument(WebDOMDocumentOperationsInternal) _createRangeWithNode:] -[WebFrame(WebInternal) _stringForRange:] -[WebHTMLView mouseMovedNotification:] _WKGetMIMETypeForExtension _WKQTIncludeOnlyModernMediaFileTypes _WKQTMovieMaxTimeLoadedChangeNotification -[WebFrame childFrames] _WKQTMovieMaxTimeLoaded _maxValueForTimeRanges -[WebView(WebPendingPublic) isHoverFeedbackSuspended] __ZN15WebChromeClient23mouseDidMoveOverElementERKN7WebCore13HitTestResultEj +[WebElementDictionary initialize] -[WebElementDictionary initWithHitTestResult:] +[WebElementDictionary initializeLookupTable] __ZL12addLookupKeyP8NSStringP13objc_selector -[WebView(WebPrivate) _mouseDidMoveOverElement:modifierFlags:] __Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectm -[WebElementDictionary objectForKey:] -[WebElementDictionary _absoluteLinkURL] -[WebElementDictionary dealloc] __ZN15WebChromeClient10setToolTipERKN7WebCore6StringE -[WebHTMLView(WebPrivate) _setToolTip:] -[WebHTMLView shouldDelayWindowOrderingForEvent:] -[WebHTMLView(WebHTMLViewFileInternal) _hitViewForEvent:] -[WebHTMLView _isSelectionEvent:] -[WebHTMLView(WebDocumentInternalProtocols) elementAtPoint:allowShadowContent:] -[WebElementDictionary _isSelected] -[WebHTMLView mouseDown:] -[WebHTMLView(WebHTMLViewFileInternal) _setMouseDownEvent:] __ZN15WebEditorClient22textFieldDidEndEditingEPN7WebCore7ElementE __Z16CallFormDelegateP7WebViewP13objc_selectorP11objc_objectS4_ __ZN15WebEditorClient25shouldChangeSelectedRangeEPN7WebCore5RangeES2_NS0_9EAffinityEb -[WebView(WebViewEditing) _shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:] -[WebView(WebPrivate) _editingDelegateForwarder] +[WebDefaultEditingDelegate sharedEditingDelegate] -[WebDefaultEditingDelegate webView:shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:] -[WebHTMLView mouseDragged:] __ZN13WebDragClient28dragSourceActionMaskForPointERKN7WebCore8IntPointE -[WebDefaultUIDelegate webView:dragSourceActionMaskForPoint:] -[WebHTMLView mouseUp:] -[WebHTMLView layout] -[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:] -[WebHTMLView reapplyStyles] -[WebHistoryItem title] -[WebDataSource(WebPrivate) _mainDocumentError] -[WebHistory orderedLastVisitedDays] -[WebHistoryPrivate orderedLastVisitedDays] __ZN3WTF6VectorIiLm0EE15reserveCapacityEm __ZSt16__introsort_loopIPilEvT_S1_T0_ __ZSt22__final_insertion_sortIPiEvT_S1_ __ZSt16__insertion_sortIPiEvT_S1_ __ZN3WTF6VectorIiLm0EE6shrinkEm -[WebHistory orderedItemsLastVisitedOnDay:] -[WebHistoryPrivate orderedItemsLastVisitedOnDay:] -[WebView(WebPrivate) _isClosed] -[WebFrameView(WebPrivate) _contentView] -[WebHTMLView resignFirstResponder] -[WebHTMLView updateCell:] -[WebHTMLView maintainsInactiveSelection] -[WebView(WebViewEditing) maintainsInactiveSelection] -[WebView(WebPendingPublic) setHoverFeedbackSuspended:] -[WebHTMLView(WebInternal) _hoverFeedbackSuspendedChanged] -[WebView elementAtPoint:] -[WebView _elementAtWindowPoint:] -[WebView(WebFileInternal) _frameViewAtWindowPoint:] -[WebHTMLView(WebDocumentInternalProtocols) elementAtPoint:] -[WebElementDictionary _domNode] -[DOMDocument(WebDOMDocumentOperations) webFrame] -[WebHistory(WebPrivate) _data] -[WebHistoryPrivate data] __ZN16WebHistoryWriterC1EPN3WTF7HashMapIxNS0_9RetainPtrI14NSMutableArrayEENS0_7IntHashIyEENS0_10HashTraitsIxEENS7_IS4_EEEE __ZN16WebHistoryWriterC2EPN3WTF7HashMapIxNS0_9RetainPtrI14NSMutableArrayEENS0_7IntHashIyEENS0_10HashTraitsIxEENS7_IS4_EEEE __ZN16WebHistoryWriter17writeHistoryItemsERN7WebCore30BinaryPropertyListObjectStreamE __ZN7WebCore25HistoryPropertyListWriterD2Ev -[WebView becomeFirstResponder] -[WebFrameView acceptsFirstResponder] -[WebHTMLView(WebDocumentPrivateProtocols) deselectAll] -[WebHTMLView clearFocus] -[WebView textSizeMultiplier] -[WebView customTextEncodingName] -[WebView _mainFrameOverrideEncoding] -[WebPreferences userStyleSheetLocation] -[NSString(WebNSURLExtras) _webkit_looksLikeAbsoluteURL] -[NSString(WebNSURLExtras) _webkit_rangeOfURLScheme] __ZN20WebFrameLoaderClient33dispatchWillPerformClientRedirectERKN7WebCore4KURLEdd __Z21CallFrameLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_dS0_S0_ __ZNK20WebFrameLoaderClient29generatedMIMETypeForURLSchemeERKN7WebCore6StringE __ZNK20WebFrameLoaderClient25didPerformFirstNavigationEv -[WebPreferences(WebPrivate) automaticallyDetectsCacheModel] __ZN20WebFrameLoaderClient19saveViewStateToItemEPN7WebCore11HistoryItemE -[WebHistory removeItems:] -[WebHistoryPrivate removeItems:] -[WebHistoryPrivate removeItem:] -[WebHistoryPrivate removeItemForURLString:] __ZN20WebFrameLoaderClient31dispatchDidCancelClientRedirectEv -[WebHistoryItem dealloc] -[WebHTMLView dealloc] -[WebHTMLView(WebPrivate) close] -[WebHTMLView(WebPrivate) _clearLastHitViewIfSelf] -[WebPluginController destroyAllPlugins] -[WebPluginController _cancelOutstandingChecks] -[WebHTMLViewPrivate clear] -[WebPluginController dealloc] -[WebHTMLRepresentation dealloc] -[WebHTMLViewPrivate dealloc] -[WebElementDictionary _webFrame] -[WebElementDictionary _targetWebFrame] -[NSURL(WebNSURLExtras) _webkit_URLByRemovingFragment] -[NSURL(WebNSURLExtras) _webkit_URLByRemovingComponent:] __ZL10isHexDigitc __ZL13hexDigitValuec __ZL32applyHostNameFunctionToURLStringP8NSStringPFvS0_8_NSRangePvES2_ __ZL29collectRangesThatNeedEncodingP8NSString8_NSRangePv __ZL28collectRangesThatNeedMappingP8NSString8_NSRangePva -[NSString(WebNSURLExtras) _web_hostNameNeedsEncodingWithRange:] -[WebHTMLView(WebPrivate) addTrackingRect:owner:userData:assumeInside:] -[WebHTMLView(WebPrivate) _sendToolTipMouseEntered] -[WebHTMLView(WebPrivate) _sendToolTipMouseExited] -[WebHTMLView windowDidResignKey:] -[WebHTMLView removeMouseMovedObserver] -[WebWindowWatcher windowWillClose:] __ZNK20WebFrameLoaderClient12canCachePageEv __ZN20WebFrameLoaderClient11createFrameERKN7WebCore4KURLERKNS0_6StringEPNS0_21HTMLFrameOwnerElementES6_bii +[WebFrame(WebInternal) _createSubframeWithOwnerElement:frameName:frameView:] -[WebHTMLView addSubview:] +[WebPluginController isPlugInView:] -[WebFrame parentFrame] _WKSetNSURLConnectionDefersCallbacks __ZL41_updateFocusedAndActiveStateTimerCallbackP16__CFRunLoopTimerPv _haltTimerFired __ZN20WebFrameLoaderClient17objectContentTypeERKN7WebCore4KURLERKNS0_6StringE _WKSetNSURLRequestShouldContentSniff __ZN20WebFrameLoaderClient39dispatchDidLoadResourceByXMLHttpRequestEmRKN7WebCore12ScriptStringE -[WebViewFactory pluginsInfo] +[WebPluginDatabase sharedDatabase] -[WebPluginDatabase init] +[WebPluginDatabase(Internal) _defaultPlugInPaths] -[WebPluginDatabase setPlugInPaths:] -[WebPluginDatabase refresh] -[WebPluginDatabase(Internal) _scanForNewPlugins] -[WebPluginDatabase(Internal) _plugInPaths] +[WebBasePluginPackage initialize] +[WebBasePluginPackage pluginWithPath:] -[WebPluginPackage initWithPath:] -[WebBasePluginPackage initWithPath:] -[WebBasePluginPackage pathByResolvingSymlinksAndAliasesInPath:] -[WebBasePluginPackage dealloc] -[WebNetscapePluginPackage initWithPath:] -[WebNetscapePluginPackage _initWithPath:] -[WebBasePluginPackage getPluginInfoFromPLists] -[WebBasePluginPackage getPluginInfoFromBundleAndMIMEDictionary:] -[NSArray(WebPluginExtensions) _web_lowercaseStrings] -[WebBasePluginPackage setMIMEToExtensionsDictionary:] -[WebBasePluginPackage setMIMEToDescriptionDictionary:] -[WebBasePluginPackage filename] -[WebBasePluginPackage setName:] -[WebBasePluginPackage setPluginDescription:] -[WebNetscapePluginPackage getPluginInfoFromResources] -[WebNetscapePluginPackage openResourceFile] -[WebNetscapePluginPackage stringForStringListID:andIndex:] +[NSString(WebKitExtras) _web_encodingForResource:] -[WebNetscapePluginPackage closeResourceFile:] -[WebBasePluginPackage isNativeLibraryData:] __ZN3WTF6VectorIhLm512EE6shrinkEm -[WebBasePluginPackage pListForPath:createFile:] +[WebBasePluginPackage preferredLocalizationName] -[WebBasePluginPackage createPropertyListFile] -[WebPluginPackage load] -[WebBasePluginPackage load] -[WebBasePluginPackage unload] -[WebPluginDatabase(Internal) _addPlugin:] -[WebBasePluginPackage path] -[WebBasePluginPackage wasAddedToPluginDatabase:] -[WebBasePluginPackage MIMETypeEnumerator] -[WebPluginDatabase pluginForMIMEType:] -[WebPluginDatabase pluginForKey:withEnumeratorSelector:] -[WebNetscapePluginPackage executableType] __ZL14checkCandidatePP20WebBasePluginPackageS1_ -[WebBasePluginPackage isQuickTimePlugIn] -[WebBasePluginPackage bundle] -[WebBasePluginPackage isJavaPlugIn] +[WebHTMLView(WebPrivate) supportedImageMIMETypes] +[WebHTMLRepresentation supportedImageMIMETypes] __ZN3WTF7HashSetIN7WebCore6StringENS1_10StringHashENS_10HashTraitsIS2_EEE3addERKS2_ __ZN3WTF9HashTableIN7WebCore6StringES2_NS_17IdentityExtractorIS2_EENS1_10StringHashENS_10HashTraitsIS2_EES7_E6expandEv __ZN3WTF9HashTableIN7WebCore6StringES2_NS_17IdentityExtractorIS2_EENS1_10StringHashENS_10HashTraitsIS2_EES7_E6rehashEi __ZN3WTF9HashTableIN7WebCore6StringES2_NS_17IdentityExtractorIS2_EENS1_10StringHashENS_10HashTraitsIS2_EES7_E13allocateTableEi __ZN3WTF9HashTableIN7WebCore6StringES2_NS_17IdentityExtractorIS2_EENS1_10StringHashENS_10HashTraitsIS2_EES7_E15deallocateTableE __ZN3WTF9HashTableIN7WebCore6StringES2_NS_17IdentityExtractorIS2_EENS1_10StringHashENS_10HashTraitsIS2_EES7_E4findIS2_NS_22Iden -[WebBasePluginPackage versionNumber] -[WebPluginDatabase plugins] -[WebBasePluginPackage name] -[WebBasePluginPackage pluginDescription] -[WebBasePluginPackage extensionsForMIMEType:] -[WebBasePluginPackage descriptionForMIMEType:] __ZN15WebChromeClient19addMessageToConsoleEN7WebCore13MessageSourceENS0_12MessageLevelERKNS0_6StringEjS5_ __ZN20WebFrameLoaderClient22dispatchDidFailLoadingEPN7WebCore14DocumentLoaderEmRKNS0_13ResourceErrorE -[WebHTMLView setNeedsLayout:] -[WebIconDatabase(WebInternal) _iconForFileURL:withSize:] -[WebIconDatabase(WebInternal) _iconsBySplittingRepresentationsOfIcon:] -[WebIconDatabase(WebInternal) _iconFromDictionary:forSize:cache:] -[WebHistoryItem alternateTitle] -[WebHistoryItem setAlternateTitle:] -[WebHistoryItem(WebPrivate) URL] -[WebBackForwardList forwardListCount] -[WebBackForwardList backListCount] -[WebBackForwardList itemAtIndex:] +[WebView(WebPrivate) canCloseAllWebViews] -[WebIconDatabase(WebInternal) _applicationWillTerminate:] +[WebView _applicationWillTerminate] __ZL27fastDocumentTeardownEnabledv +[WebView(WebPrivate) closeAllWebViews] -[WebView(WebPrivate) _clearUndoRedoOperations] -[WebView close] -[WebView(WebPrivate) _close] -[WebView(WebPrivate) _closeWithFastTeardown] -[WebView(WebPrivate) _closePluginDatabases] +[WebPluginDatabase closeSharedDatabase] -[WebView _windowWillClose:] -[WebView shouldCloseWithWindow] -[WebHTMLView windowWillClose:] -[NSEvent(WebExtras) _web_isOptionTabKeyEvent] -[WebFrame(WebPrivate) _isDisplayingStandaloneImage] -[WebView(WebPendingPublic) markAllMatchesForText:caseSensitive:highlight:limit:] -[WebHTMLView(WebDocumentInternalProtocols) setMarkedTextMatchesAreHighlighted:] -[WebHTMLView(WebDocumentInternalProtocols) markAllMatchesForText:caseSensitive:limit:] __ZL14incrementFrameP8WebFrameaa -[WebView(WebPendingPublic) unmarkAllTextMatches] -[WebHTMLView(WebDocumentInternalProtocols) unmarkAllTextMatches] -[WebDynamicScrollBarsView setAllowsHorizontalScrolling:] -[WebDynamicScrollBarsView(WebInternal) accessibilityIsIgnored] +[NSPasteboard(WebExtras) _web_setFindPasteboardString:withOwner:] __ZN20WebFrameLoaderClient50dispatchDidReceiveServerRedirectForProvisionalLoadEv __ZN20WebFrameLoaderClient29savePlatformDataToCachedFrameEPN7WebCore11CachedFrameE +[WebStringTruncator centerTruncateString:toWidth:] __ZL15defaultMenuFontv -[WebClipView additionalClip] -[WebHTMLView willRemoveSubview:] __ZN20WebFrameLoaderClient19detachedFromParent2Ev __ZN20WebFrameLoaderClient19detachedFromParent3Ev -[WebFrameView dealloc] -[WebFrameViewPrivate dealloc] __ZN20WebFrameLoaderClient20frameLoaderDestroyedEv -[WebFrame(WebInternal) _clearCoreFrame] __ZN20WebFrameLoaderClientD0Ev -[WebFrame dealloc] -[WebFramePrivate dealloc] -[NSView(WebExtras) _web_dragShouldBeginFromMouseDown:withExpiration:xHysteresis:yHysteresis:] -[NSString(WebNSURLExtras) _webkit_scriptIfJavaScriptURL] -[NSString(WebNSURLExtras) _webkit_isJavaScriptURL] -[WebHTMLView(WebPrivate) _removeTrackingRects:count:] -[WebHTMLView(WebPrivate) _addTrackingRect:owner:userData:assumeInside:useTrackingNum:] -[WebView _hitTest:dragTypes:] -[WebView draggingEntered:] -[WebView documentViewAtWindowPoint:] __ZN13WebDragClient17actionMaskForDragEPN7WebCore8DragDataE -[WebDefaultUIDelegate webView:dragDestinationActionMaskForDraggingInfo:] __ZNK19WebPasteboardHelper25insertablePasteboardTypesEv __ZNK19WebPasteboardHelper17urlFromPasteboardEPK12NSPasteboardPN7WebCore6StringE -[NSPasteboard(WebExtras) _web_bestURL] -[WebView draggingUpdated:] -[WebView _shouldAutoscrollForDraggingInfo:] -[WebView prepareForDragOperation:] -[WebView performDragOperation:] __ZN13WebDragClient32willPerformDragDestinationActionEN7WebCore21DragDestinationActionEPNS0_8DragDataE -[WebDefaultUIDelegate webView:willPerformDragDestinationAction:forDraggingInfo:] -[WebHTMLView scrollWheel:] _WKGetWheelEventDeltas -[WebClipView scrollWheel:] -[WebDynamicScrollBarsView(WebInternal) scrollWheel:] -[WebDynamicScrollBarsView(WebInternal) allowsVerticalScrolling] -[WebDynamicScrollBarsView(WebInternal) autoforwardsScrollWheelEvents] -[DOMNode(WebDOMNodeOperations) webArchive] -[WebArchive(WebInternal) _initWithCoreLegacyWebArchive:] +[WebArchivePrivate initialize] -[WebArchivePrivate .cxx_construct] -[WebArchivePrivate initWithCoreArchive:] -[WebArchive data] -[WebArchivePrivate coreArchive] -[WebArchive dealloc] -[WebArchivePrivate dealloc] -[WebArchivePrivate .cxx_destruct] -[WebHTMLView needsPanelToBecomeKey] -[WebHTMLView acceptsFirstMouse:] -[NSView(WebExtras) _web_dragShouldBeginFromMouseDown:withExpiration:] +[WebPreferences(WebInternal) _concatenateKeyWithIBCreatorID:] -[WebPreferences setJavaEnabled:] -[WebPreferences setJavaScriptEnabled:] -[WebPreferences setUserStyleSheetEnabled:] -[WebPreferences setPlugInsEnabled:] -[WebPreferences setAllowsAnimatedImages:] -[WebPreferences setLoadsImagesAutomatically:] -[WebPreferences setShouldPrintBackgrounds:] -[WebPreferences(WebPrivate) setEditableLinkBehavior:] -[NSMutableDictionary(WebNSDictionaryExtras) _webkit_setInt:forKey:] -[WebPreferences setMinimumFontSize:] -[WebPreferences setDefaultTextEncodingName:] -[WebPreferences _setStringValue:forKey:] -[WebPreferences setUserStyleSheetLocation:] -[WebPreferences setStandardFontFamily:] -[WebPreferences setDefaultFontSize:] -[WebPreferences setFixedFontFamily:] -[WebPreferences setDefaultFixedFontSize:] -[WebPreferences setMinimumLogicalFontSize:] +[WebCache initialize] +[WebCache setDisabled:] -[WebPreferences setJavaScriptCanOpenWindowsAutomatically:] -[WebPreferences setAllowsAnimatedImageLooping:] -[WebView initWithFrame:] -[WebView initWithFrame:frameName:groupName:] __ZL32needsWebViewInitThreadWorkaroundv -[WebView setPreferences:] -[WebPreferences identifier] +[WebPreferences(WebPrivate) _removeReferenceForIdentifier:] -[WebPreferences(WebPrivate) didRemoveFromWebView] +[WebView(WebFileInternal) _preferencesRemovedNotification:] +[WebView(WebFileInternal) _maxCacheModelInAnyInstance] -[WebFrame loadData:MIMEType:textEncodingName:baseURL:] -[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:] __ZL22createUniqueWebDataURLv -[WebFrame stopLoading] -[WebView setPreferencesIdentifier:] -[WebPreferences dealloc] -[WebPreferencesPrivate dealloc] -[WebFrame loadHTMLString:baseURL:] -[WebFrame _loadHTMLString:baseURL:unreachableURL:] -[WebFrameView setAllowsScrolling:] -[WebDefaultUIDelegate webView:didDrawRect:] -[WebView setTextSizeMultiplier:] -[WebPreferences(WebPrivate) setShowsURLsInToolTips:] -[WebView(WebPrivate) textIteratorForRect:] -[WebTextIterator initWithRange:] +[WebTextIteratorPrivate initialize] -[WebTextIteratorPrivate .cxx_construct] -[WebTextIterator atEnd] -[WebTextIterator currentTextLength] -[WebTextIterator currentTextPointer] -[WebTextIterator currentRange] -[WebTextIterator advance] -[WebTextIterator dealloc] -[WebTextIteratorPrivate .cxx_destruct] -[WebView hostWindow] -[WebView dealloc] -[WebView(AllWebViews) _removeFromAllWebViewsSet] -[WebView(WebPendingPublic) setScriptDebugDelegate:] -[WebView(WebPrivate) _cacheScriptDebugDelegateImplementations] -[WebView(WebPrivate) _detachScriptDebuggerFromAllFrames] -[WebFrame(WebInternal) _detachScriptDebugger] -[WebView removeDragCaret] __ZN15WebEditorClient13pageDestroyedEv __ZN15WebEditorClientD0Ev __ZN18WebInspectorClient18inspectorDestroyedEv __ZN18WebInspectorClientD0Ev __ZN20WebContextMenuClient20contextMenuDestroyedEv __ZN20WebContextMenuClientD0Ev __ZN13WebDragClient23dragControllerDestroyedEv __ZN13WebDragClientD0Ev __ZN15WebChromeClient15chromeDestroyedEv __ZN15WebChromeClientD0Ev -[WebView preferencesIdentifier] -[WebViewPrivate dealloc] -[WebViewPrivate .cxx_destruct] +[WebPreferences(WebPrivate) _checkLastReferenceForIdentifier:] -[WebView(WebViewEditing) selectedDOMRange] -[WebView(WebFileInternal) _selectedOrMainFrame] -[WebFrame(WebInternal) _findFrameWithSelection] -[WebFrame(WebInternal) _hasSelection] -[WebHTMLView(WebDocumentPrivateProtocols) selectedAttributedString] -[WebHTMLView(WebHTMLViewFileInternal) _selectedRange] -[WebHTMLView(WebDocumentPrivateProtocols) _attributeStringFromDOMRange:] +[NSAttributedString(WebKitExtras) _web_attributedStringFromRange:] -[DOMRange(WebDOMRangeOperations) webArchive] -[WebArchive mainResource] -[WebResource(WebResourceInternal) _initWithCoreResource:] +[WebResourcePrivate initialize] -[WebResourcePrivate initWithCoreResource:] -[WebResource textEncodingName] -[WebResource data] -[WebResource MIMEType] -[WebResource URL] -[WebArchive subresources] -[WebView initWithCoder:] -[WebPreferences initWithCoder:] -[WebView(WebViewEditing) editingDelegate] -[WebView(WebPrivate) setAlwaysShowVerticalScroller:] -[WebDynamicScrollBarsView(WebInternal) setVerticalScrollingMode:andLock:] -[WebDynamicScrollBarsView(WebInternal) horizontalScrollingMode] -[WebDynamicScrollBarsView(WebInternal) setScrollingModesLocked:] -[WebView(WebViewEditing) spellCheckerDocumentTag] -[WebResource dealloc] -[WebResourcePrivate dealloc] __ZN3WTF6VectorINS_6RefPtrIN7WebCore15ArchiveResourceEEELm0EE6shrinkEm -[WebView(WebViewEditing) setContinuousSpellCheckingEnabled:] +[WebView(WebFileInternal) _preflightSpellChecker] +[WebView(WebFileInternal) _preflightSpellCheckerNow:] -[WebView(WebViewEditing) undoManager] -[WebDefaultEditingDelegate undoManagerForWebView:] -[WebView(WebViewEditing) selectionAffinity] -[WebView(WebViewEditing) setSelectedDOMRange:affinity:] -[WebView(WebViewEditing) setEditable:] __ZN15WebEditorClient18shouldBeginEditingEPN7WebCore5RangeE -[WebDefaultEditingDelegate webView:shouldBeginEditingInDOMRange:] __ZN15WebEditorClient15didBeginEditingEv -[WebDefaultUIDelegate webViewFirstResponder:] -[WebView(WebPendingPublic) setTabKeyCyclesThroughElements:] -[WebHTMLView keyDown:] __ZN15WebEditorClient24handleInputMethodKeydownEPN7WebCore13KeyboardEventE -[WebHTMLView(WebInternal) _interceptEditingKeyEvent:shouldSaveCommand:] -[WebHTMLView(WebNSTextInputSupport) hasMarkedText] -[WebHTMLView(WebNSTextInputSupport) insertText:] __ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE14expandCapacityEmPKS2_ __ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE14expandCapacityEm __ZN3WTF6VectorIN7WebCore15KeypressCommandELm0EE15reserveCapacityEm __ZN15WebEditorClient19handleKeyboardEventEPN7WebCore13KeyboardEventE -[WebHTMLView coreCommandBySelector:] __ZN15WebEditorClient16shouldInsertTextERKN7WebCore6StringEPNS0_5RangeENS0_18EditorInsertActionE -[WebView(WebViewEditing) typingStyle] -[WebFrame(WebInternal) _typingStyle] __ZN15WebEditorClient22registerCommandForUndoEN3WTF10PassRefPtrIN7WebCore11EditCommandEEE __ZN15WebEditorClient28registerCommandForUndoOrRedoEN3WTF10PassRefPtrIN7WebCore11EditCommandEEEb +[WebEditCommand initialize] +[WebEditCommand commandWithEditCommand:] -[WebEditCommand .cxx_construct] -[WebEditCommand initWithEditCommand:] __ZN15WebEditorClient24respondToChangedContentsEv -[WebHTMLView keyUp:] __ZN15WebEditorClient35isAutomaticQuoteSubstitutionEnabledEv -[WebView(WebViewTextChecking) isAutomaticQuoteSubstitutionEnabled] __ZN15WebEditorClient31isAutomaticLinkDetectionEnabledEv -[WebView(WebViewTextChecking) isAutomaticLinkDetectionEnabled] __ZN15WebEditorClient34isAutomaticDashSubstitutionEnabledEv -[WebView(WebViewTextChecking) isAutomaticDashSubstitutionEnabled] __ZN15WebEditorClient33isAutomaticTextReplacementEnabledEv -[WebView(WebViewTextChecking) isAutomaticTextReplacementEnabled] __ZN15WebEditorClient36isAutomaticSpellingCorrectionEnabledEv -[WebView(WebViewTextChecking) isAutomaticSpellingCorrectionEnabled] __ZN15WebEditorClient20checkTextOfParagraphEPKtiyRN3WTF6VectorIN7WebCore18TextCheckingResultELm0EEE __ZN15WebEditorClient23spellCheckerDocumentTagEv __ZN15WebEditorClient13didEndEditingEv -[WebEditCommand dealloc] -[WebEditCommand .cxx_destruct] -[WebHTMLView(WebPrivate) removeTrackingRect:] -[WebView windowScriptObject] -[WebFrame name] __ZN20WebFrameLoaderClient14cancelledErrorERKN7WebCore15ResourceRequestE +[NSError(WebKitExtras) _webKitErrorWithDomain:code:URL:] +[NSError(WebKitExtras) _registerWebKitErrors] _registerErrors +[NSError(WebKitExtras) _webkit_addErrorsWithCodesAndDescriptions:inDomain:] +[NSError(WebKitExtras) _webkit_errorWithDomain:code:URL:] -[NSError(WebKitExtras) _webkit_initWithDomain:code:URL:] __ZN20WebFrameLoaderClient20setMainDocumentErrorEPN7WebCore14DocumentLoaderERKNS0_13ResourceErrorE -[WebDataSource(WebInternal) _setMainDocumentError:] __ZL49applyAppleDictionaryApplicationQuirkNonInlinePartP20WebFrameLoaderClientRKN7WebCore15ResourceRequestE +[WebHistoryItem(WebPrivate) _releaseAllPendingPageCaches] +[WebKitStatistics webViewCount] +[WebKitStatistics frameCount] +[WebKitStatistics dataSourceCount] +[WebKitStatistics viewCount] +[WebKitStatistics HTMLRepresentationCount] +[WebKitStatistics bridgeCount] +[WebCoreStatistics javaScriptProtectedGlobalObjectsCount] -[WebView stringByEvaluatingJavaScriptFromString:] -[WebFrame(WebInternal) _stringByEvaluatingJavaScriptFromString:] -[WebFrame(WebInternal) _stringByEvaluatingJavaScriptFromString:forceUserGesture:] _WKDrawBezeledTextArea __ZNK15WebChromeClient17windowResizerRectEv -[WebViewFactory inputElementAltText] __ZN26WebCachedFramePlatformData5clearEv -[WebHTMLView(WebInternal) closeIfNotCurrentView] __ZN26WebCachedFramePlatformDataD0Ev -[WebPluginDatabase close] -[WebPluginDatabase(Internal) _removePlugin:] +[WebView(WebPrivate) _unregisterViewClassAndRepresentationClassForMIMEType:] __ZN3WTF9HashTableIN7WebCore6StringES2_NS_17IdentityExtractorIS2_EENS1_10StringHashENS_10HashTraitsIS2_EES7_E47removeAndInvalid __ZN3WTF9HashTableIN7WebCore6StringES2_NS_17IdentityExtractorIS2_EENS1_10StringHashENS_10HashTraitsIS2_EES7_E6removeEPS2_ -[WebNetscapePluginPackage wasRemovedFromPluginDatabase:] -[WebBasePluginPackage wasRemovedFromPluginDatabase:] -[WebNetscapePluginPackage(Internal) _unloadWithShutdown:] -[WebView(WebPendingPublic) unscheduleFromRunLoop:forMode:] -[WebView _pluginForMIMEType:] __ZN20WebFrameLoaderClient12createPluginERKN7WebCore7IntSizeEPNS0_17HTMLPlugInElementERKNS0_4KURLERKN3WTF6VectorINS0_6StringELm __ZL3kitRKN3WTF6VectorIN7WebCore6StringELm0EEE __ZL10pluginViewP8WebFrameP16WebPluginPackageP7NSArrayS4_P5NSURLP10DOMElementa -[WebPluginPackage viewFactory] +[WebPluginController plugInViewWithArguments:fromPluginPackage:] __ZNK7WebCore6Widget11isFrameViewEv __ZN7WebCore6Widget16setParentVisibleEb -[WebPluginController addPlugin:] -[WebView addPluginInstanceView:] -[WebPluginDatabase addPluginInstanceView:] -[WebPluginController webView] -[WebPluginController webFrame] -[WebView(WebPrivate) defersCallbacks] _resumeTimerFired -[WebPluginController destroyPlugin:] -[WebView removePluginInstanceView:] -[WebPluginDatabase removePluginInstanceView:] __ZN12PluginWidgetD0Ev -[WebPluginDatabase destroyAllPluginInstanceViews] -[WebPluginDatabase dealloc] -[WebView mainFrameTitle] -[WebView setShouldCloseWithWindow:] -[WebDataSource initialRequest] __ZN20WebFrameLoaderClient14shouldFallBackERKN7WebCore13ResourceErrorE __ZN20WebFrameLoaderClient30dispatchDidFailProvisionalLoadERKN7WebCore13ResourceErrorE -[WebView(WebPrivate) _didFailProvisionalLoadWithError:forFrame:] -[WebFramePolicyListener finalize] -[WebElementDictionary finalize] -[WebFramePolicyListener ignore] -[WebDataSource finalize] -[WebDataSourcePrivate finalize] -[WebDefaultUIDelegate webView:didScrollDocumentInFrameView:] __ZN15WebChromeClient18makeFirstResponderEP11NSResponder -[WebView(WebPrivate) _pushPerformingProgrammaticFocus] -[WebDefaultUIDelegate webView:makeFirstResponder:] -[WebView(WebPrivate) _popPerformingProgrammaticFocus] -[WebElementDictionary count] -[WebElementDictionary _fillCache] __ZL16cacheValueForKeyPKvS0_Pv -[WebElementDictionary _title] __ZL13NSStringOrNilN7WebCore6StringE -[WebElementDictionary _absoluteImageURL] -[WebElementDictionary _isContentEditable] -[WebElementDictionary _image] -[WebElementDictionary _spellingToolTip] -[WebElementDictionary _titleDisplayString] -[WebElementDictionary _textContent] -[WebElementDictionary _imageRect] -[WebElementDictionary _altDisplayString] -[WebElementDictionary _isLiveLink] __ZN20WebFrameLoaderClient38dispatchDidLoadResourceFromMemoryCacheEPN7WebCore14DocumentLoaderERKNS0_15ResourceRequestERKNS0_16R -[WebHTMLRepresentation finalize] -[WebHTMLView finalize] -[WebHTMLViewPrivate finalize] __ZN20WebFrameLoaderClient38dispatchDecidePolicyForNewWindowActionEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEERKNS0_16Naviga __ZN20WebFrameLoaderClient19dispatchDidFailLoadERKN7WebCore13ResourceErrorE -[WebView(WebPrivate) _didFailLoadWithError:forFrame:] +[WebBaseNetscapePluginView initialize] _WKSendUserChangeNotifications +[WebHostedNetscapePluginView initialize] -[WebBaseNetscapePluginView .cxx_construct] -[WebHostedNetscapePluginView .cxx_construct] -[WebHostedNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:eleme -[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element -[WebHostedNetscapePluginView setAttributeKeys:andValues:] -[WebBaseNetscapePluginView renewGState] -[WebBaseNetscapePluginView viewWillMoveToSuperview:] -[WebBaseNetscapePluginView visibleRect] -[WebBaseNetscapePluginView isFlipped] -[WebBaseNetscapePluginView _windowClipRect] __ZN20WebFrameLoaderClient35dispatchDidChangeLocationWithinPageEv __ZN20WebFrameLoaderClient13didFinishLoadEv -[WebHTMLView validateUserInterfaceItem:] -[WebHTMLView validateUserInterfaceItemWithoutDelegate:] __ZL3kitN7WebCore8TriStateE __Z30CallUIDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objecta -[WebView(WebIBActions) validateUserInterfaceItem:] -[WebView(WebIBActions) validateUserInterfaceItemWithoutDelegate:] -[WebView(WebIBActions) canMakeTextLarger] -[WebView _canZoomIn:] -[WebView _zoomMultiplier:] -[WebView(WebIBActions) canMakeTextSmaller] -[WebView _canZoomOut:] -[WebHTMLView(WebPrivate) _hasSelection] -[WebHTMLView(WebPrivate) _isEditable] -[WebBaseNetscapePluginView viewWillMoveToWindow:] -[WebBaseNetscapePluginView removeTrackingRect] -[WebHostedNetscapePluginView removeWindowObservers] -[WebBaseNetscapePluginView removeWindowObservers] -[WebBaseNetscapePluginView setHasFocus:] -[WebBaseNetscapePluginView viewDidMoveToWindow] -[WebBaseNetscapePluginView resetTrackingRect] -[WebBaseNetscapePluginView start] -[WebBaseNetscapePluginView webView] -[WebBaseNetscapePluginView webFrame] -[WebBaseNetscapePluginView dataSource] -[WebHostedNetscapePluginView createPlugin] -[WebView userAgentForURL:] __ZN6WebKit25NetscapePluginHostManager6sharedEv __ZN6WebKit25NetscapePluginHostManagerC1Ev __ZN6WebKit25NetscapePluginHostManagerC2Ev __ZN6WebKit25NetscapePluginHostManager17instantiatePluginEP24WebNetscapePluginPackageP27WebHostedNetscapePluginViewP8NSStringP7 __ZN6WebKit25NetscapePluginHostManager14hostForPackageEP24WebNetscapePluginPackage __ZN3WTF7HashMapIP24WebNetscapePluginPackagePN6WebKit23NetscapePluginHostProxyENS_7PtrHashIS2_EENS_10HashTraitsIS2_EENS8_IS5_EE __ZN3WTF9HashTableIP24WebNetscapePluginPackageSt4pairIS2_PN6WebKit23NetscapePluginHostProxyEENS_18PairFirstExtractorIS7_EENS_7P __ZN6WebKit25NetscapePluginHostManager15spawnPluginHostEP24WebNetscapePluginPackagejRjR19ProcessSerialNumber __ZN6WebKit25NetscapePluginHostManager20initializeVendorPortEv __WKPACheckInApplication _WKInitializeRenderServer -[WebNetscapePluginPackage pluginHostArchitecture] __WKPASpawnPluginHost __WKPHCheckInWithPluginHost __ZN6WebKit23NetscapePluginHostProxyC1EjjRK19ProcessSerialNumber __ZN6WebKit23NetscapePluginHostProxyC2EjjRK19ProcessSerialNumber __ZN6WebKitL14pluginProxyMapEv __ZN3WTF7HashMapIjPN6WebKit23NetscapePluginHostProxyENS_7IntHashIjEENS_10HashTraitsIjEENS6_IS3_EEE3addERKjRKS3_ __ZN3WTF9HashTableIjSt4pairIjPN6WebKit23NetscapePluginHostProxyEENS_18PairFirstExtractorIS5_EENS_7IntHashIjEENS_14PairHashTrait _WKCreateMIGServerSource __ZN6WebKit27NetscapePluginInstanceProxyC1EPNS_23NetscapePluginHostProxyEP27WebHostedNetscapePluginViewb __ZN6WebKit27NetscapePluginInstanceProxyC2EPNS_23NetscapePluginHostProxyEP27WebHostedNetscapePluginViewb __ZN6WebKit23NetscapePluginHostProxy14pluginInstanceEj __ZNK3WTF7HashMapIjNS_6RefPtrIN6WebKit27NetscapePluginInstanceProxyEEENS_7IntHashIjEENS_10HashTraitsIjEENS7_IS4_EEE3getERKj __ZN6WebKit23NetscapePluginHostProxy17addPluginInstanceEPNS_27NetscapePluginInstanceProxyE __ZN3WTF7HashMapIjNS_6RefPtrIN6WebKit27NetscapePluginInstanceProxyEEENS_7IntHashIjEENS_10HashTraitsIjEENS7_IS4_EEE3setERKjRKS4_ __ZN6WebKit27NetscapePluginInstanceProxy13nextRequestIDEv __WKPHInstantiatePlugin __ZN6WebKit27NetscapePluginInstanceProxy30processRequestsAndWaitForReplyEj __ZN3WTF7HashMapIjPN6WebKit27NetscapePluginInstanceProxy5ReplyENS_7IntHashIjEENS_10HashTraitsIjEENS7_IS4_EEE4takeERKj __ZN3WTF9HashTableIjSt4pairIjPN6WebKit27NetscapePluginInstanceProxy5ReplyEENS_18PairFirstExtractorIS6_EENS_7IntHashIjEENS_14Pai __ZN6WebKit23NetscapePluginHostProxy15processRequestsEv _WebKitPluginClient_server __XPCLoadURL _WKPCLoadURL __ZNK3WTF7HashMapIjPN6WebKit23NetscapePluginHostProxyENS_7IntHashIjEENS_10HashTraitsIjEENS6_IS3_EEE3getERKj __ZN6WebKit27NetscapePluginInstanceProxy7loadURLEPKcS2_S2_j12LoadURLFlagsRj -[WebBaseNetscapePluginView requestWithURLCString:] -[WebBaseNetscapePluginView URLWithCString:] -[NSString(WebKitExtras) _web_stringByStrippingReturnCharacters] -[NSURL(WebNSURLExtras) _webkit_URLByRemovingResourceSpecifier] -[NSMutableURLRequest(WebNSURLRequestExtras) _web_setHTTPReferrer:] __ZN6WebKit27NetscapePluginInstanceProxy11loadRequestEP12NSURLRequestPKcbRj -[NSURL(WebNSURLExtras) _webkit_scriptIfJavaScriptURL] __ZN3WTF5DequeIPN6WebKit27NetscapePluginInstanceProxy13PluginRequestEE14expandCapacityEv __XPCInstantiatePluginReply _WKPCInstantiatePluginReply __ZN3WTF7HashMapIjPN6WebKit27NetscapePluginInstanceProxy5ReplyENS_7IntHashIjEENS_10HashTraitsIjEENS7_IS4_EEE3setERKjRKS4_ __ZN6WebKit27NetscapePluginInstanceProxy22InstantiatePluginReplyD0Ev _WKSoftwareCARendererCreate _WKMakeRenderLayer __ZN6WebKit27NetscapePluginInstanceProxy18windowFrameChangedE6CGRect __WKPHPluginInstanceWindowFrameChanged -[WebHostedNetscapePluginView updateAndSetWindow] -[WebBaseNetscapePluginView currentWindow] __ZN6WebKit27NetscapePluginInstanceProxy6resizeE6CGRectS1_b __WKPHResizePluginInstance __XPCBooleanReply _WKPCBooleanReply __ZN6WebKit27NetscapePluginInstanceProxy12BooleanReplyD0Ev -[WebHostedNetscapePluginView addWindowObservers] -[WebBaseNetscapePluginView addWindowObservers] -[WebBaseNetscapePluginView sendActivateEvent:] -[WebHostedNetscapePluginView windowFocusChanged:] __ZN6WebKit27NetscapePluginInstanceProxy18windowFocusChangedEb __WKPHPluginInstanceWindowFocusChanged -[WebBaseNetscapePluginView restartTimers] -[WebHostedNetscapePluginView stopTimers] __ZN6WebKit27NetscapePluginInstanceProxy10stopTimersEv __WKPHPluginInstanceStopTimers -[WebHostedNetscapePluginView startTimers] __ZN6WebKit27NetscapePluginInstanceProxy11startTimersEb __WKPHPluginInstanceStartTimers -[WebHostedNetscapePluginView loadStream] -[WebView acceptsFirstResponder] -[WebHostedNetscapePluginView drawRect:] _WKSoftwareCARendererRender __ZN7WebCore5TimerIN6WebKit27NetscapePluginInstanceProxyEE5firedEv __ZN6WebKit27NetscapePluginInstanceProxy17requestTimerFiredEPN7WebCore5TimerIS0_EE __ZN6WebKit27NetscapePluginInstanceProxy14performRequestEPNS0_13PluginRequestE -[WebPluginDatabase removePluginInstanceViewsFor:] __ZN20WebFrameLoaderClient22dispatchWillSubmitFormEMN7WebCore11FrameLoaderEFvNS0_12PolicyActionEEN3WTF10PassRefPtrINS0_9FormSta -[WebView(WebPrivate) _formDelegate] __Z16CallFormDelegateP7WebViewP13objc_selectorP11objc_objectS4_S4_S4_S4_ -[WebFramePolicyListener continue] -[WebBaseNetscapePluginView stop] -[WebHostedNetscapePluginView shouldStop] __ZN6WebKit27NetscapePluginInstanceProxy10shouldStopEv -[WebHostedNetscapePluginView destroyPlugin] _WKSoftwareCARendererDestroy __ZN6WebKit27NetscapePluginInstanceProxy7destroyEv __WKPHDestroyPluginInstance __XPCCancelLoadURL _WKPCCancelLoadURL __ZN6WebKit27NetscapePluginInstanceProxy16cancelStreamLoadEjs __ZNK3WTF7HashMapIjNS_6RefPtrIN6WebKit26HostedNetscapePluginStreamEEENS_7IntHashIjEENS_10HashTraitsIjEENS7_IS4_EEE3getERKj __ZN6WebKit27NetscapePluginInstanceProxy7cleanupEv __ZN6WebKit27NetscapePluginInstanceProxy14stopAllStreamsEv __ZN3WTF9HashTableIPN6WebKit13ProxyInstanceES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E4swapERSA_ __ZN3WTF9HashTableIPN6WebKit13ProxyInstanceES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E15dealloca __ZN6WebKit27NetscapePluginInstanceProxy10invalidateEv __ZN6WebKit23NetscapePluginHostProxy20removePluginInstanceEPNS_27NetscapePluginInstanceProxyE __ZN6WebKit27NetscapePluginInstanceProxyD1Ev __ZN6WebKit27NetscapePluginInstanceProxyD2Ev __ZN3WTF20deleteAllPairSecondsIPN6WebKit27NetscapePluginInstanceProxy5ReplyEKNS_7HashMapIjS4_NS_7IntHashIjEENS_10HashTraitsIjEE __ZN3WTF9HashTableIjSt4pairIjNS_9RetainPtrIP11objc_objectEEENS_18PairFirstExtractorIS6_EENS_7IntHashIjEENS_14PairHashTraitsINS_ -[WebHostedNetscapePluginView inputContext] +[WebTextInputWindowController sharedTextInputWindowController] -[WebTextInputWindowController init] -[WebTextInputPanel init] _WKGetInputPanelWindowStyle -[WebTextInputWindowController inputContext] -[WebTextInputPanel _inputContext] __ZN20NetscapePluginWidgetD0Ev -[WebBaseNetscapePluginView dealloc] -[WebHostedNetscapePluginView .cxx_destruct] -[WebBaseNetscapePluginView .cxx_destruct] __ZN6WebKit23NetscapePluginHostProxy28deadNameNotificationCallbackEP12__CFMachPortPvlS3_ __ZN6WebKit23NetscapePluginHostProxy14pluginHostDiedEv __ZN3WTF9HashTableIjSt4pairIjNS_6RefPtrIN6WebKit27NetscapePluginInstanceProxyEEEENS_18PairFirstExtractorIS6_EENS_7IntHashIjEENS __ZN6WebKit25NetscapePluginHostManager14pluginHostDiedEPNS_23NetscapePluginHostProxyE __ZN6WebKit23NetscapePluginHostProxyD1Ev __ZN6WebKit23NetscapePluginHostProxyD2Ev __ZN15WebChromeClient11scaleFactorEv __ZN15WebEditorClient27doTextFieldCommandFromEventEPN7WebCore7ElementEPNS0_13KeyboardEventE -[WebDefaultEditingDelegate webView:shouldInsertText:replacingDOMRange:givenAction:] __ZN15WebEditorClient24textFieldDidBeginEditingEPN7WebCore7ElementE -[WebHTMLRepresentation formForElement:] __ZN15WebEditorClient24textDidChangeInTextFieldEPN7WebCore7ElementE -[WebHTMLView performKeyEquivalent:] -[WebHTMLView _handleStyleKeyEquivalent:] -[WebPreferences(WebPrivate) respectStandardStyleKeyEquivalents] -[WebHTMLView(WebNSTextInputSupport) doCommandBySelector:] -[WebDefaultEditingDelegate webView:doCommandBySelector:] -[WebHTMLRepresentation elementWithName:inForm:] __ZN15WebEditorClient24smartInsertDeleteEnabledEv -[WebView(WebViewEditing) smartInsertDeleteEnabled] __ZN15WebEditorClient17shouldDeleteRangeEPN7WebCore5RangeE -[WebDefaultEditingDelegate webView:shouldDeleteDOMRange:] __ZN15WebEditorClient28textWillBeDeletedInTextFieldEPN7WebCore7ElementE __Z32CallFormDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objectS2_S4_ __ZN3WTF6VectorIN7WebCore18TextCheckingResultELm0EE14expandCapacityEmPKS2_ __ZN3WTF6VectorIN7WebCore18TextCheckingResultELm0EE14expandCapacityEm __ZN3WTF6VectorIN7WebCore18TextCheckingResultELm0EE15reserveCapacityEm __ZN7WebCore18TextCheckingResultC2ERKS0_ __ZN3WTF6VectorIN7WebCore13GrammarDetailELm0EEC1ERKS3_ __ZN3WTF6VectorIN7WebCore13GrammarDetailELm0EEC2ERKS3_ __ZN7WebCore18TextCheckingResultD2Ev _WKSetPatternPhaseInUserSpace -[NSString(WebNSURLExtras) _web_isUserVisibleURL] +[WebHTMLView(WebPrivate) _postFlagsChangedEvent:] -[WebHTMLView flagsChanged:] __ZN15WebEditorClient33isSelectTrailingWhitespaceEnabledEv -[WebView(WebPrivate) isSelectTrailingWhitespaceEnabled] __ZN15WebChromeClient11canRunModalEv -[WebHTMLView(WebPrivate) view:stringForToolTip:point:userData:] +[WebStringTruncator rightTruncateString:toWidth:withFont:] -[WebView(WebIBActions) goBack:] -[WebView goBack] __ZNK20WebFrameLoaderClient21shouldGoToHistoryItemEPN7WebCore11HistoryItemE __ZN20WebFrameLoaderClient16restoreViewStateEv -[WebDynamicScrollBarsView(WebInternal) allowsHorizontalScrolling] -[WebView(WebPendingPublic) shouldClose] -[NSEvent(WebExtras) _web_isReturnOrEnterKeyEvent] -[NSEvent(WebExtras) _web_isKeyEvent:] __ZN20WebFrameLoaderClient27registerForIconNotificationEb -[WebView(WebViewInternal) _receivedIconChangedNotification:] __ZN20WebFrameLoaderClient36transitionToCommittedFromCachedFrameEPN7WebCore11CachedFrameE __ZN20WebFrameLoaderClient11forceLayoutEv -[WebHTMLView setNeedsToApplyStyles:] __XPCGetWindowNPObject _WKPCGetWindowNPObject __ZN6WebKit27NetscapePluginInstanceProxy17getWindowNPObjectERj __ZN6WebKit27NetscapePluginInstanceProxy11idForObjectEPN3JSC8JSObjectE __ZNK3WTF9HashTableIjSt4pairIjN3JSC12ProtectedPtrINS2_8JSObjectEEEENS_18PairFirstExtractorIS6_EENS_7IntHashIjEENS_14PairHashTra __ZN3WTF7HashMapIjN3JSC12ProtectedPtrINS1_8JSObjectEEENS_7IntHashIjEENS_10HashTraitsIjEENS7_IS4_EEE3setERKjRKS4_ __ZN3WTF9HashTableIjSt4pairIjN3JSC12ProtectedPtrINS2_8JSObjectEEEENS_18PairFirstExtractorIS6_EENS_7IntHashIjEENS_14PairHashTrai __XPCEvaluate _WKPCEvaluate __ZN6WebKit27NetscapePluginInstanceProxy22willCallPluginFunctionEv __ZN6WebKit27NetscapePluginInstanceProxy8evaluateEjRKN7WebCore6StringERPcRj __ZNK3JSC21UStringSourceProvider6lengthEv __ZNK3JSC21UStringSourceProvider4dataEv __ZN6WebKit27NetscapePluginInstanceProxy12marshalValueEPN3JSC9ExecStateENS1_7JSValueERPcRj __ZN6WebKit27NetscapePluginInstanceProxy15addValueToArrayEP14NSMutableArrayPN3JSC9ExecStateENS3_7JSValueE __WKPHBooleanAndDataReply __ZN6WebKit27NetscapePluginInstanceProxy21didCallPluginFunctionEv __XPCGetStringIdentifier _WKPCGetStringIdentifier __XPCInvoke _WKPCInvoke __ZL27identifierFromIdentifierRepPN7WebCore13IdentifierRepE __ZN6WebKit27NetscapePluginInstanceProxy6invokeEjRKN3JSC10IdentifierEPcjRS5_Rj __ZNK3WTF7HashMapIjN3JSC12ProtectedPtrINS1_8JSObjectEEENS_7IntHashIjEENS_10HashTraitsIjEENS7_IS4_EEE3getERKj __ZN6WebKit27NetscapePluginInstanceProxy15demarshalValuesEPN3JSC9ExecStateEPcjRNS1_20MarkedArgumentBufferE __ZN6WebKit27NetscapePluginInstanceProxy23demarshalValueFromArrayEPN3JSC9ExecStateEP7NSArrayRmRNS1_7JSValueE __XPCReleaseObject _WKPCReleaseObject __ZN6WebKit27NetscapePluginInstanceProxy13releaseObjectEj __ZN6WebKit26HostedNetscapePluginStreamC1EPNS_27NetscapePluginInstanceProxyEjP12NSURLRequest __ZN6WebKit26HostedNetscapePluginStreamC2EPNS_27NetscapePluginInstanceProxyEjP12NSURLRequest __ZN3WTF7HashMapIjNS_6RefPtrIN6WebKit26HostedNetscapePluginStreamEEENS_7IntHashIjEENS_10HashTraitsIjEENS7_IS4_EEE3addERKjRKS4_ __ZN3WTF9HashTableIjSt4pairIjNS_6RefPtrIN6WebKit26HostedNetscapePluginStreamEEEENS_18PairFirstExtractorIS6_EENS_7IntHashIjEENS_ __ZN6WebKit26HostedNetscapePluginStream5startEv -[WebHostedNetscapePluginView createPluginBindingsInstance:] __ZN6WebKit27NetscapePluginInstanceProxy22createBindingsInstanceEN3WTF10PassRefPtrIN3JSC8Bindings10RootObjectEEE __WKPHGetScriptableNPObject __XPCInvalidateRect _WKPCInvalidateRect __ZN6WebKit27NetscapePluginInstanceProxy14invalidateRectEdddd __XPCGetScriptableNPObjectReply _WKPCGetScriptableNPObjectReply __ZN6WebKit13ProxyInstanceC1EN3WTF10PassRefPtrIN3JSC8Bindings10RootObjectEEEPNS_27NetscapePluginInstanceProxyEj __ZN6WebKit13ProxyInstanceC2EN3WTF10PassRefPtrIN3JSC8Bindings10RootObjectEEEPNS_27NetscapePluginInstanceProxyEj __ZN6WebKit27NetscapePluginInstanceProxy11addInstanceEPNS_13ProxyInstanceE __ZN3WTF7HashSetIPN6WebKit13ProxyInstanceENS_7PtrHashIS3_EENS_10HashTraitsIS3_EEE3addERKS3_ __ZN3WTF9HashTableIPN6WebKit13ProxyInstanceES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E6expandEv __ZN3WTF9HashTableIPN6WebKit13ProxyInstanceES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E6rehashEi __ZN3WTF9HashTableIPN6WebKit13ProxyInstanceES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E13allocate __ZN6WebKit27NetscapePluginInstanceProxy26GetScriptableNPObjectReplyD0Ev __ZN3JSC8Bindings8Instance12virtualBeginEv __ZNK6WebKit13ProxyInstance8getClassEv __ZN6WebKitL10proxyClassEv __ZNK6WebKit10ProxyClass10fieldNamedERKN3JSC10IdentifierEPNS1_8Bindings8InstanceE __ZN6WebKit13ProxyInstance10fieldNamedERKN3JSC10IdentifierE __WKPHNPObjectHasProperty __XPCIdentifierInfo _WKPCIdentifierInfo __ZN3WTF7HashMapINS_6RefPtrIN3JSC7UString3RepEEEPNS2_8Bindings5FieldENS_7StrHashIS5_EENS_10HashTraitsIS5_EENSB_IS8_EEE3addEPS4_ __ZN3WTF9HashTableINS_6RefPtrIN3JSC7UString3RepEEESt4pairIS5_PNS2_8Bindings5FieldEENS_18PairFirstExtractorISA_EENS_7StrHashIS5_ __ZNK6WebKit10ProxyClass12methodsNamedERKN3JSC10IdentifierEPNS1_8Bindings8InstanceE __ZN6WebKit13ProxyInstance12methodsNamedERKN3JSC10IdentifierE __WKPHNPObjectHasMethod __ZN3WTF7HashMapINS_6RefPtrIN3JSC7UString3RepEEEPNS2_8Bindings6MethodENS_7StrHashIS5_EENS_10HashTraitsIS5_EENSB_IS8_EEE3addEPS4 __ZN3WTF9HashTableINS_6RefPtrIN3JSC7UString3RepEEESt4pairIS5_PNS2_8Bindings6MethodEENS_18PairFirstExtractorISA_EENS_7StrHashIS5 __ZN3WTF6VectorIPN3JSC8Bindings6MethodELm0EEC1ERKS5_ __ZN3WTF6VectorIPN3JSC8Bindings6MethodELm0EEC2ERKS5_ __ZN3JSC8Bindings5Class14fallbackObjectEPNS_9ExecStateEPNS0_8InstanceERKNS_10IdentifierE __ZN3JSC8Bindings8Instance10virtualEndEv __ZN3JSC8Bindings8Instance18getOwnPropertySlotEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE __ZN6WebKit26HostedNetscapePluginStream7didFailEPN7WebCore26NetscapePlugInStreamLoaderERKNS1_13ResourceErrorE __WKPHStreamDidFail __ZN15WebChromeClient10windowRectEv __ZN6WebKit13ProxyInstanceD0Ev __ZN3WTF20deleteAllPairSecondsIPN3JSC8Bindings5FieldEKNS_7HashMapINS_6RefPtrINS1_7UString3RepEEES4_NS_7StrHashIS9_EENS_10HashTr __ZN3WTF20deleteAllPairSecondsIPN3JSC8Bindings6MethodEKNS_7HashMapINS_6RefPtrINS1_7UString3RepEEES4_NS_7StrHashIS9_EENS_10HashT __ZN6WebKit27NetscapePluginInstanceProxy14removeInstanceEPNS_13ProxyInstanceE __ZN3WTF9HashTableIPN6WebKit13ProxyInstanceES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E4findIS3_N __ZN3WTF9HashTableIPN6WebKit13ProxyInstanceES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E47removeAn __ZN3WTF9HashTableIPN6WebKit13ProxyInstanceES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E6removeEPS __ZN6WebKit13ProxyInstance10invalidateEv __WKPHNPObjectRelease __ZN3WTF6VectorINS_6RefPtrIN6WebKit26HostedNetscapePluginStreamEEELm0EE14expandCapacityEm __ZN3WTF6VectorINS_6RefPtrIN6WebKit26HostedNetscapePluginStreamEEELm0EE15reserveCapacityEm __ZN6WebKit26HostedNetscapePluginStream4stopEv __ZN3WTF6VectorINS_6RefPtrIN6WebKit26HostedNetscapePluginStreamEEELm0EE6shrinkEm __ZN3JSC21UStringSourceProviderD0Ev -[WebView(WebIBActions) goForward:] -[WebView goForward] -[WebFramePolicyListener download] __ZN20WebFrameLoaderClient8downloadEPN7WebCore14ResourceHandleERKNS0_15ResourceRequestES5_RKNS0_16ResourceResponseE -[WebDownload _initWithLoadingConnection:request:response:delegate:proxy:] -[WebDownload _setRealDelegate:] -[WebDownloadInternal setRealDelegate:] -[WebDownload init] -[WebDownloadInternal respondsToSelector:] -[WebDownloadInternal downloadDidBegin:] -[WebDownloadInternal download:didReceiveResponse:] __ZNK20WebFrameLoaderClient25setOriginalURLForDownloadEP11WebDownloadRKN7WebCore15ResourceRequestE __ZN20WebFrameLoaderClient29interruptForPolicyChangeErrorERKN7WebCore15ResourceRequestE -[WebDownloadInternal download:didReceiveDataOfLength:] -[WebDownloadInternal download:decideDestinationWithSuggestedFilename:] -[NSFileManager(WebNSFileManagerExtras) _webkit_setMetadataURL:referrer:atPath:] _setMetaData _WKSetMetadataURL -[WebDownloadInternal download:didCreateDestination:] -[WebDownloadInternal downloadDidFinish:] -[WebDownload dealloc] -[WebDownloadInternal dealloc] __ZN20NetscapePluginWidget11handleEventEPN7WebCore5EventE -[WebHostedNetscapePluginView handleMouseMoved:] __ZN6WebKit27NetscapePluginInstanceProxy10mouseEventEP6NSViewP7NSEvent16NPCocoaEventType __WKPHPluginInstanceMouseEvent __ZN6WebKit26HostedNetscapePluginStream18didReceiveResponseEPN7WebCore26NetscapePlugInStreamLoaderERKNS1_16ResourceResponseE _WKGetNSURLResponseLastModifiedDate __ZN6WebKit26HostedNetscapePluginStream11startStreamEP5NSURLxP6NSDateP8NSStringP6NSData -[NSURL(WebNSURLExtras) _web_URLCString] __WKPHStartStream __ZNK6WebKit26HostedNetscapePluginStream15wantsAllStreamsEv __ZN6WebKit26HostedNetscapePluginStream14didReceiveDataEPN7WebCore26NetscapePlugInStreamLoaderEPKci __WKPHStreamDidReceiveData __ZN6WebKit26HostedNetscapePluginStream16didFinishLoadingEPN7WebCore26NetscapePlugInStreamLoaderE __WKPHStreamDidFinishLoading __ZN6WebKit27NetscapePluginInstanceProxy16disconnectStreamEPNS_26HostedNetscapePluginStreamE __ZN6WebKit26HostedNetscapePluginStreamD0Ev -[WebHostedNetscapePluginView mouseExited:] __ZN20WebFrameLoaderClient18dispatchCreatePageEv -[WebBaseNetscapePluginView preferencesHaveChanged:] __ZN20WebFrameLoaderClient12dispatchShowEv -[WebBaseNetscapePluginView windowResignedKey:] -[WebView(WebPendingPublic) canMarkAllTextMatches] -[WebView(WebPendingPublic) searchFor:direction:caseSensitive:wrap:startInSelection:] -[WebHTMLView(WebDocumentPrivateProtocols) searchFor:direction:caseSensitive:wrap:startInSelection:] -[WebView(WebPendingPublic) rectsForTextMatches] -[WebHTMLView(WebDocumentInternalProtocols) rectsForTextMatches] __ZN3WTF6VectorIN7WebCore7IntRectELm0EE6shrinkEm -[WebHTMLView(WebDocumentPrivateProtocols) selectionRect] -[WebHTMLView(WebDocumentPrivateProtocols) selectionTextRects] __ZN3WTF6VectorIN7WebCore9FloatRectELm0EE6shrinkEm -[WebHTMLView(WebDocumentPrivateProtocols) selectionImageForcingBlackText:] -[WebHTMLView(WebDocumentPrivateProtocols) selectedString] -[WebFrame(WebInternal) _selectedString] -[WebBaseNetscapePluginView windowBecameKey:] -[WebHostedNetscapePluginView windowFrameDidChange:] +[WebStringTruncator widthOfString:font:] __ZN3WTF6VectorIPN3JSC8Bindings6MethodELm0EE14expandCapacityEmPKS4_ __ZN3WTF6VectorIPN3JSC8Bindings6MethodELm0EE14expandCapacityEm __ZN3WTF6VectorIPN3JSC8Bindings6MethodELm0EE15reserveCapacityEm __ZN3WTF6VectorIPN3JSC8Bindings6MethodELm0EE6shrinkEm __ZN6WebKit13ProxyInstance12invokeMethodEPN3JSC9ExecStateERKN3WTF6VectorIPNS1_8Bindings6MethodELm0EEERKNS1_7ArgListE __ZN6WebKit13ProxyInstance6invokeEPN3JSC9ExecStateE10InvokeTypeyRKNS1_7ArgListE __ZN6WebKit27NetscapePluginInstanceProxy13marshalValuesEPN3JSC9ExecStateERKNS1_7ArgListE __WKPHNPObjectInvoke __XPCBooleanAndDataReply _WKPCBooleanAndDataReply __ZN6WebKit27NetscapePluginInstanceProxy14demarshalValueEPN3JSC9ExecStateEPKcj __ZN6WebKit27NetscapePluginInstanceProxy19BooleanAndDataReplyD0Ev -[NSString(WebNSURLExtras) _webkit_stringByReplacingValidPercentEscapes] -[WebFrame findFrameNamed:] __ZN6WebKit27NetscapePluginInstanceProxy18evaluateJavaScriptEPNS0_13PluginRequestE -[WebHostedNetscapePluginView mouseEntered:] -[WebView(WebIBActions) stopLoading:] __ZN6WebKit11ProxyMethodD0Ev -[WebDownloadInternal download:shouldDecodeSourceDataOfMIMEType:] __ZN20WebFrameLoaderClient25pluginWillHandleLoadErrorERKN7WebCore16ResourceResponseE -[NSError(WebKitExtras) _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:] -[WebHTMLRepresentation receivedError:withDataSource:] _WKDrawMediaUIPart __ZL24createCGImageRefFromDataPKhj __ZL14drawMediaImageP9CGContext6CGRectP7CGImage _WKDrawMediaSliderTrack _WKQTMovieMaxTimeSeekable __ZN15WebChromeClient5focusEv __Z13webGetNSImagePN7WebCore5ImageE7_NSSize __ZL12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_ __ZL12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_S0_ __ZL12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_S0_S0_S0_ __ZL12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_S0_S0_ __ZL12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_ __Z24CallResourceLoadDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS2_S0_iS0_ __ZL12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_iS0_ __ZSt16__introsort_loopIPiiEvT_S1_T0_ __ZL9setCursorP8NSWindowP13objc_selector8_NSPoint +[WebNetscapePluginPackage initialize] _WebLMGetCurApRefNum _WebLMSetCurApRefNum +[WebNetscapePluginDocumentView initialize] -[WebNetscapePluginDocumentView .cxx_construct] -[WebNetscapePluginDocumentView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:ele -[WebNetscapePluginDocumentView setAttributeKeys:andValues:] -[WebNetscapePluginPackage load] -[WebNetscapePluginPackage _tryLoad] -[WebNetscapePluginPackage _applyDjVuWorkaround] -[WebNetscapePluginDocumentView createPlugin] -[WebNetscapePluginPackage open] -[WebNetscapePluginDocumentView(Internal) _createPlugin] +[WebNetscapePluginDocumentView setCurrentPluginView:] -[WebNetscapePluginPackage pluginFuncs] _NPN_UserAgent __Z21pluginViewForInstanceP4_NPP +[WebNetscapePluginDocumentView currentPluginView] -[WebNetscapePluginDocumentView(WebNPPCallbacks) userAgent] _NPN_GetValue -[WebNetscapePluginDocumentView(WebNPPCallbacks) getVariable:value:] _NPN_SetValue -[WebNetscapePluginDocumentView(WebNPPCallbacks) setVariable:value:] _NPN_InvalidateRect -[WebNetscapePluginDocumentView(WebNPPCallbacks) invalidateRect:] __ZN29WebNetscapePluginEventHandler6createEP29WebNetscapePluginDocumentView -[WebNetscapePluginDocumentView eventModel] __ZN35WebNetscapePluginEventHandlerCarbonC1EP29WebNetscapePluginDocumentView __ZN35WebNetscapePluginEventHandlerCarbonC2EP29WebNetscapePluginDocumentView -[WebNetscapePluginDocumentView updateAndSetWindow] -[WebNetscapePluginDocumentView saveAndSetNewPortState] -[WebNetscapePluginDocumentView saveAndSetNewPortStateForUpdate:] -[WebNetscapePluginDocumentView superviewsHaveSuperviews] -[WebNetscapePluginDocumentView setWindowIfNecessary] -[WebNetscapePluginDocumentView isNewWindowEqualToOldWindow] -[WebNetscapePluginDocumentView willCallPlugInFunction] -[WebNetscapePluginDocumentView didCallPlugInFunction] -[WebNetscapePluginDocumentView restorePortState:] -[WebNetscapePluginDocumentView windowFocusChanged:] __ZN35WebNetscapePluginEventHandlerCarbon18windowFocusChangedEb __ZL14getCarbonEventP11EventRecord __ZN35WebNetscapePluginEventHandlerCarbon9sendEventEP11EventRecord -[WebNetscapePluginDocumentView sendEvent:isDrawRect:] -[WebNetscapePluginDocumentView stopTimers] -[WebBaseNetscapePluginView stopTimers] __ZN35WebNetscapePluginEventHandlerCarbon10stopTimersEv -[WebNetscapePluginDocumentView startTimers] -[WebBaseNetscapePluginView startTimers] __ZN35WebNetscapePluginEventHandlerCarbon11startTimersEb -[WebNetscapePluginDocumentView loadStream] -[WebNetscapePluginDocumentView(Internal) _shouldCancelSrcStream] -[NSURL(WebNSURLExtras) _web_isEmpty] -[WebNetscapePluginDocumentView(WebNPPCallbacks) loadRequest:inTarget:withNotifyData:sendNotification:] __ZN23WebNetscapePluginStreamC1EP12NSURLRequestP4_NPPbPv __ZN23WebNetscapePluginStreamC2EP12NSURLRequestP4_NPPbPv __ZN23WebNetscapePluginStream9setPluginEP4_NPP -[WebBaseNetscapePluginView pluginPackage] __ZL7streamsv __ZN3WTF7HashMapIP9_NPStreamP4_NPPNS_7PtrHashIS2_EENS_10HashTraitsIS2_EENS7_IS4_EEE3addERKS2_RKS4_ __ZN3WTF9HashTableIP9_NPStreamSt4pairIS2_P4_NPPENS_18PairFirstExtractorIS6_EENS_7PtrHashIS2_EENS_14PairHashTraitsINS_10HashTrai __ZN3WTF7HashSetINS_6RefPtrI23WebNetscapePluginStreamEENS_7PtrHashIS3_EENS_10HashTraitsIS3_EEE3addERKS3_ __ZN3WTF9HashTableINS_6RefPtrI23WebNetscapePluginStreamEES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES __ZN23WebNetscapePluginStream5startEv __ZN3WTF6VectorI6CGRectLm16EE6shrinkEm -[WebNetscapePluginDocumentView drawRect:] -[WebNetscapePluginDocumentView sendDrawRectEvent:] __ZN35WebNetscapePluginEventHandlerCarbon8drawRectEP9CGContextRK7_NSRect __ZN35WebNetscapePluginEventHandlerCarbon19nullEventTimerFiredEP16__CFRunLoopTimerPv __ZN35WebNetscapePluginEventHandlerCarbon13sendNullEventEv __ZN23WebNetscapePluginStream18didReceiveResponseEPN7WebCore26NetscapePlugInStreamLoaderERKNS0_16ResourceResponseE __ZN23WebNetscapePluginStream11startStreamEP5NSURLxP6NSDateP8NSStringP6NSData __ZNK23WebNetscapePluginStream15wantsAllStreamsEv __ZN23WebNetscapePluginStream14didReceiveDataEPN7WebCore26NetscapePlugInStreamLoaderEPKci __ZN23WebNetscapePluginStream11deliverDataEv __ZN23WebNetscapePluginStream16didFinishLoadingEPN7WebCore26NetscapePlugInStreamLoaderE __ZN23WebNetscapePluginStream23destroyStreamWithReasonEs __ZN23WebNetscapePluginStream13destroyStreamEv -[WebNetscapePluginDocumentView disconnectStream:] __ZN23WebNetscapePluginStreamD0Ev -[WebNetscapePluginDocumentView createPluginScriptableObject] _NPN_MemFree _NPN_PostURLNotify -[WebNetscapePluginDocumentView(WebNPPCallbacks) postURLNotify:target:len:buf:file:notifyData:] -[WebNetscapePluginDocumentView(WebNPPCallbacks) _postURL:target:len:buf:file:notifyData:sendNotification:allowHeaders:] -[NSData(WebNSDataExtras) _web_startsWithBlankLine] -[NSData(WebNSDataExtras) _web_locationAfterFirstBlankLine] -[NSData(WebNSDataExtras) _webkit_parseRFC822HeaderFields] -[NSString(WebNSDataExtrasInternal) _web_capitalizeRFC822HeaderFieldName] _NPN_GetURLNotify -[WebNetscapePluginDocumentView(WebNPPCallbacks) getURLNotify:target:notifyData:] _NPN_GetURL -[WebNetscapePluginDocumentView(WebNPPCallbacks) getURL:target:] -[WebPluginRequest initWithRequest:frameName:notifyData:sendNotification:didStartFromUserGesture:] -[WebNetscapePluginDocumentView(WebNPPCallbacks) loadPluginRequest:] -[WebPluginRequest request] -[WebPluginRequest frameName] -[WebNetscapePluginDocumentView(WebNPPCallbacks) evaluateJavaScriptPluginRequest:] -[WebPluginRequest isCurrentEventUserGesture] -[WebPluginRequest sendNotification] -[WebPluginRequest dealloc] -[WebHistoryItem(WebPrivate) _getDailyVisitCounts:] -[WebHistoryItem(WebPrivate) _getWeeklyVisitCounts:] -[WebHistoryItem(WebPrivate) _lastVisitWasHTTPNonGet] -[WebHistoryItem(WebPrivate) lastVisitWasFailure] -[WebHistoryItem(WebPrivate) _redirectURLs] -[WebView(WebIBActions) reload:] -[WebFrame reload] __Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectj __ZL12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_j -[WebNetscapePluginDocumentView mouseEntered:] __ZN35WebNetscapePluginEventHandlerCarbon12mouseEnteredEP7NSEvent __ZL14getCarbonEventP11EventRecordP7NSEvent _WKConvertNSEventToCarbonEvent -[WebNetscapePluginDocumentView handleMouseMoved:] __ZN35WebNetscapePluginEventHandlerCarbon10mouseMovedEP7NSEvent -[WebBaseNetscapePluginView acceptsFirstResponder] -[WebBaseNetscapePluginView becomeFirstResponder] -[WebNetscapePluginDocumentView focusChanged] __ZN35WebNetscapePluginEventHandlerCarbon12focusChangedEb __ZN35WebNetscapePluginEventHandlerCarbon22installKeyEventHandlerEv -[WebNetscapePluginDocumentView mouseDown:] __ZN35WebNetscapePluginEventHandlerCarbon9mouseDownEP7NSEvent -[WebNetscapePluginDocumentView inputContext] -[WebNetscapePluginDocumentView mouseUp:] __ZN35WebNetscapePluginEventHandlerCarbon7mouseUpEP7NSEvent -[WebNetscapePluginDocumentView mouseExited:] __ZN35WebNetscapePluginEventHandlerCarbon11mouseExitedEP7NSEvent -[WebNetscapePluginDocumentView mouseDragged:] __ZN35WebNetscapePluginEventHandlerCarbon12mouseDraggedEP7NSEvent -[WebNetscapePluginDocumentView keyDown:] __ZN35WebNetscapePluginEventHandlerCarbon7keyDownEP7NSEvent _WKSendKeyEventToTSM __ZN35WebNetscapePluginEventHandlerCarbon15TSMEventHandlerEP25OpaqueEventHandlerCallRefP14OpaqueEventRefPv -[WebNetscapePluginDocumentView keyUp:] __ZN35WebNetscapePluginEventHandlerCarbon5keyUpEP7NSEvent -[WebNetscapePluginDocumentView flagsChanged:] __ZN35WebNetscapePluginEventHandlerCarbon12flagsChangedEP7NSEvent -[WebBaseNetscapePluginView resignFirstResponder] __ZN35WebNetscapePluginEventHandlerCarbon21removeKeyEventHandlerEv -[WebNetscapePluginDocumentView shouldStop] -[WebNetscapePluginDocumentView destroyPlugin] -[WebNetscapePluginDocumentView(Internal) _destroyPlugin] -[WebNetscapePluginPackage close] __ZN35WebNetscapePluginEventHandlerCarbonD0Ev -[WebNetscapePluginDocumentView dealloc] -[WebNetscapePluginDocumentView fini] -[WebNetscapePluginDocumentView .cxx_destruct] __ZL12CallDelegatePFP11objc_objectS0_P13objc_selectorzEP7WebViewS0_S2_S0_dS0_S0_ -[WebViewFactory imageTitleForFilename:width:height:] -[WebHTMLRepresentation matchLabels:againstElement:] -[WebHTMLRepresentation searchForLabels:beforeElement:] __ZN20WebFrameLoaderClient22createJavaAppletWidgetERKN7WebCore7IntSizeEPNS0_17HTMLAppletElementERKNS0_4KURLERKN3WTF6VectorINS0_ __ZL14parameterValueRKN3WTF6VectorIN7WebCore6StringELm0EEES5_RKS2_ __ZN7WebCore6Widget11handleEventEPNS_5EventE __ZN20WebFrameLoaderClient10javaAppletEP6NSView -[WebPluginController webPlugInContainerShowStatus:] __ZN20WebFrameLoaderClient21fileDoesNotExistErrorERKN7WebCore16ResourceResponseE __ZN23WebNetscapePluginStream7didFailEPN7WebCore26NetscapePlugInStreamLoaderERKNS0_13ResourceErrorE __ZN23WebNetscapePluginStream22destroyStreamWithErrorEP7NSError __ZN23WebNetscapePluginStream14reasonForErrorEP7NSError __ZN13WebDragClient24declareAndWriteDragImageEP12NSPasteboardP10DOMElementP5NSURLP8NSStringPN7WebCore5FrameE __ZL14getTopHTMLViewPN7WebCore5FrameE -[NSPasteboard(WebExtras) _web_declareAndWriteDragImageForElement:URL:title:archive:source:] +[NSPasteboard(WebExtras) _web_writableTypesForImageIncludingArchive:] __ZL33_writableTypesForImageWithArchivev __ZL36_writableTypesForImageWithoutArchivev +[NSPasteboard(WebExtras) _web_writableTypesForURL] -[NSPasteboard(WebExtras) _web_writeImage:element:URL:title:archive:types:source:] -[NSPasteboard(WebExtras) _web_writeURL:andTitle:types:] +[WebURLsWithTitles writeURLs:andTitles:toPasteboard:] +[WebURLsWithTitles arrayWithIFURLsWithTitlesPboardType] -[WebHTMLView(WebInternal) setPromisedDragTIFFDataSource:] __ZL18promisedDataClientv __ZN7WebCore20CachedResourceClient12imageChangedEPNS_11CachedImageEPKNS_7IntRectE __ZN7WebCore20CachedResourceClient14notifyFinishedEPNS_14CachedResourceE __ZN13WebDragClient27willPerformDragSourceActionEN7WebCore16DragSourceActionERKNS0_8IntPointEPNS0_9ClipboardE -[WebDefaultUIDelegate webView:willPerformDragSourceAction:fromPoint:withPasteboard:] __ZN13WebDragClient9startDragEN3WTF9RetainPtrI7NSImageEERKN7WebCore8IntPointES7_PNS4_9ClipboardEPNS4_5FrameEb -[WebHTMLView(WebInternal) _mouseDownEvent] -[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:] -[WebHTMLView draggingSourceOperationMaskForLocal:] -[WebHTMLView draggedImage:movedTo:] -[WebFrame(WebInternal) _dragSourceMovedTo:] -[WebView draggingExited:] -[WebHTMLView draggedImage:endedAt:operation:] -[WebFrame(WebInternal) _dragSourceEndedAt:operation:] -[WebNetscapePluginDocumentView setLayer:] __ZN34WebNetscapePluginEventHandlerCocoaC1EP29WebNetscapePluginDocumentView __ZN34WebNetscapePluginEventHandlerCocoaC2EP29WebNetscapePluginDocumentView __ZN34WebNetscapePluginEventHandlerCocoa18windowFocusChangedEb __ZN34WebNetscapePluginEventHandlerCocoa9sendEventEP13_NPCocoaEvent __ZN29WebNetscapePluginEventHandler10stopTimersEv __ZN29WebNetscapePluginEventHandler11startTimersEb _NPN_ConvertPoint -[WebBaseNetscapePluginView convertFromX:andY:space:toX:andY:space:] __Z26browserContainerCheckFuncsv _WKN_CheckIfAllowedToLoadURL -[WebNetscapePluginDocumentView checkIfAllowedToLoadURL:frame:callbackFunc:context:] -[WebNetscapeContainerCheckContextInfo initWithCheckRequestID:callbackFunc:context:] +[WebPluginContainerCheck checkWithRequest:target:resultObject:selector:controller:contextInfo:] -[WebPluginContainerCheck initWithRequest:target:resultObject:selector:controller:contextInfo:] -[WebPluginContainerCheck start] -[WebPluginContainerCheck _isForbiddenFileLoad] -[WebPluginContainerCheck _askPolicyDelegate] -[WebPluginContainerCheck _actionInformationWithURL:] -[WebPolicyDecisionListener _initWithTarget:action:] -[WebPolicyDecisionListenerPrivate initWithTarget:action:] -[WebPolicyDecisionListener use] -[WebPolicyDecisionListener _usePolicy:] -[WebPluginContainerCheck _continueWithPolicy:] -[WebNetscapePluginDocumentView _containerCheckResult:contextInfo:] -[WebNetscapeContainerCheckContextInfo callback] -[WebNetscapeContainerCheckContextInfo context] -[WebNetscapeContainerCheckContextInfo checkRequestID] -[WebNetscapePluginDocumentView plugin] -[WebNetscapePluginDocumentView _webPluginContainerCancelCheckIfAllowedToLoadRequest:] -[WebPluginContainerCheck contextInfo] -[WebNetscapePluginDocumentView cancelCheckIfAllowedToLoadURL:] -[WebPluginContainerCheck cancel] -[WebPolicyDecisionListener _invalidate] -[WebPolicyDecisionListener dealloc] -[WebPolicyDecisionListenerPrivate dealloc] -[WebPluginContainerCheck dealloc] _NPN_MemAlloc __ZN34WebNetscapePluginEventHandlerCocoaD0Ev -[WebView _pluginForExtension:] -[WebPluginDatabase pluginForExtension:] -[WebBasePluginPackage extensionEnumerator] -[WebBasePluginPackage MIMETypeForExtension:] __ZN34WebNetscapePluginEventHandlerCocoa10mouseMovedEP7NSEvent __ZN34WebNetscapePluginEventHandlerCocoa14sendMouseEventEP7NSEvent16NPCocoaEventType __ZN34WebNetscapePluginEventHandlerCocoa11mouseExitedEP7NSEvent __ZN15WebChromeClient12createWindowEPN7WebCore5FrameERKNS0_16FrameLoadRequestERKNS0_14WindowFeaturesE __Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectS4_ __ZL12CallDelegateP7WebViewP11objc_objectP13objc_selectorS2_S2_ __ZN15WebChromeClient18setToolbarsVisibleEb __ZN15WebChromeClient19setStatusbarVisibleEb __ZN15WebChromeClient20setScrollbarsVisibleEb __ZN15WebChromeClient17setMenubarVisibleEb __ZN15WebChromeClient12setResizableEb __ZN15WebChromeClient8pageRectEv __ZN15WebChromeClient13setWindowRectERKN7WebCore9FloatRectE __ZN15WebChromeClient4showEv __ZN34WebNetscapePluginEventHandlerCocoa12mouseEnteredEP7NSEvent __ZN34WebNetscapePluginEventHandlerCocoa12focusChangedEb __ZN34WebNetscapePluginEventHandlerCocoa22installKeyEventHandlerEv __ZN34WebNetscapePluginEventHandlerCocoa9mouseDownEP7NSEvent __ZN34WebNetscapePluginEventHandlerCocoa12mouseDraggedEP7NSEvent __ZN34WebNetscapePluginEventHandlerCocoa7mouseUpEP7NSEvent -[WebBaseNetscapePluginView windowWillClose:] -[WebFrameView keyDown:] -[WebFrameView(WebFrameViewFileInternal) _web_frame] -[WebNetscapePluginDocumentView scrollWheel:] __ZN35WebNetscapePluginEventHandlerCarbon11scrollWheelEP7NSEvent __ZN3WTF6VectorINS_6RefPtrI23WebNetscapePluginStreamEELm0EE14expandCapacityEm __ZN3WTF6VectorINS_6RefPtrI23WebNetscapePluginStreamEELm0EE15reserveCapacityEm __ZN23WebNetscapePluginStream4stopEv __ZN23WebNetscapePluginStream35cancelLoadAndDestroyStreamWithErrorEP7NSError __ZN23WebNetscapePluginStream19cancelLoadWithErrorEP7NSError __ZN3WTF6VectorINS_6RefPtrI23WebNetscapePluginStreamEELm0EE6shrinkEm -[WebHTMLView(WebPrivate) pasteboard:provideDataForType:] -[WebHTMLView(WebInternal) promisedDragTIFFDataSource] -[WebArchive initWithData:] -[WebArchivePrivate init] -[WebArchivePrivate setCoreArchive:] -[NSPasteboard(WebExtras) _web_writePromisedRTFDFromArchive:containsImage:] -[WebResource(WebResourcePrivate) _fileWrapperRepresentation] -[WebResource(WebResourcePrivate) _suggestedFilename] -[NSPasteboard(WebExtras) _web_writeFileWrapperAsRTFDAttachment:] __ZN15WebChromeClient16statusbarVisibleEv __Z30CallUIDelegateReturningBooleanaP7WebViewP13objc_selector -[WebIconDatabase releaseIconForURL:] -[WebPreferences setSerifFontFamily:] -[WebPreferences setSansSerifFontFamily:] -[WebPreferences setCursiveFontFamily:] -[WebPreferences setFantasyFontFamily:] -[WebPreferences setTabsToLinks:] -[WebPreferences setUsesPageCache:] +[WebPluginDatabase setAdditionalWebPlugInPaths:] -[WebHistory removeAllItems] -[WebHistoryPrivate removeAllItems] +[WebCache empty] -[WebBackForwardList pageCacheSize] -[WebBackForwardList setPageCacheSize:] -[WebView(WebPrivate) setUsesPageCache:] -[WebIconDatabase(WebPendingPublic) removeAllIcons] __ZN21WebIconDatabaseClient25dispatchDidRemoveAllIconsEv -[WebIconDatabase(WebInternal) _sendDidRemoveAllIconsNotification] -[WebView(WebPendingPublic) setMediaVolume:] -[WebView(WebDebugBinding) addObserver:forKeyPath:options:context:] -[WebView(WebPrivate) setObservationInfo:] +[WebView(WebPrivate) automaticallyNotifiesObserversForKey:] -[WebView(WebPrivate) drawRect:] -[WebView(WebIBActions) makeTextStandardSize:] -[WebView _resetZoom:isTextOnly:] -[WebView(WebPendingPublic) resetPageZoom:] -[WebView(WebPrivate) _setDashboardBehavior:to:] -[WebView(WebPrivate) _clearMainFrameName] -[WebPreferences(WebPrivate) setAuthorAndUserStylesEnabled:] -[WebPreferences(WebPrivate) setOfflineWebApplicationCacheEnabled:] -[WebPreferences(WebPrivate) setDeveloperExtrasEnabled:] -[WebView(WebViewEditing) setSmartInsertDeleteEnabled:] -[WebView(WebPrivate) setSelectTrailingWhitespaceEnabled:] -[WebView(WebPrivate) inspector] -[WebInspector initWithWebView:] -[WebInspector setJavaScriptProfilingEnabled:] +[WebView(WebPrivate) _setUsesTestModeFocusRingColor:] -[WebDefaultPolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:] -[WebDefaultPolicyDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:] -[WebFrame windowObject] -[WebFrame globalContext] -[WebHTMLView accessibilityFocusedUIElement] -[WebFrame(WebInternal) _accessibilityTree] -[WebFrame(WebPrivate) _pendingFrameUnloadEventCount] -[NSView(WebExtras) _web_parentWebFrameView] -[WebHistoryItem hash] -[WebClipView _focusRingVisibleRect] +[WebView(WebPrivate) _pointingHandCursor] -[NSEvent(WebExtras) _web_isDeleteKeyEvent] -[WebFrameView allowsScrolling] -[WebFrameView _scrollLineHorizontally:] -[WebFrameView _scrollOverflowInDirection:granularity:] -[WebFrameView(WebPrivate) _hasScrollBars] -[WebFrameView(WebPrivate) _largestChildWithScrollBars] -[WebHostedNetscapePluginView mouseDown:] -[WebHostedNetscapePluginView mouseDragged:] -[WebHostedNetscapePluginView mouseUp:] -[WebHostedNetscapePluginView scrollWheel:] -[WebViewFactory unregisterUniqueIdForUIElement:] _WKUnregisterUniqueIdForElement -[WebViewFactory accessibilityHandleFocusChanged] _WKAccessibilityHandleFocusChanged -[WebViewFactory textMarkerWithBytes:length:] _WKCreateAXTextMarker -[WebViewFactory objectIsTextMarker:] _WKGetAXTextMarkerTypeID -[WebViewFactory objectIsTextMarkerRange:] _WKGetAXTextMarkerRangeTypeID -[WebHTMLView accessibilityAttributeValue:] -[WebHTMLView _accessibilityParentForSubview:] -[WebViewFactory AXWebAreaText] -[WebViewFactory AXLinkText] -[WebViewFactory AXHeadingText] -[WebViewFactory AXDefinitionListTermText] -[WebViewFactory AXDefinitionListDefinitionText] -[WebViewFactory fileButtonChooseFileLabel] -[WebViewFactory fileButtonNoFileSelectedLabel] -[WebViewFactory textMarkerRangeWithStart:end:] _WKCreateAXTextMarkerRange -[WebFrame(WebPrivate) _numberOfActiveAnimations] -[WebFrame(WebPrivate) _pauseAnimation:onNode:atTime:] -[WebFrame(WebKitDebug) renderTreeAsExternalRepresentation] +[WebCoreStatistics garbageCollectJavaScriptObjects] -[WebNullPluginView initWithFrame:error:DOMElement:] -[WebNullPluginView viewDidMoveToWindow] -[WebNullPluginView reportFailure] -[WebNullPluginView dealloc] -[WebInspector webViewClosed] -[WebView(WebDebugBinding) removeObserver:forKeyPath:] +[WebCoreStatistics emptyCache] +[NSObject(WebScripting) isKeyExcludedFromWebScript:] -[WebIconDatabase iconURLForURL:] __ZN15WebChromeClient7repaintERKN7WebCore7IntRectEbbb -[WebHistoryItem(WebPrivate) RSSFeedReferrer] -[WebViewFactory refreshPlugins] -[WebViewFactory searchableIndexIntroduction] __ZN15WebChromeClient15closeWindowSoonEv -[WebView(WebPrivate) _closeWindow] -[WebHTMLView validRequestorForSendType:returnType:] -[WebHTMLView(WebDocumentPrivateProtocols) pasteboardTypesForSelection] -[WebHTMLView(WebInternal) _canSmartCopyOrDelete] -[WebHTMLView(WebInternal) isGrammarCheckingEnabled] -[WebView(WebPendingPublic) canResetPageZoom] -[WebView _canResetZoom:] -[WebView(WebIBActions) canMakeTextStandardSize] -[WebView(WebPendingPublic) canZoomPageIn] -[WebView(WebPendingPublic) canZoomPageOut] -[WebHTMLRepresentation canProvideDocumentSource] -[WebFrame(WebInternal) _canProvideDocumentSource] -[WebView supportsTextEncoding] -[WebHTMLView(WebDocumentPrivateProtocols) supportsTextEncoding] __ZN15WebEditorClient26shouldMoveRangeAfterDeleteEPN7WebCore5RangeES2_ -[WebDefaultEditingDelegate webView:shouldMoveRangeAfterDelete:replacingRange:] __ZN15WebEditorClient25shouldShowDeleteInterfaceEPN7WebCore11HTMLElementE __ZN15WebEditorClient16shouldEndEditingEPN7WebCore5RangeE -[WebView(WebPrivate) _executeCoreCommandByName:value:] __ZN15WebChromeClient18runJavaScriptAlertEPN7WebCore5FrameERKNS0_6StringE __ZNK15WebEditorClient7canUndoEv __ZN15WebEditorClient4undoEv -[WebEditorUndoTarget undoEditing:] -[WebEditCommand command] __ZN15WebEditorClient22registerCommandForRedoEN3WTF10PassRefPtrIN7WebCore11EditCommandEEE __ZN15WebEditorClient23textDidChangeInTextAreaEPN7WebCore7ElementE __ZN15WebChromeClient7unfocusEv -[WebDefaultUIDelegate webViewUnfocus:] __ZN15WebEditorClient33didSetSelectionTypesForPasteboardEv -[WebDefaultEditingDelegate webView:didSetSelectionTypesForPasteboard:] __ZN15WebEditorClient29didWriteSelectionToPasteboardEv -[WebDefaultEditingDelegate webView:didWriteSelectionToPasteboard:] -[WebHTMLView(WebInternal) paste:] -[WebHTMLView callDelegateDoCommandBySelectorIfNeeded:] -[WebHTMLView(WebHTMLViewFileInternal) _pasteWithPasteboard:allowPlainText:] -[WebView(WebViewInternal) _setInsertionPasteboard:] -[WebHTMLView(WebHTMLViewFileInternal) _documentFragmentFromPasteboard:inContext:allowPlainText:] -[WebHTMLView(WebPrivate) _documentFragmentFromPasteboard:forType:inContext:subresources:] -[WebHTMLView(WebHTMLViewFileInternal) _dataSource] -[WebDataSource(WebInternal) _documentFragmentWithArchive:] -[WebArchive(WebInternal) _coreLegacyWebArchive] -[WebFrame(WebInternal) _documentFragmentWithMarkupString:baseURLString:] -[WebHTMLView(WebHTMLViewFileInternal) _shouldInsertFragment:replacingDOMRange:givenAction:] -[WebHTMLView(WebPrivate) _canSmartReplaceWithPasteboard:] -[WebFrame(WebPrivate) _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:] -[WebView(WebIBActions) _responderValidateUserInterfaceItem:] -[WebView(WebFileInternal) _responderForResponderOperations] -[NSView(WebExtras) _web_firstResponderIsSelfOrDescendantView] __ZN15WebChromeClient5printEPN7WebCore5FrameE __ZNK15WebEditorClient7canRedoEv __ZN15WebEditorClient4redoEv -[WebEditorUndoTarget redoEditing:] -[DOMDocument(WebDOMDocumentOperations) URLWithAttributeString:] -[WebView(WebPrivate) _catchesDelegateExceptions] __ZNK19WebPasteboardHelper22fragmentFromPasteboardEPK12NSPasteboard -[WebHTMLView(WebInternal) _documentFragmentFromPasteboard:] __ZN15WebEditorClient16shouldInsertNodeEPN7WebCore4NodeEPNS0_5RangeENS0_18EditorInsertActionE __ZN15WebEditorClient17userVisibleStringEP5NSURL _WKGetExtensionsForMIMEType -[WebHTMLView(WebPrivate) _hasHTMLDocument] +[WebHTMLView(WebHTMLViewFileInternal) _excludedElementsForAttributedStringConversion] +[NSURL(WebDataURL) _web_uniqueWebDataURL] -[WebResource initWithData:URL:MIMEType:textEncodingName:frameName:] -[WebResource(WebResourcePrivate) _initWithData:URL:MIMEType:textEncodingName:frameName:response:copyData:] __ZN7WebCore20ResourceResponseBaseD2Ev -[WebDataSource addSubresource:] -[WebResource(WebResourceInternal) _coreResource] __ZN13WebDragClient22createDragImageForLinkERN7WebCore4KURLERKNS0_6StringEPNS0_5FrameE -[WebHTMLView(WebPrivate) _dragImageForURL:withLabel:] __ZNK19WebPasteboardHelper23plainTextFromPasteboardEPK12NSPasteboard __ZL25uniqueURLWithRelativePartP8NSString -[WebDataSource(WebInternal) _documentFragmentWithImageResource:] -[WebDataSource(WebInternal) _imageElementWithImageResource:] -[WebHTMLView menuForEvent:] -[WebViewFactory contextMenuItemTagOpenLink] -[WebViewFactory contextMenuItemTagOpenLinkInNewWindow] -[WebViewFactory contextMenuItemTagDownloadLinkToDisk] -[WebViewFactory contextMenuItemTagCopyLinkToClipboard] -[WebViewFactory contextMenuItemTagOpenImageInNewWindow] -[WebViewFactory contextMenuItemTagDownloadImageToDisk] -[WebViewFactory contextMenuItemTagCopyImageToClipboard] -[WebViewFactory contextMenuItemTagSearchInSpotlight] -[WebViewFactory contextMenuItemTagLookUpInDictionary] -[WebViewFactory contextMenuItemTagSearchWeb] -[WebViewFactory contextMenuItemTagCopy] -[WebViewFactory contextMenuItemTagGoBack] -[WebViewFactory contextMenuItemTagGoForward] -[WebViewFactory contextMenuItemTagStop] -[WebViewFactory contextMenuItemTagReload] -[WebViewFactory contextMenuItemTagOpenFrameInNewWindow] -[WebViewFactory contextMenuItemTagNoGuessesFound] -[WebViewFactory contextMenuItemTagIgnoreSpelling] -[WebViewFactory contextMenuItemTagLearnSpelling] -[WebViewFactory contextMenuItemTagIgnoreGrammar] -[WebViewFactory contextMenuItemTagCut] -[WebViewFactory contextMenuItemTagPaste] __ZN20WebContextMenuClient29getCustomMenuFromDefaultItemsEPN7WebCore11ContextMenuE -[WebViewFactory contextMenuItemTagSpellingMenu] -[WebViewFactory contextMenuItemTagShowSpellingPanel:] -[WebViewFactory contextMenuItemTagCheckSpelling] -[WebViewFactory contextMenuItemTagCheckSpellingWhileTyping] -[WebViewFactory contextMenuItemTagCheckGrammarWithSpelling] -[WebViewFactory contextMenuItemTagCorrectSpellingAutomatically] __ZN15WebEditorClient19spellingUIIsShowingEv -[WebViewFactory contextMenuItemTagSubstitutionsMenu] -[WebViewFactory contextMenuItemTagShowSubstitutions:] -[WebViewFactory contextMenuItemTagSmartCopyPaste] -[WebViewFactory contextMenuItemTagSmartQuotes] -[WebViewFactory contextMenuItemTagSmartDashes] -[WebViewFactory contextMenuItemTagSmartLinks] -[WebViewFactory contextMenuItemTagTextReplacement] __ZN15WebEditorClient27substitutionsPanelIsShowingEv -[WebViewFactory contextMenuItemTagTransformationsMenu] -[WebViewFactory contextMenuItemTagMakeUpperCase] -[WebViewFactory contextMenuItemTagMakeLowerCase] -[WebViewFactory contextMenuItemTagCapitalize] -[WebViewFactory contextMenuItemTagFontMenu] -[WebViewFactory contextMenuItemTagShowFonts] -[WebViewFactory contextMenuItemTagBold] -[WebViewFactory contextMenuItemTagItalic] -[WebViewFactory contextMenuItemTagUnderline] -[WebViewFactory contextMenuItemTagOutline] -[WebViewFactory contextMenuItemTagStyles] -[WebViewFactory contextMenuItemTagShowColors] -[WebViewFactory contextMenuItemTagSpeechMenu] -[WebViewFactory contextMenuItemTagStartSpeaking] -[WebViewFactory contextMenuItemTagStopSpeaking] -[WebViewFactory contextMenuItemTagWritingDirectionMenu] -[WebViewFactory contextMenuItemTagDefaultDirection] -[WebViewFactory contextMenuItemTagLeftToRight] -[WebViewFactory contextMenuItemTagRightToLeft] -[WebHTMLView(WebNSTextInputSupport) selectedRange] -[WebFrame(WebPrivate) _selectedNSRange] -[WebFrame(WebInternal) _convertToNSRange:] -[WebHTMLView(WebNSTextInputSupport) firstRectForCharacterRange:] -[WebFrame(WebInternal) _convertNSRangeToDOMRange:] -[WebFrame(WebInternal) _convertToDOMRange:] -[WebFrame(WebInternal) _firstRectForDOMRange:] __ZN15WebChromeClient19customHighlightRectEPN7WebCore4NodeERKNS0_12AtomicStringERKNS0_9FloatRectE -[WebHTMLView(WebInternal) _highlighterForType:] __ZN15WebChromeClient20paintCustomHighlightEPN7WebCore4NodeERKNS0_12AtomicStringERKNS0_9FloatRectES8_bb -[WebView(WebIBActions) makeTextLarger:] -[WebView _zoomIn:isTextOnly:] -[WebDefaultPolicyDelegate webView:shouldGoToHistoryItem:] -[WebView(WebPendingPublic) zoomPageIn:] -[WebView(WebPendingPublic) zoomPageOut:] -[WebView _zoomOut:isTextOnly:] -[WebPDFRepresentation setDataSource:] -[WebPDFView initWithFrame:] +[WebPDFView(FileInternal) _PDFPreviewViewClass] +[WebPDFView PDFKitBundle] -[PDFPrefUpdatingProxy initWithView:] -[WebPDFView setNextKeyView:] -[WebPDFView viewWillMoveToWindow:] -[WebPDFView viewDidMoveToWindow] -[WebPDFView(FileInternal) _trackFirstResponder] -[WebPDFView(FileInternal) _clipViewForPDFDocumentView] -[WebPDFView becomeFirstResponder] -[WebPDFView setDataSource:] -[WebPDFView setNeedsLayout:] -[WebPDFView layout] -[WebPDFView acceptsFirstResponder] -[WebPDFRepresentation receivedData:withDataSource:] -[WebPDFView dataSourceUpdated:] -[WebPDFRepresentation title] -[WebPDFRepresentation finishedLoadingWithDataSource:] -[WebDataSource data] +[WebPDFRepresentation PDFDocumentClass] -[WebPDFView setPDFDocument:] -[WebPDFView(FileInternal) _scaleOrDisplayModeOrPageChanged:] -[WebPDFView(FileInternal) _applyPDFDefaults] -[WebPreferences(WebPrivate) PDFScaleFactor] -[WebPreferences _floatValueForKey:] -[WebPreferences(WebPrivate) PDFDisplayMode] -[WebPDFView selectionView] -[WebPDFView string] -[WebPDFView dealloc] +[WebCoreStatistics javaScriptObjectsCount] -[WebBackForwardList capacity] -[WebBackForwardList addItem:] -[WebBackForwardList goToItem:] -[WebDefaultUIDelegate webView:setToolbarsVisible:] -[WebDefaultUIDelegate webView:setStatusBarVisible:] -[WebDefaultUIDelegate webView:setResizable:] -[WebDefaultUIDelegate webViewShow:] __XPCGetProperty _WKPCGetProperty __ZN6WebKit27NetscapePluginInstanceProxy11getPropertyEjRKN3JSC10IdentifierERPcRj -[WebHostedNetscapePluginView setLayer:] -[WebDefaultPolicyDelegate webView:decidePolicyForNewWindowAction:request:newFrameName:decisionListener:] -[WebDefaultUIDelegate webView:createWebViewWithRequest:windowFeatures:] -[WebKeyGenerator strengthMenuItemTitles] -[WebViewFactory resetButtonDefaultLabel] __ZL19isPreVersion3Clientv __ZL26fixMenusToSendToOldClientsP14NSMutableArray __ZL28isPreInspectElementTagClientv __ZN15WebChromeClient20runJavaScriptConfirmEPN7WebCore5FrameERKNS0_6StringE __Z30CallUIDelegateReturningBooleanaP7WebViewP13objc_selectorP11objc_objectS4_ __ZN15WebChromeClient19runJavaScriptPromptEPN7WebCore5FrameERKNS0_6StringES5_RS3_ __Z14CallUIDelegateP7WebViewP13objc_selectorP11objc_objectS4_S4_ __ZN15WebChromeClient17scrollbarsVisibleEv __ZN15WebChromeClient15toolbarsVisibleEv __ZN15WebChromeClient14menubarVisibleEv -[NSString(WebNSURLExtras) _web_encodeHostName] __ZL22readIDNScriptWhiteListv __ZL26readIDNScriptWhiteListFileP8NSString __ZNK15WebChromeClient11tabsToLinksEv -[WebPreferences tabsToLinks] -[WebViewFactory submitButtonDefaultLabel] __ZN15WebChromeClient12canTakeFocusEN7WebCore14FocusDirectionE __ZN15WebChromeClient9takeFocusEN7WebCore14FocusDirectionE -[WebView(WebViewInternal) _becomingFirstResponderFromOutside] -[WebHostedNetscapePluginView focusChanged] __ZN6WebKit27NetscapePluginInstanceProxy12focusChangedEb __WKPHPluginInstanceFocusChanged __ZN15WebChromeClient14keyboardUIModeEv -[WebView(WebViewInternal) _keyboardUIMode] -[WebView(WebViewInternal) _retrieveKeyboardUIModeFromPreferences:] -[WebHistory dealloc] -[WebHistoryPrivate dealloc] -[WebDefaultUIDelegate webViewClose:] __ZN15WebChromeClient21exceededDatabaseQuotaEPN7WebCore5FrameERKNS0_6StringE -[WebSecurityOrigin(WebInternal) _initWithWebCoreSecurityOrigin:] -[WebSecurityOrigin setQuota:] __ZN24WebDatabaseTrackerClient23dispatchDidModifyOriginEPN7WebCore14SecurityOriginE -[WebSecurityOrigin dealloc] __ZN24WebDatabaseTrackerClient25dispatchDidModifyDatabaseEPN7WebCore14SecurityOriginERKNS0_6StringE -[NSURL(WebNSURLExtras) _web_URLWithLowercasedScheme] -[WebFrame loadAlternateHTMLString:baseURL:forUnreachableURL:] __ZN3WTF10RefCountedIN7WebCore10StringImplEE5derefEv __ZN20WebFrameLoaderClient18cannotShowURLErrorERKN7WebCore15ResourceRequestE -[WebHistoryItem(WebPrivate) target] -[WebHistoryItem(WebPrivate) isTargetItem] -[WebHistoryItem(WebPrivate) children] __ZN20WebFrameLoaderClient31dispatchUnableToImplementPolicyERKN7WebCore13ResourceErrorE -[WebView goToBackForwardItem:] __ZN3WTF6VectorIN3JSC8RegisterELm8EE6shrinkEm -[NSString(WebKitExtras) _webkit_fixedCarbonPOSIXPath] _WKCreateCustomCFReadStream _WKSignalCFReadStreamHasBytes _WKSignalCFReadStreamEnd __ZN20WebFrameLoaderClient12blockedErrorERKN7WebCore15ResourceRequestE -[WebHTMLView(WebNSTextInputSupport) setMarkedText:selectedRange:] __ZN3WTF6VectorIN7WebCore20CompositionUnderlineELm0EE14expandCapacityEmPKS2_ __ZN3WTF6VectorIN7WebCore20CompositionUnderlineELm0EE14expandCapacityEm __ZN3WTF6VectorIN7WebCore20CompositionUnderlineELm0EE15reserveCapacityEm __ZN3WTF6VectorIN7WebCore20CompositionUnderlineELm0EE6shrinkEm -[WebFrame(WebPrivate) _selectNSRange:] -[WebHTMLView(WebNSTextInputSupport) attributedSubstringFromRange:] -[WebHTMLView(WebNSTextInputSupport) markedRange] -[WebHTMLView(WebNSTextInputSupport) unmarkText] -[WebHTMLView(WebNSTextInputSupport) characterIndexForPoint:] -[WebFrame(WebInternal) _characterRangeAtPoint:] -[WebFrame(WebInternal) _visiblePositionForPoint:] -[WebHTMLView(WebNSTextInputSupport) conversationIdentifier] -[WebView(WebPendingPublic) aeDescByEvaluatingJavaScriptFromString:] __ZL17aeDescFromJSValuePN3JSC9ExecStateENS_7JSValueE __ZN3WTF12bitwise_castIdlEET_T0_ __ZNK3WTF9HashTableIPN3JSC8JSObjectES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E8containsIS3_NS_22 __ZN3WTF7HashSetIPN3JSC8JSObjectENS_7PtrHashIS3_EENS_10HashTraitsIS3_EEE3addERKS3_ __ZN3WTF9HashTableIPN3JSC8JSObjectES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E6expandEv __ZN3WTF9HashTableIPN3JSC8JSObjectES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E6rehashEi __ZN3WTF9HashTableIPN3JSC8JSObjectES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E13allocateTableEi __ZN3WTF9HashTableIPN3JSC8JSObjectES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E15deallocateTableEP __ZN3WTF9HashTableIPN3JSC8JSObjectES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E4findIS3_NS_22Ident __ZN3WTF9HashTableIPN3JSC8JSObjectES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E47removeAndInvalida __ZN3WTF9HashTableIPN3JSC8JSObjectES3_NS_17IdentityExtractorIS3_EENS_7PtrHashIS3_EENS_10HashTraitsIS3_EES9_E6removeEPS3_ -[WebFrame(WebInternal) _convertDOMRangeToNSRange:] __ZNK6WebKit13ProxyInstance27supportsInvokeDefaultMethodEv __WKPHNPObjectHasInvokeDefaultMethod __ZN6WebKit13ProxyInstance19invokeDefaultMethodEPN3JSC9ExecStateERKNS1_7ArgListE __ZNK6WebKit10ProxyField17valueFromInstanceEPN3JSC9ExecStateEPKNS1_8Bindings8InstanceE __ZNK6WebKit13ProxyInstance10fieldValueEPN3JSC9ExecStateEPKNS1_8Bindings5FieldE __WKPHNPObjectGetProperty __ZN6WebKit10ProxyFieldD0Ev __WKPHLoadURLNotify __XPCGetIntIdentifier _WKPCGetIntIdentifier __ZNK6WebKit10ProxyField18setValueToInstanceEPN3JSC9ExecStateEPKNS1_8Bindings8InstanceENS1_7JSValueE __ZNK6WebKit13ProxyInstance13setFieldValueEPN3JSC9ExecStateEPKNS1_8Bindings5FieldENS1_7JSValueE __WKPHNPObjectSetProperty __XPCConstruct _WKPCConstruct __ZN6WebKit27NetscapePluginInstanceProxy9constructEjPcjRS1_Rj __ZNK6WebKit13ProxyInstance17supportsConstructEv __WKPHNPObjectHasConstructMethod __ZN6WebKit13ProxyInstance15invokeConstructEPN3JSC9ExecStateERKNS1_7ArgListE __XPCGetPluginElementNPObject _WKPCGetPluginElementNPObject __ZN6WebKit27NetscapePluginInstanceProxy24getPluginElementNPObjectERj -[WebBaseNetscapePluginView element] __XPCSetProperty _WKPCSetProperty __ZN6WebKit27NetscapePluginInstanceProxy11setPropertyEjRKN3JSC10IdentifierEPcj __XPCEnumerate _WKPCEnumerate __ZN6WebKit27NetscapePluginInstanceProxy9enumerateEjRPcRj __ZN3WTF9HashTableIPN3JSC7UString3RepES4_NS_17IdentityExtractorIS4_EENS_7PtrHashIS4_EENS_10HashTraitsIS4_EESA_E15deallocateTabl __ZN6WebKit13ProxyInstance16getPropertyNamesEPN3JSC9ExecStateERNS1_17PropertyNameArrayE __WKPHNPObjectEnumerate __XPCInvokeDefault _WKPCInvokeDefault __ZN6WebKit27NetscapePluginInstanceProxy13invokeDefaultEjPcjRS1_Rj __ZN3WTF12bitwise_castIldEET_T0_ __ZN20WebFrameLoaderClient20redirectDataToPluginEPN7WebCore6WidgetE -[WebHTMLRepresentation _redirectDataToManualLoader:forPluginView:] -[WebHostedNetscapePluginView pluginView:receivedResponse:] __ZN6WebKit26HostedNetscapePluginStreamC1EPNS_27NetscapePluginInstanceProxyEPN7WebCore11FrameLoaderE __ZN6WebKit26HostedNetscapePluginStreamC2EPNS_27NetscapePluginInstanceProxyEPN7WebCore11FrameLoaderE __ZN6WebKit27NetscapePluginInstanceProxy15setManualStreamEN3WTF10PassRefPtrINS_26HostedNetscapePluginStreamEEE __ZN6WebKit26HostedNetscapePluginStream23startStreamWithResponseEP13NSURLResponse -[WebHostedNetscapePluginView pluginView:receivedData:] -[WebHostedNetscapePluginView pluginViewFinishedLoading:] __ZN6WebKit26HostedNetscapePluginStream10cancelLoadEs __ZNK6WebKit26HostedNetscapePluginStream14errorForReasonEs __ZNK6WebKit26HostedNetscapePluginStream30pluginCancelledConnectionErrorEv __ZN6WebKit26HostedNetscapePluginStream10cancelLoadEP7NSError +[WebDatabaseManager sharedWebDatabaseManager] -[WebDatabaseManager deleteAllDatabases] -[WebSecurityOrigin initWithURL:] -[WebSecurityOrigin port] -[WebSecurityOrigin host] -[WebSecurityOrigin protocol] -[WebFrame(WebPrivate) _pauseTransitionOfProperty:onNode:atTime:] __ZN3WTF6VectorINS_6RefPtrIN7WebCore7ArchiveEEELm0EE6shrinkEm -[WebDataSource webArchive] -[WebIconDatabase(WebPendingPublic) setEnabled:] -[WebIconDatabase(WebInternal) _shutDownIconDatabase] -[WebPDFView viewState] -[WebFramePolicyListener invalidate] __ZL8hexDigiti __ZNK3JSC21UStringSourceProvider8getRangeEii __ZN7WebCore13ResourceErrorD2Ev +[WebIconDatabase(WebPrivate) _checkIntegrityBeforeOpening] __XPCConvertPoint _WKPCConvertPoint __ZN6WebKit27NetscapePluginInstanceProxy12convertPointEdd17NPCoordinateSpaceRdS2_S1_ -[WebHistoryItem(WebPrivate) _lastVisitedDate] __ZN6WebKit27NetscapePluginInstanceProxy10wheelEventEP6NSViewP7NSEvent __WKPHPluginInstanceWheelEvent -[WebPreferences init] -[WebPreferences(WebPrivate) setApplicationChromeModeEnabled:] -[WebHistoryItem(WebPrivate) _setTransientProperty:forKey:] -[WebHistoryItem(WebPrivate) _setLastVisitWasFailure:] -[WebBackForwardList backItem] _WKAdvanceDefaultButtonPulseAnimation -[WKAppKitDrawDecoyWindow isKeyWindow] -[WebHostedNetscapePluginView keyDown:] -[WebTextInputWindowController interpretKeyEvent:string:] -[WebTextInputPanel _interpretKeyEvent:string:] __ZN6WebKit27NetscapePluginInstanceProxy8keyEventEP6NSViewP7NSEvent16NPCocoaEventType _WKGetNSEventKeyChar __WKPHPluginInstanceKeyboardEvent -[WebHostedNetscapePluginView keyUp:] -[WebFrameView scrollLineUp:] -[WebFrameView _scrollLineVertically:] -[WebFrameView(WebFrameViewFileInternal) _verticalKeyboardScrollDistance] -[WebFrameView _scrollVerticallyBy:] -[WebFrameView scrollLineDown:] -[WebHostedNetscapePluginView flagsChanged:] __ZN6WebKit27NetscapePluginInstanceProxy12flagsChangedEP7NSEvent -[WebDataSource(WebPrivate) _fileWrapperForURL:] -[WebDataSource subresourceForURL:] __XPCSetMenuBarVisible _WKPCSetMenuBarVisible __ZN6WebKit23NetscapePluginHostProxy17setMenuBarVisibleEb -[WebBackForwardList backListWithLimit:] __ZL15vectorToNSArrayRN3WTF6VectorINS_6RefPtrIN7WebCore11HistoryItemEEELm0EEE __ZL30bumperCarBackForwardHackNeededv __ZN3WTF6VectorINS_6RefPtrIN7WebCore11HistoryItemEEELm0EE6shrinkEm -[WebHistoryItem(WebPrivate) targetItem] -[WebHistoryItem icon] -[WebBackForwardList forwardItem] __ZN15WebChromeClient13willPopUpMenuEP6NSMenu _WKPopupMenu -[WebBaseNetscapePluginView viewWillMoveToHostWindow:] -[WebBaseNetscapePluginView viewDidMoveToHostWindow] -[WebFrame(WebPrivate) _isDescendantOfFrame:] __ZN3WTF6VectorItLm2048EE14expandCapacityEmPKt __ZN3WTF6VectorItLm2048EE14expandCapacityEm __ZN3WTF6VectorItLm2048EE15reserveCapacityEm -[WebHTMLView copy:] -[WebHTMLView executeCoreCommandBySelector:] -[WebView(WebViewEditingInMail) _selectionIsAll] -[WebView(WebPrivate) _cachedResponseForURL:] -[NSMutableURLRequest(WebNSURLRequestExtras) _web_setHTTPUserAgent:] +[WebView(WebPrivate) suggestedFileExtensionForMIMEType:] _WKGetPreferredExtensionForMIMEType -[WebHTMLView(WebPrivate) pasteboardChangedOwner:] -[NSURL(WebNSURLExtras) _webkit_isJavaScriptURL] +[WebCoreStatistics statistics] +[WebCache statistics] +[WebCoreStatistics javaScriptGlobalObjectsCount] +[WebCoreStatistics javaScriptProtectedObjectsCount] +[WebCoreStatistics javaScriptProtectedObjectTypeCounts] __ZN3WTF9HashTableIPKcSt4pairIS2_jENS_18PairFirstExtractorIS4_EENS_7PtrHashIS2_EENS_14PairHashTraitsINS_10HashTraitsIS2_EENSA_I +[WebCoreStatistics iconPageURLMappingCount] +[WebCoreStatistics iconRetainedPageURLCount] +[WebCoreStatistics iconRecordCount] +[WebCoreStatistics iconsWithDataCount] +[WebCoreStatistics cachedFontDataCount] +[WebCoreStatistics cachedFontDataInactiveCount] +[WebCoreStatistics glyphPageCount] +[WebCoreStatistics memoryStatistics] __XPCSetModal _WKPCSetModal __ZN6WebKit23NetscapePluginHostProxy8setModalEb __ZN6WebKit23NetscapePluginHostProxy10beginModalEv -[WebPlaceholderModalWindow _wantsUserAttention] __ZN6WebKit23NetscapePluginHostProxy8endModalEv -[WebHTMLRepresentation canSaveAsWebArchive] -[WebFrame(WebInternal) _canSaveAsWebArchive] +[WebView(WebPrivate) _decodeData:] -[WebFrameView documentViewShouldHandlePrint] -[WebFrameView printOperationWithPrintInfo:] -[WebFrameView canPrintHeadersAndFooters] -[WebHTMLView canPrintHeadersAndFooters] -[WebHTMLView knowsPageRange:] -[WebHTMLView _availablePaperWidthForPrintOperation:] -[WebHTMLView _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:] -[WebView(WebViewPrintingPrivate) _adjustPrintingMarginsForHeaderAndFooter] -[NSPrintOperation(WebKitExtras) _web_pageSetupScaleFactor] -[WebView(WebViewPrintingPrivate) _headerHeight] __Z28CallUIDelegateReturningFloatP7WebViewP13objc_selector -[WebView(WebViewPrintingPrivate) _footerHeight] -[WebHTMLView _scaleFactorForPrintOperation:] -[WebHTMLView(WebHTMLViewFileInternal) _calculatePrintHeight] -[WebFrame(WebInternal) _computePageRectsWithPrintWidthScaleFactor:printHeight:] -[WebHTMLView _provideTotalScaleFactorForPrintOperation:] -[WebHTMLView beginDocument] -[WebHTMLView rectForPage:] -[WebHTMLView drawPageBorderWithSize:] -[WebView(WebViewPrintingPrivate) _drawHeaderAndFooter] -[WebView(WebViewPrintingPrivate) _drawHeaderInRect:] __Z14CallUIDelegateP7WebViewP13objc_selector6CGRect -[WebView(WebViewPrintingPrivate) _drawFooterInRect:] -[WebHTMLView endDocument] -[WebHTMLView _endPrintMode] -[WebHTMLView(WebPrivate) _hasInsertionPoint] -[WebPreferences(WebPrivate) setZoomsTextOnly:] -[WebView(WebIBActions) makeTextSmaller:] -[WebFrameView initWithCoder:] -[WebHTMLRepresentation documentSource] -[WebView setCustomTextEncodingName:] -[WebBackForwardList containsItem:] -[WebRenderNode initWithWebFrameView:] -[WebRenderNode dealloc] __ZL14copyRenderNodePN7WebCore12RenderObjectE -[WebRenderNode initWithName:position:rect:view:children:] -[WebRenderNode children] -[WebRenderNode name] -[WebRenderNode absolutePositionString] -[WebRenderNode positionString] -[WebRenderNode widthString] -[WebRenderNode heightString] +[WebView(WebPrivate) _setAlwaysUsesComplexTextCodePath:] +[WebCoreStatistics returnFreeMemoryToSystem] +[WebCache isDisabled] +[WebCoreStatistics purgeInactiveFontData] -[WebView(WebPrivate) _loadBackForwardListFromOtherView:] -[WebDatabaseManager origins] -[WebInspector isDebuggingJavaScript] -[WebInspector isProfilingJavaScript] -[WebView customUserAgent] -[WebInspector show:] __ZN18WebInspectorClient10createPageEv -[WebInspectorWindowController initWithInspectedWebView:] -[WebInspectorWindowController init] -[WebView setDrawsBackground:] -[WebView(WebPrivate) setProhibitsMainFrameScrolling:] -[WebInspectorWindowController webView] __ZN18WebInspectorClient19inspectedURLChangedERKN7WebCore6StringE __ZNK18WebInspectorClient17updateWindowTitleEv __ZN18WebInspectorClient19localizedStringsURLEv __ZN18WebInspectorClient12hiddenPanelsEv __ZN18WebInspectorClient13hideHighlightEv -[WebInspectorWindowController hideHighlight] __ZN18WebInspectorClient10showWindowEv -[WebInspectorWindowController window] _WKNSWindowMakeBottomCornersSquare -[WebInspectorWindowController showWindow:] -[WebInspectorWindowController setAttachedWindowHeight:] __ZN18WebInspectorClient12attachWindowEv -[WebInspectorWindowController attach] -[WebInspector showConsole:] -[WebDefaultEditingDelegate webView:shouldEndEditingInDOMRange:] __ZN18WebInspectorClient9highlightEPN7WebCore4NodeE -[WebInspectorWindowController highlightNode:] -[WebNodeHighlight initWithTargetView:inspectorController:] -[WebNodeHighlight(FileInternal) _computeHighlightWindowFrame] -[WebNodeHighlightView initWithWebNodeHighlight:] -[WebNodeHighlightView isFlipped] -[WebNodeHighlight setDelegate:] -[WebNodeHighlight attach] -[WebNodeHighlightView drawRect:] -[WebNodeHighlight inspectorController] -[WebInspectorWindowController didAttachWebNodeHighlight:] -[WebView setCurrentNodeHighlight:] -[WebNodeHighlight detach] -[WebInspectorWindowController willDetachWebNodeHighlight:] -[WebNodeHighlightView detachFromWebNodeHighlight] -[WebNodeHighlight dealloc] -[WebNodeHighlightView dealloc] __ZN18WebInspectorClient12detachWindowEv -[WebInspectorWindowController detach] -[WebInspectorWindowController close] -[WebDefaultUIDelegate webViewFrame:] -[WebDefaultUIDelegate webView:setFrame:] -[WebNodeHighlight highlightView] -[WebHTMLView _wantsKeyDownForEvent:] -[WebInspectorWindowController windowShouldClose:] -[WebFrame(WebPrivate) _setIsDisconnected:] __ZN18WebInspectorClient11closeWindowEv -[WebInspector toggleDebuggingJavaScript:] -[WebInspector startDebuggingJavaScript:] -[WebInspector toggleProfilingJavaScript:] -[WebInspector startProfilingJavaScript:] -[WebInspector stopProfilingJavaScript:] -[WebHistoryItem(WebPrivate) setRSSFeedReferrer:] -[NSView(WebExtras) _web_dragOperationForDraggingInfo:] -[NSString(WebKitExtras) _webkit_filenameByFixingIllegalCharacters] -[WebIconDatabase(WebInternal) _scaleIcon:toSize:] -[WebPDFView hitTest:] -[WebPDFView(FileInternal) _PDFDocumentViewMightHaveScrolled:] -[NSView(WebExtras) _webView] -[WebPDFView(FileInternal) _updatePreferencesSoon] -[WebPDFView(FileInternal) _updatePreferences:] -[WebPreferences(WebPrivate) setPDFScaleFactor:] -[WebPreferences _setFloatValue:forKey:] -[NSMutableDictionary(WebNSDictionaryExtras) _webkit_setFloat:forKey:] -[WebPreferences(WebPrivate) setPDFDisplayMode:] -[WebPDFView PDFViewOpenPDFInNativeApplication:] -[WebPDFView(FileInternal) _openWithFinder:] -[WebPDFView(FileInternal) _path] -[WebPDFView(FileInternal) _temporaryPDFDirectoryPath] -[WebPDFView setMarkedTextMatchesAreHighlighted:] -[WebPDFView markAllMatchesForText:caseSensitive:limit:] -[WebPDFView(FileInternal) _nextMatchFor:direction:caseSensitive:wrap:fromSelection:startInSelection:] -[WebPDFView(FileInternal) _setTextMatches:] -[WebPDFView selectedString] -[WebPDFView searchFor:direction:caseSensitive:wrap:startInSelection:] -[WebPDFView unmarkAllTextMatches] -[WebPDFView rectsForTextMatches] -[WebPDFView(FileInternal) _visiblePDFPages] -[WebPDFView selectionRect] -[WebPDFView selectionTextRects] -[WebPDFView selectionImageForcingBlackText:] -[WebPDFView selectedAttributedString] -[WebPDFView(FileInternal) _scaledAttributedString:] +[WebURLsWithTitles URLsFromPasteboard:] +[WebView(WebPrivate) canShowFile:] +[WebView(WebPrivate) _MIMETypeForFile:] __ZN20WebFrameLoaderClient41dispatchDidReceiveAuthenticationChallengeEPN7WebCore14DocumentLoaderEmRKNS0_23AuthenticationChallen +[WebPanelAuthenticationHandler sharedHandler] -[WebPanelAuthenticationHandler init] -[WebPanelAuthenticationHandler startAuthentication:window:] -[WebAuthenticationPanel initWithCallback:selector:] -[NSMutableDictionary(WebNSDictionaryExtras) _webkit_setObject:forUncopiedKey:] -[WebAuthenticationPanel runAsSheetOnWindow:withChallenge:] -[WebAuthenticationPanel setUpForChallenge:] -[WebAuthenticationPanel loadNib] -[NSControl(WebExtras) sizeToFitAndAdjustWindowHeight] -[NonBlockingPanel _blocksActionWhenModal:] -[WebAuthenticationPanel logIn:] -[WebAuthenticationPanel sheetDidEnd:returnCode:contextInfo:] -[WebPanelAuthenticationHandler _authenticationDoneWithChallenge:result:] -[WebAuthenticationPanel dealloc] -[WebPanelAuthenticationHandler tryNextChallengeForWindow:] -[WebView(WebPrivate) setBackgroundColor:] __ZN15WebChromeClient23dashboardRegionsChangedEv -[WebView(WebPrivate) _addScrollerDashboardRegions:] -[WebView(WebPrivate) _addScrollerDashboardRegions:from:] -[WebView(WebPrivate) _addScrollerDashboardRegionsForFrameView:dashboardRegions:] -[WebView(WebPrivate) _setAdditionalWebPlugInPaths:] -[WebFrame(WebPrivate) _recursive_resumeNullEventsForAllNetscapePlugins] -[WebHTMLView(WebPrivate) _resumeNullEventsForAllNetscapePlugins] __ZNK7WebCore6Widget11isScrollbarEv -[WebPreferences(WebPrivate) _setUseSiteSpecificSpoofing:] -[WebFrame(WebPrivate) _recursive_pauseNullEventsForAllNetscapePlugins] -[WebHTMLView(WebPrivate) _pauseNullEventsForAllNetscapePlugins] +[NSObject(WebScripting) isSelectorExcludedFromWebScript:] -[WebHTMLView(WebInternal) _destroyAllWebPlugins] ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Carbon/����������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024252�012303� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Carbon/CarbonWindowFrame.m���������������������������������������������������������������0000644�0001750�0001750�00000020220�10663124504�016025� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 __LP64__ #import "CarbonWindowFrame.h" #import "CarbonWindowAdapter.h" #import "CarbonWindowContentView.h" #import <Foundation/NSGeometry.h> #import <Foundation/NSString.h> #import <HIToolbox/MacWindows.h> #import "WebTypesInternal.h" @interface NSView(Secret) - (void)_setWindow:(NSWindow *)window; @end @class NSButton; /* @interface NSThemeFrame(NSHijackedClassMethods) + (float)_titlebarHeight:(unsigned int)style; @end */ @implementation CarbonWindowFrame - (NSRect)titlebarRect { NSRect titlebarRect; NSRect boundsRect; boundsRect = [self bounds]; CarbonWindowAdapter *carbonWindow; carbonWindow = (CarbonWindowAdapter *)[self window]; WindowRef windowRef = [carbonWindow windowRef]; Rect globalBounds; GetWindowBounds (windowRef, kWindowTitleBarRgn, &globalBounds); titlebarRect.origin.x = boundsRect.origin.x; titlebarRect.size.width = boundsRect.size.width; titlebarRect.size.height = globalBounds.bottom - globalBounds.top; titlebarRect.origin.y = NSMaxY(boundsRect) - titlebarRect.size.height; return titlebarRect; } // Given a content rectangle and style mask, return a corresponding frame rectangle. + (NSRect)frameRectForContentRect:(NSRect)contentRect styleMask:(NSUInteger)style { // We don't bother figuring out a good value, because content rects weren't so meaningful for NSCarbonWindows in the past, but this might not be a good assumption anymore. M.P. Warning - 12/5/00 return contentRect; } + (NSRect)contentRectForFrameRect:(NSRect)frameRect styleMask:(NSUInteger)style { // We don't bother figuring out a good value, because content rects weren't so meaningful for NSCarbonWindows in the past, but this might not be a good assumption anymore. KW - copied from +frameRectForContentRect:styleMask return frameRect; } + (NSSize)minFrameSizeForMinContentSize:(NSSize)cSize styleMask:(NSUInteger)style { // See comments above. We don't make any assumptions about the relationship between content rects and frame rects return cSize; } - (NSRect)frameRectForContentRect:(NSRect)cRect styleMask:(NSUInteger)style { return [[self class] frameRectForContentRect: cRect styleMask:style]; } - (NSRect)contentRectForFrameRect:(NSRect)fRect styleMask:(NSUInteger)style { return [[self class] contentRectForFrameRect: fRect styleMask:style]; } - (NSSize)minFrameSizeForMinContentSize:(NSSize)cSize styleMask:(NSUInteger)style { return [[self class] minFrameSizeForMinContentSize:cSize styleMask: style]; } // Initialize. - (id)initWithFrame:(NSRect)inFrameRect styleMask:(unsigned int)inStyleMask owner:(NSWindow *)inOwningWindow { // Parameter check. if (![inOwningWindow isKindOfClass:[CarbonWindowAdapter class]]) NSLog(@"CarbonWindowFrames can only be owned by CarbonWindowAdapters."); // Do the standard Cocoa thing. self = [super initWithFrame:inFrameRect]; if (!self) return nil; // Record what we'll need later. _styleMask = inStyleMask; // Do what NSFrameView's method of the same name does. [self _setWindow:inOwningWindow]; [self setNextResponder:inOwningWindow]; // Done. return self; } // Deallocate. - (void)dealloc { // Simple. [super dealloc]; } // Sink a method invocation. - (void)_setFrameNeedsDisplay:(BOOL)needsDisplay { } // Sink a method invocation. - (void)_setSheet:(BOOL)sheetFlag { } // Sink a method invocation. - (void)_updateButtonState { } #if 0 // Sink a method invocation. - (void)_windowChangedKeyState { } #endif // Toolbar methods that NSWindow expects to be there. - (BOOL)_canHaveToolbar { return NO; } - (BOOL)_toolbarIsInTransition { return NO; } - (BOOL)_toolbarIsShown { return NO; } - (BOOL)_toolbarIsHidden { return NO; } - (void)_showToolbarWithAnimation:(BOOL)animate {} - (void)_hideToolbarWithAnimation:(BOOL)animate {} - (float)_distanceFromToolbarBaseToTitlebar { return 0; } // Refuse to admit there's a close button on the window. - (NSButton *)closeButton { // Simple. return nil; } // Return what's asked for. - (unsigned int)styleMask { // Simple. return _styleMask; } // Return what's asked for. - (NSRect)dragRectForFrameRect:(NSRect)frameRect { // Do what NSThemeFrame would do. // If we just return NSZeroRect here, _NXMakeWindowVisible() gets all befuddled in the sheet-showing case, a window-moving loop is entered, and the sheet gets moved right off of the screen. M.P. Warning - 3/23/01 NSRect dragRect; dragRect.size.height = 27;//[NSThemeFrame _titlebarHeight:[self styleMask]]; dragRect.origin.y = NSMaxY(frameRect) - dragRect.size.height; dragRect.size.width = frameRect.size.width; dragRect.origin.x = frameRect.origin.x; return dragRect; } // Return what's asked for. - (BOOL)isOpaque { // Return a value that will make -[NSWindow displayIfNeeded] on our Carbon window actually work. return YES; } // Refuse to admit there's a minimize button on the window. - (NSButton *)minimizeButton { // Simple. return nil; } // Do the right thing for a Carbon window. - (void)setTitle:(NSString *)title { CarbonWindowAdapter *carbonWindow; OSStatus osStatus; WindowRef windowRef; // Set the Carbon window's title. carbonWindow = (CarbonWindowAdapter *)[self window]; windowRef = [carbonWindow windowRef]; osStatus = SetWindowTitleWithCFString(windowRef, (CFStringRef)title); if (osStatus!=noErr) NSLog(@"A Carbon window's title couldn't be set."); } // Return what's asked for. - (NSString *)title { CFStringRef windowTitle; CarbonWindowAdapter *carbonWindow; NSString *windowTitleAsNSString; OSStatus osStatus; WindowRef windowRef; // Return the Carbon window's title. carbonWindow = (CarbonWindowAdapter *)[self window]; windowRef = [carbonWindow windowRef]; osStatus = CopyWindowTitleAsCFString(windowRef, &windowTitle); if (osStatus==noErr) { windowTitleAsNSString = (NSString *)windowTitle; } else { NSLog(@"A Carbon window's title couldn't be gotten."); windowTitleAsNSString = @""; } return [windowTitleAsNSString autorelease]; } // Return what's asked for. - (float)_sheetHeightAdjustment { // Do what NSThemeFrame would do. return 22;//[NSThemeFrame _titlebarHeight:([self styleMask] & ~NSDocModalWindowMask)]; } // Return what's asked for. - (float)_maxTitlebarTitleRect { // Do what NSThemeFrame would do. return 22;//[NSThemeFrame _titlebarHeight:([self styleMask] & ~NSDocModalWindowMask)]; } - (void)_clearDragMargins { } - (void)_resetDragMargins { } @end // implementation NSCarbonWindowFrame #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Carbon/CarbonUtils.m���������������������������������������������������������������������0000644�0001750�0001750�00000011515�10663124504�014712� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 __LP64__ #include "CarbonUtils.h" #import <WebKitSystemInterface.h> extern CGImageRef _NSCreateImageRef( unsigned char *const bitmapData[5], int pixelsWide, int pixelsHigh, int bitsPerSample, int samplesPerPixel, int bitsPerPixel, int bytesPerRow, BOOL isPlanar, BOOL hasAlpha, NSString *colorSpaceName, CGColorSpaceRef customColorSpace, id sourceObj); static void PoolCleaner( EventLoopTimerRef inTimer, EventLoopIdleTimerMessage inState, void *inUserData ); static NSAutoreleasePool* sPool; static unsigned numPools; static EventLoopRef poolLoop; void HIWebViewRegisterClass( void ); void WebInitForCarbon() { static bool sAppKitLoaded; if ( !sAppKitLoaded ) { ProcessSerialNumber process; // Force us to register with process server, this ensure that the process // "flavour" is correctly established. GetCurrentProcess( &process ); NSApplicationLoad(); sPool = [[NSAutoreleasePool allocWithZone:NULL] init]; numPools = WKGetNSAutoreleasePoolCount(); poolLoop = GetCurrentEventLoop (); InstallEventLoopIdleTimer( GetMainEventLoop(), 1.0, 0, PoolCleaner, 0, NULL ); sAppKitLoaded = true; HIWebViewRegisterClass(); } } /* The pool cleaner is required because Carbon applications do not have an autorelease pool provided by their event loops. Importantly, carbon applications that nest event loops, using any of the various techniques available to Carbon apps, MUST create their our pools around their nested event loops. */ static void PoolCleaner( EventLoopTimerRef inTimer, EventLoopIdleTimerMessage inState, void *inUserData ) { if ( inState == kEventLoopIdleTimerStarted ) { CFStringRef mode = CFRunLoopCopyCurrentMode( (CFRunLoopRef)GetCFRunLoopFromEventLoop( GetCurrentEventLoop() )); EventLoopRef thisLoop = GetCurrentEventLoop (); if ( CFEqual( mode, kCFRunLoopDefaultMode ) && thisLoop == poolLoop) { unsigned currentNumPools = WKGetNSAutoreleasePoolCount()-1; if (currentNumPools == numPools){ [sPool drain]; sPool = [[NSAutoreleasePool allocWithZone:NULL] init]; numPools = WKGetNSAutoreleasePoolCount(); } } CFRelease( mode ); } } CGImageRef WebConvertNSImageToCGImageRef( NSImage* inImage ) { NSArray* reps = [inImage representations]; NSBitmapImageRep* rep = NULL; CGImageRef image = NULL; unsigned i; for ( i=0; i < [reps count]; i++ ) { if ( [[reps objectAtIndex:i] isKindOfClass:[NSBitmapImageRep class]] ) { rep = [reps objectAtIndex:i]; break; } } if ( rep ) { //CGColorSpaceRef csync = (CGColorSpaceRef)[rep valueForProperty:NSImageColorSyncProfileData]; unsigned char* planes[5]; [rep getBitmapDataPlanes:planes]; image = _NSCreateImageRef( planes, [rep pixelsWide], [rep pixelsHigh], [rep bitsPerSample], [rep samplesPerPixel], [rep bitsPerPixel], [rep bytesPerRow], [rep isPlanar], [rep hasAlpha], [rep colorSpaceName], NULL, rep); } return image; } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Carbon/HIWebView.h�����������������������������������������������������������������������0000644�0001750�0001750�00000005641�11150764637�014265� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004, 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 __HIWebView__ #define __HIWebView__ #ifndef __LP64__ #include <Carbon/Carbon.h> #include <JavaScriptCore/WebKitAvailability.h> #if PRAGMA_ONCE #pragma once #endif #ifdef __cplusplus extern "C" { #endif #ifdef __OBJC__ @class WebView; #endif /* * HIWebViewCreate() * * Summary: * Creates a new web view. * * Parameters: * * outControl: * The new web view. * * Result: * An operating system status code. * * Availability: * Mac OS X: in version 10.2.7 and later [32-bit only] * CarbonLib: not available * Non-Carbon CFM: not available */ extern OSStatus HIWebViewCreate(HIViewRef * outControl) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0; #ifdef __OBJC__ /* * HIWebViewGetWebView() * * Summary: * Returns the WebKit WebView for a given HIWebView. * * Parameters: * * inView: * The view to inspect. * * Result: * A pointer to a web view object, or NULL. * * Availability: * Mac OS X: in version 10.2.7 and later [32-bit only] * CarbonLib: not available * Non-Carbon CFM: not available */ extern WebView * HIWebViewGetWebView(HIViewRef inView) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0; #endif #ifdef __cplusplus } #endif #endif #endif /* __HIWebView__ */ �����������������������������������������������������������������������������������������������WebKit/mac/Carbon/CarbonWindowFrame.h���������������������������������������������������������������0000644�0001750�0001750�00000003447�10663124504�016034� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <AppKit/AppKit.h> @interface CarbonWindowFrame : NSView // Instance variables. { @private // Something we keep around just to return when it's asked for. unsigned int _styleMask; } @end // interface NSCarbonWindowFrame �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Carbon/HIWebView.mm����������������������������������������������������������������������0000644�0001750�0001750�00000151240�11213371321�014424� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 __LP64__ #import "HIWebView.h" #import "CarbonWindowAdapter.h" #import "HIViewAdapter.h" #import "WebHTMLViewInternal.h" #import "WebKit.h" #import <objc/objc-runtime.h> #import <WebKitSystemInterface.h> @interface NSWindow (AppKitSecretsHIWebViewKnows) - (void)_removeWindowRef; @end @interface NSView (AppKitSecretsHIWebViewKnows) - (void)_clearDirtyRectsForTree; @end extern "C" void HIWebViewRegisterClass(); @interface MenuItemProxy : NSObject <NSValidatedUserInterfaceItem> { int _tag; SEL _action; } - (id)initWithAction:(SEL)action; - (SEL)action; - (int)tag; @end @implementation MenuItemProxy - (id)initWithAction:(SEL)action { [super init]; if (self == nil) return nil; _action = action; return self; } - (SEL)action { return _action; } - (int)tag { return 0; } @end struct HIWebView { HIViewRef fViewRef; WebView* fWebView; NSView* fFirstResponder; CarbonWindowAdapter * fKitWindow; bool fIsComposited; CFRunLoopObserverRef fUpdateObserver; }; typedef struct HIWebView HIWebView; static const OSType NSAppKitPropertyCreator = 'akit'; /* These constants are not used. Commented out to make the compiler happy. static const OSType NSViewCarbonControlViewPropertyTag = 'view'; static const OSType NSViewCarbonControlAutodisplayPropertyTag = 'autd'; static const OSType NSViewCarbonControlFirstResponderViewPropertyTag = 'frvw'; */ static const OSType NSCarbonWindowPropertyTag = 'win '; #ifdef BUILDING_ON_TIGER const int typeByteCount = typeSInt32; #endif static SEL _NSSelectorForHICommand( const HICommand* hiCommand ); static const EventTypeSpec kEvents[] = { { kEventClassHIObject, kEventHIObjectConstruct }, { kEventClassHIObject, kEventHIObjectDestruct }, { kEventClassMouse, kEventMouseUp }, { kEventClassMouse, kEventMouseMoved }, { kEventClassMouse, kEventMouseDragged }, { kEventClassMouse, kEventMouseWheelMoved }, { kEventClassKeyboard, kEventRawKeyDown }, { kEventClassKeyboard, kEventRawKeyRepeat }, { kEventClassCommand, kEventCommandProcess }, { kEventClassCommand, kEventCommandUpdateStatus }, { kEventClassControl, kEventControlInitialize }, { kEventClassControl, kEventControlDraw }, { kEventClassControl, kEventControlHitTest }, { kEventClassControl, kEventControlGetPartRegion }, { kEventClassControl, kEventControlGetData }, { kEventClassControl, kEventControlBoundsChanged }, { kEventClassControl, kEventControlActivate }, { kEventClassControl, kEventControlDeactivate }, { kEventClassControl, kEventControlOwningWindowChanged }, { kEventClassControl, kEventControlClick }, { kEventClassControl, kEventControlContextualMenuClick }, { kEventClassControl, kEventControlSetFocusPart } }; #define kHIViewBaseClassID CFSTR( "com.apple.hiview" ) #define kHIWebViewClassID CFSTR( "com.apple.HIWebView" ) static HIWebView* HIWebViewConstructor( HIViewRef inView ); static void HIWebViewDestructor( HIWebView* view ); static OSStatus HIWebViewEventHandler( EventHandlerCallRef inCallRef, EventRef inEvent, void * inUserData ); static UInt32 GetBehaviors(); static ControlKind GetKind(); static void Draw( HIWebView* inView, RgnHandle limitRgn, CGContextRef inContext ); static ControlPartCode HitTest( HIWebView* view, const HIPoint* where ); static OSStatus GetRegion( HIWebView* view, ControlPartCode inPart, RgnHandle outRgn ); static void BoundsChanged( HIWebView* inView, UInt32 inOptions, const HIRect* inOriginalBounds, const HIRect* inCurrentBounds ); static void OwningWindowChanged( HIWebView* view, WindowRef oldWindow, WindowRef newWindow ); static void ActiveStateChanged( HIWebView* view ); static OSStatus Click( HIWebView* inView, EventRef inEvent ); static OSStatus ContextMenuClick( HIWebView* inView, EventRef inEvent ); static OSStatus MouseUp( HIWebView* inView, EventRef inEvent ); static OSStatus MouseMoved( HIWebView* inView, EventRef inEvent ); static OSStatus MouseDragged( HIWebView* inView, EventRef inEvent ); static OSStatus MouseWheelMoved( HIWebView* inView, EventRef inEvent ); static OSStatus ProcessCommand( HIWebView* inView, const HICommand* inCommand ); static OSStatus UpdateCommandStatus( HIWebView* inView, const HICommand* inCommand ); static OSStatus SetFocusPart( HIWebView* view, ControlPartCode desiredFocus, RgnHandle invalidRgn, Boolean focusEverything, ControlPartCode* actualFocus ); static NSView* AdvanceFocus( HIWebView* view, bool forward ); static void RelinquishFocus( HIWebView* view, bool inAutodisplay ); static WindowRef GetWindowRef( HIWebView* inView ); static void SyncFrame( HIWebView* inView ); static OSStatus WindowHandler( EventHandlerCallRef inCallRef, EventRef inEvent, void* inUserData ); static void StartUpdateObserver( HIWebView* view ); static void StopUpdateObserver( HIWebView* view ); static inline void HIRectToQDRect( const HIRect* inRect, Rect* outRect ) { outRect->top = (SInt16)CGRectGetMinY( *inRect ); outRect->left = (SInt16)CGRectGetMinX( *inRect ); outRect->bottom = (SInt16)CGRectGetMaxY( *inRect ); outRect->right = (SInt16)CGRectGetMaxX( *inRect ); } //---------------------------------------------------------------------------------- // HIWebViewCreate //---------------------------------------------------------------------------------- // OSStatus HIWebViewCreate(HIViewRef* outControl) { HIWebViewRegisterClass(); return HIObjectCreate(kHIWebViewClassID, NULL, (HIObjectRef*)outControl); } //---------------------------------------------------------------------------------- // HIWebViewGetWebView //---------------------------------------------------------------------------------- // WebView* HIWebViewGetWebView( HIViewRef inView ) { HIWebView* view = (HIWebView*)HIObjectDynamicCast( (HIObjectRef)inView, kHIWebViewClassID ); WebView* result = NULL; if ( view ) result = view->fWebView; return result; } //---------------------------------------------------------------------------------- // HIWebViewConstructor //---------------------------------------------------------------------------------- // static HIWebView* HIWebViewConstructor( HIViewRef inView ) { HIWebView* view = (HIWebView*)malloc( sizeof( HIWebView ) ); if ( view ) { NSRect frame = { { 0, 0 }, { 400, 400 } }; view->fViewRef = inView; WebView *webView = [[WebView alloc] initWithFrame: frame]; CFRetain(webView); [webView release]; view->fWebView = webView; [HIViewAdapter bindHIViewToNSView:inView nsView:view->fWebView]; view->fFirstResponder = NULL; view->fKitWindow = NULL; view->fIsComposited = false; view->fUpdateObserver = NULL; } return view; } //---------------------------------------------------------------------------------- // HIWebViewDestructor //---------------------------------------------------------------------------------- // static void HIWebViewDestructor( HIWebView* inView ) { [HIViewAdapter unbindNSView:inView->fWebView]; CFRelease(inView->fWebView); free(inView); } //---------------------------------------------------------------------------------- // HIWebViewRegisterClass //---------------------------------------------------------------------------------- // void HIWebViewRegisterClass() { static bool sRegistered; if ( !sRegistered ) { HIObjectRegisterSubclass( kHIWebViewClassID, kHIViewBaseClassID, 0, HIWebViewEventHandler, GetEventTypeCount( kEvents ), kEvents, 0, NULL ); sRegistered = true; } } //---------------------------------------------------------------------------------- // GetBehaviors //---------------------------------------------------------------------------------- // static UInt32 GetBehaviors() { return kControlSupportsDataAccess | kControlSupportsGetRegion | kControlGetsFocusOnClick; } //---------------------------------------------------------------------------------- // Draw //---------------------------------------------------------------------------------- // static void Draw( HIWebView* inView, RgnHandle limitRgn, CGContextRef inContext ) { HIRect bounds; Rect drawRect; HIRect hiRect; bool createdContext = false; if (!inView->fIsComposited) { GrafPtr port; Rect portRect; GetPort( &port ); GetPortBounds( port, &portRect ); CreateCGContextForPort( port, &inContext ); SyncCGContextOriginWithPort( inContext, port ); CGContextTranslateCTM( inContext, 0, (portRect.bottom - portRect.top) ); CGContextScaleCTM( inContext, 1, -1 ); createdContext = true; } HIViewGetBounds( inView->fViewRef, &bounds ); CGContextRef savedContext = WKNSWindowOverrideCGContext(inView->fKitWindow, inContext); [NSGraphicsContext setCurrentContext:[inView->fKitWindow graphicsContext]]; GetRegionBounds( limitRgn, &drawRect ); if ( !inView->fIsComposited ) OffsetRect( &drawRect, (SInt16)-bounds.origin.x, (SInt16)-bounds.origin.y ); hiRect.origin.x = drawRect.left; hiRect.origin.y = bounds.size.height - drawRect.bottom; // flip y hiRect.size.width = drawRect.right - drawRect.left; hiRect.size.height = drawRect.bottom - drawRect.top; // printf( "Drawing: drawRect is (%g %g) (%g %g)\n", hiRect.origin.x, hiRect.origin.y, // hiRect.size.width, hiRect.size.height ); // FIXME: We need to do layout before Carbon has decided what region needs drawn. // In Cocoa we make sure to do layout and invalidate any new regions before draw, so everything // can be drawn in one pass. Doing a layout here will cause new regions to be invalidated, but they // will not all be drawn in this pass since we already have a fixed rect we are going to display. NSView <WebDocumentView> *documentView = [[[inView->fWebView mainFrame] frameView] documentView]; if ([documentView isKindOfClass:[WebHTMLView class]]) [(WebHTMLView *)documentView _web_layoutIfNeededRecursive]; if ( inView->fIsComposited ) [inView->fWebView displayIfNeededInRect: *(NSRect*)&hiRect]; else [inView->fWebView displayRect:*(NSRect*)&hiRect]; WKNSWindowRestoreCGContext(inView->fKitWindow, savedContext); if ( !inView->fIsComposited ) { HIViewRef view; HIViewFindByID( HIViewGetRoot( GetControlOwner( inView->fViewRef ) ), kHIViewWindowGrowBoxID, &view ); if ( view ) { HIRect frame; HIViewGetBounds( view, &frame ); HIViewConvertRect( &frame, view, NULL ); hiRect.origin.x = drawRect.left; hiRect.origin.y = drawRect.top; hiRect.size.width = drawRect.right - drawRect.left; hiRect.size.height = drawRect.bottom - drawRect.top; HIViewConvertRect( &hiRect, inView->fViewRef, NULL ); if ( CGRectIntersectsRect( frame, hiRect ) ) HIViewSetNeedsDisplay( view, true ); } } if ( createdContext ) { CGContextSynchronize( inContext ); CGContextRelease( inContext ); } } //---------------------------------------------------------------------------------- // HitTest //---------------------------------------------------------------------------------- // static ControlPartCode HitTest( HIWebView* view, const HIPoint* where ) { HIRect bounds; HIViewGetBounds( view->fViewRef, &bounds ); if ( CGRectContainsPoint( bounds, *where ) ) return 1; else return kControlNoPart; } //---------------------------------------------------------------------------------- // GetRegion //---------------------------------------------------------------------------------- // static OSStatus GetRegion( HIWebView* inView, ControlPartCode inPart, RgnHandle outRgn ) { OSStatus err = eventNotHandledErr; if ( inPart == -3 ) // kControlOpaqueMetaPart: { if ( [inView->fWebView isOpaque] ) { HIRect bounds; Rect temp; HIViewGetBounds( inView->fViewRef, &bounds ); temp.top = (SInt16)bounds.origin.y; temp.left = (SInt16)bounds.origin.x; temp.bottom = (SInt16)CGRectGetMaxY( bounds ); temp.right = (SInt16)CGRectGetMaxX( bounds ); RectRgn( outRgn, &temp ); err = noErr; } } return err; } static WindowRef GetWindowRef( HIWebView* inView ) { return GetControlOwner( inView->fViewRef ); } //---------------------------------------------------------------------------------- // Click //---------------------------------------------------------------------------------- // static OSStatus Click(HIWebView* inView, EventRef inEvent) { NSEvent *kitEvent = WKCreateNSEventWithCarbonClickEvent(inEvent, GetWindowRef(inView)); if (!inView->fIsComposited) StartUpdateObserver(inView); [inView->fKitWindow sendEvent:kitEvent]; if (!inView->fIsComposited) StopUpdateObserver(inView); [kitEvent release]; return noErr; } //---------------------------------------------------------------------------------- // MouseUp //---------------------------------------------------------------------------------- // static OSStatus MouseUp( HIWebView* inView, EventRef inEvent ) { NSEvent* kitEvent = WKCreateNSEventWithCarbonEvent(inEvent); [inView->fKitWindow sendEvent:kitEvent]; [kitEvent release]; return noErr; } //---------------------------------------------------------------------------------- // MouseMoved //---------------------------------------------------------------------------------- // static OSStatus MouseMoved( HIWebView* inView, EventRef inEvent ) { NSEvent *kitEvent = WKCreateNSEventWithCarbonMouseMoveEvent(inEvent, inView->fKitWindow); [inView->fKitWindow sendEvent:kitEvent]; [kitEvent release]; return noErr; } //---------------------------------------------------------------------------------- // MouseDragged //---------------------------------------------------------------------------------- // static OSStatus MouseDragged( HIWebView* inView, EventRef inEvent ) { NSEvent* kitEvent = WKCreateNSEventWithCarbonEvent(inEvent); [inView->fKitWindow sendEvent:kitEvent]; [kitEvent release]; return noErr; } //---------------------------------------------------------------------------------- // MouseDragged //---------------------------------------------------------------------------------- // static OSStatus MouseWheelMoved( HIWebView* inView, EventRef inEvent ) { NSEvent* kitEvent = WKCreateNSEventWithCarbonEvent(inEvent); [inView->fKitWindow sendEvent:kitEvent]; [kitEvent release]; return noErr; } //---------------------------------------------------------------------------------- // ContextMenuClick //---------------------------------------------------------------------------------- // static OSStatus ContextMenuClick( HIWebView* inView, EventRef inEvent ) { NSView *webView = inView->fWebView; NSWindow *window = [webView window]; // Get the point out of the event. HIPoint point; GetEventParameter(inEvent, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(point), NULL, &point); HIViewConvertPoint(&point, inView->fViewRef, NULL); // Flip the Y coordinate, since Carbon is flipped relative to the AppKit. NSPoint location = NSMakePoint(point.x, [window frame].size.height - point.y); // Make up an event with the point and send it to the window. NSEvent *kitEvent = [NSEvent mouseEventWithType:NSRightMouseDown location:location modifierFlags:0 timestamp:GetEventTime(inEvent) windowNumber:[window windowNumber] context:0 eventNumber:0 clickCount:1 pressure:0]; [inView->fKitWindow sendEvent:kitEvent]; return noErr; } //---------------------------------------------------------------------------------- // GetKind //---------------------------------------------------------------------------------- // static ControlKind GetKind() { const ControlKind kMyKind = { 'appl', 'wbvw' }; return kMyKind; } //---------------------------------------------------------------------------------- // BoundsChanged //---------------------------------------------------------------------------------- // static void BoundsChanged( HIWebView* inView, UInt32 inOptions, const HIRect* inOriginalBounds, const HIRect* inCurrentBounds ) { if ( inView->fWebView ) { SyncFrame( inView ); } } //---------------------------------------------------------------------------------- // OwningWindowChanged //---------------------------------------------------------------------------------- // static void OwningWindowChanged( HIWebView* view, WindowRef oldWindow, WindowRef newWindow ) { if ( newWindow ){ WindowAttributes attrs; OSStatus err = GetWindowProperty(newWindow, NSAppKitPropertyCreator, NSCarbonWindowPropertyTag, sizeof(NSWindow *), NULL, &view->fKitWindow); if ( err != noErr ) { const EventTypeSpec kWindowEvents[] = { { kEventClassWindow, kEventWindowClosed }, { kEventClassMouse, kEventMouseMoved }, { kEventClassMouse, kEventMouseUp }, { kEventClassMouse, kEventMouseDragged }, { kEventClassMouse, kEventMouseWheelMoved }, { kEventClassKeyboard, kEventRawKeyDown }, { kEventClassKeyboard, kEventRawKeyRepeat }, { kEventClassKeyboard, kEventRawKeyUp }, { kEventClassControl, kEventControlClick }, }; view->fKitWindow = [[CarbonWindowAdapter alloc] initWithCarbonWindowRef: newWindow takingOwnership: NO disableOrdering:NO carbon:YES]; SetWindowProperty(newWindow, NSAppKitPropertyCreator, NSCarbonWindowPropertyTag, sizeof(NSWindow *), &view->fKitWindow); InstallWindowEventHandler( newWindow, WindowHandler, GetEventTypeCount( kWindowEvents ), kWindowEvents, newWindow, NULL ); } [[view->fKitWindow contentView] addSubview:view->fWebView]; GetWindowAttributes( newWindow, &attrs ); view->fIsComposited = ( ( attrs & kWindowCompositingAttribute ) != 0 ); SyncFrame( view ); } else { // Be sure to detach the cocoa view, too. if ( view->fWebView ) [view->fWebView removeFromSuperview]; view->fKitWindow = NULL; // break the ties that bind } } //------------------------------------------------------------------------------------- // WindowHandler //------------------------------------------------------------------------------------- // Redirect mouse events to the views beneath them. This is required for WebKit to work // properly. We install it once per window. We also tap into window close to release // the NSWindow that shadows our Carbon window. // static OSStatus WindowHandler( EventHandlerCallRef inCallRef, EventRef inEvent, void* inUserData ) { WindowRef window = (WindowRef)inUserData; OSStatus result = eventNotHandledErr; switch( GetEventClass( inEvent ) ) { case kEventClassControl: { switch( GetEventKind( inEvent ) ) { case kEventControlClick: { CarbonWindowAdapter *kitWindow; OSStatus err; err = GetWindowProperty( window, NSAppKitPropertyCreator, NSCarbonWindowPropertyTag, sizeof(NSWindow *), NULL, &kitWindow); // We must be outside the HIWebView, relinquish focus. [kitWindow relinquishFocus]; } break; } } break; case kEventClassKeyboard: { NSWindow* kitWindow; OSStatus err; NSEvent* kitEvent; // if the first responder in the kit window is something other than the // window, we assume a subview of the webview is focused. we must send // the event to the window so that it goes through the kit's normal TSM // logic, and -- more importantly -- allows any delegates associated // with the first responder to have a chance at the event. err = GetWindowProperty( window, NSAppKitPropertyCreator, NSCarbonWindowPropertyTag, sizeof(NSWindow *), NULL, &kitWindow); if ( err == noErr ) { NSResponder* responder = [kitWindow firstResponder]; if ( responder != kitWindow ) { kitEvent = WKCreateNSEventWithCarbonEvent(inEvent); [kitWindow sendEvent:kitEvent]; [kitEvent release]; result = noErr; } } } break; case kEventClassWindow: { NSWindow* kitWindow; OSStatus err; err = GetWindowProperty( window, NSAppKitPropertyCreator, NSCarbonWindowPropertyTag, sizeof(NSWindow *), NULL, &kitWindow); if ( err == noErr ) { [kitWindow _removeWindowRef]; [kitWindow close]; } result = noErr; } break; case kEventClassMouse: switch (GetEventKind(inEvent)) { case kEventMouseMoved: { Point where; GetEventParameter(inEvent, kEventParamMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &where); WindowRef temp; FindWindow(where, &temp); if (temp == window) { Rect bounds; GetWindowBounds(window, kWindowStructureRgn, &bounds); where.h -= bounds.left; where.v -= bounds.top; SetEventParameter(inEvent, kEventParamWindowRef, typeWindowRef, sizeof(WindowRef), &window); SetEventParameter(inEvent, kEventParamWindowMouseLocation, typeQDPoint, sizeof(Point), &where); OSStatus err = noErr; HIViewRef view = NULL; err = HIViewGetViewForMouseEvent(HIViewGetRoot(window), inEvent, &view); if (err == noErr && view && HIObjectIsOfClass((HIObjectRef)view, kHIWebViewClassID)) result = SendEventToEventTargetWithOptions(inEvent, HIObjectGetEventTarget((HIObjectRef)view), kEventTargetDontPropagate); } } break; case kEventMouseUp: case kEventMouseDragged: case kEventMouseWheelMoved: { OSStatus err = noErr; HIViewRef view = NULL; err = HIViewGetViewForMouseEvent(HIViewGetRoot(window), inEvent, &view); if (err == noErr && view && HIObjectIsOfClass((HIObjectRef)view, kHIWebViewClassID)) result = SendEventToEventTargetWithOptions(inEvent, HIObjectGetEventTarget((HIObjectRef)view), kEventTargetDontPropagate); } break; } break; } return result; } //---------------------------------------------------------------------------------- // SyncFrame //---------------------------------------------------------------------------------- // static void SyncFrame( HIWebView* inView ) { HIViewRef parent = HIViewGetSuperview( inView->fViewRef ); if ( parent ) { if ( inView->fIsComposited ) { HIRect frame; HIRect parentBounds; NSPoint origin; HIViewGetFrame( inView->fViewRef, &frame ); HIViewGetBounds( parent, &parentBounds ); origin.x = frame.origin.x; origin.y = parentBounds.size.height - CGRectGetMaxY( frame ); // printf( "syncing to (%g %g) (%g %g)\n", origin.x, origin.y, // frame.size.width, frame.size.height ); [inView->fWebView setFrameOrigin: origin]; [inView->fWebView setFrameSize: *(NSSize*)&frame.size]; } else { GrafPtr port = GetWindowPort( GetControlOwner( inView->fViewRef ) ); PixMapHandle portPix = GetPortPixMap( port ); Rect bounds; HIRect rootFrame; HIRect frame; GetControlBounds( inView->fViewRef, &bounds ); OffsetRect( &bounds, -(**portPix).bounds.left, -(**portPix).bounds.top ); // printf( "control lives at %d %d %d %d in window-coords\n", bounds.top, bounds.left, // bounds.bottom, bounds.right ); HIViewGetFrame( HIViewGetRoot( GetControlOwner( inView->fViewRef ) ), &rootFrame ); frame.origin.x = bounds.left; frame.origin.y = rootFrame.size.height - bounds.bottom; frame.size.width = bounds.right - bounds.left; frame.size.height = bounds.bottom - bounds.top; // printf( " before frame convert (%g %g) (%g %g)\n", frame.origin.x, frame.origin.y, // frame.size.width, frame.size.height ); [inView->fWebView convertRect:*(NSRect*)&frame fromView:nil]; // printf( " moving web view to (%g %g) (%g %g)\n", frame.origin.x, frame.origin.y, // frame.size.width, frame.size.height ); [inView->fWebView setFrameOrigin: *(NSPoint*)&frame.origin]; [inView->fWebView setFrameSize: *(NSSize*)&frame.size]; } } } //---------------------------------------------------------------------------------- // SetFocusPart //---------------------------------------------------------------------------------- // static OSStatus SetFocusPart( HIWebView* view, ControlPartCode desiredFocus, RgnHandle invalidRgn, Boolean focusEverything, ControlPartCode* actualFocus ) { NSView * freshlyMadeFirstResponderView; SInt32 partCodeToReturn; // Do what Carbon is telling us to do. if ( desiredFocus == kControlFocusNoPart ) { // Relinquish the keyboard focus. RelinquishFocus( view, true ); //(autodisplay ? YES : NO)); freshlyMadeFirstResponderView = nil; partCodeToReturn = kControlFocusNoPart; //NSLog(@"Relinquished the key focus because we have no choice."); } else if ( desiredFocus == kControlFocusNextPart || desiredFocus == kControlFocusPrevPart ) { BOOL goForward = (desiredFocus == kControlFocusNextPart ); // Advance the keyboard focus, maybe right off of this view. Maybe a subview of this one already has the keyboard focus, maybe not. freshlyMadeFirstResponderView = AdvanceFocus( view, goForward ); if (freshlyMadeFirstResponderView) partCodeToReturn = desiredFocus; else partCodeToReturn = kControlFocusNoPart; //NSLog(freshlyMadeFirstResponderView ? @"Advanced the key focus." : @"Relinquished the key focus."); } else { // What's this? if (desiredFocus != kControlIndicatorPart) { check(false); } freshlyMadeFirstResponderView = nil; partCodeToReturn = desiredFocus; } view->fFirstResponder = freshlyMadeFirstResponderView; *actualFocus = partCodeToReturn; // Done. return noErr; } //---------------------------------------------------------------------------------- // AdvanceFocus //---------------------------------------------------------------------------------- // static NSView* AdvanceFocus( HIWebView* view, bool forward ) { NSResponder* oldFirstResponder; NSView* currentKeyView; NSView* viewWeMadeFirstResponder; // Focus on some part (subview) of this control (view). Maybe // a subview of this one already has the keyboard focus, maybe not. oldFirstResponder = [view->fKitWindow firstResponder]; // If we tab out of our NSView, it will no longer be the responder // when we get here. We'll try this trick for now. We might need to // tag the view appropriately. if ( view->fFirstResponder && ( (NSResponder*)view->fFirstResponder != oldFirstResponder ) ) { return NULL; } if ( [oldFirstResponder isKindOfClass:[NSView class]] ) { NSView* tentativeNewKeyView; // Some view in this window already has the keyboard focus. It better at least be a subview of this one. NSView* oldFirstResponderView = (NSView *)oldFirstResponder; check( [oldFirstResponderView isDescendantOf:view->fWebView] ); if ( oldFirstResponderView != view->fFirstResponder && ![oldFirstResponderView isDescendantOf:view->fFirstResponder] ) { // Despite our efforts to record what view we made the first responder // (for use in the next paragraph) we couldn't keep up because the user // has clicked in a text field to make it the key focus, instead of using // the tab key. Find a control on which it's reasonable to invoke // -[NSView nextValidKeyView], taking into account the fact that // NSTextFields always pass on first-respondership to a temporarily- // contained NSTextView. NSView *viewBeingTested; currentKeyView = oldFirstResponderView; viewBeingTested = currentKeyView; while ( viewBeingTested != view->fWebView ) { if ( [viewBeingTested isKindOfClass:[NSTextField class]] ) { currentKeyView = viewBeingTested; break; } else { viewBeingTested = [viewBeingTested superview]; } } } else { // We recorded which view we made into the first responder the // last time the user hit the tab key, and nothing has invalidated // our recorded value since. currentKeyView = view->fFirstResponder; } // Try to move on to the next or previous key view. We use the laboriously // recorded/figured currentKeyView instead of just oldFirstResponder as the // jumping-off-point when searching for the next valid key view. This is so // we don't get fooled if we recently made some view the first responder, but // it passed on first-responder-ness to some temporary subview. // You can't put normal views in a window with Carbon-control-wrapped views. // Stuff like this would break. M.P. Notice - 12/2/00 tentativeNewKeyView = forward ? [currentKeyView nextValidKeyView] : [currentKeyView previousValidKeyView]; if ( tentativeNewKeyView && [tentativeNewKeyView isDescendantOf:view->fWebView] ) { // The user has tabbed to another subview of this control view. Change the keyboard focus. //NSLog(@"Tabbed to the next or previous key view."); [view->fKitWindow makeFirstResponder:tentativeNewKeyView]; viewWeMadeFirstResponder = tentativeNewKeyView; } else { // The user has tabbed past the subviews of this control view. The window is the first responder now. //NSLog(@"Tabbed past the first or last key view."); [view->fKitWindow makeFirstResponder:view->fKitWindow]; viewWeMadeFirstResponder = nil; } } else { // No view in this window has the keyboard focus. This view should // try to select one of its key subviews. We're not interested in // the subviews of sibling views here. //NSLog(@"No keyboard focus in window. Attempting to set..."); NSView *tentativeNewKeyView; check(oldFirstResponder==fKitWindow); if ( [view->fWebView acceptsFirstResponder] ) tentativeNewKeyView = view->fWebView; else tentativeNewKeyView = [view->fWebView nextValidKeyView]; if ( tentativeNewKeyView && [tentativeNewKeyView isDescendantOf:view->fWebView] ) { // This control view has at least one subview that can take the keyboard focus. if ( !forward ) { // The user has tabbed into this control view backwards. Find // and select the last subview of this one that can take the // keyboard focus. Watch out for loops of valid key views. NSView *firstTentativeNewKeyView = tentativeNewKeyView; NSView *nextTentativeNewKeyView = [tentativeNewKeyView nextValidKeyView]; while ( nextTentativeNewKeyView && [nextTentativeNewKeyView isDescendantOf:view->fWebView] && nextTentativeNewKeyView!=firstTentativeNewKeyView) { tentativeNewKeyView = nextTentativeNewKeyView; nextTentativeNewKeyView = [tentativeNewKeyView nextValidKeyView]; } } // Set the keyboard focus. //NSLog(@"Tabbed into the first or last key view."); [view->fKitWindow makeFirstResponder:tentativeNewKeyView]; viewWeMadeFirstResponder = tentativeNewKeyView; } else { // This control view has no subviews that can take the keyboard focus. //NSLog(@"Can't tab into this view."); viewWeMadeFirstResponder = nil; } } // Done. return viewWeMadeFirstResponder; } //---------------------------------------------------------------------------------- // RelinquishFocus //---------------------------------------------------------------------------------- // static void RelinquishFocus( HIWebView* view, bool inAutodisplay ) { NSResponder* firstResponder; // Apparently Carbon thinks that some subview of this control view has the keyboard focus, // or we wouldn't be being asked to relinquish focus. firstResponder = [view->fKitWindow firstResponder]; if ( [firstResponder isKindOfClass:[NSView class]] ) { // Some subview of this control view really is the first responder right now. check( [(NSView *)firstResponder isDescendantOf:view->fWebView] ); // Make the window the first responder, so that no view is the key view. [view->fKitWindow makeFirstResponder:view->fKitWindow]; // If this control is not allowed to do autodisplay, don't let // it autodisplay any just-changed focus rings or text on the // next go around the event loop. I'm probably clearing more // dirty rects than I have to, but it doesn't seem to hurt in // the print panel accessory view case, and I don't have time // to figure out exactly what -[NSCell _setKeyboardFocusRingNeedsDisplay] // is doing when invoked indirectly from -makeFirstResponder up above. M.P. Notice - 12/4/00 if ( !inAutodisplay ) [[view->fWebView opaqueAncestor] _clearDirtyRectsForTree]; } else { // The Cocoa first responder does not correspond to the Carbon // control that has the keyboard focus. This can happen when // you've closed a dialog by hitting return in an NSTextView // that's a subview of this one; Cocoa closed the window, and // now Carbon is telling this control to relinquish the focus // as it's being disposed. There's nothing to do. check(firstResponder==window); } } //---------------------------------------------------------------------------------- // ActiveStateChanged //---------------------------------------------------------------------------------- // static void ActiveStateChanged( HIWebView* view ) { if ( [view->fWebView respondsToSelector:@selector(setEnabled)] ) { [(NSControl*)view->fWebView setEnabled: IsControlEnabled( view->fViewRef )]; HIViewSetNeedsDisplay( view->fViewRef, true ); } } //---------------------------------------------------------------------------------- // ProcessCommand //---------------------------------------------------------------------------------- // static OSStatus ProcessCommand( HIWebView* inView, const HICommand* inCommand ) { OSStatus result = eventNotHandledErr; NSResponder* resp; resp = [inView->fKitWindow firstResponder]; if ( [resp isKindOfClass:[NSView class]] ) { NSView* respView = (NSView*)resp; if ( respView == inView->fWebView || [respView isDescendantOf: inView->fWebView] ) { switch ( inCommand->commandID ) { case kHICommandCut: case kHICommandCopy: case kHICommandPaste: case kHICommandClear: case kHICommandSelectAll: { SEL selector = _NSSelectorForHICommand( inCommand ); if ( [respView respondsToSelector:selector] ) { [respView performSelector:selector withObject:nil]; result = noErr; } } break; } } } return result; } //---------------------------------------------------------------------------------- // UpdateCommandStatus //---------------------------------------------------------------------------------- // static OSStatus UpdateCommandStatus( HIWebView* inView, const HICommand* inCommand ) { OSStatus result = eventNotHandledErr; MenuItemProxy* proxy = NULL; NSResponder* resp; resp = [inView->fKitWindow firstResponder]; if ( [resp isKindOfClass:[NSView class]] ) { NSView* respView = (NSView*)resp; if ( respView == inView->fWebView || [respView isDescendantOf: inView->fWebView] ) { if ( inCommand->attributes & kHICommandFromMenu ) { SEL selector = _NSSelectorForHICommand( inCommand ); if ( selector ) { if ( [resp respondsToSelector: selector] ) { proxy = [[MenuItemProxy alloc] initWithAction: selector]; // Can't use -performSelector:withObject: here because the method we're calling returns BOOL, while // -performSelector:withObject:'s return value is assumed to be an id. BOOL (*validationFunction)(id, SEL, id) = (BOOL (*)(id, SEL, id))objc_msgSend; if (validationFunction(resp, @selector(validateUserInterfaceItem:), proxy)) EnableMenuItem( inCommand->menu.menuRef, inCommand->menu.menuItemIndex ); else DisableMenuItem( inCommand->menu.menuRef, inCommand->menu.menuItemIndex ); result = noErr; } } } } } if ( proxy ) [proxy release]; return result; } // Blatantly stolen from AppKit and cropped a bit //---------------------------------------------------------------------------------- // _NSSelectorForHICommand //---------------------------------------------------------------------------------- // static SEL _NSSelectorForHICommand( const HICommand* inCommand ) { switch ( inCommand->commandID ) { case kHICommandUndo: return @selector(undo:); case kHICommandRedo: return @selector(redo:); case kHICommandCut : return @selector(cut:); case kHICommandCopy : return @selector(copy:); case kHICommandPaste: return @selector(paste:); case kHICommandClear: return @selector(delete:); case kHICommandSelectAll: return @selector(selectAll:); default: return NULL; } return NULL; } //----------------------------------------------------------------------------------- // HIWebViewEventHandler //----------------------------------------------------------------------------------- // Our object's virtual event handler method. I'm not sure if we need this these days. // We used to do various things with it, but those days are long gone... // static OSStatus HIWebViewEventHandler( EventHandlerCallRef inCallRef, EventRef inEvent, void * inUserData ) { OSStatus result = eventNotHandledErr; HIPoint where; OSType tag; void * ptr; Size size; UInt32 features; RgnHandle region = NULL; ControlPartCode part; HIWebView* view = (HIWebView*)inUserData; // [NSApp setWindowsNeedUpdate:YES] must be called before events so that ActivateTSMDocument is called to set an active document. // Without an active document, TSM will use a default document which uses a bottom-line input window which we don't want. [NSApp setWindowsNeedUpdate:YES]; switch ( GetEventClass( inEvent ) ) { case kEventClassHIObject: switch ( GetEventKind( inEvent ) ) { case kEventHIObjectConstruct: { HIObjectRef object; result = GetEventParameter( inEvent, kEventParamHIObjectInstance, typeHIObjectRef, NULL, sizeof( HIObjectRef ), NULL, &object ); require_noerr( result, MissingParameter ); // on entry for our construct event, we're passed the // creation proc we registered with for this class. // we use it now to create the instance, and then we // replace the instance parameter data with said instance // as type void. view = HIWebViewConstructor( (HIViewRef)object ); if ( view ) { SetEventParameter( inEvent, kEventParamHIObjectInstance, typeVoidPtr, sizeof( void * ), &view ); } } break; case kEventHIObjectDestruct: HIWebViewDestructor( view ); // result is unimportant break; } break; case kEventClassKeyboard: { NSEvent* kitEvent = WKCreateNSEventWithCarbonEvent(inEvent); [view->fKitWindow sendSuperEvent:kitEvent]; [kitEvent release]; result = noErr; } break; case kEventClassMouse: switch ( GetEventKind( inEvent ) ) { case kEventMouseUp: result = MouseUp( view, inEvent ); break; case kEventMouseWheelMoved: result = MouseWheelMoved( view, inEvent ); break; case kEventMouseMoved: result = MouseMoved( view, inEvent ); break; case kEventMouseDragged: result = MouseDragged( view, inEvent ); break; } break; case kEventClassCommand: { HICommand command; result = GetEventParameter( inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof( HICommand ), NULL, &command ); require_noerr( result, MissingParameter ); switch ( GetEventKind( inEvent ) ) { case kEventCommandProcess: result = ProcessCommand( view, &command ); break; case kEventCommandUpdateStatus: result = UpdateCommandStatus( view, &command ); break; } } break; case kEventClassControl: switch ( GetEventKind( inEvent ) ) { case kEventControlInitialize: features = GetBehaviors(); SetEventParameter( inEvent, kEventParamControlFeatures, typeUInt32, sizeof( UInt32 ), &features ); result = noErr; break; case kEventControlDraw: { CGContextRef context = NULL; GetEventParameter( inEvent, kEventParamRgnHandle, typeQDRgnHandle, NULL, sizeof( RgnHandle ), NULL, ®ion ); GetEventParameter( inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof( CGContextRef ), NULL, &context ); Draw( view, region, context ); result = noErr; } break; case kEventControlHitTest: GetEventParameter( inEvent, kEventParamMouseLocation, typeHIPoint, NULL, sizeof( HIPoint ), NULL, &where ); part = HitTest( view, &where ); SetEventParameter( inEvent, kEventParamControlPart, typeControlPartCode, sizeof( ControlPartCode ), &part ); result = noErr; break; case kEventControlGetPartRegion: GetEventParameter( inEvent, kEventParamControlPart, typeControlPartCode, NULL, sizeof( ControlPartCode ), NULL, &part ); GetEventParameter( inEvent, kEventParamControlRegion, typeQDRgnHandle, NULL, sizeof( RgnHandle ), NULL, ®ion ); result = GetRegion( view, part, region ); break; case kEventControlGetData: GetEventParameter(inEvent, kEventParamControlPart, typeControlPartCode, NULL, sizeof(ControlPartCode), NULL, &part); GetEventParameter(inEvent, kEventParamControlDataTag, typeEnumeration, NULL, sizeof(OSType), NULL, &tag); GetEventParameter(inEvent, kEventParamControlDataBuffer, typePtr, NULL, sizeof(Ptr), NULL, &ptr); GetEventParameter(inEvent, kEventParamControlDataBufferSize, typeByteCount, NULL, sizeof(Size), NULL, &size); if (tag == kControlKindTag) { Size outSize; result = noErr; if (ptr) { if (size != sizeof(ControlKind)) result = errDataSizeMismatch; else (*(ControlKind *)ptr) = GetKind(); } outSize = sizeof(ControlKind); SetEventParameter(inEvent, kEventParamControlDataBufferSize, typeByteCount, sizeof(Size), &outSize); } break; case kEventControlBoundsChanged: { HIRect prevRect, currRect; UInt32 attrs; GetEventParameter( inEvent, kEventParamAttributes, typeUInt32, NULL, sizeof( UInt32 ), NULL, &attrs ); GetEventParameter( inEvent, kEventParamOriginalBounds, typeHIRect, NULL, sizeof( HIRect ), NULL, &prevRect ); GetEventParameter( inEvent, kEventParamCurrentBounds, typeHIRect, NULL, sizeof( HIRect ), NULL, &currRect ); BoundsChanged( view, attrs, &prevRect, &currRect ); result = noErr; } break; case kEventControlActivate: ActiveStateChanged( view ); result = noErr; break; case kEventControlDeactivate: ActiveStateChanged( view ); result = noErr; break; case kEventControlOwningWindowChanged: { WindowRef fromWindow, toWindow; result = GetEventParameter( inEvent, kEventParamControlOriginalOwningWindow, typeWindowRef, NULL, sizeof( WindowRef ), NULL, &fromWindow ); require_noerr( result, MissingParameter ); result = GetEventParameter( inEvent, kEventParamControlCurrentOwningWindow, typeWindowRef, NULL, sizeof( WindowRef ), NULL, &toWindow ); require_noerr( result, MissingParameter ); OwningWindowChanged( view, fromWindow, toWindow ); result = noErr; } break; case kEventControlClick: result = Click( view, inEvent ); break; case kEventControlContextualMenuClick: result = ContextMenuClick( view, inEvent ); break; case kEventControlSetFocusPart: { ControlPartCode desiredFocus; RgnHandle invalidRgn; Boolean focusEverything; ControlPartCode actualFocus; result = GetEventParameter( inEvent, kEventParamControlPart, typeControlPartCode, NULL, sizeof( ControlPartCode ), NULL, &desiredFocus ); require_noerr( result, MissingParameter ); GetEventParameter( inEvent, kEventParamControlInvalRgn, typeQDRgnHandle, NULL, sizeof( RgnHandle ), NULL, &invalidRgn ); focusEverything = false; // a good default in case the parameter doesn't exist GetEventParameter( inEvent, kEventParamControlFocusEverything, typeBoolean, NULL, sizeof( Boolean ), NULL, &focusEverything ); result = SetFocusPart( view, desiredFocus, invalidRgn, focusEverything, &actualFocus ); if ( result == noErr ) verify_noerr( SetEventParameter( inEvent, kEventParamControlPart, typeControlPartCode, sizeof( ControlPartCode ), &actualFocus ) ); } break; // some other kind of Control event default: break; } break; // some other event class default: break; } MissingParameter: return result; } static void UpdateObserver(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info); static void StartUpdateObserver( HIWebView* view ) { CFRunLoopObserverContext context; CFRunLoopObserverRef observer; CFRunLoopRef mainRunLoop; check( view->fIsComposited == false ); check( view->fUpdateObserver == NULL ); context.version = 0; context.info = view; context.retain = NULL; context.release = NULL; context.copyDescription = NULL; mainRunLoop = (CFRunLoopRef)GetCFRunLoopFromEventLoop( GetMainEventLoop() ); observer = CFRunLoopObserverCreate( NULL, kCFRunLoopEntry | kCFRunLoopBeforeWaiting, true, 0, UpdateObserver, &context ); CFRunLoopAddObserver( mainRunLoop, observer, kCFRunLoopCommonModes ); view->fUpdateObserver = observer; // printf( "Update observer started\n" ); } static void StopUpdateObserver( HIWebView* view ) { check( view->fIsComposited == false ); check( view->fUpdateObserver != NULL ); CFRunLoopObserverInvalidate( view->fUpdateObserver ); CFRelease( view->fUpdateObserver ); view->fUpdateObserver = NULL; // printf( "Update observer removed\n" ); } static void UpdateObserver( CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info ) { HIWebView* view = (HIWebView*)info; RgnHandle region = NewRgn(); // printf( "Update observer called\n" ); if ( region ) { GetWindowRegion( GetControlOwner( view->fViewRef ), kWindowUpdateRgn, region ); if ( !EmptyRgn( region ) ) { RgnHandle ourRgn = NewRgn(); Rect rect; GetWindowBounds( GetControlOwner( view->fViewRef ), kWindowStructureRgn, &rect ); // printf( "Update region is non-empty\n" ); if ( ourRgn ) { Rect rect; GrafPtr savePort, port; Point offset = { 0, 0 }; port = GetWindowPort( GetControlOwner( view->fViewRef ) ); GetPort( &savePort ); SetPort( port ); GlobalToLocal( &offset ); OffsetRgn( region, offset.h, offset.v ); GetControlBounds( view->fViewRef, &rect ); RectRgn( ourRgn, &rect ); // printf( "our control is at %d %d %d %d\n", // rect.top, rect.left, rect.bottom, rect.right ); GetRegionBounds( region, &rect ); // printf( "region is at %d %d %d %d\n", // rect.top, rect.left, rect.bottom, rect.right ); SectRgn( ourRgn, region, ourRgn ); GetRegionBounds( ourRgn, &rect ); // printf( "intersection is %d %d %d %d\n", // rect.top, rect.left, rect.bottom, rect.right ); if ( !EmptyRgn( ourRgn ) ) { RgnHandle saveVis = NewRgn(); // printf( "looks like we should draw\n" ); if ( saveVis ) { // RGBColor kRedColor = { 0xffff, 0, 0 }; GetPortVisibleRegion( GetWindowPort( GetControlOwner( view->fViewRef ) ), saveVis ); SetPortVisibleRegion( GetWindowPort( GetControlOwner( view->fViewRef ) ), ourRgn ); // RGBForeColor( &kRedColor ); // PaintRgn( ourRgn ); // QDFlushPortBuffer( port, NULL ); // Delay( 15, NULL ); Draw1Control( view->fViewRef ); ValidWindowRgn( GetControlOwner( view->fViewRef ), ourRgn ); SetPortVisibleRegion( GetWindowPort( GetControlOwner( view->fViewRef ) ), saveVis ); DisposeRgn( saveVis ); } } SetPort( savePort ); DisposeRgn( ourRgn ); } } DisposeRgn( region ); } } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Carbon/CarbonWindowAdapter.h�������������������������������������������������������������0000644�0001750�0001750�00000005655�10663124504�016365� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> #import <AppKit/AppKit.h> #import <HIToolbox/CarbonEvents.h> #import <HIToolbox/MacWindows.h> @interface CarbonWindowAdapter : NSWindow { @private // The Carbon window that's being encapsulated, and whether or not this object owns (has responsibility for disposing) it. WindowRef _windowRef; BOOL _windowRefIsOwned; BOOL _carbon; // The UPP for the event handler that we use to deal with various Carbon events, and the event handler itself. EventHandlerUPP _handleEventUPP; EventHandlerRef _eventHandler; // Yes if this object should let Carbon handle kEventWindowActivated and kEventWindowDeactivated events. No otherwise. BOOL _passingCarbonWindowActivationEvents; } // Initializers. - (id)initWithCarbonWindowRef:(WindowRef)inWindowRef takingOwnership:(BOOL)inWindowRefIsOwned; - (id)initWithCarbonWindowRef:(WindowRef)inWindowRef takingOwnership:(BOOL)inWindowRefIsOwned disableOrdering:(BOOL)inDisableOrdering carbon:(BOOL)inCarbon; // Accessors. - (WindowRef)windowRef; // Update this window's frame and content rectangles to match the Carbon window's structure and content bounds rectangles. Return yes if the update was really necessary, no otherwise. - (BOOL)reconcileToCarbonWindowBounds; // Handle an event just like an NSWindow would. - (void)sendSuperEvent:(NSEvent *)inEvent; - (void)relinquishFocus; @end �����������������������������������������������������������������������������������WebKit/mac/Carbon/HIViewAdapter.h�������������������������������������������������������������������0000644�0001750�0001750�00000003456�10663124504�015121� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebKit.h> #include <HIToolbox/HIView.h> @interface HIViewAdapter : NSObject + (void)bindHIViewToNSView:(HIViewRef)hiView nsView:(NSView*)nsView; + (void)unbindNSView:(NSView*)nsView; + (HIViewRef)getHIViewForNSView:(NSView*)inView; @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Carbon/HIViewAdapter.m�������������������������������������������������������������������0000644�0001750�0001750�00000022313�11032666713�015123� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 __LP64__ #import "HIViewAdapter.h" #import "WebNSObjectExtras.h" #import <wtf/Assertions.h> static void SetViewNeedsDisplay(HIViewRef inView, RgnHandle inRegion, Boolean inNeedsDisplay); #define WATCH_INVALIDATION 0 @interface NSView(ShhhhDontTell) - (NSRect)_dirtyRect; @end @implementation HIViewAdapter static CFMutableDictionaryRef sViewMap; static IMP oldNSViewSetNeedsDisplayIMP; static IMP oldNSViewSetNeedsDisplayInRectIMP; static IMP oldNSViewNextValidKeyViewIMP; static void _webkit_NSView_setNeedsDisplay(id self, SEL _cmd, BOOL flag); static void _webkit_NSView_setNeedsDisplayInRect(id self, SEL _cmd, NSRect invalidRect); static NSView *_webkit_NSView_nextValidKeyView(id self, SEL _cmd); + (void)bindHIViewToNSView:(HIViewRef)hiView nsView:(NSView*)nsView { if (sViewMap == NULL) { sViewMap = CFDictionaryCreateMutable(NULL, 0, NULL, NULL); // Override -[NSView setNeedsDisplay:] Method setNeedsDisplayMethod = class_getInstanceMethod(objc_getClass("NSView"), @selector(setNeedsDisplay:)); ASSERT(setNeedsDisplayMethod); ASSERT(!oldNSViewSetNeedsDisplayIMP); oldNSViewSetNeedsDisplayIMP = method_setImplementation(setNeedsDisplayMethod, (IMP)_webkit_NSView_setNeedsDisplay); // Override -[NSView setNeedsDisplayInRect:] Method setNeedsDisplayInRectMethod = class_getInstanceMethod(objc_getClass("NSView"), @selector(setNeedsDisplayInRect:)); ASSERT(setNeedsDisplayInRectMethod); ASSERT(!oldNSViewSetNeedsDisplayInRectIMP); oldNSViewSetNeedsDisplayInRectIMP = method_setImplementation(setNeedsDisplayInRectMethod, (IMP)_webkit_NSView_setNeedsDisplayInRect); // Override -[NSView nextValidKeyView] Method nextValidKeyViewMethod = class_getInstanceMethod(objc_getClass("NSView"), @selector(nextValidKeyView)); ASSERT(nextValidKeyViewMethod); ASSERT(!oldNSViewNextValidKeyViewIMP); oldNSViewNextValidKeyViewIMP = method_setImplementation(nextValidKeyViewMethod, (IMP)_webkit_NSView_nextValidKeyView); } CFDictionaryAddValue(sViewMap, nsView, hiView); } + (HIViewRef)getHIViewForNSView:(NSView*)inView { return sViewMap ? (HIViewRef)CFDictionaryGetValue(sViewMap, inView) : NULL; } + (void)unbindNSView:(NSView*)inView { CFDictionaryRemoveValue(sViewMap, inView); } static void _webkit_NSView_setNeedsDisplay(id self, SEL _cmd, BOOL flag) { oldNSViewSetNeedsDisplayIMP(self, _cmd, flag); if (!flag) { HIViewRef hiView = NULL; NSRect targetBounds = [self visibleRect]; NSRect validRect = targetBounds; NSView *view = self; while (view) { targetBounds = [view visibleRect]; if ((hiView = [HIViewAdapter getHIViewForNSView:view]) != NULL) break; validRect = [view convertRect:validRect toView:[view superview]]; view = [view superview]; } if (hiView) { // Flip rect here and convert to region HIRect rect; rect.origin.x = validRect.origin.x; rect.origin.y = targetBounds.size.height - NSMaxY(validRect); rect.size.height = validRect.size.height; rect.size.width = validRect.size.width; // For now, call the region-based API. RgnHandle rgn = NewRgn(); if (rgn) { Rect qdRect; qdRect.top = (SInt16)rect.origin.y; qdRect.left = (SInt16)rect.origin.x; qdRect.bottom = CGRectGetMaxY(rect); qdRect.right = CGRectGetMaxX(rect); RectRgn(rgn, &qdRect); SetViewNeedsDisplay(hiView, rgn, false); DisposeRgn(rgn); } } } } static void _webkit_NSView_setNeedsDisplayInRect(id self, SEL _cmd, NSRect invalidRect) { invalidRect = NSUnionRect(invalidRect, [self _dirtyRect]); oldNSViewSetNeedsDisplayInRectIMP(self, _cmd, invalidRect); if (!NSIsEmptyRect(invalidRect)) { HIViewRef hiView = NULL; NSRect targetBounds = [self bounds]; NSView *view = self; while (view) { targetBounds = [view bounds]; if ((hiView = [HIViewAdapter getHIViewForNSView:view]) != NULL) break; invalidRect = [view convertRect:invalidRect toView:[view superview]]; view = [view superview]; } if (hiView) { if (NSWidth(invalidRect) > 0 && NSHeight(invalidRect)) { // Flip rect here and convert to region HIRect rect; rect.origin.x = invalidRect.origin.x; rect.origin.y = targetBounds.size.height - NSMaxY(invalidRect); rect.size.height = invalidRect.size.height; rect.size.width = invalidRect.size.width; // For now, call the region-based API. RgnHandle rgn = NewRgn(); if (rgn) { Rect qdRect; qdRect.top = (SInt16)rect.origin.y; qdRect.left = (SInt16)rect.origin.x; qdRect.bottom = CGRectGetMaxY(rect); qdRect.right = CGRectGetMaxX(rect); RectRgn(rgn, &qdRect); SetViewNeedsDisplay(hiView, rgn, true); DisposeRgn(rgn); } } } else [[self window] setViewsNeedDisplay:YES]; } } static NSView *_webkit_NSView_nextValidKeyView(id self, SEL _cmd) { if ([HIViewAdapter getHIViewForNSView:self]) return [[self window] contentView]; else return oldNSViewNextValidKeyViewIMP(self, _cmd); } @end static void SetViewNeedsDisplay(HIViewRef inHIView, RgnHandle inRegion, Boolean inNeedsDisplay) { WindowAttributes attrs; GetWindowAttributes(GetControlOwner(inHIView), &attrs); if (attrs & kWindowCompositingAttribute) { #if WATCH_INVALIDATION Rect bounds; GetRegionBounds(inRegion, &bounds); printf("%s: rect on input %d %d %d %d\n", inNeedsDisplay ? "INVALIDATE" : "VALIDATE", bounds.top, bounds.left, bounds.bottom, bounds.right); #endif HIViewSetNeedsDisplayInRegion(inHIView, inRegion, inNeedsDisplay); } else { Rect bounds, cntlBounds; GrafPtr port, savePort; Rect portBounds; #if WATCH_INVALIDATION printf("%s: rect on input %d %d %d %d\n", inNeedsDisplay ? "INVALIDATE" : "VALIDATE", bounds.top, bounds.left, bounds.bottom, bounds.right); #endif GetControlBounds(inHIView, &cntlBounds); #if WATCH_INVALIDATION printf("%s: control bounds are %d %d %d %d\n", inNeedsDisplay ? "INVALIDATE" : "VALIDATE", cntlBounds.top, cntlBounds.left, cntlBounds.bottom, cntlBounds.right); #endif port = GetWindowPort(GetControlOwner(inHIView)); GetPort(&savePort); SetPort(port); GetPortBounds(port, &portBounds); SetOrigin(0, 0); OffsetRgn(inRegion, cntlBounds.left, cntlBounds.top); GetRegionBounds(inRegion, &bounds); #if WATCH_INVALIDATION printf("%s: rect in port coords %d %d %d %d\n", inNeedsDisplay ? "INVALIDATE" : "VALIDATE", bounds.top, bounds.left, bounds.bottom, bounds.right); #endif if (inNeedsDisplay) InvalWindowRgn(GetControlOwner(inHIView), inRegion); else ValidWindowRgn(GetControlOwner(inHIView), inRegion); SetOrigin(portBounds.left, portBounds.top); SetPort(savePort); } } #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Carbon/CarbonWindowAdapter.mm������������������������������������������������������������0000644�0001750�0001750�00000122624�11116247203�016537� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ // I don't think this class belongs in WebKit. Lets move it out. // Things that I've never bothered working out: // For non-sheet windows, handle Carbon WindowMove events so as to do the same things as -[NSWindow _windowMoved]. // Check to see how this stuff deals with various screen size change scenarious. // M.P. Warning - 9/17/01 // There are some invariants I'm maintaining for objects of this class which have been successfully initialized but not deallocated. These all make it easier to not override every single method of NSWindow. // _auxiliaryStorage->auxWFlags.hasShadow will always be false if the Carbon window has a kWindowNoShadowAttribute, and vice versa. // _auxiliaryStorage->_auxWFlags.minimized will always reflect the window's Carbon collapsed state. // _borderView will always point to an NSCarbonWindowFrame. // _contentView will always point to an NSCarbonWindowContentView; // _frame will always reflect the window's Carbon kWindowStructureRgn bounds. // _styleMask will always have _NSCarbonWindowMask set, and will have NSClosableWindowMask, NSMiniaturizableWindowMask, NSResizableWindowMask, and/or NSTitledWindowMask set as appropriate. // _wflags.oneShot and _wflags.delayedOneShot will always be false. // _wFlags.visible will always reflect the window's Carbon visibility. // _windowNum will always be greater than zero, and valid. // The instance variables involved are ones that came to my attention during the initial writing of this class; I haven't methodically gone through NSWindow's ivar list or anything like that. M.P. Notice - 10/10/00 // Things that have to be worked on if NSCarbonWindows are ever used for something other than dialogs and sheets: // Clicking on an NSCarbonWindow while a Cocoa app-modal dialog is shown does not beep, as it should [old bug, maybe fixed now]. // Handling of mouse clicks or key presses for any window control (close, miniaturize, zoom) might not be all there. // Handling of miniaturization of Carbon windows via title bar double-click might not be all there. // The background on NSCarbonWindowTester's sample window (not sample dialog or sample sheet) might be wrong. // The controls on NSCarbonWindowTester's sample window look inactive when the window is inactive, but have first-click behavior. // M.P. Warning - 12/14/00 // Some things would have to be made public if someone wanted to subclass this so as to support more menu item commands. M.P. Warning - 9/19/00 #ifndef __LP64__ #import "CarbonWindowAdapter.h" #import "CarbonWindowFrame.h" #import "CarbonWindowContentView.h" #import "HIViewAdapter.h" #import <WebKitSystemInterface.h> #import <AppKit/AppKit.h> //#import <CoreGraphics/CGSWindow.h> #import <HIToolbox/CarbonEvents.h> #import <HIToolbox/Controls.h> #import <HIToolbox/HIView.h> #import <assert.h> #import <WebCore/WebCoreObjCExtras.h> #import <runtime/InitializeThreading.h> #import "WebKitLogging.h" #import "WebNSObjectExtras.h" #import "WebTypesInternal.h" @interface NSWindow(HIWebFrameView) - _initContent:(const NSRect *)contentRect styleMask:(unsigned int)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag contentView:aView; - (void)_oldPlaceWindow:(NSRect)frameRect; - (void)_windowMovedToRect:(NSRect)actualFrame; - (void)_setWindowNumber:(NSInteger)nativeWindow; - (NSGraphicsContext *)_threadContext; - (void)_setFrame:(NSRect)newWindowFrameRect; - (void)_setVisible:(BOOL)flag; @end @interface NSApplication(HIWebFrameView) - (void)setIsActive:(BOOL)aFlag; - (id)_setMouseActivationInProgress:(BOOL)flag; - (BOOL)_handleKeyEquivalent:(NSEvent*)theEvent; @end @interface NSInputContext - (BOOL)processInputKeyBindings:(NSEvent *)event; @end // Forward declarations. static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCallRef, EventRef inEventRef, void *inUserData); @implementation CarbonWindowAdapter // Return an appropriate window frame class. + (Class)frameViewClassForStyleMask:(unsigned int)style { // There's only one appropriate window style, and only one appropriate window frame class. assert(style & WKCarbonWindowMask()); return [CarbonWindowFrame class]; } // Overriding of the parent class' designated initializer, just for safety's sake. - (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)style backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag { // Do the standard Cocoa thing. self = [super initWithContentRect:contentRect styleMask:style backing:bufferingType defer:flag]; if (self==nil) return nil; // Simple. _windowRef = NULL; _windowRefIsOwned = NO; _eventHandler = NULL; // Done. return self; } // Given a reference to a Carbon window that is to be encapsulated, an indicator of whether or not this object should take responsibility for disposing of the Carbon window, and an indicator of whether to disable Carbon window ordering, initialize. This is the class' designated initializer. - (id)initWithCarbonWindowRef:(WindowRef)inWindowRef takingOwnership:(BOOL)inWindowRefIsOwned disableOrdering:(BOOL)inDisableOrdering carbon:(BOOL)inCarbon { NSBackingStoreType backingStoreType; CarbonWindowContentView *carbonWindowContentView; NSWindow *windowAsProperty; OSStatus osStatus; UInt32 windowFeatures; WindowAttributes windowAttributes; unsigned int styleMask; void *nativeWindow; WindowModality windowModality; ControlRef contentView; // Simple. // It's very weak to have to put this before the invocation of [super initWithContentRect:...], but -setContentView: is invoked from within that initializer. It turns out that the common admonition about not calling virtual functions from within C++ constructors makes sense in Objective-C too. M.P. Notice - 10/10/00 _windowRef = inWindowRef; //_auxiliaryStorage->_windowRef = inWindowRef; _windowRefIsOwned = inWindowRefIsOwned; _carbon = inCarbon; // Find out the window's CoreGraphics window reference. nativeWindow = WKGetNativeWindowFromWindowRef(inWindowRef); // Find out the window's Carbon window attributes. GetWindowAttributes(inWindowRef, &windowAttributes); // Find out the window's Carbon window features. GetWindowFeatures(inWindowRef, &windowFeatures); // Figure out the window's backing store type. // At one time, this had code stolen from CreatePlatformWindow in HIToolbox/Windows/Platform/CGSPlatform.c // But now the non-retained window class is a Carbon secret that's not even in // WindowsPriv.h; maybe we'll have to revisit this if someone needs to use WebKit // in a non-retained window. backingStoreType = NSBackingStoreRetained; // Figure out the window's style mask. styleMask = WKCarbonWindowMask(); if (windowAttributes & kWindowCloseBoxAttribute) styleMask |= NSClosableWindowMask; if (windowAttributes & kWindowResizableAttribute) styleMask |= NSResizableWindowMask; if (windowFeatures & kWindowCanCollapse) styleMask |= NSMiniaturizableWindowMask; if (windowFeatures & kWindowHasTitleBar) styleMask |= NSTitledWindowMask; osStatus = GetWindowModality(_windowRef, &windowModality, NULL); if (osStatus != noErr) { NSLog(@"Couldn't get window modality: error=%d", osStatus); return nil; } // Create one of our special content views. carbonWindowContentView = [[[CarbonWindowContentView alloc] init] autorelease]; // Do some standard Cocoa initialization. The defer argument's value is YES because we don't want -[NSWindow _commonAwake] to get called. It doesn't appear that any relevant NSWindow code checks _wFlags.deferred, so we should be able to get away with the lie. self = (CarbonWindowAdapter*)[super _initContent:NULL styleMask:styleMask backing:backingStoreType defer:YES contentView:carbonWindowContentView]; if (!self) return nil; assert(_contentView); // Record accurately whether or not this window has a shadow, in case someone asks. // _auxiliaryStorage->_auxWFlags.hasShadow = (windowAttributes & kWindowNoShadowAttribute) ? NO : YES; // Record the window number. [self _setWindowNumber:(NSInteger)nativeWindow]; // Set up from the frame rectangle. // We didn't even really try to get it right at _initContent:... time, because it's more trouble that it's worth to write a real +[NSCarbonWindow frameRectForContentRect:styleMask:]. M.P. Notice - 10/10/00 [self reconcileToCarbonWindowBounds]; // Install an event handler for the Carbon window events in which we're interested. const EventTypeSpec kEvents[] = { { kEventClassWindow, kEventWindowActivated }, { kEventClassWindow, kEventWindowDeactivated }, { kEventClassWindow, kEventWindowBoundsChanged }, { kEventClassWindow, kEventWindowShown }, { kEventClassWindow, kEventWindowHidden } }; const EventTypeSpec kControlBoundsChangedEvent = { kEventClassControl, kEventControlBoundsChanged }; osStatus = InstallEventHandler( GetWindowEventTarget(_windowRef), NSCarbonWindowHandleEvent, GetEventTypeCount( kEvents ), kEvents, (void*)self, &_eventHandler); if (osStatus!=noErr) { [self release]; return nil; } osStatus = InstallEventHandler( GetControlEventTarget( HIViewGetRoot( _windowRef ) ), NSCarbonWindowHandleEvent, 1, &kControlBoundsChangedEvent, (void*)self, &_eventHandler); if (osStatus!=noErr) { [self release]; return nil; } HIViewFindByID( HIViewGetRoot( _windowRef ), kHIViewWindowContentID, &contentView ); osStatus = InstallEventHandler( GetControlEventTarget( contentView ), NSCarbonWindowHandleEvent, 1, &kControlBoundsChangedEvent, (void*)self, &_eventHandler); if (osStatus!=noErr) { [self release]; return nil; } // Put a pointer to this Cocoa NSWindow in a Carbon window property tag. // Right now, this is just used by NSViewCarbonControl. M.P. Notice - 10/9/00 windowAsProperty = self; osStatus = SetWindowProperty(_windowRef, WKCarbonWindowPropertyCreator(), WKCarbonWindowPropertyTag(), sizeof(NSWindow *), &windowAsProperty); if (osStatus!=noErr) { [self release]; return nil; } // Ignore the Carbon window activation/deactivation events that Carbon sends to its windows at app activation/deactivation. We'll send such events when we think it's appropriate. _passingCarbonWindowActivationEvents = NO; // Be sure to sync up visibility [self _setVisible:(BOOL)IsWindowVisible( _windowRef )]; // Done. return self; } - (void)setViewsNeedDisplay:(BOOL)wellDoThey { // Make sure we can flush anything that needs it. // We need to sync the context here. I was hoping I didn't need to do this, // but apparently when scrolling, the AppKit view system draws directly. // When this occurs, I cannot intercept it to make it draw in my HIView // context. What ends up happening is that it draws, but nothing ever // flushes it. if ( [self windowNumber] != -1 ) { CGContextRef cgContext = (CGContextRef)[[self _threadContext] graphicsPort]; CGContextSynchronize( cgContext ); } } + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif } // Given a reference to a Carbon window that is to be encapsulated, and an indicator of whether or not this object should take responsibility for disposing of the Carbon window, initialize. - (id)initWithCarbonWindowRef:(WindowRef)inWindowRef takingOwnership:(BOOL)inWindowRefIsOwned { // for now, set disableOrdering to YES because that is what we've been doing and is therefore lower risk. However, I think it would be correct to set it to NO. return [self initWithCarbonWindowRef:inWindowRef takingOwnership:inWindowRefIsOwned disableOrdering:YES carbon:NO]; } // Clean up. - (void)dealloc { if (WebCoreObjCScheduleDeallocateOnMainThread([CarbonWindowAdapter class], self)) return; // Clean up, if necessary. // if we didn't remove the event handler at dealloc time, we would risk getting sent events after the window has been deallocated. See 2702179. M.P. Notice - 6/1/01 if (_eventHandler) RemoveEventHandler(_eventHandler); // Do the standard Cocoa thing. [super dealloc]; } - (void)finalize { ASSERT_MAIN_THREAD(); if (_eventHandler) RemoveEventHandler(_eventHandler); [super finalize]; } - (WindowRef)windowRef { // Simple. return _windowRef; } // should always be YES, but check in order to avoid initialization or deallocation surprises - (BOOL)_hasWindowRef { return (_windowRef != NULL); } // an NSCarbonWindow does not manage the windowRef. The windowRef manages the NSCarbonWindow - (BOOL)_managesWindowRef { return NO; } - (void)_removeWindowRef { _windowRef = NULL; if (_eventHandler) RemoveEventHandler(_eventHandler); _eventHandler = NULL; } - (WindowClass)_carbonWindowClass { WindowClass windowClass = kDocumentWindowClass; OSStatus osStatus; if ([self _hasWindowRef]) { osStatus = GetWindowClass([self windowRef], &windowClass); if (osStatus != noErr) { NSLog(@"Couldn't get window class: error=%d", osStatus); } } return windowClass; } // Update this window's frame and content frame rectangles to match the Carbon window's structure bounds and content bounds rectangles. Return yes if the update was really necessary, no otherwise. - (BOOL)reconcileToCarbonWindowBounds { OSStatus osStatus; NSRect newContentFrameRect; NSRect newWindowFrameRect; NSRect oldContentFrameRect; Rect windowContentBoundsRect; Rect windowStructureBoundsRect; // Initialize for safe returning. BOOL reconciliationWasNecessary = NO; // Precondition check. assert(_contentView); // Get the Carbon window's bounds, which are expressed in global screen coordinates, with (0,0) at the top-left of the main screen. osStatus = GetWindowBounds(_windowRef, kWindowStructureRgn, &windowStructureBoundsRect); if (osStatus!=noErr) NSLog(@"A Carbon window's structure bounds couldn't be gotten."); osStatus = GetWindowBounds(_windowRef, kWindowContentRgn, &windowContentBoundsRect); if (osStatus!=noErr) NSLog(@"A Carbon window's content bounds couldn't be gotten."); // Set the frame rectangle of the border view and this window from the Carbon window's structure region bounds. newWindowFrameRect.origin.x = windowStructureBoundsRect.left; newWindowFrameRect.origin.y = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]) - windowStructureBoundsRect.bottom; newWindowFrameRect.size.width = windowStructureBoundsRect.right - windowStructureBoundsRect.left; newWindowFrameRect.size.height = windowStructureBoundsRect.bottom - windowStructureBoundsRect.top; if (!NSEqualRects(newWindowFrameRect, _frame)) { [self _setFrame:newWindowFrameRect]; [_borderView setFrameSize:newWindowFrameRect.size]; reconciliationWasNecessary = YES; } // Set the content view's frame rect from the Carbon window's content region bounds. newContentFrameRect.origin.x = windowContentBoundsRect.left - windowStructureBoundsRect.left; newContentFrameRect.origin.y = windowStructureBoundsRect.bottom - windowContentBoundsRect.bottom; newContentFrameRect.size.width = windowContentBoundsRect.right - windowContentBoundsRect.left; newContentFrameRect.size.height = windowContentBoundsRect.bottom - windowContentBoundsRect.top; oldContentFrameRect = [_contentView frame]; if (!NSEqualRects(newContentFrameRect, oldContentFrameRect)) { [_contentView setFrame:newContentFrameRect]; reconciliationWasNecessary = YES; } // Done. return reconciliationWasNecessary; } // Handle an event just like an NSWindow would. - (void)sendSuperEvent:(NSEvent *)inEvent { // Filter out a few events that just result in complaints in the log. // Ignore some unknown event that gets sent when NSTextViews in printing accessory views are focused. M.P. Notice - 12/7/00 BOOL ignoreEvent = NO; NSEventType eventType = [inEvent type]; if (eventType==NSSystemDefined) { short eventSubtype = [inEvent subtype]; if (eventSubtype==7) { ignoreEvent = YES; } } else if (eventType == NSKeyDown) { // Handle command-space as [NSApp sendEvent:] does. if ([NSInputContext processInputKeyBindings:inEvent]) { return; } } // Simple. if (!ignoreEvent) [super sendEvent:inEvent]; } - (void)relinquishFocus { NSResponder* firstResponder; // Carbon thinks that a control has the keyboard focus, // or we wouldn't be being asked to relinquish focus. firstResponder = [self firstResponder]; if ([firstResponder isKindOfClass:[NSView class]] ){ // Make the window the first responder, so that no view is the key view. [self makeFirstResponder:self]; } } - (BOOL)makeFirstResponder:(NSResponder *)aResponder { // Let NSWindow focus the appropriate NSView. if (![super makeFirstResponder:aResponder]) return NO; // Now, if the view we're focusing is in a HIWebView, find the // corresponding HIWebView for the NSView, and tell carbon to // clear any focused control. HIViewRef viewRef = 0; NSResponder *firstResponder = [self firstResponder]; if ([firstResponder isKindOfClass:[NSView class]]) { NSView *view = (NSView *)firstResponder; while (view) { viewRef = [HIViewAdapter getHIViewForNSView:view]; if (viewRef) break; view = [view superview]; } } HIViewRef focus; GetKeyboardFocus (_windowRef, &focus); if (focus != viewRef) { SetKeyboardFocus (_windowRef, viewRef, kControlIndicatorPart ); } return YES; } // There's no override of _addCursorRect:cursor:forView:, despite the fact that NSWindow's invokes [self windowNumber], because Carbon windows won't have subviews, and therefore won't have cursor rects. // There's no override of _autoResizeState, despite the fact that NSWindow's operates on _windowNum, because it looks like it might work on Carbon windows as is. // Disappointingly, -_blockHeartBeat: is not immediately invoked to turn off heartbeating. Heartbeating is turned off by setting the gDefaultButtonPaused global variable, and then this method is invoked later, if that global is set (at heartbeating time I guess). Something has to change if we want to hook this up in Carbon windows. M.P. Warning - 9/17/01 /* // Do the right thing for a Carbon window. - (void)_blockHeartBeat:(BOOL)flag { ControlRef defaultButton; OSStatus osStatus; // Do the standard Cocoa thing. [super _blockHeartBeat:flag]; // If there's a default Carbon button in this Carbon window, make it stop pulsing, the Carbon way. // This is inspired by HIToolbox/Controls/Definitions/ButtonCDEF.c's ButtonEventHandler(). M.P. Notice - 12/5/00 osStatus = GetWindowDefaultButton(_windowRef, &defaultButton); if (osStatus==noErr && defaultButton) { Boolean anotherButtonIsTracking = flag ? TRUE : FALSE; osStatus = SetControlData(defaultButton, kControlNoPart, kControlPushButtonAnotherButtonTrackingTag, sizeof(Boolean), &anotherButtonIsTracking); if (osStatus==noErr) DrawOneControl(defaultButton); else NSLog(@"Some data couldn't be set in a Carbon control."); } } */ // Do the right thing for a Carbon window. - (void)_cancelKey:(id)sender { // Most of the time the handling of the cancel key will be done by Carbon, but this method will be invoked if an NSCarbonWindow is wrapping a Carbon window that contains an NSViewCarbonControl, and the escape key or whatever is pressed with an NSTextView focused. Just do what Carbon would do. ControlRef cancelButton; GetWindowCancelButton(_windowRef, &cancelButton); if (cancelButton) { if (IsControlActive(cancelButton)) { HIViewSimulateClick(cancelButton, kControlButtonPart, 0, NULL); } } } // Do the right thing for a Carbon window. - (void)_commonAwake { // Complain, because this should never be called. We insist that -[NSCarbonWindow initWithCarbonWindowRef] is the only valid initializer for instances of this class, and that there's no such thing as a one-shot NSCarbonWindow. NSLog(@"-[NSCarbonWindow _commonAwake] is not implemented."); } // There's no override of _commonInitFrame:styleMask:backing:defer:, despite the fact that NSWindow's modifies quite a few instance variables, because it gets called in a harmless way if the class instance is properly initialized with -[NSCarbonWindow initWithCarbonWindowRef:takingOwnership:]. // Do the right thing for a Carbon window. - _destroyRealWindow:(BOOL)orderingOut { // Complain, because this should never be called. We don't support one-shot NSCarbonWindows. NSLog(@"-[NSCarbonWindow _destroyRealWindow:] is not implemented."); return self; } // There's no override of _discardCursorRectsForView, despite the fact that NSWindow's invokes [self windowNumber], because Carbon windows won't have subviews, and therefore won't have cursor rects. // There's no override of _forceFlushWindowToScreen, despite the fact that NSWindow's invokes [self windowNumber], because it looks like it might work on Carbon windows as is. // There's no override of _getPositionFromServer, despite the fact that NSWindow's operates on _windowNum, because it's only called from -[NSApplication _activateWindows], which is hopefully about to become obsolete any second now. // There's no override of _globalWindowNum, despite the fact that NSWindow's invokes [self windowNumber], because it looks like it might work on Carbon windows as is. // There's no override of _initContent:styleMask:backing:defer:contentView:, despite the fact that NSWindow's modifies _auxiliaryStorage->_auxWFlags.hasShadow, because it will never get called if the class instance is properly initialized with -[NSCarbonWindow initWithCarbonWindowRef:takingOwnership:]. // There's no override of _initContent:styleMask:backing:defer:counterpart:, despite the fact that NSWindow's modifies _auxiliaryStorage->_auxWFlags.hasShadow, because it will never get called if the class instance is properly initialized with -[NSCarbonWindow initWithCarbonWindowRef:takingOwnership:]. // Do what NSWindow would do, but then sychronize the Carbon window structures. - (void)_oldPlaceWindow:(NSRect)frameRect { OSStatus osStatus; // Do the standard Cocoa thing. [super _oldPlaceWindow:frameRect]; // Tell Carbon to update its various regions. // Despite its name, this function should be called early and often, even if the window isn't visible yet. 2702648. M.P. Notice - 7/24/01 osStatus = WKSyncWindowWithCGAfterMove(_windowRef); if (osStatus!=noErr) NSLog(@"A Carbon window's bounds couldn't be synchronized (%i).", (int)osStatus); } // There's no override of _orderOutAndCalcKeyWithCounter:, despite the fact that NSWindow's invokes [self windowNumber], because it looks like it might work on Carbon windows as is. // There's no override of _realHeartBeatThreadContext, despite the fact that NSWindows's invokes [self windowNumber], because it looks like it might not do anything that will effect a Carbon window. // There's no override of _registerWithDockIfNeeded, despite the fact that NSWindow's invokes [self windowNumber], because it looks like it might work on Carbon windows as is. // There's no override of _removeCursorRect:cursor:forView:, despite the fact that NSWindow's invokes [self windowNumber], because Carbon windows won't have subviews, and therefore won't have cursor rects. // There's no override of _setAvoidsActivation:, despite the fact that NSWindow's invokes [self windowNumber], because it looks like it might work on Carbon windows as is. // There's no override of _setFrame:, despite the fact that NSWindow's modifies _frame, because it looks like it might work on Carbon windows as is. The synchronization of the Carbon window bounds rect to the Cocoa frame rect is done in the overrides of _oldPlaceWindow: and _windowMovedToRect:. // There's no override of _setFrameCommon:display:stashSize:, despite the fact that NSWindow's invokes [self windowNumber], because it looks like it might work on Carbon windows as is. // There's no override of _setWindowNumber:, despite the fact that NSWindow's modifies _windowNum and invokes [self windowNumber], because it looks like it might work on Carbon windows as is. // Do what NSWindow would do, but for a Carbon window. // This function is mostly cut-and-pasted from -[NSWindow _termWindowIfOwner]. M.P. Notice - 8/7/00 - (void)_termWindowIfOwner { [self _setWindowNumber:-1]; _wFlags.isTerminating = YES; if (_windowRef && _windowRefIsOwned) DisposeWindow(_windowRef); // KW - need to clear window shadow state so it gets reset correctly when new window created // if ([_borderView respondsToSelector:@selector(setShadowState:)]) { // [_borderView setShadowState:kFrameShadowNone]; // } _wFlags.isTerminating = NO; } // There's no override of _threadContext, despite the fact that NSWindow's invokes [self windowNumber], because it looks like it might not do anything that will effect a Carbon window. // There's no override of _windowMoved:, despite the fact that NSWindow's operates on _windowNum, because it looks like it might work on Carbon windows as is. // Do what NSWindow would do, but then sychronize the Carbon window structures. - (void)_windowMovedToRect:(NSRect)actualFrame { OSStatus osStatus; // Do the standard Cocoa thing. [super _windowMovedToRect:actualFrame]; // Let Carbon know that the window has been moved, unless this method is being called "early." if (_wFlags.visible) { osStatus = WKSyncWindowWithCGAfterMove(_windowRef); if (osStatus!=noErr) NSLog(@"A Carbon window's bounds couldn't be synchronized (%i).", (int)osStatus); } } - (NSRect)constrainFrameRect:(NSRect)actualFrame toScreen:(NSScreen *)screen { // let Carbon decide window size and position return actualFrame; } - (void)selectKeyViewFollowingView:(NSView *)aView { HIViewRef view = NULL; view = [HIViewAdapter getHIViewForNSView:aView]; if ( view ) { HIViewRef contentView; GetRootControl( GetControlOwner( view ), &contentView ); HIViewAdvanceFocus( contentView, 0 ); } else { [super selectKeyViewFollowingView:aView]; } } - (void)selectKeyViewPrecedingView:(NSView *)aView { HIViewRef view = NULL; view = [HIViewAdapter getHIViewForNSView:aView]; if ( view ) { HIViewRef contentView; GetRootControl( GetControlOwner( view ), &contentView ); HIViewAdvanceFocus( contentView, shiftKey ); } else { [super selectKeyViewPrecedingView:aView]; } } - (void)makeKeyWindow { [NSApp _setMouseActivationInProgress:NO]; [NSApp setIsActive:YES]; [super makeKeyWindow]; WKShowKeyAndMain(); } // Do the right thing for a Carbon window. - (BOOL)canBecomeKeyWindow { return YES; } // Do the right thing for a Carbon window. - (BOOL)canBecomeMainWindow { OSStatus osStatus; WindowClass windowClass; // By default, Carbon windows cannot become the main window. // What about when the default isn't right? Requiring subclassing seems harsh. M.P. Warning - 9/17/01 // KW - modify this to allow document windows to become main // This is primarily to get the right look, so that you don't have two windows that both look active - one Cocoa document and one Carbon document osStatus = GetWindowClass(_windowRef, &windowClass); return (osStatus == noErr && windowClass == kDocumentWindowClass); } // There's no override of deminiaturize:, despite the fact that NSWindow's invokes [self windowNumber], because it looks like it might work on Carbon windows as is. // There's no override of disableCursorRects, despite the fact that NSWindow's invokes [self windowNumber], because Carbon windows won't have subviews, and therefore won't have cursor rects. // There's no override of enableCursorRects, despite the fact that NSWindow's invokes [self windowNumber], because Carbon windows won't have subviews, and therefore won't have cursor rects. // Do the right thing for a Carbon window. - (void)encodeWithCoder:(NSCoder *)coder { // Actually, this will probably never be implemented. M.P. Notice - 8/2/00 NSLog(@"-[NSCarbonWindow encodeWithCoder:] is not implemented."); } // There's no override of frame, despite the fact that NSWindow's returns _frame, because _frame is one of the instance variables whose value we're keeping synchronized with the Carbon window. // Do the right thing for a Carbon window. - (id)initWithCoder:(NSCoder *)coder { // Actually, this will probably never be implemented. M.P. Notice - 8/2/00 NSLog(@"-[NSCarbonWindow initWithCoder:] is not implemented."); [self release]; return nil; } // There's no override of level, despite the fact that NSWindow's returns _level, because _level is one of the instance variables whose value we're keeping synchronized with the Carbon window. // There's no override of miniaturize:, despite the fact that NSWindow's invokes [self windowNumber], because it looks like it might work on Carbon windows as is. // There's no override of resizeToScreenWithEvent:, despite the fact that NSWindow's operates on _windowNum. // It looks like it's only called when an _NSForceResizeEventType event is passed into -[NSWindow sendEvent:], and I can't find any instances of that happening. /* // Do the right thing for a Carbon Window. - (void)sendEvent:(NSEvent *)theEvent { // Not all events are handled in the same manner. NSEventType eventType = [theEvent type]; if (eventType==NSAppKitDefined) { // Handle the event the Cocoa way. Carbon won't understand it anyway. [super sendEvent:theEvent]; } } */ // There's no override of setAcceptsMouseMovedEvents:, despite the fact that NSWindow's invokes [self windowNumber], because it looks like it might work on Carbon windows as is. // There's no override of setBackingType:, despite the fact that NSWindow's invokes [self windowNumber], because it's apparently not expected to do anything anyway, judging from the current implementation of PSsetwindowtype(). // Do what NSWindow would do, but for a Carbon window. - (void)setContentView:(NSView *)aView { NSRect contentFrameRect; OSStatus osStatus; Rect windowContentBoundsRect; // Precondition check. assert(_borderView); assert([_borderView isKindOfClass:[CarbonWindowFrame class]]); assert(_windowRef); // Parameter check. assert(aView); assert([aView isKindOfClass:[CarbonWindowContentView class]]); // Find out the window's Carbon window structure region (content) bounds. osStatus = GetWindowBounds(_windowRef, kWindowContentRgn, &windowContentBoundsRect); if (osStatus!=noErr) NSLog(@"A Carbon window's content bounds couldn't be gotten."); contentFrameRect.origin = NSZeroPoint; contentFrameRect.size.width = windowContentBoundsRect.right - windowContentBoundsRect.left; contentFrameRect.size.height = windowContentBoundsRect.bottom - windowContentBoundsRect.top; // If the content view is still in some other view hierarchy, pry it free. [_contentView removeFromSuperview]; assert(![_contentView superview]); // Record the content view, and size it to this window's content frame. _contentView = aView; [_contentView setFrame:contentFrameRect]; // Make the content view a subview of the border view. [_borderView addSubview:_contentView]; // Tell the content view it's new place in the responder chain. [_contentView setNextResponder:self]; } // There's no override of setDepthLimit:, despite the fact that NSWindow's invokes [self windowNumber], because it looks like it might work on Carbon windows as is. - (BOOL)worksWhenModal { WindowClass windowClass = [self _carbonWindowClass]; return (windowClass == kFloatingWindowClass || windowClass == kUtilityWindowClass); } - (void)_setModalWindowLevel { return; } - _clearModalWindowLevel { return nil; } // There's no override of setLevel:, despite the fact that NSWindow's invokes [self windowNumber], because it looks like it might work on Carbon windows as is. // I thought at first that there should be a mapping between Cocoa level and Carbon window class, but experiments convince me that such is not the case. M.P. Notice - 9/18/00 // There's no override of windowNumber, despite the fact that NSWindow's returns _windowNum, because _windowNum is one of the instance variables whose value we're keeping synchronized with the Carbon window. - (UInt32)carbonHICommandIDFromActionSelector:(SEL)inActionSelector { // Initialize with the default return value. UInt32 hiCommandID = 0; // Pretty simple, if tedious. if (inActionSelector==@selector(clear:)) hiCommandID = kHICommandClear; else if (inActionSelector==@selector(copy:)) hiCommandID = kHICommandCopy; else if (inActionSelector==@selector(cut:)) hiCommandID = kHICommandCut; else if (inActionSelector==@selector(paste:)) hiCommandID = kHICommandPaste; else if (inActionSelector==@selector(redo:)) hiCommandID = kHICommandRedo; else if (inActionSelector==@selector(selectAll:)) hiCommandID = kHICommandSelectAll; else if (inActionSelector==@selector(undo:)) hiCommandID = kHICommandUndo; // Done. return hiCommandID; } - (void)sendCarbonProcessHICommandEvent:(UInt32)inHICommandID { EventTargetRef eventTargetRef; HICommand hiCommand; OSStatus osStatus; // Initialize for safe error handling. EventRef eventRef = NULL; // Create a Process Command event. Don't mention anything about the menu item, because we don't want the Carbon Event handler fiddling with it. hiCommand.attributes = 0; hiCommand.commandID = inHICommandID; hiCommand.menu.menuRef = 0; hiCommand.menu.menuItemIndex = 0; osStatus = CreateEvent(NULL, kEventClassCommand, kEventCommandProcess, GetCurrentEventTime(), kEventAttributeNone, &eventRef); if (osStatus!=noErr) { NSLog(@"CreateEvent() returned %i.", (int)osStatus); goto CleanUp; } osStatus = SetEventParameter(eventRef, kEventParamDirectObject, typeHICommand, sizeof(HICommand), &hiCommand); if (osStatus!=noErr) { NSLog(@"SetEventParameter() returned %i.", (int)osStatus); goto CleanUp; } // Send a Carbon event to whatever has the Carbon user focus. eventTargetRef = GetUserFocusEventTarget(); osStatus = SendEventToEventTarget(eventRef, eventTargetRef); if (osStatus!=noErr) { NSLog(@"SendEventToEventTarget() returned %i.", (int)osStatus); goto CleanUp; } CleanUp: // Clean up. if (eventRef) ReleaseEvent(eventRef); } - (Boolean)sendCarbonUpdateHICommandStatusEvent:(UInt32)inHICommandID withMenuRef:(MenuRef)inMenuRef andMenuItemIndex:(UInt16)inMenuItemIndex { EventTargetRef eventTargetRef; HICommand hiCommand; OSStatus osStatus; // Initialize for safe error handling and flag returning. Boolean eventWasHandled = FALSE; EventRef eventRef = NULL; // Create a Process Command event. Don't mention anything about the menu item, because we don't want the Carbon Event handler fiddling with it. hiCommand.attributes = kHICommandFromMenu; hiCommand.commandID = inHICommandID; hiCommand.menu.menuRef = inMenuRef; hiCommand.menu.menuItemIndex = inMenuItemIndex; osStatus = CreateEvent(NULL, kEventClassCommand, kEventCommandUpdateStatus, GetCurrentEventTime(), kEventAttributeNone, &eventRef); if (osStatus!=noErr) { NSLog(@"CreateEvent() returned %i.", (int)osStatus); goto CleanUp; } osStatus = SetEventParameter(eventRef, kEventParamDirectObject, typeHICommand, sizeof(HICommand), &hiCommand); if (osStatus!=noErr) { NSLog(@"SetEventParameter() returned %i.", (int)osStatus); goto CleanUp; } // Send a Carbon event to whatever has the Carbon user focus. eventTargetRef = GetUserFocusEventTarget(); osStatus = SendEventToEventTarget(eventRef, eventTargetRef); if (osStatus==noErr) { eventWasHandled = TRUE; } else if (osStatus!=eventNotHandledErr) { NSLog(@"SendEventToEventTarget() returned %i.", (int)osStatus); goto CleanUp; } CleanUp: // Clean up. if (eventRef) ReleaseEvent(eventRef); // Done. return eventWasHandled; } - (void)_handleRootBoundsChanged { HIViewRef root = HIViewGetRoot( _windowRef ); HIRect frame; HIViewGetFrame( root, &frame ); [_borderView setFrameSize:*(NSSize*)&frame.size]; } - (void)_handleContentBoundsChanged { HIViewRef root, contentView; HIRect rootBounds, contentFrame; NSRect oldContentFrameRect; root = HIViewGetRoot( _windowRef ); HIViewFindByID( root, kHIViewWindowContentID, &contentView ); HIViewGetFrame( contentView, &contentFrame ); HIViewGetBounds( root, &rootBounds ); // Set the content view's frame rect from the Carbon window's content region bounds. contentFrame.origin.y = rootBounds.size.height - CGRectGetMaxY( contentFrame ); oldContentFrameRect = [_contentView frame]; if ( !NSEqualRects( *(NSRect*)&contentFrame, oldContentFrameRect ) ) { [_contentView setFrame:*(NSRect*)&contentFrame]; } } - (OSStatus)_handleCarbonEvent:(EventRef)inEvent callRef:(EventHandlerCallRef)inCallRef { OSStatus result = eventNotHandledErr; switch ( GetEventClass( inEvent ) ) { case kEventClassControl: { ControlRef control; check( GetEventKind( inEvent ) == kEventControlBoundsChanged ); GetEventParameter( inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof( ControlRef ), NULL, &control ); if ( control == HIViewGetRoot( _windowRef ) ) [self _handleRootBoundsChanged]; else [self _handleContentBoundsChanged]; } break; case kEventClassWindow: switch ( GetEventKind( inEvent ) ) { case kEventWindowShown: [self _setVisible:YES]; break; case kEventWindowHidden: [self _setVisible:NO]; break; case kEventWindowActivated: [self makeKeyWindow]; break; case kEventWindowDeactivated: [self resignKeyWindow]; break; case kEventWindowBoundsChanged: [self reconcileToCarbonWindowBounds]; break; } break; } return result; } // Handle various events that Carbon is sending to our window. static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCallRef, EventRef inEventRef, void *inUserData) { // default action is to send event to next handler. We modify osStatus as necessary where we don't want this behavior OSStatus osStatus = eventNotHandledErr; // We do different things for different event types. CarbonWindowAdapter *carbonWindow = (CarbonWindowAdapter *)inUserData; osStatus = [carbonWindow _handleCarbonEvent: inEventRef callRef: inEventHandlerCallRef]; // Done. If we want to propagate the event, we return eventNotHandledErr to send it to the next handler return osStatus; } // [3364117] We need to make sure this does not fall through to the AppKit implementation! bad things happen. - (void)_reallyDoOrderWindow:(NSWindowOrderingMode)place relativeTo:(int)otherWin findKey:(BOOL)doKeyCalc forCounter:(BOOL)isACounter force:(BOOL)doForce isModal:(BOOL)isModal { } - (NSRect) _growBoxRect { WindowAttributes attrs; NSRect retRect = NSZeroRect; GetWindowAttributes( _windowRef, &attrs ); if ( attrs & kWindowResizableAttribute ) { HIRect bounds, rect; HIViewRef view; HIViewGetBounds( HIViewGetRoot( _windowRef ), &bounds ); HIViewFindByID( HIViewGetRoot( _windowRef ), kHIViewWindowGrowBoxID, &view ); HIViewGetFrame( view, &rect ); rect.origin.y = bounds.size.height - CGRectGetMaxY( rect ) - 1; rect.origin.x++; retRect = *(NSRect*)▭ } return retRect; } @end // implementation CarbonWindowAdapter #endif ������������������������������������������������������������������������������������������������������������WebKit/mac/Carbon/CarbonUtils.h���������������������������������������������������������������������0000644�0001750�0001750�00000004306�11150764637�014716� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004, 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 __HIWEBCARBONUTILS__ #define __HIWEBCARBONUTILS__ #ifndef __LP64__ // These functions are only available for 32-bit. #include <JavaScriptCore/WebKitAvailability.h> #ifdef __OBJC__ #import <ApplicationServices/ApplicationServices.h> @class NSImage; #endif #ifdef __cplusplus extern "C" { #endif extern void WebInitForCarbon(void) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0; #ifdef __OBJC__ extern CGImageRef WebConvertNSImageToCGImageRef(NSImage * inImage) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0; #endif #ifdef __cplusplus } #endif #endif #endif // __HIWEBCARBONUTILS__ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Carbon/CarbonWindowContentView.h���������������������������������������������������������0000644�0001750�0001750�00000003244�10663124504�017242� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <AppKit/NSView.h> @interface CarbonWindowContentView : NSView { } @end // interface CarbonWindowContentView ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Carbon/CarbonWindowContentView.m���������������������������������������������������������0000644�0001750�0001750�00000003233�10663124504�017245� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 __LP64__ #import "CarbonWindowContentView.h" @implementation CarbonWindowContentView @end #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Storage/���������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024252�012503� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Storage/WebDatabaseManagerInternal.h�����������������������������������������������������0000644�0001750�0001750�00000003154�11200223554�020003� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(DATABASE) void WebKitInitializeDatabasesIfNecessary(); #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Storage/WebSecurityOriginInternal.h������������������������������������������������������0000644�0001750�0001750�00000003513�10763043374�017777� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #include "WebSecurityOriginPrivate.h" namespace WebCore { class SecurityOrigin; } typedef WebCore::SecurityOrigin WebCoreSecurityOrigin; @interface WebSecurityOrigin (WebInternal) - (id)_initWithWebCoreSecurityOrigin:(WebCoreSecurityOrigin *)origin; - (WebCoreSecurityOrigin *)_core; @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Storage/WebDatabaseTrackerClient.h�������������������������������������������������������0000644�0001750�0001750�00000004022�11200223554�017461� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(DATABASE) #import <WebCore/DatabaseTrackerClient.h> class WebDatabaseTrackerClient : public WebCore::DatabaseTrackerClient { public: static WebDatabaseTrackerClient* sharedWebDatabaseTrackerClient(); virtual ~WebDatabaseTrackerClient(); virtual void dispatchDidModifyOrigin(WebCore::SecurityOrigin*); virtual void dispatchDidModifyDatabase(WebCore::SecurityOrigin*, const WebCore::String& databaseIdentifier); private: WebDatabaseTrackerClient(); }; #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Storage/WebDatabaseManager.mm������������������������������������������������������������0000644�0001750�0001750�00000012512�11200223554�016466� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebDatabaseManagerPrivate.h" #import "WebDatabaseManagerInternal.h" #if ENABLE(DATABASE) #import "WebDatabaseTrackerClient.h" #import "WebSecurityOriginInternal.h" #import <WebCore/DatabaseTracker.h> #import <WebCore/SecurityOrigin.h> using namespace WebCore; NSString *WebDatabaseDirectoryDefaultsKey = @"WebDatabaseDirectory"; NSString *WebDatabaseDisplayNameKey = @"WebDatabaseDisplayNameKey"; NSString *WebDatabaseExpectedSizeKey = @"WebDatabaseExpectedSizeKey"; NSString *WebDatabaseUsageKey = @"WebDatabaseUsageKey"; NSString *WebDatabaseDidModifyOriginNotification = @"WebDatabaseDidModifyOriginNotification"; NSString *WebDatabaseDidModifyDatabaseNotification = @"WebDatabaseDidModifyDatabaseNotification"; NSString *WebDatabaseIdentifierKey = @"WebDatabaseIdentifierKey"; @implementation WebDatabaseManager + (WebDatabaseManager *) sharedWebDatabaseManager { static WebDatabaseManager *sharedManager = [[WebDatabaseManager alloc] init]; return sharedManager; } - (NSArray *)origins { Vector<RefPtr<SecurityOrigin> > coreOrigins; DatabaseTracker::tracker().origins(coreOrigins); NSMutableArray *webOrigins = [[NSMutableArray alloc] initWithCapacity:coreOrigins.size()]; for (unsigned i = 0; i < coreOrigins.size(); ++i) { WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:coreOrigins[i].get()]; [webOrigins addObject:webOrigin]; [webOrigin release]; } return [webOrigins autorelease]; } - (NSArray *)databasesWithOrigin:(WebSecurityOrigin *)origin { Vector<String> nameVector; if (!DatabaseTracker::tracker().databaseNamesForOrigin([origin _core], nameVector)) return nil; NSMutableArray *names = [[NSMutableArray alloc] initWithCapacity:nameVector.size()]; for (unsigned i = 0; i < nameVector.size(); ++i) [names addObject:(NSString *)nameVector[i]]; return [names autorelease]; } - (NSDictionary *)detailsForDatabase:(NSString *)databaseIdentifier withOrigin:(WebSecurityOrigin *)origin { static id keys[3] = {WebDatabaseDisplayNameKey, WebDatabaseExpectedSizeKey, WebDatabaseUsageKey}; DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(databaseIdentifier, [origin _core]); if (details.name().isNull()) return nil; id objects[3]; objects[0] = details.displayName().isEmpty() ? databaseIdentifier : (NSString *)details.displayName(); objects[1] = [NSNumber numberWithUnsignedLongLong:details.expectedUsage()]; objects[2] = [NSNumber numberWithUnsignedLongLong:details.currentUsage()]; return [[[NSDictionary alloc] initWithObjects:objects forKeys:keys count:3] autorelease]; } - (void)deleteAllDatabases { DatabaseTracker::tracker().deleteAllDatabases(); } - (void)deleteOrigin:(WebSecurityOrigin *)origin { DatabaseTracker::tracker().deleteOrigin([origin _core]); } - (void)deleteDatabase:(NSString *)databaseIdentifier withOrigin:(WebSecurityOrigin *)origin { DatabaseTracker::tracker().deleteDatabase([origin _core], databaseIdentifier); } @end void WebKitInitializeDatabasesIfNecessary() { static BOOL initialized = NO; if (initialized) return; // Set the database root path in WebCore NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString *databasesDirectory = [defaults objectForKey:WebDatabaseDirectoryDefaultsKey]; if (!databasesDirectory || ![databasesDirectory isKindOfClass:[NSString class]]) databasesDirectory = @"~/Library/WebKit/Databases"; DatabaseTracker::tracker().setDatabaseDirectoryPath([databasesDirectory stringByStandardizingPath]); // Set the DatabaseTrackerClient DatabaseTracker::tracker().setClient(WebDatabaseTrackerClient::sharedWebDatabaseTrackerClient()); initialized = YES; } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Storage/WebDatabaseTrackerClient.mm������������������������������������������������������0000644�0001750�0001750�00000006267�11200223554�017660� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebDatabaseTrackerClient.h" #if ENABLE(DATABASE) #import "WebDatabaseManagerPrivate.h" #import "WebSecurityOriginInternal.h" #import <wtf/RetainPtr.h> #import <WebCore/SecurityOrigin.h> using namespace WebCore; WebDatabaseTrackerClient* WebDatabaseTrackerClient::sharedWebDatabaseTrackerClient() { static WebDatabaseTrackerClient* sharedClient = new WebDatabaseTrackerClient(); return sharedClient; } WebDatabaseTrackerClient::WebDatabaseTrackerClient() { } WebDatabaseTrackerClient::~WebDatabaseTrackerClient() { } void WebDatabaseTrackerClient::dispatchDidModifyOrigin(SecurityOrigin* origin) { RetainPtr<WebSecurityOrigin> webSecurityOrigin(AdoptNS, [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]); [[NSNotificationCenter defaultCenter] postNotificationName:WebDatabaseDidModifyOriginNotification object:webSecurityOrigin.get()]; } void WebDatabaseTrackerClient::dispatchDidModifyDatabase(SecurityOrigin* origin, const String& databaseIdentifier) { RetainPtr<WebSecurityOrigin> webSecurityOrigin(AdoptNS, [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]); RetainPtr<NSDictionary> userInfo(AdoptNS, [[NSDictionary alloc] initWithObjectsAndKeys:(NSString *)databaseIdentifier, WebDatabaseIdentifierKey, nil]); [[NSNotificationCenter defaultCenter] postNotificationName:WebDatabaseDidModifyDatabaseNotification object:webSecurityOrigin.get() userInfo:userInfo.get()]; } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Storage/WebSecurityOrigin.mm�������������������������������������������������������������0000644�0001750�0001750�00000007755�11200223554�016463� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebSecurityOriginInternal.h" #import <WebCore/DatabaseTracker.h> #import <WebCore/KURL.h> #import <WebCore/SecurityOrigin.h> using namespace WebCore; @implementation WebSecurityOrigin - (id)initWithURL:(NSURL *)url { self = [super init]; if (!self) return nil; RefPtr<SecurityOrigin> origin = SecurityOrigin::create(KURL([url absoluteURL])); origin->ref(); _private = reinterpret_cast<WebSecurityOriginPrivate*>(origin.get()); return self; } - (NSString*)protocol { return reinterpret_cast<SecurityOrigin*>(_private)->protocol(); } - (NSString*)host { return reinterpret_cast<SecurityOrigin*>(_private)->host(); } // Deprecated. Use host instead. This needs to stay here until we ship a new Safari. - (NSString*)domain { return [self host]; } - (unsigned short)port { return reinterpret_cast<SecurityOrigin*>(_private)->port(); } - (unsigned long long)usage { #if ENABLE(DATABASE) return DatabaseTracker::tracker().usageForOrigin(reinterpret_cast<SecurityOrigin*>(_private)); #else return 0; #endif } - (unsigned long long)quota { #if ENABLE(DATABASE) return DatabaseTracker::tracker().quotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private)); #else return 0; #endif } // Sets the storage quota (in bytes) // If the quota is set to a value lower than the current usage, that quota will "stick" but no data will be purged to meet the new quota. // This will simply prevent new data from being added to databases in that origin - (void)setQuota:(unsigned long long)quota { #if ENABLE(DATABASE) DatabaseTracker::tracker().setQuota(reinterpret_cast<SecurityOrigin*>(_private), quota); #endif } - (BOOL)isEqual:(id)anObject { if (![anObject isMemberOfClass:[WebSecurityOrigin class]]) { return NO; } return [self _core]->equal([anObject _core]); } - (void)dealloc { if (_private) reinterpret_cast<SecurityOrigin*>(_private)->deref(); [super dealloc]; } - (void)finalize { if (_private) reinterpret_cast<SecurityOrigin*>(_private)->deref(); [super finalize]; } @end @implementation WebSecurityOrigin (WebInternal) - (id)_initWithWebCoreSecurityOrigin:(SecurityOrigin*)origin { ASSERT(origin); self = [super init]; if (!self) return nil; origin->ref(); _private = reinterpret_cast<WebSecurityOriginPrivate*>(origin); return self; } - (SecurityOrigin *)_core { return reinterpret_cast<SecurityOrigin*>(_private); } @end �������������������WebKit/mac/Storage/WebDatabaseManagerPrivate.h������������������������������������������������������0000644�0001750�0001750�00000006306�11200223554�017643� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if ENABLE(DATABASE) extern NSString *WebDatabaseDirectoryDefaultsKey; extern NSString *WebDatabaseDisplayNameKey; extern NSString *WebDatabaseExpectedSizeKey; extern NSString *WebDatabaseUsageKey; // Posted with an origin is created from scratch, gets a new database, has a database deleted, has a quota change, etc // The notification object will be a WebSecurityOrigin object corresponding to the origin. extern NSString *WebDatabaseDidModifyOriginNotification; // Posted when a database is created, its size increases, its display name changes, or its estimated size changes, or the database is removed // The notification object will be a WebSecurityOrigin object corresponding to the origin. // The notification userInfo will have a WebDatabaseNameKey whose value is the database name. extern NSString *WebDatabaseDidModifyDatabaseNotification; extern NSString *WebDatabaseIdentifierKey; @class WebSecurityOrigin; @interface WebDatabaseManager : NSObject + (WebDatabaseManager *)sharedWebDatabaseManager; // Will return an array of WebSecurityOrigin objects. - (NSArray *)origins; // Will return an array of strings, the identifiers of each database in the given origin. - (NSArray *)databasesWithOrigin:(WebSecurityOrigin *)origin; // Will return the dictionary describing everything about the database for the passed identifier and origin. - (NSDictionary *)detailsForDatabase:(NSString *)databaseIdentifier withOrigin:(WebSecurityOrigin *)origin; - (void)deleteAllDatabases; // Deletes all databases and all origins. - (void)deleteOrigin:(WebSecurityOrigin *)origin; - (void)deleteDatabase:(NSString *)databaseIdentifier withOrigin:(WebSecurityOrigin *)origin; @end #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Storage/WebSecurityOriginPrivate.h�������������������������������������������������������0000644�0001750�0001750�00000004430�11200223554�017617� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ @class WebSecurityOriginPrivate; @interface WebSecurityOrigin : NSObject { WebSecurityOriginPrivate *_private; } - (id)initWithURL:(NSURL *)url; - (NSString*)protocol; - (NSString*)host; // Returns zero if the port is the default port for the protocol, non-zero otherwise - (unsigned short)port; // Returns the current total usage of all databases in this security origin in bytes - (unsigned long long)usage; - (unsigned long long)quota; // Sets the storage quota (in bytes) // If the quota is set to a value lower than the current usage, that quota will "stick" but no data will be purged to meet the new quota. // This will simply prevent new data from being added to databases in that origin - (void)setQuota:(unsigned long long)quota; @end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/MigrateHeaders.make����������������������������������������������������������������������0000644�0001750�0001750�00000060647�11250661621�014637� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> # # 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. # 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of # its contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. VPATH = $(WEBCORE_PRIVATE_HEADERS_DIR) INTERNAL_HEADERS_DIR = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit PUBLIC_HEADERS_DIR = $(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH) PRIVATE_HEADERS_DIR = $(TARGET_BUILD_DIR)/$(PRIVATE_HEADERS_FOLDER_PATH) .PHONY : all all : \ $(PUBLIC_HEADERS_DIR)/DOM.h \ $(PUBLIC_HEADERS_DIR)/DOMAbstractView.h \ $(PUBLIC_HEADERS_DIR)/DOMAttr.h \ $(PUBLIC_HEADERS_DIR)/DOMCDATASection.h \ $(PUBLIC_HEADERS_DIR)/DOMCSS.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSCharsetRule.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSFontFaceRule.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSImportRule.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSMediaRule.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSPageRule.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSPrimitiveValue.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSRule.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSRuleList.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSStyleDeclaration.h \ $(INTERNAL_HEADERS_DIR)/DOMCSSStyleDeclarationInternal.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSStyleRule.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSStyleSheet.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSUnknownRule.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSValue.h \ $(PUBLIC_HEADERS_DIR)/DOMCSSValueList.h \ $(PUBLIC_HEADERS_DIR)/DOMCharacterData.h \ $(PUBLIC_HEADERS_DIR)/DOMComment.h \ $(PUBLIC_HEADERS_DIR)/DOMCore.h \ $(PUBLIC_HEADERS_DIR)/DOMCounter.h \ $(PUBLIC_HEADERS_DIR)/DOMDocument.h \ $(INTERNAL_HEADERS_DIR)/DOMDocumentInternal.h \ $(PUBLIC_HEADERS_DIR)/DOMDocumentFragment.h \ $(INTERNAL_HEADERS_DIR)/DOMDocumentFragmentInternal.h \ $(PUBLIC_HEADERS_DIR)/DOMDocumentType.h \ $(PUBLIC_HEADERS_DIR)/DOMElement.h \ $(INTERNAL_HEADERS_DIR)/DOMElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMElementTimeControl.h \ $(PUBLIC_HEADERS_DIR)/DOMEntity.h \ $(PUBLIC_HEADERS_DIR)/DOMEntityReference.h \ $(PUBLIC_HEADERS_DIR)/DOMEvent.h \ $(PUBLIC_HEADERS_DIR)/DOMEventException.h \ $(PUBLIC_HEADERS_DIR)/DOMEventListener.h \ $(PUBLIC_HEADERS_DIR)/DOMEventTarget.h \ $(PUBLIC_HEADERS_DIR)/DOMEvents.h \ $(PUBLIC_HEADERS_DIR)/DOMException.h \ $(PUBLIC_HEADERS_DIR)/DOMExtensions.h \ $(PUBLIC_HEADERS_DIR)/DOMFile.h \ $(PUBLIC_HEADERS_DIR)/DOMFileList.h \ $(PUBLIC_HEADERS_DIR)/DOMHTML.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLAnchorElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLAppletElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLAreaElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLBRElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLBaseElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLBaseFontElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLBodyElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLButtonElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLCollection.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLDListElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLDirectoryElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLDivElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLDocument.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLElement.h \ $(INTERNAL_HEADERS_DIR)/DOMHTMLElementInternal.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLEmbedElement.h \ $(PRIVATE_HEADERS_DIR)/DOMHTMLEmbedElementPrivate.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLFieldSetElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLFontElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLFormElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLFrameElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLFrameSetElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLHRElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLHeadElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLHeadingElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLHtmlElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLIFrameElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLImageElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLInputElement.h \ $(INTERNAL_HEADERS_DIR)/DOMHTMLInputElementInternal.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLIsIndexElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLLIElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLLabelElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLLegendElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLLinkElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLMapElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLMarqueeElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLMenuElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLMetaElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLModElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLOListElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLObjectElement.h \ $(PRIVATE_HEADERS_DIR)/DOMHTMLObjectElementPrivate.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLOptGroupElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLOptionElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLOptionsCollection.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLParagraphElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLParamElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLPreElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLQuoteElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLScriptElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLSelectElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLStyleElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLTableCaptionElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLTableCellElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLTableColElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLTableElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLTableRowElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLTableSectionElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLTextAreaElement.h \ $(INTERNAL_HEADERS_DIR)/DOMHTMLTextAreaElementInternal.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLTitleElement.h \ $(PUBLIC_HEADERS_DIR)/DOMHTMLUListElement.h \ $(PUBLIC_HEADERS_DIR)/DOMImplementation.h \ $(PUBLIC_HEADERS_DIR)/DOMKeyboardEvent.h \ $(PUBLIC_HEADERS_DIR)/DOMMediaList.h \ $(PUBLIC_HEADERS_DIR)/DOMMouseEvent.h \ $(PUBLIC_HEADERS_DIR)/DOMMutationEvent.h \ $(PUBLIC_HEADERS_DIR)/DOMNamedNodeMap.h \ $(PUBLIC_HEADERS_DIR)/DOMNode.h \ $(INTERNAL_HEADERS_DIR)/DOMNodeInternal.h \ $(PUBLIC_HEADERS_DIR)/DOMNodeFilter.h \ $(PUBLIC_HEADERS_DIR)/DOMNodeIterator.h \ $(PUBLIC_HEADERS_DIR)/DOMNodeList.h \ $(PUBLIC_HEADERS_DIR)/DOMNotation.h \ $(PUBLIC_HEADERS_DIR)/DOMObject.h \ $(PUBLIC_HEADERS_DIR)/DOMOverflowEvent.h \ $(PRIVATE_HEADERS_DIR)/DOMPrivate.h \ $(PUBLIC_HEADERS_DIR)/DOMProcessingInstruction.h \ $(PUBLIC_HEADERS_DIR)/DOMProgressEvent.h \ $(PUBLIC_HEADERS_DIR)/DOMRGBColor.h \ $(PUBLIC_HEADERS_DIR)/DOMRange.h \ $(INTERNAL_HEADERS_DIR)/DOMRangeInternal.h \ $(PUBLIC_HEADERS_DIR)/DOMRangeException.h \ $(PUBLIC_HEADERS_DIR)/DOMRanges.h \ $(PUBLIC_HEADERS_DIR)/DOMRect.h \ $(PUBLIC_HEADERS_DIR)/DOMStyleSheet.h \ $(PUBLIC_HEADERS_DIR)/DOMStyleSheetList.h \ $(PUBLIC_HEADERS_DIR)/DOMStylesheets.h \ $(PUBLIC_HEADERS_DIR)/DOMText.h \ $(PUBLIC_HEADERS_DIR)/DOMTraversal.h \ $(PUBLIC_HEADERS_DIR)/DOMTreeWalker.h \ $(PUBLIC_HEADERS_DIR)/DOMUIEvent.h \ $(PUBLIC_HEADERS_DIR)/DOMViews.h \ $(PUBLIC_HEADERS_DIR)/DOMWheelEvent.h \ $(PUBLIC_HEADERS_DIR)/DOMXPath.h \ $(PUBLIC_HEADERS_DIR)/DOMXPathException.h \ $(PUBLIC_HEADERS_DIR)/DOMXPathExpression.h \ $(PUBLIC_HEADERS_DIR)/DOMXPathNSResolver.h \ $(PUBLIC_HEADERS_DIR)/DOMXPathResult.h \ $(PRIVATE_HEADERS_DIR)/WebDashboardRegion.h \ $(PUBLIC_HEADERS_DIR)/WebScriptObject.h \ $(PUBLIC_HEADERS_DIR)/npapi.h \ $(PUBLIC_HEADERS_DIR)/npfunctions.h \ $(PUBLIC_HEADERS_DIR)/npruntime.h \ # ifeq ($(findstring ENABLE_SVG_DOM_OBJC_BINDINGS,$(FEATURE_DEFINES)), ENABLE_SVG_DOM_OBJC_BINDINGS) all : \ $(PRIVATE_HEADERS_DIR)/DOMHTMLFrameElementPrivate.h \ $(PRIVATE_HEADERS_DIR)/DOMHTMLIFrameElementPrivate.h \ $(PRIVATE_HEADERS_DIR)/DOMSVG.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAltGlyphElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAltGlyphElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAngle.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAngleInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimateColorElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimateColorElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimateElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimateElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimateTransformElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimateTransformElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedAngle.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedAngleInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedBoolean.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedBooleanInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedEnumeration.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedEnumerationInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedInteger.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedIntegerInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedLength.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedLengthInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedLengthList.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedLengthListInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedNumber.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedNumberInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedNumberList.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedNumberListInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedPathData.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedPoints.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedPreserveAspectRatio.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedPreserveAspectRatioInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedRect.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedRectInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedString.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedStringInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedTransformList.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedTransformListInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimationElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimationElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGCircleElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGCircleElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGClipPathElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGClipPathElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGColor.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGColorInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGComponentTransferFunctionElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGComponentTransferFunctionElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGCursorElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGCursorElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGDefsElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGDefsElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGDescElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGDescElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGDocument.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGDocumentInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGElement.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGElementInstance.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGElementInstanceInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGElementInstanceList.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGElementInstanceListInternal.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGEllipseElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGEllipseElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGException.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGExternalResourcesRequired.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEBlendElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEBlendElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEColorMatrixElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEColorMatrixElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEComponentTransferElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEComponentTransferElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFECompositeElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFECompositeElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEDiffuseLightingElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEDiffuseLightingElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEDisplacementMapElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEDisplacementMapElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEDistantLightElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEDistantLightElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEFloodElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEFloodElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEFuncAElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEFuncAElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEFuncBElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEFuncBElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEFuncGElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEFuncGElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEFuncRElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEFuncRElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEGaussianBlurElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEGaussianBlurElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEImageElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEImageElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEMergeElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEMergeElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEMergeNodeElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEMergeNodeElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEOffsetElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEOffsetElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEPointLightElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEPointLightElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFESpecularLightingElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFESpecularLightingElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFESpotLightElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFESpotLightElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFETileElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFETileElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFETurbulenceElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFETurbulenceElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFilterElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFilterElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFilterPrimitiveStandardAttributes.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFitToViewBox.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFontElement.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFontFaceElement.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFontFaceFormatElement.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFontFaceNameElement.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFontFaceSrcElement.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFontFaceUriElement.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGForeignObjectElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGForeignObjectElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGGElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGGElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGGlyphElement.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGGradientElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGGradientElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGImageElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGImageElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGLangSpace.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGLength.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGLengthInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGLengthList.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGLengthListInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGLineElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGLineElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGLinearGradientElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGLinearGradientElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGLocatable.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGMarkerElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGMarkerElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGMaskElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGMaskElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGMatrix.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGMatrixInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGMetadataElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGMetadataElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGMissingGlyphElement.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGNumber.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGNumberList.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGNumberListInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPaint.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPaintInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSeg.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegArcAbs.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegArcAbsInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegArcRel.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegArcRelInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegClosePath.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegClosePathInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegCurvetoCubicAbs.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegCurvetoCubicAbsInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegCurvetoCubicRel.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegCurvetoCubicRelInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegCurvetoCubicSmoothAbs.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegCurvetoCubicSmoothAbsInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegCurvetoCubicSmoothRel.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegCurvetoCubicSmoothRelInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegCurvetoQuadraticAbs.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegCurvetoQuadraticAbsInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegCurvetoQuadraticRel.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegCurvetoQuadraticRelInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegCurvetoQuadraticSmoothAbs.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegCurvetoQuadraticSmoothAbsInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegCurvetoQuadraticSmoothRel.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegCurvetoQuadraticSmoothRelInternal.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegLinetoAbs.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegLinetoAbsInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegLinetoHorizontalAbs.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegLinetoHorizontalAbsInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegLinetoHorizontalRel.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegLinetoHorizontalRelInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegLinetoRel.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegLinetoRelInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegLinetoVerticalAbs.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegLinetoVerticalAbsInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegLinetoVerticalRel.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegLinetoVerticalRelInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegList.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegListInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegMovetoAbs.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegMovetoAbsInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPathSegMovetoRel.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPathSegMovetoRelInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPatternElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPatternElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPoint.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPointList.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPointListInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPolygonElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPolygonElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPolylineElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPolylineElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGPreserveAspectRatio.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGPreserveAspectRatioInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGRadialGradientElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGRadialGradientElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGRect.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGRectElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGRectElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGRenderingIntent.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGRenderingIntentInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGSVGElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGSVGElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGScriptElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGScriptElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGSetElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGSetElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGStopElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGStopElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGStringList.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGStringListInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGStylable.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGStyleElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGStyleElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGSwitchElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGSwitchElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGSymbolElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGSymbolElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGTRefElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGTRefElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGTSpanElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGTSpanElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGTests.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGTextContentElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGTextContentElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGTextElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGTextElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGTextPathElement.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGTextPositioningElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGTextPositioningElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGTitleElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGTitleElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGTransform.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGTransformInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGTransformList.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGTransformListInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGTransformable.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGURIReference.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGUnitTypes.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGUnitTypesInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGUseElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGUseElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGViewElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGViewElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGZoomAndPan.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGZoomEvent.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGZoomEventInternal.h \ endif REPLACE_RULES = -e s/\<WebCore/\<WebKit/ -e s/DOMDOMImplementation/DOMImplementation/ HEADER_MIGRATE_CMD = sed $(REPLACE_RULES) $< $(PROCESS_HEADER_FOR_MACOSX_TARGET_CMD) > $@ ifeq ($(MACOSX_DEPLOYMENT_TARGET),10.4) PROCESS_HEADER_FOR_MACOSX_TARGET_CMD = | ( unifdef -DBUILDING_ON_TIGER || exit 0 ) else PROCESS_HEADER_FOR_MACOSX_TARGET_CMD = | ( unifdef -UBUILDING_ON_TIGER || exit 0 ) endif $(PUBLIC_HEADERS_DIR)/DOM% : DOMDOM% MigrateHeaders.make $(HEADER_MIGRATE_CMD) $(PRIVATE_HEADERS_DIR)/DOM% : DOMDOM% MigrateHeaders.make $(HEADER_MIGRATE_CMD) $(PUBLIC_HEADERS_DIR)/% : % MigrateHeaders.make $(HEADER_MIGRATE_CMD) $(PRIVATE_HEADERS_DIR)/% : % MigrateHeaders.make $(HEADER_MIGRATE_CMD) $(INTERNAL_HEADERS_DIR)/% : % MigrateHeaders.make $(HEADER_MIGRATE_CMD) �����������������������������������������������������������������������������������������WebKit/mac/WebInspector/����������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024252�013503� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebInspector/WebNodeHighlightView.h������������������������������������������������������0000644�0001750�0001750�00000003465�10770755651�017707� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ @class WebNodeHighlight; @interface WebNodeHighlightView : NSView { WebNodeHighlight *_webNodeHighlight; } - (id)initWithWebNodeHighlight:(WebNodeHighlight *)webNodeHighlight; - (WebNodeHighlight *)webNodeHighlight; - (void)detachFromWebNodeHighlight; @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebInspector/WebNodeHighlight.mm���������������������������������������������������������0000644�0001750�0001750�00000015725�11213371321�017215� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNodeHighlight.h" #import "WebNodeHighlightView.h" #import "WebNSViewExtras.h" #import <WebCore/InspectorController.h> #import <wtf/Assertions.h> using namespace WebCore; @interface WebNodeHighlight (FileInternal) - (NSRect)_computeHighlightWindowFrame; - (void)_repositionHighlightWindow; @end @implementation WebNodeHighlight - (id)initWithTargetView:(NSView *)targetView inspectorController:(InspectorController*)inspectorController { self = [super init]; if (!self) return nil; _targetView = [targetView retain]; _inspectorController = inspectorController; int styleMask = NSBorderlessWindowMask; NSRect contentRect = [NSWindow contentRectForFrameRect:[self _computeHighlightWindowFrame] styleMask:styleMask]; _highlightWindow = [[NSWindow alloc] initWithContentRect:contentRect styleMask:styleMask backing:NSBackingStoreBuffered defer:NO]; [_highlightWindow setBackgroundColor:[NSColor clearColor]]; [_highlightWindow setOpaque:NO]; [_highlightWindow setIgnoresMouseEvents:YES]; [_highlightWindow setReleasedWhenClosed:NO]; _highlightView = [[WebNodeHighlightView alloc] initWithWebNodeHighlight:self]; [_highlightWindow setContentView:_highlightView]; [_highlightView release]; return self; } - (void)dealloc { ASSERT(!_highlightWindow); ASSERT(!_targetView); ASSERT(!_highlightView); [super dealloc]; } - (void)attach { ASSERT(_targetView); ASSERT([_targetView window]); ASSERT(_highlightWindow); if (!_highlightWindow || !_targetView || ![_targetView window]) return; [[_targetView window] addChildWindow:_highlightWindow ordered:NSWindowAbove]; // Observe both frame-changed and bounds-changed notifications because either one could leave // the highlight incorrectly positioned with respect to the target view. We need to do this for // the entire superview hierarchy to handle scrolling, bars coming and going, etc. // (without making concrete assumptions about the view hierarchy). NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; for (NSView *v = _targetView; v; v = [v superview]) { [notificationCenter addObserver:self selector:@selector(_repositionHighlightWindow) name:NSViewFrameDidChangeNotification object:v]; [notificationCenter addObserver:self selector:@selector(_repositionHighlightWindow) name:NSViewBoundsDidChangeNotification object:v]; } if (_delegate && [_delegate respondsToSelector:@selector(didAttachWebNodeHighlight:)]) [_delegate didAttachWebNodeHighlight:self]; } - (id)delegate { return _delegate; } - (void)detach { if (!_highlightWindow) { ASSERT(!_targetView); return; } if (_delegate && [_delegate respondsToSelector:@selector(willDetachWebNodeHighlight:)]) [_delegate willDetachWebNodeHighlight:self]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter removeObserver:self name:NSViewFrameDidChangeNotification object:nil]; [notificationCenter removeObserver:self name:NSViewBoundsDidChangeNotification object:nil]; [[_highlightWindow parentWindow] removeChildWindow:_highlightWindow]; [_highlightWindow release]; _highlightWindow = nil; [_targetView release]; _targetView = nil; // We didn't retain _highlightView, but we do need to tell it to forget about us, so it doesn't // try to send our delegate messages after we've been dealloc'ed, e.g. [_highlightView detachFromWebNodeHighlight]; _highlightView = nil; } - (WebNodeHighlightView *)highlightView { return _highlightView; } - (void)setDelegate:(id)delegate { // The delegate is not retained, as usual in Cocoa. _delegate = delegate; } - (void)setNeedsUpdateInTargetViewRect:(NSRect)rect { ASSERT(_targetView); [[_targetView window] disableScreenUpdatesUntilFlush]; // Mark the whole highlight view as needing display since we don't know what areas // need updated, since the highlight can be larger than the element to show margins. [_highlightView setNeedsDisplay:YES]; // Redraw highlight view immediately so it updates in sync with the target view. // This is especially visible when resizing the window, scrolling or with DHTML. [_highlightView displayIfNeeded]; } - (NSView *)targetView { return _targetView; } - (InspectorController*)inspectorController { return _inspectorController; } @end @implementation WebNodeHighlight (FileInternal) - (NSRect)_computeHighlightWindowFrame { ASSERT(_targetView); ASSERT([_targetView window]); NSRect highlightWindowFrame = [_targetView convertRect:[_targetView visibleRect] toView:nil]; highlightWindowFrame.origin = [[_targetView window] convertBaseToScreen:highlightWindowFrame.origin]; return highlightWindowFrame; } - (void)_repositionHighlightWindow { // This assertion fires in cases where a new tab is created while the highlight // is showing (<http://bugs.webkit.org/show_bug.cgi?id=14254>) ASSERT([_targetView window]); // Until that bug is fixed, bail out to avoid worse problems where the highlight // moves to a nonsense location. if (![_targetView window]) return; // Disable screen updates so the highlight moves in sync with the view. [[_targetView window] disableScreenUpdatesUntilFlush]; [_highlightWindow setFrame:[self _computeHighlightWindowFrame] display:YES]; } @end �������������������������������������������WebKit/mac/WebInspector/WebNodeHighlight.h����������������������������������������������������������0000644�0001750�0001750�00000004606�10770755651�017052� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ @class WebNodeHighlightView; namespace WebCore { class InspectorController; } @interface WebNodeHighlight : NSObject { NSView *_targetView; NSWindow *_highlightWindow; WebNodeHighlightView *_highlightView; WebCore::InspectorController* _inspectorController; id _delegate; } - (id)initWithTargetView:(NSView *)targetView inspectorController:(WebCore::InspectorController*)inspectorController; - (void)setDelegate:(id)delegate; - (id)delegate; - (void)attach; - (void)detach; - (NSView *)targetView; - (WebNodeHighlightView *)highlightView; - (WebCore::InspectorController*)inspectorController; - (void)setNeedsUpdateInTargetViewRect:(NSRect)rect; @end @interface NSObject (WebNodeHighlightDelegate) - (void)didAttachWebNodeHighlight:(WebNodeHighlight *)highlight; - (void)willDetachWebNodeHighlight:(WebNodeHighlight *)highlight; @end ��������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebInspector/WebInspector.mm�������������������������������������������������������������0000644�0001750�0001750�00000013262�11203616275�016451� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebInspector.h" #import "WebFrameInternal.h" #include <WebCore/Document.h> #include <WebCore/Frame.h> #include <WebCore/InspectorController.h> #include <WebCore/Page.h> using namespace WebCore; @implementation WebInspector - (id)initWithWebView:(WebView *)webView { if (!(self = [super init])) return nil; _webView = webView; // not retained to prevent a cycle return self; } - (void)webViewClosed { _webView = nil; } - (void)show:(id)sender { if (Page* page = core(_webView)) page->inspectorController()->show(); } - (void)showConsole:(id)sender { if (Page* page = core(_webView)) page->inspectorController()->showPanel(InspectorController::ConsolePanel); } - (void)showTimeline:(id)sender { // Not used anymore. Remove when a release of Safari non-longer calls this. } - (BOOL)isDebuggingJavaScript { if (Page* page = core(_webView)) return page->inspectorController()->debuggerEnabled(); return NO; } - (void)toggleDebuggingJavaScript:(id)sender { if ([self isDebuggingJavaScript]) [self stopDebuggingJavaScript:sender]; else [self startDebuggingJavaScript:sender]; } - (void)startDebuggingJavaScript:(id)sender { Page* page = core(_webView); if (!page) return; page->inspectorController()->showPanel(InspectorController::ScriptsPanel); page->inspectorController()->enableDebugger(); } - (void)stopDebuggingJavaScript:(id)sender { if (Page* page = core(_webView)) page->inspectorController()->disableDebugger(); } - (BOOL)isProfilingJavaScript { if (Page* page = core(_webView)) return page->inspectorController()->isRecordingUserInitiatedProfile(); return NO; } - (void)toggleProfilingJavaScript:(id)sender { if ([self isProfilingJavaScript]) [self stopProfilingJavaScript:sender]; else [self startProfilingJavaScript:sender]; } - (void)startProfilingJavaScript:(id)sender { if (Page* page = core(_webView)) page->inspectorController()->startUserInitiatedProfiling(); } - (void)stopProfilingJavaScript:(id)sender { Page* page = core(_webView); if (!page) return; page->inspectorController()->stopUserInitiatedProfiling(); page->inspectorController()->showPanel(InspectorController::ProfilesPanel); } - (BOOL)isJavaScriptProfilingEnabled { if (Page* page = core(_webView)) return page->inspectorController()->profilerEnabled(); return NO; } - (void)setJavaScriptProfilingEnabled:(BOOL)enabled { Page* page = core(_webView); if (!page) return; if (enabled) page->inspectorController()->enableProfiler(); else page->inspectorController()->disableProfiler(); } - (void)close:(id)sender { if (Page* page = core(_webView)) page->inspectorController()->close(); } - (void)attach:(id)sender { if (Page* page = core(_webView)) page->inspectorController()->attachWindow(); } - (void)detach:(id)sender { if (Page* page = core(_webView)) page->inspectorController()->detachWindow(); } @end @implementation WebInspector (Obsolete) + (WebInspector *)webInspector { // Safari 3.0 calls this method static BOOL logged = NO; if (!logged) { NSLog(@"+[WebInspector webInspector]: this method is obsolete."); logged = YES; } return [[[WebInspector alloc] init] autorelease]; } - (void)setWebFrame:(WebFrame *)frame { // Safari 3.0 calls this method static BOOL logged = NO; if (!logged) { NSLog(@"-[WebInspector setWebFrame:]: this method is obsolete."); logged = YES; } _webView = [frame webView]; } - (NSWindow *)window { // Shiira calls this internal method, return nil since we can't easily return the window static BOOL logged = NO; if (!logged) { NSLog(@"-[WebInspector window]: this method is obsolete and now returns nil."); logged = YES; } return nil; } - (void)showWindow:(id)sender { // Safari 3.0 calls this method static BOOL logged = NO; if (!logged) { NSLog(@"-[WebInspector showWindow:]: this method is obsolete."); logged = YES; } [self show:sender]; } @end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebInspector/WebInspector.h��������������������������������������������������������������0000644�0001750�0001750�00000004415�11101674472�016267� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/NSObject.h> @class WebView; @interface WebInspector : NSObject { WebView *_webView; } - (id)initWithWebView:(WebView *)webView; - (void)webViewClosed; - (void)show:(id)sender; - (void)showConsole:(id)sender; - (void)close:(id)sender; - (void)attach:(id)sender; - (void)detach:(id)sender; - (BOOL)isDebuggingJavaScript; - (void)toggleDebuggingJavaScript:(id)sender; - (void)startDebuggingJavaScript:(id)sender; - (void)stopDebuggingJavaScript:(id)sender; - (BOOL)isJavaScriptProfilingEnabled; - (void)setJavaScriptProfilingEnabled:(BOOL)enabled; - (BOOL)isProfilingJavaScript; - (void)toggleProfilingJavaScript:(id)sender; - (void)startProfilingJavaScript:(id)sender; - (void)stopProfilingJavaScript:(id)sender; @end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebInspector/WebNodeHighlightView.mm�����������������������������������������������������0000644�0001750�0001750�00000005225�11213371321�020042� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006, 2008 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebNodeHighlightView.h" #import "WebNodeHighlight.h" #import <WebCore/GraphicsContext.h> #import <WebCore/InspectorController.h> #import <wtf/Assertions.h> using namespace WebCore; @implementation WebNodeHighlightView - (id)initWithWebNodeHighlight:(WebNodeHighlight *)webNodeHighlight { self = [self initWithFrame:NSZeroRect]; if (!self) return nil; _webNodeHighlight = [webNodeHighlight retain]; return self; } - (void)dealloc { [self detachFromWebNodeHighlight]; [super dealloc]; } - (void)detachFromWebNodeHighlight { [_webNodeHighlight release]; _webNodeHighlight = nil; } - (BOOL)isFlipped { return YES; } - (void)drawRect:(NSRect)rect { [NSGraphicsContext saveGraphicsState]; ASSERT([[NSGraphicsContext currentContext] isFlipped]); GraphicsContext context((PlatformGraphicsContext*)[[NSGraphicsContext currentContext] graphicsPort]); [_webNodeHighlight inspectorController]->drawNodeHighlight(context); [NSGraphicsContext restoreGraphicsState]; } - (WebNodeHighlight *)webNodeHighlight { return _webNodeHighlight; } @end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/���������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024256�012453� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebUIDelegatePrivate.h�����������������������������������������������������������0000644�0001750�0001750�00000015172�11240572025�016565� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebUIDelegate.h> #if !defined(ENABLE_DASHBOARD_SUPPORT) #define ENABLE_DASHBOARD_SUPPORT 1 #endif // Mail on Tiger expects the old value for WebMenuItemTagSearchInGoogle #define WebMenuItemTagSearchInGoogle OldWebMenuItemTagSearchWeb #define WEBMENUITEMTAG_WEBKIT_3_0_SPI_START 2000 enum { // The next three values were used in WebKit 2.0 for SPI. In WebKit 3.0 these are API, with different values. OldWebMenuItemTagSearchInSpotlight = 1000, OldWebMenuItemTagSearchWeb, OldWebMenuItemTagLookUpInDictionary, // FIXME: These should move to WebUIDelegate.h as part of the WebMenuItemTag enum there, when we're not in API freeze // Note that these values must be kept aligned with values in WebCore/ContextMenuItem.h WebMenuItemTagOpenLink = WEBMENUITEMTAG_WEBKIT_3_0_SPI_START, WebMenuItemTagIgnoreGrammar, WebMenuItemTagSpellingMenu, WebMenuItemTagShowSpellingPanel, WebMenuItemTagCheckSpelling, WebMenuItemTagCheckSpellingWhileTyping, WebMenuItemTagCheckGrammarWithSpelling, WebMenuItemTagFontMenu, WebMenuItemTagShowFonts, WebMenuItemTagBold, WebMenuItemTagItalic, WebMenuItemTagUnderline, WebMenuItemTagOutline, WebMenuItemTagStyles, WebMenuItemTagShowColors, WebMenuItemTagSpeechMenu, WebMenuItemTagStartSpeaking, WebMenuItemTagStopSpeaking, WebMenuItemTagWritingDirectionMenu, WebMenuItemTagDefaultDirection, WebMenuItemTagLeftToRight, WebMenuItemTagRightToLeft, WebMenuItemPDFSinglePageScrolling, WebMenuItemPDFFacingPagesScrolling, WebMenuItemTagInspectElement, WebMenuItemTagTextDirectionMenu, WebMenuItemTagTextDirectionDefault, WebMenuItemTagTextDirectionLeftToRight, WebMenuItemTagTextDirectionRightToLeft, WebMenuItemTagCorrectSpellingAutomatically, WebMenuItemTagSubstitutionsMenu, WebMenuItemTagShowSubstitutions, WebMenuItemTagSmartCopyPaste, WebMenuItemTagSmartQuotes, WebMenuItemTagSmartDashes, WebMenuItemTagSmartLinks, WebMenuItemTagTextReplacement, WebMenuItemTagTransformationsMenu, WebMenuItemTagMakeUpperCase, WebMenuItemTagMakeLowerCase, WebMenuItemTagCapitalize, WebMenuItemTagChangeBack, WebMenuItemTagBaseApplication = 10000 }; @class WebGeolocation; @class WebSecurityOrigin; @interface NSObject (WebUIDelegatePrivate) - (void)webView:(WebView *)webView addMessageToConsole:(NSDictionary *)message; - (NSView *)webView:(WebView *)webView plugInViewWithArguments:(NSDictionary *)arguments; #if ENABLE_DASHBOARD_SUPPORT // regions is an dictionary whose keys are regions label and values are arrays of WebDashboardRegions. - (void)webView:(WebView *)webView dashboardRegionsChanged:(NSDictionary *)regions; #endif - (void)webView:(WebView *)sender dragImage:(NSImage *)anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag forView:(NSView *)view; - (void)webView:(WebView *)sender didDrawRect:(NSRect)rect; - (void)webView:(WebView *)sender didScrollDocumentInFrameView:(WebFrameView *)frameView; // FIXME: If we ever make this method public, it should include a WebFrame parameter. - (BOOL)webViewShouldInterruptJavaScript:(WebView *)sender; - (void)webView:(WebView *)sender willPopupMenu:(NSMenu *)menu; - (void)webView:(WebView *)sender contextMenuItemSelected:(NSMenuItem *)item forElement:(NSDictionary *)element; - (void)webView:(WebView *)sender saveFrameView:(WebFrameView *)frameView showingPanel:(BOOL)showingPanel; /*! @method webView:frame:exceededDatabaseQuotaForSecurityOrigin:database: @param sender The WebView sending the delegate method. @param frame The WebFrame whose JavaScript initiated this call. @param origin The security origin that needs a larger quota. @param databaseIdentifier The identifier of the database involved. */ - (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier; - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request windowFeatures:(NSDictionary *)features; - (BOOL)webView:(WebView *)sender shouldReplaceUploadFile:(NSString *)path usingGeneratedFilename:(NSString **)filename; - (NSString *)webView:(WebView *)sender generateReplacementFile:(NSString *)path; - (BOOL)webView:(WebView *)sender frame:(WebFrame *)frame requestGeolocationPermission:(WebGeolocation *)geolocation securityOrigin:(WebSecurityOrigin *)origin; - (void)webView:(WebView *)sender formStateDidChangeForNode:(DOMNode *)node; - (void)webView:(WebView *)sender formDidFocusNode:(DOMNode *)node; - (void)webView:(WebView *)sender formDidBlurNode:(DOMNode *)node; /*! @method webView:printFrame: @abstract Informs that a WebFrame needs to be printed @param webView The WebView sending the delegate method @param frameView The WebFrame needing to be printed @discussion This method is called when a script or user requests the page to be printed. */ - (void)webView:(WebView *)sender printFrame:(WebFrame *)frame; @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebTextIterator.h����������������������������������������������������������������0000644�0001750�0001750�00000007277�11161736424�015736� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008, 2009 Apple 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 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 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 <Foundation/Foundation.h> #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 #define WebNSUInteger unsigned int #else #define WebNSUInteger NSUInteger #endif @class DOMRange; @class DOMNode; @class WebTextIteratorPrivate; @interface WebTextIterator : NSObject { @private WebTextIteratorPrivate *_private; } - (id)initWithRange:(DOMRange *)range; /*! @method advance @abstract Moves the WebTextIterator to the next bit of text or boundary between runs of text. The iterator can break up runs of text however it finds convenient, so clients need to handle text runs that are broken up into arbitrary pieces. */ - (void)advance; /*! @method atEnd @result YES if the WebTextIterator has reached the end of the DOMRange. */ - (BOOL)atEnd; /*! @method currentTextLength @result Length of the current text. Length of zero means that the iterator is at a boundary, such as an image, that separates runs of text. */ - (WebNSUInteger)currentTextLength; /*! @method currentTextPointer @result A pointer to the current text. Like the WebTextIterator itself, the pointer becomes invalid after any modification is made to the document; it must be used before the document is changed or the iterator is advanced. */ - (const unichar *)currentTextPointer; /*! @method currentRange @abstract A function that identifies the specific document range that text corresponds to. This can be quite costly to compute for non-text items, so when possible this should only be called once the caller has determined that the text is text it wants to process. If you call currentRange every time you advance the iterator, performance will be extremely slow due to the cost of computing a DOM range. @result A DOM range indicating the position within the document of the current text. */ - (DOMRange *)currentRange; @end @interface WebTextIterator (WebTextIteratorDeprecated) /*! @method currentNode @abstract A convenience method that finds the first node in currentRange; it's almost always better to use currentRange instead. @result The current DOMNode in the WebTextIterator */ - (DOMNode *)currentNode; /*! @method currentText @abstract A convenience method that makes an NSString out of the current text; it's almost always better to use currentTextPointer and currentTextLength instead. @result The current text in the WebTextIterator. */ - (NSString *)currentText; @end #undef WebNSUInteger ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebPreferencesPrivate.h����������������������������������������������������������0000644�0001750�0001750�00000014504�11262231477�017063� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2007 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebPreferences.h> #import <Quartz/Quartz.h> typedef enum { WebKitEditableLinkDefaultBehavior, WebKitEditableLinkAlwaysLive, WebKitEditableLinkOnlyLiveWithShiftKey, WebKitEditableLinkLiveWhenNotFocused, WebKitEditableLinkNeverLive } WebKitEditableLinkBehavior; typedef enum { WebTextDirectionSubmenuNeverIncluded, WebTextDirectionSubmenuAutomaticallyIncluded, WebTextDirectionSubmenuAlwaysIncluded } WebTextDirectionSubmenuInclusionBehavior; extern NSString *WebPreferencesChangedNotification; extern NSString *WebPreferencesRemovedNotification; @interface WebPreferences (WebPrivate) // Preferences that might be public in a future release - (BOOL)developerExtrasEnabled; - (void)setDeveloperExtrasEnabled:(BOOL)flag; - (BOOL)authorAndUserStylesEnabled; - (void)setAuthorAndUserStylesEnabled:(BOOL)flag; - (BOOL)applicationChromeModeEnabled; - (void)setApplicationChromeModeEnabled:(BOOL)flag; - (BOOL)usesEncodingDetector; - (void)setUsesEncodingDetector:(BOOL)flag; - (BOOL)respectStandardStyleKeyEquivalents; - (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag; - (BOOL)showsURLsInToolTips; - (void)setShowsURLsInToolTips:(BOOL)flag; - (BOOL)textAreasAreResizable; - (void)setTextAreasAreResizable:(BOOL)flag; - (PDFDisplayMode)PDFDisplayMode; - (void)setPDFDisplayMode:(PDFDisplayMode)mode; - (BOOL)shrinksStandaloneImagesToFit; - (void)setShrinksStandaloneImagesToFit:(BOOL)flag; - (BOOL)automaticallyDetectsCacheModel; - (void)setAutomaticallyDetectsCacheModel:(BOOL)automaticallyDetectsCacheModel; - (BOOL)webArchiveDebugModeEnabled; - (void)setWebArchiveDebugModeEnabled:(BOOL)webArchiveDebugModeEnabled; - (BOOL)localFileContentSniffingEnabled; - (void)setLocalFileContentSniffingEnabled:(BOOL)localFileContentSniffingEnabled; - (BOOL)offlineWebApplicationCacheEnabled; - (void)setOfflineWebApplicationCacheEnabled:(BOOL)offlineWebApplicationCacheEnabled; - (BOOL)databasesEnabled; - (void)setDatabasesEnabled:(BOOL)databasesEnabled; - (BOOL)localStorageEnabled; - (void)setLocalStorageEnabled:(BOOL)localStorageEnabled; - (BOOL)isWebSecurityEnabled; - (void)setWebSecurityEnabled:(BOOL)flag; - (BOOL)allowUniversalAccessFromFileURLs; - (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag; - (BOOL)zoomsTextOnly; - (void)setZoomsTextOnly:(BOOL)zoomsTextOnly; - (BOOL)isXSSAuditorEnabled; - (void)setXSSAuditorEnabled:(BOOL)flag; - (BOOL)experimentalNotificationsEnabled; - (void)setExperimentalNotificationsEnabled:(BOOL)notificationsEnabled; - (BOOL)experimentalWebSocketsEnabled; - (void)setExperimentalWebSocketsEnabled:(BOOL)websocketsEnabled; - (BOOL)pluginHalterEnabled; - (void)setPluginHalterEnabled:(BOOL)enabled; // zero means do AutoScale - (float)PDFScaleFactor; - (void)setPDFScaleFactor:(float)scale; - (WebKitEditableLinkBehavior)editableLinkBehavior; - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior; - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior; - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior; // Used to set preference specified in the test via LayoutTestController.overridePreference(..). // For use with DumpRenderTree only. - (void)_setPreferenceForTestWithValue:(NSString *)value forKey:(NSString *)key; // If site-specific spoofing is enabled, some pages that do inappropriate user-agent string checks will be // passed a nonstandard user-agent string to get them to work correctly. This method might be removed in // the future when there's no more need for it. - (BOOL)_useSiteSpecificSpoofing; - (void)_setUseSiteSpecificSpoofing:(BOOL)newValue; // WARNING: Allowing paste through the DOM API opens a security hole. We only use it for testing purposes. - (BOOL)isDOMPasteAllowed; - (void)setDOMPasteAllowed:(BOOL)DOMPasteAllowed; - (NSString *)_ftpDirectoryTemplatePath; - (void)_setFTPDirectoryTemplatePath:(NSString *)path; - (void)_setForceFTPDirectoryListings:(BOOL)force; - (BOOL)_forceFTPDirectoryListings; - (NSString *)_localStorageDatabasePath; - (void)_setLocalStorageDatabasePath:(NSString *)path; - (BOOL)acceleratedCompositingEnabled; - (void)setAcceleratedCompositingEnabled:(BOOL)enabled; - (BOOL)webGLEnabled; - (void)setWebGLEnabled:(BOOL)enabled; // Other private methods - (void)_postPreferencesChangesNotification; + (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier; + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)identifier; + (void)_removeReferenceForIdentifier:(NSString *)identifier; - (NSTimeInterval)_backForwardCacheExpirationInterval; + (CFStringEncoding)_systemCFStringEncoding; + (void)_setInitialDefaultTextEncodingToSystemEncoding; + (void)_setIBCreatorID:(NSString *)string; // For WebView's use only. - (void)willAddToWebView; - (void)didRemoveFromWebView; @end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebDataSource.mm�����������������������������������������������������������������0000644�0001750�0001750�00000036052�11236147724�015507� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebDataSource.h" #import "WebArchive.h" #import "WebArchiveInternal.h" #import "WebDataSourceInternal.h" #import "WebDocument.h" #import "WebDocumentLoaderMac.h" #import "WebFrameInternal.h" #import "WebFrameLoadDelegate.h" #import "WebFrameLoaderClient.h" #import "WebHTMLRepresentation.h" #import "WebKitErrorsPrivate.h" #import "WebKitLogging.h" #import "WebKitStatisticsPrivate.h" #import "WebKitNSStringExtras.h" #import "WebNSURLExtras.h" #import "WebNSURLRequestExtras.h" #import "WebPDFRepresentation.h" #import "WebResourceInternal.h" #import "WebResourceLoadDelegate.h" #import "WebViewInternal.h" #import <WebCore/ApplicationCacheStorage.h> #import <WebCore/FrameLoader.h> #import <WebCore/KURL.h> #import <WebCore/LegacyWebArchive.h> #import <WebCore/MIMETypeRegistry.h> #import <WebCore/ResourceRequest.h> #import <WebCore/SharedBuffer.h> #import <WebCore/WebCoreObjCExtras.h> #import <WebCore/WebCoreURLResponse.h> #import <WebKit/DOMHTML.h> #import <WebKit/DOMPrivate.h> #import <runtime/InitializeThreading.h> #import <wtf/Assertions.h> using namespace WebCore; @interface WebDataSourcePrivate : NSObject { @public WebDocumentLoaderMac* loader; id <WebDocumentRepresentation> representation; BOOL representationFinishedLoading; } @end @implementation WebDataSourcePrivate + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif } - (void)dealloc { if (WebCoreObjCScheduleDeallocateOnMainThread([WebDataSourcePrivate class], self)) return; ASSERT(loader); if (loader) { ASSERT(!loader->isLoading()); loader->detachDataSource(); loader->deref(); } [representation release]; [super dealloc]; } - (void)finalize { ASSERT_MAIN_THREAD(); ASSERT(loader); if (loader) { ASSERT(!loader->isLoading()); loader->detachDataSource(); loader->deref(); } [super finalize]; } @end @interface WebDataSource (WebFileInternal) @end @implementation WebDataSource (WebFileInternal) - (void)_setRepresentation:(id<WebDocumentRepresentation>)representation { [_private->representation release]; _private->representation = [representation retain]; _private->representationFinishedLoading = NO; } static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCClass, NSArray *supportTypes) { NSEnumerator *enumerator = [supportTypes objectEnumerator]; ASSERT(enumerator != nil); NSString *mime = nil; while ((mime = [enumerator nextObject]) != nil) { // Don't clobber previously-registered classes. if ([allTypes objectForKey:mime] == nil) [allTypes setObject:objCClass forKey:mime]; } } + (Class)_representationClassForMIMEType:(NSString *)MIMEType { Class repClass; return [WebView _viewClass:nil andRepresentationClass:&repClass forMIMEType:MIMEType] ? repClass : nil; } @end @implementation WebDataSource (WebPrivate) - (NSError *)_mainDocumentError { return _private->loader->mainDocumentError(); } - (void)_addSubframeArchives:(NSArray *)subframeArchives { // FIXME: This SPI is poor, poor design. Can we come up with another solution for those who need it? DocumentLoader* loader = [self _documentLoader]; ASSERT(loader); NSEnumerator *enumerator = [subframeArchives objectEnumerator]; WebArchive *archive; while ((archive = [enumerator nextObject]) != nil) loader->addAllArchiveResources([archive _coreLegacyWebArchive]); } - (NSFileWrapper *)_fileWrapperForURL:(NSURL *)URL { if ([URL isFileURL]) { NSString *path = [[URL path] stringByResolvingSymlinksInPath]; return [[[NSFileWrapper alloc] initWithPath:path] autorelease]; } WebResource *resource = [self subresourceForURL:URL]; if (resource) return [resource _fileWrapperRepresentation]; NSCachedURLResponse *cachedResponse = [[self _webView] _cachedResponseForURL:URL]; if (cachedResponse) { NSFileWrapper *wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:[cachedResponse data]] autorelease]; [wrapper setPreferredFilename:[[cachedResponse response] suggestedFilename]]; return wrapper; } return nil; } - (NSString *)_responseMIMEType { return [[self response] MIMEType]; } - (BOOL)_transferApplicationCache:(NSString*)destinationBundleIdentifier { DocumentLoader* loader = [self _documentLoader]; if (!loader) return NO; NSString *cacheDir = [NSString _webkit_localCacheDirectoryWithBundleIdentifier:destinationBundleIdentifier]; return ApplicationCacheStorage::storeCopyOfCache(cacheDir, loader->applicationCacheHost()); } @end @implementation WebDataSource (WebInternal) - (void)_finishedLoading { _private->representationFinishedLoading = YES; [[self representation] finishedLoadingWithDataSource:self]; } - (void)_receivedData:(NSData *)data { // protect self temporarily, as the bridge receivedData call could remove our last ref RetainPtr<WebDataSource*> protect(self); [[self representation] receivedData:data withDataSource:self]; if ([[self _webView] _usesDocumentViews]) [[[[self webFrame] frameView] documentView] dataSourceUpdated:self]; } - (void)_setMainDocumentError:(NSError *)error { if (!_private->representationFinishedLoading) { _private->representationFinishedLoading = YES; [[self representation] receivedError:error withDataSource:self]; } } - (void)_revertToProvisionalState { [self _setRepresentation:nil]; } + (NSMutableDictionary *)_repTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission { static NSMutableDictionary *repTypes = nil; static BOOL addedImageTypes = NO; if (!repTypes) { repTypes = [[NSMutableDictionary alloc] init]; addTypesFromClass(repTypes, [WebHTMLRepresentation class], [WebHTMLRepresentation supportedNonImageMIMETypes]); // Since this is a "secret default" we don't both registering it. BOOL omitPDFSupport = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitOmitPDFSupport"]; if (!omitPDFSupport) addTypesFromClass(repTypes, [WebPDFRepresentation class], [WebPDFRepresentation supportedMIMETypes]); } if (!addedImageTypes && !allowImageTypeOmission) { addTypesFromClass(repTypes, [WebHTMLRepresentation class], [WebHTMLRepresentation supportedImageMIMETypes]); addedImageTypes = YES; } return repTypes; } - (void)_replaceSelectionWithArchive:(WebArchive *)archive selectReplacement:(BOOL)selectReplacement { DOMDocumentFragment *fragment = [self _documentFragmentWithArchive:archive]; if (fragment) [[self webFrame] _replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:NO matchStyle:NO]; } // FIXME: There are few reasons why this method and many of its related methods can't be pushed entirely into WebCore in the future. - (DOMDocumentFragment *)_documentFragmentWithArchive:(WebArchive *)archive { ASSERT(archive); WebResource *mainResource = [archive mainResource]; if (mainResource) { NSString *MIMEType = [mainResource MIMEType]; if ([WebView canShowMIMETypeAsHTML:MIMEType]) { NSString *markupString = [[NSString alloc] initWithData:[mainResource data] encoding:NSUTF8StringEncoding]; // FIXME: seems poor form to do this as a side effect of getting a document fragment if (DocumentLoader* loader = [self _documentLoader]) loader->addAllArchiveResources([archive _coreLegacyWebArchive]); DOMDocumentFragment *fragment = [[self webFrame] _documentFragmentWithMarkupString:markupString baseURLString:[[mainResource URL] _web_originalDataAsString]]; [markupString release]; return fragment; } else if (MIMETypeRegistry::isSupportedImageMIMEType(MIMEType)) { return [self _documentFragmentWithImageResource:mainResource]; } } return nil; } - (DOMDocumentFragment *)_documentFragmentWithImageResource:(WebResource *)resource { DOMElement *imageElement = [self _imageElementWithImageResource:resource]; if (!imageElement) return 0; DOMDocumentFragment *fragment = [[[self webFrame] DOMDocument] createDocumentFragment]; [fragment appendChild:imageElement]; return fragment; } - (DOMElement *)_imageElementWithImageResource:(WebResource *)resource { if (!resource) return 0; [self addSubresource:resource]; DOMElement *imageElement = [[[self webFrame] DOMDocument] createElement:@"img"]; // FIXME: calling _web_originalDataAsString on a file URL returns an absolute path. Workaround this. NSURL *URL = [resource URL]; [imageElement setAttribute:@"src" value:[URL isFileURL] ? [URL absoluteString] : [URL _web_originalDataAsString]]; return imageElement; } // May return nil if not initialized with a URL. - (NSURL *)_URL { const KURL& url = _private->loader->url(); if (url.isEmpty()) return nil; return url; } - (WebView *)_webView { return [[self webFrame] webView]; } - (BOOL)_isDocumentHTML { NSString *MIMEType = [self _responseMIMEType]; return [WebView canShowMIMETypeAsHTML:MIMEType]; } - (void)_makeRepresentation { Class repClass = [[self class] _representationClassForMIMEType:[self _responseMIMEType]]; // Check if the data source was already bound? if (![[self representation] isKindOfClass:repClass]) { id newRep = repClass != nil ? [[repClass alloc] init] : nil; [self _setRepresentation:(id <WebDocumentRepresentation>)newRep]; [newRep release]; } [_private->representation setDataSource:self]; } - (DocumentLoader*)_documentLoader { return _private->loader; } - (id)_initWithDocumentLoader:(PassRefPtr<WebDocumentLoaderMac>)loader { self = [super init]; if (!self) return nil; _private = [[WebDataSourcePrivate alloc] init]; _private->loader = loader.releaseRef(); LOG(Loading, "creating datasource for %@", static_cast<NSURL *>(_private->loader->request().url())); ++WebDataSourceCount; return self; } @end @implementation WebDataSource - (id)initWithRequest:(NSURLRequest *)request { return [self _initWithDocumentLoader:WebDocumentLoaderMac::create(request, SubstituteData())]; } - (void)dealloc { --WebDataSourceCount; [_private release]; [super dealloc]; } - (void)finalize { --WebDataSourceCount; [super finalize]; } - (NSData *)data { RefPtr<SharedBuffer> mainResourceData = _private->loader->mainResourceData(); if (!mainResourceData) return nil; return [mainResourceData->createNSData() autorelease]; } - (id <WebDocumentRepresentation>)representation { return _private->representation; } - (WebFrame *)webFrame { FrameLoader* frameLoader = _private->loader->frameLoader(); if (!frameLoader) return nil; return static_cast<WebFrameLoaderClient*>(frameLoader->client())->webFrame(); } - (NSURLRequest *)initialRequest { return _private->loader->originalRequest().nsURLRequest(); } - (NSMutableURLRequest *)request { FrameLoader* frameLoader = _private->loader->frameLoader(); if (!frameLoader || !frameLoader->frameHasLoaded()) return nil; // FIXME: this cast is dubious return (NSMutableURLRequest *)_private->loader->request().nsURLRequest(); } - (NSURLResponse *)response { return _private->loader->response().nsURLResponse(); } - (NSString *)textEncodingName { NSString *textEncodingName = _private->loader->overrideEncoding(); if (!textEncodingName) textEncodingName = [[self response] textEncodingName]; return textEncodingName; } - (BOOL)isLoading { return _private->loader->isLoadingInAPISense(); } // Returns nil or the page title. - (NSString *)pageTitle { return [[self representation] title]; } - (NSURL *)unreachableURL { const KURL& unreachableURL = _private->loader->unreachableURL(); if (unreachableURL.isEmpty()) return nil; return unreachableURL; } - (WebArchive *)webArchive { // it makes no sense to grab a WebArchive from an uncommitted document. if (!_private->loader->isCommitted()) return nil; return [[[WebArchive alloc] _initWithCoreLegacyWebArchive:LegacyWebArchive::create(core([self webFrame]))] autorelease]; } - (WebResource *)mainResource { RefPtr<ArchiveResource> coreResource = _private->loader->mainResource(); return [[[WebResource alloc] _initWithCoreResource:coreResource.release()] autorelease]; } - (NSArray *)subresources { Vector<PassRefPtr<ArchiveResource> > coreSubresources; _private->loader->getSubresources(coreSubresources); NSMutableArray *subresources = [[NSMutableArray alloc] initWithCapacity:coreSubresources.size()]; for (unsigned i = 0; i < coreSubresources.size(); ++i) { WebResource *resource = [[WebResource alloc] _initWithCoreResource:coreSubresources[i]]; if (resource) { [subresources addObject:resource]; [resource release]; } } return [subresources autorelease]; } - (WebResource *)subresourceForURL:(NSURL *)URL { RefPtr<ArchiveResource> subresource = _private->loader->subresource(URL); return subresource ? [[[WebResource alloc] _initWithCoreResource:subresource.get()] autorelease] : nil; } - (void)addSubresource:(WebResource *)subresource { _private->loader->addArchiveResource([subresource _coreResource]); } @end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebFrame.mm����������������������������������������������������������������������0000644�0001750�0001750�00000141277�11260743001�014500� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebFrameInternal.h" #import "DOMCSSStyleDeclarationInternal.h" #import "DOMDocumentFragmentInternal.h" #import "DOMDocumentInternal.h" #import "DOMElementInternal.h" #import "DOMHTMLElementInternal.h" #import "DOMNodeInternal.h" #import "DOMRangeInternal.h" #import "WebArchiveInternal.h" #import "WebChromeClient.h" #import "WebDataSourceInternal.h" #import "WebDocumentLoaderMac.h" #import "WebFrameLoaderClient.h" #import "WebFrameViewInternal.h" #import "WebHTMLView.h" #import "WebHTMLViewInternal.h" #import "WebIconFetcherInternal.h" #import "WebKitStatisticsPrivate.h" #import "WebKitVersionChecks.h" #import "WebNSObjectExtras.h" #import "WebNSURLExtras.h" #import "WebScriptDebugger.h" #import "WebViewInternal.h" #import <JavaScriptCore/APICast.h> #import <WebCore/AXObjectCache.h> #import <WebCore/AccessibilityObject.h> #import <WebCore/AnimationController.h> #import <WebCore/CSSMutableStyleDeclaration.h> #import <WebCore/ColorMac.h> #import <WebCore/DOMImplementation.h> #import <WebCore/DocLoader.h> #import <WebCore/DocumentFragment.h> #import <WebCore/EventHandler.h> #import <WebCore/EventNames.h> #import <WebCore/Frame.h> #import <WebCore/FrameLoader.h> #import <WebCore/FrameTree.h> #import <WebCore/GraphicsContext.h> #import <WebCore/HTMLFrameOwnerElement.h> #import <WebCore/HistoryItem.h> #import <WebCore/HitTestResult.h> #import <WebCore/LegacyWebArchive.h> #import <WebCore/Page.h> #import <WebCore/PluginData.h> #import <WebCore/RenderLayer.h> #import <WebCore/RenderPart.h> #import <WebCore/RenderView.h> #import <WebCore/ReplaceSelectionCommand.h> #import <WebCore/RuntimeApplicationChecks.h> #import <WebCore/ScriptValue.h> #import <WebCore/SmartReplace.h> #import <WebCore/TextIterator.h> #import <WebCore/ThreadCheck.h> #import <WebCore/TypingCommand.h> #import <WebCore/htmlediting.h> #import <WebCore/markup.h> #import <WebCore/visible_units.h> #import <runtime/JSLock.h> #import <runtime/JSValue.h> #import <wtf/CurrentTime.h> using namespace std; using namespace WebCore; using namespace HTMLNames; using JSC::JSGlobalObject; using JSC::JSLock; using JSC::JSValue; using JSC::SilenceAssertionsOnly; /* Here is the current behavior matrix for four types of navigations: Standard Nav: Restore form state: YES Restore scroll and focus state: YES Cache policy: NSURLRequestUseProtocolCachePolicy Add to back/forward list: YES Back/Forward: Restore form state: YES Restore scroll and focus state: YES Cache policy: NSURLRequestReturnCacheDataElseLoad Add to back/forward list: NO Reload (meaning only the reload button): Restore form state: NO Restore scroll and focus state: YES Cache policy: NSURLRequestReloadIgnoringCacheData Add to back/forward list: NO Repeat load of the same URL (by any other means of navigation other than the reload button, including hitting return in the location field): Restore form state: NO Restore scroll and focus state: NO, reset to initial conditions Cache policy: NSURLRequestReloadIgnoringCacheData Add to back/forward list: NO */ NSString *WebPageCacheEntryDateKey = @"WebPageCacheEntryDateKey"; NSString *WebPageCacheDataSourceKey = @"WebPageCacheDataSourceKey"; NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey"; NSString *WebFrameMainDocumentError = @"WebFrameMainDocumentErrorKey"; NSString *WebFrameHasPlugins = @"WebFrameHasPluginsKey"; NSString *WebFrameHasUnloadListener = @"WebFrameHasUnloadListenerKey"; NSString *WebFrameUsesDatabases = @"WebFrameUsesDatabasesKey"; NSString *WebFrameUsesGeolocation = @"WebFrameUsesGeolocationKey"; NSString *WebFrameUsesApplicationCache = @"WebFrameUsesApplicationCacheKey"; NSString *WebFrameCanSuspendActiveDOMObjects = @"WebFrameCanSuspendActiveDOMObjectsKey"; // FIXME: Remove when this key becomes publicly defined NSString *NSAccessibilityEnhancedUserInterfaceAttribute = @"AXEnhancedUserInterface"; @implementation WebFramePrivate - (void)dealloc { [webFrameView release]; delete scriptDebugger; [super dealloc]; } - (void)finalize { delete scriptDebugger; [super finalize]; } - (void)setWebFrameView:(WebFrameView *)v { [v retain]; [webFrameView release]; webFrameView = v; } @end EditableLinkBehavior core(WebKitEditableLinkBehavior editableLinkBehavior) { switch (editableLinkBehavior) { case WebKitEditableLinkDefaultBehavior: return EditableLinkDefaultBehavior; case WebKitEditableLinkAlwaysLive: return EditableLinkAlwaysLive; case WebKitEditableLinkOnlyLiveWithShiftKey: return EditableLinkOnlyLiveWithShiftKey; case WebKitEditableLinkLiveWhenNotFocused: return EditableLinkLiveWhenNotFocused; case WebKitEditableLinkNeverLive: return EditableLinkNeverLive; } ASSERT_NOT_REACHED(); return EditableLinkDefaultBehavior; } TextDirectionSubmenuInclusionBehavior core(WebTextDirectionSubmenuInclusionBehavior behavior) { switch (behavior) { case WebTextDirectionSubmenuNeverIncluded: return TextDirectionSubmenuNeverIncluded; case WebTextDirectionSubmenuAutomaticallyIncluded: return TextDirectionSubmenuAutomaticallyIncluded; case WebTextDirectionSubmenuAlwaysIncluded: return TextDirectionSubmenuAlwaysIncluded; } ASSERT_NOT_REACHED(); return TextDirectionSubmenuNeverIncluded; } @implementation WebFrame (WebInternal) Frame* core(WebFrame *frame) { return frame ? frame->_private->coreFrame : 0; } WebFrame *kit(Frame* frame) { return frame ? static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame() : nil; } Page* core(WebView *webView) { return [webView page]; } WebView *kit(Page* page) { return page ? static_cast<WebChromeClient*>(page->chrome()->client())->webView() : nil; } WebView *getWebView(WebFrame *webFrame) { Frame* coreFrame = core(webFrame); if (!coreFrame) return nil; return kit(coreFrame->page()); } + (PassRefPtr<Frame>)_createFrameWithPage:(Page*)page frameName:(const String&)name frameView:(WebFrameView *)frameView ownerElement:(HTMLFrameOwnerElement*)ownerElement { WebView *webView = kit(page); WebFrame *frame = [[self alloc] _initWithWebFrameView:frameView webView:webView]; RefPtr<Frame> coreFrame = Frame::create(page, ownerElement, new WebFrameLoaderClient(frame)); [frame release]; frame->_private->coreFrame = coreFrame.get(); coreFrame->tree()->setName(name); if (ownerElement) { ASSERT(ownerElement->document()->frame()); ownerElement->document()->frame()->tree()->appendChild(coreFrame.get()); } coreFrame->init(); [webView _setZoomMultiplier:[webView _realZoomMultiplier] isTextOnly:[webView _realZoomMultiplierIsTextOnly]]; return coreFrame.release(); } + (void)_createMainFrameWithPage:(Page*)page frameName:(const String&)name frameView:(WebFrameView *)frameView { [self _createFrameWithPage:page frameName:name frameView:frameView ownerElement:0]; } + (PassRefPtr<WebCore::Frame>)_createSubframeWithOwnerElement:(HTMLFrameOwnerElement*)ownerElement frameName:(const String&)name frameView:(WebFrameView *)frameView { return [self _createFrameWithPage:ownerElement->document()->frame()->page() frameName:name frameView:frameView ownerElement:ownerElement]; } - (void)_attachScriptDebugger { ScriptController* scriptController = _private->coreFrame->script(); // Calling ScriptController::globalObject() would create a window shell, and dispatch corresponding callbacks, which may be premature // if the script debugger is attached before a document is created. if (!scriptController->haveWindowShell()) return; JSGlobalObject* globalObject = scriptController->globalObject(); if (!globalObject) return; if (_private->scriptDebugger) { ASSERT(_private->scriptDebugger == globalObject->debugger()); return; } _private->scriptDebugger = new WebScriptDebugger(globalObject); } - (void)_detachScriptDebugger { if (!_private->scriptDebugger) return; delete _private->scriptDebugger; _private->scriptDebugger = 0; } - (id)_initWithWebFrameView:(WebFrameView *)fv webView:(WebView *)v { self = [super init]; if (!self) return nil; _private = [[WebFramePrivate alloc] init]; if (fv) { [_private setWebFrameView:fv]; [fv _setWebFrame:self]; } _private->shouldCreateRenderers = YES; ++WebFrameCount; return self; } - (void)_clearCoreFrame { _private->coreFrame = 0; } - (void)_updateBackgroundAndUpdatesWhileOffscreen { WebView *webView = getWebView(self); BOOL drawsBackground = [webView drawsBackground]; NSColor *backgroundColor = [webView backgroundColor]; Frame* coreFrame = _private->coreFrame; for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { if ([webView _usesDocumentViews]) { // Don't call setDrawsBackground:YES here because it may be NO because of a load // in progress; WebFrameLoaderClient keeps it set to NO during the load process. WebFrame *webFrame = kit(frame); if (!drawsBackground) [[[webFrame frameView] _scrollView] setDrawsBackground:NO]; [[[webFrame frameView] _scrollView] setBackgroundColor:backgroundColor]; id documentView = [[webFrame frameView] documentView]; if ([documentView respondsToSelector:@selector(setDrawsBackground:)]) [documentView setDrawsBackground:drawsBackground]; if ([documentView respondsToSelector:@selector(setBackgroundColor:)]) [documentView setBackgroundColor:backgroundColor]; } if (FrameView* view = frame->view()) { view->setTransparent(!drawsBackground); view->setBaseBackgroundColor(colorFromNSColor([backgroundColor colorUsingColorSpaceName:NSDeviceRGBColorSpace])); view->setShouldUpdateWhileOffscreen([webView shouldUpdateWhileOffscreen]); } } } - (void)_setInternalLoadDelegate:(id)internalLoadDelegate { _private->internalLoadDelegate = internalLoadDelegate; } - (id)_internalLoadDelegate { return _private->internalLoadDelegate; } #ifndef BUILDING_ON_TIGER - (void)_unmarkAllBadGrammar { Frame* coreFrame = _private->coreFrame; for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { if (Document* document = frame->document()) document->removeMarkers(DocumentMarker::Grammar); } } #endif - (void)_unmarkAllMisspellings { Frame* coreFrame = _private->coreFrame; for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { if (Document* document = frame->document()) document->removeMarkers(DocumentMarker::Spelling); } } - (BOOL)_hasSelection { if ([getWebView(self) _usesDocumentViews]) { id documentView = [_private->webFrameView documentView]; // optimization for common case to avoid creating potentially large selection string if ([documentView isKindOfClass:[WebHTMLView class]]) if (Frame* coreFrame = _private->coreFrame) return coreFrame->selection()->isRange(); if ([documentView conformsToProtocol:@protocol(WebDocumentText)]) return [[documentView selectedString] length] > 0; return NO; } Frame* coreFrame = _private->coreFrame; return coreFrame && coreFrame->selection()->isRange(); } - (void)_clearSelection { ASSERT([getWebView(self) _usesDocumentViews]); id documentView = [_private->webFrameView documentView]; if ([documentView conformsToProtocol:@protocol(WebDocumentText)]) [documentView deselectAll]; } #if !ASSERT_DISABLED - (BOOL)_atMostOneFrameHasSelection { // FIXME: 4186050 is one known case that makes this debug check fail. BOOL found = NO; Frame* coreFrame = _private->coreFrame; for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) if ([kit(frame) _hasSelection]) { if (found) return NO; found = YES; } return YES; } #endif - (WebFrame *)_findFrameWithSelection { Frame* coreFrame = _private->coreFrame; for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { WebFrame *webFrame = kit(frame); if ([webFrame _hasSelection]) return webFrame; } return nil; } - (void)_clearSelectionInOtherFrames { // We rely on WebDocumentSelection protocol implementors to call this method when they become first // responder. It would be nicer to just notice first responder changes here instead, but there's no // notification sent when the first responder changes in general (Radar 2573089). WebFrame *frameWithSelection = [[getWebView(self) mainFrame] _findFrameWithSelection]; if (frameWithSelection != self) [frameWithSelection _clearSelection]; // While we're in the general area of selection and frames, check that there is only one now. ASSERT([[getWebView(self) mainFrame] _atMostOneFrameHasSelection]); } static inline WebDataSource *dataSource(DocumentLoader* loader) { return loader ? static_cast<WebDocumentLoaderMac*>(loader)->dataSource() : nil; } - (WebDataSource *)_dataSource { return dataSource(_private->coreFrame->loader()->documentLoader()); } - (void)_addData:(NSData *)data { Document* document = _private->coreFrame->document(); // Document may be nil if the part is about to redirect // as a result of JS executing during load, i.e. one frame // changing another's location before the frame's document // has been created. if (!document) return; document->setShouldCreateRenderers(_private->shouldCreateRenderers); _private->coreFrame->loader()->addData((const char *)[data bytes], [data length]); } - (NSString *)_stringWithDocumentTypeStringAndMarkupString:(NSString *)markupString { return _private->coreFrame->documentTypeString() + markupString; } - (NSArray *)_nodesFromList:(Vector<Node*> *)nodesVector { size_t size = nodesVector->size(); NSMutableArray *nodes = [NSMutableArray arrayWithCapacity:size]; for (size_t i = 0; i < size; ++i) [nodes addObject:kit((*nodesVector)[i])]; return nodes; } - (NSString *)_markupStringFromRange:(DOMRange *)range nodes:(NSArray **)nodes { // FIXME: This is always "for interchange". Is that right? See the previous method. Vector<Node*> nodeList; NSString *markupString = createMarkup(core(range), nodes ? &nodeList : 0, AnnotateForInterchange); if (nodes) *nodes = [self _nodesFromList:&nodeList]; return [self _stringWithDocumentTypeStringAndMarkupString:markupString]; } - (NSString *)_selectedString { return _private->coreFrame->displayStringModifiedByEncoding(_private->coreFrame->selectedText()); } - (NSString *)_stringForRange:(DOMRange *)range { // This will give a system malloc'd buffer that can be turned directly into an NSString unsigned length; UChar* buf = plainTextToMallocAllocatedBuffer(core(range), length, true); if (!buf) return [NSString string]; // Transfer buffer ownership to NSString return [[[NSString alloc] initWithCharactersNoCopy:buf length:length freeWhenDone:YES] autorelease]; } - (void)_drawRect:(NSRect)rect contentsOnly:(BOOL)contentsOnly { PlatformGraphicsContext* platformContext = static_cast<PlatformGraphicsContext*>([[NSGraphicsContext currentContext] graphicsPort]); ASSERT([[NSGraphicsContext currentContext] isFlipped]); GraphicsContext context(platformContext); if (contentsOnly) _private->coreFrame->view()->paintContents(&context, enclosingIntRect(rect)); else _private->coreFrame->view()->paint(&context, enclosingIntRect(rect)); } // Used by pagination code called from AppKit when a standalone web page is printed. - (NSArray*)_computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight { NSMutableArray* pages = [NSMutableArray arrayWithCapacity:5]; if (printWidthScaleFactor <= 0) { LOG_ERROR("printWidthScaleFactor has bad value %.2f", printWidthScaleFactor); return pages; } if (printHeight <= 0) { LOG_ERROR("printHeight has bad value %.2f", printHeight); return pages; } if (!_private->coreFrame || !_private->coreFrame->document() || !_private->coreFrame->view()) return pages; RenderView* root = toRenderView(_private->coreFrame->document()->renderer()); if (!root) return pages; FrameView* view = _private->coreFrame->view(); if (!view) return pages; NSView* documentView = view->documentView(); if (!documentView) return pages; float currPageHeight = printHeight; float docHeight = root->layer()->height(); float docWidth = root->layer()->width(); float printWidth = docWidth/printWidthScaleFactor; // We need to give the part the opportunity to adjust the page height at each step. for (float i = 0; i < docHeight; i += currPageHeight) { float proposedBottom = min(docHeight, i + printHeight); view->adjustPageHeight(&proposedBottom, i, proposedBottom, i); currPageHeight = max(1.0f, proposedBottom - i); for (float j = 0; j < docWidth; j += printWidth) { NSValue* val = [NSValue valueWithRect: NSMakeRect(j, i, printWidth, currPageHeight)]; [pages addObject: val]; } } return pages; } - (BOOL)_getVisibleRect:(NSRect*)rect { ASSERT_ARG(rect, rect); if (RenderPart* ownerRenderer = _private->coreFrame->ownerRenderer()) { if (ownerRenderer->needsLayout()) return NO; *rect = ownerRenderer->absoluteClippedOverflowRect(); return YES; } return NO; } - (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string { return [self _stringByEvaluatingJavaScriptFromString:string forceUserGesture:true]; } - (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture { ASSERT(_private->coreFrame->document()); JSValue result = _private->coreFrame->loader()->executeScript(string, forceUserGesture).jsValue(); if (!_private->coreFrame) // In case the script removed our frame from the page. return @""; // This bizarre set of rules matches behavior from WebKit for Safari 2.0. // If you don't like it, use -[WebScriptObject evaluateWebScript:] or // JSEvaluateScript instead, since they have less surprising semantics. if (!result || !result.isBoolean() && !result.isString() && !result.isNumber()) return @""; JSLock lock(SilenceAssertionsOnly); return String(result.toString(_private->coreFrame->script()->globalObject()->globalExec())); } - (NSRect)_caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity { VisiblePosition visiblePosition(core(node), offset, static_cast<EAffinity>(affinity)); return visiblePosition.absoluteCaretBounds(); } - (NSRect)_firstRectForDOMRange:(DOMRange *)range { return _private->coreFrame->firstRectForRange(core(range)); } - (void)_scrollDOMRangeToVisible:(DOMRange *)range { NSRect rangeRect = [self _firstRectForDOMRange:range]; Node *startNode = core([range startContainer]); if (startNode && startNode->renderer()) { RenderLayer *layer = startNode->renderer()->enclosingLayer(); if (layer) layer->scrollRectToVisible(enclosingIntRect(rangeRect), false, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded); } } - (BOOL)_needsLayout { return _private->coreFrame->view() ? _private->coreFrame->view()->needsLayout() : false; } - (id)_accessibilityTree { #if HAVE(ACCESSIBILITY) if (!AXObjectCache::accessibilityEnabled()) { AXObjectCache::enableAccessibility(); if ([[NSApp accessibilityAttributeValue:NSAccessibilityEnhancedUserInterfaceAttribute] boolValue]) AXObjectCache::enableEnhancedUserInterfaceAccessibility(); } if (!_private->coreFrame || !_private->coreFrame->document()) return nil; RenderView* root = toRenderView(_private->coreFrame->document()->renderer()); if (!root) return nil; return _private->coreFrame->document()->axObjectCache()->getOrCreate(root)->wrapper(); #else return nil; #endif } - (DOMRange *)_rangeByAlteringCurrentSelection:(SelectionController::EAlteration)alteration direction:(SelectionController::EDirection)direction granularity:(TextGranularity)granularity { if (_private->coreFrame->selection()->isNone()) return nil; SelectionController selection; selection.setSelection(_private->coreFrame->selection()->selection()); selection.modify(alteration, direction, granularity); return kit(selection.toNormalizedRange().get()); } - (TextGranularity)_selectionGranularity { return _private->coreFrame->selectionGranularity(); } - (NSRange)_convertToNSRange:(Range *)range { if (!range || !range->startContainer()) return NSMakeRange(NSNotFound, 0); Element* selectionRoot = _private->coreFrame->selection()->rootEditableElement(); Element* scope = selectionRoot ? selectionRoot : _private->coreFrame->document()->documentElement(); // Mouse events may cause TSM to attempt to create an NSRange for a portion of the view // that is not inside the current editable region. These checks ensure we don't produce // potentially invalid data when responding to such requests. if (range->startContainer() != scope && !range->startContainer()->isDescendantOf(scope)) return NSMakeRange(NSNotFound, 0); if (range->endContainer() != scope && !range->endContainer()->isDescendantOf(scope)) return NSMakeRange(NSNotFound, 0); RefPtr<Range> testRange = Range::create(scope->document(), scope, 0, range->startContainer(), range->startOffset()); ASSERT(testRange->startContainer() == scope); int startPosition = TextIterator::rangeLength(testRange.get()); ExceptionCode ec; testRange->setEnd(range->endContainer(), range->endOffset(), ec); ASSERT(testRange->startContainer() == scope); int endPosition = TextIterator::rangeLength(testRange.get()); return NSMakeRange(startPosition, endPosition - startPosition); } - (PassRefPtr<Range>)_convertToDOMRange:(NSRange)nsrange { if (nsrange.location > INT_MAX) return 0; if (nsrange.length > INT_MAX || nsrange.location + nsrange.length > INT_MAX) nsrange.length = INT_MAX - nsrange.location; // our critical assumption is that we are only called by input methods that // concentrate on a given area containing the selection // We have to do this because of text fields and textareas. The DOM for those is not // directly in the document DOM, so serialization is problematic. Our solution is // to use the root editable element of the selection start as the positional base. // That fits with AppKit's idea of an input context. Element* selectionRoot = _private->coreFrame->selection()->rootEditableElement(); Element* scope = selectionRoot ? selectionRoot : _private->coreFrame->document()->documentElement(); return TextIterator::rangeFromLocationAndLength(scope, nsrange.location, nsrange.length); } - (DOMRange *)convertNSRangeToDOMRange:(NSRange)nsrange { // This method exists to maintain compatibility with Leopard's Dictionary.app. <rdar://problem/6002160> return [self _convertNSRangeToDOMRange:nsrange]; } - (DOMRange *)_convertNSRangeToDOMRange:(NSRange)nsrange { return kit([self _convertToDOMRange:nsrange].get()); } - (NSRange)convertDOMRangeToNSRange:(DOMRange *)range { // This method exists to maintain compatibility with Leopard's Dictionary.app. <rdar://problem/6002160> return [self _convertDOMRangeToNSRange:range]; } - (NSRange)_convertDOMRangeToNSRange:(DOMRange *)range { return [self _convertToNSRange:core(range)]; } - (DOMRange *)_markDOMRange { return kit(_private->coreFrame->mark().toNormalizedRange().get()); } // Given proposedRange, returns an extended range that includes adjacent whitespace that should // be deleted along with the proposed range in order to preserve proper spacing and punctuation of // the text surrounding the deletion. - (DOMRange *)_smartDeleteRangeForProposedRange:(DOMRange *)proposedRange { Node* startContainer = core([proposedRange startContainer]); Node* endContainer = core([proposedRange endContainer]); if (startContainer == nil || endContainer == nil) return nil; ASSERT(startContainer->document() == endContainer->document()); _private->coreFrame->document()->updateLayoutIgnorePendingStylesheets(); Position start(startContainer, [proposedRange startOffset]); Position end(endContainer, [proposedRange endOffset]); Position newStart = start.upstream().leadingWhitespacePosition(DOWNSTREAM, true); if (newStart.isNull()) newStart = start; Position newEnd = end.downstream().trailingWhitespacePosition(DOWNSTREAM, true); if (newEnd.isNull()) newEnd = end; newStart = rangeCompliantEquivalent(newStart); newEnd = rangeCompliantEquivalent(newEnd); RefPtr<Range> range = _private->coreFrame->document()->createRange(); int exception = 0; range->setStart(newStart.node(), newStart.deprecatedEditingOffset(), exception); range->setEnd(newStart.node(), newStart.deprecatedEditingOffset(), exception); return kit(range.get()); } // Determines whether whitespace needs to be added around aString to preserve proper spacing and // punctuation when it’s inserted into the receiver’s text over charRange. Returns by reference // in beforeString and afterString any whitespace that should be added, unless either or both are // nil. Both are returned as nil if aString is nil or if smart insertion and deletion are disabled. - (void)_smartInsertForString:(NSString *)pasteString replacingRange:(DOMRange *)rangeToReplace beforeString:(NSString **)beforeString afterString:(NSString **)afterString { // give back nil pointers in case of early returns if (beforeString) *beforeString = nil; if (afterString) *afterString = nil; // inspect destination Node *startContainer = core([rangeToReplace startContainer]); Node *endContainer = core([rangeToReplace endContainer]); Position startPos(startContainer, [rangeToReplace startOffset]); Position endPos(endContainer, [rangeToReplace endOffset]); VisiblePosition startVisiblePos = VisiblePosition(startPos, VP_DEFAULT_AFFINITY); VisiblePosition endVisiblePos = VisiblePosition(endPos, VP_DEFAULT_AFFINITY); // this check also ensures startContainer, startPos, endContainer, and endPos are non-null if (startVisiblePos.isNull() || endVisiblePos.isNull()) return; bool addLeadingSpace = startPos.leadingWhitespacePosition(VP_DEFAULT_AFFINITY, true).isNull() && !isStartOfParagraph(startVisiblePos); if (addLeadingSpace) if (UChar previousChar = startVisiblePos.previous().characterAfter()) addLeadingSpace = !isCharacterSmartReplaceExempt(previousChar, true); bool addTrailingSpace = endPos.trailingWhitespacePosition(VP_DEFAULT_AFFINITY, true).isNull() && !isEndOfParagraph(endVisiblePos); if (addTrailingSpace) if (UChar thisChar = endVisiblePos.characterAfter()) addTrailingSpace = !isCharacterSmartReplaceExempt(thisChar, false); // inspect source bool hasWhitespaceAtStart = false; bool hasWhitespaceAtEnd = false; unsigned pasteLength = [pasteString length]; if (pasteLength > 0) { NSCharacterSet *whiteSet = [NSCharacterSet whitespaceAndNewlineCharacterSet]; if ([whiteSet characterIsMember:[pasteString characterAtIndex:0]]) { hasWhitespaceAtStart = YES; } if ([whiteSet characterIsMember:[pasteString characterAtIndex:(pasteLength - 1)]]) { hasWhitespaceAtEnd = YES; } } // issue the verdict if (beforeString && addLeadingSpace && !hasWhitespaceAtStart) *beforeString = @" "; if (afterString && addTrailingSpace && !hasWhitespaceAtEnd) *afterString = @" "; } - (DOMDocumentFragment *)_documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString { if (!_private->coreFrame || !_private->coreFrame->document()) return nil; return kit(createFragmentFromMarkup(_private->coreFrame->document(), markupString, baseURLString).get()); } - (DOMDocumentFragment *)_documentFragmentWithNodesAsParagraphs:(NSArray *)nodes { if (!_private->coreFrame || !_private->coreFrame->document()) return nil; NSEnumerator *nodeEnum = [nodes objectEnumerator]; Vector<Node*> nodesVector; DOMNode *node; while ((node = [nodeEnum nextObject])) nodesVector.append(core(node)); return kit(createFragmentFromNodes(_private->coreFrame->document(), nodesVector).get()); } - (void)_replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle { DOMDocumentFragment *fragment = kit(_private->coreFrame->document()->createDocumentFragment().get()); [fragment appendChild:node]; [self _replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:smartReplace matchStyle:matchStyle]; } - (void)_insertParagraphSeparatorInQuotedContent { if (_private->coreFrame->selection()->isNone()) return; TypingCommand::insertParagraphSeparatorInQuotedContent(_private->coreFrame->document()); _private->coreFrame->revealSelection(ScrollAlignment::alignToEdgeIfNeeded); } - (VisiblePosition)_visiblePositionForPoint:(NSPoint)point { // FIXME: Someone with access to Apple's sources could remove this needless wrapper call. return _private->coreFrame->visiblePositionForPoint(IntPoint(point)); } - (DOMRange *)_characterRangeAtPoint:(NSPoint)point { VisiblePosition position = [self _visiblePositionForPoint:point]; if (position.isNull()) return nil; VisiblePosition previous = position.previous(); if (previous.isNotNull()) { DOMRange *previousCharacterRange = kit(makeRange(previous, position).get()); NSRect rect = [self _firstRectForDOMRange:previousCharacterRange]; if (NSPointInRect(point, rect)) return previousCharacterRange; } VisiblePosition next = position.next(); if (next.isNotNull()) { DOMRange *nextCharacterRange = kit(makeRange(position, next).get()); NSRect rect = [self _firstRectForDOMRange:nextCharacterRange]; if (NSPointInRect(point, rect)) return nextCharacterRange; } return nil; } - (DOMCSSStyleDeclaration *)_typingStyle { if (!_private->coreFrame || !_private->coreFrame->typingStyle()) return nil; return kit(_private->coreFrame->typingStyle()->copy().get()); } - (void)_setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction { if (!_private->coreFrame) return; _private->coreFrame->computeAndSetTypingStyle(core(style), undoAction); } - (void)_dragSourceMovedTo:(NSPoint)windowLoc { if (!_private->coreFrame) return; FrameView* view = _private->coreFrame->view(); if (!view) return; ASSERT([getWebView(self) _usesDocumentViews]); // FIXME: These are fake modifier keys here, but they should be real ones instead. PlatformMouseEvent event(IntPoint(windowLoc), globalPoint(windowLoc, [view->platformWidget() window]), LeftButton, MouseEventMoved, 0, false, false, false, false, currentTime()); _private->coreFrame->eventHandler()->dragSourceMovedTo(event); } - (void)_dragSourceEndedAt:(NSPoint)windowLoc operation:(NSDragOperation)operation { if (!_private->coreFrame) return; FrameView* view = _private->coreFrame->view(); if (!view) return; ASSERT([getWebView(self) _usesDocumentViews]); // FIXME: These are fake modifier keys here, but they should be real ones instead. PlatformMouseEvent event(IntPoint(windowLoc), globalPoint(windowLoc, [view->platformWidget() window]), LeftButton, MouseEventMoved, 0, false, false, false, false, currentTime()); _private->coreFrame->eventHandler()->dragSourceEndedAt(event, (DragOperation)operation); } - (BOOL)_canProvideDocumentSource { Frame* frame = _private->coreFrame; String mimeType = frame->loader()->responseMIMEType(); PluginData* pluginData = frame->page() ? frame->page()->pluginData() : 0; if (WebCore::DOMImplementation::isTextMIMEType(mimeType) || Image::supportsType(mimeType) || (pluginData && pluginData->supportsMimeType(mimeType))) return NO; return YES; } - (BOOL)_canSaveAsWebArchive { // Currently, all documents that we can view source for // (HTML and XML documents) can also be saved as web archives return [self _canProvideDocumentSource]; } - (void)_receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName { // Set the encoding. This only needs to be done once, but it's harmless to do it again later. String encoding = _private->coreFrame->loader()->documentLoader()->overrideEncoding(); bool userChosen = !encoding.isNull(); if (encoding.isNull()) encoding = textEncodingName; _private->coreFrame->loader()->setEncoding(encoding, userChosen); [self _addData:data]; } @end @implementation WebFrame (WebPrivate) // FIXME: This exists only as a convenience for Safari, consider moving there. - (BOOL)_isDescendantOfFrame:(WebFrame *)ancestor { Frame* coreFrame = _private->coreFrame; return coreFrame && coreFrame->tree()->isDescendantOf(core(ancestor)); } - (void)_setShouldCreateRenderers:(BOOL)shouldCreateRenderers { _private->shouldCreateRenderers = shouldCreateRenderers; } - (NSColor *)_bodyBackgroundColor { Document* document = _private->coreFrame->document(); if (!document) return nil; HTMLElement* body = document->body(); if (!body) return nil; RenderObject* bodyRenderer = body->renderer(); if (!bodyRenderer) return nil; Color color = bodyRenderer->style()->backgroundColor(); if (!color.isValid()) return nil; return nsColor(color); } - (BOOL)_isFrameSet { Document* document = _private->coreFrame->document(); return document && document->isFrameSet(); } - (BOOL)_firstLayoutDone { return _private->coreFrame->loader()->firstLayoutDone(); } - (WebFrameLoadType)_loadType { return (WebFrameLoadType)_private->coreFrame->loader()->loadType(); } - (NSRange)_selectedNSRange { return [self _convertToNSRange:_private->coreFrame->selection()->toNormalizedRange().get()]; } - (void)_selectNSRange:(NSRange)range { RefPtr<Range> domRange = [self _convertToDOMRange:range]; if (domRange) _private->coreFrame->selection()->setSelection(VisibleSelection(domRange.get(), SEL_DEFAULT_AFFINITY)); } - (BOOL)_isDisplayingStandaloneImage { Document* document = _private->coreFrame->document(); return document && document->isImageDocument(); } - (unsigned)_pendingFrameUnloadEventCount { return _private->coreFrame->domWindow()->pendingUnloadEventListeners(); } - (WebIconFetcher *)fetchApplicationIcon:(id)target selector:(SEL)selector { return [WebIconFetcher _fetchApplicationIconForFrame:self target:target selector:selector]; } - (void)_setIsDisconnected:(bool)isDisconnected { _private->coreFrame->setIsDisconnected(isDisconnected); } - (void)_setExcludeFromTextSearch:(bool)exclude { _private->coreFrame->setExcludeFromTextSearch(exclude); } #if ENABLE(NETSCAPE_PLUGIN_API) - (void)_recursive_resumeNullEventsForAllNetscapePlugins { Frame* coreFrame = core(self); for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { NSView <WebDocumentView> *documentView = [[kit(frame) frameView] documentView]; if ([documentView isKindOfClass:[WebHTMLView class]]) [(WebHTMLView *)documentView _resumeNullEventsForAllNetscapePlugins]; } } - (void)_recursive_pauseNullEventsForAllNetscapePlugins { Frame* coreFrame = core(self); for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) { NSView <WebDocumentView> *documentView = [[kit(frame) frameView] documentView]; if ([documentView isKindOfClass:[WebHTMLView class]]) [(WebHTMLView *)documentView _pauseNullEventsForAllNetscapePlugins]; } } #endif - (BOOL)_pauseAnimation:(NSString*)name onNode:(DOMNode *)node atTime:(NSTimeInterval)time { Frame* frame = core(self); if (!frame) return false; AnimationController* controller = frame->animation(); if (!controller) return false; Node* coreNode = core(node); if (!coreNode || !coreNode->renderer()) return false; return controller->pauseAnimationAtTime(coreNode->renderer(), name, time); } - (BOOL)_pauseTransitionOfProperty:(NSString*)name onNode:(DOMNode*)node atTime:(NSTimeInterval)time { Frame* frame = core(self); if (!frame) return false; AnimationController* controller = frame->animation(); if (!controller) return false; Node* coreNode = core(node); if (!coreNode || !coreNode->renderer()) return false; return controller->pauseTransitionAtTime(coreNode->renderer(), name, time); } - (unsigned) _numberOfActiveAnimations { Frame* frame = core(self); if (!frame) return false; AnimationController* controller = frame->animation(); if (!controller) return false; return controller->numberOfActiveAnimations(); } - (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle { if (_private->coreFrame->selection()->isNone() || !fragment) return; applyCommand(ReplaceSelectionCommand::create(_private->coreFrame->document(), core(fragment), selectReplacement, smartReplace, matchStyle)); _private->coreFrame->revealSelection(ScrollAlignment::alignToEdgeIfNeeded); } - (void)_replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace { DOMDocumentFragment* fragment = kit(createFragmentFromText(_private->coreFrame->selection()->toNormalizedRange().get(), text).get()); [self _replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:smartReplace matchStyle:YES]; } - (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace { DOMDocumentFragment *fragment = [self _documentFragmentWithMarkupString:markupString baseURLString:baseURLString]; [self _replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:smartReplace matchStyle:NO]; } - (NSMutableDictionary *)_cacheabilityDictionary { NSMutableDictionary *result = [NSMutableDictionary dictionary]; FrameLoader* frameLoader = _private->coreFrame->loader(); DocumentLoader* documentLoader = frameLoader->documentLoader(); if (documentLoader && !documentLoader->mainDocumentError().isNull()) [result setObject:(NSError *)documentLoader->mainDocumentError() forKey:WebFrameMainDocumentError]; if (frameLoader->containsPlugins()) [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameHasPlugins]; if (DOMWindow* domWindow = _private->coreFrame->domWindow()) { if (domWindow->hasEventListeners(eventNames().unloadEvent)) [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameHasUnloadListener]; if (domWindow->optionalApplicationCache()) [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameUsesApplicationCache]; } if (Document* document = _private->coreFrame->document()) { if (document->hasOpenDatabases()) [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameUsesDatabases]; if (document->usingGeolocation()) [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameUsesGeolocation]; if (!document->canSuspendActiveDOMObjects()) [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameCanSuspendActiveDOMObjects]; } return result; } - (BOOL)_allowsFollowingLink:(NSURL *)URL { if (!_private->coreFrame) return YES; return FrameLoader::canLoad(URL, String(), _private->coreFrame->document()); } @end @implementation WebFrame - (id)init { return nil; } // Should be deprecated. - (id)initWithName:(NSString *)name webFrameView:(WebFrameView *)view webView:(WebView *)webView { return nil; } - (void)dealloc { [_private release]; --WebFrameCount; [super dealloc]; } - (void)finalize { --WebFrameCount; [super finalize]; } - (NSString *)name { Frame* coreFrame = _private->coreFrame; if (!coreFrame) return nil; return coreFrame->tree()->name(); } - (WebFrameView *)frameView { ASSERT(!getWebView(self) || [getWebView(self) _usesDocumentViews]); return _private->webFrameView; } - (WebView *)webView { return getWebView(self); } static bool needsMicrosoftMessengerDOMDocumentWorkaround() { static bool needsWorkaround = applicationIsMicrosoftMessenger() && [[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey] compare:@"7.1" options:NSNumericSearch] == NSOrderedAscending; return needsWorkaround; } - (DOMDocument *)DOMDocument { if (needsMicrosoftMessengerDOMDocumentWorkaround() && !pthread_main_np()) return nil; Frame* coreFrame = _private->coreFrame; if (!coreFrame) return nil; // FIXME: <rdar://problem/5145841> When loading a custom view/representation // into a web frame, the old document can still be around. This makes sure that // we'll return nil in those cases. if (![[self _dataSource] _isDocumentHTML]) return nil; Document* document = coreFrame->document(); // According to the documentation, we should return nil if the frame doesn't have a document. // While full-frame images and plugins do have an underlying HTML document, we return nil here to be // backwards compatible. if (document && (document->isPluginDocument() || document->isImageDocument())) return nil; return kit(coreFrame->document()); } - (DOMHTMLElement *)frameElement { Frame* coreFrame = _private->coreFrame; if (!coreFrame) return nil; return kit(coreFrame->ownerElement()); } - (WebDataSource *)provisionalDataSource { Frame* coreFrame = _private->coreFrame; return coreFrame ? dataSource(coreFrame->loader()->provisionalDocumentLoader()) : nil; } - (WebDataSource *)dataSource { Frame* coreFrame = _private->coreFrame; return coreFrame && coreFrame->loader()->frameHasLoaded() ? [self _dataSource] : nil; } - (void)loadRequest:(NSURLRequest *)request { _private->coreFrame->loader()->load(request, false); } static NSURL *createUniqueWebDataURL() { CFUUIDRef UUIDRef = CFUUIDCreate(kCFAllocatorDefault); NSString *UUIDString = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, UUIDRef); CFRelease(UUIDRef); NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"applewebdata://%@", UUIDString]]; CFRelease(UUIDString); return URL; } - (void)_loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL unreachableURL:(NSURL *)unreachableURL { if (!pthread_main_np()) return [[self _webkit_invokeOnMainThread] _loadData:data MIMEType:MIMEType textEncodingName:encodingName baseURL:baseURL unreachableURL:unreachableURL]; KURL responseURL; if (!baseURL) { baseURL = blankURL(); responseURL = createUniqueWebDataURL(); } ResourceRequest request([baseURL absoluteURL]); // hack because Mail checks for this property to detect data / archive loads [NSURLProtocol setProperty:@"" forKey:@"WebDataRequest" inRequest:(NSMutableURLRequest *)request.nsURLRequest()]; SubstituteData substituteData(WebCore::SharedBuffer::wrapNSData(data), MIMEType, encodingName, [unreachableURL absoluteURL], responseURL); _private->coreFrame->loader()->load(request, substituteData, false); } - (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL { WebCoreThreadViolationCheckRoundTwo(); if (!MIMEType) MIMEType = @"text/html"; [self _loadData:data MIMEType:MIMEType textEncodingName:encodingName baseURL:baseURL unreachableURL:nil]; } - (void)_loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL unreachableURL:(NSURL *)unreachableURL { NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding]; [self _loadData:data MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:baseURL unreachableURL:unreachableURL]; } - (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL { WebCoreThreadViolationCheckRoundTwo(); [self _loadHTMLString:string baseURL:baseURL unreachableURL:nil]; } - (void)loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL { WebCoreThreadViolationCheckRoundTwo(); [self _loadHTMLString:string baseURL:baseURL unreachableURL:unreachableURL]; } - (void)loadArchive:(WebArchive *)archive { if (LegacyWebArchive* coreArchive = [archive _coreLegacyWebArchive]) _private->coreFrame->loader()->loadArchive(coreArchive); } - (void)stopLoading { if (!_private->coreFrame) return; _private->coreFrame->loader()->stopForUserCancel(); } - (void)reload { if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_RELOAD_FROM_ORIGIN) && applicationIsSafari()) _private->coreFrame->loader()->reload(GetCurrentKeyModifiers() & shiftKey); else _private->coreFrame->loader()->reload(false); } - (void)reloadFromOrigin { _private->coreFrame->loader()->reload(true); } - (WebFrame *)findFrameNamed:(NSString *)name { Frame* coreFrame = _private->coreFrame; if (!coreFrame) return nil; return kit(coreFrame->tree()->find(name)); } - (WebFrame *)parentFrame { Frame* coreFrame = _private->coreFrame; if (!coreFrame) return nil; return [[kit(coreFrame->tree()->parent()) retain] autorelease]; } - (NSArray *)childFrames { Frame* coreFrame = _private->coreFrame; if (!coreFrame) return [NSArray array]; NSMutableArray *children = [NSMutableArray arrayWithCapacity:coreFrame->tree()->childCount()]; for (Frame* child = coreFrame->tree()->firstChild(); child; child = child->tree()->nextSibling()) [children addObject:kit(child)]; return children; } - (WebScriptObject *)windowObject { Frame* coreFrame = _private->coreFrame; if (!coreFrame) return 0; return coreFrame->script()->windowScriptObject(); } - (JSGlobalContextRef)globalContext { Frame* coreFrame = _private->coreFrame; if (!coreFrame) return 0; return toGlobalRef(coreFrame->script()->globalObject()->globalExec()); } @end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebDelegateImplementationCaching.h�����������������������������������������������0000644�0001750�0001750�00000013706�11260532745�021167� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ // This header contains WebView declarations that can be used anywhere in WebKit, but are neither SPI nor API. #import "WebTypesInternal.h" @class WebView; struct WebResourceDelegateImplementationCache { IMP didCancelAuthenticationChallengeFunc; IMP didReceiveAuthenticationChallengeFunc; IMP identifierForRequestFunc; IMP willSendRequestFunc; IMP didReceiveResponseFunc; IMP didReceiveContentLengthFunc; IMP didFinishLoadingFromDataSourceFunc; IMP didFailLoadingWithErrorFromDataSourceFunc; IMP didLoadResourceFromMemoryCacheFunc; IMP willCacheResponseFunc; IMP plugInFailedWithErrorFunc; IMP shouldUseCredentialStorageFunc; }; struct WebFrameLoadDelegateImplementationCache { IMP didClearWindowObjectForFrameFunc; IMP didClearInspectorWindowObjectForFrameFunc; IMP windowScriptObjectAvailableFunc; IMP didHandleOnloadEventsForFrameFunc; IMP didReceiveServerRedirectForProvisionalLoadForFrameFunc; IMP didCancelClientRedirectForFrameFunc; IMP willPerformClientRedirectToURLDelayFireDateForFrameFunc; IMP didChangeLocationWithinPageForFrameFunc; IMP willCloseFrameFunc; IMP didStartProvisionalLoadForFrameFunc; IMP didReceiveTitleForFrameFunc; IMP didCommitLoadForFrameFunc; IMP didFailProvisionalLoadWithErrorForFrameFunc; IMP didFailLoadWithErrorForFrameFunc; IMP didFinishLoadForFrameFunc; IMP didFirstLayoutInFrameFunc; IMP didFirstVisuallyNonEmptyLayoutInFrameFunc; IMP didReceiveIconForFrameFunc; IMP didFinishDocumentLoadForFrameFunc; IMP didDisplayInsecureContentFunc; IMP didRunInsecureContentFunc; }; struct WebScriptDebugDelegateImplementationCache { BOOL didParseSourceExpectsBaseLineNumber; IMP didParseSourceFunc; IMP failedToParseSourceFunc; IMP didEnterCallFrameFunc; IMP willExecuteStatementFunc; IMP willLeaveCallFrameFunc; IMP exceptionWasRaisedFunc; }; struct WebHistoryDelegateImplementationCache { IMP navigatedFunc; IMP clientRedirectFunc; IMP serverRedirectFunc; }; WebResourceDelegateImplementationCache* WebViewGetResourceLoadDelegateImplementations(WebView *); WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementations(WebView *); WebScriptDebugDelegateImplementationCache* WebViewGetScriptDebugDelegateImplementations(WebView *); WebHistoryDelegateImplementationCache* WebViewGetHistoryDelegateImplementations(WebView *webView); id CallFormDelegate(WebView *, SEL, id, id); id CallFormDelegate(WebView *self, SEL selector, id object1, id object2, id object3, id object4, id object5); BOOL CallFormDelegateReturningBoolean(BOOL, WebView *, SEL, id, SEL, id); id CallUIDelegate(WebView *, SEL); id CallUIDelegate(WebView *, SEL, id); id CallUIDelegate(WebView *, SEL, NSRect); id CallUIDelegate(WebView *, SEL, id, id); id CallUIDelegate(WebView *, SEL, id, BOOL); id CallUIDelegate(WebView *, SEL, id, id, id); id CallUIDelegate(WebView *, SEL, id, NSUInteger); float CallUIDelegateReturningFloat(WebView *, SEL); BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL); BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id); BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id, id); BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id, BOOL); id CallFrameLoadDelegate(IMP, WebView *, SEL); id CallFrameLoadDelegate(IMP, WebView *, SEL, id); id CallFrameLoadDelegate(IMP, WebView *, SEL, id, id); id CallFrameLoadDelegate(IMP, WebView *, SEL, id, id, id); id CallFrameLoadDelegate(IMP, WebView *, SEL, id, id, id, id); id CallFrameLoadDelegate(IMP, WebView *, SEL, id, NSTimeInterval, id, id); id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id); id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, id); id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, id, id); id CallResourceLoadDelegate(IMP, WebView *, SEL, id, NSInteger, id); id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, NSInteger, id); BOOL CallResourceLoadDelegateReturningBoolean(BOOL, IMP, WebView *, SEL, id, id); id CallScriptDebugDelegate(IMP, WebView *, SEL, id, id, NSInteger, id); id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, id, NSInteger, id); id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, id, id, id); id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, NSInteger, id); id CallHistoryDelegate(IMP, WebView *, SEL, id, id); id CallHistoryDelegate(IMP, WebView *, SEL, id, id, id); ����������������������������������������������������������WebKit/mac/WebView/WebViewPrivate.h�����������������������������������������������������������������0000644�0001750�0001750�00000054030�11261453657�015537� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebView.h> #import <WebKit/WebFramePrivate.h> #if !defined(ENABLE_DASHBOARD_SUPPORT) #define ENABLE_DASHBOARD_SUPPORT 1 #endif #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 #define WebNSInteger int #define WebNSUInteger unsigned int #else #define WebNSInteger NSInteger #define WebNSUInteger NSUInteger #endif @class NSError; @class WebFrame; @class WebInspector; @class WebPreferences; @class WebTextIterator; @protocol WebFormDelegate; extern NSString *_WebCanGoBackKey; extern NSString *_WebCanGoForwardKey; extern NSString *_WebEstimatedProgressKey; extern NSString *_WebIsLoadingKey; extern NSString *_WebMainFrameIconKey; extern NSString *_WebMainFrameTitleKey; extern NSString *_WebMainFrameURLKey; extern NSString *_WebMainFrameDocumentKey; // pending public WebElementDictionary keys extern NSString *WebElementTitleKey; // NSString of the title of the element (used by Safari) extern NSString *WebElementSpellingToolTipKey; // NSString of a tooltip representing misspelling or bad grammar (used internally) extern NSString *WebElementIsContentEditableKey; // NSNumber indicating whether the inner non-shared node is content editable (used internally) // other WebElementDictionary keys extern NSString *WebElementLinkIsLiveKey; // NSNumber of BOOL indictating whether the link is live or not #if ENABLE_DASHBOARD_SUPPORT typedef enum { WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows, WebDashboardBehaviorAlwaysSendActiveNullEventsToPlugIns, WebDashboardBehaviorAlwaysAcceptsFirstMouse, WebDashboardBehaviorAllowWheelScrolling, WebDashboardBehaviorUseBackwardCompatibilityMode } WebDashboardBehavior; #endif typedef enum { WebInjectAtDocumentStart, WebInjectAtDocumentEnd, } WebUserScriptInjectionTime; @interface WebController : NSTreeController { IBOutlet WebView *webView; } - (WebView *)webView; - (void)setWebView:(WebView *)newWebView; @end @interface WebView (WebViewEditingActionsPendingPublic) - (void)outdent:(id)sender; @end @interface WebView (WebPendingPublic) - (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode; - (void)unscheduleFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode; /*! @method searchFor:direction:caseSensitive:wrap:startInSelection: @abstract Searches a document view for a string and highlights the string if it is found. Starts the search from the current selection. Will search across all frames. @param string The string to search for. @param forward YES to search forward, NO to seach backwards. @param caseFlag YES to for case-sensitive search, NO for case-insensitive search. @param wrapFlag YES to wrap around, NO to avoid wrapping. @param startInSelection YES to begin search in the selected text (useful for incremental searching), NO to begin search after the selected text. @result YES if found, NO if not found. */ - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag startInSelection:(BOOL)startInSelection; - (void)setMainFrameDocumentReady:(BOOL)mainFrameDocumentReady; - (void)setTabKeyCyclesThroughElements:(BOOL)cyclesElements; - (BOOL)tabKeyCyclesThroughElements; - (void)scrollDOMRangeToVisible:(DOMRange *)range; // setHoverFeedbackSuspended: can be called by clients that want to temporarily prevent the webView // from displaying feedback about mouse position. Each WebDocumentView class that displays feedback // about mouse position should honor this setting. - (void)setHoverFeedbackSuspended:(BOOL)newValue; - (BOOL)isHoverFeedbackSuspended; /*! @method setScriptDebugDelegate: @abstract Set the WebView's WebScriptDebugDelegate delegate. @param delegate The WebScriptDebugDelegate to set as the delegate. */ - (void)setScriptDebugDelegate:(id)delegate; /*! @method scriptDebugDelegate @abstract Return the WebView's WebScriptDebugDelegate. @result The WebView's WebScriptDebugDelegate. */ - (id)scriptDebugDelegate; /*! @method setHistoryDelegate: @abstract Set the WebView's WebHistoryDelegate delegate. @param delegate The WebHistoryDelegate to set as the delegate. */ - (void)setHistoryDelegate:(id)delegate; /*! @method historyDelegate @abstract Return the WebView's WebHistoryDelegate delegate. @result The WebView's WebHistoryDelegate delegate. */ - (id)historyDelegate; - (BOOL)shouldClose; /*! @method aeDescByEvaluatingJavaScriptFromString: @param script The text of the JavaScript. @result The result of the script, converted to an NSAppleEventDescriptor, or nil for failure. */ - (NSAppleEventDescriptor *)aeDescByEvaluatingJavaScriptFromString:(NSString *)script; // Support for displaying multiple text matches. // These methods might end up moving into a protocol, so different document types can specify // whether or not they implement the protocol. For now we'll just deal with HTML. // These methods are still in flux; don't rely on them yet. - (BOOL)canMarkAllTextMatches; - (WebNSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(WebNSUInteger)limit; - (void)unmarkAllTextMatches; - (NSArray *)rectsForTextMatches; // Support for disabling registration with the undo manager. This is equivalent to the methods with the same names on NSTextView. - (BOOL)allowsUndo; - (void)setAllowsUndo:(BOOL)flag; /*! @method setPageSizeMultiplier: @abstract Change the zoom factor of the page in views managed by this webView. @param multiplier A fractional percentage value, 1.0 is 100%. */ - (void)setPageSizeMultiplier:(float)multiplier; /*! @method pageSizeMultiplier @result The page size multipler. */ - (float)pageSizeMultiplier; // Commands for doing page zoom. Will end up in WebView (WebIBActions) <NSUserInterfaceValidations> - (BOOL)canZoomPageIn; - (IBAction)zoomPageIn:(id)sender; - (BOOL)canZoomPageOut; - (IBAction)zoomPageOut:(id)sender; - (BOOL)canResetPageZoom; - (IBAction)resetPageZoom:(id)sender; // Sets a master volume control for all media elements in the WebView. Valid values are 0..1. - (void)setMediaVolume:(float)volume; - (float)mediaVolume; @end @interface WebView (WebPrivate) - (WebInspector *)inspector; /*! @method setBackgroundColor: @param backgroundColor Color to use as the default background. @abstract Sets what color the receiver draws under transparent page background colors and images. This color is also used when no page is loaded. A color with alpha should only be used when the receiver is in a non-opaque window, since the color is drawn using NSCompositeCopy. */ - (void)setBackgroundColor:(NSColor *)backgroundColor; /*! @method backgroundColor @result Returns the background color drawn under transparent page background colors and images. This color is also used when no page is loaded. A color with alpha should only be used when the receiver is in a non-opaque window, since the color is drawn using NSCompositeCopy. */ - (NSColor *)backgroundColor; /*! Could be worth adding to the API. @method _loadBackForwardListFromOtherView: @abstract Loads the view with the contents of the other view, including its backforward list. @param otherView The WebView from which to copy contents. */ - (void)_loadBackForwardListFromOtherView:(WebView *)otherView; /*! @method _dispatchPendingLoadRequests: @abstract Dispatches any pending load requests that have been scheduled because of recent DOM additions or style changes. @discussion You only need to call this method if you require synchronous notification of loads through the resource load delegate. Otherwise the resource load delegate will be notified about loads during a future run loop iteration. */ - (void)_dispatchPendingLoadRequests; + (NSArray *)_supportedFileExtensions; /*! @method canShowFile: @abstract Checks if the WebKit can show the content of the file at the specified path. @param path The path of the file to check @result YES if the WebKit can show the content of the file at the specified path. */ + (BOOL)canShowFile:(NSString *)path; /*! @method suggestedFileExtensionForMIMEType: @param MIMEType The MIME type to check. @result The extension based on the MIME type */ + (NSString *)suggestedFileExtensionForMIMEType: (NSString *)MIMEType; + (NSString *)_standardUserAgentWithApplicationName:(NSString *)applicationName; /*! @method canCloseAllWebViews @abstract Checks if all the open WebViews can be closed (by dispatching the beforeUnload event to the pages). @result YES if all the WebViews can be closed. */ + (BOOL)canCloseAllWebViews; // May well become public - (void)_setFormDelegate:(id<WebFormDelegate>)delegate; - (id<WebFormDelegate>)_formDelegate; - (BOOL)_isClosed; // _close is now replaced by public method -close. It remains here only for backward compatibility // until callers can be weaned off of it. - (void)_close; // Indicates if the WebView is in the midst of a user gesture. - (BOOL)_isProcessingUserGesture; // SPI for DumpRenderTree - (void)_updateActiveState; /*! @method _registerViewClass:representationClass:forURLScheme: @discussion Register classes that implement WebDocumentView and WebDocumentRepresentation respectively. @param viewClass The WebDocumentView class to use to render data for a given MIME type. @param representationClass The WebDocumentRepresentation class to use to represent data of the given MIME type. @param scheme The URL scheme to represent with an object of the given class. */ + (void)_registerViewClass:(Class)viewClass representationClass:(Class)representationClass forURLScheme:(NSString *)URLScheme; + (void)_unregisterViewClassAndRepresentationClassForMIMEType:(NSString *)MIMEType; /*! @method _canHandleRequest: @abstract Performs a "preflight" operation that performs some speculative checks to see if a request can be used to create a WebDocumentView and WebDocumentRepresentation. @discussion The result of this method is valid only as long as no protocols or schemes are registered or unregistered, and as long as the request is not mutated (if the request is mutable). Hence, clients should be prepared to handle failures even if they have performed request preflighting by caling this method. @param request The request to preflight. @result YES if it is likely that a WebDocumentView and WebDocumentRepresentation can be created for the request, NO otherwise. */ + (BOOL)_canHandleRequest:(NSURLRequest *)request; + (NSString *)_decodeData:(NSData *)data; + (void)_setAlwaysUsesComplexTextCodePath:(BOOL)f; // This is the old name of the above method. Needed for Safari versions that call it. + (void)_setAlwaysUseATSU:(BOOL)f; - (NSCachedURLResponse *)_cachedResponseForURL:(NSURL *)URL; #if ENABLE_DASHBOARD_SUPPORT - (void)_addScrollerDashboardRegions:(NSMutableDictionary *)regions; - (NSDictionary *)_dashboardRegions; - (void)_setDashboardBehavior:(WebDashboardBehavior)behavior to:(BOOL)flag; - (BOOL)_dashboardBehavior:(WebDashboardBehavior)behavior; #endif + (void)_setShouldUseFontSmoothing:(BOOL)f; + (BOOL)_shouldUseFontSmoothing; - (void)_setCatchesDelegateExceptions:(BOOL)f; - (BOOL)_catchesDelegateExceptions; // These two methods are useful for a test harness that needs a consistent appearance for the focus rings // regardless of OS X version. + (void)_setUsesTestModeFocusRingColor:(BOOL)f; + (BOOL)_usesTestModeFocusRingColor; /*! @method setAlwaysShowVerticalScroller: @result Forces the vertical scroller to be visible if flag is YES, otherwise if flag is NO the scroller with automatically show and hide as needed. */ - (void)setAlwaysShowVerticalScroller:(BOOL)flag; /*! @method alwaysShowVerticalScroller @result YES if the vertical scroller is always shown */ - (BOOL)alwaysShowVerticalScroller; /*! @method setAlwaysShowHorizontalScroller: @result Forces the horizontal scroller to be visible if flag is YES, otherwise if flag is NO the scroller with automatically show and hide as needed. */ - (void)setAlwaysShowHorizontalScroller:(BOOL)flag; /*! @method alwaysShowHorizontalScroller @result YES if the horizontal scroller is always shown */ - (BOOL)alwaysShowHorizontalScroller; /*! @method setProhibitsMainFrameScrolling: @abstract Prohibits scrolling in the WebView's main frame. Used to "lock" a WebView to a specific scroll position. */ - (void)setProhibitsMainFrameScrolling:(BOOL)prohibits; /*! @method _setAdditionalWebPlugInPaths: @abstract Sets additional plugin search paths for a specific WebView. */ - (void)_setAdditionalWebPlugInPaths:(NSArray *)newPaths; /*! @method _setInViewSourceMode: @abstract Used to place a WebView into a special source-viewing mode. */ - (void)_setInViewSourceMode:(BOOL)flag; /*! @method _inViewSourceMode; @abstract Whether or not the WebView is in source-view mode for HTML. */ - (BOOL)_inViewSourceMode; /*! @method _attachScriptDebuggerToAllFrames @abstract Attaches a script debugger to all frames belonging to the receiver. */ - (void)_attachScriptDebuggerToAllFrames; /*! @method _detachScriptDebuggerFromAllFrames @abstract Detaches any script debuggers from all frames belonging to the receiver. */ - (void)_detachScriptDebuggerFromAllFrames; - (BOOL)defersCallbacks; // called by QuickTime plug-in - (void)setDefersCallbacks:(BOOL)defer; // called by QuickTime plug-in - (BOOL)usesPageCache; - (void)setUsesPageCache:(BOOL)usesPageCache; - (WebHistoryItem *)_globalHistoryItem; /*! @method textIteratorForRect: @param rect The rectangle of the document that we're interested in text from. @result WebTextIterator object, initialized with a range that corresponds to the passed-in rectangle. @abstract This method gives the text for the approximate range of the document corresponding to the rectangle. The range is determined by using hit testing at the top left and bottom right of the rectangle. Because of that, there can be text visible in the rectangle that is not included in the iterator. If you need a guarantee of iterating all text that is visible, then you need to instead make a WebTextIterator with a DOMRange that covers the entire document. */ - (WebTextIterator *)textIteratorForRect:(NSRect)rect; #if ENABLE_DASHBOARD_SUPPORT // <rdar://problem/5217124> Clients other than Dashboard, don't use this. // As of this writing, Dashboard uses this on Tiger, but not on Leopard or newer. - (void)handleAuthenticationForResource:(id)identifier challenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource; #endif - (void)_clearUndoRedoOperations; /* Used to do fast (lower quality) scaling of images so that window resize can be quick. */ - (BOOL)_inFastImageScalingMode; - (void)_setUseFastImageScalingMode:(BOOL)flag; - (BOOL)_cookieEnabled; - (void)_setCookieEnabled:(BOOL)enable; // SPI for DumpRenderTree - (void)_executeCoreCommandByName:(NSString *)name value:(NSString *)value; - (void)_clearMainFrameName; - (void)_setCustomHTMLTokenizerTimeDelay:(double)timeDelay; - (void)_setCustomHTMLTokenizerChunkSize:(int)chunkSize; - (id)_initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews; - (BOOL)_usesDocumentViews; - (void)setSelectTrailingWhitespaceEnabled:(BOOL)flag; - (BOOL)isSelectTrailingWhitespaceEnabled; - (void)setMemoryCacheDelegateCallsEnabled:(BOOL)suspend; - (BOOL)areMemoryCacheDelegateCallsEnabled; - (void)_setJavaScriptURLsAreAllowed:(BOOL)setJavaScriptURLsAreAllowed; + (NSCursor *)_pointingHandCursor; // SPI for DumpRenderTree - (BOOL)_isUsingAcceleratedCompositing; // Which pasteboard text is coming from in editing delegate methods such as shouldInsertNode. - (NSPasteboard *)_insertionPasteboard; // Whitelists access from an origin (sourceOrigin) to a set of one or more origins described by the parameters: // - destinationProtocol: The protocol to grant access to. // - destinationHost: The host to grant access to. // - allowDestinationSubdomains: If host is a domain, setting this to YES will whitelist host and all its subdomains, recursively. + (void)_whiteListAccessFromOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains; // Removes all white list entries created with _whiteListAccessFromOrigin. + (void)_resetOriginAccessWhiteLists; + (void)_addUserScriptToGroup:(NSString *)groupName source:(NSString *)source url:(NSURL *)url worldID:(unsigned)worldID whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist injectionTime:(WebUserScriptInjectionTime)injectionTime; + (void)_addUserStyleSheetToGroup:(NSString *)groupName source:(NSString *)source url:(NSURL *)url worldID:(unsigned)worldID whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist; + (void)_removeUserContentFromGroup:(NSString *)groupName url:(NSURL *)url worldID:(unsigned)worldID; + (void)_removeUserContentFromGroup:(NSString *)groupName worldID:(unsigned)worldID; + (void)_removeAllUserContentFromGroup:(NSString *)groupName; @end @interface WebView (WebViewPrintingPrivate) /*! @method _adjustPrintingMarginsForHeaderAndFooter: @abstract Increase the top and bottom margins for the current print operation to account for the header and footer height. @discussion Called by <WebDocument> implementors once when a print job begins. If the <WebDocument> implementor implements knowsPageRange:, this should be called from there. Otherwise this should be called from beginDocument. The <WebDocument> implementors need to also call _drawHeaderAndFooter. */ - (void)_adjustPrintingMarginsForHeaderAndFooter; /*! @method _drawHeaderAndFooter @abstract Gives the WebView's UIDelegate a chance to draw a header and footer on the printed page. @discussion This should be called by <WebDocument> implementors from an override of drawPageBorderWithSize:. */ - (void)_drawHeaderAndFooter; @end @interface WebView (WebViewGrammarChecking) // FIXME: These two methods should be merged into WebViewEditing when we're not in API freeze - (BOOL)isGrammarCheckingEnabled; #ifndef BUILDING_ON_TIGER - (void)setGrammarCheckingEnabled:(BOOL)flag; // FIXME: This method should be merged into WebIBActions when we're not in API freeze - (void)toggleGrammarChecking:(id)sender; #endif @end @interface WebView (WebViewTextChecking) - (BOOL)isAutomaticQuoteSubstitutionEnabled; - (BOOL)isAutomaticLinkDetectionEnabled; - (BOOL)isAutomaticDashSubstitutionEnabled; - (BOOL)isAutomaticTextReplacementEnabled; - (BOOL)isAutomaticSpellingCorrectionEnabled; #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) - (void)setAutomaticQuoteSubstitutionEnabled:(BOOL)flag; - (void)toggleAutomaticQuoteSubstitution:(id)sender; - (void)setAutomaticLinkDetectionEnabled:(BOOL)flag; - (void)toggleAutomaticLinkDetection:(id)sender; - (void)setAutomaticDashSubstitutionEnabled:(BOOL)flag; - (void)toggleAutomaticDashSubstitution:(id)sender; - (void)setAutomaticTextReplacementEnabled:(BOOL)flag; - (void)toggleAutomaticTextReplacement:(id)sender; - (void)setAutomaticSpellingCorrectionEnabled:(BOOL)flag; - (void)toggleAutomaticSpellingCorrection:(id)sender; #endif @end @interface WebView (WebViewEditingInMail) - (void)_insertNewlineInQuotedContent; - (void)_replaceSelectionWithNode:(DOMNode *)node matchStyle:(BOOL)matchStyle; - (BOOL)_selectionIsCaret; - (BOOL)_selectionIsAll; @end @interface NSObject (WebFrameLoadDelegatePrivate) - (void)webView:(WebView *)sender didFirstLayoutInFrame:(WebFrame *)frame; // didFinishDocumentLoadForFrame is sent when the document has finished loading, though not necessarily all // of its subresources. // FIXME 5259339: Currently this callback is not sent for (some?) pages loaded entirely from the cache. - (void)webView:(WebView *)sender didFinishDocumentLoadForFrame:(WebFrame *)frame; // Addresses 4192534. SPI for now. - (void)webView:(WebView *)sender didHandleOnloadEventsForFrame:(WebFrame *)frame; - (void)webView:(WebView *)sender didFirstVisuallyNonEmptyLayoutInFrame:(WebFrame *)frame; // For implementing the WebInspector's test harness - (void)webView:(WebView *)webView didClearInspectorWindowObject:(WebScriptObject *)windowObject forFrame:(WebFrame *)frame; @end @interface NSObject (WebResourceLoadDelegatePrivate) // Addresses <rdar://problem/5008925> - SPI for now - (NSCachedURLResponse *)webView:(WebView *)sender resource:(id)identifier willCacheResponse:(NSCachedURLResponse *)response fromDataSource:(WebDataSource *)dataSource; @end #undef WebNSInteger #undef WebNSUInteger ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebViewData.h��������������������������������������������������������������������0000644�0001750�0001750�00000013027�11260532745�014772� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebTypesInternal.h" #import "WebDelegateImplementationCaching.h" #import <WebCore/PlatformString.h> #import <WebCore/WebCoreKeyboardUIMode.h> #import <wtf/HashMap.h> #import <wtf/RetainPtr.h> namespace WebCore { class Page; } @class WebInspector; @class WebNodeHighlight; @class WebPluginDatabase; @class WebPreferences; @class WebTextCompletionController; @protocol WebFormDelegate; extern BOOL applicationIsTerminating; extern int pluginDatabaseClientCount; // FIXME: This should be renamed to WebViewData. @interface WebViewPrivate : NSObject { @public WebCore::Page* page; id UIDelegate; id UIDelegateForwarder; id resourceProgressDelegate; id downloadDelegate; id policyDelegate; id policyDelegateForwarder; id frameLoadDelegate; id frameLoadDelegateForwarder; id <WebFormDelegate> formDelegate; id editingDelegate; id editingDelegateForwarder; id scriptDebugDelegate; id historyDelegate; WebInspector *inspector; WebNodeHighlight *currentNodeHighlight; BOOL allowsUndo; float zoomMultiplier; NSString *applicationNameForUserAgent; WebCore::String userAgent; BOOL userAgentOverridden; WebPreferences *preferences; BOOL useSiteSpecificSpoofing; NSWindow *hostWindow; int programmaticFocusCount; WebResourceDelegateImplementationCache resourceLoadDelegateImplementations; WebFrameLoadDelegateImplementationCache frameLoadDelegateImplementations; WebScriptDebugDelegateImplementationCache scriptDebugDelegateImplementations; WebHistoryDelegateImplementationCache historyDelegateImplementations; void *observationInfo; BOOL closed; BOOL shouldCloseWithWindow; BOOL mainFrameDocumentReady; BOOL drawsBackground; BOOL editable; BOOL tabKeyCyclesThroughElementsChanged; BOOL becomingFirstResponder; BOOL becomingFirstResponderFromOutside; BOOL hoverFeedbackSuspended; BOOL usesPageCache; BOOL catchesDelegateExceptions; NSColor *backgroundColor; NSString *mediaStyle; BOOL hasSpellCheckerDocumentTag; NSInteger spellCheckerDocumentTag; BOOL smartInsertDeleteEnabled; BOOL selectTrailingWhitespaceEnabled; #if ENABLE(DASHBOARD_SUPPORT) BOOL dashboardBehaviorAlwaysSendMouseEventsToAllWindows; BOOL dashboardBehaviorAlwaysSendActiveNullEventsToPlugIns; BOOL dashboardBehaviorAlwaysAcceptsFirstMouse; BOOL dashboardBehaviorAllowWheelScrolling; #endif // WebKit has both a global plug-in database and a separate, per WebView plug-in database. Dashboard uses the per WebView database. WebPluginDatabase *pluginDatabase; HashMap<unsigned long, RetainPtr<id> > identifierMap; BOOL _keyboardUIModeAccessed; WebCore::KeyboardUIMode _keyboardUIMode; BOOL shouldUpdateWhileOffscreen; // When this flag is set, we will not make any subviews underneath this WebView. This means no WebFrameViews and no WebHTMLViews. BOOL usesDocumentViews; #if USE(ACCELERATED_COMPOSITING) // When this flag is set, next time a WebHTMLView draws, it needs to temporarily disable screen updates // so that the NSView drawing is visually synchronized with CALayer updates. BOOL needsOneShotDrawingSynchronization; // Number of WebHTMLViews using accelerated compositing. Used to implement _isUsingAcceleratedCompositing. int acceleratedFramesCount; // Run loop observer used to implement the compositing equivalent of -viewWillDraw CFRunLoopObserverRef layerSyncRunLoopObserver; #endif NSPasteboard *insertionPasteboard; NSSize lastLayoutSize; BOOL ignoringMouseDraggedEvents; NSEvent *mouseDownEvent; // Kept after handling the event. BOOL handlingMouseDownEvent; NSEvent *keyDownEvent; // Kept after handling the event. WebTextCompletionController *completionController; NSTimer *autoscrollTimer; NSEvent *autoscrollTriggerEvent; CFRunLoopTimerRef updateMouseoverTimer; } @end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebArchiveInternal.h�������������������������������������������������������������0000644�0001750�0001750�00000003525�10772231064�016343� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebArchive.h" #import <JavaScriptCore/Forward.h> namespace WebCore { class LegacyWebArchive; } @interface WebArchive (WebInternal) - (id)_initWithCoreLegacyWebArchive:(WTF::PassRefPtr<WebCore::LegacyWebArchive>)coreLegacyWebArchive; - (WebCore::LegacyWebArchive *)_coreLegacyWebArchive; @end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebTextCompletionController.mm���������������������������������������������������0000644�0001750�0001750�00000031337�11242107332�020464� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebTextCompletionController.h" #import "DOMRangeInternal.h" #import "WebFrameInternal.h" #import "WebHTMLViewInternal.h" #import "WebTypesInternal.h" #import <WebCore/Frame.h> @interface NSWindow (WebNSWindowDetails) - (void)_setForceActiveControls:(BOOL)flag; @end using namespace WebCore; using namespace std; // This class handles the complete: operation. // It counts on its host view to call endRevertingChange: whenever the current completion needs to be aborted. // The class is in one of two modes: Popup window showing, or not. // It is shown when a completion yields more than one match. // If a completion yields one or zero matches, it is not shown, and there is no state carried across to the next completion. @implementation WebTextCompletionController - (id)initWithWebView:(WebView *)view HTMLView:(WebHTMLView *)htmlView { self = [super init]; if (!self) return nil; _view = view; _htmlView = htmlView; return self; } - (void)dealloc { [_popupWindow release]; [_completions release]; [_originalString release]; [super dealloc]; } - (void)_insertMatch:(NSString *)match { // FIXME: 3769654 - We should preserve case of string being inserted, even in prefix (but then also be // able to revert that). Mimic NSText. WebFrame *frame = [_htmlView _frame]; NSString *newText = [match substringFromIndex:prefixLength]; [frame _replaceSelectionWithText:newText selectReplacement:YES smartReplace:NO]; } // mostly lifted from NSTextView_KeyBinding.m - (void)_buildUI { NSRect scrollFrame = NSMakeRect(0, 0, 100, 100); NSRect tableFrame = NSZeroRect; tableFrame.size = [NSScrollView contentSizeForFrameSize:scrollFrame.size hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSNoBorder]; // Added cast to work around problem with multiple Foundation initWithIdentifier: methods with different parameter types. NSTableColumn *column = [(NSTableColumn *)[NSTableColumn alloc] initWithIdentifier:[NSNumber numberWithInt:0]]; [column setWidth:tableFrame.size.width]; [column setEditable:NO]; _tableView = [[NSTableView alloc] initWithFrame:tableFrame]; [_tableView setAutoresizingMask:NSViewWidthSizable]; [_tableView addTableColumn:column]; [column release]; [_tableView setGridStyleMask:NSTableViewGridNone]; [_tableView setCornerView:nil]; [_tableView setHeaderView:nil]; [_tableView setColumnAutoresizingStyle:NSTableViewUniformColumnAutoresizingStyle]; [_tableView setDelegate:self]; [_tableView setDataSource:self]; [_tableView setTarget:self]; [_tableView setDoubleAction:@selector(tableAction:)]; NSScrollView *scrollView = [[NSScrollView alloc] initWithFrame:scrollFrame]; [scrollView setBorderType:NSNoBorder]; [scrollView setHasVerticalScroller:YES]; [scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [scrollView setDocumentView:_tableView]; [_tableView release]; _popupWindow = [[NSWindow alloc] initWithContentRect:scrollFrame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]; [_popupWindow setAlphaValue:0.88f]; [_popupWindow setContentView:scrollView]; [scrollView release]; [_popupWindow setHasShadow:YES]; [_popupWindow setOneShot:YES]; [_popupWindow _setForceActiveControls:YES]; [_popupWindow setReleasedWhenClosed:NO]; } // mostly lifted from NSTextView_KeyBinding.m - (void)_placePopupWindow:(NSPoint)topLeft { int numberToShow = [_completions count]; if (numberToShow > 20) numberToShow = 20; NSRect windowFrame; NSPoint wordStart = topLeft; windowFrame.origin = [[_view window] convertBaseToScreen:[_htmlView convertPoint:wordStart toView:nil]]; windowFrame.size.height = numberToShow * [_tableView rowHeight] + (numberToShow + 1) * [_tableView intercellSpacing].height; windowFrame.origin.y -= windowFrame.size.height; NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont systemFontOfSize:12.0f], NSFontAttributeName, nil]; CGFloat maxWidth = 0; int maxIndex = -1; int i; for (i = 0; i < numberToShow; i++) { float width = ceilf([[_completions objectAtIndex:i] sizeWithAttributes:attributes].width); if (width > maxWidth) { maxWidth = width; maxIndex = i; } } windowFrame.size.width = 100; if (maxIndex >= 0) { maxWidth = ceilf([NSScrollView frameSizeForContentSize:NSMakeSize(maxWidth, 100.0f) hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSNoBorder].width); maxWidth = ceilf([NSWindow frameRectForContentRect:NSMakeRect(0.0f, 0.0f, maxWidth, 100.0f) styleMask:NSBorderlessWindowMask].size.width); maxWidth += 5.0f; windowFrame.size.width = max(maxWidth, windowFrame.size.width); maxWidth = min<CGFloat>(400, windowFrame.size.width); } [_popupWindow setFrame:windowFrame display:NO]; [_tableView reloadData]; [_tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; [_tableView scrollRowToVisible:0]; [self _reflectSelection]; [_popupWindow setLevel:NSPopUpMenuWindowLevel]; [_popupWindow orderFront:nil]; [[_view window] addChildWindow:_popupWindow ordered:NSWindowAbove]; } - (void)doCompletion { if (!_popupWindow) { NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker]; if (!checker) { LOG_ERROR("No NSSpellChecker"); return; } // Get preceeding word stem WebFrame *frame = [_htmlView _frame]; DOMRange *selection = kit(core(frame)->selection()->toNormalizedRange().get()); DOMRange *wholeWord = [frame _rangeByAlteringCurrentSelection:SelectionController::EXTEND direction:SelectionController::BACKWARD granularity:WordGranularity]; DOMRange *prefix = [wholeWord cloneRange]; [prefix setEnd:[selection startContainer] offset:[selection startOffset]]; // Reject some NOP cases if ([prefix collapsed]) { NSBeep(); return; } NSString *prefixStr = [frame _stringForRange:prefix]; NSString *trimmedPrefix = [prefixStr stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; if ([trimmedPrefix length] == 0) { NSBeep(); return; } prefixLength = [prefixStr length]; // Lookup matches [_completions release]; _completions = [checker completionsForPartialWordRange:NSMakeRange(0, [prefixStr length]) inString:prefixStr language:nil inSpellDocumentWithTag:[_view spellCheckerDocumentTag]]; [_completions retain]; if (!_completions || [_completions count] == 0) { NSBeep(); } else if ([_completions count] == 1) { [self _insertMatch:[_completions objectAtIndex:0]]; } else { ASSERT(!_originalString); // this should only be set IFF we have a popup window _originalString = [[frame _stringForRange:selection] retain]; [self _buildUI]; NSRect wordRect = [frame _caretRectAtNode:[wholeWord startContainer] offset:[wholeWord startOffset] affinity:NSSelectionAffinityDownstream]; // +1 to be under the word, not the caret // FIXME - 3769652 - Wrong positioning for right to left languages. We should line up the upper // right corner with the caret instead of upper left, and the +1 would be a -1. NSPoint wordLowerLeft = { NSMinX(wordRect)+1, NSMaxY(wordRect) }; [self _placePopupWindow:wordLowerLeft]; } } else { [self endRevertingChange:YES moveLeft:NO]; } } - (void)endRevertingChange:(BOOL)revertChange moveLeft:(BOOL)goLeft { if (_popupWindow) { // tear down UI [[_view window] removeChildWindow:_popupWindow]; [_popupWindow orderOut:self]; // Must autorelease because event tracking code may be on the stack touching UI [_popupWindow autorelease]; _popupWindow = nil; if (revertChange) { WebFrame *frame = [_htmlView _frame]; [frame _replaceSelectionWithText:_originalString selectReplacement:YES smartReplace:NO]; } else if ([_htmlView _hasSelection]) { if (goLeft) [_htmlView moveBackward:nil]; else [_htmlView moveForward:nil]; } [_originalString release]; _originalString = nil; } // else there is no state to abort if the window was not up } - (BOOL)popupWindowIsOpen { return _popupWindow != nil; } // WebHTMLView gives us a crack at key events it sees. Return whether we consumed the event. // The features for the various keys mimic NSTextView. - (BOOL)filterKeyDown:(NSEvent *)event { if (!_popupWindow) return NO; NSString *string = [event charactersIgnoringModifiers]; if (![string length]) return NO; unichar c = [string characterAtIndex:0]; if (c == NSUpArrowFunctionKey) { int selectedRow = [_tableView selectedRow]; if (0 < selectedRow) { [_tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:selectedRow - 1] byExtendingSelection:NO]; [_tableView scrollRowToVisible:selectedRow - 1]; } return YES; } if (c == NSDownArrowFunctionKey) { int selectedRow = [_tableView selectedRow]; if (selectedRow < (int)[_completions count] - 1) { [_tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:selectedRow + 1] byExtendingSelection:NO]; [_tableView scrollRowToVisible:selectedRow + 1]; } return YES; } if (c == NSRightArrowFunctionKey || c == '\n' || c == '\r' || c == '\t') { // FIXME: What about backtab? [self endRevertingChange:NO moveLeft:NO]; return YES; } if (c == NSLeftArrowFunctionKey) { [self endRevertingChange:NO moveLeft:YES]; return YES; } if (c == 0x1B || c == NSF5FunctionKey) { // FIXME: F5? [self endRevertingChange:YES moveLeft:NO]; return YES; } if (c == ' ' || c >= 0x21 && c <= 0x2F || c >= 0x3A && c <= 0x40 || c >= 0x5B && c <= 0x60 || c >= 0x7B && c <= 0x7D) { // FIXME: Is the above list of keys really definitive? // Originally this code called ispunct; aren't there other punctuation keys on international keyboards? [self endRevertingChange:NO moveLeft:NO]; return NO; // let the char get inserted } return NO; } - (void)_reflectSelection { int selectedRow = [_tableView selectedRow]; ASSERT(selectedRow >= 0 && selectedRow < (int)[_completions count]); [self _insertMatch:[_completions objectAtIndex:selectedRow]]; } - (void)tableAction:(id)sender { [self _reflectSelection]; [self endRevertingChange:NO moveLeft:NO]; } - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { return [_completions count]; } - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { return [_completions objectAtIndex:row]; } - (void)tableViewSelectionDidChange:(NSNotification *)notification { [self _reflectSelection]; } @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebDynamicScrollBarsView.h�������������������������������������������������������0000644�0001750�0001750�00000005013�11256475154�017475� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ // This is a Private header (containing SPI), despite the fact that its name // does not contain the word Private. // FIXME: Does Safari really need to use this any more? AppKit added autohidesScrollers // in Panther, and that was the original reason we needed this view in Safari. // FIXME: <rdar://problem/5898985> Mail currently expects this header to define WebCoreScrollbarAlwaysOn. extern const int WebCoreScrollbarAlwaysOn; @interface WebDynamicScrollBarsView : NSScrollView { int hScroll; // FIXME: Should be WebCore::ScrollbarMode if this was an ObjC++ header. int vScroll; // Ditto. BOOL hScrollModeLocked; BOOL vScrollModeLocked; BOOL suppressLayout; BOOL suppressScrollers; BOOL inUpdateScrollers; BOOL verticallyPinnedByPreviousWheelEvent; BOOL horizontallyPinnedByPreviousWheelEvent; unsigned inUpdateScrollersLayoutPass; } - (void)setAllowsHorizontalScrolling:(BOOL)flag; // This method is used by Safari, so it cannot be removed. @end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebViewInternal.h����������������������������������������������������������������0000644�0001750�0001750�00000015333�11240351066�015670� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ // This header contains WebView declarations that can be used anywhere in WebKit, but are neither SPI nor API. #import "WebPreferences.h" #import "WebViewPrivate.h" #import "WebTypesInternal.h" #ifdef __cplusplus #import <WebCore/WebCoreKeyboardUIMode.h> namespace WebCore { class String; class Frame; class KURL; class KeyboardEvent; class Page; } #endif @class WebBasePluginPackage; @class WebDownload; @class WebNodeHighlight; #ifdef __cplusplus @interface WebView (WebViewEditingExtras) - (BOOL)_interceptEditingKeyEvent:(WebCore::KeyboardEvent*)event shouldSaveCommand:(BOOL)shouldSave; - (BOOL)_shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag; @end @interface WebView (AllWebViews) + (void)_makeAllWebViewsPerformSelector:(SEL)selector; - (void)_removeFromAllWebViewsSet; - (void)_addToAllWebViewsSet; @end @interface WebView (WebViewInternal) - (WebCore::Frame*)_mainCoreFrame; - (WebCore::String)_userAgentForURL:(const WebCore::KURL&)url; - (WebCore::KeyboardUIMode)_keyboardUIMode; - (BOOL)_becomingFirstResponderFromOutside; #if ENABLE(ICONDATABASE) - (void)_registerForIconNotification:(BOOL)listen; - (void)_dispatchDidReceiveIconFromWebFrame:(WebFrame *)webFrame; #endif - (void)_setMouseDownEvent:(NSEvent *)event; - (void)_cancelUpdateMouseoverTimer; - (void)_stopAutoscrollTimer; - (void)_updateMouseoverWithFakeEvent; - (void)_selectionChanged; - (void)_setToolTip:(NSString *)toolTip; #if USE(ACCELERATED_COMPOSITING) - (BOOL)_needsOneShotDrawingSynchronization; - (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization; - (void)_startedAcceleratedCompositingForFrame:(WebFrame*)webFrame; - (void)_stoppedAcceleratedCompositingForFrame:(WebFrame*)webFrame; - (void)_scheduleCompositingLayerSync; #endif @end #endif // FIXME: Temporary way to expose methods that are in the wrong category inside WebView. @interface WebView (WebViewOtherInternal) + (void)_setCacheModel:(WebCacheModel)cacheModel; + (WebCacheModel)_cacheModel; #ifdef __cplusplus - (WebCore::Page*)page; #endif - (NSMenu *)_menuForElement:(NSDictionary *)element defaultItems:(NSArray *)items; - (id)_UIDelegateForwarder; - (id)_editingDelegateForwarder; - (id)_policyDelegateForwarder; - (void)_pushPerformingProgrammaticFocus; - (void)_popPerformingProgrammaticFocus; - (void)_didStartProvisionalLoadForFrame:(WebFrame *)frame; + (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType; - (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType; + (NSString *)_MIMETypeForFile:(NSString *)path; - (WebDownload *)_downloadURL:(NSURL *)URL; + (NSString *)_generatedMIMETypeForURLScheme:(NSString *)URLScheme; + (BOOL)_representationExistsForURLScheme:(NSString *)URLScheme; - (BOOL)_isPerformingProgrammaticFocus; - (void)_mouseDidMoveOverElement:(NSDictionary *)dictionary modifierFlags:(NSUInteger)modifierFlags; - (WebView *)_openNewWindowWithRequest:(NSURLRequest *)request; - (void)_writeImageForElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard; - (void)_writeLinkElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard; - (void)_openFrameInNewWindowFromMenu:(NSMenuItem *)sender; - (void)_searchWithGoogleFromMenu:(id)sender; - (void)_searchWithSpotlightFromMenu:(id)sender; - (void)_progressCompleted:(WebFrame *)frame; - (void)_didCommitLoadForFrame:(WebFrame *)frame; - (void)_didFinishLoadForFrame:(WebFrame *)frame; - (void)_didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; - (void)_didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; - (void)_willChangeValueForKey:(NSString *)key; - (void)_didChangeValueForKey:(NSString *)key; - (WebBasePluginPackage *)_pluginForMIMEType:(NSString *)MIMEType; - (WebBasePluginPackage *)_pluginForExtension:(NSString *)extension; - (void)setCurrentNodeHighlight:(WebNodeHighlight *)nodeHighlight; - (WebNodeHighlight *)currentNodeHighlight; - (void)addPluginInstanceView:(NSView *)view; - (void)removePluginInstanceView:(NSView *)view; - (void)removePluginInstanceViewsFor:(WebFrame*)webFrame; - (void)_addObject:(id)object forIdentifier:(unsigned long)identifier; - (id)_objectForIdentifier:(unsigned long)identifier; - (void)_removeObjectForIdentifier:(unsigned long)identifier; - (void)_setZoomMultiplier:(float)multiplier isTextOnly:(BOOL)isTextOnly; - (float)_zoomMultiplier:(BOOL)isTextOnly; - (float)_realZoomMultiplier; - (BOOL)_realZoomMultiplierIsTextOnly; - (BOOL)_canZoomOut:(BOOL)isTextOnly; - (BOOL)_canZoomIn:(BOOL)isTextOnly; - (IBAction)_zoomOut:(id)sender isTextOnly:(BOOL)isTextOnly; - (IBAction)_zoomIn:(id)sender isTextOnly:(BOOL)isTextOnly; - (BOOL)_canResetZoom:(BOOL)isTextOnly; - (IBAction)_resetZoom:(id)sender isTextOnly:(BOOL)isTextOnly; - (BOOL)_mustDrawUnionedRect:(NSRect)rect singleRects:(const NSRect *)rects count:(NSInteger)count; + (BOOL)_canHandleRequest:(NSURLRequest *)request forMainFrame:(BOOL)forMainFrame; - (void)_setInsertionPasteboard:(NSPasteboard *)pasteboard; @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebUIDelegate.h������������������������������������������������������������������0000644�0001750�0001750�00000064440�11150764637�015250� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003, 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> #import <Foundation/NSURLRequest.h> #import <JavaScriptCore/WebKitAvailability.h> #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 #define WebNSUInteger unsigned int #else #define WebNSUInteger NSUInteger #endif /*! @enum WebMenuItemTag @discussion Each menu item in the default menu items array passed in contextMenuItemsForElement:defaultMenuItems: has its tag set to one of the WebMenuItemTags. When iterating through the default menu items array, use the tag to differentiate between them. */ enum { WebMenuItemTagOpenLinkInNewWindow=1, WebMenuItemTagDownloadLinkToDisk, WebMenuItemTagCopyLinkToClipboard, WebMenuItemTagOpenImageInNewWindow, WebMenuItemTagDownloadImageToDisk, WebMenuItemTagCopyImageToClipboard, WebMenuItemTagOpenFrameInNewWindow, WebMenuItemTagCopy, WebMenuItemTagGoBack, WebMenuItemTagGoForward, WebMenuItemTagStop, WebMenuItemTagReload, WebMenuItemTagCut, WebMenuItemTagPaste, WebMenuItemTagSpellingGuess, WebMenuItemTagNoGuessesFound, WebMenuItemTagIgnoreSpelling, WebMenuItemTagLearnSpelling, WebMenuItemTagOther, WebMenuItemTagSearchInSpotlight, WebMenuItemTagSearchWeb, WebMenuItemTagLookUpInDictionary, WebMenuItemTagOpenWithDefaultApplication, WebMenuItemPDFActualSize, WebMenuItemPDFZoomIn, WebMenuItemPDFZoomOut, WebMenuItemPDFAutoSize, WebMenuItemPDFSinglePage, WebMenuItemPDFFacingPages, WebMenuItemPDFContinuous, WebMenuItemPDFNextPage, WebMenuItemPDFPreviousPage, }; /*! @enum WebDragDestinationAction @abstract Actions that the destination of a drag can perform. @constant WebDragDestinationActionNone No action @constant WebDragDestinationActionDHTML Allows DHTML (such as JavaScript) to handle the drag @constant WebDragDestinationActionEdit Allows editable documents to be edited from the drag @constant WebDragDestinationActionLoad Allows a location change from the drag @constant WebDragDestinationActionAny Allows any of the above to occur */ typedef enum { WebDragDestinationActionNone = 0, WebDragDestinationActionDHTML = 1, WebDragDestinationActionEdit = 2, WebDragDestinationActionLoad = 4, WebDragDestinationActionAny = UINT_MAX } WebDragDestinationAction; /*! @enum WebDragSourceAction @abstract Actions that the source of a drag can perform. @constant WebDragSourceActionNone No action @constant WebDragSourceActionDHTML Allows DHTML (such as JavaScript) to start a drag @constant WebDragSourceActionImage Allows an image drag to occur @constant WebDragSourceActionLink Allows a link drag to occur @constant WebDragSourceActionSelection Allows a selection drag to occur @constant WebDragSourceActionAny Allows any of the above to occur */ typedef enum { WebDragSourceActionNone = 0, WebDragSourceActionDHTML = 1, WebDragSourceActionImage = 2, WebDragSourceActionLink = 4, WebDragSourceActionSelection = 8, WebDragSourceActionAny = UINT_MAX } WebDragSourceAction; /*! @protocol WebOpenPanelResultListener @discussion This protocol is used to call back with the results of the file open panel requested by runOpenPanelForFileButtonWithResultListener: */ @protocol WebOpenPanelResultListener <NSObject> /*! @method chooseFilename: @abstract Call this method to return a filename from the file open panel. @param fileName */ - (void)chooseFilename:(NSString *)fileName; /*! @method chooseFilenames: @abstract Call this method to return an array of filenames from the file open panel. @param fileNames */ - (void)chooseFilenames:(NSArray *)fileNames WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0); /*! @method cancel @abstract Call this method to indicate that the file open panel was cancelled. */ - (void)cancel; @end @class WebView; /*! @category WebUIDelegate @discussion A class that implements WebUIDelegate provides window-related methods that may be used by Javascript, plugins and other aspects of web pages. These methods are used to open new windows and control aspects of existing windows. */ @interface NSObject (WebUIDelegate) /*! @method webView:createWebViewWithRequest: @abstract Create a new window and begin to load the specified request. @discussion The newly created window is hidden, and the window operations delegate on the new WebViews will get a webViewShow: call. @param sender The WebView sending the delegate method. @param request The request to load. @result The WebView for the new window. */ - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request; /*! @method webViewShow: @param sender The WebView sending the delegate method. @abstract Show the window that contains the top level view of the WebView, ordering it frontmost. @discussion This will only be called just after createWindowWithRequest: is used to create a new window. */ - (void)webViewShow:(WebView *)sender; /*! @method webView:createWebViewModalDialogWithRequest: @abstract Create a new window and begin to load the specified request. @discussion The newly created window is hidden, and the window operations delegate on the new WebViews will get a webViewShow: call. @param sender The WebView sending the delegate method. @param request The request to load. @result The WebView for the new window. */ - (WebView *)webView:(WebView *)sender createWebViewModalDialogWithRequest:(NSURLRequest *)request; /*! @method webViewRunModal: @param sender The WebView sending the delegate method. @abstract Show the window that contains the top level view of the WebView, ordering it frontmost. The window should be run modal in the application. @discussion This will only be called just after createWebViewModalDialogWithRequest: is used to create a new window. */ - (void)webViewRunModal:(WebView *)sender; /*! @method webViewClose: @abstract Close the current window. @param sender The WebView sending the delegate method. @discussion Clients showing multiple views in one window may choose to close only the one corresponding to this WebView. Other clients may choose to ignore this method entirely. */ - (void)webViewClose:(WebView *)sender; /*! @method webViewFocus: @abstract Focus the current window (i.e. makeKeyAndOrderFront:). @param The WebView sending the delegate method. @discussion Clients showing multiple views in one window may want to also do something to focus the one corresponding to this WebView. */ - (void)webViewFocus:(WebView *)sender; /*! @method webViewUnfocus: @abstract Unfocus the current window. @param sender The WebView sending the delegate method. @discussion Clients showing multiple views in one window may want to also do something to unfocus the one corresponding to this WebView. */ - (void)webViewUnfocus:(WebView *)sender; /*! @method webViewFirstResponder: @abstract Get the first responder for this window. @param sender The WebView sending the delegate method. @discussion This method should return the focused control in the WebView's view, if any. If the view is out of the window hierarchy, this might return something than calling firstResponder on the real NSWindow would. It's OK to return either nil or the real first responder if some control not in the window has focus. */ - (NSResponder *)webViewFirstResponder:(WebView *)sender; /*! @method webView:makeFirstResponder: @abstract Set the first responder for this window. @param sender The WebView sending the delegate method. @param responder The responder to make first (will always be a view) @discussion responder will always be a view that is in the view subhierarchy of the top-level web view for this WebView. If the WebView's top level view is currently out of the view hierarchy, it may be desirable to save the first responder elsewhere, or possibly ignore this call. */ - (void)webView:(WebView *)sender makeFirstResponder:(NSResponder *)responder; /*! @method webView:setStatusText: @abstract Set the window's status display, if any, to the specified string. @param sender The WebView sending the delegate method. @param text The status text to set */ - (void)webView:(WebView *)sender setStatusText:(NSString *)text; /*! @method webViewStatusText: @abstract Get the currently displayed status text. @param sender The WebView sending the delegate method. @result The status text */ - (NSString *)webViewStatusText:(WebView *)sender; /*! @method webViewAreToolbarsVisible: @abstract Determine whether the window's toolbars are currently visible @param sender The WebView sending the delegate method. @discussion This method should return YES if the window has any toolbars that are currently on, besides the status bar. If the app has more than one toolbar per window, for example a regular command toolbar and a favorites bar, it should return YES from this method if at least one is on. @result YES if at least one toolbar is visible, otherwise NO. */ - (BOOL)webViewAreToolbarsVisible:(WebView *)sender; /*! @method webView:setToolbarsVisible: @param sender The WebView sending the delegate method. @abstract Set whether the window's toolbars are currently visible. @param visible New value for toolbar visibility @discussion Setting this to YES should turn on all toolbars (except for a possible status bar). Setting it to NO should turn off all toolbars (with the same exception). */ - (void)webView:(WebView *)sender setToolbarsVisible:(BOOL)visible; /*! @method webViewIsStatusBarVisible: @abstract Determine whether the status bar is visible. @param sender The WebView sending the delegate method. @result YES if the status bar is visible, otherwise NO. */ - (BOOL)webViewIsStatusBarVisible:(WebView *)sender; /*! @method webView:setStatusBarVisible: @abstract Set whether the status bar is currently visible. @param visible The new visibility value @discussion Setting this to YES should show the status bar, setting it to NO should hide it. */ - (void)webView:(WebView *)sender setStatusBarVisible:(BOOL)visible; /*! @method webViewIsResizable: @abstract Determine whether the window is resizable or not. @param sender The WebView sending the delegate method. @result YES if resizable, NO if not. @discussion If there are multiple views in the same window, they have have their own separate resize controls and this may need to be handled specially. */ - (BOOL)webViewIsResizable:(WebView *)sender; /*! @method webView:setResizable: @abstract Set the window to resizable or not @param sender The WebView sending the delegate method. @param resizable YES if the window should be made resizable, NO if not. @discussion If there are multiple views in the same window, they have have their own separate resize controls and this may need to be handled specially. */ - (void)webView:(WebView *)sender setResizable:(BOOL)resizable; /*! @method webView:setFrame: @abstract Set the window's frame rect @param sender The WebView sending the delegate method. @param frame The new window frame size @discussion Even though a caller could set the frame directly using the NSWindow, this method is provided so implementors of this protocol can do special things on programmatic move/resize, like avoiding autosaving of the size. */ - (void)webView:(WebView *)sender setFrame:(NSRect)frame; /*! @method webViewFrame: @param sender The WebView sending the delegate method. @abstract REturn the window's frame rect @discussion */ - (NSRect)webViewFrame:(WebView *)sender; /*! @method webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame: @abstract Display a JavaScript alert panel. @param sender The WebView sending the delegate method. @param message The message to display. @param frame The WebFrame whose JavaScript initiated this call. @discussion Clients should visually indicate that this panel comes from JavaScript initiated by the specified frame. The panel should have a single OK button. */ - (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame; /*! @method webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame: @abstract Display a JavaScript confirm panel. @param sender The WebView sending the delegate method. @param message The message to display. @param frame The WebFrame whose JavaScript initiated this call. @result YES if the user hit OK, NO if the user chose Cancel. @discussion Clients should visually indicate that this panel comes from JavaScript initiated by the specified frame. The panel should have two buttons, e.g. "OK" and "Cancel". */ - (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame; /*! @method webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame: @abstract Display a JavaScript text input panel. @param sender The WebView sending the delegate method. @param message The message to display. @param defaultText The initial text for the text entry area. @param frame The WebFrame whose JavaScript initiated this call. @result The typed text if the user hit OK, otherwise nil. @discussion Clients should visually indicate that this panel comes from JavaScript initiated by the specified frame. The panel should have two buttons, e.g. "OK" and "Cancel", and an area to type text. */ - (NSString *)webView:(WebView *)sender runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText initiatedByFrame:(WebFrame *)frame; /*! @method webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame: @abstract Display a confirm panel by an "before unload" event handler. @param sender The WebView sending the delegate method. @param message The message to display. @param frame The WebFrame whose JavaScript initiated this call. @result YES if the user hit OK, NO if the user chose Cancel. @discussion Clients should include a message in addition to the one supplied by the web page that indicates. The panel should have two buttons, e.g. "OK" and "Cancel". */ - (BOOL)webView:(WebView *)sender runBeforeUnloadConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame; /*! @method webView:runOpenPanelForFileButtonWithResultListener: @abstract Display a file open panel for a file input control. @param sender The WebView sending the delegate method. @param resultListener The object to call back with the results. @discussion This method is passed a callback object instead of giving a return value so that it can be handled with a sheet. */ - (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener; /*! @method webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles @abstract Display a file open panel for a file input control that may allow multiple files to be selected. @param sender The WebView sending the delegate method. @param resultListener The object to call back with the results. @param allowMultipleFiles YES if the open panel should allow myltiple files to be selected, NO if not. @discussion This method is passed a callback object instead of giving a return value so that it can be handled with a sheet. */ - (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener allowMultipleFiles:(BOOL)allowMultipleFiles WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0); /*! @method webView:mouseDidMoveOverElement:modifierFlags: @abstract Update the window's feedback for mousing over links to reflect a new item the mouse is over or new modifier flags. @param sender The WebView sending the delegate method. @param elementInformation Dictionary that describes the element that the mouse is over, or nil. @param modifierFlags The modifier flags as in NSEvent. */ - (void)webView:(WebView *)sender mouseDidMoveOverElement:(NSDictionary *)elementInformation modifierFlags:(WebNSUInteger)modifierFlags; /*! @method webView:contextMenuItemsForElement:defaultMenuItems: @abstract Returns the menu items to display in an element's contextual menu. @param sender The WebView sending the delegate method. @param element A dictionary representation of the clicked element. @param defaultMenuItems An array of default NSMenuItems to include in all contextual menus. @result An array of NSMenuItems to include in the contextual menu. */ - (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems; /*! @method webView:validateUserInterfaceItem:defaultValidation: @abstract Controls UI validation @param webView The WebView sending the delegate method @param item The user interface item being validated @pararm defaultValidation Whether or not the WebView thinks the item is valid @discussion This method allows the UI delegate to control WebView's validation of user interface items. See WebView.h to see the methods to that WebView can currently validate. See NSUserInterfaceValidations and NSValidatedUserInterfaceItem for information about UI validation. */ - (BOOL)webView:(WebView *)webView validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item defaultValidation:(BOOL)defaultValidation; /*! @method webView:shouldPerformAction:fromSender: @abstract Controls actions @param webView The WebView sending the delegate method @param action The action being sent @param sender The sender of the action @discussion This method allows the UI delegate to control WebView's behavior when an action is being sent. For example, if the action is copy:, the delegate can return YES to allow WebView to perform its default copy behavior or return NO and perform copy: in some other way. See WebView.h to see the actions that WebView can perform. */ - (BOOL)webView:(WebView *)webView shouldPerformAction:(SEL)action fromSender:(id)sender; /*! @method webView:dragDestinationActionMaskForDraggingInfo: @abstract Controls behavior when dragging to a WebView @param webView The WebView sending the delegate method @param draggingInfo The dragging info of the drag @discussion This method is called periodically as something is dragged over a WebView. The UI delegate can return a mask indicating which drag destination actions can occur, WebDragDestinationActionAny to allow any kind of action or WebDragDestinationActionNone to not accept the drag. */ - (WebNSUInteger)webView:(WebView *)webView dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo; /*! @method webView:willPerformDragDestinationAction:forDraggingInfo: @abstract Informs that WebView will perform a drag destination action @param webView The WebView sending the delegate method @param action The drag destination action @param draggingInfo The dragging info of the drag @discussion This method is called after the last call to webView:dragDestinationActionMaskForDraggingInfo: after something is dropped on a WebView. This method informs the UI delegate of the drag destination action that WebView will perform. */ - (void)webView:(WebView *)webView willPerformDragDestinationAction:(WebDragDestinationAction)action forDraggingInfo:(id <NSDraggingInfo>)draggingInfo; /*! @method webView:dragSourceActionMaskForPoint: @abstract Controls behavior when dragging from a WebView @param webView The WebView sending the delegate method @param point The point where the drag started in the coordinates of the WebView @discussion This method is called after the user has begun a drag from a WebView. The UI delegate can return a mask indicating which drag source actions can occur, WebDragSourceActionAny to allow any kind of action or WebDragSourceActionNone to not begin a drag. */ - (WebNSUInteger)webView:(WebView *)webView dragSourceActionMaskForPoint:(NSPoint)point; /*! @method webView:willPerformDragSourceAction:fromPoint:withPasteboard: @abstract Informs that a drag a has begun from a WebView @param webView The WebView sending the delegate method @param action The drag source action @param point The point where the drag started in the coordinates of the WebView @param pasteboard The drag pasteboard @discussion This method is called after webView:dragSourceActionMaskForPoint: is called after the user has begun a drag from a WebView. This method informs the UI delegate of the drag source action that will be performed and gives the delegate an opportunity to modify the contents of the dragging pasteboard. */ - (void)webView:(WebView *)webView willPerformDragSourceAction:(WebDragSourceAction)action fromPoint:(NSPoint)point withPasteboard:(NSPasteboard *)pasteboard; /*! @method webView:printFrameView: @abstract Informs that a WebFrameView needs to be printed @param webView The WebView sending the delegate method @param frameView The WebFrameView needing to be printed @discussion This method is called when a script or user requests the page to be printed. In this method the delegate can prepare the WebFrameView to be printed. Some content that WebKit displays can be printed directly by the WebFrameView, other content will need to be handled by the delegate. To determine if the WebFrameView can handle printing the delegate should check WebFrameView's documentViewShouldHandlePrint, if YES then the delegate can call printDocumentView on the WebFrameView. Otherwise the delegate will need to request a NSPrintOperation from the WebFrameView's printOperationWithPrintInfo to handle the printing. */ - (void)webView:(WebView *)sender printFrameView:(WebFrameView *)frameView; /*! @method webViewHeaderHeight: @param webView The WebView sending the delegate method @abstract Reserve a height for the printed page header. @result The height to reserve for the printed page header, return 0.0 to not reserve any space for a header. @discussion The height returned will be used to calculate the rect passed to webView:drawHeaderInRect:. */ - (float)webViewHeaderHeight:(WebView *)sender; /*! @method webViewFooterHeight: @param webView The WebView sending the delegate method @abstract Reserve a height for the printed page footer. @result The height to reserve for the printed page footer, return 0.0 to not reserve any space for a footer. @discussion The height returned will be used to calculate the rect passed to webView:drawFooterInRect:. */ - (float)webViewFooterHeight:(WebView *)sender; /*! @method webView:drawHeaderInRect: @param webView The WebView sending the delegate method @param rect The NSRect reserved for the header of the page @abstract The delegate should draw a header for the sender in the supplied rect. */ - (void)webView:(WebView *)sender drawHeaderInRect:(NSRect)rect; /*! @method webView:drawFooterInRect: @param webView The WebView sending the delegate method @param rect The NSRect reserved for the footer of the page @abstract The delegate should draw a footer for the sender in the supplied rect. */ - (void)webView:(WebView *)sender drawFooterInRect:(NSRect)rect; // The following delegate methods are deprecated in favor of the ones above that specify // the WebFrame whose JavaScript initiated this call. - (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0); - (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0); - (NSString *)webView:(WebView *)sender runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0); // The following delegate methods are deprecated. Content rect calculations are now done automatically. - (void)webView:(WebView *)sender setContentRect:(NSRect)frame WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0); - (NSRect)webViewContentRect:(WebView *)sender WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0); @end #undef WebNSUInteger ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebDocumentPrivate.h�������������������������������������������������������������0000644�0001750�0001750�00000007410�10761765653�016411� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebDocument.h> #import <WebKit/WebHTMLView.h> @class DOMDocument; @protocol WebDocumentImage <NSObject> - (NSImage *)image; @end // This method is deprecated as it now lives on WebFrame. @protocol WebDocumentDOM <NSObject> - (DOMDocument *)DOMDocument; - (BOOL)canSaveAsWebArchive; @end @protocol WebDocumentSelection <WebDocumentText> - (NSArray *)pasteboardTypesForSelection; - (void)writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard; // Array of rects that tightly enclose the selected text, in coordinates of selectinView. - (NSArray *)selectionTextRects; // Rect tightly enclosing the entire selected area, in coordinates of selectionView. - (NSRect)selectionRect; // NSImage of the portion of the selection that's in view. This does not draw backgrounds. // The text is all black according to the parameter. - (NSImage *)selectionImageForcingBlackText:(BOOL)forceBlackText; // Rect tightly enclosing the entire selected area, in coordinates of selectionView. // NOTE: This method is equivalent to selectionRect and shouldn't be used; use selectionRect instead. - (NSRect)selectionImageRect; // View that draws the selection and can be made first responder. Often this is self but it could be // a nested view, as for example in the case of WebPDFView. - (NSView *)selectionView; @end @protocol WebDocumentIncrementalSearching /*! @method searchFor:direction:caseSensitive:wrap:startInSelection: @abstract Searches a document view for a string and highlights the string if it is found. @param string The string to search for. @param forward YES to search forward, NO to seach backwards. @param caseFlag YES to for case-sensitive search, NO for case-insensitive search. @param wrapFlag YES to wrap around, NO to avoid wrapping. @param startInSelection YES to begin search in the selected text (useful for incremental searching), NO to begin search after the selected text. @result YES if found, NO if not found. */ - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag startInSelection:(BOOL)startInSelection; @end @interface WebHTMLView (WebDocumentPrivateProtocols) <WebDocumentSelection, WebDocumentIncrementalSearching> @end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebDocumentInternal.h������������������������������������������������������������0000644�0001750�0001750�00000006016�10766021001�016525� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebDocumentPrivate.h> #import <WebKit/WebHTMLView.h> #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 #define WebNSUInteger unsigned int #else #define WebNSUInteger NSUInteger #endif /*! @protocol _WebDocumentZooming @discussion Optional protocol for a view that wants to handle its own zoom. */ @protocol _WebDocumentZooming <NSObject> // Methods to perform the actual commands - (IBAction)_zoomOut:(id)sender; - (IBAction)_zoomIn:(id)sender; - (IBAction)_resetZoom:(id)sender; // Whether or not the commands can be executed. - (BOOL)_canZoomOut; - (BOOL)_canZoomIn; - (BOOL)_canResetZoom; @end @protocol WebDocumentElement <NSObject> - (NSDictionary *)elementAtPoint:(NSPoint)point; - (NSDictionary *)elementAtPoint:(NSPoint)point allowShadowContent:(BOOL)allow; @end @protocol WebMultipleTextMatches <NSObject> - (void)setMarkedTextMatchesAreHighlighted:(BOOL)newValue; - (BOOL)markedTextMatchesAreHighlighted; - (WebNSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag limit:(WebNSUInteger)limit; - (void)unmarkAllTextMatches; - (NSArray *)rectsForTextMatches; @end /* Used to save and restore state in the view, typically when going back/forward */ @protocol _WebDocumentViewState <NSObject> - (NSPoint)scrollPoint; - (void)setScrollPoint:(NSPoint)p; - (id)viewState; - (void)setViewState:(id)statePList; @end @interface WebHTMLView (WebDocumentInternalProtocols) <WebDocumentElement, WebMultipleTextMatches> @end #undef WebNSUInteger ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebEditingDelegate.h�������������������������������������������������������������0000644�0001750�0001750�00000006354�10560203415�016300� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004, 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> @class DOMCSSStyleDeclaration; @class DOMRange; @class WebView; typedef enum { WebViewInsertActionTyped, WebViewInsertActionPasted, WebViewInsertActionDropped, } WebViewInsertAction; @interface NSObject (WebViewEditingDelegate) - (BOOL)webView:(WebView *)webView shouldBeginEditingInDOMRange:(DOMRange *)range; - (BOOL)webView:(WebView *)webView shouldEndEditingInDOMRange:(DOMRange *)range; - (BOOL)webView:(WebView *)webView shouldInsertNode:(DOMNode *)node replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action; - (BOOL)webView:(WebView *)webView shouldInsertText:(NSString *)text replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action; - (BOOL)webView:(WebView *)webView shouldDeleteDOMRange:(DOMRange *)range; - (BOOL)webView:(WebView *)webView shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag; - (BOOL)webView:(WebView *)webView shouldApplyStyle:(DOMCSSStyleDeclaration *)style toElementsInDOMRange:(DOMRange *)range; - (BOOL)webView:(WebView *)webView shouldChangeTypingStyle:(DOMCSSStyleDeclaration *)currentStyle toStyle:(DOMCSSStyleDeclaration *)proposedStyle; - (BOOL)webView:(WebView *)webView doCommandBySelector:(SEL)selector; - (void)webViewDidBeginEditing:(NSNotification *)notification; - (void)webViewDidChange:(NSNotification *)notification; - (void)webViewDidEndEditing:(NSNotification *)notification; - (void)webViewDidChangeTypingStyle:(NSNotification *)notification; - (void)webViewDidChangeSelection:(NSNotification *)notification; - (NSUndoManager *)undoManagerForWebView:(WebView *)webView; @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebFrameLoadDelegatePrivate.h����������������������������������������������������0000644�0001750�0001750�00000003466�11250233433�020103� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Adam Barth. 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebFrameLoadDelegate.h> @class WebSecurityOrigin; @interface NSObject (WebFrameLoadDelegatePrivate) - (void)webViewDidDisplayInsecureContent:(WebView *)webView; - (void)webView:(WebView *)webView didRunInsecureContent:(WebSecurityOrigin *)origin; @end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebPDFRepresentation.mm����������������������������������������������������������0000644�0001750�0001750�00000012507�11255745761�017016� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebPDFRepresentation.h" #import "WebDataSourcePrivate.h" #import "WebFrame.h" #import "WebJSPDFDoc.h" #import "WebNSObjectExtras.h" #import "WebPDFDocumentExtras.h" #import "WebPDFView.h" #import "WebTypesInternal.h" #import <JavaScriptCore/Assertions.h> #import <JavaScriptCore/JSContextRef.h> #import <JavaScriptCore/JSStringRef.h> #import <JavaScriptCore/JSStringRefCF.h> @implementation WebPDFRepresentation + (NSArray *)postScriptMIMETypes { return [NSArray arrayWithObjects: @"application/postscript", nil]; } + (NSArray *)supportedMIMETypes { return [[[self class] postScriptMIMETypes] arrayByAddingObjectsFromArray: [NSArray arrayWithObjects: @"text/pdf", @"application/pdf", nil]]; } + (Class)PDFDocumentClass { static Class PDFDocumentClass = nil; if (PDFDocumentClass == nil) { PDFDocumentClass = [[WebPDFView PDFKitBundle] classNamed:@"PDFDocument"]; if (PDFDocumentClass == nil) { LOG_ERROR("Couldn't find PDFDocument class in PDFKit.framework"); } } return PDFDocumentClass; } + (void)initialize { if (self != [WebPDFRepresentation class]) return; Class pdfDocumentClass = [self PDFDocumentClass]; if (pdfDocumentClass) addWebPDFDocumentExtras(pdfDocumentClass); } - (void)setDataSource:(WebDataSource *)dataSource; { } - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource; { } - (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource; { } - (NSData *)convertPostScriptDataSourceToPDF:(NSData *)data { // Convert PostScript to PDF using Quartz 2D API // http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_ps_convert/chapter_16_section_1.html CGPSConverterCallbacks callbacks = { 0, 0, 0, 0, 0, 0, 0, 0 }; CGPSConverterRef converter = CGPSConverterCreate(0, &callbacks, 0); ASSERT(converter); CGDataProviderRef provider = CGDataProviderCreateWithCFData((CFDataRef)data); ASSERT(provider); CFMutableDataRef result = CFDataCreateMutable(kCFAllocatorDefault, 0); ASSERT(result); CGDataConsumerRef consumer = CGDataConsumerCreateWithCFData(result); ASSERT(consumer); // Error handled by detecting zero-length 'result' in caller CGPSConverterConvert(converter, provider, consumer, 0); CFRelease(converter); CFRelease(provider); CFRelease(consumer); return WebCFAutorelease(result); } - (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource { NSData *data = [dataSource data]; NSArray *postScriptMIMETypes = [[self class] postScriptMIMETypes]; NSString *mimeType = [dataSource _responseMIMEType]; if ([postScriptMIMETypes containsObject:mimeType]) { data = [self convertPostScriptDataSourceToPDF:data]; if ([data length] == 0) return; } WebPDFView *view = (WebPDFView *)[[[dataSource webFrame] frameView] documentView]; PDFDocument *doc = [[[[self class] PDFDocumentClass] alloc] initWithData:data]; [view setPDFDocument:doc]; NSArray *scripts = [doc _web_allScripts]; [doc release]; doc = nil; NSUInteger scriptCount = [scripts count]; if (!scriptCount) return; JSGlobalContextRef ctx = JSGlobalContextCreate(0); JSObjectRef jsPDFDoc = makeJSPDFDoc(ctx, dataSource); for (NSUInteger i = 0; i < scriptCount; ++i) { JSStringRef script = JSStringCreateWithCFString((CFStringRef)[scripts objectAtIndex:i]); JSEvaluateScript(ctx, script, jsPDFDoc, 0, 0, 0); JSStringRelease(script); } JSGlobalContextRelease(ctx); } - (BOOL)canProvideDocumentSource { return NO; } - (NSString *)documentSource { return nil; } - (NSString *)title { return nil; } @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebResourceLoadDelegate.h��������������������������������������������������������0000644�0001750�0001750�00000022136�10435377273�017317� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003, 2004, 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 #define WebNSInteger int #else #define WebNSInteger NSInteger #endif @class WebView; @class WebDataSource; @class NSURLAuthenticationChallenge; @class NSURLResponse; @class NSURLRequest; /*! @category WebResourceLoadDelegate @discussion Implementors of this protocol will receive messages indicating that a resource is about to be loaded, data has been received for a resource, an error has been received for a resource, and completion of a resource load. Implementors are also given the opportunity to mutate requests before they are sent. The various progress methods of this protocol all receive an identifier as the parameter. This identifier can be used to track messages associated with a single resource. For example, a single resource may generate multiple resource:willSendRequest:redirectResponse:fromDataSource: messages as it's URL is redirected. */ @interface NSObject (WebResourceLoadDelegate) /*! @method webView:identifierForInitialRequest:fromDataSource: @param webView The WebView sending the message. @param request The request about to be sent. @param dataSource The datasource that initiated the load. @discussion An implementor of WebResourceLoadDelegate should provide an identifier that can be used to track the load of a single resource. This identifier will be passed as the first argument for all of the other WebResourceLoadDelegate methods. The identifier is useful to track changes to a resources request, which will be provided by one or more calls to resource:willSendRequest:redirectResponse:fromDataSource:. @result An identifier that will be passed back to the implementor for each callback. The identifier will be retained. */ - (id)webView:(WebView *)sender identifierForInitialRequest:(NSURLRequest *)request fromDataSource:(WebDataSource *)dataSource; /*! @method resource:willSendRequest:redirectResponse:fromDataSource: @discussion This message is sent before a load is initiated. The request may be modified as necessary by the receiver. @param webView The WebView sending the message. @param identifier An identifier that can be used to track the progress of a resource load across multiple call backs. @param request The request about to be sent. @param redirectResponse If the request is being made in response to a redirect we received, the response that conveyed that redirect. @param dataSource The dataSource that initiated the load. @result Returns the request, which may be mutated by the implementor, although typically will be request. */ - (NSURLRequest *)webView:(WebView *)sender resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource; /*! @method webView:resource:didReceiveAuthenticationChallenge:fromDataSource: @abstract Start authentication for the resource, providing a challenge @discussion Call useCredential::, continueWithoutCredential or cancel on the challenge when done. @param challenge The NSURLAuthenticationChallenge to start authentication for @discussion If you do not implement this delegate method, WebKit will handle authentication automatically by prompting with a sheet on the window that the WebView is associated with. */ - (void)webView:(WebView *)sender resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource; /*! @method webView:resource:didCancelAuthenticationChallenge:fromDataSource: @abstract Cancel authentication for a given request @param challenge The NSURLAuthenticationChallenge for which to cancel authentication */ - (void)webView:(WebView *)sender resource:(id)identifier didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource; /*! @method webView:resource:didReceiveResponse:fromDataSource: @abstract This message is sent after a response has been received for this load. @param webView The WebView sending the message. @param identifier An identifier that can be used to track the progress of a resource load across multiple call backs. @param response The response for the request. @param dataSource The dataSource that initiated the load. @discussion In some rare cases, multiple responses may be received for a single load. This occurs with multipart/x-mixed-replace, or "server push". In this case, the client should assume that each new response resets progress so far for the resource back to 0, and should check the new response for the expected content length. */ - (void)webView:(WebView *)sender resource:(id)identifier didReceiveResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)dataSource; /*! @method webView:resource:didReceiveContentLength:fromDataSource: @discussion Multiple of these messages may be sent as data arrives. @param webView The WebView sending the message. @param identifier An identifier that can be used to track the progress of a resource load across multiple call backs. @param length The amount of new data received. This is not the total amount, just the new amount received. @param dataSource The dataSource that initiated the load. */ - (void)webView:(WebView *)sender resource:(id)identifier didReceiveContentLength:(WebNSInteger)length fromDataSource:(WebDataSource *)dataSource; /*! @method webView:resource:didFinishLoadingFromDataSource: @discussion This message is sent after a load has successfully completed. @param webView The WebView sending the message. @param identifier An identifier that can be used to track the progress of a resource load across multiple call backs. @param dataSource The dataSource that initiated the load. */ - (void)webView:(WebView *)sender resource:(id)identifier didFinishLoadingFromDataSource:(WebDataSource *)dataSource; /*! @method webView:resource:didFailLoadingWithError:fromDataSource: @discussion This message is sent after a load has failed to load due to an error. @param webView The WebView sending the message. @param identifier An identifier that can be used to track the progress of a resource load across multiple call backs. @param error The error associated with this load. @param dataSource The dataSource that initiated the load. */ - (void)webView:(WebView *)sender resource:(id)identifier didFailLoadingWithError:(NSError *)error fromDataSource:(WebDataSource *)dataSource; /*! @method webView:plugInFailedWithError:dataSource: @discussion Called when a plug-in is not found, fails to load or is not available for some reason. @param webView The WebView sending the message. @param error The plug-in error. In the userInfo dictionary of the error, the object for the NSErrorFailingURLKey key is a URL string of the SRC attribute, the object for the WebKitErrorPlugInNameKey key is a string of the plug-in's name, the object for the WebKitErrorPlugInPageURLStringKey key is a URL string of the PLUGINSPAGE attribute and the object for the WebKitErrorMIMETypeKey key is a string of the TYPE attribute. Some, none or all of the mentioned attributes can be present in the userInfo. The error returns nil for userInfo when none are present. @param dataSource The dataSource that contains the plug-in. */ - (void)webView:(WebView *)sender plugInFailedWithError:(NSError *)error dataSource:(WebDataSource *)dataSource; @end #undef WebNSInteger ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebFrameViewInternal.h�����������������������������������������������������������0000644�0001750�0001750�00000004252�11072604200�016633� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebFrameView.h> @class WebDynamicScrollBarsView; @class WebView; @interface WebFrameView (WebInternal) - (WebView *)_webView; - (void)_setDocumentView:(NSView <WebDocumentView> *)view; - (NSView <WebDocumentView> *)_makeDocumentViewForDataSource:(WebDataSource *)dataSource; - (void)_setWebFrame:(WebFrame *)webFrame; - (float)_verticalPageScrollDistance; + (NSMutableDictionary *)_viewTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission; + (Class)_viewClassForMIMEType:(NSString *)MIMEType; + (BOOL)_canShowMIMETypeAsHTML:(NSString *)MIMEType; - (WebDynamicScrollBarsView *)_scrollView; - (void)_install; @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebClipView.h��������������������������������������������������������������������0000644�0001750�0001750�00000003466�10360512352�015006� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <AppKit/AppKit.h> @interface WebClipView : NSClipView { BOOL _haveAdditionalClip; NSRect _additionalClip; } - (void)setAdditionalClip:(NSRect)additionalClip; - (void)resetAdditionalClip; - (BOOL)hasAdditionalClip; - (NSRect)additionalClip; @end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebScriptDebugger.mm�������������������������������������������������������������0000644�0001750�0001750�00000023406�11247044641�016361� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebScriptDebugger.h" #import "WebDelegateImplementationCaching.h" #import "WebFrameInternal.h" #import "WebScriptDebugDelegate.h" #import "WebViewInternal.h" #import <JavaScriptCore/DebuggerCallFrame.h> #import <JavaScriptCore/JSGlobalObject.h> #import <JavaScriptCore/SourceCode.h> #import <WebCore/DOMWindow.h> #import <WebCore/Frame.h> #import <WebCore/JSDOMWindow.h> #import <WebCore/KURL.h> #import <WebCore/ScriptController.h> using namespace JSC; using namespace WebCore; @interface WebScriptCallFrame (WebScriptDebugDelegateInternal) - (WebScriptCallFrame *)_initWithGlobalObject:(WebScriptObject *)globalObj debugger:(WebScriptDebugger *)debugger caller:(WebScriptCallFrame *)caller debuggerCallFrame:(const DebuggerCallFrame&)debuggerCallFrame; - (void)_setDebuggerCallFrame:(const DebuggerCallFrame&)debuggerCallFrame; - (void)_clearDebuggerCallFrame; @end NSString *toNSString(const UString& s) { if (s.isEmpty()) return nil; return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(s.data()) length:s.size()]; } static NSString *toNSString(const SourceCode& s) { if (!s.length()) return nil; return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(s.data()) length:s.length()]; } // convert UString to NSURL static NSURL *toNSURL(const UString& s) { if (s.isEmpty()) return nil; return KURL(ParsedURLString, s); } static WebFrame *toWebFrame(JSGlobalObject* globalObject) { JSDOMWindow* window = static_cast<JSDOMWindow*>(globalObject); return kit(window->impl()->frame()); } WebScriptDebugger::WebScriptDebugger(JSGlobalObject* globalObject) : m_callingDelegate(false) , m_globalObject(globalObject) { attach(globalObject); initGlobalCallFrame(globalObject->globalExec()); } void WebScriptDebugger::initGlobalCallFrame(const DebuggerCallFrame& debuggerCallFrame) { m_callingDelegate = true; WebFrame *webFrame = toWebFrame(debuggerCallFrame.dynamicGlobalObject()); m_topCallFrame.adoptNS([[WebScriptCallFrame alloc] _initWithGlobalObject:core(webFrame)->script()->windowScriptObject() debugger:this caller:m_topCallFrame.get() debuggerCallFrame:debuggerCallFrame]); m_globalCallFrame = m_topCallFrame; WebView *webView = [webFrame webView]; WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView); if (implementations->didEnterCallFrameFunc) CallScriptDebugDelegate(implementations->didEnterCallFrameFunc, webView, @selector(webView:didEnterCallFrame:sourceId:line:forWebFrame:), m_topCallFrame.get(), static_cast<NSInteger>(0), -1, webFrame); m_callingDelegate = false; } // callbacks - relay to delegate void WebScriptDebugger::sourceParsed(ExecState* exec, const SourceCode& source, int errorLine, const UString& errorMsg) { if (m_callingDelegate) return; m_callingDelegate = true; NSString *nsSource = toNSString(source); NSURL *nsURL = toNSURL(source.provider()->url()); WebFrame *webFrame = toWebFrame(exec->dynamicGlobalObject()); WebView *webView = [webFrame webView]; WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView); if (errorLine == -1) { if (implementations->didParseSourceFunc) { if (implementations->didParseSourceExpectsBaseLineNumber) CallScriptDebugDelegate(implementations->didParseSourceFunc, webView, @selector(webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:), nsSource, source.firstLine(), nsURL, source.provider()->asID(), webFrame); else CallScriptDebugDelegate(implementations->didParseSourceFunc, webView, @selector(webView:didParseSource:fromURL:sourceId:forWebFrame:), nsSource, [nsURL absoluteString], source.provider()->asID(), webFrame); } } else { NSString* nsErrorMessage = toNSString(errorMsg); NSDictionary *info = [[NSDictionary alloc] initWithObjectsAndKeys:nsErrorMessage, WebScriptErrorDescriptionKey, [NSNumber numberWithUnsignedInt:errorLine], WebScriptErrorLineNumberKey, nil]; NSError *error = [[NSError alloc] initWithDomain:WebScriptErrorDomain code:WebScriptGeneralErrorCode userInfo:info]; if (implementations->failedToParseSourceFunc) CallScriptDebugDelegate(implementations->failedToParseSourceFunc, webView, @selector(webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:), nsSource, source.firstLine(), nsURL, error, webFrame); [error release]; [info release]; } m_callingDelegate = false; } void WebScriptDebugger::callEvent(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber) { if (m_callingDelegate) return; m_callingDelegate = true; WebFrame *webFrame = toWebFrame(debuggerCallFrame.dynamicGlobalObject()); m_topCallFrame.adoptNS([[WebScriptCallFrame alloc] _initWithGlobalObject:core(webFrame)->script()->windowScriptObject() debugger:this caller:m_topCallFrame.get() debuggerCallFrame:debuggerCallFrame]); WebView *webView = [webFrame webView]; WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView); if (implementations->didEnterCallFrameFunc) CallScriptDebugDelegate(implementations->didEnterCallFrameFunc, webView, @selector(webView:didEnterCallFrame:sourceId:line:forWebFrame:), m_topCallFrame.get(), sourceID, lineNumber, webFrame); m_callingDelegate = false; } void WebScriptDebugger::atStatement(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber) { if (m_callingDelegate) return; m_callingDelegate = true; WebFrame *webFrame = toWebFrame(debuggerCallFrame.dynamicGlobalObject()); WebView *webView = [webFrame webView]; [m_topCallFrame.get() _setDebuggerCallFrame:debuggerCallFrame]; WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView); if (implementations->willExecuteStatementFunc) CallScriptDebugDelegate(implementations->willExecuteStatementFunc, webView, @selector(webView:willExecuteStatement:sourceId:line:forWebFrame:), m_topCallFrame.get(), sourceID, lineNumber, webFrame); m_callingDelegate = false; } void WebScriptDebugger::returnEvent(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber) { if (m_callingDelegate) return; m_callingDelegate = true; WebFrame *webFrame = toWebFrame(debuggerCallFrame.dynamicGlobalObject()); WebView *webView = [webFrame webView]; [m_topCallFrame.get() _setDebuggerCallFrame:debuggerCallFrame]; WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView); if (implementations->willLeaveCallFrameFunc) CallScriptDebugDelegate(implementations->willLeaveCallFrameFunc, webView, @selector(webView:willLeaveCallFrame:sourceId:line:forWebFrame:), m_topCallFrame.get(), sourceID, lineNumber, webFrame); [m_topCallFrame.get() _clearDebuggerCallFrame]; m_topCallFrame = [m_topCallFrame.get() caller]; m_callingDelegate = false; } void WebScriptDebugger::exception(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber) { if (m_callingDelegate) return; m_callingDelegate = true; WebFrame *webFrame = toWebFrame(debuggerCallFrame.dynamicGlobalObject()); WebView *webView = [webFrame webView]; [m_topCallFrame.get() _setDebuggerCallFrame:debuggerCallFrame]; WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView); if (implementations->exceptionWasRaisedFunc) CallScriptDebugDelegate(implementations->exceptionWasRaisedFunc, webView, @selector(webView:exceptionWasRaised:sourceId:line:forWebFrame:), m_topCallFrame.get(), sourceID, lineNumber, webFrame); m_callingDelegate = false; } void WebScriptDebugger::willExecuteProgram(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineno) { } void WebScriptDebugger::didExecuteProgram(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineno) { } void WebScriptDebugger::didReachBreakpoint(const DebuggerCallFrame&, intptr_t, int) { return; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebTextCompletionController.h����������������������������������������������������0000644�0001750�0001750�00000003635�11210703511�020276� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple 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 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 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. */ @class WebView; @class WebHTMLView; @interface WebTextCompletionController : NSObject <NSTableViewDelegate, NSTableViewDataSource> { @private WebView *_view; WebHTMLView *_htmlView; NSWindow *_popupWindow; NSTableView *_tableView; NSArray *_completions; NSString *_originalString; int prefixLength; } - (id)initWithWebView:(WebView *)view HTMLView:(WebHTMLView *)htmlView; - (void)doCompletion; - (void)endRevertingChange:(BOOL)revertChange moveLeft:(BOOL)goLeft; - (BOOL)popupWindowIsOpen; - (BOOL)filterKeyDown:(NSEvent *)event; - (void)_reflectSelection; @end ���������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebPolicyDelegatePrivate.h�������������������������������������������������������0000644�0001750�0001750�00000004557�11242622727�017523� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebPolicyDelegate.h> @class WebHistoryItem; @class WebPolicyDecisionListenerPrivate; extern NSString *WebActionFormKey; // HTMLFormElement typedef enum { WebNavigationTypePlugInRequest = WebNavigationTypeOther + 1 } WebExtraNavigationType; @interface WebPolicyDecisionListener : NSObject <WebPolicyDecisionListener> { @private WebPolicyDecisionListenerPrivate *_private; } - (id)_initWithTarget:(id)target action:(SEL)action; - (void)_invalidate; @end @interface NSObject (WebPolicyDelegatePrivate) // Needed for <rdar://problem/3951283> can view pages from the back/forward cache that should be disallowed by Parental Controls - (BOOL)webView:(WebView *)webView shouldGoToHistoryItem:(WebHistoryItem *)item; - (BOOL)webView:(WebView *)webView shouldLoadMediaURL:(NSURL *)url inFrame:(WebFrame *)frame; @end �������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebDataSourcePrivate.h�����������������������������������������������������������0000644�0001750�0001750�00000003561�11044661252�016651� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebDataSource.h> @interface WebDataSource (WebPrivate) - (NSFileWrapper *)_fileWrapperForURL:(NSURL *)URL; - (void)_addSubframeArchives:(NSArray *) archives; - (NSError *)_mainDocumentError; - (NSString *)_responseMIMEType; - (BOOL)_transferApplicationCache:(NSString*)destinationBundleIdentifier; @end �����������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebFramePrivate.h����������������������������������������������������������������0000644�0001750�0001750�00000012134�11260743001�015636� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ // This header contains the WebFrame SPI. #import <WebKit/WebFrame.h> #import <JavaScriptCore/JSBase.h> #if !defined(ENABLE_NETSCAPE_PLUGIN_API) #define ENABLE_NETSCAPE_PLUGIN_API 1 #endif @class DOMDocumentFragment; @class DOMNode; @class WebIconFetcher; @class WebScriptObject; // Keys for accessing the values in the page cache dictionary. extern NSString *WebPageCacheEntryDateKey; extern NSString *WebPageCacheDataSourceKey; extern NSString *WebPageCacheDocumentViewKey; extern NSString *WebFrameMainDocumentError; extern NSString *WebFrameHasPlugins; extern NSString *WebFrameHasUnloadListener; extern NSString *WebFrameUsesDatabases; extern NSString *WebFrameUsesGeolocation; extern NSString *WebFrameUsesApplicationCache; extern NSString *WebFrameCanSuspendActiveDOMObjects; typedef enum { WebFrameLoadTypeStandard, WebFrameLoadTypeBack, WebFrameLoadTypeForward, WebFrameLoadTypeIndexedBackForward, // a multi-item hop in the backforward list WebFrameLoadTypeReload, WebFrameLoadTypeReloadAllowingStaleData, WebFrameLoadTypeSame, // user loads same URL again (but not reload button) WebFrameLoadTypeInternal, // maps to WebCore::FrameLoadTypeRedirectWithLockedBackForwardList WebFrameLoadTypeReplace, WebFrameLoadTypeReloadFromOrigin, WebFrameLoadTypeBackWMLDeckNotAccessible } WebFrameLoadType; @interface WebFrame (WebPrivate) - (BOOL)_isDescendantOfFrame:(WebFrame *)frame; - (void)_setShouldCreateRenderers:(BOOL)f; - (NSColor *)_bodyBackgroundColor; - (BOOL)_isFrameSet; - (BOOL)_firstLayoutDone; - (WebFrameLoadType)_loadType; // These methods take and return NSRanges based on the root editable element as the positional base. // This fits with AppKit's idea of an input context. These methods are slow compared to their DOMRange equivalents. // You should use WebView's selectedDOMRange and setSelectedDOMRange whenever possible. - (NSRange)_selectedNSRange; - (void)_selectNSRange:(NSRange)range; - (BOOL)_isDisplayingStandaloneImage; - (unsigned) _pendingFrameUnloadEventCount; - (WebIconFetcher *)fetchApplicationIcon:(id)target selector:(SEL)selector; - (void)_setIsDisconnected:(bool)isDisconnected; - (void)_setExcludeFromTextSearch:(bool)exclude; #if ENABLE_NETSCAPE_PLUGIN_API - (void)_recursive_resumeNullEventsForAllNetscapePlugins; - (void)_recursive_pauseNullEventsForAllNetscapePlugins; #endif // Pause a given CSS animation or transition on the target node at a specific time. // If the animation or transition is already paused, it will update its pause time. // This method is only intended to be used for testing the CSS animation and transition system. - (BOOL)_pauseAnimation:(NSString*)name onNode:(DOMNode *)node atTime:(NSTimeInterval)time; - (BOOL)_pauseTransitionOfProperty:(NSString*)name onNode:(DOMNode*)node atTime:(NSTimeInterval)time; // Returns the total number of currently running animations (includes both CSS transitions and CSS animations). - (unsigned) _numberOfActiveAnimations; - (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle; - (void)_replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace; - (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace; - (NSMutableDictionary *)_cacheabilityDictionary; - (BOOL)_allowsFollowingLink:(NSURL *)URL; @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebPDFView.mm��������������������������������������������������������������������0000644�0001750�0001750�00000156574�11212126444�014723� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebPDFView.h" #import "WebDataSourceInternal.h" #import "WebDelegateImplementationCaching.h" #import "WebDocumentInternal.h" #import "WebDocumentPrivate.h" #import "WebFrame.h" #import "WebFrameInternal.h" #import "WebFrameView.h" #import "WebLocalizableStrings.h" #import "WebNSArrayExtras.h" #import "WebNSAttributedStringExtras.h" #import "WebNSPasteboardExtras.h" #import "WebNSViewExtras.h" #import "WebPDFRepresentation.h" #import "WebPreferencesPrivate.h" #import "WebUIDelegate.h" #import "WebUIDelegatePrivate.h" #import "WebView.h" #import "WebViewInternal.h" #import <PDFKit/PDFKit.h> #import <WebCore/EventNames.h> #import <WebCore/FormState.h> #import <WebCore/Frame.h> #import <WebCore/FrameLoadRequest.h> #import <WebCore/FrameLoader.h> #import <WebCore/HTMLFormElement.h> #import <WebCore/KURL.h> #import <WebCore/KeyboardEvent.h> #import <WebCore/MouseEvent.h> #import <WebCore/PlatformKeyboardEvent.h> #import <WebCore/RuntimeApplicationChecks.h> #import <wtf/Assertions.h> using namespace WebCore; // Redeclarations of PDFKit notifications. We can't use the API since we use a weak link to the framework. #define _webkit_PDFViewDisplayModeChangedNotification @"PDFViewDisplayModeChanged" #define _webkit_PDFViewScaleChangedNotification @"PDFViewScaleChanged" #define _webkit_PDFViewPageChangedNotification @"PDFViewChangedPage" @interface PDFDocument (PDFKitSecretsIKnow) - (NSPrintOperation *)getPrintOperationForPrintInfo:(NSPrintInfo *)printInfo autoRotate:(BOOL)doRotate; @end extern "C" NSString *_NSPathForSystemFramework(NSString *framework); @interface WebPDFView (FileInternal) + (Class)_PDFPreviewViewClass; + (Class)_PDFViewClass; - (BOOL)_anyPDFTagsFoundInMenu:(NSMenu *)menu; - (void)_applyPDFDefaults; - (BOOL)_canLookUpInDictionary; - (NSClipView *)_clipViewForPDFDocumentView; - (NSEvent *)_fakeKeyEventWithFunctionKey:(unichar)functionKey; - (NSMutableArray *)_menuItemsFromPDFKitForEvent:(NSEvent *)theEvent; - (PDFSelection *)_nextMatchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag fromSelection:(PDFSelection *)initialSelection startInSelection:(BOOL)startInSelection; - (void)_openWithFinder:(id)sender; - (NSString *)_path; - (void)_PDFDocumentViewMightHaveScrolled:(NSNotification *)notification; - (BOOL)_pointIsInSelection:(NSPoint)point; - (NSAttributedString *)_scaledAttributedString:(NSAttributedString *)unscaledAttributedString; - (void)_setTextMatches:(NSArray *)array; - (NSString *)_temporaryPDFDirectoryPath; - (void)_trackFirstResponder; - (void)_updatePreferencesSoon; - (NSSet *)_visiblePDFPages; @end; // PDFPrefUpdatingProxy is a class that forwards everything it gets to a target and updates the PDF viewing prefs // after each of those messages. We use it as a way to hook all the places that the PDF viewing attrs change. @interface PDFPrefUpdatingProxy : NSProxy { WebPDFView *view; } - (id)initWithView:(WebPDFView *)view; @end #pragma mark C UTILITY FUNCTIONS static void _applicationInfoForMIMEType(NSString *type, NSString **name, NSImage **image) { NSURL *appURL = nil; OSStatus error = LSCopyApplicationForMIMEType((CFStringRef)type, kLSRolesAll, (CFURLRef *)&appURL); if (error != noErr) return; NSString *appPath = [appURL path]; CFRelease (appURL); *image = [[NSWorkspace sharedWorkspace] iconForFile:appPath]; [*image setSize:NSMakeSize(16.f,16.f)]; NSString *appName = [[NSFileManager defaultManager] displayNameAtPath:appPath]; *name = appName; } // FIXME 4182876: We can eliminate this function in favor if -isEqual: if [PDFSelection isEqual:] is overridden // to compare contents. static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selectionB) { NSArray *aPages = [selectionA pages]; NSArray *bPages = [selectionB pages]; if (![aPages isEqual:bPages]) return NO; int count = [aPages count]; int i; for (i = 0; i < count; ++i) { NSRect aBounds = [selectionA boundsForPage:[aPages objectAtIndex:i]]; NSRect bBounds = [selectionB boundsForPage:[bPages objectAtIndex:i]]; if (!NSEqualRects(aBounds, bBounds)) { return NO; } } return YES; } @implementation WebPDFView #pragma mark WebPDFView API + (NSBundle *)PDFKitBundle { static NSBundle *PDFKitBundle = nil; if (PDFKitBundle == nil) { NSString *PDFKitPath = [_NSPathForSystemFramework(@"Quartz.framework") stringByAppendingString:@"/Frameworks/PDFKit.framework"]; if (PDFKitPath == nil) { LOG_ERROR("Couldn't find PDFKit.framework"); return nil; } PDFKitBundle = [NSBundle bundleWithPath:PDFKitPath]; if (![PDFKitBundle load]) { LOG_ERROR("Couldn't load PDFKit.framework"); } } return PDFKitBundle; } + (NSArray *)supportedMIMETypes { return [WebPDFRepresentation supportedMIMETypes]; } - (void)setPDFDocument:(PDFDocument *)doc { // Both setDocument: and _applyPDFDefaults will trigger scale and mode-changed notifications. // Those aren't reflecting user actions, so we need to ignore them. _ignoreScaleAndDisplayModeAndPageNotifications = YES; [PDFSubview setDocument:doc]; [self _applyPDFDefaults]; _ignoreScaleAndDisplayModeAndPageNotifications = NO; } #pragma mark NSObject OVERRIDES - (void)dealloc { [dataSource release]; [previewView release]; [PDFSubview release]; [path release]; [PDFSubviewProxy release]; [textMatches release]; [super dealloc]; } #pragma mark NSResponder OVERRIDES - (void)centerSelectionInVisibleArea:(id)sender { [PDFSubview scrollSelectionToVisible:nil]; } - (void)scrollPageDown:(id)sender { // PDFView doesn't support this responder method directly, so we pass it a fake key event [PDFSubview keyDown:[self _fakeKeyEventWithFunctionKey:NSPageDownFunctionKey]]; } - (void)scrollPageUp:(id)sender { // PDFView doesn't support this responder method directly, so we pass it a fake key event [PDFSubview keyDown:[self _fakeKeyEventWithFunctionKey:NSPageUpFunctionKey]]; } - (void)scrollLineDown:(id)sender { // PDFView doesn't support this responder method directly, so we pass it a fake key event [PDFSubview keyDown:[self _fakeKeyEventWithFunctionKey:NSDownArrowFunctionKey]]; } - (void)scrollLineUp:(id)sender { // PDFView doesn't support this responder method directly, so we pass it a fake key event [PDFSubview keyDown:[self _fakeKeyEventWithFunctionKey:NSUpArrowFunctionKey]]; } - (void)scrollToBeginningOfDocument:(id)sender { // PDFView doesn't support this responder method directly, so we pass it a fake key event [PDFSubview keyDown:[self _fakeKeyEventWithFunctionKey:NSHomeFunctionKey]]; } - (void)scrollToEndOfDocument:(id)sender { // PDFView doesn't support this responder method directly, so we pass it a fake key event [PDFSubview keyDown:[self _fakeKeyEventWithFunctionKey:NSEndFunctionKey]]; } // jumpToSelection is the old name for what AppKit now calls centerSelectionInVisibleArea. Safari // was using the old jumpToSelection selector in its menu. Newer versions of Safari will us the // selector centerSelectionInVisibleArea. We'll leave this old selector in place for two reasons: // (1) compatibility between older Safari and newer WebKit; (2) other WebKit-based applications // might be using the jumpToSelection: selector, and we don't want to break them. - (void)jumpToSelection:(id)sender { [self centerSelectionInVisibleArea:nil]; } #pragma mark NSView OVERRIDES - (BOOL)acceptsFirstResponder { return YES; } - (BOOL)becomeFirstResponder { // This works together with setNextKeyView to splice our PDFSubview into // the key loop similar to the way NSScrollView does this. NSWindow *window = [self window]; id newFirstResponder = nil; if ([window keyViewSelectionDirection] == NSSelectingPrevious) { NSView *previousValidKeyView = [self previousValidKeyView]; if ((previousValidKeyView != self) && (previousValidKeyView != PDFSubview)) newFirstResponder = previousValidKeyView; } else { NSView *PDFDocumentView = [PDFSubview documentView]; if ([PDFDocumentView acceptsFirstResponder]) newFirstResponder = PDFDocumentView; } if (!newFirstResponder) return NO; if (![window makeFirstResponder:newFirstResponder]) return NO; [[dataSource webFrame] _clearSelectionInOtherFrames]; return YES; } - (NSView *)hitTest:(NSPoint)point { // Override hitTest so we can override menuForEvent. NSEvent *event = [NSApp currentEvent]; NSEventType type = [event type]; if (type == NSRightMouseDown || (type == NSLeftMouseDown && ([event modifierFlags] & NSControlKeyMask))) return self; return [super hitTest:point]; } - (id)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { [self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; Class previewViewClass = [[self class] _PDFPreviewViewClass]; // We might not have found a previewViewClass, but if we did find it // then we should be able to create an instance. if (previewViewClass) { previewView = [[previewViewClass alloc] initWithFrame:frame]; ASSERT(previewView); } NSView *topLevelPDFKitView = nil; if (previewView) { // We'll retain the PDFSubview here so that it is equally retained in all // code paths. That way we don't need to worry about conditionally releasing // it later. PDFSubview = [[previewView performSelector:@selector(pdfView)] retain]; topLevelPDFKitView = previewView; } else { PDFSubview = [[[[self class] _PDFViewClass] alloc] initWithFrame:frame]; topLevelPDFKitView = PDFSubview; } ASSERT(PDFSubview); [topLevelPDFKitView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [self addSubview:topLevelPDFKitView]; [PDFSubview setDelegate:self]; written = NO; // Messaging this proxy is the same as messaging PDFSubview, with the side effect that the // PDF viewing defaults are updated afterwards PDFSubviewProxy = (PDFView *)[[PDFPrefUpdatingProxy alloc] initWithView:self]; } return self; } - (NSMenu *)menuForEvent:(NSEvent *)theEvent { // Start with the menu items supplied by PDFKit, with WebKit tags applied NSMutableArray *items = [self _menuItemsFromPDFKitForEvent:theEvent]; // Add in an "Open with <default PDF viewer>" item NSString *appName = nil; NSImage *appIcon = nil; _applicationInfoForMIMEType([dataSource _responseMIMEType], &appName, &appIcon); if (!appName) appName = UI_STRING("Finder", "Default application name for Open With context menu"); // To match the PDFKit style, we'll add Open with Preview even when there's no document yet to view, and // disable it using validateUserInterfaceItem. NSString *title = [NSString stringWithFormat:UI_STRING("Open with %@", "context menu item for PDF"), appName]; NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:title action:@selector(_openWithFinder:) keyEquivalent:@""]; [item setTag:WebMenuItemTagOpenWithDefaultApplication]; if (appIcon) [item setImage:appIcon]; [items insertObject:item atIndex:0]; [item release]; [items insertObject:[NSMenuItem separatorItem] atIndex:1]; // pass the items off to the WebKit context menu mechanism WebView *webView = [[dataSource webFrame] webView]; ASSERT(webView); NSMenu *menu = [webView _menuForElement:[self elementAtPoint:[self convertPoint:[theEvent locationInWindow] fromView:nil]] defaultItems:items]; // The delegate has now had the opportunity to add items to the standard PDF-related items, or to // remove or modify some of the PDF-related items. In 10.4, the PDF context menu did not go through // the standard WebKit delegate path, and so the standard PDF-related items always appeared. For // clients that create their own context menu by hand-picking specific items from the default list, such as // Safari, none of the PDF-related items will appear until the client is rewritten to explicitly // include these items. For backwards compatibility of tip-of-tree WebKit with the 10.4 version of Safari // (the configuration that people building open source WebKit use), we'll use the entire set of PDFKit-supplied // menu items. This backward-compatibility hack won't work with any non-Safari clients, but this seems OK since // (1) the symptom is fairly minor, and (2) we suspect that non-Safari clients are probably using the entire // set of default items, rather than manually choosing from them. We can remove this code entirely when we // ship a version of Safari that includes the fix for radar 3796579. if (![self _anyPDFTagsFoundInMenu:menu] && applicationIsSafari()) { [menu addItem:[NSMenuItem separatorItem]]; NSEnumerator *e = [items objectEnumerator]; NSMenuItem *menuItem; while ((menuItem = [e nextObject]) != nil) { // copy menuItem since a given menuItem can be in only one menu at a time, and we don't // want to mess with the menu returned from PDFKit. [menu addItem:[menuItem copy]]; } } return menu; } - (void)setNextKeyView:(NSView *)aView { // This works together with becomeFirstResponder to splice PDFSubview into // the key loop similar to the way NSScrollView and NSClipView do this. NSView *documentView = [PDFSubview documentView]; if (documentView) { [documentView setNextKeyView:aView]; // We need to make the documentView be the next view in the keyview loop. // It would seem more sensible to do this in our init method, but it turns out // that [NSClipView setDocumentView] won't call this method if our next key view // is already set, so we wait until we're called before adding this connection. // We'll also clear it when we're called with nil, so this could go through the // same code path more than once successfully. [super setNextKeyView: aView ? documentView : nil]; } else [super setNextKeyView:aView]; } - (void)viewDidMoveToWindow { // FIXME 2573089: we can observe a notification for first responder changes // instead of the very frequent NSWindowDidUpdateNotification if/when 2573089 is addressed. NSWindow *newWindow = [self window]; if (!newWindow) return; [self _trackFirstResponder]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter addObserver:self selector:@selector(_trackFirstResponder) name:NSWindowDidUpdateNotification object:newWindow]; [notificationCenter addObserver:self selector:@selector(_scaleOrDisplayModeOrPageChanged:) name:_webkit_PDFViewScaleChangedNotification object:PDFSubview]; [notificationCenter addObserver:self selector:@selector(_scaleOrDisplayModeOrPageChanged:) name:_webkit_PDFViewDisplayModeChangedNotification object:PDFSubview]; [notificationCenter addObserver:self selector:@selector(_scaleOrDisplayModeOrPageChanged:) name:_webkit_PDFViewPageChangedNotification object:PDFSubview]; [notificationCenter addObserver:self selector:@selector(_PDFDocumentViewMightHaveScrolled:) name:NSViewBoundsDidChangeNotification object:[self _clipViewForPDFDocumentView]]; } - (void)viewWillMoveToWindow:(NSWindow *)window { // FIXME 2573089: we can observe a notification for changes to the first responder // instead of the very frequent NSWindowDidUpdateNotification if/when 2573089 is addressed. NSWindow *oldWindow = [self window]; if (!oldWindow) return; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter removeObserver:self name:NSWindowDidUpdateNotification object:oldWindow]; [notificationCenter removeObserver:self name:_webkit_PDFViewScaleChangedNotification object:PDFSubview]; [notificationCenter removeObserver:self name:_webkit_PDFViewDisplayModeChangedNotification object:PDFSubview]; [notificationCenter removeObserver:self name:_webkit_PDFViewPageChangedNotification object:PDFSubview]; [notificationCenter removeObserver:self name:NSViewBoundsDidChangeNotification object:[self _clipViewForPDFDocumentView]]; firstResponderIsPDFDocumentView = NO; } #pragma mark NSUserInterfaceValidations PROTOCOL IMPLEMENTATION - (BOOL)validateUserInterfaceItemWithoutDelegate:(id <NSValidatedUserInterfaceItem>)item { SEL action = [item action]; if (action == @selector(takeFindStringFromSelection:) || action == @selector(centerSelectionInVisibleArea:) || action == @selector(jumpToSelection:)) return [PDFSubview currentSelection] != nil; if (action == @selector(_openWithFinder:)) return [PDFSubview document] != nil; if (action == @selector(_lookUpInDictionaryFromMenu:)) return [self _canLookUpInDictionary]; return YES; } - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item { // This can be called during teardown when _webView is nil. Return NO when this happens, because CallUIDelegateReturningBoolean // assumes the WebVIew is non-nil. if (![self _webView]) return NO; BOOL result = [self validateUserInterfaceItemWithoutDelegate:item]; return CallUIDelegateReturningBoolean(result, [self _webView], @selector(webView:validateUserInterfaceItem:defaultValidation:), item, result); } #pragma mark INTERFACE BUILDER ACTIONS FOR SAFARI // Surprisingly enough, this isn't defined in any superclass, though it is defined in assorted AppKit classes since // it's a standard menu item IBAction. - (IBAction)copy:(id)sender { [PDFSubview copy:sender]; } // This used to be a standard IBAction (for Use Selection For Find), but AppKit now uses performFindPanelAction: // with a menu item tag for this purpose. - (IBAction)takeFindStringFromSelection:(id)sender { [NSPasteboard _web_setFindPasteboardString:[[PDFSubview currentSelection] string] withOwner:self]; } #pragma mark WebFrameView UNDECLARED "DELEGATE METHODS" // This is tested in -[WebFrameView canPrintHeadersAndFooters], but isn't declared anywhere (yuck) - (BOOL)canPrintHeadersAndFooters { return NO; } // This is tested in -[WebFrameView printOperationWithPrintInfo:], but isn't declared anywhere (yuck) - (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo { return [[PDFSubview document] getPrintOperationForPrintInfo:printInfo autoRotate:YES]; } #pragma mark WebDocumentView PROTOCOL IMPLEMENTATION - (void)setDataSource:(WebDataSource *)ds { if (dataSource == ds) return; dataSource = [ds retain]; // FIXME: There must be some better place to put this. There is no comment in ChangeLog // explaining why it's in this method. [self setFrame:[[self superview] frame]]; } - (void)dataSourceUpdated:(WebDataSource *)dataSource { } - (void)setNeedsLayout:(BOOL)flag { } - (void)layout { } - (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow { } - (void)viewDidMoveToHostWindow { } #pragma mark WebDocumentElement PROTOCOL IMPLEMENTATION - (NSDictionary *)elementAtPoint:(NSPoint)point { WebFrame *frame = [dataSource webFrame]; ASSERT(frame); return [NSDictionary dictionaryWithObjectsAndKeys: frame, WebElementFrameKey, [NSNumber numberWithBool:[self _pointIsInSelection:point]], WebElementIsSelectedKey, nil]; } - (NSDictionary *)elementAtPoint:(NSPoint)point allowShadowContent:(BOOL)allow { return [self elementAtPoint:point]; } #pragma mark WebDocumentSearching PROTOCOL IMPLEMENTATION - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag { return [self searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag startInSelection:NO]; } #pragma mark WebDocumentIncrementalSearching PROTOCOL IMPLEMENTATION - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag startInSelection:(BOOL)startInSelection { PDFSelection *selection = [self _nextMatchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag fromSelection:[PDFSubview currentSelection] startInSelection:startInSelection]; if (!selection) return NO; [PDFSubview setCurrentSelection:selection]; [PDFSubview scrollSelectionToVisible:nil]; return YES; } #pragma mark WebMultipleTextMatches PROTOCOL IMPLEMENTATION - (void)setMarkedTextMatchesAreHighlighted:(BOOL)newValue { // This method is part of the WebMultipleTextMatches algorithm, but this class doesn't support // highlighting text matches inline. #ifndef NDEBUG if (newValue) LOG_ERROR("[WebPDFView setMarkedTextMatchesAreHighlighted:] called with YES, which isn't supported"); #endif } - (BOOL)markedTextMatchesAreHighlighted { return NO; } - (NSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag limit:(NSUInteger)limit { PDFSelection *previousMatch = nil; PDFSelection *nextMatch = nil; NSMutableArray *matches = [[NSMutableArray alloc] initWithCapacity:limit]; for (;;) { nextMatch = [self _nextMatchFor:string direction:YES caseSensitive:caseFlag wrap:NO fromSelection:previousMatch startInSelection:NO]; if (!nextMatch) break; [matches addObject:nextMatch]; previousMatch = nextMatch; if ([matches count] >= limit) break; } [self _setTextMatches:matches]; [matches release]; return [matches count]; } - (void)unmarkAllTextMatches { [self _setTextMatches:nil]; } - (NSArray *)rectsForTextMatches { NSMutableArray *result = [NSMutableArray arrayWithCapacity:[textMatches count]]; NSSet *visiblePages = [self _visiblePDFPages]; NSEnumerator *matchEnumerator = [textMatches objectEnumerator]; PDFSelection *match; while ((match = [matchEnumerator nextObject]) != nil) { NSEnumerator *pages = [[match pages] objectEnumerator]; PDFPage *page; while ((page = [pages nextObject]) != nil) { // Skip pages that aren't visible (needed for non-continuous modes, see 5362989) if (![visiblePages containsObject:page]) continue; NSRect selectionOnPageInPDFViewCoordinates = [PDFSubview convertRect:[match boundsForPage:page] fromPage:page]; [result addObject:[NSValue valueWithRect:selectionOnPageInPDFViewCoordinates]]; } } return result; } #pragma mark WebDocumentText PROTOCOL IMPLEMENTATION - (BOOL)supportsTextEncoding { return NO; } - (NSString *)string { return [[PDFSubview document] string]; } - (NSAttributedString *)attributedString { // changing the selection is a hack, but the only way to get an attr string is via PDFSelection // must copy this selection object because we change the selection which seems to release it PDFSelection *savedSelection = [[PDFSubview currentSelection] copy]; [PDFSubview selectAll:nil]; NSAttributedString *result = [[PDFSubview currentSelection] attributedString]; if (savedSelection) { [PDFSubview setCurrentSelection:savedSelection]; [savedSelection release]; } else { // FIXME: behavior of setCurrentSelection:nil is not documented - check 4182934 for progress // Otherwise, we could collapse this code with the case above. [PDFSubview clearSelection]; } result = [self _scaledAttributedString:result]; return result; } - (NSString *)selectedString { return [[PDFSubview currentSelection] string]; } - (NSAttributedString *)selectedAttributedString { return [self _scaledAttributedString:[[PDFSubview currentSelection] attributedString]]; } - (void)selectAll { [PDFSubview selectAll:nil]; } - (void)deselectAll { [PDFSubview clearSelection]; } #pragma mark WebDocumentViewState PROTOCOL IMPLEMENTATION // Even though to WebKit we are the "docView", in reality a PDFView contains its own scrollview and docView. // And it even turns out there is another PDFKit view between the docView and its enclosing ScrollView, so // we have to be sure to do our calculations based on that view, immediately inside the ClipView. We try // to make as few assumptions about the PDFKit view hierarchy as possible. - (NSPoint)scrollPoint { NSView *realDocView = [PDFSubview documentView]; NSClipView *clipView = [[realDocView enclosingScrollView] contentView]; return [clipView bounds].origin; } - (void)setScrollPoint:(NSPoint)p { WebFrame *frame = [dataSource webFrame]; //FIXME: We only restore scroll state in the non-frames case because otherwise we get a crash due to // PDFKit calling display from within its drawRect:. See bugzilla 4164. if (![frame parentFrame]) { NSView *realDocView = [PDFSubview documentView]; [[[realDocView enclosingScrollView] documentView] scrollPoint:p]; } } - (id)viewState { NSMutableArray *state = [NSMutableArray arrayWithCapacity:4]; PDFDisplayMode mode = [PDFSubview displayMode]; [state addObject:[NSNumber numberWithInt:mode]]; if (mode == kPDFDisplaySinglePage || mode == kPDFDisplayTwoUp) { unsigned int pageIndex = [[PDFSubview document] indexForPage:[PDFSubview currentPage]]; [state addObject:[NSNumber numberWithUnsignedInt:pageIndex]]; } // else in continuous modes, scroll position gets us to the right page BOOL autoScaleFlag = [PDFSubview autoScales]; [state addObject:[NSNumber numberWithBool:autoScaleFlag]]; if (!autoScaleFlag) [state addObject:[NSNumber numberWithFloat:[PDFSubview scaleFactor]]]; return state; } - (void)setViewState:(id)statePList { ASSERT([statePList isKindOfClass:[NSArray class]]); NSArray *state = statePList; int i = 0; PDFDisplayMode mode = [[state objectAtIndex:i++] intValue]; [PDFSubview setDisplayMode:mode]; if (mode == kPDFDisplaySinglePage || mode == kPDFDisplayTwoUp) { unsigned int pageIndex = [[state objectAtIndex:i++] unsignedIntValue]; [PDFSubview goToPage:[[PDFSubview document] pageAtIndex:pageIndex]]; } // else in continuous modes, scroll position gets us to the right page BOOL autoScaleFlag = [[state objectAtIndex:i++] boolValue]; [PDFSubview setAutoScales:autoScaleFlag]; if (!autoScaleFlag) [PDFSubview setScaleFactor:[[state objectAtIndex:i++] floatValue]]; } #pragma mark _WebDocumentTextSizing PROTOCOL IMPLEMENTATION - (IBAction)_zoomOut:(id)sender { [PDFSubviewProxy zoomOut:sender]; } - (IBAction)_zoomIn:(id)sender { [PDFSubviewProxy zoomIn:sender]; } - (IBAction)_resetZoom:(id)sender { [PDFSubviewProxy setScaleFactor:1.0f]; } - (BOOL)_canZoomOut { return [PDFSubview canZoomOut]; } - (BOOL)_canZoomIn { return [PDFSubview canZoomIn]; } - (BOOL)_canResetZoom { return [PDFSubview scaleFactor] != 1.0; } #pragma mark WebDocumentSelection PROTOCOL IMPLEMENTATION - (NSRect)selectionRect { NSRect result = NSZeroRect; PDFSelection *selection = [PDFSubview currentSelection]; NSEnumerator *pages = [[selection pages] objectEnumerator]; PDFPage *page; while ((page = [pages nextObject]) != nil) { NSRect selectionOnPageInPDFViewCoordinates = [PDFSubview convertRect:[selection boundsForPage:page] fromPage:page]; if (NSIsEmptyRect(result)) result = selectionOnPageInPDFViewCoordinates; else result = NSUnionRect(result, selectionOnPageInPDFViewCoordinates); } // Convert result to be in documentView (selectionView) coordinates result = [PDFSubview convertRect:result toView:[PDFSubview documentView]]; return result; } - (NSArray *)selectionTextRects { // FIXME: We'd need new PDFKit API/SPI to get multiple text rects for selections that intersect more than one line return [NSArray arrayWithObject:[NSValue valueWithRect:[self selectionRect]]]; } - (NSView *)selectionView { return [PDFSubview documentView]; } - (NSImage *)selectionImageForcingBlackText:(BOOL)forceBlackText { // Convert the selection to an attributed string, and draw that. // FIXME 4621154: this doesn't handle italics (and maybe other styles) // FIXME 4604366: this doesn't handle text at non-actual size NSMutableAttributedString *attributedString = [[self selectedAttributedString] mutableCopy]; NSRange wholeStringRange = NSMakeRange(0, [attributedString length]); // Modify the styles in the attributed string to draw black text, no background, and no underline. We draw // no underline because it would look ugly. [attributedString beginEditing]; [attributedString removeAttribute:NSBackgroundColorAttributeName range:wholeStringRange]; [attributedString removeAttribute:NSUnderlineStyleAttributeName range:wholeStringRange]; if (forceBlackText) [attributedString addAttribute:NSForegroundColorAttributeName value:[NSColor colorWithDeviceWhite:0.0f alpha:1.0f] range:wholeStringRange]; [attributedString endEditing]; NSImage* selectionImage = [[[NSImage alloc] initWithSize:[self selectionRect].size] autorelease]; [selectionImage lockFocus]; [attributedString drawAtPoint:NSZeroPoint]; [selectionImage unlockFocus]; [attributedString release]; return selectionImage; } - (NSRect)selectionImageRect { // FIXME: deal with clipping? return [self selectionRect]; } - (NSArray *)pasteboardTypesForSelection { return [NSArray arrayWithObjects:NSRTFDPboardType, NSRTFPboardType, NSStringPboardType, nil]; } - (void)writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard { NSAttributedString *attributedString = [self selectedAttributedString]; if ([types containsObject:NSRTFDPboardType]) { NSData *RTFDData = [attributedString RTFDFromRange:NSMakeRange(0, [attributedString length]) documentAttributes:nil]; [pasteboard setData:RTFDData forType:NSRTFDPboardType]; } if ([types containsObject:NSRTFPboardType]) { if ([attributedString containsAttachments]) attributedString = [attributedString _web_attributedStringByStrippingAttachmentCharacters]; NSData *RTFData = [attributedString RTFFromRange:NSMakeRange(0, [attributedString length]) documentAttributes:nil]; [pasteboard setData:RTFData forType:NSRTFPboardType]; } if ([types containsObject:NSStringPboardType]) [pasteboard setString:[self selectedString] forType:NSStringPboardType]; } #pragma mark PDFView DELEGATE METHODS - (void)PDFViewWillClickOnLink:(PDFView *)sender withURL:(NSURL *)URL { if (!URL) return; NSWindow *window = [sender window]; NSEvent *nsEvent = [window currentEvent]; const int noButton = -1; int button = noButton; RefPtr<Event> event; switch ([nsEvent type]) { case NSLeftMouseUp: button = 0; break; case NSRightMouseUp: button = 1; break; case NSOtherMouseUp: button = [nsEvent buttonNumber]; break; case NSKeyDown: { PlatformKeyboardEvent pe(nsEvent); pe.disambiguateKeyDownEvent(PlatformKeyboardEvent::RawKeyDown); event = KeyboardEvent::create(eventNames().keydownEvent, true, true, 0, pe.keyIdentifier(), pe.windowsVirtualKeyCode(), pe.ctrlKey(), pe.altKey(), pe.shiftKey(), pe.metaKey(), false); } default: break; } if (button != noButton) { event = MouseEvent::create(eventNames().clickEvent, true, true, 0, [nsEvent clickCount], 0, 0, 0, 0, [nsEvent modifierFlags] & NSControlKeyMask, [nsEvent modifierFlags] & NSAlternateKeyMask, [nsEvent modifierFlags] & NSShiftKeyMask, [nsEvent modifierFlags] & NSCommandKeyMask, button, 0, 0, true); } // Call to the frame loader because this is where our security checks are made. core([dataSource webFrame])->loader()->loadFrameRequest(ResourceRequest(URL), false, false, event.get(), 0); } - (void)PDFViewOpenPDFInNativeApplication:(PDFView *)sender { // Delegate method sent when the user requests opening the PDF file in the system's default app [self _openWithFinder:sender]; } - (void)PDFViewPerformPrint:(PDFView *)sender { CallUIDelegate([self _webView], @selector(webView:printFrameView:), [[dataSource webFrame] frameView]); } - (void)PDFViewSavePDFToDownloadFolder:(PDFView *)sender { // We don't want to write the file until we have a document to write (see 5267607). if (![PDFSubview document]) { NSBeep(); return; } // Delegate method sent when the user requests downloading the PDF file to disk. We pass NO for // showingPanel: so that the PDF file is saved to the standard location without user intervention. CallUIDelegate([self _webView], @selector(webView:saveFrameView:showingPanel:), [[dataSource webFrame] frameView], NO); } @end @implementation WebPDFView (FileInternal) + (Class)_PDFPreviewViewClass { static Class PDFPreviewViewClass = nil; static BOOL checkedForPDFPreviewViewClass = NO; if (!checkedForPDFPreviewViewClass) { checkedForPDFPreviewViewClass = YES; PDFPreviewViewClass = [[WebPDFView PDFKitBundle] classNamed:@"PDFPreviewView"]; } // This class might not be available; callers need to deal with a nil return here. return PDFPreviewViewClass; } + (Class)_PDFViewClass { static Class PDFViewClass = nil; if (PDFViewClass == nil) { PDFViewClass = [[WebPDFView PDFKitBundle] classNamed:@"PDFView"]; if (!PDFViewClass) LOG_ERROR("Couldn't find PDFView class in PDFKit.framework"); } return PDFViewClass; } - (BOOL)_anyPDFTagsFoundInMenu:(NSMenu *)menu { NSEnumerator *e = [[menu itemArray] objectEnumerator]; NSMenuItem *item; while ((item = [e nextObject]) != nil) { switch ([item tag]) { case WebMenuItemTagOpenWithDefaultApplication: case WebMenuItemPDFActualSize: case WebMenuItemPDFZoomIn: case WebMenuItemPDFZoomOut: case WebMenuItemPDFAutoSize: case WebMenuItemPDFSinglePage: case WebMenuItemPDFSinglePageScrolling: case WebMenuItemPDFFacingPages: case WebMenuItemPDFFacingPagesScrolling: case WebMenuItemPDFContinuous: case WebMenuItemPDFNextPage: case WebMenuItemPDFPreviousPage: return YES; } } return NO; } - (void)_applyPDFDefaults { // Set up default viewing params WebPreferences *prefs = [[dataSource _webView] preferences]; float scaleFactor = [prefs PDFScaleFactor]; if (scaleFactor == 0) [PDFSubview setAutoScales:YES]; else { [PDFSubview setAutoScales:NO]; [PDFSubview setScaleFactor:scaleFactor]; } [PDFSubview setDisplayMode:[prefs PDFDisplayMode]]; } - (BOOL)_canLookUpInDictionary { return [PDFSubview respondsToSelector:@selector(_searchInDictionary:)]; } - (NSClipView *)_clipViewForPDFDocumentView { NSClipView *clipView = (NSClipView *)[[PDFSubview documentView] _web_superviewOfClass:[NSClipView class]]; ASSERT(clipView); return clipView; } - (NSEvent *)_fakeKeyEventWithFunctionKey:(unichar)functionKey { // FIXME 4400480: when PDFView implements the standard scrolling selectors that this // method is used to mimic, we can eliminate this method and call them directly. NSString *keyAsString = [NSString stringWithCharacters:&functionKey length:1]; return [NSEvent keyEventWithType:NSKeyDown location:NSZeroPoint modifierFlags:0 timestamp:0 windowNumber:0 context:nil characters:keyAsString charactersIgnoringModifiers:keyAsString isARepeat:NO keyCode:0]; } - (void)_lookUpInDictionaryFromMenu:(id)sender { // This method is used by WebKit's context menu item. Here we map to the method that // PDFView uses. Since the PDFView method isn't API, and isn't available on all versions // of PDFKit, we use performSelector after a respondsToSelector check, rather than calling it directly. if ([self _canLookUpInDictionary]) [PDFSubview performSelector:@selector(_searchInDictionary:) withObject:sender]; } - (NSMutableArray *)_menuItemsFromPDFKitForEvent:(NSEvent *)theEvent { NSMutableArray *copiedItems = [NSMutableArray array]; NSDictionary *actionsToTags = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:WebMenuItemPDFActualSize], NSStringFromSelector(@selector(_setActualSize:)), [NSNumber numberWithInt:WebMenuItemPDFZoomIn], NSStringFromSelector(@selector(zoomIn:)), [NSNumber numberWithInt:WebMenuItemPDFZoomOut], NSStringFromSelector(@selector(zoomOut:)), [NSNumber numberWithInt:WebMenuItemPDFAutoSize], NSStringFromSelector(@selector(_setAutoSize:)), [NSNumber numberWithInt:WebMenuItemPDFSinglePage], NSStringFromSelector(@selector(_setSinglePage:)), [NSNumber numberWithInt:WebMenuItemPDFSinglePageScrolling], NSStringFromSelector(@selector(_setSinglePageScrolling:)), [NSNumber numberWithInt:WebMenuItemPDFFacingPages], NSStringFromSelector(@selector(_setDoublePage:)), [NSNumber numberWithInt:WebMenuItemPDFFacingPagesScrolling], NSStringFromSelector(@selector(_setDoublePageScrolling:)), [NSNumber numberWithInt:WebMenuItemPDFContinuous], NSStringFromSelector(@selector(_toggleContinuous:)), [NSNumber numberWithInt:WebMenuItemPDFNextPage], NSStringFromSelector(@selector(goToNextPage:)), [NSNumber numberWithInt:WebMenuItemPDFPreviousPage], NSStringFromSelector(@selector(goToPreviousPage:)), nil]; // Leave these menu items out, since WebKit inserts equivalent ones. Note that we leave out PDFKit's "Look Up in Dictionary" // item here because WebKit already includes an item with the same title and purpose. We map WebKit's to PDFKit's // "Look Up in Dictionary" via the implementation of -[WebPDFView _lookUpInDictionaryFromMenu:]. NSSet *unwantedActions = [[NSSet alloc] initWithObjects: NSStringFromSelector(@selector(_searchInSpotlight:)), NSStringFromSelector(@selector(_searchInGoogle:)), NSStringFromSelector(@selector(_searchInDictionary:)), NSStringFromSelector(@selector(copy:)), nil]; NSEnumerator *e = [[[PDFSubview menuForEvent:theEvent] itemArray] objectEnumerator]; NSMenuItem *item; while ((item = [e nextObject]) != nil) { NSString *actionString = NSStringFromSelector([item action]); if ([unwantedActions containsObject:actionString]) continue; // Copy items since a menu item can be in only one menu at a time, and we don't // want to modify the original menu supplied by PDFKit. NSMenuItem *itemCopy = [item copy]; [copiedItems addObject:itemCopy]; // Include all of PDFKit's separators for now. At the end we'll remove any ones that were made // useless by removing PDFKit's menu items. if ([itemCopy isSeparatorItem]) continue; NSNumber *tagNumber = [actionsToTags objectForKey:actionString]; int tag; if (tagNumber != nil) tag = [tagNumber intValue]; else { // This should happen only if PDFKit updates behind WebKit's back. It's non-ideal because clients that only include tags // that they recognize (like Safari) won't get these PDFKit additions until WebKit is updated to match. tag = WebMenuItemTagOther; LOG_ERROR("no WebKit menu item tag found for PDF context menu item action \"%@\", using WebMenuItemTagOther", actionString); } if ([itemCopy tag] == 0) { [itemCopy setTag:tag]; if ([itemCopy target] == PDFSubview) { // Note that updating the defaults is cheap because it catches redundant settings, so installing // the proxy for actions that don't impact the defaults is OK [itemCopy setTarget:PDFSubviewProxy]; } } else LOG_ERROR("PDF context menu item %@ came with tag %d, so no WebKit tag was applied. This could mean that the item doesn't appear in clients such as Safari.", [itemCopy title], [itemCopy tag]); } [actionsToTags release]; [unwantedActions release]; // Since we might have removed elements supplied by PDFKit, and we want to minimize our hardwired // knowledge of the order and arrangement of PDFKit's menu items, we need to remove any bogus // separators that were left behind. [copiedItems _webkit_removeUselessMenuItemSeparators]; return copiedItems; } - (PDFSelection *)_nextMatchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag fromSelection:(PDFSelection *)initialSelection startInSelection:(BOOL)startInSelection { if (![string length]) return nil; int options = 0; if (!forward) options |= NSBackwardsSearch; if (!caseFlag) options |= NSCaseInsensitiveSearch; PDFDocument *document = [PDFSubview document]; PDFSelection *selectionForInitialSearch = [initialSelection copy]; if (startInSelection) { // Initially we want to include the selected text in the search. PDFDocument's API always searches from just // past the passed-in selection, so we need to pass a selection that's modified appropriately. // FIXME 4182863: Ideally we'd use a zero-length selection at the edge of the current selection, but zero-length // selections don't work in PDFDocument. So instead we make a one-length selection just before or after the // current selection, which works for our purposes even when the current selection is at an edge of the // document. int initialSelectionLength = [[initialSelection string] length]; if (forward) { [selectionForInitialSearch extendSelectionAtStart:1]; [selectionForInitialSearch extendSelectionAtEnd:-initialSelectionLength]; } else { [selectionForInitialSearch extendSelectionAtEnd:1]; [selectionForInitialSearch extendSelectionAtStart:-initialSelectionLength]; } } PDFSelection *foundSelection = [document findString:string fromSelection:selectionForInitialSearch withOptions:options]; [selectionForInitialSearch release]; // If we first searched in the selection, and we found the selection, search again from just past the selection if (startInSelection && _PDFSelectionsAreEqual(foundSelection, initialSelection)) foundSelection = [document findString:string fromSelection:initialSelection withOptions:options]; if (!foundSelection && wrapFlag) foundSelection = [document findString:string fromSelection:nil withOptions:options]; return foundSelection; } - (void)_openWithFinder:(id)sender { // We don't want to write the file until we have a document to write (see 4892525). if (![PDFSubview document]) { NSBeep(); return; } NSString *opath = [self _path]; if (opath) { if (!written) { // Create a PDF file with the minimal permissions (only accessible to the current user, see 4145714) NSNumber *permissions = [[NSNumber alloc] initWithInt:S_IRUSR]; NSDictionary *fileAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:permissions, NSFilePosixPermissions, nil]; [permissions release]; [[NSFileManager defaultManager] createFileAtPath:opath contents:[dataSource data] attributes:fileAttributes]; [fileAttributes release]; written = YES; } if (![[NSWorkspace sharedWorkspace] openFile:opath]) { // NSWorkspace couldn't open file. Do we need an alert // here? We ignore the error elsewhere. } } } - (NSString *)_path { // Generate path once. if (path) return path; NSString *filename = [[dataSource response] suggestedFilename]; NSFileManager *manager = [NSFileManager defaultManager]; NSString *temporaryPDFDirectoryPath = [self _temporaryPDFDirectoryPath]; if (!temporaryPDFDirectoryPath) { // This should never happen; if it does we'll fail silently on non-debug builds. ASSERT_NOT_REACHED(); return nil; } path = [temporaryPDFDirectoryPath stringByAppendingPathComponent:filename]; if ([manager fileExistsAtPath:path]) { NSString *pathTemplatePrefix = [temporaryPDFDirectoryPath stringByAppendingPathComponent:@"XXXXXX-"]; NSString *pathTemplate = [pathTemplatePrefix stringByAppendingString:filename]; // fileSystemRepresentation returns a const char *; copy it into a char * so we can modify it safely char *cPath = strdup([pathTemplate fileSystemRepresentation]); int fd = mkstemps(cPath, strlen(cPath) - strlen([pathTemplatePrefix fileSystemRepresentation]) + 1); if (fd < 0) { // Couldn't create a temporary file! Should never happen; if it does we'll fail silently on non-debug builds. ASSERT_NOT_REACHED(); path = nil; } else { close(fd); path = [manager stringWithFileSystemRepresentation:cPath length:strlen(cPath)]; } free(cPath); } [path retain]; return path; } - (void)_PDFDocumentViewMightHaveScrolled:(NSNotification *)notification { NSClipView *clipView = [self _clipViewForPDFDocumentView]; ASSERT([notification object] == clipView); NSPoint scrollPosition = [clipView bounds].origin; if (NSEqualPoints(scrollPosition, lastScrollPosition)) return; lastScrollPosition = scrollPosition; WebView *webView = [self _webView]; [[webView _UIDelegateForwarder] webView:webView didScrollDocumentInFrameView:[[dataSource webFrame] frameView]]; } - (PDFView *)_PDFSubview { return PDFSubview; } - (BOOL)_pointIsInSelection:(NSPoint)point { PDFPage *page = [PDFSubview pageForPoint:point nearest:NO]; if (!page) return NO; NSRect selectionRect = [PDFSubview convertRect:[[PDFSubview currentSelection] boundsForPage:page] fromPage:page]; return NSPointInRect(point, selectionRect); } - (void)_scaleOrDisplayModeOrPageChanged:(NSNotification *)notification { ASSERT([notification object] == PDFSubview); if (!_ignoreScaleAndDisplayModeAndPageNotifications) { [self _updatePreferencesSoon]; // Notify UI delegate that the entire page has been redrawn, since (unlike for WebHTMLView) // we can't hook into the drawing mechanism itself. This fixes 5337529. WebView *webView = [self _webView]; [[webView _UIDelegateForwarder] webView:webView didDrawRect:[webView bounds]]; } } - (NSAttributedString *)_scaledAttributedString:(NSAttributedString *)unscaledAttributedString { if (!unscaledAttributedString) return nil; float scaleFactor = [PDFSubview scaleFactor]; if (scaleFactor == 1.0) return unscaledAttributedString; NSMutableAttributedString *result = [[unscaledAttributedString mutableCopy] autorelease]; unsigned int length = [result length]; NSRange effectiveRange = NSMakeRange(0,0); [result beginEditing]; while (NSMaxRange(effectiveRange) < length) { NSFont *unscaledFont = [result attribute:NSFontAttributeName atIndex:NSMaxRange(effectiveRange) effectiveRange:&effectiveRange]; if (!unscaledFont) { // FIXME: We can't scale the font if we don't know what it is. We should always know what it is, // but sometimes don't due to PDFKit issue 5089411. When that's addressed, we can remove this // early continue. LOG_ERROR("no font attribute found in range %@ for attributed string \"%@\" on page %@ (see radar 5089411)", NSStringFromRange(effectiveRange), result, [[dataSource request] URL]); continue; } NSFont *scaledFont = [NSFont fontWithName:[unscaledFont fontName] size:[unscaledFont pointSize]*scaleFactor]; [result addAttribute:NSFontAttributeName value:scaledFont range:effectiveRange]; } [result endEditing]; return result; } - (void)_setTextMatches:(NSArray *)array { [array retain]; [textMatches release]; textMatches = array; } - (NSString *)_temporaryPDFDirectoryPath { // Returns nil if the temporary PDF directory didn't exist and couldn't be created static NSString *_temporaryPDFDirectoryPath = nil; if (!_temporaryPDFDirectoryPath) { NSString *temporaryDirectoryTemplate = [NSTemporaryDirectory() stringByAppendingPathComponent:@"WebKitPDFs-XXXXXX"]; char *cTemplate = strdup([temporaryDirectoryTemplate fileSystemRepresentation]); if (!mkdtemp(cTemplate)) { // This should never happen; if it does we'll fail silently on non-debug builds. ASSERT_NOT_REACHED(); } else { // cTemplate has now been modified to be the just-created directory name. This directory has 700 permissions, // so only the current user can add to it or view its contents. _temporaryPDFDirectoryPath = [[[NSFileManager defaultManager] stringWithFileSystemRepresentation:cTemplate length:strlen(cTemplate)] retain]; } free(cTemplate); } return _temporaryPDFDirectoryPath; } - (void)_trackFirstResponder { ASSERT([self window]); BOOL newFirstResponderIsPDFDocumentView = [[self window] firstResponder] == [PDFSubview documentView]; if (newFirstResponderIsPDFDocumentView == firstResponderIsPDFDocumentView) return; // This next clause is the entire purpose of _trackFirstResponder. In other WebDocument // view classes this is done in a resignFirstResponder override, but in this case the // first responder view is a PDFKit class that we can't subclass. if (newFirstResponderIsPDFDocumentView && ![[dataSource _webView] maintainsInactiveSelection]) [self deselectAll]; firstResponderIsPDFDocumentView = newFirstResponderIsPDFDocumentView; } - (void)_updatePreferences:(WebPreferences *)prefs { float scaleFactor = [PDFSubview autoScales] ? 0.0f : [PDFSubview scaleFactor]; [prefs setPDFScaleFactor:scaleFactor]; [prefs setPDFDisplayMode:[PDFSubview displayMode]]; _willUpdatePreferencesSoon = NO; [prefs release]; [self release]; } - (void)_updatePreferencesSoon { // Consolidate calls; due to the PDFPrefUpdatingProxy method, this can be called multiple times with a single user action // such as showing the context menu. if (_willUpdatePreferencesSoon) return; WebPreferences *prefs = [[dataSource _webView] preferences]; [self retain]; [prefs retain]; [self performSelector:@selector(_updatePreferences:) withObject:prefs afterDelay:0]; _willUpdatePreferencesSoon = YES; } - (NSSet *)_visiblePDFPages { // Returns the set of pages that are at least partly visible, used to avoid processing non-visible pages PDFDocument *pdfDocument = [PDFSubview document]; if (!pdfDocument) return nil; NSRect pdfViewBounds = [PDFSubview bounds]; PDFPage *topLeftPage = [PDFSubview pageForPoint:NSMakePoint(NSMinX(pdfViewBounds), NSMaxY(pdfViewBounds)) nearest:YES]; PDFPage *bottomRightPage = [PDFSubview pageForPoint:NSMakePoint(NSMaxX(pdfViewBounds), NSMinY(pdfViewBounds)) nearest:YES]; // only page-free documents should return nil for either of these two since we passed YES for nearest: if (!topLeftPage) { ASSERT(!bottomRightPage); return nil; } NSUInteger firstVisiblePageIndex = [pdfDocument indexForPage:topLeftPage]; NSUInteger lastVisiblePageIndex = [pdfDocument indexForPage:bottomRightPage]; if (firstVisiblePageIndex > lastVisiblePageIndex) { NSUInteger swap = firstVisiblePageIndex; firstVisiblePageIndex = lastVisiblePageIndex; lastVisiblePageIndex = swap; } NSMutableSet *result = [NSMutableSet set]; NSUInteger pageIndex; for (pageIndex = firstVisiblePageIndex; pageIndex <= lastVisiblePageIndex; ++pageIndex) [result addObject:[pdfDocument pageAtIndex:pageIndex]]; return result; } @end @implementation PDFPrefUpdatingProxy - (id)initWithView:(WebPDFView *)aView { // No [super init], since we inherit from NSProxy view = aView; return self; } - (void)forwardInvocation:(NSInvocation *)invocation { [invocation invokeWithTarget:[view _PDFSubview]]; [view _updatePreferencesSoon]; } - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel { return [[view _PDFSubview] methodSignatureForSelector:sel]; } @end ������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebHTMLRepresentation.h����������������������������������������������������������0000644�0001750�0001750�00000005325�10432315656�016757� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> #import <WebKit/WebDocumentPrivate.h> @class WebHTMLRepresentationPrivate; @class NSView; @class DOMNode; @class DOMElement; @protocol WebDocumentMarkup; @protocol WebDocumentRepresentation; @protocol WebDocumentSourceRepresentation; /*! @class WebHTMLRepresentation */ @interface WebHTMLRepresentation : NSObject <WebDocumentRepresentation, WebDocumentDOM> { WebHTMLRepresentationPrivate *_private; } + (NSArray *)supportedMIMETypes; + (NSArray *)supportedNonImageMIMETypes; + (NSArray *)supportedImageMIMETypes; - (NSAttributedString *)attributedStringFrom:(DOMNode *)startNode startOffset:(int)startOffset to:(DOMNode *)endNode endOffset:(int)endOffset; - (DOMElement *)elementWithName:(NSString *)name inForm:(DOMElement *)form; - (BOOL)elementDoesAutoComplete:(DOMElement *)element; - (BOOL)elementIsPassword:(DOMElement *)element; - (DOMElement *)formForElement:(DOMElement *)element; - (DOMElement *)currentForm; - (NSArray *)controlsInForm:(DOMElement *)form; - (NSString *)searchForLabels:(NSArray *)labels beforeElement:(DOMElement *)element; - (NSString *)matchLabels:(NSArray *)labels againstElement:(DOMElement *)element; @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebDataSourceInternal.h����������������������������������������������������������0000644�0001750�0001750�00000005134�11025107554�017010� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebDataSourcePrivate.h" #import <wtf/Forward.h> namespace WebCore { class DocumentLoader; } class WebDocumentLoaderMac; @class DOMDocumentFragment; @class DOMElement; @class WebArchive; @class WebResource; @class WebView; @interface WebDataSource (WebInternal) - (void)_makeRepresentation; - (BOOL)_isDocumentHTML; - (WebView *)_webView; - (NSURL *)_URL; - (DOMElement *)_imageElementWithImageResource:(WebResource *)resource; - (DOMDocumentFragment *)_documentFragmentWithImageResource:(WebResource *)resource; - (DOMDocumentFragment *)_documentFragmentWithArchive:(WebArchive *)archive; + (NSMutableDictionary *)_repTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission; - (void)_replaceSelectionWithArchive:(WebArchive *)archive selectReplacement:(BOOL)selectReplacement; - (id)_initWithDocumentLoader:(PassRefPtr<WebDocumentLoaderMac>)loader; - (void)_finishedLoading; - (void)_receivedData:(NSData *)data; - (void)_revertToProvisionalState; - (void)_setMainDocumentError:(NSError *)error; - (WebCore::DocumentLoader*)_documentLoader; @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebClipView.m��������������������������������������������������������������������0000644�0001750�0001750�00000010114�11032666713�015007� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebClipView.h" #import <WebKit/WebHTMLView.h> #import <WebKit/WebNSViewExtras.h> #import <WebKit/WebViewPrivate.h> #import <wtf/Assertions.h> // WebClipView's entire reason for existing is to set the clip used by focus ring redrawing. // There's no easy way to prevent the focus ring from drawing outside the passed-in clip rectangle // because it expects to have to draw outside the bounds of the view it's being drawn for. // But it looks for the enclosing clip view, which gives us a hook we can use to control it. // The "additional clip" is a clip for focus ring redrawing. // FIXME: Change terminology from "additional clip" to "focus ring clip". @interface NSView (WebViewMethod) - (WebView *)_webView; @end @implementation WebClipView - (id)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (!self) return nil; // 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 subframes, which use WebClipView. // See these bugs for more information: // <rdar://problem/3409315>: REGRESSSION (7B58-7B60)?: Safari draws blank frames on macosx.apple.com perf page [self releaseGState]; return self; } - (void)resetAdditionalClip { ASSERT(_haveAdditionalClip); _haveAdditionalClip = NO; } - (void)setAdditionalClip:(NSRect)additionalClip { ASSERT(!_haveAdditionalClip); _haveAdditionalClip = YES; _additionalClip = additionalClip; } - (BOOL)hasAdditionalClip { return _haveAdditionalClip; } - (NSRect)additionalClip { ASSERT(_haveAdditionalClip); return _additionalClip; } - (NSRect)_focusRingVisibleRect { NSRect rect = [self visibleRect]; if (_haveAdditionalClip) { rect = NSIntersectionRect(rect, _additionalClip); } return rect; } - (void)scrollWheel:(NSEvent *)event { NSView *docView = [self documentView]; if ([docView respondsToSelector:@selector(_webView)]) { #if ENABLE(DASHBOARD_SUPPORT) WebView *wv = [docView _webView]; if ([wv _dashboardBehavior:WebDashboardBehaviorAllowWheelScrolling]) { [super scrollWheel:event]; } #endif return; } [super scrollWheel:event]; } @end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebFrameInternal.h���������������������������������������������������������������0000644�0001750�0001750�00000015204�11172152603�016005� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ // This header contains WebFrame declarations that can be used anywhere in WebKit, but are neither SPI nor API. #import "WebFramePrivate.h" #import "WebPreferencesPrivate.h" #import <WebCore/EditAction.h> #import <WebCore/FrameLoaderTypes.h> #import <WebCore/SelectionController.h> #import <WebCore/Settings.h> @class DOMCSSStyleDeclaration; @class DOMDocumentFragment; @class DOMElement; @class DOMNode; @class DOMRange; @class WebFrameView; @class WebHistoryItem; class WebScriptDebugger; namespace WebCore { class CSSStyleDeclaration; class Document; class DocumentLoader; class Element; class Frame; class Frame; class HistoryItem; class HTMLElement; class HTMLFrameOwnerElement; class Node; class Page; class Range; } typedef WebCore::HistoryItem WebCoreHistoryItem; WebCore::Frame* core(WebFrame *); WebFrame *kit(WebCore::Frame *); WebCore::Page* core(WebView *); WebView *kit(WebCore::Page*); WebCore::EditableLinkBehavior core(WebKitEditableLinkBehavior); WebCore::TextDirectionSubmenuInclusionBehavior core(WebTextDirectionSubmenuInclusionBehavior); WebView *getWebView(WebFrame *webFrame); @interface WebFramePrivate : NSObject { @public WebCore::Frame* coreFrame; WebFrameView *webFrameView; WebScriptDebugger* scriptDebugger; id internalLoadDelegate; BOOL shouldCreateRenderers; } @end @protocol WebCoreRenderTreeCopier <NSObject> - (NSObject *)nodeWithName:(NSString *)name position:(NSPoint)position rect:(NSRect)rect view:(NSView *)view children:(NSArray *)children; @end @interface WebFrame (WebInternal) + (void)_createMainFrameWithPage:(WebCore::Page*)page frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView; + (PassRefPtr<WebCore::Frame>)_createSubframeWithOwnerElement:(WebCore::HTMLFrameOwnerElement*)ownerElement frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView; - (id)_initWithWebFrameView:(WebFrameView *)webFrameView webView:(WebView *)webView; - (void)_clearCoreFrame; - (void)_updateBackgroundAndUpdatesWhileOffscreen; - (void)_setInternalLoadDelegate:(id)internalLoadDelegate; - (id)_internalLoadDelegate; #ifndef BUILDING_ON_TIGER - (void)_unmarkAllBadGrammar; #endif - (void)_unmarkAllMisspellings; - (BOOL)_hasSelection; - (void)_clearSelection; - (WebFrame *)_findFrameWithSelection; - (void)_clearSelectionInOtherFrames; - (void)_attachScriptDebugger; - (void)_detachScriptDebugger; // dataSource reports null for the initial empty document's data source; this is needed // to preserve compatibility with Mail and Safari among others. But internal to WebKit, // we need to be able to get the initial data source as well, so the _dataSource method // should be used instead. - (WebDataSource *)_dataSource; - (BOOL)_needsLayout; - (void)_drawRect:(NSRect)rect contentsOnly:(BOOL)contentsOnly; - (BOOL)_getVisibleRect:(NSRect*)rect; - (NSArray*)_computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight; - (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string; - (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture; - (NSString *)_selectedString; - (NSString *)_stringForRange:(DOMRange *)range; - (NSString *)_markupStringFromRange:(DOMRange *)range nodes:(NSArray **)nodes; - (NSRect)_caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity; - (NSRect)_firstRectForDOMRange:(DOMRange *)range; - (void)_scrollDOMRangeToVisible:(DOMRange *)range; - (id)_accessibilityTree; - (DOMRange *)_rangeByAlteringCurrentSelection:(WebCore::SelectionController::EAlteration)alteration direction:(WebCore::SelectionController::EDirection)direction granularity:(WebCore::TextGranularity)granularity; - (void)_smartInsertForString:(NSString *)pasteString replacingRange:(DOMRange *)charRangeToReplace beforeString:(NSString **)beforeString afterString:(NSString **)afterString; - (NSRange)_convertToNSRange:(WebCore::Range*)range; - (DOMRange *)_convertNSRangeToDOMRange:(NSRange)range; - (NSRange)_convertDOMRangeToNSRange:(DOMRange *)range; - (DOMDocumentFragment *)_documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString; - (DOMDocumentFragment *)_documentFragmentWithNodesAsParagraphs:(NSArray *)nodes; - (void)_replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle; - (void)_insertParagraphSeparatorInQuotedContent; - (DOMRange *)_characterRangeAtPoint:(NSPoint)point; - (DOMCSSStyleDeclaration *)_typingStyle; - (void)_setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebCore::EditAction)undoAction; - (void)_dragSourceMovedTo:(NSPoint)windowLoc; - (void)_dragSourceEndedAt:(NSPoint)windowLoc operation:(NSDragOperation)operation; - (BOOL)_canProvideDocumentSource; - (BOOL)_canSaveAsWebArchive; - (void)_receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName; @end @interface NSObject (WebInternalFrameLoadDelegate) - (void)webFrame:(WebFrame *)webFrame didFinishLoadWithError:(NSError *)error; @end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebHistoryDelegate.h�������������������������������������������������������������0000644�0001750�0001750�00000003627�11260535714�016366� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 <Foundation/Foundation.h> @class WebFrame; @class WebNavigationData; @class WebView; @interface NSObject (WebHistoryDelegate) - (void)webView:(WebView *)webView didNavigateWithNavigationData:(WebNavigationData *)navigationData inFrame:(WebFrame *)webFrame; - (void)webView:(WebView *)webView didPerformClientRedirectFromURL:(NSString *)sourceURL toURL:(NSString *)destinationURL inFrame:(WebFrame *)webFrame; - (void)webView:(WebView *)webView didPerformServerRedirectFromURL:(NSString *)sourceURL toURL:(NSString *)destinationURL inFrame:(WebFrame *)webFrame; @end ���������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebPDFDocumentExtras.h�����������������������������������������������������������0000644�0001750�0001750�00000002714�11255737546�016600� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 <PDFKit/PDFDocument.h> @interface PDFDocument (WebPDFDocumentExtras) - (NSArray *)_web_allScripts; @end void addWebPDFDocumentExtras(Class); ����������������������������������������������������WebKit/mac/WebView/WebHTMLViewInternal.h������������������������������������������������������������0000644�0001750�0001750�00000005560�11242164623�016361� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ // Things internal to the WebKit framework; not SPI. #import "WebHTMLViewPrivate.h" #if USE(ACCELERATED_COMPOSITING) @class CALayer; #endif @class WebFrame; namespace WebCore { class CachedImage; class KeyboardEvent; } @interface WebHTMLView (WebInternal) - (void)_selectionChanged; - (void)_updateFontPanel; - (BOOL)_canSmartCopyOrDelete; - (id <WebHTMLHighlighter>)_highlighterForType:(NSString*)type; - (WebFrame *)_frame; - (void)_lookUpInDictionaryFromMenu:(id)sender; - (void)_hoverFeedbackSuspendedChanged; - (BOOL)_interceptEditingKeyEvent:(WebCore::KeyboardEvent *)event shouldSaveCommand:(BOOL)shouldSave; - (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard; - (NSEvent *)_mouseDownEvent; #ifndef BUILDING_ON_TIGER - (BOOL)isGrammarCheckingEnabled; - (void)setGrammarCheckingEnabled:(BOOL)flag; - (void)toggleGrammarChecking:(id)sender; #endif - (WebCore::CachedImage*)promisedDragTIFFDataSource; - (void)setPromisedDragTIFFDataSource:(WebCore::CachedImage*)source; - (void)_web_layoutIfNeededRecursive; - (void)_destroyAllWebPlugins; - (BOOL)_needsLayout; #if USE(ACCELERATED_COMPOSITING) - (void)attachRootLayer:(CALayer*)layer; - (void)detachRootLayer; #endif #if USE(ACCELERATED_COMPOSITING) && defined(BUILDING_ON_LEOPARD) - (void)_updateLayerHostingViewPosition; #endif @end ������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebFormDelegate.h����������������������������������������������������������������0000644�0001750�0001750�00000006516�10521047242�015621� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003, 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <AppKit/AppKit.h> @class DOMElement; @class DOMHTMLInputElement; @class DOMHTMLTextAreaElement; @class WebFrame; /*! @protocol WebFormSubmissionListener */ @protocol WebFormSubmissionListener <NSObject> - (void)continue; @end /*! @protocol WebFormDelegate */ @protocol WebFormDelegate <NSObject> // Various methods send by controls that edit text to their delegates, which are all // analogous to similar methods in AppKit/NSControl.h. // These methods are forwarded from widgets used in forms to the WebFormDelegate. - (void)textFieldDidBeginEditing:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame; - (void)textFieldDidEndEditing:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame; - (void)textDidChangeInTextField:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame; - (void)textDidChangeInTextArea:(DOMHTMLTextAreaElement *)element inFrame:(WebFrame *)frame; - (BOOL)textField:(DOMHTMLInputElement *)element doCommandBySelector:(SEL)commandSelector inFrame:(WebFrame *)frame; - (BOOL)textField:(DOMHTMLInputElement *)element shouldHandleEvent:(NSEvent *)event inFrame:(WebFrame *)frame; // Sent when a form is just about to be submitted (before the load is started) // listener must be sent continue when the delegate is done. - (void)frame:(WebFrame *)frame sourceFrame:(WebFrame *)sourceFrame willSubmitForm:(DOMElement *)form withValues:(NSDictionary *)values submissionListener:(id <WebFormSubmissionListener>)listener; @end /*! @class WebFormDelegate @discussion The WebFormDelegate class responds to all WebFormDelegate protocol methods by doing nothing. It's provided for the convenience of clients who only want to implement some of the above methods and ignore others. */ @interface WebFormDelegate : NSObject <WebFormDelegate> @end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebHTMLRepresentation.mm���������������������������������������������������������0000644�0001750�0001750�00000026423�11201156670�017135� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebHTMLRepresentation.h" #import "DOMElementInternal.h" #import "DOMRangeInternal.h" #import "WebArchive.h" #import "WebBasePluginPackage.h" #import "WebDataSourceInternal.h" #import "WebDocumentPrivate.h" #import "WebFrameInternal.h" #import "WebKitNSStringExtras.h" #import "WebKitStatisticsPrivate.h" #import "WebNSAttributedStringExtras.h" #import "WebNSObjectExtras.h" #import "WebView.h" #import <Foundation/NSURLResponse.h> #import <WebCore/Document.h> #import <WebCore/DocumentLoader.h> #import <WebCore/Frame.h> #import <WebCore/FrameLoader.h> #import <WebCore/FrameLoaderClient.h> #import <WebCore/HTMLFormControlElement.h> #import <WebCore/HTMLFormElement.h> #import <WebCore/HTMLInputElement.h> #import <WebCore/HTMLNames.h> #import <WebCore/MIMETypeRegistry.h> #import <WebCore/Range.h> #import <WebCore/TextResourceDecoder.h> #import <WebKit/DOMHTMLInputElement.h> #import <wtf/Assertions.h> #import <wtf/StdLibExtras.h> using namespace WebCore; using namespace HTMLNames; @interface WebHTMLRepresentationPrivate : NSObject { @public WebDataSource *dataSource; BOOL hasSentResponseToPlugin; id <WebPluginManualLoader> manualLoader; NSView *pluginView; } @end @implementation WebHTMLRepresentationPrivate @end @implementation WebHTMLRepresentation static NSArray *stringArray(const HashSet<String>& set) { NSMutableArray *array = [NSMutableArray arrayWithCapacity:set.size()]; HashSet<String>::const_iterator end = set.end(); for (HashSet<String>::const_iterator it = set.begin(); it != end; ++it) [array addObject:(NSString *)(*it)]; return array; } static NSArray *concatenateArrays(NSArray *first, NSArray *second) { NSMutableArray *result = [[first mutableCopy] autorelease]; [result addObjectsFromArray:second]; return result; } + (NSArray *)supportedMIMETypes { DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, staticSupportedMIMETypes, (concatenateArrays([self supportedNonImageMIMETypes], [self supportedImageMIMETypes]))); return staticSupportedMIMETypes.get(); } + (NSArray *)supportedNonImageMIMETypes { DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, staticSupportedNonImageMIMETypes, (stringArray(MIMETypeRegistry::getSupportedNonImageMIMETypes()))); return staticSupportedNonImageMIMETypes.get(); } + (NSArray *)supportedImageMIMETypes { DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, staticSupportedImageMIMETypes, (stringArray(MIMETypeRegistry::getSupportedImageMIMETypes()))); return staticSupportedImageMIMETypes.get(); } - init { self = [super init]; if (!self) return nil; _private = [[WebHTMLRepresentationPrivate alloc] init]; ++WebHTMLRepresentationCount; return self; } - (void)dealloc { --WebHTMLRepresentationCount; [_private release]; [super dealloc]; } - (void)finalize { --WebHTMLRepresentationCount; [super finalize]; } - (void)_redirectDataToManualLoader:(id<WebPluginManualLoader>)manualLoader forPluginView:(NSView *)pluginView { _private->manualLoader = manualLoader; _private->pluginView = pluginView; } - (void)setDataSource:(WebDataSource *)dataSource { _private->dataSource = dataSource; } - (BOOL)_isDisplayingWebArchive { return [[_private->dataSource _responseMIMEType] _webkit_isCaseInsensitiveEqualToString:@"application/x-webarchive"]; } - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource { WebFrame *webFrame = [dataSource webFrame]; if (webFrame) { if (!_private->pluginView) [webFrame _receivedData:data textEncodingName:[[_private->dataSource response] textEncodingName]]; // If the document is a stand-alone media document, now is the right time to cancel the WebKit load Frame* coreFrame = core(webFrame); if (coreFrame->document() && coreFrame->document()->isMediaDocument()) coreFrame->loader()->documentLoader()->cancelMainResourceLoad(coreFrame->loader()->client()->pluginWillHandleLoadError(coreFrame->loader()->documentLoader()->response())); if (_private->pluginView) { if (!_private->hasSentResponseToPlugin) { [_private->manualLoader pluginView:_private->pluginView receivedResponse:[dataSource response]]; _private->hasSentResponseToPlugin = YES; } [_private->manualLoader pluginView:_private->pluginView receivedData:data]; } } } - (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource { if (_private->pluginView) { [_private->manualLoader pluginView:_private->pluginView receivedError:error]; } } - (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource { WebFrame *frame = [dataSource webFrame]; if (_private->pluginView) { [_private->manualLoader pluginViewFinishedLoading:_private->pluginView]; return; } if (frame) { if (![self _isDisplayingWebArchive]) { // Telling the frame we received some data and passing nil as the data is our // way to get work done that is normally done when the first bit of data is // received, even for the case of a document with no data (like about:blank). [frame _receivedData:nil textEncodingName:[[_private->dataSource response] textEncodingName]]; } WebView *webView = [frame webView]; if ([webView isEditable]) core(frame)->applyEditingStyleToBodyElement(); } } - (BOOL)canProvideDocumentSource { return [[_private->dataSource webFrame] _canProvideDocumentSource]; } - (BOOL)canSaveAsWebArchive { return [[_private->dataSource webFrame] _canSaveAsWebArchive]; } - (NSString *)documentSource { if ([self _isDisplayingWebArchive]) { SharedBuffer *parsedArchiveData = [_private->dataSource _documentLoader]->parsedArchiveData(); NSData *nsData = parsedArchiveData ? parsedArchiveData->createNSData() : nil; NSString *result = [[NSString alloc] initWithData:nsData encoding:NSUTF8StringEncoding]; [nsData release]; return [result autorelease]; } Frame* coreFrame = core([_private->dataSource webFrame]); if (!coreFrame) return nil; Document* document = coreFrame->document(); if (!document) return nil; TextResourceDecoder* decoder = document->decoder(); if (!decoder) return nil; NSData *data = [_private->dataSource data]; if (!data) return nil; return decoder->encoding().decode(reinterpret_cast<const char*>([data bytes]), [data length]); } - (NSString *)title { return nsStringNilIfEmpty([_private->dataSource _documentLoader]->title()); } - (DOMDocument *)DOMDocument { return [[_private->dataSource webFrame] DOMDocument]; } - (NSAttributedString *)attributedText { // FIXME: Implement return nil; } - (NSAttributedString *)attributedStringFrom:(DOMNode *)startNode startOffset:(int)startOffset to:(DOMNode *)endNode endOffset:(int)endOffset { return [NSAttributedString _web_attributedStringFromRange:Range::create(core(startNode)->document(), core(startNode), startOffset, core(endNode), endOffset).get()]; } static HTMLFormElement* formElementFromDOMElement(DOMElement *element) { Element* node = core(element); return node && node->hasTagName(formTag) ? static_cast<HTMLFormElement*>(node) : 0; } - (DOMElement *)elementWithName:(NSString *)name inForm:(DOMElement *)form { HTMLFormElement* formElement = formElementFromDOMElement(form); if (!formElement) return nil; Vector<HTMLFormControlElement*>& elements = formElement->formElements; AtomicString targetName = name; for (unsigned i = 0; i < elements.size(); i++) { HTMLFormControlElement* elt = elements[i]; if (elt->formControlName() == targetName) return kit(elt); } return nil; } static HTMLInputElement* inputElementFromDOMElement(DOMElement* element) { Element* node = core(element); return node && node->hasTagName(inputTag) ? static_cast<HTMLInputElement*>(node) : 0; } - (BOOL)elementDoesAutoComplete:(DOMElement *)element { HTMLInputElement* inputElement = inputElementFromDOMElement(element); return inputElement && inputElement->inputType() == HTMLInputElement::TEXT && inputElement->autoComplete(); } - (BOOL)elementIsPassword:(DOMElement *)element { HTMLInputElement* inputElement = inputElementFromDOMElement(element); return inputElement && inputElement->inputType() == HTMLInputElement::PASSWORD; } - (DOMElement *)formForElement:(DOMElement *)element { HTMLInputElement* inputElement = inputElementFromDOMElement(element); return inputElement ? kit(inputElement->form()) : 0; } - (DOMElement *)currentForm { return kit(core([_private->dataSource webFrame])->currentForm()); } - (NSArray *)controlsInForm:(DOMElement *)form { HTMLFormElement* formElement = formElementFromDOMElement(form); if (!formElement) return nil; NSMutableArray *results = nil; Vector<HTMLFormControlElement*>& elements = formElement->formElements; for (unsigned i = 0; i < elements.size(); i++) { if (elements[i]->isEnumeratable()) { // Skip option elements, other duds DOMElement* de = kit(elements[i]); if (!results) results = [NSMutableArray arrayWithObject:de]; else [results addObject:de]; } } return results; } - (NSString *)searchForLabels:(NSArray *)labels beforeElement:(DOMElement *)element { return core([_private->dataSource webFrame])->searchForLabelsBeforeElement(labels, core(element)); } - (NSString *)matchLabels:(NSArray *)labels againstElement:(DOMElement *)element { return core([_private->dataSource webFrame])->matchLabelsAgainstElement(labels, core(element)); } @end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebPreferences.h�����������������������������������������������������������������0000644�0001750�0001750�00000026320�11223160544�015520� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003, 2004, 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 #define WebNSUInteger unsigned int #else #define WebNSUInteger NSUInteger #endif /*! @enum WebCacheModel @abstract Specifies a usage model for a WebView, which WebKit will use to determine its caching behavior. @constant WebCacheModelDocumentViewer Appropriate for a WebView displaying a fixed document -- like a splash screen, a chat document, or a word processing document -- with no UI for navigation. The WebView will behave like any other view, releasing resources when they are no longer referenced. Remote resources, if any, will be cached to disk. This is the most memory-efficient setting. Examples: iChat, Mail, TextMate, Growl. @constant WebCacheModelDocumentBrowser Appropriate for a WebView displaying a browsable series of documents with a UI for navigating between them -- for example, a reference materials browser or a website designer. The WebView will cache a reasonable number of resources and previously viewed documents in memory and/or on disk. Examples: Dictionary, Help Viewer, Coda. @constant WebCacheModelPrimaryWebBrowser Appropriate for a WebView in the application that acts as the user's primary web browser. The WebView will cache a very large number of resources and previously viewed documents in memory and/or on disk. Examples: Safari, OmniWeb, Shiira. */ enum { WebCacheModelDocumentViewer = 0, WebCacheModelDocumentBrowser = 1, WebCacheModelPrimaryWebBrowser = 2 }; typedef WebNSUInteger WebCacheModel; @class WebPreferencesPrivate; extern NSString *WebPreferencesChangedNotification; /*! @class WebPreferences */ @interface WebPreferences: NSObject <NSCoding> { @private WebPreferencesPrivate *_private; } /*! @method standardPreferences */ + (WebPreferences *)standardPreferences; /*! @method initWithIdentifier: @param anIdentifier A string used to identify the WebPreferences. @discussion WebViews can share instances of WebPreferences by using an instance of WebPreferences with the same identifier. Typically, instance are not created directly. Instead you set the preferences identifier on a WebView. The identifier is used as a prefix that is added to the user defaults keys for the WebPreferences. @result Returns a new instance of WebPreferences or a previously allocated instance with the same identifier. */ - (id)initWithIdentifier:(NSString *)anIdentifier; /*! @method identifier @result Returns the identifier for this WebPreferences. */ - (NSString *)identifier; /*! @method standardFontFamily */ - (NSString *)standardFontFamily; /*! @method setStandardFontFamily: @param family */ - (void)setStandardFontFamily:(NSString *)family; /*! @method fixedFontFamily */ - (NSString *)fixedFontFamily; /*! @method setFixedFontFamily: @param family */ - (void)setFixedFontFamily:(NSString *)family; /*! @method serifFontFamily */ - (NSString *)serifFontFamily; /*! @method setSerifFontFamily: @param family */ - (void)setSerifFontFamily:(NSString *)family; /*! @method sansSerifFontFamily */ - (NSString *)sansSerifFontFamily; /*! @method setSansSerifFontFamily: @param family */ - (void)setSansSerifFontFamily:(NSString *)family; /*! @method cursiveFontFamily */ - (NSString *)cursiveFontFamily; /*! @method setCursiveFontFamily: @param family */ - (void)setCursiveFontFamily:(NSString *)family; /*! @method fantasyFontFamily */ - (NSString *)fantasyFontFamily; /*! @method setFantasyFontFamily: @param family */ - (void)setFantasyFontFamily:(NSString *)family; /*! @method defaultFontSize */ - (int)defaultFontSize; /*! @method setDefaultFontSize: @param size */ - (void)setDefaultFontSize:(int)size; /*! @method defaultFixedFontSize */ - (int)defaultFixedFontSize; /*! @method setDefaultFixedFontSize: @param size */ - (void)setDefaultFixedFontSize:(int)size; /*! @method minimumFontSize */ - (int)minimumFontSize; /*! @method setMinimumFontSize: @param size */ - (void)setMinimumFontSize:(int)size; /*! @method minimumLogicalFontSize */ - (int)minimumLogicalFontSize; /*! @method setMinimumLogicalFontSize: @param size */ - (void)setMinimumLogicalFontSize:(int)size; /*! @method defaultTextEncodingName */ - (NSString *)defaultTextEncodingName; /*! @method setDefaultTextEncodingName: @param encoding */ - (void)setDefaultTextEncodingName:(NSString *)encoding; /*! @method userStyleSheetEnabled */ - (BOOL)userStyleSheetEnabled; /*! @method setUserStyleSheetEnabled: @param flag */ - (void)setUserStyleSheetEnabled:(BOOL)flag; /*! @method userStyleSheetLocation @discussion The location of the user style sheet. */ - (NSURL *)userStyleSheetLocation; /*! @method setUserStyleSheetLocation: @param URL The location of the user style sheet. */ - (void)setUserStyleSheetLocation:(NSURL *)URL; /*! @method isJavaEnabled */ - (BOOL)isJavaEnabled; /*! @method setJavaEnabled: @param flag */ - (void)setJavaEnabled:(BOOL)flag; /*! @method isJavaScriptEnabled */ - (BOOL)isJavaScriptEnabled; /*! @method setJavaScriptEnabled: @param flag */ - (void)setJavaScriptEnabled:(BOOL)flag; /*! @method JavaScriptCanOpenWindowsAutomatically */ - (BOOL)javaScriptCanOpenWindowsAutomatically; /*! @method setJavaScriptCanOpenWindowsAutomatically: @param flag */ - (void)setJavaScriptCanOpenWindowsAutomatically:(BOOL)flag; /*! @method arePlugInsEnabled */ - (BOOL)arePlugInsEnabled; /*! @method setPlugInsEnabled: @param flag */ - (void)setPlugInsEnabled:(BOOL)flag; /*! @method allowAnimatedImages */ - (BOOL)allowsAnimatedImages; /*! @method setAllowAnimatedImages: @param flag */ - (void)setAllowsAnimatedImages:(BOOL)flag; /*! @method allowAnimatedImageLooping */ - (BOOL)allowsAnimatedImageLooping; /*! @method setAllowAnimatedImageLooping: @param flag */ - (void)setAllowsAnimatedImageLooping: (BOOL)flag; /*! @method setWillLoadImagesAutomatically: @param flag */ - (void)setLoadsImagesAutomatically: (BOOL)flag; /*! @method willLoadImagesAutomatically */ - (BOOL)loadsImagesAutomatically; /*! @method setAutosaves: @param flag @discussion If autosave preferences is YES the settings represented by WebPreferences will be stored in the user defaults database. */ - (void)setAutosaves:(BOOL)flag; /*! @method autosaves @result The value of the autosave preferences flag. */ - (BOOL)autosaves; /*! @method setShouldPrintBackgrounds: @param flag */ - (void)setShouldPrintBackgrounds:(BOOL)flag; /*! @method shouldPrintBackgrounds @result The value of the shouldPrintBackgrounds preferences flag */ - (BOOL)shouldPrintBackgrounds; /*! @method setPrivateBrowsingEnabled: @param flag @abstract If private browsing is enabled, WebKit will not store information about sites the user visits. */ - (void)setPrivateBrowsingEnabled:(BOOL)flag; /*! @method privateBrowsingEnabled */ - (BOOL)privateBrowsingEnabled; /*! @method setTabsToLinks: @param flag @abstract If tabsToLinks is YES, the tab key will focus links and form controls. The option key temporarily reverses this preference. */ - (void)setTabsToLinks:(BOOL)flag; /*! @method tabsToLinks */ - (BOOL)tabsToLinks; /*! @method setUsesPageCache: @abstract Sets whether the receiver's associated WebViews use the shared page cache. @param UsesPageCache Whether the receiver's associated WebViews use the shared page cache. @discussion Pages are cached as they are added to a WebBackForwardList, and removed from the cache as they are removed from a WebBackForwardList. Because the page cache is global, caching a page in one WebBackForwardList may cause a page in another WebBackForwardList to be evicted from the cache. */ - (void)setUsesPageCache:(BOOL)usesPageCache; /*! @method usesPageCache @abstract Returns whether the receiver should use the shared page cache. @result Whether the receiver should use the shared page cache. @discussion Pages are cached as they are added to a WebBackForwardList, and removed from the cache as they are removed from a WebBackForwardList. Because the page cache is global, caching a page in one WebBackForwardList may cause a page in another WebBackForwardList to be evicted from the cache. */ - (BOOL)usesPageCache; /*! @method setCacheModel: @abstract Specifies a usage model for a WebView, which WebKit will use to determine its caching behavior. @param cacheModel The WebView's usage model for WebKit. If necessary, WebKit will prune its caches to match cacheModel. @discussion Research indicates that users tend to browse within clusters of documents that hold resources in common, and to revisit previously visited documents. WebKit and the frameworks below it include built-in caches that take advantage of these patterns, substantially improving document load speed in browsing situations. The WebKit cache model controls the behaviors of all of these caches, including NSURLCache and the various WebCore caches. Applications with a browsing interface can improve document load speed substantially by specifying WebCacheModelDocumentBrowser. Applications without a browsing interface can reduce memory usage substantially by specifying WebCacheModelDocumentViewer. If setCacheModel: is not called, WebKit will select a cache model automatically. */ - (void)setCacheModel:(WebCacheModel)cacheModel; /*! @method cacheModel: @abstract Returns the usage model according to which WebKit determines its caching behavior. @result The usage model. */ - (WebCacheModel)cacheModel; @end #undef WebNSUInteger ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebFormDelegate.m����������������������������������������������������������������0000644�0001750�0001750�00000005655�10521047242�015631� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebFormDelegatePrivate.h" // FIXME: This could become an informal protocol; we switched all the API // delegates to be informal. @implementation WebFormDelegate static WebFormDelegate *sharedDelegate = nil; // Return a object with NOP implementations of the protocol's methods // Note this feature relies on our default delegate being stateless + (WebFormDelegate *)_sharedWebFormDelegate { if (!sharedDelegate) sharedDelegate = [[WebFormDelegate alloc] init]; return sharedDelegate; } - (void)textFieldDidBeginEditing:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame { } - (void)textFieldDidEndEditing:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame { } - (void)textDidChangeInTextField:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame { } - (void)textDidChangeInTextArea:(DOMHTMLTextAreaElement *)element inFrame:(WebFrame *)frame { } - (BOOL)textField:(DOMHTMLInputElement *)element doCommandBySelector:(SEL)commandSelector inFrame:(WebFrame *)frame { return NO; } - (BOOL)textField:(DOMHTMLInputElement *)element shouldHandleEvent:(NSEvent *)event inFrame:(WebFrame *)frame { return NO; } - (void)frame:(WebFrame *)frame sourceFrame:(WebFrame *)sourceFrame willSubmitForm:(DOMElement *)form withValues:(NSDictionary *)values submissionListener:(id <WebFormSubmissionListener>)listener { [listener continue]; } @end �����������������������������������������������������������������������������������WebKit/mac/WebView/WebArchive.mm��������������������������������������������������������������������0000644�0001750�0001750�00000030762�11161603011�015017� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebArchive.h" #import "WebArchiveInternal.h" #import "WebKitLogging.h" #import "WebNSObjectExtras.h" #import "WebResourceInternal.h" #import "WebTypesInternal.h" #import <JavaScriptCore/InitializeThreading.h> #import <WebCore/ArchiveResource.h> #import <WebCore/LegacyWebArchive.h> #import <WebCore/ThreadCheck.h> #import <WebCore/WebCoreObjCExtras.h> using namespace WebCore; NSString *WebArchivePboardType = @"Apple Web Archive pasteboard type"; static NSString * const WebMainResourceKey = @"WebMainResource"; static NSString * const WebSubresourcesKey = @"WebSubresources"; static NSString * const WebSubframeArchivesKey = @"WebSubframeArchives"; @interface WebArchivePrivate : NSObject { @public WebResource *cachedMainResource; NSArray *cachedSubresources; NSArray *cachedSubframeArchives; @private RefPtr<LegacyWebArchive> coreArchive; } - (id)initWithCoreArchive:(PassRefPtr<LegacyWebArchive>)coreArchive; - (LegacyWebArchive*)coreArchive; - (void)setCoreArchive:(PassRefPtr<LegacyWebArchive>)newCoreArchive; @end @implementation WebArchivePrivate + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif } - (id)init { self = [super init]; if (!self) return nil; coreArchive = LegacyWebArchive::create(); return self; } - (id)initWithCoreArchive:(PassRefPtr<LegacyWebArchive>)_coreArchive { self = [super init]; if (!self || !_coreArchive) { [self release]; return nil; } coreArchive = _coreArchive; return self; } - (LegacyWebArchive*)coreArchive { return coreArchive.get(); } - (void)setCoreArchive:(PassRefPtr<LegacyWebArchive>)newCoreArchive { ASSERT(coreArchive); ASSERT(newCoreArchive); coreArchive = newCoreArchive; } - (void)dealloc { if (WebCoreObjCScheduleDeallocateOnMainThread([WebArchivePrivate class], self)) return; [cachedMainResource release]; [cachedSubresources release]; [cachedSubframeArchives release]; [super dealloc]; } @end @implementation WebArchive - (id)init { WebCoreThreadViolationCheckRoundTwo(); self = [super init]; if (!self) return nil; _private = [[WebArchivePrivate alloc] init]; return self; } static BOOL isArrayOfClass(id object, Class elementClass) { if (![object isKindOfClass:[NSArray class]]) return NO; NSArray *array = (NSArray *)object; NSUInteger count = [array count]; for (NSUInteger i = 0; i < count; ++i) if (![[array objectAtIndex:i] isKindOfClass:elementClass]) return NO; return YES; } - (id)initWithMainResource:(WebResource *)mainResource subresources:(NSArray *)subresources subframeArchives:(NSArray *)subframeArchives { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) return [[self _webkit_invokeOnMainThread] initWithMainResource:mainResource subresources:subresources subframeArchives:subframeArchives]; #endif WebCoreThreadViolationCheckRoundTwo(); self = [super init]; if (!self) return nil; _private = [[WebArchivePrivate alloc] init]; _private->cachedMainResource = [mainResource retain]; if (!_private->cachedMainResource) { [self release]; return nil; } if (!subresources || isArrayOfClass(subresources, [WebResource class])) _private->cachedSubresources = [subresources retain]; else { [self release]; return nil; } if (!subframeArchives || isArrayOfClass(subframeArchives, [WebArchive class])) _private->cachedSubframeArchives = [subframeArchives retain]; else { [self release]; return nil; } RefPtr<ArchiveResource> coreMainResource = mainResource ? [mainResource _coreResource] : 0; Vector<PassRefPtr<ArchiveResource> > coreResources; NSEnumerator *enumerator = [subresources objectEnumerator]; WebResource *subresource; while ((subresource = [enumerator nextObject]) != nil) coreResources.append([subresource _coreResource]); Vector<PassRefPtr<LegacyWebArchive> > coreArchives; enumerator = [subframeArchives objectEnumerator]; WebArchive *subframeArchive; while ((subframeArchive = [enumerator nextObject]) != nil) coreArchives.append([subframeArchive->_private coreArchive]); [_private setCoreArchive:LegacyWebArchive::create(coreMainResource.release(), coreResources, coreArchives)]; if (![_private coreArchive]) { [self release]; return nil; } return self; } - (id)initWithData:(NSData *)data { WebCoreThreadViolationCheckRoundTwo(); self = [super init]; if (!self) return nil; #if !LOG_DISABLED CFAbsoluteTime start = CFAbsoluteTimeGetCurrent(); #endif _private = [[WebArchivePrivate alloc] init]; RefPtr<LegacyWebArchive> coreArchive = LegacyWebArchive::create(SharedBuffer::wrapNSData(data).get()); if (!coreArchive) { [self release]; return nil; } [_private setCoreArchive:coreArchive.release()]; #if !LOG_DISABLED CFAbsoluteTime end = CFAbsoluteTimeGetCurrent(); CFAbsoluteTime duration = end - start; #endif LOG(Timing, "Parsing web archive with [NSPropertyListSerialization propertyListFromData::::] took %f seconds", duration); return self; } - (id)initWithCoder:(NSCoder *)decoder { WebResource *mainResource = nil; NSArray *subresources = nil; NSArray *subframeArchives = nil; @try { id object = [decoder decodeObjectForKey:WebMainResourceKey]; if ([object isKindOfClass:[WebResource class]]) mainResource = [object retain]; object = [decoder decodeObjectForKey:WebSubresourcesKey]; if (isArrayOfClass(object, [WebResource class])) subresources = [object retain]; object = [decoder decodeObjectForKey:WebSubframeArchivesKey]; if (isArrayOfClass(object, [WebArchive class])) subframeArchives = [object retain]; } @catch(id) { [self release]; return nil; } return [self initWithMainResource:mainResource subresources:subresources subframeArchives:subframeArchives]; } - (void)encodeWithCoder:(NSCoder *)encoder { [encoder encodeObject:[self mainResource] forKey:WebMainResourceKey]; [encoder encodeObject:[self subresources] forKey:WebSubresourcesKey]; [encoder encodeObject:[self subframeArchives] forKey:WebSubframeArchivesKey]; } - (void)dealloc { [_private release]; [super dealloc]; } - (id)copyWithZone:(NSZone *)zone { return [self retain]; } - (WebResource *)mainResource { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) return [[self _webkit_invokeOnMainThread] mainResource]; #endif WebCoreThreadViolationCheckRoundTwo(); // Currently from WebKit API perspective, WebArchives are entirely immutable once created // If they ever become mutable, we'll need to rethink this. if (!_private->cachedMainResource) { LegacyWebArchive* coreArchive = [_private coreArchive]; if (coreArchive) _private->cachedMainResource = [[WebResource alloc] _initWithCoreResource:coreArchive->mainResource()]; } return [[_private->cachedMainResource retain] autorelease]; } - (NSArray *)subresources { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) return [[self _webkit_invokeOnMainThread] subresources]; #endif WebCoreThreadViolationCheckRoundTwo(); // Currently from WebKit API perspective, WebArchives are entirely immutable once created // If they ever become mutable, we'll need to rethink this. if (!_private->cachedSubresources) { LegacyWebArchive* coreArchive = [_private coreArchive]; if (!coreArchive) _private->cachedSubresources = [[NSArray alloc] init]; else { const Vector<RefPtr<ArchiveResource> >& subresources(coreArchive->subresources()); NSMutableArray *mutableArray = [[NSMutableArray alloc] initWithCapacity:subresources.size()]; _private->cachedSubresources = mutableArray; for (unsigned i = 0; i < subresources.size(); ++i) { WebResource *resource = [[WebResource alloc] _initWithCoreResource:subresources[i].get()]; if (resource) { [mutableArray addObject:resource]; [resource release]; } } } } // Maintain the WebKit 3 behavior of this API, which is documented and // relied upon by some clients, of returning nil if there are no subresources. return [_private->cachedSubresources count] ? [[_private->cachedSubresources retain] autorelease] : nil; } - (NSArray *)subframeArchives { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) return [[self _webkit_invokeOnMainThread] subframeArchives]; #endif WebCoreThreadViolationCheckRoundTwo(); // Currently from WebKit API perspective, WebArchives are entirely immutable once created // If they ever become mutable, we'll need to rethink this. if (!_private->cachedSubframeArchives) { LegacyWebArchive* coreArchive = [_private coreArchive]; if (!coreArchive) _private->cachedSubframeArchives = [[NSArray alloc] init]; else { const Vector<RefPtr<Archive> >& subframeArchives(coreArchive->subframeArchives()); NSMutableArray *mutableArray = [[NSMutableArray alloc] initWithCapacity:subframeArchives.size()]; _private->cachedSubframeArchives = mutableArray; for (unsigned i = 0; i < subframeArchives.size(); ++i) { WebArchive *archive = [[WebArchive alloc] _initWithCoreLegacyWebArchive:(LegacyWebArchive *)subframeArchives[i].get()]; [mutableArray addObject:archive]; [archive release]; } } } return [[_private->cachedSubframeArchives retain] autorelease]; } - (NSData *)data { WebCoreThreadViolationCheckRoundTwo(); #if !LOG_DISABLED CFAbsoluteTime start = CFAbsoluteTimeGetCurrent(); #endif RetainPtr<CFDataRef> data = [_private coreArchive]->rawDataRepresentation(); #if !LOG_DISABLED CFAbsoluteTime end = CFAbsoluteTimeGetCurrent(); CFAbsoluteTime duration = end - start; #endif LOG(Timing, "Serializing web archive to raw CFPropertyList data took %f seconds", duration); return [[(NSData *)data.get() retain] autorelease]; } @end @implementation WebArchive (WebInternal) - (id)_initWithCoreLegacyWebArchive:(PassRefPtr<WebCore::LegacyWebArchive>)coreLegacyWebArchive { WebCoreThreadViolationCheckRoundTwo(); self = [super init]; if (!self) return nil; _private = [[WebArchivePrivate alloc] initWithCoreArchive:coreLegacyWebArchive]; if (!_private) { [self release]; return nil; } return self; } - (WebCore::LegacyWebArchive *)_coreLegacyWebArchive { WebCoreThreadViolationCheckRoundTwo(); return [_private coreArchive]; } @end ��������������WebKit/mac/WebView/WebFrameView.mm������������������������������������������������������������������0000644�0001750�0001750�00000106623�11250252622�015332� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebFrameView.h" #import "WebClipView.h" #import "WebDataSourcePrivate.h" #import "WebDocument.h" #import "WebDynamicScrollBarsViewInternal.h" #import "WebFrame.h" #import "WebFrameInternal.h" #import "WebFrameViewInternal.h" #import "WebFrameViewPrivate.h" #import "WebHistoryItemInternal.h" #import "WebHTMLViewPrivate.h" #import "WebKeyGenerator.h" #import "WebKitErrorsPrivate.h" #import "WebKitStatisticsPrivate.h" #import "WebKitVersionChecks.h" #import "WebNSDictionaryExtras.h" #import "WebNSObjectExtras.h" #import "WebNSPasteboardExtras.h" #import "WebNSViewExtras.h" #import "WebNSWindowExtras.h" #import "WebPDFView.h" #import "WebPreferenceKeysPrivate.h" #import "WebResourceInternal.h" #import "WebSystemInterface.h" #import "WebViewFactory.h" #import "WebViewInternal.h" #import "WebViewPrivate.h" #import <Foundation/NSURLRequest.h> #import <WebCore/DragController.h> #import <WebCore/EventHandler.h> #import <WebCore/Frame.h> #import <WebCore/FrameView.h> #import <WebCore/HistoryItem.h> #import <WebCore/Page.h> #import <WebCore/RenderPart.h> #import <WebCore/ThreadCheck.h> #import <WebCore/WebCoreFrameView.h> #import <WebCore/WebCoreView.h> #import <WebKitSystemInterface.h> #import <wtf/Assertions.h> using namespace WebCore; @interface NSWindow (WindowPrivate) - (BOOL)_needsToResetDragMargins; - (void)_setNeedsToResetDragMargins:(BOOL)s; @end @interface NSClipView (AppKitSecretsIKnow) - (BOOL)_scrollTo:(const NSPoint *)newOrigin animate:(BOOL)animate; // need the boolean result from this method @end enum { SpaceKey = 0x0020 }; @interface WebFrameView (WebFrameViewFileInternal) <WebCoreFrameView> - (float)_verticalKeyboardScrollDistance; @end @interface WebFrameViewPrivate : NSObject { @public WebFrame *webFrame; WebDynamicScrollBarsView *frameScrollView; } @end @implementation WebFrameViewPrivate - (void)dealloc { [frameScrollView release]; [super dealloc]; } @end @implementation WebFrameView (WebFrameViewFileInternal) - (float)_verticalKeyboardScrollDistance { // Arrow keys scroll the same distance that clicking the scroll arrow does. return [[self _scrollView] verticalLineScroll]; } - (Frame*)_web_frame { return core(_private->webFrame); } @end @implementation WebFrameView (WebInternal) // Note that the WebVew is not retained. - (WebView *)_webView { return [_private->webFrame webView]; } - (void)_setDocumentView:(NSView <WebDocumentView> *)view { WebDynamicScrollBarsView *sv = [self _scrollView]; core([self _webView])->dragController()->setDidInitiateDrag(false); [sv setSuppressLayout:YES]; // If the old view is the first responder, transfer first responder status to the new view as // a convenience and so that we don't leave the window pointing to a view that's no longer in it. NSWindow *window = [sv window]; NSResponder *firstResponder = [window firstResponder]; bool makeNewViewFirstResponder = [firstResponder isKindOfClass:[NSView class]] && [(NSView *)firstResponder isDescendantOf:[sv documentView]]; // Suppress the resetting of drag margins since we know we can't affect them. BOOL resetDragMargins = [window _needsToResetDragMargins]; [window _setNeedsToResetDragMargins:NO]; [sv setDocumentView:view]; [window _setNeedsToResetDragMargins:resetDragMargins]; if (makeNewViewFirstResponder) [window makeFirstResponder:view]; [sv setSuppressLayout:NO]; } -(NSView <WebDocumentView> *)_makeDocumentViewForDataSource:(WebDataSource *)dataSource { NSString* MIMEType = [dataSource _responseMIMEType]; if (!MIMEType) MIMEType = @"text/html"; Class viewClass = [[self class] _viewClassForMIMEType:MIMEType]; NSView <WebDocumentView> *documentView; if (viewClass) { // If the dataSource's representation has already been created, and it is also the // same class as the desired documentView, then use it as the documentView instead // of creating another one (Radar 4340787). id <WebDocumentRepresentation> dataSourceRepresentation = [dataSource representation]; if (dataSourceRepresentation && [dataSourceRepresentation class] == viewClass) documentView = (NSView <WebDocumentView> *)[dataSourceRepresentation retain]; else documentView = [[viewClass alloc] initWithFrame:[self bounds]]; } else documentView = nil; [self _setDocumentView:documentView]; [documentView release]; return documentView; } - (void)_setWebFrame:(WebFrame *)webFrame { if (!webFrame) { NSView *docV = [self documentView]; if ([docV respondsToSelector:@selector(close)]) [docV performSelector:@selector(close)]; } // Not retained because the WebView owns the WebFrame, which owns the WebFrameView. _private->webFrame = webFrame; } - (WebDynamicScrollBarsView *)_scrollView { // This can be called by [super dealloc] when cleaning up the key view loop, // after _private has been nilled out. if (_private == nil) return nil; return _private->frameScrollView; } - (float)_verticalPageScrollDistance { float overlap = [self _verticalKeyboardScrollDistance]; float height = [[self _contentView] bounds].size.height; return (height < overlap) ? height / 2 : height - overlap; } static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCClass, NSArray *supportTypes) { NSEnumerator *enumerator = [supportTypes objectEnumerator]; ASSERT(enumerator != nil); NSString *mime = nil; while ((mime = [enumerator nextObject]) != nil) { // Don't clobber previously-registered classes. if ([allTypes objectForKey:mime] == nil) [allTypes setObject:objCClass forKey:mime]; } } + (NSMutableDictionary *)_viewTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission { static NSMutableDictionary *viewTypes = nil; static BOOL addedImageTypes = NO; if (!viewTypes) { viewTypes = [[NSMutableDictionary alloc] init]; addTypesFromClass(viewTypes, [WebHTMLView class], [WebHTMLView supportedNonImageMIMETypes]); // Since this is a "secret default" we don't bother registering it. BOOL omitPDFSupport = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitOmitPDFSupport"]; if (!omitPDFSupport) addTypesFromClass(viewTypes, [WebPDFView class], [WebPDFView supportedMIMETypes]); } if (!addedImageTypes && !allowImageTypeOmission) { addTypesFromClass(viewTypes, [WebHTMLView class], [WebHTMLView supportedImageMIMETypes]); addedImageTypes = YES; } return viewTypes; } + (BOOL)_canShowMIMETypeAsHTML:(NSString *)MIMEType { return [[[self _viewTypesAllowImageTypeOmission:YES] _webkit_objectForMIMEType:MIMEType] isSubclassOfClass:[WebHTMLView class]]; } + (Class)_viewClassForMIMEType:(NSString *)MIMEType { Class viewClass; return [WebView _viewClass:&viewClass andRepresentationClass:nil forMIMEType:MIMEType] ? viewClass : nil; } - (void)_install { ASSERT(_private->webFrame); ASSERT(_private->frameScrollView); Frame* frame = core(_private->webFrame); ASSERT(frame); ASSERT(frame->page()); // If this isn't the main frame, it must have an owner element set, or it // won't ever get installed in the view hierarchy. ASSERT(frame == frame->page()->mainFrame() || frame->ownerElement()); FrameView* view = frame->view(); view->setPlatformWidget(_private->frameScrollView); // FIXME: Frame tries to do this too. Is this code needed? if (RenderPart* owner = frame->ownerRenderer()) { owner->setWidget(view); // Now the render part owns the view, so we don't any more. } } @end @implementation WebFrameView - initWithCoder:(NSCoder *)decoder { // Older nibs containing WebViews will also contain WebFrameViews. We need to keep track of // their count also to match the decrement in -dealloc. ++WebFrameViewCount; return [super initWithCoder:decoder]; } - initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (!self) return nil; static bool didFirstTimeInitialization; if (!didFirstTimeInitialization) { didFirstTimeInitialization = true; InitWebCoreSystemInterface(); // Need to tell WebCore what function to call for the "History Item has Changed" notification. // Note: We also do this in WebHistoryItem's init method. WebCore::notifyHistoryItemChanged = WKNotifyHistoryItemChanged; [WebViewFactory createSharedFactory]; [WebKeyGenerator createSharedGenerator]; // FIXME: Remove the NSAppKitVersionNumberWithDeferredWindowDisplaySupport check once // once AppKit's Deferred Window Display support is available. #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || !defined(NSAppKitVersionNumberWithDeferredWindowDisplaySupport) // CoreGraphics deferred updates are disabled if WebKitEnableCoalescedUpdatesPreferenceKey is NO // or has no value. For compatibility with Mac OS X 10.5 and lower, deferred updates are off by default. if (![[NSUserDefaults standardUserDefaults] boolForKey:WebKitEnableDeferredUpdatesPreferenceKey]) WKDisableCGDeferredUpdates(); #endif if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_MAIN_THREAD_EXCEPTIONS)) setDefaultThreadViolationBehavior(LogOnFirstThreadViolation, ThreadViolationRoundOne); bool throwExceptionsForRoundTwo = WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_ROUND_TWO_MAIN_THREAD_EXCEPTIONS); #ifdef MAIL_THREAD_WORKAROUND // Even if old Mail is linked with new WebKit, don't throw exceptions. if ([WebResource _needMailThreadWorkaroundIfCalledOffMainThread]) throwExceptionsForRoundTwo = false; #endif if (!throwExceptionsForRoundTwo) setDefaultThreadViolationBehavior(LogOnFirstThreadViolation, ThreadViolationRoundTwo); } _private = [[WebFrameViewPrivate alloc] init]; WebDynamicScrollBarsView *scrollView = [[WebDynamicScrollBarsView alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, frame.size.width, frame.size.height)]; _private->frameScrollView = scrollView; [scrollView setContentView:[[[WebClipView alloc] initWithFrame:[scrollView bounds]] autorelease]]; [scrollView setDrawsBackground:NO]; [scrollView setHasVerticalScroller:NO]; [scrollView setHasHorizontalScroller:NO]; [scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [scrollView setLineScroll:40.0f]; [self addSubview:scrollView]; // Don't call our overridden version of setNextKeyView here; we need to make the standard NSView // link between us and our subview so that previousKeyView and previousValidKeyView work as expected. // This works together with our becomeFirstResponder and setNextKeyView overrides. [super setNextKeyView:scrollView]; ++WebFrameViewCount; return self; } - (void)dealloc { --WebFrameViewCount; [_private release]; _private = nil; [super dealloc]; } - (void)finalize { --WebFrameViewCount; [super finalize]; } - (WebFrame *)webFrame { return _private->webFrame; } - (void)setAllowsScrolling:(BOOL)flag { WebCore::Frame *frame = core([self webFrame]); if (WebCore::FrameView *view = frame? frame->view() : 0) view->setCanHaveScrollbars(flag); } - (BOOL)allowsScrolling { WebCore::Frame *frame = core([self webFrame]); if (WebCore::FrameView *view = frame? frame->view() : 0) return view->canHaveScrollbars(); return YES; } - (NSView <WebDocumentView> *)documentView { return [[self _scrollView] documentView]; } - (BOOL)acceptsFirstResponder { // We always accept first responder; this matches OS X 10.2 WebKit // behavior (see 3469791). return YES; } - (BOOL)becomeFirstResponder { // This works together with setNextKeyView to splice the WebFrameView into // the key loop similar to the way NSScrollView does this. Note that // WebView has similar code. NSWindow *window = [self window]; if ([window keyViewSelectionDirection] == NSSelectingPrevious) { NSView *previousValidKeyView = [self previousValidKeyView]; // If we couldn't find a previous valid key view, ask the WebView. This handles frameset // cases (one is mentioned in Radar bug 3748628). Note that previousValidKeyView should // never be self but can be due to AppKit oddness (mentioned in Radar bug 3748628). if (previousValidKeyView == nil || previousValidKeyView == self) previousValidKeyView = [[[self webFrame] webView] previousValidKeyView]; [window makeFirstResponder:previousValidKeyView]; } else { // If the scroll view won't accept first-responderness now, then just become // the first responder ourself like a normal view. This lets us be the first // responder in cases where no page has yet been loaded. if ([[self _scrollView] acceptsFirstResponder]) [window makeFirstResponder:[self _scrollView]]; } return YES; } - (void)setNextKeyView:(NSView *)aView { // This works together with becomeFirstResponder to splice the WebFrameView into // the key loop similar to the way NSScrollView does this. Note that // WebView has very similar code. if ([self _scrollView] != nil) { [[self _scrollView] setNextKeyView:aView]; } else { [super setNextKeyView:aView]; } } - (BOOL)isOpaque { return [[self _webView] drawsBackground]; } - (void)drawRect:(NSRect)rect { if ([self documentView] == nil) { // Need to paint ourselves if there's no documentView to do it instead. if ([[self _webView] drawsBackground]) { [[[self _webView] backgroundColor] set]; NSRectFill(rect); } } else { #ifndef NDEBUG if ([[self _scrollView] drawsBackground]) { [[NSColor cyanColor] set]; NSRectFill(rect); } #endif } } - (NSRect)visibleRect { // This method can be called beneath -[NSView dealloc] after we have cleared _private. if (!_private) return [super visibleRect]; // FIXME: <rdar://problem/6213380> This method does not work correctly with transforms, for two reasons: // 1) [super visibleRect] does not account for the transform, since it is not represented // in the NSView hierarchy. // 2) -_getVisibleRect: does not correct for transforms. NSRect rendererVisibleRect; if (![[self webFrame] _getVisibleRect:&rendererVisibleRect]) return [super visibleRect]; if (NSIsEmptyRect(rendererVisibleRect)) return NSZeroRect; NSRect viewVisibleRect = [super visibleRect]; if (NSIsEmptyRect(viewVisibleRect)) return NSZeroRect; NSRect frame = [self frame]; // rendererVisibleRect is in the parent's coordinate space, and frame is in the superview's coordinate space. // The return value from this method needs to be in this view's coordinate space. We get that right by subtracting // the origins (and correcting for flipping), but when we support transforms, we will need to do better than this. rendererVisibleRect.origin.x -= frame.origin.x; rendererVisibleRect.origin.y = NSMaxY(frame) - NSMaxY(rendererVisibleRect); return NSIntersectionRect(rendererVisibleRect, viewVisibleRect); } - (void)setFrameSize:(NSSize)size { if (!NSEqualSizes(size, [self frame].size)) { // See WebFrameLoaderClient::provisionalLoadStarted. if ([[[self webFrame] webView] drawsBackground]) [[self _scrollView] setDrawsBackground:YES]; if (Frame* coreFrame = [self _web_frame]) { if (FrameView* coreFrameView = coreFrame->view()) coreFrameView->setNeedsLayout(); } } [super setFrameSize:size]; } - (void)viewDidMoveToWindow { // See WebFrameLoaderClient::provisionalLoadStarted. // Need to check _private for nil because this can be called inside -[WebView initWithCoder:]. if (_private && [[[self webFrame] webView] drawsBackground]) [[self _scrollView] setDrawsBackground:YES]; [super viewDidMoveToWindow]; } - (BOOL)_scrollOverflowInDirection:(ScrollDirection)direction granularity:(ScrollGranularity)granularity { // scrolling overflows is only applicable if we're dealing with an WebHTMLView if (![[self documentView] isKindOfClass:[WebHTMLView class]]) return NO; Frame* frame = core([self webFrame]); if (!frame) return NO; return frame->eventHandler()->scrollOverflow(direction, granularity); } - (BOOL)_scrollToBeginningOfDocument { if ([self _scrollOverflowInDirection:ScrollUp granularity:ScrollByDocument]) return YES; if (![self _hasScrollBars]) return NO; NSPoint point = [[[self _scrollView] documentView] frame].origin; return [[self _contentView] _scrollTo:&point animate:YES]; } - (BOOL)_scrollToEndOfDocument { if ([self _scrollOverflowInDirection:ScrollDown granularity:ScrollByDocument]) return YES; if (![self _hasScrollBars]) return NO; NSRect frame = [[[self _scrollView] documentView] frame]; NSPoint point = NSMakePoint(frame.origin.x, NSMaxY(frame)); return [[self _contentView] _scrollTo:&point animate:YES]; } - (void)scrollToBeginningOfDocument:(id)sender { if ([self _scrollToBeginningOfDocument]) return; if (WebFrameView *child = [self _largestChildWithScrollBars]) { if ([child _scrollToBeginningOfDocument]) return; } [[self nextResponder] tryToPerform:@selector(scrollToBeginningOfDocument:) with:sender]; } - (void)scrollToEndOfDocument:(id)sender { if ([self _scrollToEndOfDocument]) return; if (WebFrameView *child = [self _largestChildWithScrollBars]) { if ([child _scrollToEndOfDocument]) return; } [[self nextResponder] tryToPerform:@selector(scrollToEndOfDocument:) with:sender]; } - (void)_goBack { [[self _webView] goBack]; } - (void)_goForward { [[self _webView] goForward]; } - (BOOL)_scrollVerticallyBy:(float)delta { // This method uses the secret method _scrollTo on NSClipView. // It does that because it needs to know definitively whether scrolling was // done or not to help implement the "scroll parent if we are at the limit" feature. // In the presence of smooth scrolling, there's no easy way to tell if the method // did any scrolling or not with the public API. NSPoint point = [[self _contentView] bounds].origin; point.y += delta; return [[self _contentView] _scrollTo:&point animate:YES]; } - (BOOL)_scrollHorizontallyBy:(float)delta { NSPoint point = [[self _contentView] bounds].origin; point.x += delta; return [[self _contentView] _scrollTo:&point animate:YES]; } - (float)_horizontalKeyboardScrollDistance { // Arrow keys scroll the same distance that clicking the scroll arrow does. return [[self _scrollView] horizontalLineScroll]; } - (float)_horizontalPageScrollDistance { float overlap = [self _horizontalKeyboardScrollDistance]; float width = [[self _contentView] bounds].size.width; return (width < overlap) ? width / 2 : width - overlap; } - (BOOL)_pageVertically:(BOOL)up { if ([self _scrollOverflowInDirection:up ? ScrollUp : ScrollDown granularity:ScrollByPage]) return YES; if (![self _hasScrollBars]) return [[self _largestChildWithScrollBars] _pageVertically:up]; float delta = [self _verticalPageScrollDistance]; return [self _scrollVerticallyBy:up ? -delta : delta]; } - (BOOL)_pageHorizontally:(BOOL)left { if ([self _scrollOverflowInDirection:left ? ScrollLeft : ScrollRight granularity:ScrollByPage]) return YES; if (![self _hasScrollBars]) return [[self _largestChildWithScrollBars] _pageHorizontally:left]; float delta = [self _horizontalPageScrollDistance]; return [self _scrollHorizontallyBy:left ? -delta : delta]; } - (BOOL)_scrollLineVertically:(BOOL)up { if ([self _scrollOverflowInDirection:up ? ScrollUp : ScrollDown granularity:ScrollByLine]) return YES; if (![self _hasScrollBars]) return [[self _largestChildWithScrollBars] _scrollLineVertically:up]; float delta = [self _verticalKeyboardScrollDistance]; return [self _scrollVerticallyBy:up ? -delta : delta]; } - (BOOL)_scrollLineHorizontally:(BOOL)left { if ([self _scrollOverflowInDirection:left ? ScrollLeft : ScrollRight granularity:ScrollByLine]) return YES; if (![self _hasScrollBars]) return [[self _largestChildWithScrollBars] _scrollLineHorizontally:left]; float delta = [self _horizontalKeyboardScrollDistance]; return [self _scrollHorizontallyBy:left ? -delta : delta]; } - (void)scrollPageUp:(id)sender { if (![self _pageVertically:YES]) { // If we were already at the top, tell the next responder to scroll if it can. [[self nextResponder] tryToPerform:@selector(scrollPageUp:) with:sender]; } } - (void)scrollPageDown:(id)sender { if (![self _pageVertically:NO]) { // If we were already at the bottom, tell the next responder to scroll if it can. [[self nextResponder] tryToPerform:@selector(scrollPageDown:) with:sender]; } } - (void)scrollLineUp:(id)sender { if (![self _scrollLineVertically:YES]) [[self nextResponder] tryToPerform:@selector(scrollLineUp:) with:sender]; } - (void)scrollLineDown:(id)sender { if (![self _scrollLineVertically:NO]) [[self nextResponder] tryToPerform:@selector(scrollLineDown:) with:sender]; } - (BOOL)_firstResponderIsFormControl { NSResponder *firstResponder = [[self window] firstResponder]; // WebHTMLView is an NSControl subclass these days, but it's not a form control if ([firstResponder isKindOfClass:[WebHTMLView class]]) { return NO; } return [firstResponder isKindOfClass:[NSControl class]]; } - (void)keyDown:(NSEvent *)event { NSString *characters = [event characters]; int index, count; BOOL callSuper = YES; Frame* coreFrame = [self _web_frame]; BOOL maintainsBackForwardList = coreFrame && coreFrame->page()->backForwardList()->enabled() ? YES : NO; count = [characters length]; for (index = 0; index < count; ++index) { switch ([characters characterAtIndex:index]) { case NSDeleteCharacter: if (!maintainsBackForwardList) { callSuper = YES; break; } // This odd behavior matches some existing browsers, // including Windows IE if ([event modifierFlags] & NSShiftKeyMask) { [self _goForward]; } else { [self _goBack]; } callSuper = NO; break; case SpaceKey: // Checking for a control will allow events to percolate // correctly when the focus is on a form control and we // are in full keyboard access mode. if ((![self allowsScrolling] && ![self _largestChildWithScrollBars]) || [self _firstResponderIsFormControl]) { callSuper = YES; break; } if ([event modifierFlags] & NSShiftKeyMask) { [self scrollPageUp:nil]; } else { [self scrollPageDown:nil]; } callSuper = NO; break; case NSPageUpFunctionKey: if (![self allowsScrolling] && ![self _largestChildWithScrollBars]) { callSuper = YES; break; } [self scrollPageUp:nil]; callSuper = NO; break; case NSPageDownFunctionKey: if (![self allowsScrolling] && ![self _largestChildWithScrollBars]) { callSuper = YES; break; } [self scrollPageDown:nil]; callSuper = NO; break; case NSHomeFunctionKey: if (![self allowsScrolling] && ![self _largestChildWithScrollBars]) { callSuper = YES; break; } [self scrollToBeginningOfDocument:nil]; callSuper = NO; break; case NSEndFunctionKey: if (![self allowsScrolling] && ![self _largestChildWithScrollBars]) { callSuper = YES; break; } [self scrollToEndOfDocument:nil]; callSuper = NO; break; case NSUpArrowFunctionKey: // We don't handle shifted or control-arrow keys here, so let super have a chance. if ([event modifierFlags] & (NSShiftKeyMask | NSControlKeyMask)) { callSuper = YES; break; } if ((![self allowsScrolling] && ![self _largestChildWithScrollBars]) || [[[self window] firstResponder] isKindOfClass:[NSPopUpButton class]]) { // Let arrow keys go through to pop up buttons // <rdar://problem/3455910>: hitting up or down arrows when focus is on a // pop-up menu should pop the menu callSuper = YES; break; } if ([event modifierFlags] & NSCommandKeyMask) { [self scrollToBeginningOfDocument:nil]; } else if ([event modifierFlags] & NSAlternateKeyMask) { [self scrollPageUp:nil]; } else { [self scrollLineUp:nil]; } callSuper = NO; break; case NSDownArrowFunctionKey: // We don't handle shifted or control-arrow keys here, so let super have a chance. if ([event modifierFlags] & (NSShiftKeyMask | NSControlKeyMask)) { callSuper = YES; break; } if ((![self allowsScrolling] && ![self _largestChildWithScrollBars]) || [[[self window] firstResponder] isKindOfClass:[NSPopUpButton class]]) { // Let arrow keys go through to pop up buttons // <rdar://problem/3455910>: hitting up or down arrows when focus is on a // pop-up menu should pop the menu callSuper = YES; break; } if ([event modifierFlags] & NSCommandKeyMask) { [self scrollToEndOfDocument:nil]; } else if ([event modifierFlags] & NSAlternateKeyMask) { [self scrollPageDown:nil]; } else { [self scrollLineDown:nil]; } callSuper = NO; break; case NSLeftArrowFunctionKey: // We don't handle shifted or control-arrow keys here, so let super have a chance. if ([event modifierFlags] & (NSShiftKeyMask | NSControlKeyMask)) { callSuper = YES; break; } // Check back/forward related keys. if ([event modifierFlags] & NSCommandKeyMask) { if (!maintainsBackForwardList) { callSuper = YES; break; } [self _goBack]; } else { // Now check scrolling related keys. if ((![self allowsScrolling] && ![self _largestChildWithScrollBars])) { callSuper = YES; break; } if ([event modifierFlags] & NSAlternateKeyMask) { [self _pageHorizontally:YES]; } else { [self _scrollLineHorizontally:YES]; } } callSuper = NO; break; case NSRightArrowFunctionKey: // We don't handle shifted or control-arrow keys here, so let super have a chance. if ([event modifierFlags] & (NSShiftKeyMask | NSControlKeyMask)) { callSuper = YES; break; } // Check back/forward related keys. if ([event modifierFlags] & NSCommandKeyMask) { if (!maintainsBackForwardList) { callSuper = YES; break; } [self _goForward]; } else { // Now check scrolling related keys. if ((![self allowsScrolling] && ![self _largestChildWithScrollBars])) { callSuper = YES; break; } if ([event modifierFlags] & NSAlternateKeyMask) { [self _pageHorizontally:NO]; } else { [self _scrollLineHorizontally:NO]; } } callSuper = NO; break; } } if (callSuper) { [super keyDown:event]; } else { // if we did something useful, get the cursor out of the way [NSCursor setHiddenUntilMouseMoves:YES]; } } - (NSView *)_webcore_effectiveFirstResponder { NSView *view = [self documentView]; return view ? [view _webcore_effectiveFirstResponder] : [super _webcore_effectiveFirstResponder]; } - (BOOL)canPrintHeadersAndFooters { NSView *documentView = [[self _scrollView] documentView]; if ([documentView respondsToSelector:@selector(canPrintHeadersAndFooters)]) { return [(id)documentView canPrintHeadersAndFooters]; } return NO; } - (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo { NSView *documentView = [[self _scrollView] documentView]; if (!documentView) { return nil; } if ([documentView respondsToSelector:@selector(printOperationWithPrintInfo:)]) { return [(id)documentView printOperationWithPrintInfo:printInfo]; } return [NSPrintOperation printOperationWithView:documentView printInfo:printInfo]; } - (BOOL)documentViewShouldHandlePrint { NSView *documentView = [[self _scrollView] documentView]; if (documentView && [documentView respondsToSelector:@selector(documentViewShouldHandlePrint)]) return [(id)documentView documentViewShouldHandlePrint]; return NO; } - (void)printDocumentView { NSView *documentView = [[self _scrollView] documentView]; if (documentView && [documentView respondsToSelector:@selector(printDocumentView)]) [(id)documentView printDocumentView]; } @end @implementation WebFrameView (WebPrivate) - (float)_area { NSRect frame = [self frame]; return frame.size.height * frame.size.width; } - (BOOL)_hasScrollBars { NSScrollView *scrollView = [self _scrollView]; return [scrollView hasHorizontalScroller] || [scrollView hasVerticalScroller]; } - (WebFrameView *)_largestChildWithScrollBars { WebFrameView *largest = nil; NSArray *frameChildren = [[self webFrame] childFrames]; unsigned i; for (i=0; i < [frameChildren count]; i++) { WebFrameView *childFrameView = [[frameChildren objectAtIndex:i] frameView]; WebFrameView *scrollableFrameView = [childFrameView _hasScrollBars] ? childFrameView : [childFrameView _largestChildWithScrollBars]; if (!scrollableFrameView) continue; // Some ads lurk in child frames of zero width and height, see radar 4406994. These don't count as scrollable. // Maybe someday we'll discover that this minimum area check should be larger, but this covers the known cases. float area = [scrollableFrameView _area]; if (area < 1.0) continue; if (!largest || (area > [largest _area])) { largest = scrollableFrameView; } } return largest; } - (NSClipView *)_contentView { return [[self _scrollView] contentView]; } - (Class)_customScrollViewClass { if ([_private->frameScrollView class] == [WebDynamicScrollBarsView class]) return nil; return [_private->frameScrollView class]; } - (void)_setCustomScrollViewClass:(Class)customClass { if (!customClass) customClass = [WebDynamicScrollBarsView class]; ASSERT([customClass isSubclassOfClass:[WebDynamicScrollBarsView class]]); if (customClass == [_private->frameScrollView class]) return; if (![customClass isSubclassOfClass:[WebDynamicScrollBarsView class]]) return; WebDynamicScrollBarsView *oldScrollView = _private->frameScrollView; // already retained NSView <WebDocumentView> *documentView = [[self documentView] retain]; WebDynamicScrollBarsView *scrollView = [[customClass alloc] initWithFrame:[oldScrollView frame]]; [scrollView setContentView:[[[WebClipView alloc] initWithFrame:[scrollView bounds]] autorelease]]; [scrollView setDrawsBackground:[oldScrollView drawsBackground]]; [scrollView setHasVerticalScroller:[oldScrollView hasVerticalScroller]]; [scrollView setHasHorizontalScroller:[oldScrollView hasHorizontalScroller]]; [scrollView setAutoresizingMask:[oldScrollView autoresizingMask]]; [scrollView setLineScroll:[oldScrollView lineScroll]]; [self addSubview:scrollView]; // don't call our overridden version here; we need to make the standard NSView link between us // and our subview so that previousKeyView and previousValidKeyView work as expected. This works // together with our becomeFirstResponder and setNextKeyView overrides. [super setNextKeyView:scrollView]; _private->frameScrollView = scrollView; [self _setDocumentView:documentView]; [self _install]; [oldScrollView removeFromSuperview]; [oldScrollView release]; [documentView release]; } @end �������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebPreferenceKeysPrivate.h�������������������������������������������������������0000644�0001750�0001750�00000017446�11262231477�017544� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ // These are private because callers should be using the cover methods. They are in // a Private (as opposed to Internal) header file because Safari uses some of them // for managed preferences. #define WebKitLogLevelPreferenceKey @"WebKitLogLevel" #define WebKitStandardFontPreferenceKey @"WebKitStandardFont" #define WebKitFixedFontPreferenceKey @"WebKitFixedFont" #define WebKitSerifFontPreferenceKey @"WebKitSerifFont" #define WebKitSansSerifFontPreferenceKey @"WebKitSansSerifFont" #define WebKitCursiveFontPreferenceKey @"WebKitCursiveFont" #define WebKitFantasyFontPreferenceKey @"WebKitFantasyFont" #define WebKitMinimumFontSizePreferenceKey @"WebKitMinimumFontSize" #define WebKitMinimumLogicalFontSizePreferenceKey @"WebKitMinimumLogicalFontSize" #define WebKitDefaultFontSizePreferenceKey @"WebKitDefaultFontSize" #define WebKitDefaultFixedFontSizePreferenceKey @"WebKitDefaultFixedFontSize" #define WebKitDefaultTextEncodingNamePreferenceKey @"WebKitDefaultTextEncodingName" #define WebKitUsesEncodingDetectorPreferenceKey @"WebKitUsesEncodingDetector" #define WebKitUserStyleSheetEnabledPreferenceKey @"WebKitUserStyleSheetEnabledPreferenceKey" #define WebKitUserStyleSheetLocationPreferenceKey @"WebKitUserStyleSheetLocationPreferenceKey" #define WebKitShouldPrintBackgroundsPreferenceKey @"WebKitShouldPrintBackgroundsPreferenceKey" #define WebKitTextAreasAreResizablePreferenceKey @"WebKitTextAreasAreResizable" #define WebKitShrinksStandaloneImagesToFitPreferenceKey @"WebKitShrinksStandaloneImagesToFit" #define WebKitJavaEnabledPreferenceKey @"WebKitJavaEnabled" #define WebKitJavaScriptEnabledPreferenceKey @"WebKitJavaScriptEnabled" #define WebKitWebSecurityEnabledPreferenceKey @"WebKitWebSecurityEnabled" #define WebKitAllowUniversalAccessFromFileURLsPreferenceKey @"WebKitAllowUniversalAccessFromFileURLs" #define WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey @"WebKitJavaScriptCanOpenWindowsAutomatically" #define WebKitPluginsEnabledPreferenceKey @"WebKitPluginsEnabled" #define WebKitDatabasesEnabledPreferenceKey @"WebKitDatabasesEnabledPreferenceKey" #define WebKitLocalStorageEnabledPreferenceKey @"WebKitLocalStorageEnabledPreferenceKey" #define WebKitExperimentalNotificationsEnabledPreferenceKey @"WebKitExperimentalNotificationsEnabledPreferenceKey" #define WebKitExperimentalWebSocketsEnabledPreferenceKey @"WebKitExperimentalWebSocketsEnabledPreferenceKey" #define WebKitAllowAnimatedImagesPreferenceKey @"WebKitAllowAnimatedImagesPreferenceKey" #define WebKitAllowAnimatedImageLoopingPreferenceKey @"WebKitAllowAnimatedImageLoopingPreferenceKey" #define WebKitDisplayImagesKey @"WebKitDisplayImagesKey" #define WebKitBackForwardCacheExpirationIntervalKey @"WebKitBackForwardCacheExpirationIntervalKey" #define WebKitTabToLinksPreferenceKey @"WebKitTabToLinksPreferenceKey" #define WebKitPrivateBrowsingEnabledPreferenceKey @"WebKitPrivateBrowsingEnabled" #define WebSmartInsertDeleteEnabled @"WebSmartInsertDeleteEnabled" #define WebContinuousSpellCheckingEnabled @"WebContinuousSpellCheckingEnabled" #define WebGrammarCheckingEnabled @"WebGrammarCheckingEnabled" #define WebAutomaticQuoteSubstitutionEnabled @"WebAutomaticQuoteSubstitutionEnabled" #define WebAutomaticLinkDetectionEnabled @"WebAutomaticLinkDetectionEnabled" #define WebAutomaticDashSubstitutionEnabled @"WebAutomaticDashSubstitutionEnabled" #define WebAutomaticTextReplacementEnabled @"WebAutomaticTextReplacementEnabled" #define WebAutomaticSpellingCorrectionEnabled @"WebAutomaticSpellingCorrectionEnabled" #define WebKitDOMPasteAllowedPreferenceKey @"WebKitDOMPasteAllowedPreferenceKey" #define WebKitUsesPageCachePreferenceKey @"WebKitUsesPageCachePreferenceKey" #define WebKitFTPDirectoryTemplatePath @"WebKitFTPDirectoryTemplatePath" #define WebKitForceFTPDirectoryListings @"WebKitForceFTPDirectoryListings" #define WebKitDeveloperExtrasEnabledPreferenceKey @"WebKitDeveloperExtrasEnabledPreferenceKey" #define WebKitAuthorAndUserStylesEnabledPreferenceKey @"WebKitAuthorAndUserStylesEnabledPreferenceKey" #define WebKitApplicationChromeModeEnabledPreferenceKey @"WebKitApplicationChromeModeEnabledPreferenceKey" #define WebKitWebArchiveDebugModeEnabledPreferenceKey @"WebKitWebArchiveDebugModeEnabledPreferenceKey" #define WebKitLocalFileContentSniffingEnabledPreferenceKey @"WebKitLocalFileContentSniffingEnabledPreferenceKey" #define WebKitLocalStorageDatabasePathPreferenceKey @"WebKitLocalStorageDatabasePathPreferenceKey" #define WebKitEnableFullDocumentTeardownPreferenceKey @"WebKitEnableFullDocumentTeardown" #define WebKitOfflineWebApplicationCacheEnabledPreferenceKey @"WebKitOfflineWebApplicationCacheEnabled" #define WebKitZoomsTextOnlyPreferenceKey @"WebKitZoomsTextOnly" #define WebKitXSSAuditorEnabledPreferenceKey @"WebKitXSSAuditorEnabled" #define WebKitAcceleratedCompositingEnabledPreferenceKey @"WebKitAcceleratedCompositingEnabled" #define WebKitWebGLEnabledPreferenceKey @"WebKitWebGLEnabled" #define WebKitPluginHalterEnabledPreferenceKey @"WebKitPluginHalterEnabled" // These are private both because callers should be using the cover methods and because the // cover methods themselves are private. #define WebKitRespectStandardStyleKeyEquivalentsPreferenceKey @"WebKitRespectStandardStyleKeyEquivalents" #define WebKitShowsURLsInToolTipsPreferenceKey @"WebKitShowsURLsInToolTips" #define WebKitPDFDisplayModePreferenceKey @"WebKitPDFDisplayMode" #define WebKitPDFScaleFactorPreferenceKey @"WebKitPDFScaleFactor" #define WebKitUseSiteSpecificSpoofingPreferenceKey @"WebKitUseSiteSpecificSpoofing" #define WebKitEditableLinkBehaviorPreferenceKey @"WebKitEditableLinkBehavior" #define WebKitCacheModelPreferenceKey @"WebKitCacheModelPreferenceKey" #define WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey @"WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey" // CoreGraphics deferred updates are disabled if WebKitEnableCoalescedUpdatesPreferenceKey is set // to NO, or has no value. For compatibility with Mac OS X 10.4.6, deferred updates are OFF by // default. #define WebKitEnableDeferredUpdatesPreferenceKey @"WebKitEnableDeferredUpdates" // For debugging only. Don't use these. #define WebKitPageCacheSizePreferenceKey @"WebKitPageCacheSizePreferenceKey" #define WebKitObjectCacheSizePreferenceKey @"WebKitObjectCacheSizePreferenceKey" #define WebKitDebugFullPageZoomPreferenceKey @"WebKitDebugFullPageZoomPreferenceKey" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebRenderNode.mm�����������������������������������������������������������������0000644�0001750�0001750�00000012236�11237103001�015455� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebRenderNode.h" #import "WebFrameInternal.h" #import <WebCore/Frame.h> #import <WebCore/FrameLoaderClient.h> #import <WebCore/RenderText.h> #import <WebCore/RenderWidget.h> #import <WebCore/RenderView.h> #import <WebCore/Widget.h> using namespace WebCore; static WebRenderNode *copyRenderNode(RenderObject*); @implementation WebRenderNode - (id)_initWithCoreFrame:(Frame *)frame { [self release]; if (!frame->loader()->client()->hasHTMLView()) return nil; RenderObject* renderer = frame->contentRenderer(); if (!renderer) return nil; return copyRenderNode(renderer); } - (id)_initWithName:(NSString *)n position:(NSPoint)p rect:(NSRect)r coreFrame:(Frame*)coreFrame children:(NSArray *)c { NSMutableArray *collectChildren; self = [super init]; if (!self) return nil; collectChildren = [c mutableCopy]; name = [n retain]; rect = r; absolutePosition = p; if (coreFrame) { WebRenderNode *node = [[WebRenderNode alloc] _initWithCoreFrame:coreFrame]; [collectChildren addObject:node]; [node release]; } children = [collectChildren copy]; [collectChildren release]; return self; } static WebRenderNode *copyRenderNode(RenderObject* node) { NSMutableArray *children = [[NSMutableArray alloc] init]; for (RenderObject* child = node->firstChild(); child; child = child->nextSibling()) { WebRenderNode *childCopy = copyRenderNode(child); [children addObject:childCopy]; [childCopy release]; } NSString *name = [[NSString alloc] initWithUTF8String:node->renderName()]; RenderWidget* renderWidget = node->isWidget() ? toRenderWidget(node) : 0; Widget* widget = renderWidget ? renderWidget->widget() : 0; FrameView* frameView = widget && widget->isFrameView() ? static_cast<FrameView*>(widget) : 0; Frame* frame = frameView ? frameView->frame() : 0; // FIXME: broken with transforms FloatPoint absPos = node->localToAbsolute(FloatPoint()); int x = 0; int y = 0; int width = 0; int height = 0; if (node->isBox()) { RenderBox* box = toRenderBox(node); x = box->x(); y = box->y(); width = box->width(); height = box->height(); } else if (node->isText()) { // FIXME: Preserve old behavior even though it's strange. RenderText* text = toRenderText(node); x = text->firstRunX(); y = text->firstRunY(); IntRect box = text->linesBoundingBox(); width = box.width(); height = box.height(); } WebRenderNode *result = [[WebRenderNode alloc] _initWithName:name position:absPos rect:NSMakeRect(x, y, width, height) coreFrame:frame children:children]; [name release]; [children release]; return result; } - (id)initWithWebFrame:(WebFrame *)frame { return [self _initWithCoreFrame:core(frame)]; } - (void)dealloc { [children release]; [name release]; [super dealloc]; } - (NSArray *)children { return children; } - (NSString *)name { return name; } - (NSString *)absolutePositionString { return [NSString stringWithFormat:@"(%.0f, %.0f)", absolutePosition.x, absolutePosition.y]; } - (NSString *)positionString { return [NSString stringWithFormat:@"(%.0f, %.0f)", rect.origin.x, rect.origin.y]; } - (NSString *)widthString { return [NSString stringWithFormat:@"%.0f", rect.size.width]; } - (NSString *)heightString { return [NSString stringWithFormat:@"%.0f", rect.size.height]; } @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebNavigationData.mm�������������������������������������������������������������0000644�0001750�0001750�00000005552�11260535714�016344� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 "WebNavigationData.h" @interface WebNavigationDataPrivate : NSObject { @public NSString *url; NSString *title; NSURLRequest *originalRequest; NSURLResponse *response; BOOL hasSubstituteData; NSString *clientRedirectSource; } @end @implementation WebNavigationDataPrivate - (void)dealloc { [url release]; [title release]; [originalRequest release]; [response release]; [clientRedirectSource release]; [super dealloc]; } @end @implementation WebNavigationData - (id)initWithURLString:(NSString *)url title:(NSString *)title originalRequest:(NSURLRequest *)request response:(NSURLResponse *)response hasSubstituteData:(BOOL)hasSubstituteData clientRedirectSource:(NSString *)redirectSource; { _private = [[WebNavigationDataPrivate alloc] init]; _private->url = [url retain]; _private->title = [title retain]; _private->originalRequest = [request retain]; _private->response = [response retain]; _private->hasSubstituteData = hasSubstituteData; _private->clientRedirectSource = [redirectSource retain]; return self; } - (NSString *)url { return _private->url; } - (NSString *)title { return _private->title; } - (NSURLRequest *)originalRequest { return _private->originalRequest; } - (NSURLResponse *)response { return _private->response; } - (BOOL)hasSubstituteData { return _private->hasSubstituteData; } - (NSString *)clientRedirectSource { return _private->clientRedirectSource; } - (void)dealloc { [_private release]; [super dealloc]; } @end ������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebPDFDocumentExtras.mm����������������������������������������������������������0000644�0001750�0001750�00000012563�11260221312�016734� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 "WebPDFDocumentExtras.h" #import "WebTypesInternal.h" #import <JavaScriptCore/Vector.h> #import <JavaScriptCore/RetainPtr.h> #import <PDFKit/PDFDocument.h> #import <objc/objc-runtime.h> #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) @interface PDFDocument (Internal) - (CGPDFDocumentRef)documentRef; @end #endif static void appendValuesInPDFNameSubtreeToVector(CGPDFDictionaryRef subtree, Vector<CGPDFObjectRef>& values) { CGPDFArrayRef names; if (CGPDFDictionaryGetArray(subtree, "Names", &names)) { size_t nameCount = CGPDFArrayGetCount(names) / 2; for (size_t i = 0; i < nameCount; ++i) { CGPDFObjectRef object; CGPDFArrayGetObject(names, 2 * i + 1, &object); values.append(object); } return; } CGPDFArrayRef kids; if (!CGPDFDictionaryGetArray(subtree, "Kids", &kids)) return; size_t kidCount = CGPDFArrayGetCount(kids); for (size_t i = 0; i < kidCount; ++i) { CGPDFDictionaryRef kid; if (!CGPDFArrayGetDictionary(kids, i, &kid)) continue; appendValuesInPDFNameSubtreeToVector(kid, values); } } static void getAllValuesInPDFNameTree(CGPDFDictionaryRef tree, Vector<CGPDFObjectRef>& allValues) { appendValuesInPDFNameSubtreeToVector(tree, allValues); } static NSArray *web_PDFDocumentAllScripts(id self, SEL _cmd) { NSMutableArray *scripts = [NSMutableArray array]; CGPDFDocumentRef pdfDocument = [self documentRef]; if (!pdfDocument) return scripts; CGPDFDictionaryRef pdfCatalog = CGPDFDocumentGetCatalog(pdfDocument); if (!pdfCatalog) return scripts; // Get the dictionary of all document-level name trees. CGPDFDictionaryRef namesDictionary; if (!CGPDFDictionaryGetDictionary(pdfCatalog, "Names", &namesDictionary)) return scripts; // Get the document-level "JavaScript" name tree. CGPDFDictionaryRef javaScriptNameTree; if (!CGPDFDictionaryGetDictionary(namesDictionary, "JavaScript", &javaScriptNameTree)) return scripts; // The names are aribtrary. We are only interested in the values. Vector<CGPDFObjectRef> objects; getAllValuesInPDFNameTree(javaScriptNameTree, objects); size_t objectCount = objects.size(); for (size_t i = 0; i < objectCount; ++i) { CGPDFDictionaryRef javaScriptAction; if (!CGPDFObjectGetValue(reinterpret_cast<CGPDFObjectRef>(objects[i]), kCGPDFObjectTypeDictionary, &javaScriptAction)) continue; // A JavaScript action must have an action type of "JavaScript". const char* actionType; if (!CGPDFDictionaryGetName(javaScriptAction, "S", &actionType) || strcmp(actionType, "JavaScript")) continue; const UInt8* bytes = 0; CFIndex length; CGPDFStreamRef stream; CGPDFStringRef string; RetainPtr<CFDataRef> data; if (CGPDFDictionaryGetStream(javaScriptAction, "JS", &stream)) { CGPDFDataFormat format; data.adoptCF(CGPDFStreamCopyData(stream, &format)); bytes = CFDataGetBytePtr(data.get()); length = CFDataGetLength(data.get()); } else if (CGPDFDictionaryGetString(javaScriptAction, "JS", &string)) { bytes = CGPDFStringGetBytePtr(string); length = CGPDFStringGetLength(string); } if (!bytes) continue; NSStringEncoding encoding = (length > 1 && bytes[0] == 0xFE && bytes[1] == 0xFF) ? NSUnicodeStringEncoding : NSUTF8StringEncoding; NSString *script = [[NSString alloc] initWithBytes:bytes length:length encoding:encoding]; [scripts addObject:script]; [script release]; } return scripts; } void addWebPDFDocumentExtras(Class pdfDocumentClass) { #ifndef BUILDING_ON_TIGER class_addMethod(pdfDocumentClass, @selector(_web_allScripts), (IMP)web_PDFDocumentAllScripts, "@@:"); #else static struct objc_method_list methodList = { 0, 1, { @selector(_web_allScripts), (char*)"@@:", (IMP)web_PDFDocumentAllScripts } }; class_addMethods(pdfDocumentClass, &methodList); #endif } ���������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebFrameViewPrivate.h������������������������������������������������������������0000644�0001750�0001750�00000005221�10461215670�016500� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebFrameView.h> @interface WebFrameView (WebPrivate) /*! @method _largestChildWithScrollBars @abstract Of the child WebFrameViews that are displaying scroll bars, determines which has the largest area. @result A child WebFrameView that is displaying scroll bars, or nil if none. */ - (WebFrameView *)_largestChildWithScrollBars; /*! @method _hasScrollBars @result YES if at least one scroll bar is currently displayed */ - (BOOL)_hasScrollBars; /*! @method _contentView @result The content view (NSClipView) of the WebFrameView's scroll view. */ - (NSClipView *)_contentView; /*! @method _customScrollViewClass @result The custom scroll view class that is installed, nil if the default scroll view is being used. */ - (Class)_customScrollViewClass; /*! @method _setCustomScrollViewClass: @result Switches the WebFrameView's scroll view class, this class needs to be a subclass of WebDynamicScrollBarsView. Passing nil will switch back to the default WebDynamicScrollBarsView class. */ - (void)_setCustomScrollViewClass:(Class)scrollViewClass; @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebViewData.mm�������������������������������������������������������������������0000644�0001750�0001750�00000006353�11212126444�015150� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * Copyright (C) 2006 David Smith (catfish.man@gmail.com) * * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebViewData.h" #import "WebKitLogging.h" #import "WebPreferenceKeysPrivate.h" #import <WebCore/WebCoreObjCExtras.h> #import <objc/objc-auto.h> #import <runtime/InitializeThreading.h> BOOL applicationIsTerminating = NO; int pluginDatabaseClientCount = 0; @implementation WebViewPrivate + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif } - (id)init { self = [super init]; if (!self) return nil; allowsUndo = YES; usesPageCache = YES; shouldUpdateWhileOffscreen = YES; zoomMultiplier = 1; #if ENABLE(DASHBOARD_SUPPORT) dashboardBehaviorAllowWheelScrolling = YES; #endif shouldCloseWithWindow = objc_collecting_enabled(); smartInsertDeleteEnabled = ![[NSUserDefaults standardUserDefaults] objectForKey:WebSmartInsertDeleteEnabled] || [[NSUserDefaults standardUserDefaults] boolForKey:WebSmartInsertDeleteEnabled]; pluginDatabaseClientCount++; return self; } - (void)dealloc { ASSERT(applicationIsTerminating || !page); ASSERT(applicationIsTerminating || !preferences); ASSERT(!insertionPasteboard); [applicationNameForUserAgent release]; [backgroundColor release]; [inspector release]; [currentNodeHighlight release]; [hostWindow release]; [policyDelegateForwarder release]; [UIDelegateForwarder release]; [frameLoadDelegateForwarder release]; [editingDelegateForwarder release]; [mediaStyle release]; [super dealloc]; } - (void)finalize { ASSERT_MAIN_THREAD(); ASSERT(!insertionPasteboard); [super finalize]; } @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebView.mm�����������������������������������������������������������������������0000644�0001750�0001750�00000614014�11261453657�014372� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * Copyright (C) 2006 David Smith (catfish.man@gmail.com) * * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebViewInternal.h" #import "WebViewData.h" #import "DOMCSSStyleDeclarationInternal.h" #import "DOMNodeInternal.h" #import "DOMRangeInternal.h" #import "WebBackForwardListInternal.h" #import "WebCache.h" #import "WebChromeClient.h" #import "WebContextMenuClient.h" #import "WebDOMOperationsPrivate.h" #import "WebDataSourceInternal.h" #import "WebDatabaseManagerInternal.h" #import "WebDefaultEditingDelegate.h" #import "WebDefaultPolicyDelegate.h" #import "WebDefaultUIDelegate.h" #import "WebDelegateImplementationCaching.h" #import "WebDocument.h" #import "WebDocumentInternal.h" #import "WebDownload.h" #import "WebDownloadInternal.h" #import "WebDragClient.h" #import "WebDynamicScrollBarsViewInternal.h" #import "WebEditingDelegate.h" #import "WebEditorClient.h" #import "WebFormDelegatePrivate.h" #import "WebFrameInternal.h" #import "WebFrameViewInternal.h" #import "WebHTMLRepresentation.h" #import "WebHTMLViewInternal.h" #import "WebHistoryItemInternal.h" #import "WebIconDatabaseInternal.h" #import "WebInspector.h" #import "WebInspectorClient.h" #import "WebKitErrors.h" #import "WebKitLogging.h" #import "WebKitNSStringExtras.h" #import "WebKitStatisticsPrivate.h" #import "WebKitSystemBits.h" #import "WebKitVersionChecks.h" #import "WebLocalizableStrings.h" #import "WebNSDataExtras.h" #import "WebNSDataExtrasPrivate.h" #import "WebNSDictionaryExtras.h" #import "WebNSEventExtras.h" #import "WebNSObjectExtras.h" #import "WebNSPasteboardExtras.h" #import "WebNSPrintOperationExtras.h" #import "WebNSURLExtras.h" #import "WebNSURLRequestExtras.h" #import "WebNSUserDefaultsExtras.h" #import "WebNSViewExtras.h" #import "WebNodeHighlight.h" #import "WebPDFView.h" #import "WebPanelAuthenticationHandler.h" #import "WebPasteboardHelper.h" #import "WebPluginDatabase.h" #import "WebPolicyDelegate.h" #import "WebPreferenceKeysPrivate.h" #import "WebPreferencesPrivate.h" #import "WebScriptDebugDelegate.h" #import "WebSystemInterface.h" #import "WebTextCompletionController.h" #import "WebTextIterator.h" #import "WebUIDelegate.h" #import "WebUIDelegatePrivate.h" #import <CoreFoundation/CFSet.h> #import <Foundation/NSURLConnection.h> #import <WebCore/ApplicationCacheStorage.h> #import <WebCore/Cache.h> #import <WebCore/ColorMac.h> #import <WebCore/Cursor.h> #import <WebCore/Document.h> #import <WebCore/DocumentLoader.h> #import <WebCore/DragController.h> #import <WebCore/DragData.h> #import <WebCore/Editor.h> #import <WebCore/EventHandler.h> #import <WebCore/ExceptionHandlers.h> #import <WebCore/FocusController.h> #import <WebCore/Frame.h> #import <WebCore/FrameLoader.h> #import <WebCore/FrameTree.h> #import <WebCore/FrameView.h> #import <WebCore/GCController.h> #import <WebCore/HTMLNames.h> #import <WebCore/HistoryItem.h> #import <WebCore/IconDatabase.h> #import <WebCore/Logging.h> #import <WebCore/MIMETypeRegistry.h> #import <WebCore/Page.h> #import <WebCore/PageCache.h> #import <WebCore/PageGroup.h> #import <WebCore/PlatformMouseEvent.h> #import <WebCore/ProgressTracker.h> #import <WebCore/ResourceHandle.h> #import <WebCore/RuntimeApplicationChecks.h> #import <WebCore/ScriptController.h> #import <WebCore/ScriptValue.h> #import <WebCore/SecurityOrigin.h> #import <WebCore/SelectionController.h> #import <WebCore/Settings.h> #import <WebCore/TextResourceDecoder.h> #import <WebCore/ThreadCheck.h> #import <WebCore/WebCoreObjCExtras.h> #import <WebCore/WebCoreView.h> #import <WebCore/Widget.h> #import <WebKit/DOM.h> #import <WebKit/DOMExtensions.h> #import <WebKit/DOMPrivate.h> #import <WebKitSystemInterface.h> #import <mach-o/dyld.h> #import <objc/objc-auto.h> #import <objc/objc-runtime.h> #import <runtime/ArrayPrototype.h> #import <runtime/DateInstance.h> #import <runtime/InitializeThreading.h> #import <runtime/JSLock.h> #import <runtime/JSValue.h> #import <wtf/Assertions.h> #import <wtf/HashTraits.h> #import <wtf/RefCountedLeakCounter.h> #import <wtf/RefPtr.h> #import <wtf/StdLibExtras.h> #if ENABLE(DASHBOARD_SUPPORT) #import <WebKit/WebDashboardRegion.h> #endif @class NSTextInputContext; @interface NSResponder (WebNSResponderDetails) - (NSTextInputContext *)inputContext; @end @interface NSSpellChecker (WebNSSpellCheckerDetails) - (void)_preflightChosenSpellServer; @end @interface NSView (WebNSViewDetails) - (NSView *)_hitTest:(NSPoint *)aPoint dragTypes:(NSSet *)types; - (void)_autoscrollForDraggingInfo:(id)dragInfo timeDelta:(NSTimeInterval)repeatDelta; - (BOOL)_shouldAutoscrollForDraggingInfo:(id)dragInfo; @end @interface NSWindow (WebNSWindowDetails) - (id)_oldFirstResponderBeforeBecoming; @end using namespace WebCore; using namespace JSC; #if defined(__ppc__) || defined(__ppc64__) #define PROCESSOR "PPC" #elif defined(__i386__) || defined(__x86_64__) #define PROCESSOR "Intel" #else #error Unknown architecture #endif #define FOR_EACH_RESPONDER_SELECTOR(macro) \ macro(alignCenter) \ macro(alignJustified) \ macro(alignLeft) \ macro(alignRight) \ macro(capitalizeWord) \ macro(centerSelectionInVisibleArea) \ macro(changeAttributes) \ macro(changeBaseWritingDirection) \ macro(changeBaseWritingDirectionToLTR) \ macro(changeBaseWritingDirectionToRTL) \ macro(changeColor) \ macro(changeDocumentBackgroundColor) \ macro(changeFont) \ macro(changeSpelling) \ macro(checkSpelling) \ macro(complete) \ macro(copy) \ macro(copyFont) \ macro(cut) \ macro(delete) \ macro(deleteBackward) \ macro(deleteBackwardByDecomposingPreviousCharacter) \ macro(deleteForward) \ macro(deleteToBeginningOfLine) \ macro(deleteToBeginningOfParagraph) \ macro(deleteToEndOfLine) \ macro(deleteToEndOfParagraph) \ macro(deleteToMark) \ macro(deleteWordBackward) \ macro(deleteWordForward) \ macro(ignoreSpelling) \ macro(indent) \ macro(insertBacktab) \ macro(insertLineBreak) \ macro(insertNewline) \ macro(insertNewlineIgnoringFieldEditor) \ macro(insertParagraphSeparator) \ macro(insertTab) \ macro(insertTabIgnoringFieldEditor) \ macro(lowercaseWord) \ macro(makeBaseWritingDirectionLeftToRight) \ macro(makeBaseWritingDirectionRightToLeft) \ macro(makeTextWritingDirectionLeftToRight) \ macro(makeTextWritingDirectionNatural) \ macro(makeTextWritingDirectionRightToLeft) \ macro(moveBackward) \ macro(moveBackwardAndModifySelection) \ macro(moveDown) \ macro(moveDownAndModifySelection) \ macro(moveForward) \ macro(moveForwardAndModifySelection) \ macro(moveLeft) \ macro(moveLeftAndModifySelection) \ macro(moveParagraphBackwardAndModifySelection) \ macro(moveParagraphForwardAndModifySelection) \ macro(moveRight) \ macro(moveRightAndModifySelection) \ macro(moveToBeginningOfDocument) \ macro(moveToBeginningOfDocumentAndModifySelection) \ macro(moveToBeginningOfLine) \ macro(moveToBeginningOfLineAndModifySelection) \ macro(moveToBeginningOfParagraph) \ macro(moveToBeginningOfParagraphAndModifySelection) \ macro(moveToBeginningOfSentence) \ macro(moveToBeginningOfSentenceAndModifySelection) \ macro(moveToEndOfDocument) \ macro(moveToEndOfDocumentAndModifySelection) \ macro(moveToEndOfLine) \ macro(moveToEndOfLineAndModifySelection) \ macro(moveToEndOfParagraph) \ macro(moveToEndOfParagraphAndModifySelection) \ macro(moveToEndOfSentence) \ macro(moveToEndOfSentenceAndModifySelection) \ macro(moveToLeftEndOfLine) \ macro(moveToLeftEndOfLineAndModifySelection) \ macro(moveToRightEndOfLine) \ macro(moveToRightEndOfLineAndModifySelection) \ macro(moveUp) \ macro(moveUpAndModifySelection) \ macro(moveWordBackward) \ macro(moveWordBackwardAndModifySelection) \ macro(moveWordForward) \ macro(moveWordForwardAndModifySelection) \ macro(moveWordLeft) \ macro(moveWordLeftAndModifySelection) \ macro(moveWordRight) \ macro(moveWordRightAndModifySelection) \ macro(outdent) \ macro(orderFrontSubstitutionsPanel) \ macro(pageDown) \ macro(pageDownAndModifySelection) \ macro(pageUp) \ macro(pageUpAndModifySelection) \ macro(paste) \ macro(pasteAsPlainText) \ macro(pasteAsRichText) \ macro(pasteFont) \ macro(performFindPanelAction) \ macro(scrollLineDown) \ macro(scrollLineUp) \ macro(scrollPageDown) \ macro(scrollPageUp) \ macro(scrollToBeginningOfDocument) \ macro(scrollToEndOfDocument) \ macro(selectAll) \ macro(selectLine) \ macro(selectParagraph) \ macro(selectSentence) \ macro(selectToMark) \ macro(selectWord) \ macro(setMark) \ macro(showGuessPanel) \ macro(startSpeaking) \ macro(stopSpeaking) \ macro(subscript) \ macro(superscript) \ macro(swapWithMark) \ macro(takeFindStringFromSelection) \ macro(toggleBaseWritingDirection) \ macro(transpose) \ macro(underline) \ macro(unscript) \ macro(uppercaseWord) \ macro(yank) \ macro(yankAndSelect) \ #define WebKitOriginalTopPrintingMarginKey @"WebKitOriginalTopMargin" #define WebKitOriginalBottomPrintingMarginKey @"WebKitOriginalBottomMargin" #define KeyboardUIModeDidChangeNotification @"com.apple.KeyboardUIModeDidChange" #define AppleKeyboardUIMode CFSTR("AppleKeyboardUIMode") #define UniversalAccessDomain CFSTR("com.apple.universalaccess") #if USE(ACCELERATED_COMPOSITING) #define UsingAcceleratedCompositingProperty @"_isUsingAcceleratedCompositing" #endif static BOOL s_didSetCacheModel; static WebCacheModel s_cacheModel = WebCacheModelDocumentViewer; static WebView *lastMouseoverView; #ifndef NDEBUG static const char webViewIsOpen[] = "At least one WebView is still open."; #endif #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) @interface NSObject (NSTextInputContextDetails) - (BOOL)wantsToHandleMouseEvents; - (BOOL)handleMouseEvent:(NSEvent *)event; @end #endif @interface NSObject (WebValidateWithoutDelegate) - (BOOL)validateUserInterfaceItemWithoutDelegate:(id <NSValidatedUserInterfaceItem>)item; @end @interface _WebSafeForwarder : NSObject { id target; // Non-retained. Don't retain delegates. id defaultTarget; BOOL catchExceptions; } - (id)initWithTarget:(id)target defaultTarget:(id)defaultTarget catchExceptions:(BOOL)catchExceptions; @end @interface WebView (WebFileInternal) - (WebFrame *)_selectedOrMainFrame; - (BOOL)_isLoading; - (WebFrameView *)_frameViewAtWindowPoint:(NSPoint)point; - (WebFrame *)_focusedFrame; + (void)_preflightSpellChecker; - (BOOL)_continuousCheckingAllowed; - (NSResponder *)_responderForResponderOperations; #if USE(ACCELERATED_COMPOSITING) - (void)_clearLayerSyncLoopObserver; #endif @end static void patchMailRemoveAttributesMethod(); NSString *WebElementDOMNodeKey = @"WebElementDOMNode"; NSString *WebElementFrameKey = @"WebElementFrame"; NSString *WebElementImageKey = @"WebElementImage"; NSString *WebElementImageAltStringKey = @"WebElementImageAltString"; NSString *WebElementImageRectKey = @"WebElementImageRect"; NSString *WebElementImageURLKey = @"WebElementImageURL"; NSString *WebElementIsSelectedKey = @"WebElementIsSelected"; NSString *WebElementLinkLabelKey = @"WebElementLinkLabel"; NSString *WebElementLinkTargetFrameKey = @"WebElementTargetFrame"; NSString *WebElementLinkTitleKey = @"WebElementLinkTitle"; NSString *WebElementLinkURLKey = @"WebElementLinkURL"; NSString *WebElementSpellingToolTipKey = @"WebElementSpellingToolTip"; NSString *WebElementTitleKey = @"WebElementTitle"; NSString *WebElementLinkIsLiveKey = @"WebElementLinkIsLive"; NSString *WebElementIsContentEditableKey = @"WebElementIsContentEditableKey"; NSString *WebViewProgressStartedNotification = @"WebProgressStartedNotification"; NSString *WebViewProgressEstimateChangedNotification = @"WebProgressEstimateChangedNotification"; NSString *WebViewProgressFinishedNotification = @"WebProgressFinishedNotification"; NSString * const WebViewDidBeginEditingNotification = @"WebViewDidBeginEditingNotification"; NSString * const WebViewDidChangeNotification = @"WebViewDidChangeNotification"; NSString * const WebViewDidEndEditingNotification = @"WebViewDidEndEditingNotification"; NSString * const WebViewDidChangeTypingStyleNotification = @"WebViewDidChangeTypingStyleNotification"; NSString * const WebViewDidChangeSelectionNotification = @"WebViewDidChangeSelectionNotification"; enum { WebViewVersion = 4 }; #define timedLayoutSize 4096 static NSMutableSet *schemesWithRepresentationsSet; NSString *_WebCanGoBackKey = @"canGoBack"; NSString *_WebCanGoForwardKey = @"canGoForward"; NSString *_WebEstimatedProgressKey = @"estimatedProgress"; NSString *_WebIsLoadingKey = @"isLoading"; NSString *_WebMainFrameIconKey = @"mainFrameIcon"; NSString *_WebMainFrameTitleKey = @"mainFrameTitle"; NSString *_WebMainFrameURLKey = @"mainFrameURL"; NSString *_WebMainFrameDocumentKey = @"mainFrameDocument"; @interface WebProgressItem : NSObject { @public long long bytesReceived; long long estimatedLength; } @end @implementation WebProgressItem @end static BOOL continuousSpellCheckingEnabled; #ifndef BUILDING_ON_TIGER static BOOL grammarCheckingEnabled; #endif #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) static BOOL automaticQuoteSubstitutionEnabled; static BOOL automaticLinkDetectionEnabled; static BOOL automaticDashSubstitutionEnabled; static BOOL automaticTextReplacementEnabled; static BOOL automaticSpellingCorrectionEnabled; #endif @implementation WebView (AllWebViews) static CFSetCallBacks NonRetainingSetCallbacks = { 0, NULL, NULL, CFCopyDescription, CFEqual, CFHash }; static CFMutableSetRef allWebViewsSet; + (void)_makeAllWebViewsPerformSelector:(SEL)selector { if (!allWebViewsSet) return; [(NSMutableSet *)allWebViewsSet makeObjectsPerformSelector:selector]; } - (void)_removeFromAllWebViewsSet { if (allWebViewsSet) CFSetRemoveValue(allWebViewsSet, self); } - (void)_addToAllWebViewsSet { if (!allWebViewsSet) allWebViewsSet = CFSetCreateMutable(NULL, 0, &NonRetainingSetCallbacks); CFSetSetValue(allWebViewsSet, self); } @end @implementation WebView (WebPrivate) static inline int callGestalt(OSType selector) { SInt32 value = 0; Gestalt(selector, &value); return value; } // Uses underscores instead of dots because if "4." ever appears in a user agent string, old DHTML libraries treat it as Netscape 4. static NSString *createMacOSXVersionString() { // Can't use -[NSProcessInfo operatingSystemVersionString] because it has too much stuff we don't want. int major = callGestalt(gestaltSystemVersionMajor); ASSERT(major); int minor = callGestalt(gestaltSystemVersionMinor); int bugFix = callGestalt(gestaltSystemVersionBugFix); if (bugFix) return [[NSString alloc] initWithFormat:@"%d_%d_%d", major, minor, bugFix]; if (minor) return [[NSString alloc] initWithFormat:@"%d_%d", major, minor]; return [[NSString alloc] initWithFormat:@"%d", major]; } static NSString *createUserVisibleWebKitVersionString() { // If the version is 4 digits long or longer, then the first digit represents // the version of the OS. Our user agent string should not include this first digit, // so strip it off and report the rest as the version. <rdar://problem/4997547> NSString *fullVersion = [[NSBundle bundleForClass:[WebView class]] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey]; NSRange nonDigitRange = [fullVersion rangeOfCharacterFromSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]]; if (nonDigitRange.location == NSNotFound && [fullVersion length] >= 4) return [[fullVersion substringFromIndex:1] copy]; if (nonDigitRange.location != NSNotFound && nonDigitRange.location >= 4) return [[fullVersion substringFromIndex:1] copy]; return [fullVersion copy]; } + (NSString *)_standardUserAgentWithApplicationName:(NSString *)applicationName { // Note: Do *not* move the initialization of osVersion nor webKitVersion into the declaration. // Garbage collection won't correctly mark the global variable in that case <rdar://problem/5733674>. static NSString *osVersion; static NSString *webKitVersion; if (!osVersion) osVersion = createMacOSXVersionString(); if (!webKitVersion) webKitVersion = createUserVisibleWebKitVersionString(); NSString *language = [NSUserDefaults _webkit_preferredLanguageCode]; if ([applicationName length]) return [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X %@; %@) AppleWebKit/%@ (KHTML, like Gecko) %@", osVersion, language, webKitVersion, applicationName]; return [NSString stringWithFormat:@"Mozilla/5.0 (Macintosh; U; " PROCESSOR " Mac OS X %@; %@) AppleWebKit/%@ (KHTML, like Gecko)", osVersion, language, webKitVersion]; } static void WebKitInitializeApplicationCachePathIfNecessary() { static BOOL initialized = NO; if (initialized) return; NSString *appName = [[NSBundle mainBundle] bundleIdentifier]; if (!appName) appName = [[NSProcessInfo processInfo] processName]; ASSERT(appName); NSString* cacheDir = [NSString _webkit_localCacheDirectoryWithBundleIdentifier:appName]; cacheStorage().setCacheDirectory(cacheDir); initialized = YES; } static bool runningLeopardMail() { #ifdef BUILDING_ON_LEOPARD return applicationIsAppleMail(); #endif return NO; } static bool runningTigerMail() { #ifdef BUILDING_ON_TIGER return applicationIsAppleMail(); #endif return NO; } - (void)_dispatchPendingLoadRequests { cache()->loader()->servePendingRequests(); } - (void)_registerDraggedTypes { NSArray *editableTypes = [WebHTMLView _insertablePasteboardTypes]; NSArray *URLTypes = [NSPasteboard _web_dragTypesForURL]; NSMutableSet *types = [[NSMutableSet alloc] initWithArray:editableTypes]; [types addObjectsFromArray:URLTypes]; [self registerForDraggedTypes:[types allObjects]]; [types release]; } - (BOOL)_usesDocumentViews { return _private->usesDocumentViews; } - (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews { WebCoreThreadViolationCheckRoundTwo(); #ifndef NDEBUG WTF::RefCountedLeakCounter::suppressMessages(webViewIsOpen); #endif WebPreferences *standardPreferences = [WebPreferences standardPreferences]; [standardPreferences willAddToWebView]; _private->preferences = [standardPreferences retain]; _private->catchesDelegateExceptions = YES; _private->mainFrameDocumentReady = NO; _private->drawsBackground = YES; _private->backgroundColor = [[NSColor colorWithDeviceWhite:1 alpha:1] retain]; _private->usesDocumentViews = usesDocumentViews; WebFrameView *frameView = nil; if (_private->usesDocumentViews) { NSRect f = [self frame]; frameView = [[WebFrameView alloc] initWithFrame: NSMakeRect(0,0,f.size.width,f.size.height)]; [frameView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [self addSubview:frameView]; [frameView release]; } static bool didOneTimeInitialization = false; if (!didOneTimeInitialization) { WebKitInitializeLoggingChannelsIfNecessary(); WebCore::InitializeLoggingChannelsIfNecessary(); [WebHistoryItem initWindowWatcherIfNecessary]; #if ENABLE(DATABASE) WebKitInitializeDatabasesIfNecessary(); #endif WebKitInitializeApplicationCachePathIfNecessary(); patchMailRemoveAttributesMethod(); didOneTimeInitialization = true; } _private->page = new Page(new WebChromeClient(self), new WebContextMenuClient(self), new WebEditorClient(self), new WebDragClient(self), new WebInspectorClient(self), 0); _private->page->settings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]); [WebFrame _createMainFrameWithPage:_private->page frameName:frameName frameView:frameView]; #ifndef BUILDING_ON_TIGER NSRunLoop *runLoop = [NSRunLoop mainRunLoop]; #else NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; #endif if (WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOADING_DURING_COMMON_RUNLOOP_MODES)) [self scheduleInRunLoop:runLoop forMode:(NSString *)kCFRunLoopCommonModes]; else [self scheduleInRunLoop:runLoop forMode:NSDefaultRunLoopMode]; [self _addToAllWebViewsSet]; [self setGroupName:groupName]; // If there's already a next key view (e.g., from a nib), wire it up to our // contained frame view. In any case, wire our next key view up to the our // contained frame view. This works together with our becomeFirstResponder // and setNextKeyView overrides. NSView *nextKeyView = [self nextKeyView]; if (nextKeyView && nextKeyView != frameView) [frameView setNextKeyView:nextKeyView]; [super setNextKeyView:frameView]; ++WebViewCount; [self _registerDraggedTypes]; WebPreferences *prefs = [self preferences]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesChangedNotification:) name:WebPreferencesChangedNotification object:prefs]; // Post a notification so the WebCore settings update. [[self preferences] _postPreferencesChangesNotification]; if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOCAL_RESOURCE_SECURITY_RESTRICTION)) { // Originally, we allowed all local loads. FrameLoader::setLocalLoadPolicy(FrameLoader::AllowLocalLoadsForAll); } else if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_MORE_STRICT_LOCAL_RESOURCE_SECURITY_RESTRICTION)) { // Later, we allowed local loads for local URLs and documents loaded // with substitute data. FrameLoader::setLocalLoadPolicy(FrameLoader::AllowLocalLoadsForLocalAndSubstituteData); } if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_CONTENT_SNIFFING_FOR_FILE_URLS)) ResourceHandle::forceContentSniffing(); } - (id)_initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews { self = [super initWithFrame:f]; if (!self) return nil; #ifdef ENABLE_WEBKIT_UNSET_DYLD_FRAMEWORK_PATH // DYLD_FRAMEWORK_PATH is used so Safari will load the development version of WebKit, which // may not work with other WebKit applications. Unsetting DYLD_FRAMEWORK_PATH removes the // need for Safari to unset it to prevent it from being passed to applications it launches. // Unsetting it when a WebView is first created is as good a place as any. // See <http://bugs.webkit.org/show_bug.cgi?id=4286> for more details. if (getenv("WEBKIT_UNSET_DYLD_FRAMEWORK_PATH")) { unsetenv("DYLD_FRAMEWORK_PATH"); unsetenv("WEBKIT_UNSET_DYLD_FRAMEWORK_PATH"); } #endif _private = [[WebViewPrivate alloc] init]; [self _commonInitializationWithFrameName:frameName groupName:groupName usesDocumentViews:usesDocumentViews]; [self setMaintainsBackForwardList: YES]; return self; } - (BOOL)_mustDrawUnionedRect:(NSRect)rect singleRects:(const NSRect *)rects count:(NSInteger)count { // If count == 0 here, use the rect passed in for drawing. This is a workaround for: // <rdar://problem/3908282> REGRESSION (Mail): No drag image dragging selected text in Blot and Mail // The reason for the workaround is that this method is called explicitly from the code // to generate a drag image, and at that time, getRectsBeingDrawn:count: will return a zero count. const int cRectThreshold = 10; const float cWastedSpaceThreshold = 0.75f; BOOL useUnionedRect = (count <= 1) || (count > cRectThreshold); if (!useUnionedRect) { // Attempt to guess whether or not we should use the unioned rect or the individual rects. // We do this by computing the percentage of "wasted space" in the union. If that wasted space // is too large, then we will do individual rect painting instead. float unionPixels = (rect.size.width * rect.size.height); float singlePixels = 0; for (int i = 0; i < count; ++i) singlePixels += rects[i].size.width * rects[i].size.height; float wastedSpace = 1 - (singlePixels / unionPixels); if (wastedSpace <= cWastedSpaceThreshold) useUnionedRect = YES; } return useUnionedRect; } - (void)drawSingleRect:(NSRect)rect { ASSERT(!_private->usesDocumentViews); [NSGraphicsContext saveGraphicsState]; NSRectClip(rect); @try { [[self mainFrame] _drawRect:rect contentsOnly:NO]; WebView *webView = [self _webView]; [[webView _UIDelegateForwarder] webView:webView didDrawRect:rect]; if (WebNodeHighlight *currentHighlight = [webView currentNodeHighlight]) [currentHighlight setNeedsUpdateInTargetViewRect:rect]; [NSGraphicsContext restoreGraphicsState]; } @catch (NSException *localException) { [NSGraphicsContext restoreGraphicsState]; LOG_ERROR("Exception caught while drawing: %@", localException); [localException raise]; } } - (BOOL)isFlipped { return _private && !_private->usesDocumentViews; } - (void)setFrameSize:(NSSize)size { if (!_private->usesDocumentViews && !NSEqualSizes(_private->lastLayoutSize, size)) { Frame* frame = [self _mainCoreFrame]; // FIXME: Viewless WebKit is broken with Safari banners (e.g., the Find banner). We'll have to figure out a way for // Safari to communicate that this space is being consumed. For WebKit with document views, there's no // need to do an explicit resize, since WebFrameViews have auto resizing turned on and will handle changing // their bounds automatically. See <rdar://problem/6835573> for details. frame->view()->resize(IntSize(size)); frame->view()->setNeedsLayout(); [self setNeedsDisplay:YES]; _private->lastLayoutSize = size; } [super setFrameSize:size]; } #if USE(ACCELERATED_COMPOSITING) || !defined(BUILDING_ON_TIGER) - (void)_viewWillDrawInternal { Frame* frame = [self _mainCoreFrame]; if (frame && frame->view()) frame->view()->layoutIfNeededRecursive(); } #endif #ifndef BUILDING_ON_TIGER - (void)viewWillDraw { if (!_private->usesDocumentViews) [self _viewWillDrawInternal]; [super viewWillDraw]; } #endif - (void)drawRect:(NSRect)rect { if (_private->usesDocumentViews) return [super drawRect:rect]; ASSERT_MAIN_THREAD(); const NSRect *rects; NSInteger count; [self getRectsBeingDrawn:&rects count:&count]; if ([self _mustDrawUnionedRect:rect singleRects:rects count:count]) [self drawSingleRect:rect]; else for (int i = 0; i < count; ++i) [self drawSingleRect:rects[i]]; } + (NSArray *)_supportedMIMETypes { // Load the plug-in DB allowing plug-ins to install types. [WebPluginDatabase sharedDatabase]; return [[WebFrameView _viewTypesAllowImageTypeOmission:NO] allKeys]; } + (NSArray *)_supportedFileExtensions { NSMutableSet *extensions = [[NSMutableSet alloc] init]; NSArray *MIMETypes = [self _supportedMIMETypes]; NSEnumerator *enumerator = [MIMETypes objectEnumerator]; NSString *MIMEType; while ((MIMEType = [enumerator nextObject]) != nil) { NSArray *extensionsForType = WKGetExtensionsForMIMEType(MIMEType); if (extensionsForType) { [extensions addObjectsFromArray:extensionsForType]; } } NSArray *uniqueExtensions = [extensions allObjects]; [extensions release]; return uniqueExtensions; } + (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType { MIMEType = [MIMEType lowercaseString]; Class viewClass = [[WebFrameView _viewTypesAllowImageTypeOmission:YES] _webkit_objectForMIMEType:MIMEType]; Class repClass = [[WebDataSource _repTypesAllowImageTypeOmission:YES] _webkit_objectForMIMEType:MIMEType]; if (!viewClass || !repClass || [[WebPDFView supportedMIMETypes] containsObject:MIMEType]) { // Our optimization to avoid loading the plug-in DB and image types for the HTML case failed. // Load the plug-in DB allowing plug-ins to install types. [WebPluginDatabase sharedDatabase]; // Load the image types and get the view class and rep class. This should be the fullest picture of all handled types. viewClass = [[WebFrameView _viewTypesAllowImageTypeOmission:NO] _webkit_objectForMIMEType:MIMEType]; repClass = [[WebDataSource _repTypesAllowImageTypeOmission:NO] _webkit_objectForMIMEType:MIMEType]; } if (viewClass && repClass) { // Special-case WebHTMLView for text types that shouldn't be shown. if (viewClass == [WebHTMLView class] && repClass == [WebHTMLRepresentation class] && [[WebHTMLView unsupportedTextMIMETypes] containsObject:MIMEType]) { return NO; } if (vClass) *vClass = viewClass; if (rClass) *rClass = repClass; return YES; } return NO; } - (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType { if ([[self class] _viewClass:vClass andRepresentationClass:rClass forMIMEType:MIMEType]) return YES; if (_private->pluginDatabase) { WebBasePluginPackage *pluginPackage = [_private->pluginDatabase pluginForMIMEType:MIMEType]; if (pluginPackage) { if (vClass) *vClass = [WebHTMLView class]; if (rClass) *rClass = [WebHTMLRepresentation class]; return YES; } } return NO; } + (void)_setAlwaysUseATSU:(BOOL)f { [self _setAlwaysUsesComplexTextCodePath:f]; } + (void)_setAlwaysUsesComplexTextCodePath:(BOOL)f { Font::setCodePath(f ? Font::Complex : Font::Auto); } + (BOOL)canCloseAllWebViews { return DOMWindow::dispatchAllPendingBeforeUnloadEvents(); } + (void)closeAllWebViews { DOMWindow::dispatchAllPendingUnloadEvents(); // This will close the WebViews in a random order. Change this if close order is important. NSEnumerator *enumerator = [(NSMutableSet *)allWebViewsSet objectEnumerator]; while (WebView *webView = [enumerator nextObject]) [webView close]; } + (BOOL)canShowFile:(NSString *)path { return [[self class] canShowMIMEType:[WebView _MIMETypeForFile:path]]; } + (NSString *)suggestedFileExtensionForMIMEType:(NSString *)type { return WKGetPreferredExtensionForMIMEType(type); } - (BOOL)_isClosed { return !_private || _private->closed; } - (void)_closePluginDatabases { pluginDatabaseClientCount--; // Close both sets of plug-in databases because plug-ins need an opportunity to clean up files, etc. // Unload the WebView local plug-in database. if (_private->pluginDatabase) { [_private->pluginDatabase destroyAllPluginInstanceViews]; [_private->pluginDatabase close]; [_private->pluginDatabase release]; _private->pluginDatabase = nil; } // Keep the global plug-in database active until the app terminates to avoid having to reload plug-in bundles. if (!pluginDatabaseClientCount && applicationIsTerminating) [WebPluginDatabase closeSharedDatabase]; } - (void)_closeWithFastTeardown { #ifndef NDEBUG WTF::RefCountedLeakCounter::suppressMessages("At least one WebView was closed with fast teardown."); #endif _private->closed = YES; [[NSDistributedNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self]; [self _closePluginDatabases]; } static bool fastDocumentTeardownEnabled() { #ifdef NDEBUG static bool enabled = ![[NSUserDefaults standardUserDefaults] boolForKey:WebKitEnableFullDocumentTeardownPreferenceKey]; #else static bool initialized = false; static bool enabled = false; if (!initialized) { // This allows debug builds to default to not have fast teardown, so leak checking still works. // But still allow the WebKitEnableFullDocumentTeardown default to override it if present. NSNumber *setting = [[NSUserDefaults standardUserDefaults] objectForKey:WebKitEnableFullDocumentTeardownPreferenceKey]; if (setting) enabled = ![setting boolValue]; initialized = true; } #endif return enabled; } // _close is here only for backward compatibility; clients and subclasses should use // public method -close instead. - (void)_close { if (!_private || _private->closed) return; if (lastMouseoverView == self) lastMouseoverView = nil; #ifndef NDEBUG WTF::RefCountedLeakCounter::cancelMessageSuppression(webViewIsOpen); #endif // To quit the apps fast we skip document teardown, except plugins // need to be destroyed and unloaded. if (applicationIsTerminating && fastDocumentTeardownEnabled()) { [self _closeWithFastTeardown]; return; } if (Frame* mainFrame = [self _mainCoreFrame]) mainFrame->loader()->detachFromParent(); [self _removeFromAllWebViewsSet]; [self setHostWindow:nil]; [self setDownloadDelegate:nil]; [self setEditingDelegate:nil]; [self setFrameLoadDelegate:nil]; [self setPolicyDelegate:nil]; [self setResourceLoadDelegate:nil]; [self setScriptDebugDelegate:nil]; [self setUIDelegate:nil]; [_private->inspector webViewClosed]; // setHostWindow:nil must be called before this value is set (see 5408186) _private->closed = YES; // To avoid leaks, call removeDragCaret in case it wasn't called after moveDragCaretToPoint. [self removeDragCaret]; // Deleteing the WebCore::Page will clear the page cache so we call destroy on // all the plug-ins in the page cache to break any retain cycles. // See comment in HistoryItem::releaseAllPendingPageCaches() for more information. delete _private->page; _private->page = 0; if (_private->hasSpellCheckerDocumentTag) { [[NSSpellChecker sharedSpellChecker] closeSpellDocumentWithTag:_private->spellCheckerDocumentTag]; _private->hasSpellCheckerDocumentTag = NO; } #if USE(ACCELERATED_COMPOSITING) [self _clearLayerSyncLoopObserver]; #endif [[NSDistributedNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self]; [WebPreferences _removeReferenceForIdentifier:[self preferencesIdentifier]]; WebPreferences *preferences = _private->preferences; _private->preferences = nil; [preferences didRemoveFromWebView]; [preferences release]; [self _closePluginDatabases]; #ifndef NDEBUG // Need this to make leak messages accurate. if (applicationIsTerminating) { gcController().garbageCollectNow(); [WebCache setDisabled:YES]; } #endif } // Indicates if the WebView is in the midst of a user gesture. - (BOOL)_isProcessingUserGesture { WebFrame *frame = [self mainFrame]; return core(frame)->loader()->isProcessingUserGesture(); } + (NSString *)_MIMETypeForFile:(NSString *)path { NSString *extension = [path pathExtension]; NSString *MIMEType = nil; // Get the MIME type from the extension. if ([extension length] != 0) { MIMEType = WKGetMIMETypeForExtension(extension); } // If we can't get a known MIME type from the extension, sniff. if ([MIMEType length] == 0 || [MIMEType isEqualToString:@"application/octet-stream"]) { NSFileHandle *handle = [NSFileHandle fileHandleForReadingAtPath:path]; NSData *data = [handle readDataOfLength:WEB_GUESS_MIME_TYPE_PEEK_LENGTH]; [handle closeFile]; if ([data length] != 0) { MIMEType = [data _webkit_guessedMIMEType]; } if ([MIMEType length] == 0) { MIMEType = @"application/octet-stream"; } } return MIMEType; } - (WebDownload *)_downloadURL:(NSURL *)URL { ASSERT(URL); NSURLRequest *request = [[NSURLRequest alloc] initWithURL:URL]; WebDownload *download = [WebDownload _downloadWithRequest:request delegate:_private->downloadDelegate directory:nil]; [request release]; return download; } - (WebView *)_openNewWindowWithRequest:(NSURLRequest *)request { NSDictionary *features = [[NSDictionary alloc] init]; WebView *newWindowWebView = [[self _UIDelegateForwarder] webView:self createWebViewWithRequest:nil windowFeatures:features]; [features release]; if (!newWindowWebView) return nil; CallUIDelegate(newWindowWebView, @selector(webViewShow:)); return newWindowWebView; } - (WebInspector *)inspector { if (!_private->inspector) _private->inspector = [[WebInspector alloc] initWithWebView:self]; return _private->inspector; } - (WebCore::Page*)page { return _private->page; } - (NSMenu *)_menuForElement:(NSDictionary *)element defaultItems:(NSArray *)items { NSArray *defaultMenuItems = [[WebDefaultUIDelegate sharedUIDelegate] webView:self contextMenuItemsForElement:element defaultMenuItems:items]; NSArray *menuItems = CallUIDelegate(self, @selector(webView:contextMenuItemsForElement:defaultMenuItems:), element, defaultMenuItems); if (!menuItems) return nil; unsigned count = [menuItems count]; if (!count) return nil; NSMenu *menu = [[NSMenu alloc] init]; for (unsigned i = 0; i < count; i++) [menu addItem:[menuItems objectAtIndex:i]]; return [menu autorelease]; } - (void)_mouseDidMoveOverElement:(NSDictionary *)dictionary modifierFlags:(NSUInteger)modifierFlags { // We originally intended to call this delegate method sometimes with a nil dictionary, but due to // a bug dating back to WebKit 1.0 this delegate was never called with nil! Unfortunately we can't // start calling this with nil since it will break Adobe Help Viewer, and possibly other clients. if (!dictionary) return; CallUIDelegate(self, @selector(webView:mouseDidMoveOverElement:modifierFlags:), dictionary, modifierFlags); } - (void)_loadBackForwardListFromOtherView:(WebView *)otherView { if (!_private->page) return; if (!otherView->_private->page) return; // It turns out the right combination of behavior is done with the back/forward load // type. (See behavior matrix at the top of WebFramePrivate.) So we copy all the items // in the back forward list, and go to the current one. BackForwardList* backForwardList = _private->page->backForwardList(); ASSERT(!backForwardList->currentItem()); // destination list should be empty BackForwardList* otherBackForwardList = otherView->_private->page->backForwardList(); if (!otherBackForwardList->currentItem()) return; // empty back forward list, bail HistoryItem* newItemToGoTo = 0; int lastItemIndex = otherBackForwardList->forwardListCount(); for (int i = -otherBackForwardList->backListCount(); i <= lastItemIndex; ++i) { if (i == 0) { // If this item is showing , save away its current scroll and form state, // since that might have changed since loading and it is normally not saved // until we leave that page. otherView->_private->page->mainFrame()->loader()->saveDocumentAndScrollState(); } RefPtr<HistoryItem> newItem = otherBackForwardList->itemAtIndex(i)->copy(); if (i == 0) newItemToGoTo = newItem.get(); backForwardList->addItem(newItem.release()); } ASSERT(newItemToGoTo); _private->page->goToItem(newItemToGoTo, FrameLoadTypeIndexedBackForward); } - (void)_setFormDelegate: (id<WebFormDelegate>)delegate { _private->formDelegate = delegate; } - (id<WebFormDelegate>)_formDelegate { return _private->formDelegate; } - (BOOL)_needsAdobeFrameReloadingQuirk { static BOOL needsQuirk = WKAppVersionCheckLessThan(@"com.adobe.Acrobat", -1, 9.0) || WKAppVersionCheckLessThan(@"com.adobe.Acrobat.Pro", -1, 9.0) || WKAppVersionCheckLessThan(@"com.adobe.Reader", -1, 9.0) || WKAppVersionCheckLessThan(@"com.adobe.distiller", -1, 9.0) || WKAppVersionCheckLessThan(@"com.adobe.Contribute", -1, 4.2) || WKAppVersionCheckLessThan(@"com.adobe.dreamweaver-9.0", -1, 9.1) || WKAppVersionCheckLessThan(@"com.macromedia.fireworks", -1, 9.1) || WKAppVersionCheckLessThan(@"com.adobe.InCopy", -1, 5.1) || WKAppVersionCheckLessThan(@"com.adobe.InDesign", -1, 5.1) || WKAppVersionCheckLessThan(@"com.adobe.Soundbooth", -1, 2); return needsQuirk; } - (BOOL)_needsLinkElementTextCSSQuirk { static BOOL needsQuirk = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_LINK_ELEMENT_TEXT_CSS_QUIRK) && WKAppVersionCheckLessThan(@"com.e-frontier.shade10", -1, 10.6); return needsQuirk; } - (BOOL)_needsKeyboardEventDisambiguationQuirks { static BOOL needsQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_IE_COMPATIBLE_KEYBOARD_EVENT_DISPATCH) && !applicationIsSafari(); return needsQuirks; } - (BOOL)_needsFrameLoadDelegateRetainQuirk { static BOOL needsQuirk = WKAppVersionCheckLessThan(@"com.equinux.iSale5", -1, 5.6); return needsQuirk; } - (void)_preferencesChangedNotification:(NSNotification *)notification { WebPreferences *preferences = (WebPreferences *)[notification object]; ASSERT(preferences == [self preferences]); if (!_private->userAgentOverridden) _private->userAgent = String(); // Cache this value so we don't have to read NSUserDefaults on each page load _private->useSiteSpecificSpoofing = [preferences _useSiteSpecificSpoofing]; // Update corresponding WebCore Settings object. if (!_private->page) return; Settings* settings = _private->page->settings(); settings->setCursiveFontFamily([preferences cursiveFontFamily]); settings->setDefaultFixedFontSize([preferences defaultFixedFontSize]); settings->setDefaultFontSize([preferences defaultFontSize]); settings->setDefaultTextEncodingName([preferences defaultTextEncodingName]); settings->setUsesEncodingDetector([preferences usesEncodingDetector]); settings->setFantasyFontFamily([preferences fantasyFontFamily]); settings->setFixedFontFamily([preferences fixedFontFamily]); settings->setForceFTPDirectoryListings([preferences _forceFTPDirectoryListings]); settings->setFTPDirectoryTemplatePath([preferences _ftpDirectoryTemplatePath]); settings->setLocalStorageDatabasePath([preferences _localStorageDatabasePath]); settings->setJavaEnabled([preferences isJavaEnabled]); settings->setJavaScriptEnabled([preferences isJavaScriptEnabled]); settings->setWebSecurityEnabled([preferences isWebSecurityEnabled]); settings->setAllowUniversalAccessFromFileURLs([preferences allowUniversalAccessFromFileURLs]); settings->setJavaScriptCanOpenWindowsAutomatically([preferences javaScriptCanOpenWindowsAutomatically]); settings->setMinimumFontSize([preferences minimumFontSize]); settings->setMinimumLogicalFontSize([preferences minimumLogicalFontSize]); settings->setPluginsEnabled([preferences arePlugInsEnabled]); settings->setDatabasesEnabled([preferences databasesEnabled]); settings->setLocalStorageEnabled([preferences localStorageEnabled]); settings->setExperimentalNotificationsEnabled([preferences experimentalNotificationsEnabled]); settings->setExperimentalWebSocketsEnabled([preferences experimentalWebSocketsEnabled]); settings->setPrivateBrowsingEnabled([preferences privateBrowsingEnabled]); settings->setSansSerifFontFamily([preferences sansSerifFontFamily]); settings->setSerifFontFamily([preferences serifFontFamily]); settings->setStandardFontFamily([preferences standardFontFamily]); settings->setLoadsImagesAutomatically([preferences loadsImagesAutomatically]); settings->setShouldPrintBackgrounds([preferences shouldPrintBackgrounds]); settings->setTextAreasAreResizable([preferences textAreasAreResizable]); settings->setShrinksStandaloneImagesToFit([preferences shrinksStandaloneImagesToFit]); settings->setEditableLinkBehavior(core([preferences editableLinkBehavior])); settings->setTextDirectionSubmenuInclusionBehavior(core([preferences textDirectionSubmenuInclusionBehavior])); settings->setDOMPasteAllowed([preferences isDOMPasteAllowed]); settings->setUsesPageCache([self usesPageCache]); settings->setShowsURLsInToolTips([preferences showsURLsInToolTips]); settings->setDeveloperExtrasEnabled([preferences developerExtrasEnabled]); settings->setAuthorAndUserStylesEnabled([preferences authorAndUserStylesEnabled]); settings->setApplicationChromeMode([preferences applicationChromeModeEnabled]); if ([preferences userStyleSheetEnabled]) { NSString* location = [[preferences userStyleSheetLocation] _web_originalDataAsString]; settings->setUserStyleSheetLocation([NSURL URLWithString:(location ? location : @"")]); } else settings->setUserStyleSheetLocation([NSURL URLWithString:@""]); settings->setNeedsAdobeFrameReloadingQuirk([self _needsAdobeFrameReloadingQuirk]); settings->setTreatsAnyTextCSSLinkAsStylesheet([self _needsLinkElementTextCSSQuirk]); settings->setNeedsKeyboardEventDisambiguationQuirks([self _needsKeyboardEventDisambiguationQuirks]); settings->setNeedsLeopardMailQuirks(runningLeopardMail()); settings->setNeedsTigerMailQuirks(runningTigerMail()); settings->setNeedsSiteSpecificQuirks(_private->useSiteSpecificSpoofing); settings->setWebArchiveDebugModeEnabled([preferences webArchiveDebugModeEnabled]); settings->setLocalFileContentSniffingEnabled([preferences localFileContentSniffingEnabled]); settings->setOfflineWebApplicationCacheEnabled([preferences offlineWebApplicationCacheEnabled]); settings->setZoomsTextOnly([preferences zoomsTextOnly]); settings->setXSSAuditorEnabled([preferences isXSSAuditorEnabled]); settings->setEnforceCSSMIMETypeInStrictMode(!WKAppVersionCheckLessThan(@"com.apple.iWeb", -1, 2.1)); settings->setAcceleratedCompositingEnabled([preferences acceleratedCompositingEnabled]); settings->setWebGLEnabled([preferences webGLEnabled]); } static inline IMP getMethod(id o, SEL s) { return [o respondsToSelector:s] ? [o methodForSelector:s] : 0; } - (void)_cacheResourceLoadDelegateImplementations { WebResourceDelegateImplementationCache *cache = &_private->resourceLoadDelegateImplementations; id delegate = _private->resourceProgressDelegate; if (!delegate) { bzero(cache, sizeof(WebResourceDelegateImplementationCache)); return; } cache->didCancelAuthenticationChallengeFunc = getMethod(delegate, @selector(webView:resource:didReceiveAuthenticationChallenge:fromDataSource:)); cache->didFailLoadingWithErrorFromDataSourceFunc = getMethod(delegate, @selector(webView:resource:didFailLoadingWithError:fromDataSource:)); cache->didFinishLoadingFromDataSourceFunc = getMethod(delegate, @selector(webView:resource:didFinishLoadingFromDataSource:)); cache->didLoadResourceFromMemoryCacheFunc = getMethod(delegate, @selector(webView:didLoadResourceFromMemoryCache:response:length:fromDataSource:)); cache->didReceiveAuthenticationChallengeFunc = getMethod(delegate, @selector(webView:resource:didReceiveAuthenticationChallenge:fromDataSource:)); cache->didReceiveContentLengthFunc = getMethod(delegate, @selector(webView:resource:didReceiveContentLength:fromDataSource:)); cache->didReceiveResponseFunc = getMethod(delegate, @selector(webView:resource:didReceiveResponse:fromDataSource:)); cache->identifierForRequestFunc = getMethod(delegate, @selector(webView:identifierForInitialRequest:fromDataSource:)); cache->plugInFailedWithErrorFunc = getMethod(delegate, @selector(webView:plugInFailedWithError:dataSource:)); cache->willCacheResponseFunc = getMethod(delegate, @selector(webView:resource:willCacheResponse:fromDataSource:)); cache->willSendRequestFunc = getMethod(delegate, @selector(webView:resource:willSendRequest:redirectResponse:fromDataSource:)); cache->shouldUseCredentialStorageFunc = getMethod(delegate, @selector(webView:resource:shouldUseCredentialStorageForDataSource:)); } - (void)_cacheFrameLoadDelegateImplementations { WebFrameLoadDelegateImplementationCache *cache = &_private->frameLoadDelegateImplementations; id delegate = _private->frameLoadDelegate; if (!delegate) { bzero(cache, sizeof(WebFrameLoadDelegateImplementationCache)); return; } cache->didCancelClientRedirectForFrameFunc = getMethod(delegate, @selector(webView:didCancelClientRedirectForFrame:)); cache->didChangeLocationWithinPageForFrameFunc = getMethod(delegate, @selector(webView:didChangeLocationWithinPageForFrame:)); cache->didClearWindowObjectForFrameFunc = getMethod(delegate, @selector(webView:didClearWindowObject:forFrame:)); cache->didClearInspectorWindowObjectForFrameFunc = getMethod(delegate, @selector(webView:didClearInspectorWindowObject:forFrame:)); cache->didCommitLoadForFrameFunc = getMethod(delegate, @selector(webView:didCommitLoadForFrame:)); cache->didFailLoadWithErrorForFrameFunc = getMethod(delegate, @selector(webView:didFailLoadWithError:forFrame:)); cache->didFailProvisionalLoadWithErrorForFrameFunc = getMethod(delegate, @selector(webView:didFailProvisionalLoadWithError:forFrame:)); cache->didFinishDocumentLoadForFrameFunc = getMethod(delegate, @selector(webView:didFinishDocumentLoadForFrame:)); cache->didFinishLoadForFrameFunc = getMethod(delegate, @selector(webView:didFinishLoadForFrame:)); cache->didFirstLayoutInFrameFunc = getMethod(delegate, @selector(webView:didFirstLayoutInFrame:)); cache->didFirstVisuallyNonEmptyLayoutInFrameFunc = getMethod(delegate, @selector(webView:didFirstVisuallyNonEmptyLayoutInFrame:)); cache->didHandleOnloadEventsForFrameFunc = getMethod(delegate, @selector(webView:didHandleOnloadEventsForFrame:)); cache->didReceiveIconForFrameFunc = getMethod(delegate, @selector(webView:didReceiveIcon:forFrame:)); cache->didReceiveServerRedirectForProvisionalLoadForFrameFunc = getMethod(delegate, @selector(webView:didReceiveServerRedirectForProvisionalLoadForFrame:)); cache->didReceiveTitleForFrameFunc = getMethod(delegate, @selector(webView:didReceiveTitle:forFrame:)); cache->didStartProvisionalLoadForFrameFunc = getMethod(delegate, @selector(webView:didStartProvisionalLoadForFrame:)); cache->willCloseFrameFunc = getMethod(delegate, @selector(webView:willCloseFrame:)); cache->willPerformClientRedirectToURLDelayFireDateForFrameFunc = getMethod(delegate, @selector(webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:)); cache->windowScriptObjectAvailableFunc = getMethod(delegate, @selector(webView:windowScriptObjectAvailable:)); cache->didDisplayInsecureContentFunc = getMethod(delegate, @selector(webViewDidDisplayInsecureContent:)); cache->didRunInsecureContentFunc = getMethod(delegate, @selector(webView:didRunInsecureContent:)); } - (void)_cacheScriptDebugDelegateImplementations { WebScriptDebugDelegateImplementationCache *cache = &_private->scriptDebugDelegateImplementations; id delegate = _private->scriptDebugDelegate; if (!delegate) { bzero(cache, sizeof(WebScriptDebugDelegateImplementationCache)); return; } cache->didParseSourceFunc = getMethod(delegate, @selector(webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:)); if (cache->didParseSourceFunc) cache->didParseSourceExpectsBaseLineNumber = YES; else cache->didParseSourceFunc = getMethod(delegate, @selector(webView:didParseSource:fromURL:sourceId:forWebFrame:)); cache->failedToParseSourceFunc = getMethod(delegate, @selector(webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:)); cache->didEnterCallFrameFunc = getMethod(delegate, @selector(webView:didEnterCallFrame:sourceId:line:forWebFrame:)); cache->willExecuteStatementFunc = getMethod(delegate, @selector(webView:willExecuteStatement:sourceId:line:forWebFrame:)); cache->willLeaveCallFrameFunc = getMethod(delegate, @selector(webView:willLeaveCallFrame:sourceId:line:forWebFrame:)); cache->exceptionWasRaisedFunc = getMethod(delegate, @selector(webView:exceptionWasRaised:sourceId:line:forWebFrame:)); } - (void)_cacheHistoryDelegateImplementations { WebHistoryDelegateImplementationCache *cache = &_private->historyDelegateImplementations; id delegate = _private->historyDelegate; if (!delegate) { bzero(cache, sizeof(WebHistoryDelegateImplementationCache)); return; } cache->navigatedFunc = getMethod(delegate, @selector(webView:didNavigateWithNavigationData:inFrame:)); cache->clientRedirectFunc = getMethod(delegate, @selector(webView:didPerformClientRedirectFromURL:toURL:inFrame:)); cache->serverRedirectFunc = getMethod(delegate, @selector(webView:didPerformServerRedirectFromURL:toURL:inFrame:)); } - (id)_policyDelegateForwarder { if (!_private->policyDelegateForwarder) _private->policyDelegateForwarder = [[_WebSafeForwarder alloc] initWithTarget:_private->policyDelegate defaultTarget:[WebDefaultPolicyDelegate sharedPolicyDelegate] catchExceptions:_private->catchesDelegateExceptions]; return _private->policyDelegateForwarder; } - (id)_UIDelegateForwarder { if (!_private->UIDelegateForwarder) _private->UIDelegateForwarder = [[_WebSafeForwarder alloc] initWithTarget:_private->UIDelegate defaultTarget:[WebDefaultUIDelegate sharedUIDelegate] catchExceptions:_private->catchesDelegateExceptions]; return _private->UIDelegateForwarder; } - (id)_editingDelegateForwarder { // This can be called during window deallocation by QTMovieView in the QuickTime Cocoa Plug-in. // Not sure if that is a bug or not. if (!_private) return nil; if (!_private->editingDelegateForwarder) _private->editingDelegateForwarder = [[_WebSafeForwarder alloc] initWithTarget:_private->editingDelegate defaultTarget:[WebDefaultEditingDelegate sharedEditingDelegate] catchExceptions:_private->catchesDelegateExceptions]; return _private->editingDelegateForwarder; } - (void)_closeWindow { [[self _UIDelegateForwarder] webViewClose:self]; } + (void)_unregisterViewClassAndRepresentationClassForMIMEType:(NSString *)MIMEType { [[WebFrameView _viewTypesAllowImageTypeOmission:NO] removeObjectForKey:MIMEType]; [[WebDataSource _repTypesAllowImageTypeOmission:NO] removeObjectForKey:MIMEType]; // FIXME: We also need to maintain MIMEType registrations (which can be dynamically changed) // in the WebCore MIMEType registry. For now we're doing this in a safe, limited manner // to fix <rdar://problem/5372989> - a future revamping of the entire system is neccesary for future robustness MIMETypeRegistry::getSupportedNonImageMIMETypes().remove(MIMEType); } + (void)_registerViewClass:(Class)viewClass representationClass:(Class)representationClass forURLScheme:(NSString *)URLScheme { NSString *MIMEType = [self _generatedMIMETypeForURLScheme:URLScheme]; [self registerViewClass:viewClass representationClass:representationClass forMIMEType:MIMEType]; // FIXME: We also need to maintain MIMEType registrations (which can be dynamically changed) // in the WebCore MIMEType registry. For now we're doing this in a safe, limited manner // to fix <rdar://problem/5372989> - a future revamping of the entire system is neccesary for future robustness if ([viewClass class] == [WebHTMLView class]) MIMETypeRegistry::getSupportedNonImageMIMETypes().add(MIMEType); // This is used to make _representationExistsForURLScheme faster. // Without this set, we'd have to create the MIME type each time. if (schemesWithRepresentationsSet == nil) { schemesWithRepresentationsSet = [[NSMutableSet alloc] init]; } [schemesWithRepresentationsSet addObject:[[[URLScheme lowercaseString] copy] autorelease]]; } + (NSString *)_generatedMIMETypeForURLScheme:(NSString *)URLScheme { return [@"x-apple-web-kit/" stringByAppendingString:[URLScheme lowercaseString]]; } + (BOOL)_representationExistsForURLScheme:(NSString *)URLScheme { return [schemesWithRepresentationsSet containsObject:[URLScheme lowercaseString]]; } + (BOOL)_canHandleRequest:(NSURLRequest *)request forMainFrame:(BOOL)forMainFrame { // FIXME: If <rdar://problem/5217309> gets fixed, this check can be removed. if (!request) return NO; if ([NSURLConnection canHandleRequest:request]) return YES; NSString *scheme = [[request URL] scheme]; // Representations for URL schemes work at the top level. if (forMainFrame && [self _representationExistsForURLScheme:scheme]) return YES; return [scheme _webkit_isCaseInsensitiveEqualToString:@"applewebdata"]; } + (BOOL)_canHandleRequest:(NSURLRequest *)request { return [self _canHandleRequest:request forMainFrame:YES]; } + (NSString *)_decodeData:(NSData *)data { HTMLNames::init(); // this method is used for importing bookmarks at startup, so HTMLNames are likely to be uninitialized yet RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/html"); // bookmark files are HTML String result = decoder->decode(static_cast<const char*>([data bytes]), [data length]); result += decoder->flush(); return result; } - (void)_pushPerformingProgrammaticFocus { _private->programmaticFocusCount++; } - (void)_popPerformingProgrammaticFocus { _private->programmaticFocusCount--; } - (BOOL)_isPerformingProgrammaticFocus { return _private->programmaticFocusCount != 0; } - (void)_didChangeValueForKey: (NSString *)key { LOG (Bindings, "calling didChangeValueForKey: %@", key); [self didChangeValueForKey: key]; } - (void)_willChangeValueForKey: (NSString *)key { LOG (Bindings, "calling willChangeValueForKey: %@", key); [self willChangeValueForKey: key]; } + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key { static NSSet *manualNotifyKeys = nil; if (!manualNotifyKeys) manualNotifyKeys = [[NSSet alloc] initWithObjects:_WebMainFrameURLKey, _WebIsLoadingKey, _WebEstimatedProgressKey, _WebCanGoBackKey, _WebCanGoForwardKey, _WebMainFrameTitleKey, _WebMainFrameIconKey, _WebMainFrameDocumentKey, #if USE(ACCELERATED_COMPOSITING) UsingAcceleratedCompositingProperty, // used by DRT #endif nil]; if ([manualNotifyKeys containsObject:key]) return NO; return YES; } - (NSArray *)_declaredKeys { static NSArray *declaredKeys = nil; if (!declaredKeys) declaredKeys = [[NSArray alloc] initWithObjects:_WebMainFrameURLKey, _WebIsLoadingKey, _WebEstimatedProgressKey, _WebCanGoBackKey, _WebCanGoForwardKey, _WebMainFrameTitleKey, _WebMainFrameIconKey, _WebMainFrameDocumentKey, nil]; return declaredKeys; } - (void)setObservationInfo:(void *)info { _private->observationInfo = info; } - (void *)observationInfo { return _private->observationInfo; } - (void)_willChangeBackForwardKeys { [self _willChangeValueForKey: _WebCanGoBackKey]; [self _willChangeValueForKey: _WebCanGoForwardKey]; } - (void)_didChangeBackForwardKeys { [self _didChangeValueForKey: _WebCanGoBackKey]; [self _didChangeValueForKey: _WebCanGoForwardKey]; } - (void)_didStartProvisionalLoadForFrame:(WebFrame *)frame { [self _willChangeBackForwardKeys]; if (frame == [self mainFrame]){ // Force an observer update by sending a will/did. [self _willChangeValueForKey: _WebIsLoadingKey]; [self _didChangeValueForKey: _WebIsLoadingKey]; [self _willChangeValueForKey: _WebMainFrameURLKey]; } [NSApp setWindowsNeedUpdate:YES]; } - (void)_didCommitLoadForFrame:(WebFrame *)frame { if (frame == [self mainFrame]) [self _didChangeValueForKey: _WebMainFrameURLKey]; [NSApp setWindowsNeedUpdate:YES]; } - (void)_didFinishLoadForFrame:(WebFrame *)frame { [self _didChangeBackForwardKeys]; if (frame == [self mainFrame]){ // Force an observer update by sending a will/did. [self _willChangeValueForKey: _WebIsLoadingKey]; [self _didChangeValueForKey: _WebIsLoadingKey]; } [NSApp setWindowsNeedUpdate:YES]; } - (void)_didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame { [self _didChangeBackForwardKeys]; if (frame == [self mainFrame]){ // Force an observer update by sending a will/did. [self _willChangeValueForKey: _WebIsLoadingKey]; [self _didChangeValueForKey: _WebIsLoadingKey]; } [NSApp setWindowsNeedUpdate:YES]; } - (void)_didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame { [self _didChangeBackForwardKeys]; if (frame == [self mainFrame]){ // Force an observer update by sending a will/did. [self _willChangeValueForKey: _WebIsLoadingKey]; [self _didChangeValueForKey: _WebIsLoadingKey]; [self _didChangeValueForKey: _WebMainFrameURLKey]; } [NSApp setWindowsNeedUpdate:YES]; } - (NSCachedURLResponse *)_cachedResponseForURL:(NSURL *)URL { NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:URL]; [request _web_setHTTPUserAgent:[self userAgentForURL:URL]]; NSCachedURLResponse *cachedResponse = [[NSURLCache sharedURLCache] cachedResponseForRequest:request]; [request release]; return cachedResponse; } - (void)_writeImageForElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard { NSURL *linkURL = [element objectForKey:WebElementLinkURLKey]; DOMElement *domElement = [element objectForKey:WebElementDOMNodeKey]; [pasteboard _web_writeImage:(NSImage *)(domElement ? nil : [element objectForKey:WebElementImageKey]) element:domElement URL:linkURL ? linkURL : (NSURL *)[element objectForKey:WebElementImageURLKey] title:[element objectForKey:WebElementImageAltStringKey] archive:[[element objectForKey:WebElementDOMNodeKey] webArchive] types:types source:nil]; } - (void)_writeLinkElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard { [pasteboard _web_writeURL:[element objectForKey:WebElementLinkURLKey] andTitle:[element objectForKey:WebElementLinkLabelKey] types:types]; } - (void)_setInitiatedDrag:(BOOL)initiatedDrag { if (!_private->page) return; _private->page->dragController()->setDidInitiateDrag(initiatedDrag); } #if ENABLE(DASHBOARD_SUPPORT) #define DASHBOARD_CONTROL_LABEL @"control" - (void)_addControlRect:(NSRect)bounds clip:(NSRect)clip fromView:(NSView *)view toDashboardRegions:(NSMutableDictionary *)regions { NSRect adjustedBounds = bounds; adjustedBounds.origin = [self convertPoint:bounds.origin fromView:view]; adjustedBounds.origin.y = [self bounds].size.height - adjustedBounds.origin.y; adjustedBounds.size = bounds.size; NSRect adjustedClip; adjustedClip.origin = [self convertPoint:clip.origin fromView:view]; adjustedClip.origin.y = [self bounds].size.height - adjustedClip.origin.y; adjustedClip.size = clip.size; WebDashboardRegion *region = [[WebDashboardRegion alloc] initWithRect:adjustedBounds clip:adjustedClip type:WebDashboardRegionTypeScrollerRectangle]; NSMutableArray *scrollerRegions = [regions objectForKey:DASHBOARD_CONTROL_LABEL]; if (!scrollerRegions) { scrollerRegions = [[NSMutableArray alloc] init]; [regions setObject:scrollerRegions forKey:DASHBOARD_CONTROL_LABEL]; [scrollerRegions release]; } [scrollerRegions addObject:region]; [region release]; } - (void)_addScrollerDashboardRegionsForFrameView:(FrameView*)frameView dashboardRegions:(NSMutableDictionary *)regions { NSView *documentView = [[kit(frameView->frame()) frameView] documentView]; const HashSet<RefPtr<Widget> >* children = frameView->children(); HashSet<RefPtr<Widget> >::const_iterator end = children->end(); for (HashSet<RefPtr<Widget> >::const_iterator it = children->begin(); it != end; ++it) { Widget* widget = (*it).get(); if (widget->isFrameView()) { [self _addScrollerDashboardRegionsForFrameView:static_cast<FrameView*>(widget) dashboardRegions:regions]; continue; } if (!widget->isScrollbar()) continue; // FIXME: This should really pass an appropriate clip, but our first try got it wrong, and // it's not common to need this to be correct in Dashboard widgets. NSRect bounds = widget->frameRect(); [self _addControlRect:bounds clip:bounds fromView:documentView toDashboardRegions:regions]; } } - (void)_addScrollerDashboardRegions:(NSMutableDictionary *)regions from:(NSArray *)views { // Add scroller regions for NSScroller and WebCore scrollbars NSUInteger count = [views count]; for (NSUInteger i = 0; i < count; i++) { NSView *view = [views objectAtIndex:i]; if ([view isKindOfClass:[WebHTMLView class]]) { if (Frame* coreFrame = core([(WebHTMLView*)view _frame])) { if (FrameView* coreView = coreFrame->view()) [self _addScrollerDashboardRegionsForFrameView:coreView dashboardRegions:regions]; } } else if ([view isKindOfClass:[NSScroller class]]) { // AppKit places absent scrollers at -100,-100 if ([view frame].origin.y < 0) continue; [self _addControlRect:[view bounds] clip:[view visibleRect] fromView:view toDashboardRegions:regions]; } [self _addScrollerDashboardRegions:regions from:[view subviews]]; } } - (void)_addScrollerDashboardRegions:(NSMutableDictionary *)regions { [self _addScrollerDashboardRegions:regions from:[self subviews]]; } - (NSDictionary *)_dashboardRegions { // Only return regions from main frame. Frame* mainFrame = [self _mainCoreFrame]; if (!mainFrame) return nil; NSMutableDictionary *regions = mainFrame->dashboardRegionsDictionary(); [self _addScrollerDashboardRegions:regions]; return regions; } - (void)_setDashboardBehavior:(WebDashboardBehavior)behavior to:(BOOL)flag { // FIXME: Remove this blanket assignment once Dashboard and Dashcode implement // specific support for the backward compatibility mode flag. if (behavior == WebDashboardBehaviorAllowWheelScrolling && flag == NO && _private->page) _private->page->settings()->setUsesDashboardBackwardCompatibilityMode(true); switch (behavior) { case WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows: { _private->dashboardBehaviorAlwaysSendMouseEventsToAllWindows = flag; break; } case WebDashboardBehaviorAlwaysSendActiveNullEventsToPlugIns: { _private->dashboardBehaviorAlwaysSendActiveNullEventsToPlugIns = flag; break; } case WebDashboardBehaviorAlwaysAcceptsFirstMouse: { _private->dashboardBehaviorAlwaysAcceptsFirstMouse = flag; break; } case WebDashboardBehaviorAllowWheelScrolling: { _private->dashboardBehaviorAllowWheelScrolling = flag; break; } case WebDashboardBehaviorUseBackwardCompatibilityMode: { if (_private->page) _private->page->settings()->setUsesDashboardBackwardCompatibilityMode(flag); break; } } } - (BOOL)_dashboardBehavior:(WebDashboardBehavior)behavior { switch (behavior) { case WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows: { return _private->dashboardBehaviorAlwaysSendMouseEventsToAllWindows; } case WebDashboardBehaviorAlwaysSendActiveNullEventsToPlugIns: { return _private->dashboardBehaviorAlwaysSendActiveNullEventsToPlugIns; } case WebDashboardBehaviorAlwaysAcceptsFirstMouse: { return _private->dashboardBehaviorAlwaysAcceptsFirstMouse; } case WebDashboardBehaviorAllowWheelScrolling: { return _private->dashboardBehaviorAllowWheelScrolling; } case WebDashboardBehaviorUseBackwardCompatibilityMode: { return _private->page && _private->page->settings()->usesDashboardBackwardCompatibilityMode(); } } return NO; } #endif /* ENABLE(DASHBOARD_SUPPORT) */ + (void)_setShouldUseFontSmoothing:(BOOL)f { Font::setShouldUseSmoothing(f); } + (BOOL)_shouldUseFontSmoothing { return Font::shouldUseSmoothing(); } + (void)_setUsesTestModeFocusRingColor:(BOOL)f { setUsesTestModeFocusRingColor(f); } + (BOOL)_usesTestModeFocusRingColor { return usesTestModeFocusRingColor(); } - (void)setAlwaysShowVerticalScroller:(BOOL)flag { WebDynamicScrollBarsView *scrollview = [[[self mainFrame] frameView] _scrollView]; if (flag) { [scrollview setVerticalScrollingMode:ScrollbarAlwaysOn andLock:YES]; } else { [scrollview setVerticalScrollingModeLocked:NO]; [scrollview setVerticalScrollingMode:ScrollbarAuto andLock:NO]; } } - (BOOL)alwaysShowVerticalScroller { WebDynamicScrollBarsView *scrollview = [[[self mainFrame] frameView] _scrollView]; return [scrollview verticalScrollingModeLocked] && [scrollview verticalScrollingMode] == ScrollbarAlwaysOn; } - (void)setAlwaysShowHorizontalScroller:(BOOL)flag { WebDynamicScrollBarsView *scrollview = [[[self mainFrame] frameView] _scrollView]; if (flag) { [scrollview setHorizontalScrollingMode:ScrollbarAlwaysOn andLock:YES]; } else { [scrollview setHorizontalScrollingModeLocked:NO]; [scrollview setHorizontalScrollingMode:ScrollbarAuto andLock:NO]; } } - (void)setProhibitsMainFrameScrolling:(BOOL)prohibits { if (Frame* mainFrame = [self _mainCoreFrame]) mainFrame->view()->setProhibitsScrolling(prohibits); } - (BOOL)alwaysShowHorizontalScroller { WebDynamicScrollBarsView *scrollview = [[[self mainFrame] frameView] _scrollView]; return [scrollview horizontalScrollingModeLocked] && [scrollview horizontalScrollingMode] == ScrollbarAlwaysOn; } - (void)_setInViewSourceMode:(BOOL)flag { if (Frame* mainFrame = [self _mainCoreFrame]) mainFrame->setInViewSourceMode(flag); } - (BOOL)_inViewSourceMode { Frame* mainFrame = [self _mainCoreFrame]; return mainFrame && mainFrame->inViewSourceMode(); } - (void)_setUseFastImageScalingMode:(BOOL)flag { if (_private->page && _private->page->inLowQualityImageInterpolationMode() != flag) { _private->page->setInLowQualityImageInterpolationMode(flag); [self setNeedsDisplay:YES]; } } - (BOOL)_inFastImageScalingMode { if (_private->page) return _private->page->inLowQualityImageInterpolationMode(); return NO; } - (BOOL)_cookieEnabled { if (_private->page) return _private->page->cookieEnabled(); return YES; } - (void)_setCookieEnabled:(BOOL)enable { if (_private->page) _private->page->setCookieEnabled(enable); } - (void)_setAdditionalWebPlugInPaths:(NSArray *)newPaths { if (!_private->pluginDatabase) _private->pluginDatabase = [[WebPluginDatabase alloc] init]; [_private->pluginDatabase setPlugInPaths:newPaths]; [_private->pluginDatabase refresh]; } - (void)_attachScriptDebuggerToAllFrames { for (Frame* frame = [self _mainCoreFrame]; frame; frame = frame->tree()->traverseNext()) [kit(frame) _attachScriptDebugger]; } - (void)_detachScriptDebuggerFromAllFrames { for (Frame* frame = [self _mainCoreFrame]; frame; frame = frame->tree()->traverseNext()) [kit(frame) _detachScriptDebugger]; } - (void)setBackgroundColor:(NSColor *)backgroundColor { if ([_private->backgroundColor isEqual:backgroundColor]) return; id old = _private->backgroundColor; _private->backgroundColor = [backgroundColor retain]; [old release]; [[self mainFrame] _updateBackgroundAndUpdatesWhileOffscreen]; } - (NSColor *)backgroundColor { return _private->backgroundColor; } - (BOOL)defersCallbacks { if (!_private->page) return NO; return _private->page->defersLoading(); } - (void)setDefersCallbacks:(BOOL)defer { if (!_private->page) return; return _private->page->setDefersLoading(defer); } // For backwards compatibility with the WebBackForwardList API, we honor both // a per-WebView and a per-preferences setting for whether to use the page cache. - (BOOL)usesPageCache { return _private->usesPageCache && [[self preferences] usesPageCache]; } - (void)setUsesPageCache:(BOOL)usesPageCache { _private->usesPageCache = usesPageCache; // Post a notification so the WebCore settings update. [[self preferences] _postPreferencesChangesNotification]; } - (WebHistoryItem *)_globalHistoryItem { if (!_private->page) return nil; return kit(_private->page->globalHistoryItem()); } - (WebTextIterator *)textIteratorForRect:(NSRect)rect { IntPoint rectStart(rect.origin.x, rect.origin.y); IntPoint rectEnd(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height); Frame* coreFrame = [self _mainCoreFrame]; if (!coreFrame) return nil; VisibleSelection selectionInsideRect(coreFrame->visiblePositionForPoint(rectStart), coreFrame->visiblePositionForPoint(rectEnd)); return [[[WebTextIterator alloc] initWithRange:kit(selectionInsideRect.toNormalizedRange().get())] autorelease]; } - (void)handleAuthenticationForResource:(id)identifier challenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource { NSWindow *window = [self hostWindow] ? [self hostWindow] : [self window]; [[WebPanelAuthenticationHandler sharedHandler] startAuthentication:challenge window:window]; } - (void)_clearUndoRedoOperations { if (!_private->page) return; _private->page->clearUndoRedoOperations(); } - (void)_setCatchesDelegateExceptions:(BOOL)f { _private->catchesDelegateExceptions = f; } - (BOOL)_catchesDelegateExceptions { return _private->catchesDelegateExceptions; } - (void)_executeCoreCommandByName:(NSString *)name value:(NSString *)value { Frame* coreFrame = [self _mainCoreFrame]; if (!coreFrame) return; coreFrame->editor()->command(name).execute(value); } - (void)_setCustomHTMLTokenizerTimeDelay:(double)timeDelay { if (!_private->page) return; return _private->page->setCustomHTMLTokenizerTimeDelay(timeDelay); } - (void)_setCustomHTMLTokenizerChunkSize:(int)chunkSize { if (!_private->page) return; return _private->page->setCustomHTMLTokenizerChunkSize(chunkSize); } - (void)_clearMainFrameName { _private->page->mainFrame()->tree()->clearName(); } - (void)setSelectTrailingWhitespaceEnabled:(BOOL)flag { _private->selectTrailingWhitespaceEnabled = flag; if (flag) [self setSmartInsertDeleteEnabled:false]; } - (BOOL)isSelectTrailingWhitespaceEnabled { return _private->selectTrailingWhitespaceEnabled; } - (void)setMemoryCacheDelegateCallsEnabled:(BOOL)enabled { _private->page->setMemoryCacheClientCallsEnabled(enabled); } - (BOOL)areMemoryCacheDelegateCallsEnabled { return _private->page->areMemoryCacheClientCallsEnabled(); } - (void)_setJavaScriptURLsAreAllowed:(BOOL)areAllowed { _private->page->setJavaScriptURLsAreAllowed(areAllowed); } + (NSCursor *)_pointingHandCursor { return handCursor().impl(); } - (BOOL)_isUsingAcceleratedCompositing { #if USE(ACCELERATED_COMPOSITING) return _private->acceleratedFramesCount > 0; #else return NO; #endif } - (NSPasteboard *)_insertionPasteboard { return _private ? _private->insertionPasteboard : nil; } + (void)_whiteListAccessFromOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains { SecurityOrigin::whiteListAccessFromOrigin(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains); } +(void)_resetOriginAccessWhiteLists { SecurityOrigin::resetOriginAccessWhiteLists(); } - (void)_updateActiveState { if (_private && _private->page) _private->page->focusController()->setActive([[self window] isKeyWindow]); } static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns) { // Convert the patterns into Vectors. NSUInteger count = [patterns count]; if (count == 0) return 0; Vector<String>* patternsVector = new Vector<String>; for (NSUInteger i = 0; i < count; ++i) { id entry = [patterns objectAtIndex:i]; if ([entry isKindOfClass:[NSString class]]) patternsVector->append(String((NSString*)entry)); } return patternsVector; } + (void)_addUserScriptToGroup:(NSString *)groupName source:(NSString *)source url:(NSURL *)url worldID:(unsigned)worldID whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist injectionTime:(WebUserScriptInjectionTime)injectionTime { String group(groupName); if (group.isEmpty() || worldID == UINT_MAX) return; PageGroup* pageGroup = PageGroup::pageGroup(group); if (!pageGroup) return; pageGroup->addUserScript(source, url, toStringVector(whitelist), toStringVector(blacklist), worldID, injectionTime == WebInjectAtDocumentStart ? InjectAtDocumentStart : InjectAtDocumentEnd); } + (void)_addUserStyleSheetToGroup:(NSString *)groupName source:(NSString *)source url:(NSURL *)url worldID:(unsigned)worldID whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist { String group(groupName); if (group.isEmpty() || worldID == UINT_MAX) return; PageGroup* pageGroup = PageGroup::pageGroup(group); if (!pageGroup) return; pageGroup->addUserStyleSheet(source, url, toStringVector(whitelist), toStringVector(blacklist), worldID); } + (void)_removeUserContentFromGroup:(NSString *)groupName url:(NSURL *)url worldID:(unsigned)worldID { String group(groupName); if (group.isEmpty()) return; PageGroup* pageGroup = PageGroup::pageGroup(group); if (!pageGroup) return; pageGroup->removeUserContentWithURLForWorld(url, worldID); } + (void)_removeUserContentFromGroup:(NSString *)groupName worldID:(unsigned)worldID { String group(groupName); if (group.isEmpty()) return; PageGroup* pageGroup = PageGroup::pageGroup(group); if (!pageGroup) return; pageGroup->removeUserContentForWorld(worldID); } + (void)_removeAllUserContentFromGroup:(NSString *)groupName { String group(groupName); if (group.isEmpty()) return; PageGroup* pageGroup = PageGroup::pageGroup(group); if (!pageGroup) return; pageGroup->removeAllUserContent(); } @end @implementation _WebSafeForwarder // Used to send messages to delegates that implement informal protocols. - (id)initWithTarget:(id)t defaultTarget:(id)dt catchExceptions:(BOOL)c { self = [super init]; if (!self) return nil; target = t; // Non retained. defaultTarget = dt; catchExceptions = c; return self; } - (void)forwardInvocation:(NSInvocation *)invocation { if ([target respondsToSelector:[invocation selector]]) { if (catchExceptions) { @try { [invocation invokeWithTarget:target]; } @catch(id exception) { ReportDiscardedDelegateException([invocation selector], exception); } } else [invocation invokeWithTarget:target]; return; } if ([defaultTarget respondsToSelector:[invocation selector]]) [invocation invokeWithTarget:defaultTarget]; // Do nothing quietly if method not implemented. } - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector { return [defaultTarget methodSignatureForSelector:aSelector]; } @end @implementation WebView + (void)initialize { static BOOL initialized = NO; if (initialized) return; initialized = YES; InitWebCoreSystemInterface(); [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationWillTerminate) name:NSApplicationWillTerminateNotification object:NSApp]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesChangedNotification:) name:WebPreferencesChangedNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesRemovedNotification:) name:WebPreferencesRemovedNotification object:nil]; continuousSpellCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebContinuousSpellCheckingEnabled]; #ifndef BUILDING_ON_TIGER grammarCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebGrammarCheckingEnabled]; #endif #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) automaticQuoteSubstitutionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticQuoteSubstitutionEnabled]; automaticLinkDetectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticLinkDetectionEnabled]; automaticDashSubstitutionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticDashSubstitutionEnabled]; automaticTextReplacementEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticTextReplacementEnabled]; automaticSpellingCorrectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticSpellingCorrectionEnabled]; #endif } + (void)_applicationWillTerminate { applicationIsTerminating = YES; if (fastDocumentTeardownEnabled()) [self closeAllWebViews]; if (!pluginDatabaseClientCount) [WebPluginDatabase closeSharedDatabase]; PageGroup::closeLocalStorage(); } + (BOOL)canShowMIMEType:(NSString *)MIMEType { return [self _viewClass:nil andRepresentationClass:nil forMIMEType:MIMEType]; } - (WebBasePluginPackage *)_pluginForMIMEType:(NSString *)MIMEType { WebBasePluginPackage *pluginPackage = [[WebPluginDatabase sharedDatabase] pluginForMIMEType:MIMEType]; if (pluginPackage) return pluginPackage; if (_private->pluginDatabase) return [_private->pluginDatabase pluginForMIMEType:MIMEType]; return nil; } - (WebBasePluginPackage *)_pluginForExtension:(NSString *)extension { WebBasePluginPackage *pluginPackage = [[WebPluginDatabase sharedDatabase] pluginForExtension:extension]; if (pluginPackage) return pluginPackage; if (_private->pluginDatabase) return [_private->pluginDatabase pluginForExtension:extension]; return nil; } - (void)addPluginInstanceView:(NSView *)view { if (!_private->pluginDatabase) _private->pluginDatabase = [[WebPluginDatabase alloc] init]; [_private->pluginDatabase addPluginInstanceView:view]; } - (void)removePluginInstanceView:(NSView *)view { if (_private->pluginDatabase) [_private->pluginDatabase removePluginInstanceView:view]; } - (void)removePluginInstanceViewsFor:(WebFrame*)webFrame { if (_private->pluginDatabase) [_private->pluginDatabase removePluginInstanceViewsFor:webFrame]; } - (BOOL)_isMIMETypeRegisteredAsPlugin:(NSString *)MIMEType { if ([[WebPluginDatabase sharedDatabase] isMIMETypeRegistered:MIMEType]) return YES; if (_private->pluginDatabase && [_private->pluginDatabase isMIMETypeRegistered:MIMEType]) return YES; return NO; } + (BOOL)canShowMIMETypeAsHTML:(NSString *)MIMEType { return [WebFrameView _canShowMIMETypeAsHTML:MIMEType]; } + (NSArray *)MIMETypesShownAsHTML { NSMutableDictionary *viewTypes = [WebFrameView _viewTypesAllowImageTypeOmission:YES]; NSEnumerator *enumerator = [viewTypes keyEnumerator]; id key; NSMutableArray *array = [[[NSMutableArray alloc] init] autorelease]; while ((key = [enumerator nextObject])) { if ([viewTypes objectForKey:key] == [WebHTMLView class]) [array addObject:key]; } return array; } + (void)setMIMETypesShownAsHTML:(NSArray *)MIMETypes { NSDictionary *viewTypes = [[WebFrameView _viewTypesAllowImageTypeOmission:YES] copy]; NSEnumerator *enumerator = [viewTypes keyEnumerator]; id key; while ((key = [enumerator nextObject])) { if ([viewTypes objectForKey:key] == [WebHTMLView class]) [WebView _unregisterViewClassAndRepresentationClassForMIMEType:key]; } int i, count = [MIMETypes count]; for (i = 0; i < count; i++) { [WebView registerViewClass:[WebHTMLView class] representationClass:[WebHTMLRepresentation class] forMIMEType:[MIMETypes objectAtIndex:i]]; } [viewTypes release]; } + (NSURL *)URLFromPasteboard:(NSPasteboard *)pasteboard { return [pasteboard _web_bestURL]; } + (NSString *)URLTitleFromPasteboard:(NSPasteboard *)pasteboard { return [pasteboard stringForType:WebURLNamePboardType]; } + (void)registerURLSchemeAsLocal:(NSString *)protocol { SecurityOrigin::registerURLSchemeAsLocal(protocol); } - (id)_initWithArguments:(NSDictionary *) arguments { NSCoder *decoder = [arguments objectForKey:@"decoder"]; if (decoder) { self = [self initWithCoder:decoder]; } else { ASSERT([arguments objectForKey:@"frame"]); NSValue *frameValue = [arguments objectForKey:@"frame"]; NSRect frame = (frameValue ? [frameValue rectValue] : NSZeroRect); NSString *frameName = [arguments objectForKey:@"frameName"]; NSString *groupName = [arguments objectForKey:@"groupName"]; self = [self initWithFrame:frame frameName:frameName groupName:groupName]; } return self; } static bool clientNeedsWebViewInitThreadWorkaround() { if (WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_WEBVIEW_INIT_THREAD_WORKAROUND)) return false; NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier]; // Installer. if ([bundleIdentifier _webkit_isCaseInsensitiveEqualToString:@"com.apple.installer"]) return true; // Automator. if ([bundleIdentifier _webkit_isCaseInsensitiveEqualToString:@"com.apple.Automator"]) return true; // Automator Runner. if ([bundleIdentifier _webkit_isCaseInsensitiveEqualToString:@"com.apple.AutomatorRunner"]) return true; // Automator workflows. if ([bundleIdentifier _webkit_hasCaseInsensitivePrefix:@"com.apple.Automator."]) return true; #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) // Mail. if ([bundleIdentifier _webkit_isCaseInsensitiveEqualToString:@"com.apple.Mail"]) return true; #endif return false; } static bool needsWebViewInitThreadWorkaround() { static bool isOldClient = clientNeedsWebViewInitThreadWorkaround(); return isOldClient && !pthread_main_np(); } - (id)initWithFrame:(NSRect)f { return [self initWithFrame:f frameName:nil groupName:nil]; } - (id)initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName { if (needsWebViewInitThreadWorkaround()) return [[self _webkit_invokeOnMainThread] initWithFrame:f frameName:frameName groupName:groupName]; WebCoreThreadViolationCheckRoundTwo(); return [self _initWithFrame:f frameName:frameName groupName:groupName usesDocumentViews:YES]; } - (id)initWithCoder:(NSCoder *)decoder { if (needsWebViewInitThreadWorkaround()) return [[self _webkit_invokeOnMainThread] initWithCoder:decoder]; WebCoreThreadViolationCheckRoundTwo(); WebView *result = nil; @try { NSString *frameName; NSString *groupName; WebPreferences *preferences; BOOL useBackForwardList = NO; BOOL allowsUndo = YES; result = [super initWithCoder:decoder]; result->_private = [[WebViewPrivate alloc] init]; // We don't want any of the archived subviews. The subviews will always // be created in _commonInitializationFrameName:groupName:. [[result subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)]; if ([decoder allowsKeyedCoding]) { frameName = [decoder decodeObjectForKey:@"FrameName"]; groupName = [decoder decodeObjectForKey:@"GroupName"]; preferences = [decoder decodeObjectForKey:@"Preferences"]; useBackForwardList = [decoder decodeBoolForKey:@"UseBackForwardList"]; if ([decoder containsValueForKey:@"AllowsUndo"]) allowsUndo = [decoder decodeBoolForKey:@"AllowsUndo"]; } else { int version; [decoder decodeValueOfObjCType:@encode(int) at:&version]; frameName = [decoder decodeObject]; groupName = [decoder decodeObject]; preferences = [decoder decodeObject]; if (version > 1) [decoder decodeValuesOfObjCTypes:"c", &useBackForwardList]; // The allowsUndo field is no longer written out in encodeWithCoder, but since there are // version 3 NIBs that have this field encoded, we still need to read it in. if (version == 3) [decoder decodeValuesOfObjCTypes:"c", &allowsUndo]; } if (![frameName isKindOfClass:[NSString class]]) frameName = nil; if (![groupName isKindOfClass:[NSString class]]) groupName = nil; if (![preferences isKindOfClass:[WebPreferences class]]) preferences = nil; LOG(Encoding, "FrameName = %@, GroupName = %@, useBackForwardList = %d\n", frameName, groupName, (int)useBackForwardList); [result _commonInitializationWithFrameName:frameName groupName:groupName usesDocumentViews:YES]; [result page]->backForwardList()->setEnabled(useBackForwardList); result->_private->allowsUndo = allowsUndo; if (preferences) [result setPreferences:preferences]; } @catch (NSException *localException) { result = nil; [self release]; } return result; } - (void)encodeWithCoder:(NSCoder *)encoder { // Set asside the subviews before we archive. We don't want to archive any subviews. // The subviews will always be created in _commonInitializationFrameName:groupName:. id originalSubviews = _subviews; _subviews = nil; [super encodeWithCoder:encoder]; // Restore the subviews we set aside. _subviews = originalSubviews; BOOL useBackForwardList = _private->page && _private->page->backForwardList()->enabled(); if ([encoder allowsKeyedCoding]) { [encoder encodeObject:[[self mainFrame] name] forKey:@"FrameName"]; [encoder encodeObject:[self groupName] forKey:@"GroupName"]; [encoder encodeObject:[self preferences] forKey:@"Preferences"]; [encoder encodeBool:useBackForwardList forKey:@"UseBackForwardList"]; [encoder encodeBool:_private->allowsUndo forKey:@"AllowsUndo"]; } else { int version = WebViewVersion; [encoder encodeValueOfObjCType:@encode(int) at:&version]; [encoder encodeObject:[[self mainFrame] name]]; [encoder encodeObject:[self groupName]]; [encoder encodeObject:[self preferences]]; [encoder encodeValuesOfObjCTypes:"c", &useBackForwardList]; // DO NOT encode any new fields here, doing so will break older WebKit releases. } LOG(Encoding, "FrameName = %@, GroupName = %@, useBackForwardList = %d\n", [[self mainFrame] name], [self groupName], (int)useBackForwardList); } - (void)dealloc { if (WebCoreObjCScheduleDeallocateOnMainThread([WebView class], self)) return; // call close to ensure we tear-down completely // this maintains our old behavior for existing applications [self close]; --WebViewCount; if ([self _needsFrameLoadDelegateRetainQuirk]) [_private->frameLoadDelegate release]; [_private release]; // [super dealloc] can end up dispatching against _private (3466082) _private = nil; [super dealloc]; } - (void)finalize { ASSERT(_private->closed); --WebViewCount; [super finalize]; } - (void)close { // _close existed first, and some clients might be calling or overriding it, so call through. [self _close]; } - (void)setShouldCloseWithWindow:(BOOL)close { _private->shouldCloseWithWindow = close; } - (BOOL)shouldCloseWithWindow { return _private->shouldCloseWithWindow; } - (void)addWindowObserversForWindow:(NSWindow *)window { if (window) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidResignKey:) name:NSWindowDidResignKeyNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillOrderOnScreen:) name:WKWindowWillOrderOnScreenNotification() object:window]; } } - (void)removeWindowObservers { NSWindow *window = [self window]; if (window) { [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidBecomeKeyNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResignKeyNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:WKWindowWillOrderOnScreenNotification() object:window]; } } - (void)viewWillMoveToWindow:(NSWindow *)window { // Don't do anything if the WebView isn't initialized. // This happens when decoding a WebView in a nib. // FIXME: What sets up the observer of NSWindowWillCloseNotification in this case? if (!_private || _private->closed) return; if ([self window] && [self window] != [self hostWindow]) [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowWillCloseNotification object:[self window]]; if (window) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillClose:) name:NSWindowWillCloseNotification object:window]; // Ensure that we will receive the events that WebHTMLView (at least) needs. // The following are expensive enough that we don't want to call them over // and over, so do them when we move into a window. [window setAcceptsMouseMovedEvents:YES]; WKSetNSWindowShouldPostEventNotifications(window, YES); } else _private->page->willMoveOffscreen(); if (window != [self window]) { [self removeWindowObservers]; [self addWindowObserversForWindow:window]; } } - (void)viewDidMoveToWindow { // Don't do anything if we aren't initialized. This happens // when decoding a WebView. When WebViews are decoded their subviews // are created by initWithCoder: and so won't be normally // initialized. The stub views are discarded by WebView. if (!_private || _private->closed) return; if ([self window]) _private->page->didMoveOnscreen(); [self _updateActiveState]; } - (void)_windowDidBecomeKey:(NSNotification *)notification { NSWindow *keyWindow = [notification object]; if (keyWindow == [self window] || keyWindow == [[self window] attachedSheet]) [self _updateActiveState]; } - (void)_windowDidResignKey:(NSNotification *)notification { NSWindow *formerKeyWindow = [notification object]; if (formerKeyWindow == [self window] || formerKeyWindow == [[self window] attachedSheet]) [self _updateActiveState]; } - (void)_windowWillOrderOnScreen:(NSNotification *)notification { if (![self shouldUpdateWhileOffscreen]) [self setNeedsDisplay:YES]; } - (void)_windowWillClose:(NSNotification *)notification { if ([self shouldCloseWithWindow] && ([self window] == [self hostWindow] || ([self window] && ![self hostWindow]) || (![self window] && [self hostWindow]))) [self close]; } - (void)setPreferences:(WebPreferences *)prefs { if (!prefs) prefs = [WebPreferences standardPreferences]; if (_private->preferences == prefs) return; [prefs willAddToWebView]; WebPreferences *oldPrefs = _private->preferences; [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedNotification object:[self preferences]]; [WebPreferences _removeReferenceForIdentifier:[oldPrefs identifier]]; _private->preferences = [prefs retain]; // After registering for the notification, post it so the WebCore settings update. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesChangedNotification:) name:WebPreferencesChangedNotification object:[self preferences]]; [[self preferences] _postPreferencesChangesNotification]; [oldPrefs didRemoveFromWebView]; [oldPrefs release]; } - (WebPreferences *)preferences { return _private->preferences; } - (void)setPreferencesIdentifier:(NSString *)anIdentifier { if (!_private->closed && ![anIdentifier isEqual:[[self preferences] identifier]]) { WebPreferences *prefs = [[WebPreferences alloc] initWithIdentifier:anIdentifier]; [self setPreferences:prefs]; [prefs release]; } } - (NSString *)preferencesIdentifier { return [[self preferences] identifier]; } - (void)setUIDelegate:delegate { _private->UIDelegate = delegate; [_private->UIDelegateForwarder release]; _private->UIDelegateForwarder = nil; } - UIDelegate { return _private->UIDelegate; } - (void)setResourceLoadDelegate: delegate { _private->resourceProgressDelegate = delegate; [self _cacheResourceLoadDelegateImplementations]; } - resourceLoadDelegate { return _private->resourceProgressDelegate; } - (void)setDownloadDelegate: delegate { _private->downloadDelegate = delegate; } - downloadDelegate { return _private->downloadDelegate; } - (void)setPolicyDelegate:delegate { _private->policyDelegate = delegate; [_private->policyDelegateForwarder release]; _private->policyDelegateForwarder = nil; } - policyDelegate { return _private->policyDelegate; } - (void)setFrameLoadDelegate:delegate { // <rdar://problem/6950660> - Due to some subtle WebKit changes - presumably to delegate callback behavior - we've // unconvered a latent bug in at least one WebKit app where the delegate wasn't properly retained by the app and // was dealloc'ed before being cleared. // This is an effort to keep such apps working for now. if ([self _needsFrameLoadDelegateRetainQuirk]) { [delegate retain]; [_private->frameLoadDelegate release]; } _private->frameLoadDelegate = delegate; [self _cacheFrameLoadDelegateImplementations]; #if ENABLE(ICONDATABASE) // If this delegate wants callbacks for icons, fire up the icon database. if (_private->frameLoadDelegateImplementations.didReceiveIconForFrameFunc) [WebIconDatabase sharedIconDatabase]; #endif } - frameLoadDelegate { return _private->frameLoadDelegate; } - (WebFrame *)mainFrame { // This can be called in initialization, before _private has been set up (3465613) if (!_private || !_private->page) return nil; return kit(_private->page->mainFrame()); } - (WebFrame *)selectedFrame { if (_private->usesDocumentViews) { // If the first responder is a view in our tree, we get the frame containing the first responder. // This is faster than searching the frame hierarchy, and will give us a result even in the case // where the focused frame doesn't actually contain a selection. WebFrame *focusedFrame = [self _focusedFrame]; if (focusedFrame) return focusedFrame; } // If the first responder is outside of our view tree, we search for a frame containing a selection. // There should be at most only one of these. return [[self mainFrame] _findFrameWithSelection]; } - (WebBackForwardList *)backForwardList { if (!_private->page) return nil; if (!_private->page->backForwardList()->enabled()) return nil; return kit(_private->page->backForwardList()); } - (void)setMaintainsBackForwardList:(BOOL)flag { if (!_private->page) return; _private->page->backForwardList()->setEnabled(flag); } - (BOOL)goBack { if (!_private->page) return NO; return _private->page->goBack(); } - (BOOL)goForward { if (!_private->page) return NO; return _private->page->goForward(); } - (BOOL)goToBackForwardItem:(WebHistoryItem *)item { if (!_private->page) return NO; _private->page->goToItem(core(item), FrameLoadTypeIndexedBackForward); return YES; } - (void)setTextSizeMultiplier:(float)m { [self _setZoomMultiplier:m isTextOnly:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]]; } - (float)textSizeMultiplier { return [self _realZoomMultiplierIsTextOnly] ? _private->zoomMultiplier : 1.0f; } - (void)_setZoomMultiplier:(float)m isTextOnly:(BOOL)isTextOnly { // NOTE: This has no visible effect when viewing a PDF (see <rdar://problem/4737380>) _private->zoomMultiplier = m; ASSERT(_private->page); if (_private->page) _private->page->settings()->setZoomsTextOnly(isTextOnly); // FIXME: it would be nice to rework this code so that _private->zoomMultiplier doesn't exist and callers // all access _private->page->settings(). Frame* coreFrame = [self _mainCoreFrame]; if (coreFrame) coreFrame->setZoomFactor(m, isTextOnly); } - (float)_zoomMultiplier:(BOOL)isTextOnly { if (isTextOnly != [self _realZoomMultiplierIsTextOnly]) return 1.0f; return _private->zoomMultiplier; } - (float)_realZoomMultiplier { return _private->zoomMultiplier; } - (BOOL)_realZoomMultiplierIsTextOnly { if (!_private->page) return NO; return _private->page->settings()->zoomsTextOnly(); } #define MinimumZoomMultiplier 0.5f #define MaximumZoomMultiplier 3.0f #define ZoomMultiplierRatio 1.2f - (BOOL)_canZoomOut:(BOOL)isTextOnly { id docView = [[[self mainFrame] frameView] documentView]; if ([docView conformsToProtocol:@protocol(_WebDocumentZooming)]) { id <_WebDocumentZooming> zoomingDocView = (id <_WebDocumentZooming>)docView; return [zoomingDocView _canZoomOut]; } return [self _zoomMultiplier:isTextOnly] / ZoomMultiplierRatio > MinimumZoomMultiplier; } - (BOOL)_canZoomIn:(BOOL)isTextOnly { id docView = [[[self mainFrame] frameView] documentView]; if ([docView conformsToProtocol:@protocol(_WebDocumentZooming)]) { id <_WebDocumentZooming> zoomingDocView = (id <_WebDocumentZooming>)docView; return [zoomingDocView _canZoomIn]; } return [self _zoomMultiplier:isTextOnly] * ZoomMultiplierRatio < MaximumZoomMultiplier; } - (IBAction)_zoomOut:(id)sender isTextOnly:(BOOL)isTextOnly { id docView = [[[self mainFrame] frameView] documentView]; if ([docView conformsToProtocol:@protocol(_WebDocumentZooming)]) { id <_WebDocumentZooming> zoomingDocView = (id <_WebDocumentZooming>)docView; return [zoomingDocView _zoomOut:sender]; } float newScale = [self _zoomMultiplier:isTextOnly] / ZoomMultiplierRatio; if (newScale > MinimumZoomMultiplier) [self _setZoomMultiplier:newScale isTextOnly:isTextOnly]; } - (IBAction)_zoomIn:(id)sender isTextOnly:(BOOL)isTextOnly { id docView = [[[self mainFrame] frameView] documentView]; if ([docView conformsToProtocol:@protocol(_WebDocumentZooming)]) { id <_WebDocumentZooming> zoomingDocView = (id <_WebDocumentZooming>)docView; return [zoomingDocView _zoomIn:sender]; } float newScale = [self _zoomMultiplier:isTextOnly] * ZoomMultiplierRatio; if (newScale < MaximumZoomMultiplier) [self _setZoomMultiplier:newScale isTextOnly:isTextOnly]; } - (BOOL)_canResetZoom:(BOOL)isTextOnly { id docView = [[[self mainFrame] frameView] documentView]; if ([docView conformsToProtocol:@protocol(_WebDocumentZooming)]) { id <_WebDocumentZooming> zoomingDocView = (id <_WebDocumentZooming>)docView; return [zoomingDocView _canResetZoom]; } return [self _zoomMultiplier:isTextOnly] != 1.0f; } - (IBAction)_resetZoom:(id)sender isTextOnly:(BOOL)isTextOnly { id docView = [[[self mainFrame] frameView] documentView]; if ([docView conformsToProtocol:@protocol(_WebDocumentZooming)]) { id <_WebDocumentZooming> zoomingDocView = (id <_WebDocumentZooming>)docView; return [zoomingDocView _resetZoom:sender]; } if ([self _zoomMultiplier:isTextOnly] != 1.0f) [self _setZoomMultiplier:1.0f isTextOnly:isTextOnly]; } - (void)setApplicationNameForUserAgent:(NSString *)applicationName { NSString *name = [applicationName copy]; [_private->applicationNameForUserAgent release]; _private->applicationNameForUserAgent = name; if (!_private->userAgentOverridden) _private->userAgent = String(); } - (NSString *)applicationNameForUserAgent { return [[_private->applicationNameForUserAgent retain] autorelease]; } - (void)setCustomUserAgent:(NSString *)userAgentString { _private->userAgent = userAgentString; _private->userAgentOverridden = userAgentString != nil; } - (NSString *)customUserAgent { if (!_private->userAgentOverridden) return nil; return _private->userAgent; } - (void)setMediaStyle:(NSString *)mediaStyle { if (_private->mediaStyle != mediaStyle) { [_private->mediaStyle release]; _private->mediaStyle = [mediaStyle copy]; } } - (NSString *)mediaStyle { return _private->mediaStyle; } - (BOOL)supportsTextEncoding { id documentView = [[[self mainFrame] frameView] documentView]; return [documentView conformsToProtocol:@protocol(WebDocumentText)] && [documentView supportsTextEncoding]; } - (void)setCustomTextEncodingName:(NSString *)encoding { NSString *oldEncoding = [self customTextEncodingName]; if (encoding == oldEncoding || [encoding isEqualToString:oldEncoding]) return; if (Frame* mainFrame = [self _mainCoreFrame]) mainFrame->loader()->reloadWithOverrideEncoding(encoding); } - (NSString *)_mainFrameOverrideEncoding { WebDataSource *dataSource = [[self mainFrame] provisionalDataSource]; if (dataSource == nil) dataSource = [[self mainFrame] _dataSource]; if (dataSource == nil) return nil; return nsStringNilIfEmpty([dataSource _documentLoader]->overrideEncoding()); } - (NSString *)customTextEncodingName { return [self _mainFrameOverrideEncoding]; } - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script { // Return statements are only valid in a function but some applications pass in scripts // prefixed with return (<rdar://problems/5103720&4616860>) since older WebKit versions // silently ignored the return. If the application is linked against an earlier version // of WebKit we will strip the return so the script wont fail. if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_JAVASCRIPT_RETURN_QUIRK)) { NSRange returnStringRange = [script rangeOfString:@"return "]; if (returnStringRange.length && !returnStringRange.location) script = [script substringFromIndex:returnStringRange.location + returnStringRange.length]; } NSString *result = [[self mainFrame] _stringByEvaluatingJavaScriptFromString:script]; // The only way stringByEvaluatingJavaScriptFromString can return nil is if the frame was removed by the script // Since there's no way to get rid of the main frame, result will never ever be nil here. ASSERT(result); return result; } - (WebScriptObject *)windowScriptObject { Frame* coreFrame = [self _mainCoreFrame]; if (!coreFrame) return nil; return coreFrame->script()->windowScriptObject(); } // Get the appropriate user-agent string for a particular URL. - (NSString *)userAgentForURL:(NSURL *)url { return [self _userAgentForURL:KURL([url absoluteURL])]; } - (void)setHostWindow:(NSWindow *)hostWindow { if (_private->closed) return; if (hostWindow == _private->hostWindow) return; Frame* coreFrame = [self _mainCoreFrame]; if (_private->usesDocumentViews) { for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) [[[kit(frame) frameView] documentView] viewWillMoveToHostWindow:hostWindow]; } if (_private->hostWindow && [self window] != _private->hostWindow) [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowWillCloseNotification object:_private->hostWindow]; if (hostWindow) [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillClose:) name:NSWindowWillCloseNotification object:hostWindow]; [_private->hostWindow release]; _private->hostWindow = [hostWindow retain]; if (_private->usesDocumentViews) { for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) [[[kit(frame) frameView] documentView] viewDidMoveToHostWindow]; } } - (NSWindow *)hostWindow { // -[WebView hostWindow] can sometimes be called from the WebView's [super dealloc] method // so we check here to make sure it's not null. if (!_private) return nil; return _private->hostWindow; } - (NSView <WebDocumentView> *)documentViewAtWindowPoint:(NSPoint)point { return [[self _frameViewAtWindowPoint:point] documentView]; } - (NSDictionary *)_elementAtWindowPoint:(NSPoint)windowPoint { WebFrameView *frameView = [self _frameViewAtWindowPoint:windowPoint]; if (!frameView) return nil; NSView <WebDocumentView> *documentView = [frameView documentView]; if ([documentView conformsToProtocol:@protocol(WebDocumentElement)]) { NSPoint point = [documentView convertPoint:windowPoint fromView:nil]; return [(NSView <WebDocumentElement> *)documentView elementAtPoint:point]; } return [NSDictionary dictionaryWithObject:[frameView webFrame] forKey:WebElementFrameKey]; } - (NSDictionary *)elementAtPoint:(NSPoint)point { return [self _elementAtWindowPoint:[self convertPoint:point toView:nil]]; } // The following 2 internal NSView methods are called on the drag destination to make scrolling while dragging work. // Scrolling while dragging will only work if the drag destination is in a scroll view. The WebView is the drag destination. // When dragging to a WebView, the document subview should scroll, but it doesn't because it is not the drag destination. // Forward these calls to the document subview to make its scroll view scroll. - (void)_autoscrollForDraggingInfo:(id)draggingInfo timeDelta:(NSTimeInterval)repeatDelta { NSView <WebDocumentView> *documentView = [self documentViewAtWindowPoint:[draggingInfo draggingLocation]]; [documentView _autoscrollForDraggingInfo:draggingInfo timeDelta:repeatDelta]; } - (BOOL)_shouldAutoscrollForDraggingInfo:(id)draggingInfo { NSView <WebDocumentView> *documentView = [self documentViewAtWindowPoint:[draggingInfo draggingLocation]]; return [documentView _shouldAutoscrollForDraggingInfo:draggingInfo]; } - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)draggingInfo { NSView <WebDocumentView>* view = [self documentViewAtWindowPoint:[draggingInfo draggingLocation]]; WebPasteboardHelper helper([view isKindOfClass:[WebHTMLView class]] ? (WebHTMLView*)view : nil); IntPoint client([draggingInfo draggingLocation]); IntPoint global(globalPoint([draggingInfo draggingLocation], [self window])); DragData dragData(draggingInfo, client, global, (DragOperation)[draggingInfo draggingSourceOperationMask], &helper); return core(self)->dragController()->dragEntered(&dragData); } - (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)draggingInfo { Page* page = core(self); if (!page) return NSDragOperationNone; NSView <WebDocumentView>* view = [self documentViewAtWindowPoint:[draggingInfo draggingLocation]]; WebPasteboardHelper helper([view isKindOfClass:[WebHTMLView class]] ? (WebHTMLView*)view : nil); IntPoint client([draggingInfo draggingLocation]); IntPoint global(globalPoint([draggingInfo draggingLocation], [self window])); DragData dragData(draggingInfo, client, global, (DragOperation)[draggingInfo draggingSourceOperationMask], &helper); return page->dragController()->dragUpdated(&dragData); } - (void)draggingExited:(id <NSDraggingInfo>)draggingInfo { Page* page = core(self); if (!page) return; NSView <WebDocumentView>* view = [self documentViewAtWindowPoint:[draggingInfo draggingLocation]]; WebPasteboardHelper helper([view isKindOfClass:[WebHTMLView class]] ? (WebHTMLView*)view : nil); IntPoint client([draggingInfo draggingLocation]); IntPoint global(globalPoint([draggingInfo draggingLocation], [self window])); DragData dragData(draggingInfo, client, global, (DragOperation)[draggingInfo draggingSourceOperationMask], &helper); page->dragController()->dragExited(&dragData); } - (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)draggingInfo { return YES; } - (BOOL)performDragOperation:(id <NSDraggingInfo>)draggingInfo { NSView <WebDocumentView>* view = [self documentViewAtWindowPoint:[draggingInfo draggingLocation]]; WebPasteboardHelper helper([view isKindOfClass:[WebHTMLView class]]? (WebHTMLView*)view : nil); IntPoint client([draggingInfo draggingLocation]); IntPoint global(globalPoint([draggingInfo draggingLocation], [self window])); DragData dragData(draggingInfo, client, global, (DragOperation)[draggingInfo draggingSourceOperationMask], &helper); return core(self)->dragController()->performDrag(&dragData); } - (NSView *)_hitTest:(NSPoint *)point dragTypes:(NSSet *)types { NSView *hitView = [super _hitTest:point dragTypes:types]; if (!hitView && [[self superview] mouse:*point inRect:[self frame]]) return self; return hitView; } - (BOOL)acceptsFirstResponder { if (_private->usesDocumentViews) return [[[self mainFrame] frameView] acceptsFirstResponder]; // FIXME (Viewless): Need more code from WebHTMLView here. return YES; } - (BOOL)becomeFirstResponder { if (_private->usesDocumentViews) { if (_private->becomingFirstResponder) { // Fix for unrepro infinite recursion reported in Radar 4448181. If we hit this assert on // a debug build, we should figure out what causes the problem and do a better fix. ASSERT_NOT_REACHED(); return NO; } // This works together with setNextKeyView to splice the WebView into // the key loop similar to the way NSScrollView does this. Note that // WebFrameView has very similar code. NSWindow *window = [self window]; WebFrameView *mainFrameView = [[self mainFrame] frameView]; NSResponder *previousFirstResponder = [[self window] _oldFirstResponderBeforeBecoming]; BOOL fromOutside = ![previousFirstResponder isKindOfClass:[NSView class]] || (![(NSView *)previousFirstResponder isDescendantOf:self] && previousFirstResponder != self); if ([window keyViewSelectionDirection] == NSSelectingPrevious) { NSView *previousValidKeyView = [self previousValidKeyView]; if (previousValidKeyView != self && previousValidKeyView != mainFrameView) { _private->becomingFirstResponder = YES; _private->becomingFirstResponderFromOutside = fromOutside; [window makeFirstResponder:previousValidKeyView]; _private->becomingFirstResponderFromOutside = NO; _private->becomingFirstResponder = NO; return YES; } return NO; } if ([mainFrameView acceptsFirstResponder]) { _private->becomingFirstResponder = YES; _private->becomingFirstResponderFromOutside = fromOutside; [window makeFirstResponder:mainFrameView]; _private->becomingFirstResponderFromOutside = NO; _private->becomingFirstResponder = NO; return YES; } return NO; } // FIXME (Viewless): Need more code from WebHTMLView here. return YES; } - (NSView *)_webcore_effectiveFirstResponder { if (_private && _private->usesDocumentViews) { if (WebFrameView *frameView = [[self mainFrame] frameView]) return [frameView _webcore_effectiveFirstResponder]; } return [super _webcore_effectiveFirstResponder]; } - (void)setNextKeyView:(NSView *)view { if (_private && _private->usesDocumentViews) { // This works together with becomeFirstResponder to splice the WebView into // the key loop similar to the way NSScrollView does this. Note that // WebFrameView has similar code. if (WebFrameView *mainFrameView = [[self mainFrame] frameView]) { [mainFrameView setNextKeyView:view]; return; } } [super setNextKeyView:view]; } static WebFrame *incrementFrame(WebFrame *frame, BOOL forward, BOOL wrapFlag) { Frame* coreFrame = core(frame); return kit(forward ? coreFrame->tree()->traverseNextWithWrap(wrapFlag) : coreFrame->tree()->traversePreviousWithWrap(wrapFlag)); } - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag { return [self searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag startInSelection:NO]; } + (void)registerViewClass:(Class)viewClass representationClass:(Class)representationClass forMIMEType:(NSString *)MIMEType { [[WebFrameView _viewTypesAllowImageTypeOmission:YES] setObject:viewClass forKey:MIMEType]; [[WebDataSource _repTypesAllowImageTypeOmission:YES] setObject:representationClass forKey:MIMEType]; // FIXME: We also need to maintain MIMEType registrations (which can be dynamically changed) // in the WebCore MIMEType registry. For now we're doing this in a safe, limited manner // to fix <rdar://problem/5372989> - a future revamping of the entire system is neccesary for future robustness if ([viewClass class] == [WebHTMLView class]) MIMETypeRegistry::getSupportedNonImageMIMETypes().add(MIMEType); } - (void)setGroupName:(NSString *)groupName { if (!_private->page) return; _private->page->setGroupName(groupName); } - (NSString *)groupName { if (!_private->page) return nil; return _private->page->groupName(); } - (double)estimatedProgress { if (!_private->page) return 0.0; return _private->page->progress()->estimatedProgress(); } - (NSArray *)pasteboardTypesForSelection { NSView <WebDocumentView> *documentView = [[[self _selectedOrMainFrame] frameView] documentView]; if ([documentView conformsToProtocol:@protocol(WebDocumentSelection)]) { return [(NSView <WebDocumentSelection> *)documentView pasteboardTypesForSelection]; } return [NSArray array]; } - (void)writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard { WebFrame *frame = [self _selectedOrMainFrame]; if (frame && [frame _hasSelection]) { NSView <WebDocumentView> *documentView = [[frame frameView] documentView]; if ([documentView conformsToProtocol:@protocol(WebDocumentSelection)]) [(NSView <WebDocumentSelection> *)documentView writeSelectionWithPasteboardTypes:types toPasteboard:pasteboard]; } } - (NSArray *)pasteboardTypesForElement:(NSDictionary *)element { if ([element objectForKey:WebElementImageURLKey] != nil) { return [NSPasteboard _web_writableTypesForImageIncludingArchive:([element objectForKey:WebElementDOMNodeKey] != nil)]; } else if ([element objectForKey:WebElementLinkURLKey] != nil) { return [NSPasteboard _web_writableTypesForURL]; } else if ([[element objectForKey:WebElementIsSelectedKey] boolValue]) { return [self pasteboardTypesForSelection]; } return [NSArray array]; } - (void)writeElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard { if ([element objectForKey:WebElementImageURLKey] != nil) { [self _writeImageForElement:element withPasteboardTypes:types toPasteboard:pasteboard]; } else if ([element objectForKey:WebElementLinkURLKey] != nil) { [self _writeLinkElement:element withPasteboardTypes:types toPasteboard:pasteboard]; } else if ([[element objectForKey:WebElementIsSelectedKey] boolValue]) { [self writeSelectionWithPasteboardTypes:types toPasteboard:pasteboard]; } } - (void)moveDragCaretToPoint:(NSPoint)point { if (Page* page = core(self)) page->dragController()->placeDragCaret(IntPoint([self convertPoint:point toView:nil])); } - (void)removeDragCaret { if (Page* page = core(self)) page->dragController()->dragEnded(); } - (void)setMainFrameURL:(NSString *)URLString { [[self mainFrame] loadRequest: [NSURLRequest requestWithURL: [NSURL _web_URLWithDataAsString: URLString]]]; } - (NSString *)mainFrameURL { WebDataSource *ds; ds = [[self mainFrame] provisionalDataSource]; if (!ds) ds = [[self mainFrame] _dataSource]; return [[[ds request] URL] _web_originalDataAsString]; } - (BOOL)isLoading { LOG (Bindings, "isLoading = %d", (int)[self _isLoading]); return [self _isLoading]; } - (NSString *)mainFrameTitle { NSString *mainFrameTitle = [[[self mainFrame] _dataSource] pageTitle]; return (mainFrameTitle != nil) ? mainFrameTitle : (NSString *)@""; } - (NSImage *)mainFrameIcon { return [[WebIconDatabase sharedIconDatabase] iconForURL:[[[[self mainFrame] _dataSource] _URL] _web_originalDataAsString] withSize:WebIconSmallSize]; } - (DOMDocument *)mainFrameDocument { // only return the actual value if the state we're in gives NSTreeController // enough time to release its observers on the old model if (_private->mainFrameDocumentReady) return [[self mainFrame] DOMDocument]; return nil; } - (void)setDrawsBackground:(BOOL)drawsBackground { if (_private->drawsBackground == drawsBackground) return; _private->drawsBackground = drawsBackground; [[self mainFrame] _updateBackgroundAndUpdatesWhileOffscreen]; } - (BOOL)drawsBackground { // This method can be called beneath -[NSView dealloc] after we have cleared _private, // indirectly via -[WebFrameView viewDidMoveToWindow]. return !_private || _private->drawsBackground; } - (void)setShouldUpdateWhileOffscreen:(BOOL)updateWhileOffscreen { if (_private->shouldUpdateWhileOffscreen == updateWhileOffscreen) return; _private->shouldUpdateWhileOffscreen = updateWhileOffscreen; [[self mainFrame] _updateBackgroundAndUpdatesWhileOffscreen]; } - (BOOL)shouldUpdateWhileOffscreen { return _private->shouldUpdateWhileOffscreen; } - (void)setCurrentNodeHighlight:(WebNodeHighlight *)nodeHighlight { id old = _private->currentNodeHighlight; _private->currentNodeHighlight = [nodeHighlight retain]; [old release]; } - (WebNodeHighlight *)currentNodeHighlight { return _private->currentNodeHighlight; } - (NSView *)previousValidKeyView { NSView *result = [super previousValidKeyView]; // Work around AppKit bug 6905484. If the result is a view that's inside this one, it's // possible it is the wrong answer, because the fact that it's a descendant causes the // code that implements key view redirection to fail; this means we won't redirect to // the toolbar, for example, when we hit the edge of a window. Since the bug is specific // to cases where the receiver of previousValidKeyView is an ancestor of the last valid // key view in the loop, we can sidestep it by walking along previous key views until // we find one that is not a superview, then using that to call previousValidKeyView. if (![result isDescendantOf:self]) return result; // Use a visited set so we don't loop indefinitely when walking crazy key loops. // AppKit uses such sets internally and we want our loop to be as robust as its loops. RetainPtr<CFMutableSetRef> visitedViews = CFSetCreateMutable(0, 0, 0); CFSetAddValue(visitedViews.get(), result); NSView *previousView = self; do { CFSetAddValue(visitedViews.get(), previousView); previousView = [previousView previousKeyView]; if (!previousView || CFSetGetValue(visitedViews.get(), previousView)) return result; } while ([result isDescendantOf:previousView]); return [previousView previousValidKeyView]; } - (void)mouseDown:(NSEvent *)event { // FIXME (Viewless): This method should be shared with WebHTMLView, which needs to // do the same work in the usesDocumentViews case. We don't want to maintain two // duplicate copies of this method. if (_private->usesDocumentViews) { [super mouseDown:event]; return; } // There's a chance that responding to this event will run a nested event loop, and // fetching a new event might release the old one. Retaining and then autoreleasing // the current event prevents that from causing a problem inside WebKit or AppKit code. [[event retain] autorelease]; RetainPtr<WebView> protector = self; if ([[self inputContext] wantsToHandleMouseEvents] && [[self inputContext] handleMouseEvent:event]) return; _private->handlingMouseDownEvent = YES; // Record the mouse down position so we can determine drag hysteresis. [self _setMouseDownEvent:event]; NSInputManager *currentInputManager = [NSInputManager currentInputManager]; if ([currentInputManager wantsToHandleMouseEvents] && [currentInputManager handleMouseEvent:event]) goto done; [_private->completionController endRevertingChange:NO moveLeft:NO]; // If the web page handles the context menu event and menuForEvent: returns nil, we'll get control click events here. // We don't want to pass them along to KHTML a second time. if (!([event modifierFlags] & NSControlKeyMask)) { _private->ignoringMouseDraggedEvents = NO; // Don't do any mouseover while the mouse is down. [self _cancelUpdateMouseoverTimer]; // Let WebCore get a chance to deal with the event. This will call back to us // to start the autoscroll timer if appropriate. if (Frame* frame = [self _mainCoreFrame]) frame->eventHandler()->mouseDown(event); } done: _private->handlingMouseDownEvent = NO; } - (void)mouseUp:(NSEvent *)event { // FIXME (Viewless): This method should be shared with WebHTMLView, which needs to // do the same work in the usesDocumentViews case. We don't want to maintain two // duplicate copies of this method. if (_private->usesDocumentViews) { [super mouseUp:event]; return; } // There's a chance that responding to this event will run a nested event loop, and // fetching a new event might release the old one. Retaining and then autoreleasing // the current event prevents that from causing a problem inside WebKit or AppKit code. [[event retain] autorelease]; [self _setMouseDownEvent:nil]; NSInputManager *currentInputManager = [NSInputManager currentInputManager]; if ([currentInputManager wantsToHandleMouseEvents] && [currentInputManager handleMouseEvent:event]) return; [self retain]; [self _stopAutoscrollTimer]; if (Frame* frame = [self _mainCoreFrame]) frame->eventHandler()->mouseUp(event); [self _updateMouseoverWithFakeEvent]; [self release]; } @end @implementation WebView (WebIBActions) - (IBAction)takeStringURLFrom: sender { NSString *URLString = [sender stringValue]; [[self mainFrame] loadRequest: [NSURLRequest requestWithURL: [NSURL _web_URLWithDataAsString: URLString]]]; } - (BOOL)canGoBack { if (!_private->page) return NO; return !!_private->page->backForwardList()->backItem(); } - (BOOL)canGoForward { if (!_private->page) return NO; return !!_private->page->backForwardList()->forwardItem(); } - (IBAction)goBack:(id)sender { [self goBack]; } - (IBAction)goForward:(id)sender { [self goForward]; } - (IBAction)stopLoading:(id)sender { [[self mainFrame] stopLoading]; } - (IBAction)reload:(id)sender { [[self mainFrame] reload]; } - (IBAction)reloadFromOrigin:(id)sender { [[self mainFrame] reloadFromOrigin]; } // FIXME: This code should move into WebCore so that it is not duplicated in each WebKit. // (This includes canMakeTextSmaller/Larger, makeTextSmaller/Larger, and canMakeTextStandardSize/makeTextStandardSize) - (BOOL)canMakeTextSmaller { return [self _canZoomOut:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]]; } - (IBAction)makeTextSmaller:(id)sender { return [self _zoomOut:sender isTextOnly:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]]; } - (BOOL)canMakeTextLarger { return [self _canZoomIn:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]]; } - (IBAction)makeTextLarger:(id)sender { return [self _zoomIn:sender isTextOnly:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]]; } - (BOOL)canMakeTextStandardSize { return [self _canResetZoom:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]]; } - (IBAction)makeTextStandardSize:(id)sender { return [self _resetZoom:sender isTextOnly:![[NSUserDefaults standardUserDefaults] boolForKey:WebKitDebugFullPageZoomPreferenceKey]]; } - (IBAction)toggleSmartInsertDelete:(id)sender { [self setSmartInsertDeleteEnabled:![self smartInsertDeleteEnabled]]; } - (IBAction)toggleContinuousSpellChecking:(id)sender { [self setContinuousSpellCheckingEnabled:![self isContinuousSpellCheckingEnabled]]; } - (BOOL)_responderValidateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item { id responder = [self _responderForResponderOperations]; if (responder != self && [responder respondsToSelector:[item action]]) { if ([responder respondsToSelector:@selector(validateUserInterfaceItemWithoutDelegate:)]) return [responder validateUserInterfaceItemWithoutDelegate:item]; if ([responder respondsToSelector:@selector(validateUserInterfaceItem:)]) return [responder validateUserInterfaceItem:item]; return YES; } return NO; } #define VALIDATE(name) \ else if (action == @selector(name:)) { return [self _responderValidateUserInterfaceItem:item]; } - (BOOL)validateUserInterfaceItemWithoutDelegate:(id <NSValidatedUserInterfaceItem>)item { SEL action = [item action]; if (action == @selector(goBack:)) { return [self canGoBack]; } else if (action == @selector(goForward:)) { return [self canGoForward]; } else if (action == @selector(makeTextLarger:)) { return [self canMakeTextLarger]; } else if (action == @selector(makeTextSmaller:)) { return [self canMakeTextSmaller]; } else if (action == @selector(makeTextStandardSize:)) { return [self canMakeTextStandardSize]; } else if (action == @selector(reload:)) { return [[self mainFrame] _dataSource] != nil; } else if (action == @selector(stopLoading:)) { return [self _isLoading]; } else if (action == @selector(toggleContinuousSpellChecking:)) { BOOL checkMark = NO; BOOL retVal = NO; if ([self _continuousCheckingAllowed]) { checkMark = [self isContinuousSpellCheckingEnabled]; retVal = YES; } if ([(NSObject *)item isKindOfClass:[NSMenuItem class]]) { NSMenuItem *menuItem = (NSMenuItem *)item; [menuItem setState:checkMark ? NSOnState : NSOffState]; } return retVal; } else if (action == @selector(toggleSmartInsertDelete:)) { BOOL checkMark = [self smartInsertDeleteEnabled]; if ([(NSObject *)item isKindOfClass:[NSMenuItem class]]) { NSMenuItem *menuItem = (NSMenuItem *)item; [menuItem setState:checkMark ? NSOnState : NSOffState]; } return YES; #ifndef BUILDING_ON_TIGER } else if (action == @selector(toggleGrammarChecking:)) { BOOL checkMark = [self isGrammarCheckingEnabled]; if ([(NSObject *)item isKindOfClass:[NSMenuItem class]]) { NSMenuItem *menuItem = (NSMenuItem *)item; [menuItem setState:checkMark ? NSOnState : NSOffState]; } return YES; #endif #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) } else if (action == @selector(toggleAutomaticQuoteSubstitution:)) { BOOL checkMark = [self isAutomaticQuoteSubstitutionEnabled]; if ([(NSObject *)item isKindOfClass:[NSMenuItem class]]) { NSMenuItem *menuItem = (NSMenuItem *)item; [menuItem setState:checkMark ? NSOnState : NSOffState]; } return YES; } else if (action == @selector(toggleAutomaticLinkDetection:)) { BOOL checkMark = [self isAutomaticLinkDetectionEnabled]; if ([(NSObject *)item isKindOfClass:[NSMenuItem class]]) { NSMenuItem *menuItem = (NSMenuItem *)item; [menuItem setState:checkMark ? NSOnState : NSOffState]; } return YES; } else if (action == @selector(toggleAutomaticDashSubstitution:)) { BOOL checkMark = [self isAutomaticDashSubstitutionEnabled]; if ([(NSObject *)item isKindOfClass:[NSMenuItem class]]) { NSMenuItem *menuItem = (NSMenuItem *)item; [menuItem setState:checkMark ? NSOnState : NSOffState]; } return YES; } else if (action == @selector(toggleAutomaticTextReplacement:)) { BOOL checkMark = [self isAutomaticTextReplacementEnabled]; if ([(NSObject *)item isKindOfClass:[NSMenuItem class]]) { NSMenuItem *menuItem = (NSMenuItem *)item; [menuItem setState:checkMark ? NSOnState : NSOffState]; } return YES; } else if (action == @selector(toggleAutomaticSpellingCorrection:)) { BOOL checkMark = [self isAutomaticSpellingCorrectionEnabled]; if ([(NSObject *)item isKindOfClass:[NSMenuItem class]]) { NSMenuItem *menuItem = (NSMenuItem *)item; [menuItem setState:checkMark ? NSOnState : NSOffState]; } return YES; #endif } FOR_EACH_RESPONDER_SELECTOR(VALIDATE) return YES; } - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item { BOOL result = [self validateUserInterfaceItemWithoutDelegate:item]; return CallUIDelegateReturningBoolean(result, self, @selector(webView:validateUserInterfaceItem:defaultValidation:), item, result); } @end @implementation WebView (WebPendingPublic) - (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode { if (runLoop && mode) core(self)->addSchedulePair(SchedulePair::create(runLoop, (CFStringRef)mode)); } - (void)unscheduleFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode { if (runLoop && mode) core(self)->removeSchedulePair(SchedulePair::create(runLoop, (CFStringRef)mode)); } - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag startInSelection:(BOOL)startInSelection { if (_private->closed) return NO; // Get the frame holding the selection, or start with the main frame WebFrame *startFrame = [self _selectedOrMainFrame]; // Search the first frame, then all the other frames, in order NSView <WebDocumentSearching> *startSearchView = nil; WebFrame *frame = startFrame; do { WebFrame *nextFrame = incrementFrame(frame, forward, wrapFlag); BOOL onlyOneFrame = (frame == nextFrame); ASSERT(!onlyOneFrame || frame == startFrame); id <WebDocumentView> view = [[frame frameView] documentView]; if ([view conformsToProtocol:@protocol(WebDocumentSearching)]) { NSView <WebDocumentSearching> *searchView = (NSView <WebDocumentSearching> *)view; if (frame == startFrame) startSearchView = searchView; BOOL foundString; // In some cases we have to search some content twice; see comment later in this method. // We can avoid ever doing this in the common one-frame case by passing YES for wrapFlag // here, and then bailing out before we get to the code that would search again in the // same content. BOOL wrapOnThisPass = wrapFlag && onlyOneFrame; if ([searchView conformsToProtocol:@protocol(WebDocumentIncrementalSearching)]) foundString = [(NSView <WebDocumentIncrementalSearching> *)searchView searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapOnThisPass startInSelection:startInSelection]; else foundString = [searchView searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapOnThisPass]; if (foundString) { if (frame != startFrame) [startFrame _clearSelection]; [[self window] makeFirstResponder:searchView]; return YES; } if (onlyOneFrame) return NO; } frame = nextFrame; } while (frame && frame != startFrame); // If there are multiple frames and wrapFlag is true and we've visited each one without finding a result, we still need to search in the // first-searched frame up to the selection. However, the API doesn't provide a way to search only up to a particular point. The only // way to make sure the entire frame is searched is to pass YES for the wrapFlag. When there are no matches, this will search again // some content that we already searched on the first pass. In the worst case, we could search the entire contents of this frame twice. // To fix this, we'd need to add a mechanism to specify a range in which to search. if (wrapFlag && startSearchView) { BOOL foundString; if ([startSearchView conformsToProtocol:@protocol(WebDocumentIncrementalSearching)]) foundString = [(NSView <WebDocumentIncrementalSearching> *)startSearchView searchFor:string direction:forward caseSensitive:caseFlag wrap:YES startInSelection:startInSelection]; else foundString = [startSearchView searchFor:string direction:forward caseSensitive:caseFlag wrap:YES]; if (foundString) { [[self window] makeFirstResponder:startSearchView]; return YES; } } return NO; } - (void)setHoverFeedbackSuspended:(BOOL)newValue { if (_private->hoverFeedbackSuspended == newValue) return; _private->hoverFeedbackSuspended = newValue; if (_private->usesDocumentViews) { id <WebDocumentView> documentView = [[[self mainFrame] frameView] documentView]; // FIXME: in a perfect world we'd do this in a general way that worked with any document view, // such as by calling a protocol method or using respondsToSelector or sending a notification. // But until there is any need for these more general solutions, we'll just hardwire it to work // with WebHTMLView. // Note that _hoverFeedbackSuspendedChanged needs to be called only on the main WebHTMLView, not // on each subframe separately. if ([documentView isKindOfClass:[WebHTMLView class]]) [(WebHTMLView *)documentView _hoverFeedbackSuspendedChanged]; return; } [self _updateMouseoverWithFakeEvent]; } - (BOOL)isHoverFeedbackSuspended { return _private->hoverFeedbackSuspended; } - (void)setMainFrameDocumentReady:(BOOL)mainFrameDocumentReady { // by setting this to NO, calls to mainFrameDocument are forced to return nil // setting this to YES lets it return the actual DOMDocument value // we use this to tell NSTreeController to reset its observers and clear its state if (_private->mainFrameDocumentReady == mainFrameDocumentReady) return; [self _willChangeValueForKey:_WebMainFrameDocumentKey]; _private->mainFrameDocumentReady = mainFrameDocumentReady; [self _didChangeValueForKey:_WebMainFrameDocumentKey]; // this will cause observers to call mainFrameDocument where this flag will be checked } // This method name is used by Mail on Tiger (but not post-Tiger), so we shouldn't delete it // until the day comes when we're no longer supporting Mail on Tiger. - (WebFrame *)_frameForCurrentSelection { return [self _selectedOrMainFrame]; } - (void)setTabKeyCyclesThroughElements:(BOOL)cyclesElements { _private->tabKeyCyclesThroughElementsChanged = YES; if (_private->page) _private->page->setTabKeyCyclesThroughElements(cyclesElements); } - (BOOL)tabKeyCyclesThroughElements { return _private->page && _private->page->tabKeyCyclesThroughElements(); } - (void)setScriptDebugDelegate:(id)delegate { _private->scriptDebugDelegate = delegate; [self _cacheScriptDebugDelegateImplementations]; if (delegate) [self _attachScriptDebuggerToAllFrames]; else [self _detachScriptDebuggerFromAllFrames]; } - (id)scriptDebugDelegate { return _private->scriptDebugDelegate; } - (void)setHistoryDelegate:(id)delegate { _private->historyDelegate = delegate; [self _cacheHistoryDelegateImplementations]; } - (id)historyDelegate { return _private->historyDelegate; } - (BOOL)shouldClose { Frame* coreFrame = [self _mainCoreFrame]; if (!coreFrame) return YES; return coreFrame->shouldClose(); } static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue jsValue) { NSAppleEventDescriptor* aeDesc = 0; if (jsValue.isBoolean()) return [NSAppleEventDescriptor descriptorWithBoolean:jsValue.getBoolean()]; if (jsValue.isString()) return [NSAppleEventDescriptor descriptorWithString:String(jsValue.getString())]; if (jsValue.isNumber()) { double value = jsValue.uncheckedGetNumber(); int intValue = value; if (value == intValue) return [NSAppleEventDescriptor descriptorWithDescriptorType:typeSInt32 bytes:&intValue length:sizeof(intValue)]; return [NSAppleEventDescriptor descriptorWithDescriptorType:typeIEEE64BitFloatingPoint bytes:&value length:sizeof(value)]; } if (jsValue.isObject()) { JSObject* object = jsValue.getObject(); if (object->inherits(&DateInstance::info)) { DateInstance* date = static_cast<DateInstance*>(object); double ms = 0; int tzOffset = 0; if (date->getTime(ms, tzOffset)) { CFAbsoluteTime utcSeconds = ms / 1000 - kCFAbsoluteTimeIntervalSince1970; LongDateTime ldt; if (noErr == UCConvertCFAbsoluteTimeToLongDateTime(utcSeconds, &ldt)) return [NSAppleEventDescriptor descriptorWithDescriptorType:typeLongDateTime bytes:&ldt length:sizeof(ldt)]; } } else if (object->inherits(&JSArray::info)) { DEFINE_STATIC_LOCAL(HashSet<JSObject*>, visitedElems, ()); if (!visitedElems.contains(object)) { visitedElems.add(object); JSArray* array = static_cast<JSArray*>(object); aeDesc = [NSAppleEventDescriptor listDescriptor]; unsigned numItems = array->length(); for (unsigned i = 0; i < numItems; ++i) [aeDesc insertDescriptor:aeDescFromJSValue(exec, array->get(exec, i)) atIndex:0]; visitedElems.remove(object); return aeDesc; } } JSValue primitive = object->toPrimitive(exec); if (exec->hadException()) { exec->clearException(); return [NSAppleEventDescriptor nullDescriptor]; } return aeDescFromJSValue(exec, primitive); } if (jsValue.isUndefined()) return [NSAppleEventDescriptor descriptorWithTypeCode:cMissingValue]; ASSERT(jsValue.isNull()); return [NSAppleEventDescriptor nullDescriptor]; } - (NSAppleEventDescriptor *)aeDescByEvaluatingJavaScriptFromString:(NSString *)script { Frame* coreFrame = [self _mainCoreFrame]; if (!coreFrame) return nil; if (!coreFrame->document()) return nil; JSValue result = coreFrame->loader()->executeScript(script, true).jsValue(); if (!result) // FIXME: pass errors return 0; JSLock lock(SilenceAssertionsOnly); return aeDescFromJSValue(coreFrame->script()->globalObject()->globalExec(), result); } - (BOOL)canMarkAllTextMatches { WebFrame *frame = [self mainFrame]; do { id <WebDocumentView> view = [[frame frameView] documentView]; if (view && ![view conformsToProtocol:@protocol(WebMultipleTextMatches)]) return NO; frame = incrementFrame(frame, YES, NO); } while (frame); return YES; } - (NSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(NSUInteger)limit { WebFrame *frame = [self mainFrame]; unsigned matchCount = 0; do { id <WebDocumentView> view = [[frame frameView] documentView]; if ([view conformsToProtocol:@protocol(WebMultipleTextMatches)]) { [(NSView <WebMultipleTextMatches>*)view setMarkedTextMatchesAreHighlighted:highlight]; ASSERT(limit == 0 || matchCount < limit); matchCount += [(NSView <WebMultipleTextMatches>*)view markAllMatchesForText:string caseSensitive:caseFlag limit:limit == 0 ? 0 : limit - matchCount]; // Stop looking if we've reached the limit. A limit of 0 means no limit. if (limit > 0 && matchCount >= limit) break; } frame = incrementFrame(frame, YES, NO); } while (frame); return matchCount; } - (void)unmarkAllTextMatches { WebFrame *frame = [self mainFrame]; do { id <WebDocumentView> view = [[frame frameView] documentView]; if ([view conformsToProtocol:@protocol(WebMultipleTextMatches)]) [(NSView <WebMultipleTextMatches>*)view unmarkAllTextMatches]; frame = incrementFrame(frame, YES, NO); } while (frame); } - (NSArray *)rectsForTextMatches { NSMutableArray *result = [NSMutableArray array]; WebFrame *frame = [self mainFrame]; do { id <WebDocumentView> view = [[frame frameView] documentView]; if ([view conformsToProtocol:@protocol(WebMultipleTextMatches)]) { NSView <WebMultipleTextMatches> *documentView = (NSView <WebMultipleTextMatches> *)view; NSRect documentViewVisibleRect = [documentView visibleRect]; NSArray *originalRects = [documentView rectsForTextMatches]; unsigned rectCount = [originalRects count]; unsigned rectIndex; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; for (rectIndex = 0; rectIndex < rectCount; ++rectIndex) { NSRect r = [[originalRects objectAtIndex:rectIndex] rectValue]; // Clip rect to document view's visible rect so rect is confined to subframe r = NSIntersectionRect(r, documentViewVisibleRect); if (NSIsEmptyRect(r)) continue; // Convert rect to our coordinate system r = [documentView convertRect:r toView:self]; [result addObject:[NSValue valueWithRect:r]]; if (rectIndex % 10 == 0) { [pool drain]; pool = [[NSAutoreleasePool alloc] init]; } } [pool drain]; } frame = incrementFrame(frame, YES, NO); } while (frame); return result; } - (void)scrollDOMRangeToVisible:(DOMRange *)range { [[[[range startContainer] ownerDocument] webFrame] _scrollDOMRangeToVisible:range]; } - (BOOL)allowsUndo { return _private->allowsUndo; } - (void)setAllowsUndo:(BOOL)flag { _private->allowsUndo = flag; } - (void)setPageSizeMultiplier:(float)m { [self _setZoomMultiplier:m isTextOnly:NO]; } - (float)pageSizeMultiplier { return ![self _realZoomMultiplierIsTextOnly] ? _private->zoomMultiplier : 1.0f; } - (BOOL)canZoomPageIn { return [self _canZoomIn:NO]; } - (IBAction)zoomPageIn:(id)sender { return [self _zoomIn:sender isTextOnly:NO]; } - (BOOL)canZoomPageOut { return [self _canZoomOut:NO]; } - (IBAction)zoomPageOut:(id)sender { return [self _zoomOut:sender isTextOnly:NO]; } - (BOOL)canResetPageZoom { return [self _canResetZoom:NO]; } - (IBAction)resetPageZoom:(id)sender { return [self _resetZoom:sender isTextOnly:NO]; } - (void)setMediaVolume:(float)volume { if (_private->page) _private->page->setMediaVolume(volume); } - (float)mediaVolume { if (!_private->page) return 0; return _private->page->mediaVolume(); } @end @implementation WebView (WebViewPrintingPrivate) - (float)_headerHeight { return CallUIDelegateReturningFloat(self, @selector(webViewHeaderHeight:)); } - (float)_footerHeight { return CallUIDelegateReturningFloat(self, @selector(webViewFooterHeight:)); } - (void)_drawHeaderInRect:(NSRect)rect { #ifdef DEBUG_HEADER_AND_FOOTER NSGraphicsContext *currentContext = [NSGraphicsContext currentContext]; [currentContext saveGraphicsState]; [[NSColor yellowColor] set]; NSRectFill(rect); [currentContext restoreGraphicsState]; #endif SEL selector = @selector(webView:drawHeaderInRect:); if (![_private->UIDelegate respondsToSelector:selector]) return; NSGraphicsContext *currentContext = [NSGraphicsContext currentContext]; [currentContext saveGraphicsState]; NSRectClip(rect); CallUIDelegate(self, selector, rect); [currentContext restoreGraphicsState]; } - (void)_drawFooterInRect:(NSRect)rect { #ifdef DEBUG_HEADER_AND_FOOTER NSGraphicsContext *currentContext = [NSGraphicsContext currentContext]; [currentContext saveGraphicsState]; [[NSColor cyanColor] set]; NSRectFill(rect); [currentContext restoreGraphicsState]; #endif SEL selector = @selector(webView:drawFooterInRect:); if (![_private->UIDelegate respondsToSelector:selector]) return; NSGraphicsContext *currentContext = [NSGraphicsContext currentContext]; [currentContext saveGraphicsState]; NSRectClip(rect); CallUIDelegate(self, selector, rect); [currentContext restoreGraphicsState]; } - (void)_adjustPrintingMarginsForHeaderAndFooter { NSPrintOperation *op = [NSPrintOperation currentOperation]; NSPrintInfo *info = [op printInfo]; NSMutableDictionary *infoDictionary = [info dictionary]; // We need to modify the top and bottom margins in the NSPrintInfo to account for the space needed by the // header and footer. Because this method can be called more than once on the same NSPrintInfo (see 5038087), // we stash away the unmodified top and bottom margins the first time this method is called, and we read from // those stashed-away values on subsequent calls. float originalTopMargin; float originalBottomMargin; NSNumber *originalTopMarginNumber = [infoDictionary objectForKey:WebKitOriginalTopPrintingMarginKey]; if (!originalTopMarginNumber) { ASSERT(![infoDictionary objectForKey:WebKitOriginalBottomPrintingMarginKey]); originalTopMargin = [info topMargin]; originalBottomMargin = [info bottomMargin]; [infoDictionary setObject:[NSNumber numberWithFloat:originalTopMargin] forKey:WebKitOriginalTopPrintingMarginKey]; [infoDictionary setObject:[NSNumber numberWithFloat:originalBottomMargin] forKey:WebKitOriginalBottomPrintingMarginKey]; } else { ASSERT([originalTopMarginNumber isKindOfClass:[NSNumber class]]); ASSERT([[infoDictionary objectForKey:WebKitOriginalBottomPrintingMarginKey] isKindOfClass:[NSNumber class]]); originalTopMargin = [originalTopMarginNumber floatValue]; originalBottomMargin = [[infoDictionary objectForKey:WebKitOriginalBottomPrintingMarginKey] floatValue]; } float scale = [op _web_pageSetupScaleFactor]; [info setTopMargin:originalTopMargin + [self _headerHeight] * scale]; [info setBottomMargin:originalBottomMargin + [self _footerHeight] * scale]; } - (void)_drawHeaderAndFooter { // The header and footer rect height scales with the page, but the width is always // all the way across the printed page (inset by printing margins). NSPrintOperation *op = [NSPrintOperation currentOperation]; float scale = [op _web_pageSetupScaleFactor]; NSPrintInfo *printInfo = [op printInfo]; NSSize paperSize = [printInfo paperSize]; float headerFooterLeft = [printInfo leftMargin]/scale; float headerFooterWidth = (paperSize.width - ([printInfo leftMargin] + [printInfo rightMargin]))/scale; NSRect footerRect = NSMakeRect(headerFooterLeft, [printInfo bottomMargin]/scale - [self _footerHeight] , headerFooterWidth, [self _footerHeight]); NSRect headerRect = NSMakeRect(headerFooterLeft, (paperSize.height - [printInfo topMargin])/scale, headerFooterWidth, [self _headerHeight]); [self _drawHeaderInRect:headerRect]; [self _drawFooterInRect:footerRect]; } @end @implementation WebView (WebDebugBinding) - (void)addObserver:(NSObject *)anObserver forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context { LOG (Bindings, "addObserver:%p forKeyPath:%@ options:%x context:%p", anObserver, keyPath, options, context); [super addObserver:anObserver forKeyPath:keyPath options:options context:context]; } - (void)removeObserver:(NSObject *)anObserver forKeyPath:(NSString *)keyPath { LOG (Bindings, "removeObserver:%p forKeyPath:%@", anObserver, keyPath); [super removeObserver:anObserver forKeyPath:keyPath]; } @end //========================================================================================== // Editing @implementation WebView (WebViewCSS) - (DOMCSSStyleDeclaration *)computedStyleForElement:(DOMElement *)element pseudoElement:(NSString *)pseudoElement { // FIXME: is this the best level for this conversion? if (pseudoElement == nil) pseudoElement = @""; return [[element ownerDocument] getComputedStyle:element pseudoElement:pseudoElement]; } @end @implementation WebView (WebViewEditing) - (DOMRange *)editableDOMRangeForPoint:(NSPoint)point { Page* page = core(self); if (!page) return nil; return kit(page->mainFrame()->editor()->rangeForPoint(IntPoint([self convertPoint:point toView:nil])).get()); } - (BOOL)_shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag { // FIXME: This quirk is needed due to <rdar://problem/4985321> - We can phase it out once Aperture can adopt the new behavior on their end if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_APERTURE_QUIRK) && [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Aperture"]) return YES; return [[self _editingDelegateForwarder] webView:self shouldChangeSelectedDOMRange:currentRange toDOMRange:proposedRange affinity:selectionAffinity stillSelecting:flag]; } - (BOOL)maintainsInactiveSelection { return NO; } - (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity { Frame* coreFrame = core([self _selectedOrMainFrame]); if (!coreFrame) return; if (range == nil) coreFrame->selection()->clear(); else { // Derive the frame to use from the range passed in. // Using _selectedOrMainFrame could give us a different document than // the one the range uses. coreFrame = core([range startContainer])->document()->frame(); if (!coreFrame) return; coreFrame->selection()->setSelectedRange(core(range), core(selectionAffinity), true); } } - (DOMRange *)selectedDOMRange { Frame* coreFrame = core([self _selectedOrMainFrame]); if (!coreFrame) return nil; return kit(coreFrame->selection()->toNormalizedRange().get()); } - (NSSelectionAffinity)selectionAffinity { Frame* coreFrame = core([self _selectedOrMainFrame]); if (!coreFrame) return NSSelectionAffinityDownstream; return kit(coreFrame->selection()->affinity()); } - (void)setEditable:(BOOL)flag { if (_private->editable != flag) { _private->editable = flag; if (!_private->tabKeyCyclesThroughElementsChanged && _private->page) _private->page->setTabKeyCyclesThroughElements(!flag); Frame* mainFrame = [self _mainCoreFrame]; if (mainFrame) { if (flag) { mainFrame->applyEditingStyleToBodyElement(); // If the WebView is made editable and the selection is empty, set it to something. if (![self selectedDOMRange]) mainFrame->setSelectionFromNone(); } else mainFrame->removeEditingStyleFromBodyElement(); } } } - (BOOL)isEditable { return _private->editable; } - (void)setTypingStyle:(DOMCSSStyleDeclaration *)style { // We don't know enough at thls level to pass in a relevant WebUndoAction; we'd have to // change the API to allow this. [[self _selectedOrMainFrame] _setTypingStyle:style withUndoAction:EditActionUnspecified]; } - (DOMCSSStyleDeclaration *)typingStyle { return [[self _selectedOrMainFrame] _typingStyle]; } - (void)setSmartInsertDeleteEnabled:(BOOL)flag { if (_private->smartInsertDeleteEnabled != flag) { _private->smartInsertDeleteEnabled = flag; [[NSUserDefaults standardUserDefaults] setBool:_private->smartInsertDeleteEnabled forKey:WebSmartInsertDeleteEnabled]; } if (flag) [self setSelectTrailingWhitespaceEnabled:false]; } - (BOOL)smartInsertDeleteEnabled { return _private->smartInsertDeleteEnabled; } - (void)setContinuousSpellCheckingEnabled:(BOOL)flag { if (continuousSpellCheckingEnabled != flag) { continuousSpellCheckingEnabled = flag; [[NSUserDefaults standardUserDefaults] setBool:continuousSpellCheckingEnabled forKey:WebContinuousSpellCheckingEnabled]; } if ([self isContinuousSpellCheckingEnabled]) { [[self class] _preflightSpellChecker]; } else { [[self mainFrame] _unmarkAllMisspellings]; } } - (BOOL)isContinuousSpellCheckingEnabled { return (continuousSpellCheckingEnabled && [self _continuousCheckingAllowed]); } - (NSInteger)spellCheckerDocumentTag { if (!_private->hasSpellCheckerDocumentTag) { _private->spellCheckerDocumentTag = [NSSpellChecker uniqueSpellDocumentTag]; _private->hasSpellCheckerDocumentTag = YES; } return _private->spellCheckerDocumentTag; } - (NSUndoManager *)undoManager { if (!_private->allowsUndo) return nil; NSUndoManager *undoManager = [[self _editingDelegateForwarder] undoManagerForWebView:self]; if (undoManager) return undoManager; return [super undoManager]; } - (void)registerForEditingDelegateNotification:(NSString *)name selector:(SEL)selector { NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter]; if ([_private->editingDelegate respondsToSelector:selector]) [defaultCenter addObserver:_private->editingDelegate selector:selector name:name object:self]; } - (void)setEditingDelegate:(id)delegate { if (_private->editingDelegate == delegate) return; NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter]; // remove notifications from current delegate [defaultCenter removeObserver:_private->editingDelegate name:WebViewDidBeginEditingNotification object:self]; [defaultCenter removeObserver:_private->editingDelegate name:WebViewDidChangeNotification object:self]; [defaultCenter removeObserver:_private->editingDelegate name:WebViewDidEndEditingNotification object:self]; [defaultCenter removeObserver:_private->editingDelegate name:WebViewDidChangeTypingStyleNotification object:self]; [defaultCenter removeObserver:_private->editingDelegate name:WebViewDidChangeSelectionNotification object:self]; _private->editingDelegate = delegate; [_private->editingDelegateForwarder release]; _private->editingDelegateForwarder = nil; // add notifications for new delegate [self registerForEditingDelegateNotification:WebViewDidBeginEditingNotification selector:@selector(webViewDidBeginEditing:)]; [self registerForEditingDelegateNotification:WebViewDidChangeNotification selector:@selector(webViewDidChange:)]; [self registerForEditingDelegateNotification:WebViewDidEndEditingNotification selector:@selector(webViewDidEndEditing:)]; [self registerForEditingDelegateNotification:WebViewDidChangeTypingStyleNotification selector:@selector(webViewDidChangeTypingStyle:)]; [self registerForEditingDelegateNotification:WebViewDidChangeSelectionNotification selector:@selector(webViewDidChangeSelection:)]; } - (id)editingDelegate { return _private->editingDelegate; } - (DOMCSSStyleDeclaration *)styleDeclarationWithText:(NSString *)text { // FIXME: Should this really be attached to the document with the current selection? DOMCSSStyleDeclaration *decl = [[[self _selectedOrMainFrame] DOMDocument] createCSSStyleDeclaration]; [decl setCssText:text]; return decl; } @end @implementation WebView (WebViewGrammarChecking) // FIXME: This method should be merged into WebViewEditing when we're not in API freeze - (BOOL)isGrammarCheckingEnabled { #ifdef BUILDING_ON_TIGER return NO; #else return grammarCheckingEnabled; #endif } #ifndef BUILDING_ON_TIGER // FIXME: This method should be merged into WebViewEditing when we're not in API freeze - (void)setGrammarCheckingEnabled:(BOOL)flag { if (grammarCheckingEnabled == flag) return; grammarCheckingEnabled = flag; [[NSUserDefaults standardUserDefaults] setBool:grammarCheckingEnabled forKey:WebGrammarCheckingEnabled]; #ifndef BUILDING_ON_LEOPARD [[NSSpellChecker sharedSpellChecker] updatePanels]; #else NSSpellChecker *spellChecker = [NSSpellChecker sharedSpellChecker]; if ([spellChecker respondsToSelector:@selector(_updateGrammar)]) [spellChecker performSelector:@selector(_updateGrammar)]; #endif // We call _preflightSpellChecker when turning continuous spell checking on, but we don't need to do that here // because grammar checking only occurs on code paths that already preflight spell checking appropriately. if (![self isGrammarCheckingEnabled]) [[self mainFrame] _unmarkAllBadGrammar]; } // FIXME: This method should be merged into WebIBActions when we're not in API freeze - (void)toggleGrammarChecking:(id)sender { [self setGrammarCheckingEnabled:![self isGrammarCheckingEnabled]]; } #endif @end @implementation WebView (WebViewTextChecking) - (BOOL)isAutomaticQuoteSubstitutionEnabled { #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) return NO; #else return automaticQuoteSubstitutionEnabled; #endif } - (BOOL)isAutomaticLinkDetectionEnabled { #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) return NO; #else return automaticLinkDetectionEnabled; #endif } - (BOOL)isAutomaticDashSubstitutionEnabled { #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) return NO; #else return automaticDashSubstitutionEnabled; #endif } - (BOOL)isAutomaticTextReplacementEnabled { #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) return NO; #else return automaticTextReplacementEnabled; #endif } - (BOOL)isAutomaticSpellingCorrectionEnabled { #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) return NO; #else return automaticSpellingCorrectionEnabled; #endif } #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) - (void)setAutomaticQuoteSubstitutionEnabled:(BOOL)flag { if (automaticQuoteSubstitutionEnabled == flag) return; automaticQuoteSubstitutionEnabled = flag; [[NSUserDefaults standardUserDefaults] setBool:automaticQuoteSubstitutionEnabled forKey:WebAutomaticQuoteSubstitutionEnabled]; [[NSSpellChecker sharedSpellChecker] updatePanels]; } - (void)toggleAutomaticQuoteSubstitution:(id)sender { [self setAutomaticQuoteSubstitutionEnabled:![self isAutomaticQuoteSubstitutionEnabled]]; } - (void)setAutomaticLinkDetectionEnabled:(BOOL)flag { if (automaticLinkDetectionEnabled == flag) return; automaticLinkDetectionEnabled = flag; [[NSUserDefaults standardUserDefaults] setBool:automaticLinkDetectionEnabled forKey:WebAutomaticLinkDetectionEnabled]; [[NSSpellChecker sharedSpellChecker] updatePanels]; } - (void)toggleAutomaticLinkDetection:(id)sender { [self setAutomaticLinkDetectionEnabled:![self isAutomaticLinkDetectionEnabled]]; } - (void)setAutomaticDashSubstitutionEnabled:(BOOL)flag { if (automaticDashSubstitutionEnabled == flag) return; automaticDashSubstitutionEnabled = flag; [[NSUserDefaults standardUserDefaults] setBool:automaticDashSubstitutionEnabled forKey:WebAutomaticDashSubstitutionEnabled]; [[NSSpellChecker sharedSpellChecker] updatePanels]; } - (void)toggleAutomaticDashSubstitution:(id)sender { [self setAutomaticDashSubstitutionEnabled:![self isAutomaticDashSubstitutionEnabled]]; } - (void)setAutomaticTextReplacementEnabled:(BOOL)flag { if (automaticTextReplacementEnabled == flag) return; automaticTextReplacementEnabled = flag; [[NSUserDefaults standardUserDefaults] setBool:automaticTextReplacementEnabled forKey:WebAutomaticTextReplacementEnabled]; [[NSSpellChecker sharedSpellChecker] updatePanels]; } - (void)toggleAutomaticTextReplacement:(id)sender { [self setAutomaticTextReplacementEnabled:![self isAutomaticTextReplacementEnabled]]; } - (void)setAutomaticSpellingCorrectionEnabled:(BOOL)flag { if (automaticSpellingCorrectionEnabled == flag) return; automaticSpellingCorrectionEnabled = flag; [[NSUserDefaults standardUserDefaults] setBool:automaticSpellingCorrectionEnabled forKey:WebAutomaticSpellingCorrectionEnabled]; [[NSSpellChecker sharedSpellChecker] updatePanels]; } - (void)toggleAutomaticSpellingCorrection:(id)sender { [self setAutomaticSpellingCorrectionEnabled:![self isAutomaticSpellingCorrectionEnabled]]; } #endif @end @implementation WebView (WebViewUndoableEditing) - (void)replaceSelectionWithNode:(DOMNode *)node { [[self _selectedOrMainFrame] _replaceSelectionWithNode:node selectReplacement:YES smartReplace:NO matchStyle:NO]; } - (void)replaceSelectionWithText:(NSString *)text { [[self _selectedOrMainFrame] _replaceSelectionWithText:text selectReplacement:YES smartReplace:NO]; } - (void)replaceSelectionWithMarkupString:(NSString *)markupString { [[self _selectedOrMainFrame] _replaceSelectionWithMarkupString:markupString baseURLString:nil selectReplacement:YES smartReplace:NO]; } - (void)replaceSelectionWithArchive:(WebArchive *)archive { [[[self _selectedOrMainFrame] _dataSource] _replaceSelectionWithArchive:archive selectReplacement:YES]; } - (void)deleteSelection { WebFrame *webFrame = [self _selectedOrMainFrame]; Frame* coreFrame = core(webFrame); if (coreFrame) coreFrame->editor()->deleteSelectionWithSmartDelete([(WebHTMLView *)[[webFrame frameView] documentView] _canSmartCopyOrDelete]); } - (void)applyStyle:(DOMCSSStyleDeclaration *)style { // We don't know enough at thls level to pass in a relevant WebUndoAction; we'd have to // change the API to allow this. WebFrame *webFrame = [self _selectedOrMainFrame]; Frame* coreFrame = core(webFrame); if (coreFrame) coreFrame->editor()->applyStyle(core(style)); } @end @implementation WebView (WebViewEditingActions) - (void)_performResponderOperation:(SEL)selector with:(id)parameter { static BOOL reentered = NO; if (reentered) { [[self nextResponder] tryToPerform:selector with:parameter]; return; } // There are two possibilities here. // // One is that WebView has been called in its role as part of the responder chain. // In that case, it's fine to call the first responder and end up calling down the // responder chain again. Later we will return here with reentered = YES and continue // past the WebView. // // The other is that we are being called directly, in which case we want to pass the // selector down to the view inside us that can handle it, and continue down the // responder chain as usual. // Pass this selector down to the first responder. NSResponder *responder = [self _responderForResponderOperations]; reentered = YES; [responder tryToPerform:selector with:parameter]; reentered = NO; } #define FORWARD(name) \ - (void)name:(id)sender { [self _performResponderOperation:_cmd with:sender]; } FOR_EACH_RESPONDER_SELECTOR(FORWARD) - (void)insertText:(NSString *)text { [self _performResponderOperation:_cmd with:text]; } @end @implementation WebView (WebViewEditingInMail) - (void)_insertNewlineInQuotedContent { [[self _selectedOrMainFrame] _insertParagraphSeparatorInQuotedContent]; } - (void)_replaceSelectionWithNode:(DOMNode *)node matchStyle:(BOOL)matchStyle { [[self _selectedOrMainFrame] _replaceSelectionWithNode:node selectReplacement:YES smartReplace:NO matchStyle:matchStyle]; } - (BOOL)_selectionIsCaret { Frame* coreFrame = core([self _selectedOrMainFrame]); if (!coreFrame) return NO; return coreFrame->selection()->isCaret(); } - (BOOL)_selectionIsAll { Frame* coreFrame = core([self _selectedOrMainFrame]); if (!coreFrame) return NO; return coreFrame->selection()->isAll(MayLeaveEditableContent); } @end static WebFrameView *containingFrameView(NSView *view) { while (view && ![view isKindOfClass:[WebFrameView class]]) view = [view superview]; return (WebFrameView *)view; } @implementation WebView (WebFileInternal) + (void)_setCacheModel:(WebCacheModel)cacheModel { if (s_didSetCacheModel && cacheModel == s_cacheModel) return; NSString *nsurlCacheDirectory = (NSString *)WebCFAutorelease(WKCopyFoundationCacheDirectory()); if (!nsurlCacheDirectory) nsurlCacheDirectory = NSHomeDirectory(); // As a fudge factor, use 1000 instead of 1024, in case the reported byte // count doesn't align exactly to a megabyte boundary. uint64_t memSize = WebMemorySize() / 1024 / 1000; unsigned long long diskFreeSize = WebVolumeFreeSize(nsurlCacheDirectory) / 1024 / 1000; NSURLCache *nsurlCache = [NSURLCache sharedURLCache]; unsigned cacheTotalCapacity = 0; unsigned cacheMinDeadCapacity = 0; unsigned cacheMaxDeadCapacity = 0; double deadDecodedDataDeletionInterval = 0; unsigned pageCacheCapacity = 0; NSUInteger nsurlCacheMemoryCapacity = 0; NSUInteger nsurlCacheDiskCapacity = 0; switch (cacheModel) { case WebCacheModelDocumentViewer: { // Page cache capacity (in pages) pageCacheCapacity = 0; // Object cache capacities (in bytes) if (memSize >= 2048) cacheTotalCapacity = 96 * 1024 * 1024; else if (memSize >= 1536) cacheTotalCapacity = 64 * 1024 * 1024; else if (memSize >= 1024) cacheTotalCapacity = 32 * 1024 * 1024; else if (memSize >= 512) cacheTotalCapacity = 16 * 1024 * 1024; cacheMinDeadCapacity = 0; cacheMaxDeadCapacity = 0; // Foundation memory cache capacity (in bytes) nsurlCacheMemoryCapacity = 0; // Foundation disk cache capacity (in bytes) nsurlCacheDiskCapacity = [nsurlCache diskCapacity]; break; } case WebCacheModelDocumentBrowser: { // Page cache capacity (in pages) if (memSize >= 1024) pageCacheCapacity = 3; else if (memSize >= 512) pageCacheCapacity = 2; else if (memSize >= 256) pageCacheCapacity = 1; else pageCacheCapacity = 0; // Object cache capacities (in bytes) if (memSize >= 2048) cacheTotalCapacity = 96 * 1024 * 1024; else if (memSize >= 1536) cacheTotalCapacity = 64 * 1024 * 1024; else if (memSize >= 1024) cacheTotalCapacity = 32 * 1024 * 1024; else if (memSize >= 512) cacheTotalCapacity = 16 * 1024 * 1024; cacheMinDeadCapacity = cacheTotalCapacity / 8; cacheMaxDeadCapacity = cacheTotalCapacity / 4; // Foundation memory cache capacity (in bytes) if (memSize >= 2048) nsurlCacheMemoryCapacity = 4 * 1024 * 1024; else if (memSize >= 1024) nsurlCacheMemoryCapacity = 2 * 1024 * 1024; else if (memSize >= 512) nsurlCacheMemoryCapacity = 1 * 1024 * 1024; else nsurlCacheMemoryCapacity = 512 * 1024; // Foundation disk cache capacity (in bytes) if (diskFreeSize >= 16384) nsurlCacheDiskCapacity = 50 * 1024 * 1024; else if (diskFreeSize >= 8192) nsurlCacheDiskCapacity = 40 * 1024 * 1024; else if (diskFreeSize >= 4096) nsurlCacheDiskCapacity = 30 * 1024 * 1024; else nsurlCacheDiskCapacity = 20 * 1024 * 1024; break; } case WebCacheModelPrimaryWebBrowser: { // Page cache capacity (in pages) // (Research indicates that value / page drops substantially after 3 pages.) if (memSize >= 2048) pageCacheCapacity = 5; else if (memSize >= 1024) pageCacheCapacity = 4; else if (memSize >= 512) pageCacheCapacity = 3; else if (memSize >= 256) pageCacheCapacity = 2; else pageCacheCapacity = 1; // Object cache capacities (in bytes) // (Testing indicates that value / MB depends heavily on content and // browsing pattern. Even growth above 128MB can have substantial // value / MB for some content / browsing patterns.) if (memSize >= 2048) cacheTotalCapacity = 128 * 1024 * 1024; else if (memSize >= 1536) cacheTotalCapacity = 96 * 1024 * 1024; else if (memSize >= 1024) cacheTotalCapacity = 64 * 1024 * 1024; else if (memSize >= 512) cacheTotalCapacity = 32 * 1024 * 1024; cacheMinDeadCapacity = cacheTotalCapacity / 4; cacheMaxDeadCapacity = cacheTotalCapacity / 2; // This code is here to avoid a PLT regression. We can remove it if we // can prove that the overall system gain would justify the regression. cacheMaxDeadCapacity = max(24u, cacheMaxDeadCapacity); deadDecodedDataDeletionInterval = 60; // Foundation memory cache capacity (in bytes) // (These values are small because WebCore does most caching itself.) if (memSize >= 1024) nsurlCacheMemoryCapacity = 4 * 1024 * 1024; else if (memSize >= 512) nsurlCacheMemoryCapacity = 2 * 1024 * 1024; else if (memSize >= 256) nsurlCacheMemoryCapacity = 1 * 1024 * 1024; else nsurlCacheMemoryCapacity = 512 * 1024; // Foundation disk cache capacity (in bytes) if (diskFreeSize >= 16384) nsurlCacheDiskCapacity = 175 * 1024 * 1024; else if (diskFreeSize >= 8192) nsurlCacheDiskCapacity = 150 * 1024 * 1024; else if (diskFreeSize >= 4096) nsurlCacheDiskCapacity = 125 * 1024 * 1024; else if (diskFreeSize >= 2048) nsurlCacheDiskCapacity = 100 * 1024 * 1024; else if (diskFreeSize >= 1024) nsurlCacheDiskCapacity = 75 * 1024 * 1024; else nsurlCacheDiskCapacity = 50 * 1024 * 1024; break; } default: ASSERT_NOT_REACHED(); }; #ifdef BUILDING_ON_TIGER // Don't use a big Foundation disk cache on Tiger because, according to the // PLT, the Foundation disk cache on Tiger is slower than the network. nsurlCacheDiskCapacity = [nsurlCache diskCapacity]; #endif // Don't shrink a big disk cache, since that would cause churn. nsurlCacheDiskCapacity = max(nsurlCacheDiskCapacity, [nsurlCache diskCapacity]); cache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity); cache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval); pageCache()->setCapacity(pageCacheCapacity); [nsurlCache setMemoryCapacity:nsurlCacheMemoryCapacity]; [nsurlCache setDiskCapacity:nsurlCacheDiskCapacity]; s_cacheModel = cacheModel; s_didSetCacheModel = YES; } + (WebCacheModel)_cacheModel { return s_cacheModel; } + (WebCacheModel)_didSetCacheModel { return s_didSetCacheModel; } + (WebCacheModel)_maxCacheModelInAnyInstance { WebCacheModel cacheModel = WebCacheModelDocumentViewer; NSEnumerator *enumerator = [(NSMutableSet *)allWebViewsSet objectEnumerator]; while (WebPreferences *preferences = [[enumerator nextObject] preferences]) cacheModel = max(cacheModel, [preferences cacheModel]); return cacheModel; } + (void)_preferencesChangedNotification:(NSNotification *)notification { WebPreferences *preferences = (WebPreferences *)[notification object]; ASSERT([preferences isKindOfClass:[WebPreferences class]]); WebCacheModel cacheModel = [preferences cacheModel]; if (![self _didSetCacheModel] || cacheModel > [self _cacheModel]) [self _setCacheModel:cacheModel]; else if (cacheModel < [self _cacheModel]) [self _setCacheModel:max([[WebPreferences standardPreferences] cacheModel], [self _maxCacheModelInAnyInstance])]; } + (void)_preferencesRemovedNotification:(NSNotification *)notification { WebPreferences *preferences = (WebPreferences *)[notification object]; ASSERT([preferences isKindOfClass:[WebPreferences class]]); if ([preferences cacheModel] == [self _cacheModel]) [self _setCacheModel:max([[WebPreferences standardPreferences] cacheModel], [self _maxCacheModelInAnyInstance])]; } - (WebFrame *)_focusedFrame { NSResponder *resp = [[self window] firstResponder]; if (resp && [resp isKindOfClass:[NSView class]] && [(NSView *)resp isDescendantOf:[[self mainFrame] frameView]]) { WebFrameView *frameView = containingFrameView((NSView *)resp); ASSERT(frameView != nil); return [frameView webFrame]; } return nil; } - (WebFrame *)_selectedOrMainFrame { WebFrame *result = [self selectedFrame]; if (result == nil) result = [self mainFrame]; return result; } - (BOOL)_isLoading { WebFrame *mainFrame = [self mainFrame]; return [[mainFrame _dataSource] isLoading] || [[mainFrame provisionalDataSource] isLoading]; } - (WebFrameView *)_frameViewAtWindowPoint:(NSPoint)point { if (_private->closed) return nil; ASSERT(_private->usesDocumentViews); NSView *view = [self hitTest:[[self superview] convertPoint:point fromView:nil]]; if (![view isDescendantOf:[[self mainFrame] frameView]]) return nil; WebFrameView *frameView = containingFrameView(view); ASSERT(frameView); return frameView; } + (void)_preflightSpellCheckerNow:(id)sender { [[NSSpellChecker sharedSpellChecker] _preflightChosenSpellServer]; } + (void)_preflightSpellChecker { // As AppKit does, we wish to delay tickling the shared spellchecker into existence on application launch. if ([NSSpellChecker sharedSpellCheckerExists]) { [self _preflightSpellCheckerNow:self]; } else { [self performSelector:@selector(_preflightSpellCheckerNow:) withObject:self afterDelay:2.0]; } } - (BOOL)_continuousCheckingAllowed { static BOOL allowContinuousSpellChecking = YES; static BOOL readAllowContinuousSpellCheckingDefault = NO; if (!readAllowContinuousSpellCheckingDefault) { if ([[NSUserDefaults standardUserDefaults] objectForKey:@"NSAllowContinuousSpellChecking"]) { allowContinuousSpellChecking = [[NSUserDefaults standardUserDefaults] boolForKey:@"NSAllowContinuousSpellChecking"]; } readAllowContinuousSpellCheckingDefault = YES; } return allowContinuousSpellChecking; } - (NSResponder *)_responderForResponderOperations { NSResponder *responder = [[self window] firstResponder]; WebFrameView *mainFrameView = [[self mainFrame] frameView]; // If the current responder is outside of the webview, use our main frameView or its // document view. We also do this for subviews of self that are siblings of the main // frameView since clients might insert non-webview-related views there (see 4552713). if (responder != self && ![mainFrameView _web_firstResponderIsSelfOrDescendantView]) { responder = [mainFrameView documentView]; if (!responder) responder = mainFrameView; } return responder; } - (void)_openFrameInNewWindowFromMenu:(NSMenuItem *)sender { ASSERT_ARG(sender, [sender isKindOfClass:[NSMenuItem class]]); NSDictionary *element = [sender representedObject]; ASSERT([element isKindOfClass:[NSDictionary class]]); WebDataSource *dataSource = [[element objectForKey:WebElementFrameKey] dataSource]; NSURLRequest *request = [[dataSource request] copy]; ASSERT(request); [self _openNewWindowWithRequest:request]; [request release]; } - (void)_searchWithGoogleFromMenu:(id)sender { id documentView = [[[self selectedFrame] frameView] documentView]; if (![documentView conformsToProtocol:@protocol(WebDocumentText)]) { return; } NSString *selectedString = [(id <WebDocumentText>)documentView selectedString]; if ([selectedString length] == 0) { return; } NSPasteboard *pasteboard = [NSPasteboard pasteboardWithUniqueName]; [pasteboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; NSMutableString *s = [selectedString mutableCopy]; const unichar nonBreakingSpaceCharacter = 0xA0; NSString *nonBreakingSpaceString = [NSString stringWithCharacters:&nonBreakingSpaceCharacter length:1]; [s replaceOccurrencesOfString:nonBreakingSpaceString withString:@" " options:0 range:NSMakeRange(0, [s length])]; [pasteboard setString:s forType:NSStringPboardType]; [s release]; // FIXME: seems fragile to use the service by name, but this is what AppKit does NSPerformService(@"Search With Google", pasteboard); } - (void)_searchWithSpotlightFromMenu:(id)sender { id documentView = [[[self selectedFrame] frameView] documentView]; if (![documentView conformsToProtocol:@protocol(WebDocumentText)]) return; NSString *selectedString = [(id <WebDocumentText>)documentView selectedString]; if (![selectedString length]) return; #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) [[NSWorkspace sharedWorkspace] showSearchResultsForQueryString:selectedString]; #else (void)HISearchWindowShow((CFStringRef)selectedString, kNilOptions); #endif } #if USE(ACCELERATED_COMPOSITING) - (void)_clearLayerSyncLoopObserver { if (!_private->layerSyncRunLoopObserver) return; CFRunLoopObserverInvalidate(_private->layerSyncRunLoopObserver); CFRelease(_private->layerSyncRunLoopObserver); _private->layerSyncRunLoopObserver = 0; } #endif @end @implementation WebView (WebViewInternal) - (BOOL)_becomingFirstResponderFromOutside { return _private->becomingFirstResponderFromOutside; } #if ENABLE(ICONDATABASE) - (void)_receivedIconChangedNotification:(NSNotification *)notification { // Get the URL for this notification NSDictionary *userInfo = [notification userInfo]; ASSERT([userInfo isKindOfClass:[NSDictionary class]]); NSString *urlString = [userInfo objectForKey:WebIconNotificationUserInfoURLKey]; ASSERT([urlString isKindOfClass:[NSString class]]); // If that URL matches the current main frame, dispatch the delegate call, which will also unregister // us for this notification if ([[self mainFrameURL] isEqualTo:urlString]) [self _dispatchDidReceiveIconFromWebFrame:[self mainFrame]]; } - (void)_registerForIconNotification:(BOOL)listen { if (listen) [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_receivedIconChangedNotification:) name:WebIconDatabaseDidAddIconNotification object:nil]; else [[NSNotificationCenter defaultCenter] removeObserver:self name:WebIconDatabaseDidAddIconNotification object:nil]; } - (void)_dispatchDidReceiveIconFromWebFrame:(WebFrame *)webFrame { // FIXME: This willChangeValueForKey call is too late, because the icon has already changed by now. [self _willChangeValueForKey:_WebMainFrameIconKey]; // Since we definitely have an icon and are about to send out the delegate call for that, this WebView doesn't need to listen for the general // notification any longer [self _registerForIconNotification:NO]; WebFrameLoadDelegateImplementationCache* cache = &_private->frameLoadDelegateImplementations; if (cache->didReceiveIconForFrameFunc) { Image* image = iconDatabase()->iconForPageURL(core(webFrame)->loader()->url().string(), IntSize(16, 16)); if (NSImage *icon = webGetNSImage(image, NSMakeSize(16, 16))) CallFrameLoadDelegate(cache->didReceiveIconForFrameFunc, self, @selector(webView:didReceiveIcon:forFrame:), icon, webFrame); } [self _didChangeValueForKey:_WebMainFrameIconKey]; } #endif // ENABLE(ICONDATABASE) // Get the appropriate user-agent string for a particular URL. - (WebCore::String)_userAgentForURL:(const WebCore::KURL&)url { if (_private->useSiteSpecificSpoofing) { // No current site-specific spoofs. } if (_private->userAgent.isNull()) _private->userAgent = [[self class] _standardUserAgentWithApplicationName:_private->applicationNameForUserAgent]; return _private->userAgent; } - (void)_addObject:(id)object forIdentifier:(unsigned long)identifier { ASSERT(!_private->identifierMap.contains(identifier)); // If the identifier map is initially empty it means we're starting a load // of something. The semantic is that the web view should be around as long // as something is loading. Because of that we retain the web view. if (_private->identifierMap.isEmpty()) CFRetain(self); _private->identifierMap.set(identifier, object); } - (id)_objectForIdentifier:(unsigned long)identifier { return _private->identifierMap.get(identifier).get(); } - (void)_removeObjectForIdentifier:(unsigned long)identifier { ASSERT(_private->identifierMap.contains(identifier)); _private->identifierMap.remove(identifier); // If the identifier map is now empty it means we're no longer loading anything // and we should release the web view. if (_private->identifierMap.isEmpty()) CFRelease(self); } - (void)_retrieveKeyboardUIModeFromPreferences:(NSNotification *)notification { CFPreferencesAppSynchronize(UniversalAccessDomain); Boolean keyExistsAndHasValidFormat; int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, UniversalAccessDomain, &keyExistsAndHasValidFormat); // The keyboard access mode is reported by two bits: // Bit 0 is set if feature is on // Bit 1 is set if full keyboard access works for any control, not just text boxes and lists // We require both bits to be on. // I do not know that we would ever get one bit on and the other off since // checking the checkbox in system preferences which is marked as "Turn on full keyboard access" // turns on both bits. _private->_keyboardUIMode = (mode & 0x2) ? KeyboardAccessFull : KeyboardAccessDefault; // check for tabbing to links if ([_private->preferences tabsToLinks]) _private->_keyboardUIMode = (KeyboardUIMode)(_private->_keyboardUIMode | KeyboardAccessTabsToLinks); } - (KeyboardUIMode)_keyboardUIMode { if (!_private->_keyboardUIModeAccessed) { _private->_keyboardUIModeAccessed = YES; [self _retrieveKeyboardUIModeFromPreferences:nil]; [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:) name:KeyboardUIModeDidChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:) name:WebPreferencesChangedNotification object:nil]; } return _private->_keyboardUIMode; } - (void)_setInsertionPasteboard:(NSPasteboard *)pasteboard { _private->insertionPasteboard = pasteboard; } - (void)_setMouseDownEvent:(NSEvent *)event { ASSERT(!event || [event type] == NSLeftMouseDown || [event type] == NSRightMouseDown || [event type] == NSOtherMouseDown); if (event == _private->mouseDownEvent) return; [event retain]; [_private->mouseDownEvent release]; _private->mouseDownEvent = event; } - (void)_cancelUpdateMouseoverTimer { if (_private->updateMouseoverTimer) { CFRunLoopTimerInvalidate(_private->updateMouseoverTimer); CFRelease(_private->updateMouseoverTimer); _private->updateMouseoverTimer = NULL; } } - (void)_stopAutoscrollTimer { NSTimer *timer = _private->autoscrollTimer; _private->autoscrollTimer = nil; [_private->autoscrollTriggerEvent release]; _private->autoscrollTriggerEvent = nil; [timer invalidate]; [timer release]; } + (void)_updateMouseoverWithEvent:(NSEvent *)event { WebView *oldView = lastMouseoverView; lastMouseoverView = nil; NSView *contentView = [[event window] contentView]; NSPoint locationForHitTest = [[contentView superview] convertPoint:[event locationInWindow] fromView:nil]; for (NSView *hitView = [contentView hitTest:locationForHitTest]; hitView; hitView = [hitView superview]) { if ([hitView isKindOfClass:[WebView class]]) { lastMouseoverView = static_cast<WebView *>(hitView); break; } } if (lastMouseoverView && lastMouseoverView->_private->hoverFeedbackSuspended) lastMouseoverView = nil; if (lastMouseoverView != oldView) { if (Frame* oldCoreFrame = [oldView _mainCoreFrame]) { NSEvent *oldViewEvent = [NSEvent mouseEventWithType:NSMouseMoved location:NSMakePoint(-1, -1) modifierFlags:[[NSApp currentEvent] modifierFlags] timestamp:[NSDate timeIntervalSinceReferenceDate] windowNumber:[[oldView window] windowNumber] context:[[NSApp currentEvent] context] eventNumber:0 clickCount:0 pressure:0]; oldCoreFrame->eventHandler()->mouseMoved(oldViewEvent); } } if (!lastMouseoverView) return; if (Frame* coreFrame = core([lastMouseoverView mainFrame])) coreFrame->eventHandler()->mouseMoved(event); } - (void)_updateMouseoverWithFakeEvent { [self _cancelUpdateMouseoverTimer]; NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:[[self window] convertScreenToBase:[NSEvent mouseLocation]] modifierFlags:[[NSApp currentEvent] modifierFlags] timestamp:[NSDate timeIntervalSinceReferenceDate] windowNumber:[[self window] windowNumber] context:[[NSApp currentEvent] context] eventNumber:0 clickCount:0 pressure:0]; [[self class] _updateMouseoverWithEvent:fakeEvent]; } - (void)_setToolTip:(NSString *)toolTip { if (_private->usesDocumentViews) { id documentView = [[[self _selectedOrMainFrame] frameView] documentView]; if ([documentView isKindOfClass:[WebHTMLView class]]) [documentView _setToolTip:toolTip]; return; } // FIXME (Viewless): Code to handle tooltips needs to move into WebView. } - (void)_selectionChanged { if (_private->usesDocumentViews) { id documentView = [[[self _selectedOrMainFrame] frameView] documentView]; if ([documentView isKindOfClass:[WebHTMLView class]]) [documentView _selectionChanged]; return; } // FIXME (Viewless): We'll need code here. } - (Frame*)_mainCoreFrame { return (_private && _private->page) ? _private->page->mainFrame() : 0; } #if USE(ACCELERATED_COMPOSITING) - (BOOL)_needsOneShotDrawingSynchronization { return _private->needsOneShotDrawingSynchronization; } - (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization { _private->needsOneShotDrawingSynchronization = needsSynchronization; } - (void)_startedAcceleratedCompositingForFrame:(WebFrame*)webFrame { BOOL entering = _private->acceleratedFramesCount == 0; if (entering) [self willChangeValueForKey:UsingAcceleratedCompositingProperty]; ++_private->acceleratedFramesCount; if (entering) [self didChangeValueForKey:UsingAcceleratedCompositingProperty]; } - (void)_stoppedAcceleratedCompositingForFrame:(WebFrame*)webFrame { BOOL leaving = _private->acceleratedFramesCount == 1; ASSERT(_private->acceleratedFramesCount > 0); if (leaving) [self willChangeValueForKey:UsingAcceleratedCompositingProperty]; --_private->acceleratedFramesCount; if (leaving) [self didChangeValueForKey:UsingAcceleratedCompositingProperty]; } - (BOOL)_syncCompositingChanges { Frame* frame = [self _mainCoreFrame]; if (frame && frame->view()) return frame->view()->syncCompositingStateRecursive(); return YES; } /* The order of events with compositing updates is this: Start of runloop End of runloop | | --|-------------------------------------------------------|-- ^ ^ ^ | | | NSWindow update, | CA commit NSView drawing | flush | layerSyncRunLoopObserverCallBack To avoid flashing, we have to ensure that compositing changes (rendered via the CoreAnimation rendering display link) appear on screen at the same time as content painted into the window via the normal WebCore rendering path. CoreAnimation will commit any layer changes at the end of the runloop via its "CA commit" observer. Those changes can then appear onscreen at any time when the display link fires, which can result in unsynchronized rendering. To fix this, the GraphicsLayerCA code in WebCore does not change the CA layer tree during style changes and layout; it stores up all changes and commits them via syncCompositingState(). There are then two situations in which we can call syncCompositingState(): 1. When painting. FrameView::paintContents() makes a call to syncCompositingState(). 2. When style changes/layout have made changes to the layer tree which do not result in painting. In this case we need a run loop observer to do a syncCompositingState() at an appropriate time. The observer will keep firing until the time is right (essentially when there are no more pending layouts). */ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActivity, void* info) { WebView* webView = reinterpret_cast<WebView*>(info); if ([webView _syncCompositingChanges]) [webView _clearLayerSyncLoopObserver]; } - (void)_scheduleCompositingLayerSync { if (_private->layerSyncRunLoopObserver) return; // Run after AppKit does its window update. If we do any painting, we'll commit // layer changes from FrameView::paintContents(), otherwise we'll commit via // _syncCompositingChanges when this observer fires. const CFIndex runLoopOrder = NSDisplayWindowRunLoopOrdering + 1; // The WebView always outlives the observer, so no need to retain/release. CFRunLoopObserverContext context = { 0, self, 0, 0, 0 }; _private->layerSyncRunLoopObserver = CFRunLoopObserverCreate(NULL, kCFRunLoopBeforeWaiting | kCFRunLoopExit, true /* repeats */, runLoopOrder, layerSyncRunLoopObserverCallBack, &context); CFRunLoopAddObserver(CFRunLoopGetCurrent(), _private->layerSyncRunLoopObserver, kCFRunLoopCommonModes); } #endif @end #ifdef BUILDING_ON_LEOPARD static IMP originalRecursivelyRemoveMailAttributesImp; static id objectElementDataAttribute(DOMHTMLObjectElement *self, SEL) { return [self getAttribute:@"data"]; } static void recursivelyRemoveMailAttributes(DOMNode *self, SEL selector, BOOL a, BOOL b, BOOL c) { // While inside this Mail function, change the behavior of -[DOMHTMLObjectElement data] back to what it used to be // before we fixed a bug in it (see http://trac.webkit.org/changeset/30044 for that change). // It's a little bit strange to patch a method defined by WebKit, but it helps keep this workaround self-contained. Method methodToPatch = class_getInstanceMethod(objc_getRequiredClass("DOMHTMLObjectElement"), @selector(data)); IMP originalDataImp = method_setImplementation(methodToPatch, reinterpret_cast<IMP>(objectElementDataAttribute)); originalRecursivelyRemoveMailAttributesImp(self, selector, a, b, c); method_setImplementation(methodToPatch, originalDataImp); } #endif static void patchMailRemoveAttributesMethod() { #ifdef BUILDING_ON_LEOPARD if (!WKAppVersionCheckLessThan(@"com.apple.mail", -1, 4.0)) return; Method methodToPatch = class_getInstanceMethod(objc_getRequiredClass("DOMNode"), @selector(recursivelyRemoveMailAttributes:convertObjectsToImages:convertEditableElements:)); if (!methodToPatch) return; originalRecursivelyRemoveMailAttributesImp = method_setImplementation(methodToPatch, reinterpret_cast<IMP>(recursivelyRemoveMailAttributes)); #endif } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebHTMLRepresentationPrivate.h���������������������������������������������������0000644�0001750�0001750�00000003463�10766122014�020305� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebHTMLRepresentation.h> @protocol WebPluginManualLoader; @interface WebHTMLRepresentation (WebPrivate) - (void)_redirectDataToManualLoader:(id<WebPluginManualLoader>)manualLoader forPluginView:(NSView *)pluginView; - (void)printDOMTree; @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebFrameLoadDelegate.h�����������������������������������������������������������0000644�0001750�0001750�00000023504�11073574261�016555� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003, 2004, 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> #import <JavaScriptCore/WebKitAvailability.h> @class NSError; @class WebFrame; @class WebScriptObject; @class WebView; /*! @category WebFrameLoadDelegate @discussion A WebView's WebFrameLoadDelegate tracks the loading progress of its frames. When a data source of a frame starts to load, the data source is considered "provisional". Once at least one byte is received, the data source is considered "committed". This is done so the contents of the frame will not be lost if the new data source fails to successfully load. */ @interface NSObject (WebFrameLoadDelegate) /*! @method webView:didStartProvisionalLoadForFrame: @abstract Notifies the delegate that the provisional load of a frame has started @param webView The WebView sending the message @param frame The frame for which the provisional load has started @discussion This method is called after the provisional data source of a frame has started to load. */ - (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame; /*! @method webView:didReceiveServerRedirectForProvisionalLoadForFrame: @abstract Notifies the delegate that a server redirect occurred during the provisional load @param webView The WebView sending the message @param frame The frame for which the redirect occurred */ - (void)webView:(WebView *)sender didReceiveServerRedirectForProvisionalLoadForFrame:(WebFrame *)frame; /*! @method webView:didFailProvisionalLoadWithError:forFrame: @abstract Notifies the delegate that the provisional load has failed @param webView The WebView sending the message @param error The error that occurred @param frame The frame for which the error occurred @discussion This method is called after the provisional data source has failed to load. The frame will continue to display the contents of the committed data source if there is one. */ - (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; /*! @method webView:didCommitLoadForFrame: @abstract Notifies the delegate that the load has changed from provisional to committed @param webView The WebView sending the message @param frame The frame for which the load has committed @discussion This method is called after the provisional data source has become the committed data source. In some cases, a single load may be committed more than once. This happens in the case of multipart/x-mixed-replace, also known as "server push". In this case, a single location change leads to multiple documents that are loaded in sequence. When this happens, a new commit will be sent for each document. */ - (void)webView:(WebView *)sender didCommitLoadForFrame:(WebFrame *)frame; /*! @method webView:didReceiveTitle:forFrame: @abstract Notifies the delegate that the page title for a frame has been received @param webView The WebView sending the message @param title The new page title @param frame The frame for which the title has been received @discussion The title may update during loading; clients should be prepared for this. */ - (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame; /*! @method webView:didReceiveIcon:forFrame: @abstract Notifies the delegate that a page icon image for a frame has been received @param webView The WebView sending the message @param image The icon image. Also known as a "favicon". @param frame The frame for which a page icon has been received */ - (void)webView:(WebView *)sender didReceiveIcon:(NSImage *)image forFrame:(WebFrame *)frame; /*! @method webView:didFinishLoadForFrame: @abstract Notifies the delegate that the committed load of a frame has completed @param webView The WebView sending the message @param frame The frame that finished loading @discussion This method is called after the committed data source of a frame has successfully loaded and will only be called when all subresources such as images and stylesheets are done loading. Plug-In content and JavaScript-requested loads may occur after this method is called. */ - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame; /*! @method webView:didFailLoadWithError:forFrame: @abstract Notifies the delegate that the committed load of a frame has failed @param webView The WebView sending the message @param error The error that occurred @param frame The frame that failed to load @discussion This method is called after a data source has committed but failed to completely load. */ - (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; /*! @method webView:didChangeLocationWithinPageForFrame: @abstract Notifies the delegate that the scroll position in a frame has changed @param webView The WebView sending the message @param frame The frame that scrolled @discussion This method is called when anchors within a page have been clicked. */ - (void)webView:(WebView *)sender didChangeLocationWithinPageForFrame:(WebFrame *)frame; /*! @method webView:willPerformClientRedirectToURL:delay:fireDate:forFrame: @abstract Notifies the delegate that a frame will perform a client-side redirect @param webView The WebView sending the message @param URL The URL to be redirected to @param seconds Seconds in which the redirect will happen @param date The fire date @param frame The frame on which the redirect will occur @discussion This method can be used to continue progress feedback while a client-side redirect is pending. */ - (void)webView:(WebView *)sender willPerformClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date forFrame:(WebFrame *)frame; /*! @method webView:didCancelClientRedirectForFrame: @abstract Notifies the delegate that a pending client-side redirect has been cancelled @param webView The WebView sending the message @param frame The frame for which the pending redirect was cancelled @discussion A client-side redirect can be cancelled if a frame changes location before the timeout. */ - (void)webView:(WebView *)sender didCancelClientRedirectForFrame:(WebFrame *)frame; /*! @method webView:willCloseFrame: @abstract Notifies the delegate that a frame will be closed @param webView The WebView sending the message @param frame The frame that will be closed @discussion This method is called right before WebKit is done with the frame and the objects that it contains. */ - (void)webView:(WebView *)sender willCloseFrame:(WebFrame *)frame; /*! @method webView:didClearWindowObject:forFrame: @abstract Notifies the delegate that the JavaScript window object in a frame has been cleared in preparation for a new load. This is the preferred place to set custom properties on the window object using the WebScriptObject and JavaScriptCore APIs. @param webView The webView sending the message. @param windowObject The WebScriptObject representing the frame's JavaScript window object. @param frame The WebFrame to which windowObject belongs. @discussion If a delegate implements both webView:didClearWindowObject:forFrame: and webView:windowScriptObjectAvailable:, only webView:didClearWindowObject:forFrame: will be invoked. This enables a delegate to implement both methods for backwards compatibility with older versions of WebKit. */ - (void)webView:(WebView *)webView didClearWindowObject:(WebScriptObject *)windowObject forFrame:(WebFrame *)frame; /*! @method webView:windowScriptObjectAvailable: @abstract Notifies the delegate that the scripting object for a page is available. This is called before the page is loaded. It may be useful to allow delegates to bind native objects to the window. @param webView The webView sending the message. @param windowScriptObject The WebScriptObject for the window in the scripting environment. @discussion This method is deprecated. Consider using webView:didClearWindowObject:forFrame: instead. */ - (void)webView:(WebView *)webView windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0); @end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebJSPDFDoc.h��������������������������������������������������������������������0000644�0001750�0001750�00000002650�11255737546�014574� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 <JavaScriptCore/JSBase.h> @class WebDataSource; JSObjectRef makeJSPDFDoc(JSContextRef, WebDataSource *); ����������������������������������������������������������������������������������������WebKit/mac/WebView/WebResource.h��������������������������������������������������������������������0000644�0001750�0001750�00000006154�10766563304�015065� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004, 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> @class WebResourcePrivate; /*! @class WebResource @discussion A WebResource represents a fully downloaded URL. It includes the data of the resource as well as the metadata associated with the resource. */ @interface WebResource : NSObject <NSCoding, NSCopying> { @private WebResourcePrivate *_private; } /*! @method initWithData:URL:MIMEType:textEncodingName:frameName @abstract The initializer for WebResource. @param data The data of the resource. @param URL The URL of the resource. @param MIMEType The MIME type of the resource. @param textEncodingName The text encoding name of the resource (can be nil). @param frameName The frame name of the resource if the resource represents the contents of an entire HTML frame (can be nil). @result An initialized WebResource. */ - (id)initWithData:(NSData *)data URL:(NSURL *)URL MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName frameName:(NSString *)frameName; /*! @method data @result The data of the resource. */ - (NSData *)data; /*! @method URL @result The URL of the resource. */ - (NSURL *)URL; /*! @method MIMEType @result The MIME type of the resource. */ - (NSString *)MIMEType; /*! @method textEncodingName @result The text encoding name of the resource (can be nil). */ - (NSString *)textEncodingName; /*! @method frameName @result The frame name of the resource if the resource represents the contents of an entire HTML frame (can be nil). */ - (NSString *)frameName; @end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebScriptDebugger.h��������������������������������������������������������������0000644�0001750�0001750�00000006340�11137447003�016172� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 WebScriptDebugger_h #define WebScriptDebugger_h #include <debugger/Debugger.h> #include <runtime/Protect.h> #include <wtf/RetainPtr.h> namespace JSC { class DebuggerCallFrame; class ExecState; class JSGlobalObject; class JSObject; class ArgList; class UString; } @class WebScriptCallFrame; NSString *toNSString(const JSC::UString&); class WebScriptDebugger : public JSC::Debugger { public: WebScriptDebugger(JSC::JSGlobalObject*); void initGlobalCallFrame(const JSC::DebuggerCallFrame&); virtual void sourceParsed(JSC::ExecState*, const JSC::SourceCode&, int errorLine, const JSC::UString& errorMsg); virtual void callEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber); virtual void atStatement(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber); virtual void returnEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber); virtual void exception(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber); virtual void willExecuteProgram(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno); virtual void didExecuteProgram(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno); virtual void didReachBreakpoint(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineno); JSC::JSGlobalObject* globalObject() const { return m_globalObject.get(); } WebScriptCallFrame *globalCallFrame() const { return m_globalCallFrame.get(); } private: bool m_callingDelegate; RetainPtr<WebScriptCallFrame> m_topCallFrame; JSC::ProtectedPtr<JSC::JSGlobalObject> m_globalObject; RetainPtr<WebScriptCallFrame> m_globalCallFrame; }; #endif // WebScriptDebugger_h ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebView.h������������������������������������������������������������������������0000644�0001750�0001750�00000074022�11121474144�014174� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003, 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 #define WebNSInteger int #else #define WebNSInteger NSInteger #endif @class DOMCSSStyleDeclaration; @class DOMDocument; @class DOMElement; @class DOMNode; @class DOMRange; @class WebArchive; @class WebBackForwardList; @class WebDataSource; @class WebFrame; @class WebFrameView; @class WebHistoryItem; @class WebPreferences; @class WebScriptObject; @class WebViewPrivate; // Element dictionary keys extern NSString *WebElementDOMNodeKey; // DOMNode of the element extern NSString *WebElementFrameKey; // WebFrame of the element extern NSString *WebElementImageAltStringKey; // NSString of the ALT attribute of the image element extern NSString *WebElementImageKey; // NSImage of the image element extern NSString *WebElementImageRectKey; // NSValue of an NSRect, the rect of the image element extern NSString *WebElementImageURLKey; // NSURL of the image element extern NSString *WebElementIsSelectedKey; // NSNumber of BOOL indicating whether the element is selected or not extern NSString *WebElementLinkURLKey; // NSURL of the link if the element is within an anchor extern NSString *WebElementLinkTargetFrameKey; // WebFrame of the target of the anchor extern NSString *WebElementLinkTitleKey; // NSString of the title of the anchor extern NSString *WebElementLinkLabelKey; // NSString of the text within the anchor /* @discussion Notifications sent by WebView to mark the progress of loads. @constant WebViewProgressStartedNotification Posted whenever a load begins in the WebView, including a load that is initiated in a subframe. After receiving this notification zero or more WebViewProgressEstimateChangedNotifications will be sent. The userInfo will be nil. @constant WebViewProgressEstimateChangedNotification Posted whenever the value of estimatedProgress changes. The userInfo will be nil. @constant WebViewProgressFinishedNotification Posted when the load for a WebView has finished. The userInfo will be nil. */ extern NSString *WebViewProgressStartedNotification; extern NSString *WebViewProgressEstimateChangedNotification; extern NSString *WebViewProgressFinishedNotification; /*! @class WebView WebView manages the interaction between WebFrameViews and WebDataSources. Modification of the policies and behavior of the WebKit is largely managed by WebViews and their delegates. <p> Typical usage: </p> <pre> WebView *webView; WebFrame *mainFrame; webView = [[WebView alloc] initWithFrame: NSMakeRect (0,0,640,480)]; mainFrame = [webView mainFrame]; [mainFrame loadRequest:request]; </pre> WebViews have the following delegates: WebUIDelegate, WebResourceLoadDelegate, WebFrameLoadDelegate, and WebPolicyDelegate. WebKit depends on the WebView's WebUIDelegate for all window related management, including opening new windows and controlling the user interface elements in those windows. WebResourceLoadDelegate is used to monitor the progress of resources as they are loaded. This delegate may be used to present users with a progress monitor. The WebFrameLoadDelegate receives messages when the URL in a WebFrame is changed. WebView's WebPolicyDelegate can make determinations about how content should be handled, based on the resource's URL and MIME type. */ @interface WebView : NSView { @private WebViewPrivate *_private; } /*! @method canShowMIMEType: @abstract Checks if the WebKit can show content of a certain MIME type. @param MIMEType The MIME type to check. @result YES if the WebKit can show content with MIMEtype. */ + (BOOL)canShowMIMEType:(NSString *)MIMEType; /*! @method canShowMIMETypeAsHTML: @abstract Checks if the the MIME type is a type that the WebKit will interpret as HTML. @param MIMEType The MIME type to check. @result YES if the MIMEtype in an HTML type. */ + (BOOL)canShowMIMETypeAsHTML:(NSString *)MIMEType; /*! @method MIMETypesShownAsHTML @result Returns an array of NSStrings that describe the MIME types WebKit will attempt to render as HTML. */ + (NSArray *)MIMETypesShownAsHTML; /*! @method setMIMETypesShownAsHTML: @discussion Sets the array of NSString MIME types that WebKit will attempt to render as HTML. Typically you will retrieve the built-in array using MIMETypesShownAsHTML and add additional MIME types to that array. */ + (void)setMIMETypesShownAsHTML:(NSArray *)MIMETypes; /*! @method URLFromPasteboard: @abstract Returns a URL from a pasteboard @param pasteboard The pasteboard with a URL @result A URL if the pasteboard has one. Nil if it does not. @discussion This method differs than NSURL's URLFromPasteboard method in that it tries multiple pasteboard types including NSURLPboardType to find a URL on the pasteboard. */ + (NSURL *)URLFromPasteboard:(NSPasteboard *)pasteboard; /*! @method URLTitleFromPasteboard: @abstract Returns a URL title from a pasteboard @param pasteboard The pasteboard with a URL title @result A URL title if the pasteboard has one. Nil if it does not. @discussion This method returns a title that refers a URL on the pasteboard. An example of this is the link label which is the text inside the anchor tag. */ + (NSString *)URLTitleFromPasteboard:(NSPasteboard *)pasteboard; /*! @method registerURLSchemeAsLocal: @abstract Adds the scheme to the list of schemes to be treated as local. @param scheme The scheme to register */ + (void)registerURLSchemeAsLocal:(NSString *)scheme; /*! @method initWithFrame:frameName:groupName: @abstract The designated initializer for WebView. @discussion Initialize a WebView with the supplied parameters. This method will create a main WebFrame with the view. Passing a top level frame name is useful if you handle a targetted frame navigation that would normally open a window in some other way that still ends up creating a new WebView. @param frame The frame used to create the view. @param frameName The name to use for the top level frame. May be nil. @param groupName The name of the webView set to which this webView will be added. May be nil. @result Returns an initialized WebView. */ - (id)initWithFrame:(NSRect)frame frameName:(NSString *)frameName groupName:(NSString *)groupName; /*! @method close @abstract Closes the receiver, unloading its web page and canceling any pending loads. Once the receiver has closed, it will no longer respond to requests or fire delegate methods. (However, the -close method itself may fire delegate methods.) @discussion A garbage collected application is required to call close when the receiver is no longer needed. The close method will be called automatically when the window or hostWindow closes and shouldCloseWithWindow returns YES. A non-garbage collected application can still call close, providing a convenient way to prevent receiver from doing any more loading and firing any future delegate methods. */ - (void)close; /*! @method setShouldCloseWithWindow: @abstract Set whether the receiver closes when either it's window or hostWindow closes. @param close YES if the receiver should close when either it's window or hostWindow closes, otherwise NO. */ - (void)setShouldCloseWithWindow:(BOOL)close; /*! @method shouldCloseWithWindow @abstract Returns whether the receiver closes when either it's window or hostWindow closes. @discussion Defaults to YES in garbage collected applications, otherwise NO to maintain backwards compatibility. @result YES if the receiver closes when either it's window or hostWindow closes, otherwise NO. */ - (BOOL)shouldCloseWithWindow; /*! @method setUIDelegate: @abstract Set the WebView's WebUIDelegate. @param delegate The WebUIDelegate to set as the delegate. */ - (void)setUIDelegate:(id)delegate; /*! @method UIDelegate @abstract Return the WebView's WebUIDelegate. @result The WebView's WebUIDelegate. */ - (id)UIDelegate; /*! @method setResourceLoadDelegate: @abstract Set the WebView's WebResourceLoadDelegate load delegate. @param delegate The WebResourceLoadDelegate to set as the load delegate. */ - (void)setResourceLoadDelegate:(id)delegate; /*! @method resourceLoadDelegate @result Return the WebView's WebResourceLoadDelegate. */ - (id)resourceLoadDelegate; /*! @method setDownloadDelegate: @abstract Set the WebView's WebDownloadDelegate. @discussion The download delegate is retained by WebDownload when any downloads are in progress. @param delegate The WebDownloadDelegate to set as the download delegate. */ - (void)setDownloadDelegate:(id)delegate; /*! @method downloadDelegate @abstract Return the WebView's WebDownloadDelegate. @result The WebView's WebDownloadDelegate. */ - (id)downloadDelegate; /*! @method setFrameLoadDelegate: @abstract Set the WebView's WebFrameLoadDelegate delegate. @param delegate The WebFrameLoadDelegate to set as the delegate. */ - (void)setFrameLoadDelegate:(id)delegate; /*! @method frameLoadDelegate @abstract Return the WebView's WebFrameLoadDelegate delegate. @result The WebView's WebFrameLoadDelegate delegate. */ - (id)frameLoadDelegate; /*! @method setPolicyDelegate: @abstract Set the WebView's WebPolicyDelegate delegate. @param delegate The WebPolicyDelegate to set as the delegate. */ - (void)setPolicyDelegate:(id)delegate; /*! @method policyDelegate @abstract Return the WebView's WebPolicyDelegate. @result The WebView's WebPolicyDelegate. */ - (id)policyDelegate; /*! @method mainFrame @abstract Return the top level frame. @discussion Note that even document that are not framesets will have a mainFrame. @result The main frame. */ - (WebFrame *)mainFrame; /*! @method selectedFrame @abstract Return the frame that has the active selection. @discussion Returns the frame that contains the first responder, if any. Otherwise returns the frame that contains a non-zero-length selection, if any. Returns nil if no frame meets these criteria. @result The selected frame. */ - (WebFrame *)selectedFrame; /*! @method backForwardList @result The backforward list for this webView. */ - (WebBackForwardList *)backForwardList; /*! @method setMaintainsBackForwardList: @abstract Enable or disable the use of a backforward list for this webView. @param flag Turns use of the back forward list on or off */ - (void)setMaintainsBackForwardList:(BOOL)flag; /*! @method goBack @abstract Go back to the previous URL in the backforward list. @result YES if able to go back in the backforward list, NO otherwise. */ - (BOOL)goBack; /*! @method goForward @abstract Go forward to the next URL in the backforward list. @result YES if able to go forward in the backforward list, NO otherwise. */ - (BOOL)goForward; /*! @method goToBackForwardItem: @abstract Go back or forward to an item in the backforward list. @result YES if able to go to the item, NO otherwise. */ - (BOOL)goToBackForwardItem:(WebHistoryItem *)item; /*! @method setTextSizeMultiplier: @abstract Change the size of the text rendering in views managed by this webView. @param multiplier A fractional percentage value, 1.0 is 100%. */ - (void)setTextSizeMultiplier:(float)multiplier; /*! @method textSizeMultiplier @result The text size multipler. */ - (float)textSizeMultiplier; /*! @method setApplicationNameForUserAgent: @abstract Set the application name. @discussion This name will be used in user-agent strings that are chosen for best results in rendering web pages. @param applicationName The application name */ - (void)setApplicationNameForUserAgent:(NSString *)applicationName; /*! @method applicationNameForUserAgent @result The name of the application as used in the user-agent string. */ - (NSString *)applicationNameForUserAgent; /*! @method setCustomUserAgent: @abstract Set the user agent. @discussion Setting this means that the webView should use this user-agent string instead of constructing a user-agent string for each URL. Setting it to nil causes the webView to construct the user-agent string for each URL for best results rendering web pages. @param userAgentString The user agent description */ - (void)setCustomUserAgent:(NSString *)userAgentString; /*! @method customUserAgent @result The custom user-agent string or nil if no custom user-agent string has been set. */ - (NSString *)customUserAgent; /*! @method userAgentForURL: @abstract Get the appropriate user-agent string for a particular URL. @param URL The URL. @result The user-agent string for the supplied URL. */ - (NSString *)userAgentForURL:(NSURL *)URL; /*! @method supportsTextEncoding @abstract Find out if the current web page supports text encodings. @result YES if the document view of the current web page can support different text encodings. */ - (BOOL)supportsTextEncoding; /*! @method setCustomTextEncodingName: @discussion Make the page display with a different text encoding; stops any load in progress. The text encoding passed in overrides the normal text encoding smarts including what's specified in a web page's header or HTTP response. The text encoding automatically goes back to the default when the top level frame changes to a new location. Setting the text encoding name to nil makes the webView use default encoding rules. @param encoding The text encoding name to use to display a page or nil. */ - (void)setCustomTextEncodingName:(NSString *)encodingName; /*! @method customTextEncodingName @result The custom text encoding name or nil if no custom text encoding name has been set. */ - (NSString *)customTextEncodingName; /*! @method setMediaStyle: @discussion Set the media style for the WebView. The mediaStyle will override the normal value of the CSS media property. Setting the value to nil will restore the normal value. @param mediaStyle The value to use for the CSS media property. */ - (void)setMediaStyle:(NSString *)mediaStyle; /*! @method mediaStyle @result mediaStyle The value to use for the CSS media property, as set by setMediaStyle:. It will be nil unless set by that method. */ - (NSString *)mediaStyle; /*! @method stringByEvaluatingJavaScriptFromString: @param script The text of the JavaScript. @result The result of the script, converted to a string, or nil for failure. */ - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script; /*! @method windowScriptObject @discussion windowScriptObject return a WebScriptObject that represents the window object from the script environment. @result Returns the window object from the script environment. */ - (WebScriptObject *)windowScriptObject; /*! @method setPreferences: @param preferences The preferences to use for the webView. @abstract Override the standard setting for the webView. */ - (void)setPreferences: (WebPreferences *)prefs; /*! @method preferences @result Returns the preferences used by this webView. @discussion This method will return [WebPreferences standardPreferences] if no other instance of WebPreferences has been set. */ - (WebPreferences *)preferences; /*! @method setPreferencesIdentifier: @param anIdentifier The string to use a prefix for storing values for this WebView in the user defaults database. @discussion If the WebPreferences for this WebView are stored in the user defaults database, the string set in this method will be used a key prefix. */ - (void)setPreferencesIdentifier:(NSString *)anIdentifier; /*! @method preferencesIdentifier @result Returns the WebPreferences key prefix. */ - (NSString *)preferencesIdentifier; /*! @method setHostWindow: @param hostWindow The host window for the web view. @discussion Parts of WebKit (such as plug-ins and JavaScript) depend on a window to function properly. Set a host window so these parts continue to function even when the web view is not in an actual window. */ - (void)setHostWindow:(NSWindow *)hostWindow; /*! @method hostWindow @result The host window for the web view. */ - (NSWindow *)hostWindow; /*! @method searchFor:direction:caseSensitive: @abstract Searches a document view for a string and highlights the string if it is found. Starts the search from the current selection. Will search across all frames. @param string The string to search for. @param forward YES to search forward, NO to seach backwards. @param caseFlag YES to for case-sensitive search, NO for case-insensitive search. @result YES if found, NO if not found. */ - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag; /*! @method registerViewClass:representationClass:forMIMEType: @discussion Register classes that implement WebDocumentView and WebDocumentRepresentation respectively. A document class may register for a primary MIME type by excluding a subtype, i.e. "video/" will match the document class with all video types. More specific matching takes precedence over general matching. @param viewClass The WebDocumentView class to use to render data for a given MIME type. @param representationClass The WebDocumentRepresentation class to use to represent data of the given MIME type. @param MIMEType The MIME type to represent with an object of the given class. */ + (void)registerViewClass:(Class)viewClass representationClass:(Class)representationClass forMIMEType:(NSString *)MIMEType; /*! @method setGroupName: @param groupName The name of the group for this WebView. @discussion JavaScript may access named frames within the same group. */ - (void)setGroupName:(NSString *)groupName; /*! @method groupName @discussion The group name for this WebView. */ - (NSString *)groupName; /*! @method estimatedProgress @discussion An estimate of the percent complete for a document load. This value will range from 0 to 1.0 and, once a load completes, will remain at 1.0 until a new load starts, at which point it will be reset to 0. The value is an estimate based on the total number of bytes expected to be received for a document, including all it's possible subresources. For more accurate progress indication it is recommended that you implement a WebFrameLoadDelegate and a WebResourceLoadDelegate. */ - (double)estimatedProgress; /*! @method isLoading @discussion Returns YES if there are any pending loads. */ - (BOOL)isLoading; /*! @method elementAtPoint: @param point A point in the coordinates of the WebView @result An element dictionary describing the point */ - (NSDictionary *)elementAtPoint:(NSPoint)point; /*! @method pasteboardTypesForSelection @abstract Returns the pasteboard types that WebView can use for the current selection */ - (NSArray *)pasteboardTypesForSelection; /*! @method writeSelectionWithPasteboardTypes:toPasteboard: @abstract Writes the current selection to the pasteboard @param types The types that WebView will write to the pasteboard @param pasteboard The pasteboard to write to */ - (void)writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard; /*! @method pasteboardTypesForElement: @abstract Returns the pasteboard types that WebView can use for an element @param element The element */ - (NSArray *)pasteboardTypesForElement:(NSDictionary *)element; /*! @method writeElement:withPasteboardTypes:toPasteboard: @abstract Writes an element to the pasteboard @param element The element to write to the pasteboard @param types The types that WebView will write to the pasteboard @param pasteboard The pasteboard to write to */ - (void)writeElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard; /*! @method moveDragCaretToPoint: @param point A point in the coordinates of the WebView @discussion This method moves the caret that shows where something being dragged will be dropped. It may cause the WebView to scroll to make the new position of the drag caret visible. */ - (void)moveDragCaretToPoint:(NSPoint)point; /*! @method removeDragCaret @abstract Removes the drag caret from the WebView */ - (void)removeDragCaret; /*! @method setDrawsBackground: @param drawsBackround YES to cause the receiver to draw a default white background, NO otherwise. @abstract Sets whether the receiver draws a default white background when the loaded page has no background specified. */ - (void)setDrawsBackground:(BOOL)drawsBackround; /*! @method drawsBackground @result Returns YES if the receiver draws a default white background, NO otherwise. */ - (BOOL)drawsBackground; /*! @method setShouldUpdateWhileOffscreen: @abstract Sets whether the receiver must update even when it is not in a window that is currently visible. @param updateWhileOffscreen whether the receiver is required to render updates to the web page when it is not in a visible window. @abstract If set to NO, then whenever the web view is not in a visible window, updates to the web page will not necessarily be rendered in the view. However, when the window is made visible, the view will be updated automatically. Not updating while hidden can improve performance. If set to is YES, hidden web views are always updated. This is the default. */ - (void)setShouldUpdateWhileOffscreen:(BOOL)updateWhileOffscreen; /*! @method shouldUpdateWhileOffscreen @result Returns whether the web view is always updated even when it is not in a window that is currently visible. */ - (BOOL)shouldUpdateWhileOffscreen; /*! @method setMainFrameURL: @param URLString The URL to load in the mainFrame. */ - (void)setMainFrameURL:(NSString *)URLString; /*! @method mainFrameURL @result Returns the main frame's current URL. */ - (NSString *)mainFrameURL; /*! @method mainFrameDocument @result Returns the main frame's DOMDocument. */ - (DOMDocument *)mainFrameDocument; /*! @method mainFrameTitle @result Returns the main frame's title if any, otherwise an empty string. */ - (NSString *)mainFrameTitle; /*! @method mainFrameIcon @discussion The methods returns the site icon for the current page loaded in the mainFrame. @result Returns the main frame's icon if any, otherwise nil. */ - (NSImage *)mainFrameIcon; @end @interface WebView (WebIBActions) <NSUserInterfaceValidations> - (IBAction)takeStringURLFrom:(id)sender; - (IBAction)stopLoading:(id)sender; - (IBAction)reload:(id)sender; - (IBAction)reloadFromOrigin:(id)sender; - (BOOL)canGoBack; - (IBAction)goBack:(id)sender; - (BOOL)canGoForward; - (IBAction)goForward:(id)sender; - (BOOL)canMakeTextLarger; - (IBAction)makeTextLarger:(id)sender; - (BOOL)canMakeTextSmaller; - (IBAction)makeTextSmaller:(id)sender; - (BOOL)canMakeTextStandardSize; - (IBAction)makeTextStandardSize:(id)sender; - (IBAction)toggleContinuousSpellChecking:(id)sender; - (IBAction)toggleSmartInsertDelete:(id)sender; @end // WebView editing support extern NSString * const WebViewDidBeginEditingNotification; extern NSString * const WebViewDidChangeNotification; extern NSString * const WebViewDidEndEditingNotification; extern NSString * const WebViewDidChangeTypingStyleNotification; extern NSString * const WebViewDidChangeSelectionNotification; @interface WebView (WebViewCSS) - (DOMCSSStyleDeclaration *)computedStyleForElement:(DOMElement *)element pseudoElement:(NSString *)pseudoElement; @end @interface WebView (WebViewEditing) - (DOMRange *)editableDOMRangeForPoint:(NSPoint)point; - (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity; - (DOMRange *)selectedDOMRange; - (NSSelectionAffinity)selectionAffinity; - (BOOL)maintainsInactiveSelection; - (void)setEditable:(BOOL)flag; - (BOOL)isEditable; - (void)setTypingStyle:(DOMCSSStyleDeclaration *)style; - (DOMCSSStyleDeclaration *)typingStyle; - (void)setSmartInsertDeleteEnabled:(BOOL)flag; - (BOOL)smartInsertDeleteEnabled; - (void)setContinuousSpellCheckingEnabled:(BOOL)flag; - (BOOL)isContinuousSpellCheckingEnabled; - (WebNSInteger)spellCheckerDocumentTag; - (NSUndoManager *)undoManager; - (void)setEditingDelegate:(id)delegate; - (id)editingDelegate; - (DOMCSSStyleDeclaration *)styleDeclarationWithText:(NSString *)text; @end @interface WebView (WebViewUndoableEditing) - (void)replaceSelectionWithNode:(DOMNode *)node; - (void)replaceSelectionWithText:(NSString *)text; - (void)replaceSelectionWithMarkupString:(NSString *)markupString; - (void)replaceSelectionWithArchive:(WebArchive *)archive; - (void)deleteSelection; - (void)applyStyle:(DOMCSSStyleDeclaration *)style; @end @interface WebView (WebViewEditingActions) - (void)copy:(id)sender; - (void)cut:(id)sender; - (void)paste:(id)sender; - (void)copyFont:(id)sender; - (void)pasteFont:(id)sender; - (void)delete:(id)sender; - (void)pasteAsPlainText:(id)sender; - (void)pasteAsRichText:(id)sender; - (void)changeFont:(id)sender; - (void)changeAttributes:(id)sender; - (void)changeDocumentBackgroundColor:(id)sender; - (void)changeColor:(id)sender; - (void)alignCenter:(id)sender; - (void)alignJustified:(id)sender; - (void)alignLeft:(id)sender; - (void)alignRight:(id)sender; - (void)checkSpelling:(id)sender; - (void)showGuessPanel:(id)sender; - (void)performFindPanelAction:(id)sender; - (void)startSpeaking:(id)sender; - (void)stopSpeaking:(id)sender; - (void)moveToBeginningOfSentence:(id)sender; - (void)moveToBeginningOfSentenceAndModifySelection:(id)sender; - (void)moveToEndOfSentence:(id)sender; - (void)moveToEndOfSentenceAndModifySelection:(id)sender; - (void)selectSentence:(id)sender; /* The following methods are declared in NSResponder.h. WebView overrides each method in this list, providing a custom implementation for each. - (void)capitalizeWord:(id)sender; - (void)centerSelectionInVisibleArea:(id)sender; - (void)changeCaseOfLetter:(id)sender; - (void)complete:(id)sender; - (void)deleteBackward:(id)sender; - (void)deleteBackwardByDecomposingPreviousCharacter:(id)sender; - (void)deleteForward:(id)sender; - (void)deleteToBeginningOfLine:(id)sender; - (void)deleteToBeginningOfParagraph:(id)sender; - (void)deleteToEndOfLine:(id)sender; - (void)deleteToEndOfParagraph:(id)sender; - (void)deleteWordBackward:(id)sender; - (void)deleteWordForward:(id)sender; - (void)indent:(id)sender; - (void)insertBacktab:(id)sender; - (void)insertNewline:(id)sender; - (void)insertParagraphSeparator:(id)sender; - (void)insertTab:(id)sender; - (void)lowercaseWord:(id)sender; - (void)moveBackward:(id)sender; - (void)moveBackwardAndModifySelection:(id)sender; - (void)moveDown:(id)sender; - (void)moveDownAndModifySelection:(id)sender; - (void)moveForward:(id)sender; - (void)moveForwardAndModifySelection:(id)sender; - (void)moveLeft:(id)sender; - (void)moveLeftAndModifySelection:(id)sender; - (void)moveRight:(id)sender; - (void)moveRightAndModifySelection:(id)sender; - (void)moveToBeginningOfDocument:(id)sender; - (void)moveToBeginningOfDocumentAndModifySelection:(id)sender; - (void)moveToBeginningOfLine:(id)sender; - (void)moveToBeginningOfLineAndModifySelection:(id)sender; - (void)moveToBeginningOfParagraph:(id)sender; - (void)moveToBeginningOfParagraphAndModifySelection:(id)sender; - (void)moveToEndOfDocument:(id)sender; - (void)moveToEndOfDocumentAndModifySelection:(id)sender; - (void)moveToEndOfLine:(id)sender; - (void)moveToEndOfLineAndModifySelection:(id)sender; - (void)moveToEndOfParagraph:(id)sender; - (void)moveToEndOfParagraphAndModifySelection:(id)sender; - (void)moveUp:(id)sender; - (void)moveUpAndModifySelection:(id)sender; - (void)moveWordBackward:(id)sender; - (void)moveWordBackwardAndModifySelection:(id)sender; - (void)moveWordForward:(id)sender; - (void)moveWordForwardAndModifySelection:(id)sender; - (void)moveWordLeft:(id)sender; - (void)moveWordLeftAndModifySelection:(id)sender; - (void)moveWordRight:(id)sender; - (void)moveWordRightAndModifySelection:(id)sender; - (void)pageDown:(id)sender; - (void)pageUp:(id)sender; - (void)scrollLineDown:(id)sender; - (void)scrollLineUp:(id)sender; - (void)scrollPageDown:(id)sender; - (void)scrollPageUp:(id)sender; - (void)selectAll:(id)sender; - (void)selectLine:(id)sender; - (void)selectParagraph:(id)sender; - (void)selectWord:(id)sender; - (void)uppercaseWord:(id)sender; */ @end #undef WebNSInteger ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebDynamicScrollBarsViewInternal.h�����������������������������������������������0000644�0001750�0001750�00000005017�11067334724�021173� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebDynamicScrollBarsView.h" #import <WebCore/WebCoreFrameView.h> @interface WebDynamicScrollBarsView (WebInternal) <WebCoreFrameScrollView> - (BOOL)allowsHorizontalScrolling; - (BOOL)allowsVerticalScrolling; - (void)setScrollingModes:(WebCore::ScrollbarMode)hMode vertical:(WebCore::ScrollbarMode)vMode andLock:(BOOL)lock; - (void)scrollingModes:(WebCore::ScrollbarMode*)hMode vertical:(WebCore::ScrollbarMode*)vMode; - (WebCore::ScrollbarMode)horizontalScrollingMode; - (WebCore::ScrollbarMode)verticalScrollingMode; - (void)setHorizontalScrollingMode:(WebCore::ScrollbarMode)mode andLock:(BOOL)lock; - (void)setVerticalScrollingMode:(WebCore::ScrollbarMode)mode andLock:(BOOL)lock; - (void)setHorizontalScrollingModeLocked:(BOOL)locked; - (void)setVerticalScrollingModeLocked:(BOOL)locked; - (void)setScrollingModesLocked:(BOOL)mode; - (BOOL)horizontalScrollingModeLocked; - (BOOL)verticalScrollingModeLocked; - (void)updateScrollers; - (void)setSuppressLayout:(BOOL)flag; @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebDocumentLoaderMac.mm����������������������������������������������������������0000644�0001750�0001750�00000011654�10744307516�017004� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebDocumentLoaderMac.h" #import "WebKitVersionChecks.h" #import "WebView.h" using namespace WebCore; WebDocumentLoaderMac::WebDocumentLoaderMac(const ResourceRequest& request, const SubstituteData& substituteData) : DocumentLoader(request, substituteData) , m_dataSource(nil) , m_isDataSourceRetained(false) { } static inline bool needsDataLoadWorkaround(WebView *webView) { #ifdef BUILDING_ON_TIGER // Tiger has to be a little less efficient. id frameLoadDelegate = [webView frameLoadDelegate]; if (!frameLoadDelegate) return false; NSString *bundleIdentifier = [[NSBundle bundleForClass:[frameLoadDelegate class]] bundleIdentifier]; if ([bundleIdentifier isEqualToString:@"com.apple.AppKit"]) return true; if ([bundleIdentifier isEqualToString:@"com.adobe.Installers.Setup"]) return true; return false; #else static bool needsWorkaround = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_ADOBE_INSTALLER_QUIRK) && [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.adobe.Installers.Setup"]; return needsWorkaround; #endif } void WebDocumentLoaderMac::setDataSource(WebDataSource *dataSource, WebView *webView) { ASSERT(!m_dataSource); ASSERT(!m_isDataSourceRetained); m_dataSource = dataSource; retainDataSource(); m_resourceLoadDelegate = [webView resourceLoadDelegate]; m_downloadDelegate = [webView downloadDelegate]; // Some clients run the run loop in a way that prevents the data load timer // from firing. We work around that issue here. See <rdar://problem/5266289> // and <rdar://problem/5049509>. if (needsDataLoadWorkaround(webView)) m_deferMainResourceDataLoad = false; } WebDataSource *WebDocumentLoaderMac::dataSource() const { return m_dataSource; } void WebDocumentLoaderMac::attachToFrame() { DocumentLoader::attachToFrame(); retainDataSource(); } void WebDocumentLoaderMac::detachFromFrame() { DocumentLoader::detachFromFrame(); if (m_loadingResources.isEmpty()) releaseDataSource(); // FIXME: What prevents the data source from getting deallocated while the // frame is not attached? } void WebDocumentLoaderMac::increaseLoadCount(unsigned long identifier) { ASSERT(m_dataSource); if (m_loadingResources.contains(identifier)) return; m_loadingResources.add(identifier); retainDataSource(); } void WebDocumentLoaderMac::decreaseLoadCount(unsigned long identifier) { HashSet<unsigned long>::iterator it = m_loadingResources.find(identifier); // It is valid for a load to be cancelled before it's started. if (it == m_loadingResources.end()) return; m_loadingResources.remove(it); if (m_loadingResources.isEmpty()) { m_resourceLoadDelegate = 0; m_downloadDelegate = 0; if (!frame()) releaseDataSource(); } } void WebDocumentLoaderMac::retainDataSource() { if (m_isDataSourceRetained || !m_dataSource) return; m_isDataSourceRetained = true; CFRetain(m_dataSource); } void WebDocumentLoaderMac::releaseDataSource() { if (!m_isDataSourceRetained) return; ASSERT(m_dataSource); m_isDataSourceRetained = false; CFRelease(m_dataSource); } void WebDocumentLoaderMac::detachDataSource() { ASSERT(!m_isDataSourceRetained); m_dataSource = nil; } ������������������������������������������������������������������������������������WebKit/mac/WebView/WebDelegateImplementationCaching.mm����������������������������������������������0000644�0001750�0001750�00000060144�11260532745�021347� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * Copyright (C) 2006 David Smith (catfish.man@gmail.com) * * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebDelegateImplementationCaching.h" #import "WebKitLogging.h" #import "WebView.h" #import "WebViewData.h" #import <objc/objc-runtime.h> @implementation WebView (WebDelegateImplementationCaching) WebResourceDelegateImplementationCache* WebViewGetResourceLoadDelegateImplementations(WebView *webView) { static WebResourceDelegateImplementationCache empty; if (!webView) return ∅ return &webView->_private->resourceLoadDelegateImplementations; } WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementations(WebView *webView) { static WebFrameLoadDelegateImplementationCache empty; if (!webView) return ∅ return &webView->_private->frameLoadDelegateImplementations; } WebScriptDebugDelegateImplementationCache* WebViewGetScriptDebugDelegateImplementations(WebView *webView) { static WebScriptDebugDelegateImplementationCache empty; if (!webView) return ∅ return &webView->_private->scriptDebugDelegateImplementations; } WebHistoryDelegateImplementationCache* WebViewGetHistoryDelegateImplementations(WebView *webView) { static WebHistoryDelegateImplementationCache empty; if (!webView) return ∅ return &webView->_private->historyDelegateImplementations; } // We use these functions to call the delegates and block exceptions. These functions are // declared inside a WebView category to get direct access to the delegate data memebers, // preventing more ObjC message dispatch and compensating for the expense of the @try/@catch. typedef float (*ObjCMsgSendFPRet)(id, SEL, ...); #if defined(__i386__) static const ObjCMsgSendFPRet objc_msgSend_float_return = reinterpret_cast<ObjCMsgSendFPRet>(objc_msgSend_fpret); #else static const ObjCMsgSendFPRet objc_msgSend_float_return = reinterpret_cast<ObjCMsgSendFPRet>(objc_msgSend); #endif static inline id CallDelegate(WebView *self, id delegate, SEL selector) { if (!delegate || ![delegate respondsToSelector:selector]) return nil; if (!self->_private->catchesDelegateExceptions) return objc_msgSend(delegate, selector, self); @try { return objc_msgSend(delegate, selector, self); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(WebView *self, id delegate, SEL selector, id object) { if (!delegate || ![delegate respondsToSelector:selector]) return nil; if (!self->_private->catchesDelegateExceptions) return objc_msgSend(delegate, selector, self, object); @try { return objc_msgSend(delegate, selector, self, object); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(WebView *self, id delegate, SEL selector, NSRect rect) { if (!delegate || ![delegate respondsToSelector:selector]) return nil; if (!self->_private->catchesDelegateExceptions) return reinterpret_cast<id (*)(id, SEL, WebView *, NSRect)>(objc_msgSend)(delegate, selector, self, rect); @try { return reinterpret_cast<id (*)(id, SEL, WebView *, NSRect)>(objc_msgSend)(delegate, selector, self, rect); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(WebView *self, id delegate, SEL selector, id object1, id object2) { if (!delegate || ![delegate respondsToSelector:selector]) return nil; if (!self->_private->catchesDelegateExceptions) return objc_msgSend(delegate, selector, self, object1, object2); @try { return objc_msgSend(delegate, selector, self, object1, object2); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(WebView *self, id delegate, SEL selector, id object, BOOL boolean) { if (!delegate || ![delegate respondsToSelector:selector]) return nil; if (!self->_private->catchesDelegateExceptions) return objc_msgSend(delegate, selector, self, object, boolean); @try { return objc_msgSend(delegate, selector, self, object, boolean); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(WebView *self, id delegate, SEL selector, id object1, id object2, id object3) { if (!delegate || ![delegate respondsToSelector:selector]) return nil; if (!self->_private->catchesDelegateExceptions) return objc_msgSend(delegate, selector, self, object1, object2, object3); @try { return objc_msgSend(delegate, selector, self, object1, object2, object3); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(WebView *self, id delegate, SEL selector, id object, NSUInteger integer) { if (!delegate || ![delegate respondsToSelector:selector]) return nil; if (!self->_private->catchesDelegateExceptions) return objc_msgSend(delegate, selector, self, object, integer); @try { return objc_msgSend(delegate, selector, self, object, integer); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline float CallDelegateReturningFloat(WebView *self, id delegate, SEL selector) { if (!delegate || ![delegate respondsToSelector:selector]) return 0.0f; if (!self->_private->catchesDelegateExceptions) return objc_msgSend_float_return(delegate, selector, self); @try { return objc_msgSend_float_return(delegate, selector, self); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return 0.0f; } static inline BOOL CallDelegateReturningBoolean(BOOL result, WebView *self, id delegate, SEL selector) { if (!delegate || ![delegate respondsToSelector:selector]) return result; if (!self->_private->catchesDelegateExceptions) return reinterpret_cast<BOOL (*)(id, SEL, WebView *)>(objc_msgSend)(delegate, selector, self); @try { return reinterpret_cast<BOOL (*)(id, SEL, WebView *)>(objc_msgSend)(delegate, selector, self); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return result; } static inline BOOL CallDelegateReturningBoolean(BOOL result, WebView *self, id delegate, SEL selector, id object) { if (!delegate || ![delegate respondsToSelector:selector]) return result; if (!self->_private->catchesDelegateExceptions) return reinterpret_cast<BOOL (*)(id, SEL, WebView *, id)>(objc_msgSend)(delegate, selector, self, object); @try { return reinterpret_cast<BOOL (*)(id, SEL, WebView *, id)>(objc_msgSend)(delegate, selector, self, object); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return result; } static inline BOOL CallDelegateReturningBoolean(BOOL result, WebView *self, id delegate, SEL selector, id object, BOOL boolean) { if (!delegate || ![delegate respondsToSelector:selector]) return result; if (!self->_private->catchesDelegateExceptions) return reinterpret_cast<BOOL (*)(id, SEL, WebView *, id, BOOL)>(objc_msgSend)(delegate, selector, self, object, boolean); @try { return reinterpret_cast<BOOL (*)(id, SEL, WebView *, id, BOOL)>(objc_msgSend)(delegate, selector, self, object, boolean); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return result; } static inline BOOL CallDelegateReturningBoolean(BOOL result, WebView *self, id delegate, SEL selector, id object1, id object2) { if (!delegate || ![delegate respondsToSelector:selector]) return result; if (!self->_private->catchesDelegateExceptions) return reinterpret_cast<BOOL (*)(id, SEL, WebView *, id, id)>(objc_msgSend)(delegate, selector, self, object1, object2); @try { return reinterpret_cast<BOOL (*)(id, SEL, WebView *, id, id)>(objc_msgSend)(delegate, selector, self, object1, object2); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return result; } static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector) { if (!delegate) return nil; if (!self->_private->catchesDelegateExceptions) return implementation(delegate, selector, self); @try { return implementation(delegate, selector, self); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object) { if (!delegate) return nil; if (!self->_private->catchesDelegateExceptions) return implementation(delegate, selector, self, object); @try { return implementation(delegate, selector, self, object); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, id object2) { if (!delegate) return nil; if (!self->_private->catchesDelegateExceptions) return implementation(delegate, selector, self, object1, object2); @try { return implementation(delegate, selector, self, object1, object2); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, id object2, id object3) { if (!delegate) return nil; if (!self->_private->catchesDelegateExceptions) return implementation(delegate, selector, self, object1, object2, object3); @try { return implementation(delegate, selector, self, object1, object2, object3); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, id object2, id object3, id object4) { if (!delegate) return nil; if (!self->_private->catchesDelegateExceptions) return implementation(delegate, selector, self, object1, object2, object3, object4); @try { return implementation(delegate, selector, self, object1, object2, object3, object4); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, NSInteger integer, id object2) { if (!delegate) return nil; if (!self->_private->catchesDelegateExceptions) return implementation(delegate, selector, self, object1, integer, object2); @try { return implementation(delegate, selector, self, object1, integer, object2); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, NSInteger integer1, NSInteger integer2, id object2) { if (!delegate) return nil; if (!self->_private->catchesDelegateExceptions) return implementation(delegate, selector, self, object1, integer1, integer2, object2); @try { return implementation(delegate, selector, self, object1, integer1, integer2, object2); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, id object2, NSInteger integer, id object3) { if (!delegate) return nil; if (!self->_private->catchesDelegateExceptions) return implementation(delegate, selector, self, object1, object2, integer, object3); @try { return implementation(delegate, selector, self, object1, object2, integer, object3); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, NSInteger integer1, id object2, NSInteger integer2, id object3) { if (!delegate) return nil; if (!self->_private->catchesDelegateExceptions) return implementation(delegate, selector, self, object1, integer1, object2, integer2, object3); @try { return implementation(delegate, selector, self, object1, integer1, object2, integer2, object3); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, NSInteger integer, id object2, id object3, id object4) { if (!delegate) return nil; if (!self->_private->catchesDelegateExceptions) return implementation(delegate, selector, self, object1, integer, object2, object3, object4); @try { return implementation(delegate, selector, self, object1, integer, object2, object3, object4); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, NSTimeInterval interval, id object2, id object3) { if (!delegate) return nil; if (!self->_private->catchesDelegateExceptions) return implementation(delegate, selector, self, object1, interval, object2, object3); @try { return implementation(delegate, selector, self, object1, interval, object2, object3); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } id CallUIDelegate(WebView *self, SEL selector) { return CallDelegate(self, self->_private->UIDelegate, selector); } id CallUIDelegate(WebView *self, SEL selector, id object) { return CallDelegate(self, self->_private->UIDelegate, selector, object); } id CallUIDelegate(WebView *self, SEL selector, id object, BOOL boolean) { return CallDelegate(self, self->_private->UIDelegate, selector, object, boolean); } id CallUIDelegate(WebView *self, SEL selector, NSRect rect) { return CallDelegate(self, self->_private->UIDelegate, selector, rect); } id CallUIDelegate(WebView *self, SEL selector, id object1, id object2) { return CallDelegate(self, self->_private->UIDelegate, selector, object1, object2); } id CallUIDelegate(WebView *self, SEL selector, id object1, id object2, id object3) { return CallDelegate(self, self->_private->UIDelegate, selector, object1, object2, object3); } id CallUIDelegate(WebView *self, SEL selector, id object, NSUInteger integer) { return CallDelegate(self, self->_private->UIDelegate, selector, object, integer); } float CallUIDelegateReturningFloat(WebView *self, SEL selector) { return CallDelegateReturningFloat(self, self->_private->UIDelegate, selector); } BOOL CallUIDelegateReturningBoolean(BOOL result, WebView *self, SEL selector) { return CallDelegateReturningBoolean(result, self, self->_private->UIDelegate, selector); } BOOL CallUIDelegateReturningBoolean(BOOL result, WebView *self, SEL selector, id object) { return CallDelegateReturningBoolean(result, self, self->_private->UIDelegate, selector, object); } BOOL CallUIDelegateReturningBoolean(BOOL result, WebView *self, SEL selector, id object, BOOL boolean) { return CallDelegateReturningBoolean(result, self, self->_private->UIDelegate, selector, object, boolean); } BOOL CallUIDelegateReturningBoolean(BOOL result, WebView *self, SEL selector, id object1, id object2) { return CallDelegateReturningBoolean(result, self, self->_private->UIDelegate, selector, object1, object2); } id CallFrameLoadDelegate(IMP implementation, WebView *self, SEL selector) { return CallDelegate(implementation, self, self->_private->frameLoadDelegate, selector); } id CallFrameLoadDelegate(IMP implementation, WebView *self, SEL selector, id object) { return CallDelegate(implementation, self, self->_private->frameLoadDelegate, selector, object); } id CallFrameLoadDelegate(IMP implementation, WebView *self, SEL selector, id object1, id object2) { return CallDelegate(implementation, self, self->_private->frameLoadDelegate, selector, object1, object2); } id CallFrameLoadDelegate(IMP implementation, WebView *self, SEL selector, id object1, id object2, id object3) { return CallDelegate(implementation, self, self->_private->frameLoadDelegate, selector, object1, object2, object3); } id CallFrameLoadDelegate(IMP implementation, WebView *self, SEL selector, id object1, id object2, id object3, id object4) { return CallDelegate(implementation, self, self->_private->frameLoadDelegate, selector, object1, object2, object3, object4); } id CallFrameLoadDelegate(IMP implementation, WebView *self, SEL selector, id object1, NSTimeInterval interval, id object2, id object3) { return CallDelegate(implementation, self, self->_private->frameLoadDelegate, selector, object1, interval, object2, object3); } id CallResourceLoadDelegate(IMP implementation, WebView *self, SEL selector, id object1, id object2) { return CallDelegate(implementation, self, self->_private->resourceProgressDelegate, selector, object1, object2); } id CallResourceLoadDelegate(IMP implementation, WebView *self, SEL selector, id object1, id object2, id object3) { return CallDelegate(implementation, self, self->_private->resourceProgressDelegate, selector, object1, object2, object3); } id CallResourceLoadDelegate(IMP implementation, WebView *self, SEL selector, id object1, id object2, id object3, id object4) { return CallDelegate(implementation, self, self->_private->resourceProgressDelegate, selector, object1, object2, object3, object4); } id CallResourceLoadDelegate(IMP implementation, WebView *self, SEL selector, id object1, NSInteger integer, id object2) { return CallDelegate(implementation, self, self->_private->resourceProgressDelegate, selector, object1, integer, object2); } id CallResourceLoadDelegate(IMP implementation, WebView *self, SEL selector, id object1, id object2, NSInteger integer, id object3) { return CallDelegate(implementation, self, self->_private->resourceProgressDelegate, selector, object1, object2, integer, object3); } BOOL CallResourceLoadDelegateReturningBoolean(BOOL result, IMP implementation, WebView *self, SEL selector, id object1, id object2) { if (!self->_private->catchesDelegateExceptions) return reinterpret_cast<BOOL (*)(id, SEL, WebView *, id, id)>(objc_msgSend)(self->_private->resourceProgressDelegate, selector, self, object1, object2); @try { return reinterpret_cast<BOOL (*)(id, SEL, WebView *, id, id)>(objc_msgSend)(self->_private->resourceProgressDelegate, selector, self, object1, object2); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return result; } id CallScriptDebugDelegate(IMP implementation, WebView *self, SEL selector, id object1, id object2, NSInteger integer, id object3) { return CallDelegate(implementation, self, self->_private->scriptDebugDelegate, selector, object1, object2, integer, object3); } id CallScriptDebugDelegate(IMP implementation, WebView *self, SEL selector, id object1, NSInteger integer1, id object2, NSInteger integer2, id object3) { return CallDelegate(implementation, self, self->_private->scriptDebugDelegate, selector, object1, integer1, object2, integer2, object3); } id CallScriptDebugDelegate(IMP implementation, WebView *self, SEL selector, id object1, NSInteger integer, id object2, id object3, id object4) { return CallDelegate(implementation, self, self->_private->scriptDebugDelegate, selector, object1, integer, object2, object3, object4); } id CallScriptDebugDelegate(IMP implementation, WebView *self, SEL selector, id object1, NSInteger integer1, NSInteger integer2, id object2) { return CallDelegate(implementation, self, self->_private->scriptDebugDelegate, selector, object1, integer1, integer2, object2); } id CallHistoryDelegate(IMP implementation, WebView *self, SEL selector, id object1, id object2) { return CallDelegate(implementation, self, self->_private->historyDelegate, selector, object1, object2); } id CallHistoryDelegate(IMP implementation, WebView *self, SEL selector, id object1, id object2, id object3) { return CallDelegate(implementation, self, self->_private->historyDelegate, selector, object1, object2, object3); } // The form delegate needs to have it's own implementation, because the first argument is never the WebView id CallFormDelegate(WebView *self, SEL selector, id object1, id object2) { id delegate = self->_private->formDelegate; if (!delegate || ![delegate respondsToSelector:selector]) return nil; if (!self->_private->catchesDelegateExceptions) return objc_msgSend(delegate, selector, object1, object2); @try { return objc_msgSend(delegate, selector, object1, object2); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } id CallFormDelegate(WebView *self, SEL selector, id object1, id object2, id object3, id object4, id object5) { id delegate = self->_private->formDelegate; if (!delegate || ![delegate respondsToSelector:selector]) return nil; if (!self->_private->catchesDelegateExceptions) return objc_msgSend(delegate, selector, object1, object2, object3, object4, object5); @try { return objc_msgSend(delegate, selector, object1, object2, object3, object4, object5); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return nil; } BOOL CallFormDelegateReturningBoolean(BOOL result, WebView *self, SEL selector, id object1, SEL selectorArg, id object2) { id delegate = self->_private->formDelegate; if (!delegate || ![delegate respondsToSelector:selector]) return result; if (!self->_private->catchesDelegateExceptions) return reinterpret_cast<BOOL (*)(id, SEL, id, SEL, id)>(objc_msgSend)(delegate, selector, object1, selectorArg, object2); @try { return reinterpret_cast<BOOL (*)(id, SEL, id, SEL, id)>(objc_msgSend)(delegate, selector, object1, selectorArg, object2); } @catch(id exception) { ReportDiscardedDelegateException(selector, exception); } return result; } @end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebEditingDelegatePrivate.h������������������������������������������������������0000644�0001750�0001750�00000004077�10744307516�017646� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebEditingDelegate.h> @class DOMHTMLElement; @interface NSObject (WebViewEditingDelegatePrivate) - (BOOL)webView:(WebView *)webView shouldShowDeleteInterfaceForElement:(DOMHTMLElement *)element; - (void)webView:(WebView *)webView didWriteSelectionToPasteboard:(NSPasteboard *)pasteboard; - (void)webView:(WebView *)webView didSetSelectionTypesForPasteboard:(NSPasteboard *)pasteboard; - (BOOL)webView:(WebView *)webView shouldMoveRangeAfterDelete:(DOMRange *)range replacingRange:(DOMRange *)rangeToBeReplaced; @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebResource.mm�������������������������������������������������������������������0000644�0001750�0001750�00000032520�11221220037�015217� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebResourceInternal.h" #import "WebFrameInternal.h" #import "WebKitLogging.h" #import "WebKitVersionChecks.h" #import "WebNSDictionaryExtras.h" #import "WebNSObjectExtras.h" #import "WebNSURLExtras.h" #import <JavaScriptCore/InitializeThreading.h> #import <JavaScriptCore/PassRefPtr.h> #import <WebCore/ArchiveResource.h> #import <WebCore/LegacyWebArchive.h> #import <WebCore/RuntimeApplicationChecks.h> #import <WebCore/TextEncoding.h> #import <WebCore/ThreadCheck.h> #import <WebCore/WebCoreObjCExtras.h> #import <WebCore/WebCoreURLResponse.h> using namespace WebCore; static NSString * const WebResourceDataKey = @"WebResourceData"; static NSString * const WebResourceFrameNameKey = @"WebResourceFrameName"; static NSString * const WebResourceMIMETypeKey = @"WebResourceMIMEType"; static NSString * const WebResourceURLKey = @"WebResourceURL"; static NSString * const WebResourceTextEncodingNameKey = @"WebResourceTextEncodingName"; static NSString * const WebResourceResponseKey = @"WebResourceResponse"; @interface WebResourcePrivate : NSObject { @public ArchiveResource* coreResource; } - (id)initWithCoreResource:(PassRefPtr<ArchiveResource>)coreResource; @end @implementation WebResourcePrivate + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif } - (id)init { return [super init]; } - (id)initWithCoreResource:(PassRefPtr<ArchiveResource>)passedResource { self = [super init]; if (!self) return nil; // Acquire the PassRefPtr<>'s ref as our own manual ref coreResource = passedResource.releaseRef(); return self; } - (void)dealloc { if (WebCoreObjCScheduleDeallocateOnMainThread([WebResourcePrivate class], self)) return; if (coreResource) coreResource->deref(); [super dealloc]; } - (void)finalize { if (coreResource) coreResource->deref(); [super finalize]; } @end @implementation WebResource - (id)init { self = [super init]; if (!self) return nil; _private = [[WebResourcePrivate alloc] init]; return self; } - (id)initWithData:(NSData *)data URL:(NSURL *)URL MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName frameName:(NSString *)frameName { return [self _initWithData:data URL:URL MIMEType:MIMEType textEncodingName:textEncodingName frameName:frameName response:nil copyData:YES]; } - (id)initWithCoder:(NSCoder *)decoder { WebCoreThreadViolationCheckRoundTwo(); self = [super init]; if (!self) return nil; NSData *data = nil; NSURL *url = nil; NSString *mimeType = nil, *textEncoding = nil, *frameName = nil; NSURLResponse *response = nil; @try { id object = [decoder decodeObjectForKey:WebResourceDataKey]; if ([object isKindOfClass:[NSData class]]) data = object; object = [decoder decodeObjectForKey:WebResourceURLKey]; if ([object isKindOfClass:[NSURL class]]) url = object; object = [decoder decodeObjectForKey:WebResourceMIMETypeKey]; if ([object isKindOfClass:[NSString class]]) mimeType = object; object = [decoder decodeObjectForKey:WebResourceTextEncodingNameKey]; if ([object isKindOfClass:[NSString class]]) textEncoding = object; object = [decoder decodeObjectForKey:WebResourceFrameNameKey]; if ([object isKindOfClass:[NSString class]]) frameName = object; object = [decoder decodeObjectForKey:WebResourceResponseKey]; if ([object isKindOfClass:[NSURLResponse class]]) response = object; } @catch(id) { [self release]; return nil; } _private = [[WebResourcePrivate alloc] initWithCoreResource:ArchiveResource::create(SharedBuffer::wrapNSData(data), url, mimeType, textEncoding, frameName, response)]; return self; } - (void)encodeWithCoder:(NSCoder *)encoder { ArchiveResource *resource = _private->coreResource; NSData *data = nil; NSURL *url = nil; NSString *mimeType = nil, *textEncoding = nil, *frameName = nil; NSURLResponse *response = nil; if (resource) { if (resource->data()) data = [resource->data()->createNSData() autorelease]; url = resource->url(); mimeType = resource->mimeType(); textEncoding = resource->textEncoding(); frameName = resource->frameName(); response = resource->response().nsURLResponse(); } [encoder encodeObject:data forKey:WebResourceDataKey]; [encoder encodeObject:url forKey:WebResourceURLKey]; [encoder encodeObject:mimeType forKey:WebResourceMIMETypeKey]; [encoder encodeObject:textEncoding forKey:WebResourceTextEncodingNameKey]; [encoder encodeObject:frameName forKey:WebResourceFrameNameKey]; [encoder encodeObject:response forKey:WebResourceResponseKey]; } - (void)dealloc { [_private release]; [super dealloc]; } - (id)copyWithZone:(NSZone *)zone { return [self retain]; } - (NSData *)data { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) return [[self _webkit_invokeOnMainThread] data]; #endif WebCoreThreadViolationCheckRoundTwo(); if (!_private->coreResource) return nil; if (!_private->coreResource->data()) return nil; return [_private->coreResource->data()->createNSData() autorelease]; } - (NSURL *)URL { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) return [[self _webkit_invokeOnMainThread] URL]; #endif WebCoreThreadViolationCheckRoundTwo(); if (!_private->coreResource) return nil; NSURL *url = _private->coreResource->url(); return url; } - (NSString *)MIMEType { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) return [[self _webkit_invokeOnMainThread] MIMEType]; #endif WebCoreThreadViolationCheckRoundTwo(); if (!_private->coreResource) return nil; NSString *mimeType = _private->coreResource->mimeType(); return mimeType; } - (NSString *)textEncodingName { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) return [[self _webkit_invokeOnMainThread] textEncodingName]; #endif WebCoreThreadViolationCheckRoundTwo(); if (!_private->coreResource) return nil; NSString *textEncodingName = _private->coreResource->textEncoding(); return textEncodingName; } - (NSString *)frameName { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) return [[self _webkit_invokeOnMainThread] frameName]; #endif WebCoreThreadViolationCheckRoundTwo(); if (!_private->coreResource) return nil; NSString *frameName = _private->coreResource->frameName(); return frameName; } - (id)description { return [NSString stringWithFormat:@"<%@ %@>", [self className], [self URL]]; } @end @implementation WebResource (WebResourceInternal) - (id)_initWithCoreResource:(PassRefPtr<ArchiveResource>)coreResource { self = [super init]; if (!self) return nil; ASSERT(coreResource); // WebResources should not be init'ed with nil data, and doing so breaks certain uses of NSHTMLReader // See <rdar://problem/5820157> for more info if (!coreResource->data()) { [self release]; return nil; } _private = [[WebResourcePrivate alloc] initWithCoreResource:coreResource]; return self; } - (WebCore::ArchiveResource *)_coreResource { return _private->coreResource; } @end @implementation WebResource (WebResourcePrivate) // SPI for Mail (5066325) // FIXME: This "ignoreWhenUnarchiving" concept is an ugly one - can we find a cleaner solution for those who need this SPI? - (void)_ignoreWhenUnarchiving { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) { [[self _webkit_invokeOnMainThread] _ignoreWhenUnarchiving]; return; } #endif WebCoreThreadViolationCheckRoundTwo(); if (!_private->coreResource) return; _private->coreResource->ignoreWhenUnarchiving(); } - (id)_initWithData:(NSData *)data URL:(NSURL *)URL MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName frameName:(NSString *)frameName response:(NSURLResponse *)response copyData:(BOOL)copyData { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) return [[self _webkit_invokeOnMainThread] _initWithData:data URL:URL MIMEType:MIMEType textEncodingName:textEncodingName frameName:frameName response:response copyData:copyData]; #endif WebCoreThreadViolationCheckRoundTwo(); self = [super init]; if (!self) return nil; if (!data || !URL || !MIMEType) { [self release]; return nil; } _private = [[WebResourcePrivate alloc] initWithCoreResource:ArchiveResource::create(SharedBuffer::wrapNSData(copyData ? [[data copy] autorelease] : data), URL, MIMEType, textEncodingName, frameName, response)]; return self; } - (id)_initWithData:(NSData *)data URL:(NSURL *)URL response:(NSURLResponse *)response { // Pass NO for copyData since the data doesn't need to be copied since we know that callers will no longer modify it. // Copying it will also cause a performance regression. return [self _initWithData:data URL:URL MIMEType:[response MIMEType] textEncodingName:[response textEncodingName] frameName:nil response:response copyData:NO]; } - (NSString *)_suggestedFilename { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) return [[self _webkit_invokeOnMainThread] _suggestedFilename]; #endif WebCoreThreadViolationCheckRoundTwo(); if (!_private->coreResource) return nil; NSString *suggestedFilename = _private->coreResource->response().suggestedFilename(); return suggestedFilename; } - (NSFileWrapper *)_fileWrapperRepresentation { NSFileWrapper *wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:[self data]] autorelease]; NSString *filename = [self _suggestedFilename]; if (!filename || ![filename length]) filename = [[self URL] _webkit_suggestedFilenameWithMIMEType:[self MIMEType]]; [wrapper setPreferredFilename:filename]; return wrapper; } - (NSURLResponse *)_response { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) return [[self _webkit_invokeOnMainThread] _response]; #endif WebCoreThreadViolationCheckRoundTwo(); NSURLResponse *response = nil; if (_private->coreResource) response = _private->coreResource->response().nsURLResponse(); return response ? response : [[[NSURLResponse alloc] init] autorelease]; } - (NSString *)_stringValue { #ifdef MAIL_THREAD_WORKAROUND if (needMailThreadWorkaround()) return [[self _webkit_invokeOnMainThread] _stringValue]; #endif WebCoreThreadViolationCheckRoundTwo(); WebCore::TextEncoding encoding; if (_private->coreResource) encoding = _private->coreResource->textEncoding(); if (!encoding.isValid()) encoding = WindowsLatin1Encoding(); SharedBuffer* coreData = _private->coreResource ? _private->coreResource->data() : 0; return encoding.decode(reinterpret_cast<const char*>(coreData ? coreData->data() : 0), coreData ? coreData->size() : 0); } @end #ifdef MAIL_THREAD_WORKAROUND static const double newMailBundleVersion = 1050.0; @implementation WebResource (WebMailThreadWorkaround) + (BOOL)_needMailThreadWorkaroundIfCalledOffMainThread { static BOOL isOldMail = applicationIsAppleMail() && [[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey] doubleValue] < newMailBundleVersion; return isOldMail; } @end #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebScriptDebugDelegate.mm��������������������������������������������������������0000644�0001750�0001750�00000021154�11233422436�017311� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebDataSource.h" #import "WebDataSourceInternal.h" #import "WebFrameInternal.h" #import "WebScriptDebugDelegate.h" #import "WebScriptDebugger.h" #import "WebViewInternal.h" #import <WebCore/Frame.h> #import <WebCore/ScriptController.h> #import <WebCore/WebScriptObjectPrivate.h> #import <WebCore/runtime_root.h> #import <debugger/Debugger.h> #import <debugger/DebuggerActivation.h> #import <debugger/DebuggerCallFrame.h> #import <interpreter/CallFrame.h> #import <runtime/Completion.h> #import <runtime/JSFunction.h> #import <runtime/JSGlobalObject.h> #import <runtime/JSLock.h> using namespace JSC; using namespace WebCore; // FIXME: these error strings should be public for future use by WebScriptObject and in WebScriptObject.h NSString * const WebScriptErrorDomain = @"WebScriptErrorDomain"; NSString * const WebScriptErrorDescriptionKey = @"WebScriptErrorDescription"; NSString * const WebScriptErrorLineNumberKey = @"WebScriptErrorLineNumber"; @interface WebScriptCallFrame (WebScriptDebugDelegateInternal) - (id)_convertValueToObjcValue:(JSValue)value; @end @interface WebScriptCallFramePrivate : NSObject { @public WebScriptObject *globalObject; // the global object's proxy (not retained) WebScriptCallFrame *caller; // previous stack frame DebuggerCallFrame* debuggerCallFrame; WebScriptDebugger* debugger; } @end @implementation WebScriptCallFramePrivate - (void)dealloc { [caller release]; delete debuggerCallFrame; [super dealloc]; } @end // WebScriptCallFrame // // One of these is created to represent each stack frame. Additionally, there is a "global" // frame to represent the outermost scope. This global frame is always the last frame in // the chain of callers. // // The delegate can assign a "wrapper" to each frame object so it can relay calls through its // own exported interface. This class is private to WebCore (and the delegate). @implementation WebScriptCallFrame (WebScriptDebugDelegateInternal) - (WebScriptCallFrame *)_initWithGlobalObject:(WebScriptObject *)globalObj debugger:(WebScriptDebugger *)debugger caller:(WebScriptCallFrame *)caller debuggerCallFrame:(const DebuggerCallFrame&)debuggerCallFrame { if ((self = [super init])) { _private = [[WebScriptCallFramePrivate alloc] init]; _private->globalObject = globalObj; _private->caller = [caller retain]; _private->debugger = debugger; } return self; } - (void)_setDebuggerCallFrame:(const DebuggerCallFrame&)debuggerCallFrame { if (!_private->debuggerCallFrame) _private->debuggerCallFrame = new DebuggerCallFrame(debuggerCallFrame); else *_private->debuggerCallFrame = debuggerCallFrame; } - (void)_clearDebuggerCallFrame { delete _private->debuggerCallFrame; _private->debuggerCallFrame = 0; } - (id)_convertValueToObjcValue:(JSValue)value { if (!value) return nil; WebScriptObject *globalObject = _private->globalObject; if (value == [globalObject _imp]) return globalObject; Bindings::RootObject* root1 = [globalObject _originRootObject]; if (!root1) return nil; Bindings::RootObject* root2 = [globalObject _rootObject]; if (!root2) return nil; return [WebScriptObject _convertValueToObjcValue:value originRootObject:root1 rootObject:root2]; } @end @implementation WebScriptCallFrame - (void) dealloc { [_userInfo release]; [_private release]; [super dealloc]; } - (void)setUserInfo:(id)userInfo { if (userInfo != _userInfo) { [_userInfo release]; _userInfo = [userInfo retain]; } } - (id)userInfo { return _userInfo; } - (WebScriptCallFrame *)caller { return _private->caller; } // Returns an array of scope objects (most local first). // The properties of each scope object are the variables for that scope. // Note that the last entry in the array will _always_ be the global object (windowScriptObject), // whose properties are the global variables. - (NSArray *)scopeChain { if (!_private->debuggerCallFrame) return [NSArray array]; JSLock lock(SilenceAssertionsOnly); const ScopeChainNode* scopeChain = _private->debuggerCallFrame->scopeChain(); if (!scopeChain->next) // global frame return [NSArray arrayWithObject:_private->globalObject]; NSMutableArray *scopes = [[NSMutableArray alloc] init]; ScopeChainIterator end = scopeChain->end(); for (ScopeChainIterator it = scopeChain->begin(); it != end; ++it) { JSObject* object = *it; if (object->isActivationObject()) object = new (scopeChain->globalData) DebuggerActivation(object); [scopes addObject:[self _convertValueToObjcValue:object]]; } NSArray *result = [NSArray arrayWithArray:scopes]; [scopes release]; return result; } // Returns the name of the function for this frame, if available. // Returns nil for anonymous functions and for the global frame. - (NSString *)functionName { if (!_private->debuggerCallFrame) return nil; const UString* functionName = _private->debuggerCallFrame->functionName(); return functionName ? toNSString(*functionName) : nil; } // Returns the pending exception for this frame (nil if none). - (id)exception { if (!_private->debuggerCallFrame) return nil; JSValue exception = _private->debuggerCallFrame->exception(); return exception ? [self _convertValueToObjcValue:exception] : nil; } // Evaluate some JavaScript code in the context of this frame. // The code is evaluated as if by "eval", and the result is returned. // If there is an (uncaught) exception, it is returned as though _it_ were the result. // Calling this method on the global frame is not quite the same as calling the WebScriptObject // method of the same name, due to the treatment of exceptions. - (id)evaluateWebScript:(NSString *)script { if (!_private->debuggerCallFrame) return nil; JSLock lock(SilenceAssertionsOnly); // If this is the global call frame and there is no dynamic global object, // Dashcode is attempting to execute JS in the evaluator using a stale // WebScriptCallFrame. Instead, we need to set the dynamic global object // and evaluate the JS in the global object's global call frame. JSGlobalObject* globalObject = _private->debugger->globalObject(); if (self == _private->debugger->globalCallFrame() && !globalObject->globalData()->dynamicGlobalObject) { JSGlobalObject* globalObject = _private->debugger->globalObject(); DynamicGlobalObjectScope globalObjectScope(globalObject->globalExec(), globalObject); JSValue exception; JSValue result = evaluateInGlobalCallFrame(String(script), exception, globalObject); if (exception) return [self _convertValueToObjcValue:exception]; return result ? [self _convertValueToObjcValue:result] : nil; } JSValue exception; JSValue result = _private->debuggerCallFrame->evaluate(String(script), exception); if (exception) return [self _convertValueToObjcValue:exception]; return result ? [self _convertValueToObjcValue:result] : nil; } @end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebPolicyDelegate.mm�������������������������������������������������������������0000644�0001750�0001750�00000006441�11024565362�016343� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebPolicyDelegatePrivate.h" #import <WebCore/FrameLoaderTypes.h> #import <objc/objc-runtime.h> using namespace WebCore; NSString *WebActionButtonKey = @"WebActionButtonKey"; NSString *WebActionElementKey = @"WebActionElementKey"; NSString *WebActionFormKey = @"WebActionFormKey"; NSString *WebActionModifierFlagsKey = @"WebActionModifierFlagsKey"; NSString *WebActionNavigationTypeKey = @"WebActionNavigationTypeKey"; NSString *WebActionOriginalURLKey = @"WebActionOriginalURLKey"; @interface WebPolicyDecisionListenerPrivate : NSObject { @public id target; SEL action; } - (id)initWithTarget:(id)target action:(SEL)action; @end @implementation WebPolicyDecisionListenerPrivate - (id)initWithTarget:(id)t action:(SEL)a { self = [super init]; if (!self) return nil; target = [t retain]; action = a; return self; } - (void)dealloc { [target release]; [super dealloc]; } @end @implementation WebPolicyDecisionListener - (id)_initWithTarget:(id)target action:(SEL)action { self = [super init]; if (!self) return nil; _private = [[WebPolicyDecisionListenerPrivate alloc] initWithTarget:target action:action]; return self; } -(void)dealloc { [_private release]; [super dealloc]; } - (void)_usePolicy:(PolicyAction)policy { if (_private->target) ((void (*)(id, SEL, PolicyAction))objc_msgSend)(_private->target, _private->action, policy); } - (void)_invalidate { id target = _private->target; _private->target = nil; [target release]; } // WebPolicyDecisionListener implementation - (void)use { [self _usePolicy:PolicyUse]; } - (void)ignore { [self _usePolicy:PolicyIgnore]; } - (void)download { [self _usePolicy:PolicyDownload]; } @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebDocument.h��������������������������������������������������������������������0000644�0001750�0001750�00000015012�10360512352�015030� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003, 2004, 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> @class NSError; @class WebDataSource; /*! @protocol WebDocumentView @discussion Protocol implemented by the document view of WebFrameView */ @protocol WebDocumentView <NSObject> /*! @method setDataSource: @abstract Called when the corresponding data source has been created. @param dataSource The corresponding data source. */ - (void)setDataSource:(WebDataSource *)dataSource; /*! @method dataSourceUpdated: @abstract Called when the corresponding data source has received data. @param dataSource The corresponding data source. */ - (void)dataSourceUpdated:(WebDataSource *)dataSource; /*! @method setNeedsLayout: @discussion Called when WebKit has determined that the document view needs to layout. This method should simply set a flag and call layout from drawRect if the flag is YES. @param flag YES to cause a layout, no to not cause a layout. */ - (void)setNeedsLayout:(BOOL)flag; /*! @method layout @discussion Called when the document view must immediately layout. For simple views, setting the frame is a sufficient implementation of this method. */ - (void)layout; /*! @method viewWillMoveToHostWindow: @param hostWindow The host window for the document view. @abstract Called before the host window is set on the parent web view. */ - (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow; /*! @method viewDidMoveToHostWindow @abstract Called after the host window is set on the parent web view. */ - (void)viewDidMoveToHostWindow; @end /*! @protocol WebDocumentSearching @discussion Optional protocol for searching document view of WebFrameView. */ @protocol WebDocumentSearching <NSObject> /*! @method searchFor:direction:caseSensitive:wrap: @abstract Searches a document view for a string and highlights the string if it is found. @param string The string to search for. @param forward YES to search forward, NO to seach backwards. @param caseFlag YES to for case-sensitive search, NO for case-insensitive search. @param wrapFlag YES to wrap around, NO to avoid wrapping. @result YES if found, NO if not found. */ - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag; @end /*! @protocol WebDocumentText @discussion Optional protocol for supporting text operations. */ @protocol WebDocumentText <NSObject> /*! @method supportsTextEncoding @result YES if the document view support text encoding, NO if it doesn't. */ - (BOOL)supportsTextEncoding; /*! @method string @result String that represents the entire document. */ - (NSString *)string; /*! @method attributedString @result Attributed string that represents the entire document. */ - (NSAttributedString *)attributedString; /*! @method selectedString @result String that represents the current selection. */ - (NSString *)selectedString; /*! @method selectedAttributedString @result Attributed string that represents the current selection. */ - (NSAttributedString *)selectedAttributedString; /*! @method selectAll @abstract Selects all the text in the document. */ - (void)selectAll; /*! @method deselectText @abstract Causes a text selection to lose its selection. */ - (void)deselectAll; @end /*! @protocol WebDocumentRepresentation @discussion Protocol implemented by the document representation of a data source. */ @protocol WebDocumentRepresentation <NSObject> /*! @method setDataSource: @abstract Called soon after the document representation is created. @param dataSource The data source that is set. */ - (void)setDataSource:(WebDataSource *)dataSource; /*! @method receivedData:withDataSource: @abstract Called when the data source has received data. @param data The data that the data source has received. @param dataSource The data source that has received data. */ - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource; /*! @method receivedError:withDataSource: @abstract Called when the data source has received an error. @param error The error that the data source has received. @param dataSource The data source that has received the error. */ - (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource; /*! @method finishedLoadingWithDataSource: @abstract Called when the data source has finished loading. @param dataSource The datasource that has finished loading. */ - (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource; /*! @method canProvideDocumentSource @result Returns true if the representation can provide document source. */ - (BOOL)canProvideDocumentSource; /*! @method documentSource @result Returns the textual source representation of the document. For HTML documents this is the original HTML source. */ - (NSString *)documentSource; /*! @method title @result Return the title for the document. */ - (NSString *)title; @end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebArchive.h���������������������������������������������������������������������0000644�0001750�0001750�00000007565�10360512352�014651� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2004, 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> @class WebArchivePrivate; @class WebResource; /*! @const WebArchivePboardType @abstract The pasteboard type constant used when adding or accessing a WebArchive on the pasteboard. */ extern NSString *WebArchivePboardType; /*! @class WebArchive @discussion WebArchive represents a main resource as well as all the subresources and subframes associated with the main resource. The main resource can be an entire web page, a portion of a web page, or some other kind of data such as an image. This class can be used for saving standalone web pages, representing portions of a web page on the pasteboard, or any other application where one class is needed to represent rich web content. */ @interface WebArchive : NSObject <NSCoding, NSCopying> { @private WebArchivePrivate *_private; } /*! @method initWithMainResource:subresources:subframeArchives: @abstract The initializer for WebArchive. @param mainResource The main resource of the archive. @param subresources The subresources of the archive (can be nil). @param subframeArchives The archives representing the subframes of the archive (can be nil). @result An initialized WebArchive. */ - (id)initWithMainResource:(WebResource *)mainResource subresources:(NSArray *)subresources subframeArchives:(NSArray *)subframeArchives; /*! @method initWithData: @abstract The initializer for creating a WebArchive from data. @param data The data representing the archive. This can be obtained using WebArchive's data method. @result An initialized WebArchive. */ - (id)initWithData:(NSData *)data; /*! @method mainResource @result The main resource of the archive. */ - (WebResource *)mainResource; /*! @method subresources @result The subresource of the archive (can be nil). */ - (NSArray *)subresources; /*! @method subframeArchives @result The archives representing the subframes of the archive (can be nil). */ - (NSArray *)subframeArchives; /*! @method data @result The data representation of the archive. @discussion The data returned by this method can be used to save a web archive to a file or to place a web archive on the pasteboard using WebArchivePboardType. To create a WebArchive using the returned data, call initWithData:. */ - (NSData *)data; @end �������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebResourceLoadDelegatePrivate.h�������������������������������������������������0000644�0001750�0001750�00000004273�11122647234�020643� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 #define WebNSInteger int #else #define WebNSInteger NSInteger #endif @class WebView; @class WebDataSource; @class NSURLAuthenticationChallenge; @class NSURLResponse; @class NSURLRequest; @interface NSObject (WebResourceLoadDelegatePrivate) - (void)webView:(WebView *)webView didLoadResourceFromMemoryCache:(NSURLRequest *)request response:(NSURLResponse *)response length:(WebNSInteger)length fromDataSource:(WebDataSource *)dataSource; - (BOOL)webView:(WebView *)webView resource:(id)identifier shouldUseCredentialStorageForDataSource:(WebDataSource *)dataSource; @end #undef WebNSInteger �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebDynamicScrollBarsView.mm������������������������������������������������������0000644�0001750�0001750�00000031774�11256475154�017674� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebDynamicScrollBarsViewInternal.h" #import "WebDocument.h" #import "WebFrameInternal.h" #import "WebFrameView.h" #import "WebHTMLViewInternal.h" #import <WebCore/Frame.h> #import <WebCore/FrameView.h> #import <WebKitSystemInterface.h> using namespace WebCore; // FIXME: <rdar://problem/5898985> Mail expects a constant of this name to exist. const int WebCoreScrollbarAlwaysOn = ScrollbarAlwaysOn; @implementation WebDynamicScrollBarsView - (void)setAllowsHorizontalScrolling:(BOOL)flag { if (hScrollModeLocked) return; if (flag && hScroll == ScrollbarAlwaysOff) hScroll = ScrollbarAuto; else if (!flag && hScroll != ScrollbarAlwaysOff) hScroll = ScrollbarAlwaysOff; [self updateScrollers]; } @end @implementation WebDynamicScrollBarsView (WebInternal) - (void)setSuppressLayout:(BOOL)flag; { suppressLayout = flag; } - (void)setScrollBarsSuppressed:(BOOL)suppressed repaintOnUnsuppress:(BOOL)repaint { suppressScrollers = suppressed; // This code was originally changes for a Leopard performance imporvement. We decided to // ifdef it to fix correctness issues on Tiger documented in <rdar://problem/5441823>. #ifndef BUILDING_ON_TIGER if (suppressed) { [[self verticalScroller] setNeedsDisplay:NO]; [[self horizontalScroller] setNeedsDisplay:NO]; } if (!suppressed && repaint) [super reflectScrolledClipView:[self contentView]]; #else if (suppressed || repaint) { [[self verticalScroller] setNeedsDisplay: !suppressed]; [[self horizontalScroller] setNeedsDisplay: !suppressed]; } #endif } static const unsigned cMaxUpdateScrollbarsPass = 2; - (void)updateScrollers { NSView *documentView = [self documentView]; // If we came in here with the view already needing a layout, then go ahead and do that // first. (This will be the common case, e.g., when the page changes due to window resizing for example). // This layout will not re-enter updateScrollers and does not count towards our max layout pass total. if (!suppressLayout && !suppressScrollers && [documentView isKindOfClass:[WebHTMLView class]]) { WebHTMLView* htmlView = (WebHTMLView*)documentView; if ([htmlView _needsLayout]) { inUpdateScrollers = YES; [(id <WebDocumentView>)documentView layout]; inUpdateScrollers = NO; } } BOOL hasHorizontalScroller = [self hasHorizontalScroller]; BOOL hasVerticalScroller = [self hasVerticalScroller]; BOOL newHasHorizontalScroller = hasHorizontalScroller; BOOL newHasVerticalScroller = hasVerticalScroller; if (!documentView) { newHasHorizontalScroller = NO; newHasVerticalScroller = NO; } if (hScroll != ScrollbarAuto) newHasHorizontalScroller = (hScroll == ScrollbarAlwaysOn); if (vScroll != ScrollbarAuto) newHasVerticalScroller = (vScroll == ScrollbarAlwaysOn); if (!documentView || suppressLayout || suppressScrollers || (hScroll != ScrollbarAuto && vScroll != ScrollbarAuto)) { inUpdateScrollers = YES; if (hasHorizontalScroller != newHasHorizontalScroller) [self setHasHorizontalScroller:newHasHorizontalScroller]; if (hasVerticalScroller != newHasVerticalScroller) [self setHasVerticalScroller:newHasVerticalScroller]; if (suppressScrollers) { [[self verticalScroller] setNeedsDisplay:NO]; [[self horizontalScroller] setNeedsDisplay:NO]; } inUpdateScrollers = NO; return; } BOOL needsLayout = NO; NSSize documentSize = [documentView frame].size; NSSize visibleSize = [self documentVisibleRect].size; NSSize frameSize = [self frame].size; if (hScroll == ScrollbarAuto) { newHasHorizontalScroller = documentSize.width > visibleSize.width; if (newHasHorizontalScroller && !inUpdateScrollersLayoutPass && documentSize.height <= frameSize.height && documentSize.width <= frameSize.width) newHasHorizontalScroller = NO; } if (vScroll == ScrollbarAuto) { newHasVerticalScroller = documentSize.height > visibleSize.height; if (newHasVerticalScroller && !inUpdateScrollersLayoutPass && documentSize.height <= frameSize.height && documentSize.width <= frameSize.width) newHasVerticalScroller = NO; } // Unless in ScrollbarsAlwaysOn mode, if we ever turn one scrollbar off, always turn the other one off too. // Never ever try to both gain/lose a scrollbar in the same pass. if (!newHasHorizontalScroller && hasHorizontalScroller && vScroll != ScrollbarAlwaysOn) newHasVerticalScroller = NO; if (!newHasVerticalScroller && hasVerticalScroller && hScroll != ScrollbarAlwaysOn) newHasHorizontalScroller = NO; if (hasHorizontalScroller != newHasHorizontalScroller) { inUpdateScrollers = YES; [self setHasHorizontalScroller:newHasHorizontalScroller]; inUpdateScrollers = NO; needsLayout = YES; } if (hasVerticalScroller != newHasVerticalScroller) { inUpdateScrollers = YES; [self setHasVerticalScroller:newHasVerticalScroller]; inUpdateScrollers = NO; needsLayout = YES; } if (needsLayout && inUpdateScrollersLayoutPass < cMaxUpdateScrollbarsPass && [documentView conformsToProtocol:@protocol(WebDocumentView)]) { inUpdateScrollersLayoutPass++; [(id <WebDocumentView>)documentView setNeedsLayout:YES]; [(id <WebDocumentView>)documentView layout]; NSSize newDocumentSize = [documentView frame].size; if (NSEqualSizes(documentSize, newDocumentSize)) { // The layout with the new scroll state had no impact on // the document's overall size, so updateScrollers didn't get called. // Recur manually. [self updateScrollers]; } inUpdateScrollersLayoutPass--; } } // Make the horizontal and vertical scroll bars come and go as needed. - (void)reflectScrolledClipView:(NSClipView *)clipView { if (clipView == [self contentView]) { // FIXME: This hack here prevents infinite recursion that takes place when we // gyrate between having a vertical scroller and not having one. A reproducible // case is clicking on the "the Policy Routing text" link at // http://www.linuxpowered.com/archive/howto/Net-HOWTO-8.html. // The underlying cause is some problem in the NSText machinery, but I was not // able to pin it down. NSGraphicsContext *currentContext = [NSGraphicsContext currentContext]; if (!inUpdateScrollers && (!currentContext || [currentContext isDrawingToScreen])) [self updateScrollers]; } // This code was originally changed for a Leopard performance imporvement. We decided to // ifdef it to fix correctness issues on Tiger documented in <rdar://problem/5441823>. #ifndef BUILDING_ON_TIGER // Update the scrollers if they're not being suppressed. if (!suppressScrollers) [super reflectScrolledClipView:clipView]; #else [super reflectScrolledClipView:clipView]; // Validate the scrollers if they're being suppressed. if (suppressScrollers) { [[self verticalScroller] setNeedsDisplay: NO]; [[self horizontalScroller] setNeedsDisplay: NO]; } #endif #if USE(ACCELERATED_COMPOSITING) && defined(BUILDING_ON_LEOPARD) NSView *documentView = [self documentView]; if ([documentView isKindOfClass:[WebHTMLView class]]) { WebHTMLView *htmlView = (WebHTMLView *)documentView; if ([htmlView _isUsingAcceleratedCompositing]) [htmlView _updateLayerHostingViewPosition]; } #endif } - (BOOL)allowsHorizontalScrolling { return hScroll != ScrollbarAlwaysOff; } - (BOOL)allowsVerticalScrolling { return vScroll != ScrollbarAlwaysOff; } - (void)scrollingModes:(WebCore::ScrollbarMode*)hMode vertical:(WebCore::ScrollbarMode*)vMode { *hMode = static_cast<ScrollbarMode>(hScroll); *vMode = static_cast<ScrollbarMode>(vScroll); } - (ScrollbarMode)horizontalScrollingMode { return static_cast<ScrollbarMode>(hScroll); } - (ScrollbarMode)verticalScrollingMode { return static_cast<ScrollbarMode>(vScroll); } - (void)setHorizontalScrollingMode:(ScrollbarMode)horizontalMode andLock:(BOOL)lock { [self setScrollingModes:horizontalMode vertical:[self verticalScrollingMode] andLock:lock]; } - (void)setVerticalScrollingMode:(ScrollbarMode)verticalMode andLock:(BOOL)lock { [self setScrollingModes:[self horizontalScrollingMode] vertical:verticalMode andLock:lock]; } // Mail uses this method, so we cannot remove it. - (void)setVerticalScrollingMode:(ScrollbarMode)verticalMode { [self setScrollingModes:[self horizontalScrollingMode] vertical:verticalMode andLock:NO]; } - (void)setScrollingModes:(ScrollbarMode)horizontalMode vertical:(ScrollbarMode)verticalMode andLock:(BOOL)lock { BOOL update = NO; if (verticalMode != vScroll && !vScrollModeLocked) { vScroll = verticalMode; update = YES; } if (horizontalMode != hScroll && !hScrollModeLocked) { hScroll = horizontalMode; update = YES; } if (lock) [self setScrollingModesLocked:YES]; if (update) [self updateScrollers]; } - (void)setHorizontalScrollingModeLocked:(BOOL)locked { hScrollModeLocked = locked; } - (void)setVerticalScrollingModeLocked:(BOOL)locked { vScrollModeLocked = locked; } - (void)setScrollingModesLocked:(BOOL)locked { hScrollModeLocked = vScrollModeLocked = locked; } - (BOOL)horizontalScrollingModeLocked { return hScrollModeLocked; } - (BOOL)verticalScrollingModeLocked { return vScrollModeLocked; } - (BOOL)autoforwardsScrollWheelEvents { return YES; } - (void)scrollWheel:(NSEvent *)event { float deltaX; float deltaY; BOOL isContinuous; WKGetWheelEventDeltas(event, &deltaX, &deltaY, &isContinuous); BOOL isLatchingEvent = WKIsLatchingWheelEvent(event); if (fabsf(deltaY) > fabsf(deltaX)) { if (![self allowsVerticalScrolling]) { [[self nextResponder] scrollWheel:event]; return; } if (isLatchingEvent && !verticallyPinnedByPreviousWheelEvent) { double verticalPosition = [[self verticalScroller] doubleValue]; if ((deltaY >= 0.0 && verticalPosition == 0.0) || (deltaY <= 0.0 && verticalPosition == 1.0)) return; } } else { if (![self allowsHorizontalScrolling]) { [[self nextResponder] scrollWheel:event]; return; } if (isLatchingEvent && !horizontallyPinnedByPreviousWheelEvent) { double horizontalPosition = [[self horizontalScroller] doubleValue]; if ((deltaX >= 0.0 && horizontalPosition == 0.0) || (deltaX <= 0.0 && horizontalPosition == 1.0)) return; } } [super scrollWheel:event]; if (!isLatchingEvent) { double verticalPosition = [[self verticalScroller] doubleValue]; double horizontalPosition = [[self horizontalScroller] doubleValue]; verticallyPinnedByPreviousWheelEvent = (verticalPosition == 0.0 || verticalPosition == 1.0); horizontallyPinnedByPreviousWheelEvent = (horizontalPosition == 0.0 || horizontalPosition == 1.0); } } - (BOOL)accessibilityIsIgnored { id docView = [self documentView]; if ([docView isKindOfClass:[WebFrameView class]] && ![(WebFrameView *)docView allowsScrolling]) return YES; return [super accessibilityIsIgnored]; } @end ����WebKit/mac/WebView/WebResourcePrivate.h�������������������������������������������������������������0000644�0001750�0001750�00000004204�10772231064�016402� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebResource.h> @interface WebResource (WebResourcePrivate) - (id)_initWithData:(NSData *)data URL:(NSURL *)URL MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)textEncodingName frameName:(NSString *)frameName response:(NSURLResponse *)response copyData:(BOOL)copyData; - (id)_initWithData:(NSData *)data URL:(NSURL *)URL response:(NSURLResponse *)response; - (void)_ignoreWhenUnarchiving; - (NSFileWrapper *)_fileWrapperRepresentation; - (NSURLResponse *)_response; - (NSString *)_stringValue; @end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebRenderNode.h������������������������������������������������������������������0000644�0001750�0001750�00000003676�11237072047�015322� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> @class WebFrame; @interface WebRenderNode : NSObject { NSArray *children; NSString *name; NSRect rect; NSPoint absolutePosition; } - (id)initWithWebFrame:(WebFrame *)frame; - (NSArray *)children; - (NSString *)name; - (NSString *)positionString; - (NSString *)absolutePositionString; - (NSString *)widthString; - (NSString *)heightString; @end ������������������������������������������������������������������WebKit/mac/WebView/WebFrame.h�����������������������������������������������������������������������0000644�0001750�0001750�00000017277�11121474144�014325� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003, 2004, 2005, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> #import <JavaScriptCore/JSBase.h> @class DOMDocument; @class DOMHTMLElement; @class NSURLRequest; @class WebArchive; @class WebDataSource; @class WebFramePrivate; @class WebFrameView; @class WebScriptObject; @class WebView; /*! @class WebFrame @discussion Every web page is represented by at least one WebFrame. A WebFrame has a WebFrameView and a WebDataSource. */ @interface WebFrame : NSObject { @private WebFramePrivate *_private; } /*! @method initWithName:webFrameView:webView: @abstract The designated initializer of WebFrame. @discussion WebFrames are normally created for you by the WebView. You should not need to invoke this method directly. @param name The name of the frame. @param view The WebFrameView for the frame. @param webView The WebView that manages the frame. @result Returns an initialized WebFrame. */ - (id)initWithName:(NSString *)name webFrameView:(WebFrameView *)view webView:(WebView *)webView; /*! @method name @result The frame name. */ - (NSString *)name; /*! @method webView @result Returns the WebView for the document that includes this frame. */ - (WebView *)webView; /*! @method frameView @result The WebFrameView for this frame. */ - (WebFrameView *)frameView; /*! @method DOMDocument @abstract Returns the DOM document of the frame. @description Returns nil if the frame does not contain a DOM document such as a standalone image. */ - (DOMDocument *)DOMDocument; /*! @method frameElement @abstract Returns the frame element of the frame. @description The class of the result is either DOMHTMLFrameElement, DOMHTMLIFrameElement or DOMHTMLObjectElement. Returns nil if the frame is the main frame since there is no frame element for the frame in this case. */ - (DOMHTMLElement *)frameElement; /*! @method loadRequest: @param request The web request to load. */ - (void)loadRequest:(NSURLRequest *)request; /*! @method loadData:MIMEType:textEncodingName:baseURL: @param data The data to use for the main page of the document. @param MIMEType The MIME type of the data. @param encodingName The encoding of the data. @param URL The base URL to apply to relative URLs within the document. */ - (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)URL; /*! @method loadHTMLString:baseURL: @param string The string to use for the main page of the document. @param URL The base URL to apply to relative URLs within the document. */ - (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)URL; /*! @method loadAlternateHTMLString:baseURL:forUnreachableURL: @abstract Loads a page to display as a substitute for a URL that could not be reached. @discussion This allows clients to display page-loading errors in the webview itself. This is typically called while processing the WebFrameLoadDelegate method -webView:didFailProvisionalLoadWithError:forFrame: or one of the the WebPolicyDelegate methods -webView:decidePolicyForMIMEType:request:frame:decisionListener: or -webView:unableToImplementPolicyWithError:frame:. If it is called from within one of those three delegate methods then the back/forward list will be maintained appropriately. @param string The string to use for the main page of the document. @param baseURL The baseURL to apply to relative URLs within the document. @param unreachableURL The URL for which this page will serve as alternate content. */ - (void)loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL; /*! @method loadArchive: @abstract Causes WebFrame to load a WebArchive. @param archive The archive to be loaded. */ - (void)loadArchive:(WebArchive *)archive; /*! @method dataSource @discussion Returns the committed data source. Will return nil if the provisional data source hasn't yet been loaded. @result The datasource for this frame. */ - (WebDataSource *)dataSource; /*! @method provisionalDataSource @discussion Will return the provisional data source. The provisional data source will be nil if no data source has been set on the frame, or the data source has successfully transitioned to the committed data source. @result The provisional datasource of this frame. */ - (WebDataSource *)provisionalDataSource; /*! @method stopLoading @discussion Stop any pending loads on the frame's data source, and its children. */ - (void)stopLoading; /*! @method reload @discussion Performs HTTP/1.1 end-to-end revalidation using cache-validating conditionals if possible. */ - (void)reload; /*! @method reloadFromOrigin @discussion Performs HTTP/1.1 end-to-end reload. */ - (void)reloadFromOrigin; /*! @method findFrameNamed: @discussion This method returns a frame with the given name. findFrameNamed returns self for _self and _current, the parent frame for _parent and the main frame for _top. findFrameNamed returns self for _parent and _top if the receiver is the mainFrame. findFrameNamed first searches from the current frame to all descending frames then the rest of the frames in the WebView. If still not found, findFrameNamed searches the frames of the other WebViews. @param name The name of the frame to find. @result The frame matching the provided name. nil if the frame is not found. */ - (WebFrame *)findFrameNamed:(NSString *)name; /*! @method parentFrame @result The frame containing this frame, or nil if this is a top level frame. */ - (WebFrame *)parentFrame; /*! @method childFrames @discussion The frames in the array are associated with a frame set or iframe. @result Returns an array of WebFrame. */ - (NSArray *)childFrames; /*! @method windowObject @result The WebScriptObject representing the frame's JavaScript window object. */ - (WebScriptObject *)windowObject; /*! @method globalContext @result The frame's global JavaScript execution context. Use this method to bridge between the WebKit and JavaScriptCore APIs. */ - (JSGlobalContextRef)globalContext; @end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebHTMLRepresentationInternal.h��������������������������������������������������0000644�0001750�0001750�00000003274�11044426332�020447� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebHTMLRepresentationPrivate.h> @interface WebHTMLRepresentation (WebInternal) + (NSArray *)supportedNonImageMIMETypes; @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebFrameView.h�������������������������������������������������������������������0000644�0001750�0001750�00000007244�10454353247�015161� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003, 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> @class WebDataSource; @class WebFrame; @class WebFrameViewPrivate; @protocol WebDocumentView; /*! @class WebFrameView */ @interface WebFrameView : NSView { @private WebFrameViewPrivate *_private; } /*! @method webFrame @abstract Returns the WebFrame associated with this WebFrameView @result The WebFrameView's frame. */ - (WebFrame *)webFrame; /*! @method documentView @abstract Returns the WebFrameView's document subview @result The subview that renders the WebFrameView's contents */ - (NSView <WebDocumentView> *)documentView; /*! @method setAllowsScrolling: @abstract Sets whether the WebFrameView allows its document to be scrolled @param flag YES to allow the document to be scrolled, NO to disallow scrolling */ - (void)setAllowsScrolling:(BOOL)flag; /*! @method allowsScrolling @abstract Returns whether the WebFrameView allows its document to be scrolled @result YES if the document is allowed to scroll, otherwise NO */ - (BOOL)allowsScrolling; /*! @method canPrintHeadersAndFooters @abstract Tells whether this frame can print headers and footers @result YES if the frame can, no otherwise */ - (BOOL)canPrintHeadersAndFooters; /*! @method printOperationWithPrintInfo @abstract Creates a print operation set up to print this frame @result A newly created print operation object */ - (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo; /*! @method documentViewShouldHandlePrint @abstract Called by the host application before it initializes and runs a print operation. @result If NO is returned, the host application will abort its print operation and call -printDocumentView on the WebFrameView. The document view is then expected to run its own print operation. If YES is returned, the host application's print operation will continue as normal. */ - (BOOL)documentViewShouldHandlePrint; /*! @method printDocumentView @abstract Called by the host application when the WebFrameView returns YES from -documentViewShouldHandlePrint. */ - (void)printDocumentView; @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebDocumentLoaderMac.h�����������������������������������������������������������0000644�0001750�0001750�00000005177�11025107554�016616� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebCore/DocumentLoader.h> #import <wtf/RetainPtr.h> #import <wtf/HashSet.h> @class WebDataSource; @class WebView; namespace WebCore { class ResourceRequest; } class WebDocumentLoaderMac : public WebCore::DocumentLoader { public: static PassRefPtr<WebDocumentLoaderMac> create(const WebCore::ResourceRequest& request, const WebCore::SubstituteData& data) { return adoptRef(new WebDocumentLoaderMac(request, data)); } void setDataSource(WebDataSource *, WebView*); void detachDataSource(); WebDataSource *dataSource() const; void increaseLoadCount(unsigned long identifier); void decreaseLoadCount(unsigned long identifier); private: WebDocumentLoaderMac(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); virtual void attachToFrame(); virtual void detachFromFrame(); void retainDataSource(); void releaseDataSource(); WebDataSource *m_dataSource; bool m_isDataSourceRetained; RetainPtr<id> m_resourceLoadDelegate; RetainPtr<id> m_downloadDelegate; HashSet<unsigned long> m_loadingResources; }; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebNavigationData.h��������������������������������������������������������������0000644�0001750�0001750�00000003614�11260535714�016157� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 <Foundation/Foundation.h> @class WebFrame; @class WebNavigationDataPrivate; @class WebView; @interface WebNavigationData : NSObject { @private WebNavigationDataPrivate *_private; } - (id)initWithURLString:(NSString *)url title:(NSString *)title originalRequest:(NSURLRequest *)request response:(NSURLResponse *)response hasSubstituteData:(BOOL)hasSubstituteData clientRedirectSource:(NSString *)redirectSource; - (NSString *)url; - (NSString *)title; - (NSURLRequest *)originalRequest; - (NSURLResponse *)response; - (BOOL)hasSubstituteData; - (NSString *)clientRedirectSource; @end ��������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebJSPDFDoc.mm�������������������������������������������������������������������0000644�0001750�0001750�00000005514�11255737546�014760� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Apple 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 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 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 "WebJSPDFDoc.h" #import "WebDataSource.h" #import "WebDelegateImplementationCaching.h" #import "WebFrame.h" #import "WebView.h" #import <JavaScriptCore/JSObjectRef.h> static void jsPDFDocInitialize(JSContextRef ctx, JSObjectRef object) { WebDataSource *dataSource = (WebDataSource *)JSObjectGetPrivate(object); CFRetain(dataSource); } static void jsPDFDocFinalize(JSObjectRef object) { WebDataSource *dataSource = (WebDataSource *)JSObjectGetPrivate(object); CFRelease(dataSource); } static JSValueRef jsPDFDocPrint(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { WebDataSource *dataSource = (WebDataSource *)JSObjectGetPrivate(thisObject); WebView *webView = [[dataSource webFrame] webView]; CallUIDelegate(webView, @selector(webView:printFrameView:), [[dataSource webFrame] frameView]); return JSValueMakeUndefined(ctx); } static JSStaticFunction jsPDFDocStaticFunctions[] = { { "print", jsPDFDocPrint, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { 0, 0, 0 }, }; static JSClassDefinition jsPDFDocClassDefinition = { 0, kJSClassAttributeNone, "Doc", 0, 0, jsPDFDocStaticFunctions, jsPDFDocInitialize, jsPDFDocFinalize, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; JSObjectRef makeJSPDFDoc(JSContextRef ctx, WebDataSource *dataSource) { static JSClassRef jsPDFDocClass = JSClassCreate(&jsPDFDocClassDefinition); return JSObjectMake(ctx, jsPDFDocClass, dataSource); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebFormDelegatePrivate.h���������������������������������������������������������0000644�0001750�0001750�00000003245�10360512352�017150� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebFormDelegate.h" @interface WebFormDelegate (WebPrivate) + (WebFormDelegate *)_sharedWebFormDelegate; @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebPolicyDelegate.h��������������������������������������������������������������0000644�0001750�0001750�00000023065�10722672111�016155� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003, 2004, 2005, 2007 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> @class NSError; @class NSURLResponse; @class NSURLRequest; @class WebView; @class WebFrame; @class WebPolicyPrivate; /*! @enum WebNavigationType @abstract The type of action that triggered a possible navigation. @constant WebNavigationTypeLinkClicked A link with an href was clicked. @constant WebNavigationTypeFormSubmitted A form was submitted. @constant WebNavigationTypeBackForward The user chose back or forward. @constant WebNavigationTypeReload The User hit the reload button. @constant WebNavigationTypeFormResubmitted A form was resubmitted (by virtue of doing back, forward or reload). @constant WebNavigationTypeOther Navigation is taking place for some other reason. */ typedef enum { WebNavigationTypeLinkClicked, WebNavigationTypeFormSubmitted, WebNavigationTypeBackForward, WebNavigationTypeReload, WebNavigationTypeFormResubmitted, WebNavigationTypeOther } WebNavigationType; extern NSString *WebActionNavigationTypeKey; // NSNumber (WebNavigationType) extern NSString *WebActionElementKey; // NSDictionary of element info extern NSString *WebActionButtonKey; // NSNumber (0 for left button, 1 for middle button, 2 for right button) extern NSString *WebActionModifierFlagsKey; // NSNumber (unsigned) extern NSString *WebActionOriginalURLKey; // NSURL /*! @protocol WebPolicyDecisionListener @discussion This protocol is used to call back with the results of a policy decision. This provides the ability to make these decisions asyncrhonously, which means the decision can be made by prompting with a sheet, for example. */ @protocol WebPolicyDecisionListener <NSObject> /*! @method use @abstract Use the resource @discussion If there remain more policy decisions to be made, then the next policy delegate method gets to decide. This will be either the next navigation policy delegate if there is a redirect, or the content policy delegate. If there are no more policy decisions to be made, the resource will be displayed inline if possible. If there is no view available to display the resource inline, then unableToImplementPolicyWithError:frame: will be called with an appropriate error. <p>If a new window is going to be created for this navigation as a result of frame targetting, then it will be created once you call this method. */ - (void)use; /*! @method download @abstract Download the resource instead of displaying it. @discussion This method is more than just a convenience because it allows an in-progress navigation to be converted to a download based on content type, without having to stop and restart the load. */ - (void)download; /*! @method ignore @abstract Do nothing (but the client may choose to handle the request itself) @discussion A policy of ignore prevents WebKit from doing anything further with the load, however, the client is still free to handle the request in some other way, such as opening a new window, opening a new window behind the current one, opening the URL in an external app, revealing the location in Finder if a file URL, etc. */ - (void)ignore; @end /*! @category WebPolicyDelegate @discussion While loading a URL, WebKit asks the WebPolicyDelegate for policies that determine the action of what to do with the URL or the data that the URL represents. Typically, the policy handler methods are called in this order: decidePolicyForNewWindowAction:request:newFrameName:decisionListener: (at most once)<BR> decidePolicyForNavigationAction:request:frame:decisionListener: (zero or more times)<BR> decidePolicyForMIMEType:request:frame: (zero or more times)<BR> New window policy is always checked. Navigation policy is checked for the initial load and every redirect unless blocked by an earlier policy. Content policy is checked once the content type is known, unless an earlier policy prevented it. In rare cases, content policy might be checked more than once. This occurs when loading a "multipart/x-mixed-replace" document, also known as "server push". In this case, multiple documents come in one navigation, with each replacing the last. In this case, conent policy will be checked for each one. */ @interface NSObject (WebPolicyDelegate) /*! @method webView:decidePolicyForNavigationAction:request:frame:decisionListener: @abstract This method is called to decide what to do with a proposed navigation. @param actionInformation Dictionary that describes the action that triggered this navigation. @param request The request for the proposed navigation @param frame The WebFrame in which the navigation is happening @param listener The object to call when the decision is made @discussion This method will be called before loading starts, and on every redirect. */ - (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener; /*! @method webView:decidePolicyForNewWindowAction:request:newFrameName:decisionListener: @discussion This method is called to decide what to do with an targetted nagivation that would open a new window. @param actionInformation Dictionary that describes the action that triggered this navigation. @param request The request for the proposed navigation @param frame The frame in which the navigation is taking place @param listener The object to call when the decision is made @discussion This method is provided so that modified clicks on a targetted link which opens a new frame can prevent the new window from being opened if they decide to do something else, like download or present the new frame in a specialized way. <p>If this method picks a policy of Use, the new window will be opened, and decidePolicyForNavigationAction:request:frame:decisionListner: will be called with a WebNavigationType of WebNavigationTypeOther in its action. This is to avoid possible confusion about the modifiers. */ - (void)webView:(WebView *)webView decidePolicyForNewWindowAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request newFrameName:(NSString *)frameName decisionListener:(id<WebPolicyDecisionListener>)listener; /*! @method webView:decidePolicyForMIMEType:request:frame: @discussion Returns the policy for content which has been partially loaded. Sent after webView:didStartProvisionalLoadForFrame: is sent on the WebFrameLoadDelegate. @param type MIME type for the resource. @param request A NSURLRequest for the partially loaded content. @param frame The frame which is loading the URL. @param listener The object to call when the decision is made */ - (void)webView:(WebView *)webView decidePolicyForMIMEType:(NSString *)type request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener; /*! @method webView:unableToImplementPolicy:error:forURL:inFrame: @discussion Called when a WebPolicy could not be implemented. It is up to the client to display appropriate feedback. @param policy The policy that could not be implemented. @param error The error that caused the policy to not be implemented. @param URL The URL of the resource for which a particular action was requested but failed. @param frame The frame in which the policy could not be implemented. */ - (void)webView:(WebView *)webView unableToImplementPolicyWithError:(NSError *)error frame:(WebFrame *)frame; @end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebDataSource.h������������������������������������������������������������������0000644�0001750�0001750�00000014721�10360512352�015312� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2003, 2004, 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Cocoa/Cocoa.h> #import <WebKit/WebDocument.h> @class NSMutableURLRequest; @class NSURLConnection; @class NSURLRequest; @class NSURLResponse; @class WebArchive; @class WebDataSourcePrivate; @class WebFrame; @class WebResource; /*! @class WebDataSource @discussion A WebDataSource represents the data associated with a web page. A datasource has a WebDocumentRepresentation which holds an appropriate representation of the data. WebDataSources manage a hierarchy of WebFrames. WebDataSources are typically related to a view by their containing WebFrame. */ @interface WebDataSource : NSObject { @private WebDataSourcePrivate *_private; } /*! @method initWithRequest: @abstract The designated initializer for WebDataSource. @param request The request to use in creating a datasource. @result Returns an initialized WebDataSource. */ - (id)initWithRequest:(NSURLRequest *)request; /*! @method data @discussion The data will be incomplete until the datasource has completely loaded. @result Returns the raw data associated with the datasource. Returns nil if the datasource hasn't loaded any data. */ - (NSData *)data; /*! @method representation @discussion A representation holds a type specific representation of the datasource's data. The representation class is determined by mapping a MIME type to a class. The representation is created once the MIME type of the datasource content has been determined. @result Returns the representation associated with this datasource. Returns nil if the datasource hasn't created it's representation. */ - (id <WebDocumentRepresentation>)representation; /*! @method webFrame @result Return the frame that represents this data source. */ - (WebFrame *)webFrame; /*! @method initialRequest @result Returns a reference to the original request that created the datasource. This request will be unmodified by WebKit. */ - (NSURLRequest *)initialRequest; /*! @method request @result Returns the request that was used to create this datasource. */ - (NSMutableURLRequest *)request; /*! @method response @result returns the WebResourceResponse for the data source. */ - (NSURLResponse *)response; /*! @method textEncodingName @result Returns either the override encoding, as set on the WebView for this dataSource or the encoding from the response. */ - (NSString *)textEncodingName; /*! @method isLoading @discussion Returns YES if there are any pending loads. */ - (BOOL)isLoading; /*! @method pageTitle @result Returns nil or the page title. */ - (NSString *)pageTitle; /*! @method unreachableURL @discussion This will be non-nil only for dataSources created by calls to the WebFrame method loadAlternateHTMLString:baseURL:forUnreachableURL:. @result returns the unreachableURL for which this dataSource is showing alternate content, or nil */ - (NSURL *)unreachableURL; /*! @method webArchive @result A WebArchive representing the data source, its subresources and child frames. @description This method constructs a WebArchive using the original downloaded data. In the case of HTML, if the current state of the document is preferred, webArchive should be called on the DOM document instead. */ - (WebArchive *)webArchive; /*! @method mainResource @result A WebResource representing the data source. @description This method constructs a WebResource using the original downloaded data. This method can be used to construct a WebArchive in case the archive returned by WebDataSource's webArchive isn't sufficient. */ - (WebResource *)mainResource; /*! @method subresources @abstract Returns all the subresources associated with the data source. @description The returned array only contains subresources that have fully downloaded. */ - (NSArray *)subresources; /*! method subresourceForURL: @abstract Returns a subresource for a given URL. @param URL The URL of the subresource. @description Returns non-nil if the data source has fully downloaded a subresource with the given URL. */ - (WebResource *)subresourceForURL:(NSURL *)URL; /*! @method addSubresource: @abstract Adds a subresource to the data source. @param subresource The subresource to be added. @description addSubresource: adds a subresource to the data source's list of subresources. Later, if something causes the data source to load the URL of the subresource, the data source will load the data from the subresource instead of from the network. For example, if one wants to add an image that is already downloaded to a web page, addSubresource: can be called so that the data source uses the downloaded image rather than accessing the network. NOTE: If the data source already has a subresource with the same URL, addSubresource: will replace it. */ - (void)addSubresource:(WebResource *)subresource; @end �����������������������������������������������WebKit/mac/WebView/WebPDFRepresentation.h�����������������������������������������������������������0000644�0001750�0001750�00000003332�11255737546�016632� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebDocument.h" @protocol WebDocumentRepresentation; @interface WebPDFRepresentation : NSObject <WebDocumentRepresentation> + (NSArray *)supportedMIMETypes; @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebHTMLView.h��������������������������������������������������������������������0000644�0001750�0001750�00000005024�10522504575�014663� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebDocument.h> @class WebDataSource; @class WebHTMLViewPrivate; /*! @class WebHTMLView @discussion A document view of WebFrameView that displays HTML content. WebHTMLView is a NSControl because it hosts NSCells that are painted by WebCore's Aqua theme renderer (and those cells must be hosted by an enclosing NSControl in order to paint properly). */ @interface WebHTMLView : NSControl <WebDocumentView, WebDocumentSearching> { @private WebHTMLViewPrivate *_private; } /*! @method setNeedsToApplyStyles: @abstract Sets flag to cause reapplication of style information. @param flag YES to apply style information, NO to not apply style information. */ - (void)setNeedsToApplyStyles:(BOOL)flag; /*! @method reapplyStyles @discussion Immediately causes reapplication of style information to the view. This should not be called directly, instead call setNeedsToApplyStyles:. */ - (void)reapplyStyles; - (void)outdent:(id)sender; @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebPDFView.h���������������������������������������������������������������������0000644�0001750�0001750�00000004476�11170746753�014550� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebDocumentInternal.h> @class PDFDocument; @class PDFView; @class WebDataSource; @interface WebPDFView : NSView <WebDocumentView, WebDocumentSearching, WebDocumentIncrementalSearching, WebMultipleTextMatches, WebDocumentSelection, WebDocumentElement, _WebDocumentViewState, _WebDocumentZooming> { NSView *previewView; PDFView *PDFSubview; NSString *path; BOOL firstResponderIsPDFDocumentView; BOOL written; BOOL _ignoreScaleAndDisplayModeAndPageNotifications; BOOL _willUpdatePreferencesSoon; PDFView *PDFSubviewProxy; WebDataSource *dataSource; NSArray *textMatches; NSPoint lastScrollPosition; } + (NSArray *)supportedMIMETypes; + (NSBundle *)PDFKitBundle; - (void)setPDFDocument:(PDFDocument *)doc; @end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebScriptDebugDelegate.h���������������������������������������������������������0000644�0001750�0001750�00000013413�11142413761�017126� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <Foundation/Foundation.h> #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 #define WebNSUInteger unsigned int #else #define WebNSUInteger NSUInteger #endif #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) typedef int WebSourceId; #else typedef intptr_t WebSourceId; #endif @class WebView; @class WebFrame; @class WebScriptCallFrame; @class WebScriptCallFramePrivate; @class WebScriptObject; extern NSString * const WebScriptErrorDomain; extern NSString * const WebScriptErrorDescriptionKey; extern NSString * const WebScriptErrorLineNumberKey; enum { WebScriptGeneralErrorCode = -100 }; // WebScriptDebugDelegate messages @interface NSObject (WebScriptDebugDelegate) // some source was parsed, establishing a "source ID" (>= 0) for future reference // this delegate method is deprecated, please switch to the new version below - (void)webView:(WebView *)webView didParseSource:(NSString *)source fromURL:(NSString *)url sourceId:(WebSourceId)sid forWebFrame:(WebFrame *)webFrame; // some source was parsed, establishing a "source ID" (>= 0) for future reference - (void)webView:(WebView *)webView didParseSource:(NSString *)source baseLineNumber:(WebNSUInteger)lineNumber fromURL:(NSURL *)url sourceId:(WebSourceId)sid forWebFrame:(WebFrame *)webFrame; // some source failed to parse - (void)webView:(WebView *)webView failedToParseSource:(NSString *)source baseLineNumber:(WebNSUInteger)lineNumber fromURL:(NSURL *)url withError:(NSError *)error forWebFrame:(WebFrame *)webFrame; // just entered a stack frame (i.e. called a function, or started global scope) - (void)webView:(WebView *)webView didEnterCallFrame:(WebScriptCallFrame *)frame sourceId:(WebSourceId)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame; // about to execute some code - (void)webView:(WebView *)webView willExecuteStatement:(WebScriptCallFrame *)frame sourceId:(WebSourceId)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame; // about to leave a stack frame (i.e. return from a function) - (void)webView:(WebView *)webView willLeaveCallFrame:(WebScriptCallFrame *)frame sourceId:(WebSourceId)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame; // exception is being thrown - (void)webView:(WebView *)webView exceptionWasRaised:(WebScriptCallFrame *)frame sourceId:(WebSourceId)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame; @end // WebScriptCallFrame interface // // These objects are passed as arguments to the debug delegate. @interface WebScriptCallFrame : NSObject { @private WebScriptCallFramePrivate* _private; id _userInfo; } // associate user info with frame - (void)setUserInfo:(id)userInfo; // retrieve user info - (id)userInfo; // get next frame on call stack (or nil if this is already the "global" frame) - (WebScriptCallFrame *)caller; // get array of WebScriptObjects for each scope (innermost first, last is always global object) - (NSArray *)scopeChain; // get name of function (if available) or nil - (NSString *)functionName; // get pending exception (if any) or nil - (id)exception; // evaluate a script (as if by "eval") in the context of this frame - (id)evaluateWebScript:(NSString *)script; @end #undef WebNSUInteger �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebTextIterator.mm���������������������������������������������������������������0000644�0001750�0001750�00000005515�11203322752�016101� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008, 2009 Apple 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 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 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 "WebTextIterator.h" #import "DOMNodeInternal.h" #import "DOMRangeInternal.h" #import "WebTypesInternal.h" #import <JavaScriptCore/Vector.h> #import <WebCore/TextIterator.h> #import <WebCore/WebCoreObjCExtras.h> using namespace JSC; using namespace WebCore; @interface WebTextIteratorPrivate : NSObject { @public OwnPtr<TextIterator> _textIterator; } @end @implementation WebTextIteratorPrivate + (void)initialize { #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif } @end @implementation WebTextIterator - (void)dealloc { [_private release]; [super dealloc]; } - (id)initWithRange:(DOMRange *)range { self = [super init]; if (!self) return self; _private = [[WebTextIteratorPrivate alloc] init]; _private->_textIterator.set(new TextIterator(core(range))); return self; } - (void)advance { _private->_textIterator->advance(); } - (BOOL)atEnd { return _private->_textIterator->atEnd(); } - (DOMRange *)currentRange { return kit(_private->_textIterator->range().get()); } - (const unichar *)currentTextPointer { return _private->_textIterator->characters(); } - (NSUInteger)currentTextLength { return _private->_textIterator->length(); } @end @implementation WebTextIterator (WebTextIteratorDeprecated) - (DOMNode *)currentNode { return kit(_private->_textIterator->node()); } - (NSString *)currentText { return [NSString stringWithCharacters:_private->_textIterator->characters() length:_private->_textIterator->length()]; } @end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebPreferences.mm����������������������������������������������������������������0000644�0001750�0001750�00000114354�11262231477�015716� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved. * (C) 2006 Graham Dennis (graham.dennis@gmail.com) * * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebPreferencesPrivate.h" #import "WebPreferenceKeysPrivate.h" #import "WebKitLogging.h" #import "WebKitNSStringExtras.h" #import "WebKitSystemBits.h" #import "WebKitSystemInterface.h" #import "WebKitVersionChecks.h" #import "WebNSDictionaryExtras.h" #import "WebNSURLExtras.h" NSString *WebPreferencesChangedNotification = @"WebPreferencesChangedNotification"; NSString *WebPreferencesRemovedNotification = @"WebPreferencesRemovedNotification"; #define KEY(x) (_private->identifier ? [_private->identifier stringByAppendingString:(x)] : (x)) enum { WebPreferencesVersion = 1 }; static WebPreferences *_standardPreferences; static NSMutableDictionary *webPreferencesInstances; static bool contains(const char* const array[], int count, const char* item) { if (!item) return false; for (int i = 0; i < count; i++) if (!strcasecmp(array[i], item)) return true; return false; } static WebCacheModel cacheModelForMainBundle(void) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // Apps that probably need the small setting static const char* const documentViewerIDs[] = { "Microsoft/com.microsoft.Messenger", "com.adiumX.adiumX", "com.alientechnology.Proteus", "com.apple.Dashcode", "com.apple.iChat", "com.barebones.bbedit", "com.barebones.textwrangler", "com.barebones.yojimbo", "com.equinux.iSale4", "com.growl.growlframework", "com.intrarts.PandoraMan", "com.karelia.Sandvox", "com.macromates.textmate", "com.realmacsoftware.rapidweaverpro", "com.red-sweater.marsedit", "com.yahoo.messenger3", "de.codingmonkeys.SubEthaEdit", "fi.karppinen.Pyro", "info.colloquy", "kungfoo.tv.ecto", }; // Apps that probably need the medium setting static const char* const documentBrowserIDs[] = { "com.apple.Dictionary", "com.apple.Xcode", "com.apple.dashboard.client", "com.apple.helpviewer", "com.culturedcode.xyle", "com.macrabbit.CSSEdit", "com.panic.Coda", "com.ranchero.NetNewsWire", "com.thinkmac.NewsLife", "org.xlife.NewsFire", "uk.co.opencommunity.vienna2", }; // Apps that probably need the large setting static const char* const primaryWebBrowserIDs[] = { "com.app4mac.KidsBrowser" "com.app4mac.wKiosk", "com.freeverse.bumpercar", "com.omnigroup.OmniWeb5", "com.sunrisebrowser.Sunrise", "net.hmdt-web.Shiira", }; WebCacheModel cacheModel; const char* bundleID = [[[NSBundle mainBundle] bundleIdentifier] UTF8String]; if (contains(documentViewerIDs, sizeof(documentViewerIDs) / sizeof(documentViewerIDs[0]), bundleID)) cacheModel = WebCacheModelDocumentViewer; else if (contains(documentBrowserIDs, sizeof(documentBrowserIDs) / sizeof(documentBrowserIDs[0]), bundleID)) cacheModel = WebCacheModelDocumentBrowser; else if (contains(primaryWebBrowserIDs, sizeof(primaryWebBrowserIDs) / sizeof(primaryWebBrowserIDs[0]), bundleID)) cacheModel = WebCacheModelPrimaryWebBrowser; else { bool isLegacyApp = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_CACHE_MODEL_API); if (isLegacyApp) cacheModel = WebCacheModelDocumentBrowser; // To avoid regressions in apps that depended on old WebKit's large cache. else cacheModel = WebCacheModelDocumentViewer; // To save memory. } [pool drain]; return cacheModel; } @interface WebPreferencesPrivate : NSObject { @public NSMutableDictionary *values; NSString *identifier; NSString *IBCreatorID; BOOL autosaves; BOOL automaticallyDetectsCacheModel; unsigned numWebViews; } @end @implementation WebPreferencesPrivate - (void)dealloc { [values release]; [identifier release]; [IBCreatorID release]; [super dealloc]; } @end @interface WebPreferences (WebInternal) + (NSString *)_concatenateKeyWithIBCreatorID:(NSString *)key; + (NSString *)_IBCreatorID; @end @interface WebPreferences (WebForwardDeclarations) // This pseudo-category is needed so these methods can be used from within other category implementations // without being in the public header file. - (BOOL)_boolValueForKey:(NSString *)key; - (void)_setBoolValue:(BOOL)value forKey:(NSString *)key; - (int)_integerValueForKey:(NSString *)key; - (void)_setIntegerValue:(int)value forKey:(NSString *)key; - (float)_floatValueForKey:(NSString *)key; - (void)_setFloatValue:(float)value forKey:(NSString *)key; - (void)_setUnsignedLongLongValue:(unsigned long long)value forKey:(NSString *)key; - (unsigned long long)_unsignedLongLongValueForKey:(NSString *)key; @end @implementation WebPreferences - init { // Create fake identifier static int instanceCount = 1; NSString *fakeIdentifier; // At least ensure that identifier hasn't been already used. fakeIdentifier = [NSString stringWithFormat:@"WebPreferences%d", instanceCount++]; while ([[self class] _getInstanceForIdentifier:fakeIdentifier]){ fakeIdentifier = [NSString stringWithFormat:@"WebPreferences%d", instanceCount++]; } return [self initWithIdentifier:fakeIdentifier]; } - (id)initWithIdentifier:(NSString *)anIdentifier { self = [super init]; if (!self) return nil; _private = [[WebPreferencesPrivate alloc] init]; _private->IBCreatorID = [[WebPreferences _IBCreatorID] retain]; WebPreferences *instance = [[self class] _getInstanceForIdentifier:anIdentifier]; if (instance){ [self release]; return [instance retain]; } _private->values = [[NSMutableDictionary alloc] init]; _private->identifier = [anIdentifier copy]; _private->automaticallyDetectsCacheModel = YES; [[self class] _setInstance:self forIdentifier:_private->identifier]; [self _postPreferencesChangesNotification]; return self; } - (id)initWithCoder:(NSCoder *)decoder { self = [super init]; if (!self) return nil; _private = [[WebPreferencesPrivate alloc] init]; _private->IBCreatorID = [[WebPreferences _IBCreatorID] retain]; _private->automaticallyDetectsCacheModel = YES; @try { id identifier = nil; id values = nil; if ([decoder allowsKeyedCoding]) { identifier = [decoder decodeObjectForKey:@"Identifier"]; values = [decoder decodeObjectForKey:@"Values"]; } else { int version; [decoder decodeValueOfObjCType:@encode(int) at:&version]; if (version == 1) { identifier = [decoder decodeObject]; values = [decoder decodeObject]; } } if ([identifier isKindOfClass:[NSString class]]) _private->identifier = [identifier copy]; if ([values isKindOfClass:[NSDictionary class]]) _private->values = [values mutableCopy]; // ensure dictionary is mutable LOG(Encoding, "Identifier = %@, Values = %@\n", _private->identifier, _private->values); } @catch(id) { [self release]; return nil; } // If we load a nib multiple times, or have instances in multiple // nibs with the same name, the first guy up wins. WebPreferences *instance = [[self class] _getInstanceForIdentifier:_private->identifier]; if (instance) { [self release]; self = [instance retain]; } else { [[self class] _setInstance:self forIdentifier:_private->identifier]; } return self; } - (void)encodeWithCoder:(NSCoder *)encoder { if ([encoder allowsKeyedCoding]){ [encoder encodeObject:_private->identifier forKey:@"Identifier"]; [encoder encodeObject:_private->values forKey:@"Values"]; LOG (Encoding, "Identifier = %@, Values = %@\n", _private->identifier, _private->values); } else { int version = WebPreferencesVersion; [encoder encodeValueOfObjCType:@encode(int) at:&version]; [encoder encodeObject:_private->identifier]; [encoder encodeObject:_private->values]; } } + (WebPreferences *)standardPreferences { if (_standardPreferences == nil) { _standardPreferences = [[WebPreferences alloc] initWithIdentifier:nil]; [_standardPreferences setAutosaves:YES]; } return _standardPreferences; } // if we ever have more than one WebPreferences object, this would move to init + (void)initialize { NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: @"Times", WebKitStandardFontPreferenceKey, @"Courier", WebKitFixedFontPreferenceKey, @"Times", WebKitSerifFontPreferenceKey, @"Helvetica", WebKitSansSerifFontPreferenceKey, @"Apple Chancery", WebKitCursiveFontPreferenceKey, @"Papyrus", WebKitFantasyFontPreferenceKey, @"1", WebKitMinimumFontSizePreferenceKey, @"9", WebKitMinimumLogicalFontSizePreferenceKey, @"16", WebKitDefaultFontSizePreferenceKey, @"13", WebKitDefaultFixedFontSizePreferenceKey, @"ISO-8859-1", WebKitDefaultTextEncodingNamePreferenceKey, [NSNumber numberWithBool:NO], WebKitUsesEncodingDetectorPreferenceKey, [NSNumber numberWithBool:NO], WebKitUserStyleSheetEnabledPreferenceKey, @"", WebKitUserStyleSheetLocationPreferenceKey, [NSNumber numberWithBool:NO], WebKitShouldPrintBackgroundsPreferenceKey, [NSNumber numberWithBool:NO], WebKitTextAreasAreResizablePreferenceKey, [NSNumber numberWithBool:NO], WebKitShrinksStandaloneImagesToFitPreferenceKey, [NSNumber numberWithBool:YES], WebKitJavaEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitJavaScriptEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitWebSecurityEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitAllowUniversalAccessFromFileURLsPreferenceKey, [NSNumber numberWithBool:YES], WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey, [NSNumber numberWithBool:YES], WebKitPluginsEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitDatabasesEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitLocalStorageEnabledPreferenceKey, [NSNumber numberWithBool:NO], WebKitExperimentalNotificationsEnabledPreferenceKey, [NSNumber numberWithBool:NO], WebKitExperimentalWebSocketsEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitAllowAnimatedImagesPreferenceKey, [NSNumber numberWithBool:YES], WebKitAllowAnimatedImageLoopingPreferenceKey, [NSNumber numberWithBool:YES], WebKitDisplayImagesKey, @"1800", WebKitBackForwardCacheExpirationIntervalKey, [NSNumber numberWithBool:NO], WebKitTabToLinksPreferenceKey, [NSNumber numberWithBool:NO], WebKitPrivateBrowsingEnabledPreferenceKey, [NSNumber numberWithBool:NO], WebKitRespectStandardStyleKeyEquivalentsPreferenceKey, [NSNumber numberWithBool:NO], WebKitShowsURLsInToolTipsPreferenceKey, @"1", WebKitPDFDisplayModePreferenceKey, @"0", WebKitPDFScaleFactorPreferenceKey, @"0", WebKitUseSiteSpecificSpoofingPreferenceKey, [NSNumber numberWithInt:WebKitEditableLinkDefaultBehavior], WebKitEditableLinkBehaviorPreferenceKey, #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) [NSNumber numberWithInt:WebTextDirectionSubmenuAutomaticallyIncluded], #else [NSNumber numberWithInt:WebTextDirectionSubmenuNeverIncluded], #endif WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey, [NSNumber numberWithBool:NO], WebKitDOMPasteAllowedPreferenceKey, [NSNumber numberWithBool:YES], WebKitUsesPageCachePreferenceKey, [NSNumber numberWithInt:cacheModelForMainBundle()], WebKitCacheModelPreferenceKey, [NSNumber numberWithBool:NO], WebKitDeveloperExtrasEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitAuthorAndUserStylesEnabledPreferenceKey, [NSNumber numberWithBool:NO], WebKitApplicationChromeModeEnabledPreferenceKey, [NSNumber numberWithBool:NO], WebKitWebArchiveDebugModeEnabledPreferenceKey, [NSNumber numberWithBool:NO], WebKitLocalFileContentSniffingEnabledPreferenceKey, [NSNumber numberWithBool:NO], WebKitOfflineWebApplicationCacheEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitZoomsTextOnlyPreferenceKey, [NSNumber numberWithBool:YES], WebKitXSSAuditorEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitAcceleratedCompositingEnabledPreferenceKey, [NSNumber numberWithBool:NO], WebKitWebGLEnabledPreferenceKey, [NSNumber numberWithBool:NO], WebKitPluginHalterEnabledPreferenceKey, nil]; // This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above ASSERT(kPDFDisplaySinglePageContinuous == 1); [[NSUserDefaults standardUserDefaults] registerDefaults:dict]; } - (void)dealloc { [_private release]; [super dealloc]; } - (NSString *)identifier { return _private->identifier; } - (id)_valueForKey:(NSString *)key { NSString *_key = KEY(key); id o = [_private->values objectForKey:_key]; if (o) return o; o = [[NSUserDefaults standardUserDefaults] objectForKey:_key]; if (!o && key != _key) o = [[NSUserDefaults standardUserDefaults] objectForKey:key]; return o; } - (NSString *)_stringValueForKey:(NSString *)key { id s = [self _valueForKey:key]; return [s isKindOfClass:[NSString class]] ? (NSString *)s : nil; } - (void)_setStringValue:(NSString *)value forKey:(NSString *)key { if ([[self _stringValueForKey:key] isEqualToString:value]) return; NSString *_key = KEY(key); [_private->values setObject:value forKey:_key]; if (_private->autosaves) [[NSUserDefaults standardUserDefaults] setObject:value forKey:_key]; [self _postPreferencesChangesNotification]; } - (int)_integerValueForKey:(NSString *)key { id o = [self _valueForKey:key]; return [o respondsToSelector:@selector(intValue)] ? [o intValue] : 0; } - (void)_setIntegerValue:(int)value forKey:(NSString *)key { if ([self _integerValueForKey:key] == value) return; NSString *_key = KEY(key); [_private->values _webkit_setInt:value forKey:_key]; if (_private->autosaves) [[NSUserDefaults standardUserDefaults] setInteger:value forKey:_key]; [self _postPreferencesChangesNotification]; } - (float)_floatValueForKey:(NSString *)key { id o = [self _valueForKey:key]; return [o respondsToSelector:@selector(floatValue)] ? [o floatValue] : 0.0f; } - (void)_setFloatValue:(float)value forKey:(NSString *)key { if ([self _floatValueForKey:key] == value) return; NSString *_key = KEY(key); [_private->values _webkit_setFloat:value forKey:_key]; if (_private->autosaves) [[NSUserDefaults standardUserDefaults] setFloat:value forKey:_key]; [self _postPreferencesChangesNotification]; } - (BOOL)_boolValueForKey:(NSString *)key { return [self _integerValueForKey:key] != 0; } - (void)_setBoolValue:(BOOL)value forKey:(NSString *)key { if ([self _boolValueForKey:key] == value) return; NSString *_key = KEY(key); [_private->values _webkit_setBool:value forKey:_key]; if (_private->autosaves) [[NSUserDefaults standardUserDefaults] setBool:value forKey:_key]; [self _postPreferencesChangesNotification]; } - (unsigned long long)_unsignedLongLongValueForKey:(NSString *)key { id o = [self _valueForKey:key]; return [o respondsToSelector:@selector(unsignedLongLongValue)] ? [o unsignedLongLongValue] : 0; } - (void)_setUnsignedLongLongValue:(unsigned long long)value forKey:(NSString *)key { if ([self _unsignedLongLongValueForKey:key] == value) return; NSString *_key = KEY(key); [_private->values _webkit_setUnsignedLongLong:value forKey:_key]; if (_private->autosaves) [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithUnsignedLongLong:value] forKey:_key]; [self _postPreferencesChangesNotification]; } - (NSString *)standardFontFamily { return [self _stringValueForKey: WebKitStandardFontPreferenceKey]; } - (void)setStandardFontFamily:(NSString *)family { [self _setStringValue: family forKey: WebKitStandardFontPreferenceKey]; } - (NSString *)fixedFontFamily { return [self _stringValueForKey: WebKitFixedFontPreferenceKey]; } - (void)setFixedFontFamily:(NSString *)family { [self _setStringValue: family forKey: WebKitFixedFontPreferenceKey]; } - (NSString *)serifFontFamily { return [self _stringValueForKey: WebKitSerifFontPreferenceKey]; } - (void)setSerifFontFamily:(NSString *)family { [self _setStringValue: family forKey: WebKitSerifFontPreferenceKey]; } - (NSString *)sansSerifFontFamily { return [self _stringValueForKey: WebKitSansSerifFontPreferenceKey]; } - (void)setSansSerifFontFamily:(NSString *)family { [self _setStringValue: family forKey: WebKitSansSerifFontPreferenceKey]; } - (NSString *)cursiveFontFamily { return [self _stringValueForKey: WebKitCursiveFontPreferenceKey]; } - (void)setCursiveFontFamily:(NSString *)family { [self _setStringValue: family forKey: WebKitCursiveFontPreferenceKey]; } - (NSString *)fantasyFontFamily { return [self _stringValueForKey: WebKitFantasyFontPreferenceKey]; } - (void)setFantasyFontFamily:(NSString *)family { [self _setStringValue: family forKey: WebKitFantasyFontPreferenceKey]; } - (int)defaultFontSize { return [self _integerValueForKey: WebKitDefaultFontSizePreferenceKey]; } - (void)setDefaultFontSize:(int)size { [self _setIntegerValue: size forKey: WebKitDefaultFontSizePreferenceKey]; } - (int)defaultFixedFontSize { return [self _integerValueForKey: WebKitDefaultFixedFontSizePreferenceKey]; } - (void)setDefaultFixedFontSize:(int)size { [self _setIntegerValue: size forKey: WebKitDefaultFixedFontSizePreferenceKey]; } - (int)minimumFontSize { return [self _integerValueForKey: WebKitMinimumFontSizePreferenceKey]; } - (void)setMinimumFontSize:(int)size { [self _setIntegerValue: size forKey: WebKitMinimumFontSizePreferenceKey]; } - (int)minimumLogicalFontSize { return [self _integerValueForKey: WebKitMinimumLogicalFontSizePreferenceKey]; } - (void)setMinimumLogicalFontSize:(int)size { [self _setIntegerValue: size forKey: WebKitMinimumLogicalFontSizePreferenceKey]; } - (NSString *)defaultTextEncodingName { return [self _stringValueForKey: WebKitDefaultTextEncodingNamePreferenceKey]; } - (void)setDefaultTextEncodingName:(NSString *)encoding { [self _setStringValue: encoding forKey: WebKitDefaultTextEncodingNamePreferenceKey]; } - (BOOL)userStyleSheetEnabled { return [self _boolValueForKey: WebKitUserStyleSheetEnabledPreferenceKey]; } - (void)setUserStyleSheetEnabled:(BOOL)flag { [self _setBoolValue: flag forKey: WebKitUserStyleSheetEnabledPreferenceKey]; } - (NSURL *)userStyleSheetLocation { NSString *locationString = [self _stringValueForKey: WebKitUserStyleSheetLocationPreferenceKey]; if ([locationString _webkit_looksLikeAbsoluteURL]) { return [NSURL _web_URLWithDataAsString:locationString]; } else { locationString = [locationString stringByExpandingTildeInPath]; return [NSURL fileURLWithPath:locationString]; } } - (void)setUserStyleSheetLocation:(NSURL *)URL { NSString *locationString; if ([URL isFileURL]) { locationString = [[URL path] _web_stringByAbbreviatingWithTildeInPath]; } else { locationString = [URL _web_originalDataAsString]; } [self _setStringValue:locationString forKey: WebKitUserStyleSheetLocationPreferenceKey]; } - (BOOL)shouldPrintBackgrounds { return [self _boolValueForKey: WebKitShouldPrintBackgroundsPreferenceKey]; } - (void)setShouldPrintBackgrounds:(BOOL)flag { [self _setBoolValue: flag forKey: WebKitShouldPrintBackgroundsPreferenceKey]; } - (BOOL)isJavaEnabled { return [self _boolValueForKey: WebKitJavaEnabledPreferenceKey]; } - (void)setJavaEnabled:(BOOL)flag { [self _setBoolValue: flag forKey: WebKitJavaEnabledPreferenceKey]; } - (BOOL)isJavaScriptEnabled { return [self _boolValueForKey: WebKitJavaScriptEnabledPreferenceKey]; } - (void)setJavaScriptEnabled:(BOOL)flag { [self _setBoolValue: flag forKey: WebKitJavaScriptEnabledPreferenceKey]; } - (BOOL)javaScriptCanOpenWindowsAutomatically { return [self _boolValueForKey: WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey]; } - (void)setJavaScriptCanOpenWindowsAutomatically:(BOOL)flag { [self _setBoolValue: flag forKey: WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey]; } - (BOOL)arePlugInsEnabled { return [self _boolValueForKey: WebKitPluginsEnabledPreferenceKey]; } - (void)setPlugInsEnabled:(BOOL)flag { [self _setBoolValue: flag forKey: WebKitPluginsEnabledPreferenceKey]; } - (BOOL)allowsAnimatedImages { return [self _boolValueForKey: WebKitAllowAnimatedImagesPreferenceKey]; } - (void)setAllowsAnimatedImages:(BOOL)flag { [self _setBoolValue: flag forKey: WebKitAllowAnimatedImagesPreferenceKey]; } - (BOOL)allowsAnimatedImageLooping { return [self _boolValueForKey: WebKitAllowAnimatedImageLoopingPreferenceKey]; } - (void)setAllowsAnimatedImageLooping: (BOOL)flag { [self _setBoolValue: flag forKey: WebKitAllowAnimatedImageLoopingPreferenceKey]; } - (void)setLoadsImagesAutomatically: (BOOL)flag { [self _setBoolValue: flag forKey: WebKitDisplayImagesKey]; } - (BOOL)loadsImagesAutomatically { return [self _boolValueForKey: WebKitDisplayImagesKey]; } - (void)setAutosaves:(BOOL)flag { _private->autosaves = flag; } - (BOOL)autosaves { return _private->autosaves; } - (void)setTabsToLinks:(BOOL)flag { [self _setBoolValue: flag forKey: WebKitTabToLinksPreferenceKey]; } - (BOOL)tabsToLinks { return [self _boolValueForKey:WebKitTabToLinksPreferenceKey]; } - (void)setPrivateBrowsingEnabled:(BOOL)flag { [self _setBoolValue:flag forKey:WebKitPrivateBrowsingEnabledPreferenceKey]; } - (BOOL)privateBrowsingEnabled { return [self _boolValueForKey:WebKitPrivateBrowsingEnabledPreferenceKey]; } - (void)setUsesPageCache:(BOOL)usesPageCache { [self _setBoolValue:usesPageCache forKey:WebKitUsesPageCachePreferenceKey]; } - (BOOL)usesPageCache { return [self _boolValueForKey:WebKitUsesPageCachePreferenceKey]; } - (void)setCacheModel:(WebCacheModel)cacheModel { [self _setIntegerValue:cacheModel forKey:WebKitCacheModelPreferenceKey]; [self setAutomaticallyDetectsCacheModel:NO]; } - (WebCacheModel)cacheModel { return [self _integerValueForKey:WebKitCacheModelPreferenceKey]; } @end @implementation WebPreferences (WebPrivate) - (BOOL)developerExtrasEnabled { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; if ([defaults boolForKey:@"DisableWebKitDeveloperExtras"]) return NO; #ifdef NDEBUG if ([defaults boolForKey:@"WebKitDeveloperExtras"] || [defaults boolForKey:@"IncludeDebugMenu"]) return YES; return [self _boolValueForKey:WebKitDeveloperExtrasEnabledPreferenceKey]; #else return YES; // always enable in debug builds #endif } - (void)setDeveloperExtrasEnabled:(BOOL)flag { [self _setBoolValue:flag forKey:WebKitDeveloperExtrasEnabledPreferenceKey]; } - (BOOL)authorAndUserStylesEnabled { return [self _boolValueForKey:WebKitAuthorAndUserStylesEnabledPreferenceKey]; } - (void)setAuthorAndUserStylesEnabled:(BOOL)flag { [self _setBoolValue:flag forKey:WebKitAuthorAndUserStylesEnabledPreferenceKey]; } - (BOOL)applicationChromeModeEnabled { return [self _boolValueForKey:WebKitApplicationChromeModeEnabledPreferenceKey]; } - (void)setApplicationChromeModeEnabled:(BOOL)flag { [self _setBoolValue:flag forKey:WebKitApplicationChromeModeEnabledPreferenceKey]; } - (BOOL)webArchiveDebugModeEnabled { return [self _boolValueForKey:WebKitWebArchiveDebugModeEnabledPreferenceKey]; } - (void)setWebArchiveDebugModeEnabled:(BOOL)flag { [self _setBoolValue:flag forKey:WebKitWebArchiveDebugModeEnabledPreferenceKey]; } - (BOOL)localFileContentSniffingEnabled { return [self _boolValueForKey:WebKitLocalFileContentSniffingEnabledPreferenceKey]; } - (void)setLocalFileContentSniffingEnabled:(BOOL)flag { [self _setBoolValue:flag forKey:WebKitLocalFileContentSniffingEnabledPreferenceKey]; } - (BOOL)offlineWebApplicationCacheEnabled { return [self _boolValueForKey:WebKitOfflineWebApplicationCacheEnabledPreferenceKey]; } - (void)setOfflineWebApplicationCacheEnabled:(BOOL)flag { [self _setBoolValue:flag forKey:WebKitOfflineWebApplicationCacheEnabledPreferenceKey]; } - (BOOL)zoomsTextOnly { return [self _boolValueForKey:WebKitZoomsTextOnlyPreferenceKey]; } - (void)setZoomsTextOnly:(BOOL)flag { [self _setBoolValue:flag forKey:WebKitZoomsTextOnlyPreferenceKey]; } - (BOOL)isXSSAuditorEnabled { return [self _boolValueForKey:WebKitXSSAuditorEnabledPreferenceKey]; } - (void)setXSSAuditorEnabled:(BOOL)flag { [self _setBoolValue:flag forKey:WebKitXSSAuditorEnabledPreferenceKey]; } - (BOOL)respectStandardStyleKeyEquivalents { return [self _boolValueForKey:WebKitRespectStandardStyleKeyEquivalentsPreferenceKey]; } - (void)setRespectStandardStyleKeyEquivalents:(BOOL)flag { [self _setBoolValue:flag forKey:WebKitRespectStandardStyleKeyEquivalentsPreferenceKey]; } - (BOOL)showsURLsInToolTips { return [self _boolValueForKey:WebKitShowsURLsInToolTipsPreferenceKey]; } - (void)setShowsURLsInToolTips:(BOOL)flag { [self _setBoolValue:flag forKey:WebKitShowsURLsInToolTipsPreferenceKey]; } - (BOOL)textAreasAreResizable { return [self _boolValueForKey: WebKitTextAreasAreResizablePreferenceKey]; } - (void)setTextAreasAreResizable:(BOOL)flag { [self _setBoolValue: flag forKey: WebKitTextAreasAreResizablePreferenceKey]; } - (BOOL)shrinksStandaloneImagesToFit { return [self _boolValueForKey:WebKitShrinksStandaloneImagesToFitPreferenceKey]; } - (void)setShrinksStandaloneImagesToFit:(BOOL)flag { [self _setBoolValue:flag forKey:WebKitShrinksStandaloneImagesToFitPreferenceKey]; } - (BOOL)automaticallyDetectsCacheModel { return _private->automaticallyDetectsCacheModel; } - (void)setAutomaticallyDetectsCacheModel:(BOOL)automaticallyDetectsCacheModel { _private->automaticallyDetectsCacheModel = automaticallyDetectsCacheModel; } - (BOOL)usesEncodingDetector { return [self _boolValueForKey: WebKitUsesEncodingDetectorPreferenceKey]; } - (void)setUsesEncodingDetector:(BOOL)flag { [self _setBoolValue: flag forKey: WebKitUsesEncodingDetectorPreferenceKey]; } - (BOOL)isWebSecurityEnabled { return [self _boolValueForKey: WebKitWebSecurityEnabledPreferenceKey]; } - (void)setWebSecurityEnabled:(BOOL)flag { [self _setBoolValue: flag forKey: WebKitWebSecurityEnabledPreferenceKey]; } - (BOOL)allowUniversalAccessFromFileURLs { return [self _boolValueForKey: WebKitAllowUniversalAccessFromFileURLsPreferenceKey]; } - (void)setAllowUniversalAccessFromFileURLs:(BOOL)flag { [self _setBoolValue: flag forKey: WebKitAllowUniversalAccessFromFileURLsPreferenceKey]; } - (NSTimeInterval)_backForwardCacheExpirationInterval { // FIXME: There's probably no good reason to read from the standard user defaults instead of self. return (NSTimeInterval)[[NSUserDefaults standardUserDefaults] floatForKey:WebKitBackForwardCacheExpirationIntervalKey]; } - (float)PDFScaleFactor { return [self _floatValueForKey:WebKitPDFScaleFactorPreferenceKey]; } - (void)setPDFScaleFactor:(float)factor { [self _setFloatValue:factor forKey:WebKitPDFScaleFactorPreferenceKey]; } - (PDFDisplayMode)PDFDisplayMode { PDFDisplayMode value = [self _integerValueForKey:WebKitPDFDisplayModePreferenceKey]; if (value != kPDFDisplaySinglePage && value != kPDFDisplaySinglePageContinuous && value != kPDFDisplayTwoUp && value != kPDFDisplayTwoUpContinuous) { // protect against new modes from future versions of OS X stored in defaults value = kPDFDisplaySinglePageContinuous; } return value; } - (void)setPDFDisplayMode:(PDFDisplayMode)mode { [self _setIntegerValue:mode forKey:WebKitPDFDisplayModePreferenceKey]; } - (WebKitEditableLinkBehavior)editableLinkBehavior { WebKitEditableLinkBehavior value = static_cast<WebKitEditableLinkBehavior> ([self _integerValueForKey:WebKitEditableLinkBehaviorPreferenceKey]); if (value != WebKitEditableLinkDefaultBehavior && value != WebKitEditableLinkAlwaysLive && value != WebKitEditableLinkNeverLive && value != WebKitEditableLinkOnlyLiveWithShiftKey && value != WebKitEditableLinkLiveWhenNotFocused) { // ensure that a valid result is returned value = WebKitEditableLinkDefaultBehavior; } return value; } - (void)setEditableLinkBehavior:(WebKitEditableLinkBehavior)behavior { [self _setIntegerValue:behavior forKey:WebKitEditableLinkBehaviorPreferenceKey]; } - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior { WebTextDirectionSubmenuInclusionBehavior value = static_cast<WebTextDirectionSubmenuInclusionBehavior>([self _integerValueForKey:WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey]); if (value != WebTextDirectionSubmenuNeverIncluded && value != WebTextDirectionSubmenuAutomaticallyIncluded && value != WebTextDirectionSubmenuAlwaysIncluded) { // Ensure that a valid result is returned. value = WebTextDirectionSubmenuNeverIncluded; } return value; } - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior { [self _setIntegerValue:behavior forKey:WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey]; } - (BOOL)_useSiteSpecificSpoofing { return [self _boolValueForKey:WebKitUseSiteSpecificSpoofingPreferenceKey]; } - (void)_setUseSiteSpecificSpoofing:(BOOL)newValue { [self _setBoolValue:newValue forKey:WebKitUseSiteSpecificSpoofingPreferenceKey]; } - (BOOL)databasesEnabled { return [self _boolValueForKey:WebKitDatabasesEnabledPreferenceKey]; } - (void)setDatabasesEnabled:(BOOL)databasesEnabled { [self _setBoolValue:databasesEnabled forKey:WebKitDatabasesEnabledPreferenceKey]; } - (BOOL)localStorageEnabled { return [self _boolValueForKey:WebKitLocalStorageEnabledPreferenceKey]; } - (void)setLocalStorageEnabled:(BOOL)localStorageEnabled { [self _setBoolValue:localStorageEnabled forKey:WebKitLocalStorageEnabledPreferenceKey]; } - (BOOL)experimentalNotificationsEnabled { return [self _boolValueForKey:WebKitExperimentalNotificationsEnabledPreferenceKey]; } - (void)setExperimentalNotificationsEnabled:(BOOL)experimentalNotificationsEnabled { [self _setBoolValue:experimentalNotificationsEnabled forKey:WebKitExperimentalNotificationsEnabledPreferenceKey]; } - (BOOL)experimentalWebSocketsEnabled { return [self _boolValueForKey:WebKitExperimentalWebSocketsEnabledPreferenceKey]; } - (void)setExperimentalWebSocketsEnabled:(BOOL)experimentalWebSocketsEnabled { [self _setBoolValue:experimentalWebSocketsEnabled forKey:WebKitExperimentalWebSocketsEnabledPreferenceKey]; } + (WebPreferences *)_getInstanceForIdentifier:(NSString *)ident { LOG(Encoding, "requesting for %@\n", ident); if (!ident) return _standardPreferences; WebPreferences *instance = [webPreferencesInstances objectForKey:[self _concatenateKeyWithIBCreatorID:ident]]; return instance; } + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)ident { if (!webPreferencesInstances) webPreferencesInstances = [[NSMutableDictionary alloc] init]; if (ident) { [webPreferencesInstances setObject:instance forKey:[self _concatenateKeyWithIBCreatorID:ident]]; LOG(Encoding, "recording %p for %@\n", instance, [self _concatenateKeyWithIBCreatorID:ident]); } } + (void)_checkLastReferenceForIdentifier:(id)identifier { // FIXME: This won't work at all under garbage collection because retainCount returns a constant. // We may need to change WebPreferences API so there's an explicit way to end the lifetime of one. WebPreferences *instance = [webPreferencesInstances objectForKey:identifier]; if ([instance retainCount] == 1) [webPreferencesInstances removeObjectForKey:identifier]; } + (void)_removeReferenceForIdentifier:(NSString *)ident { if (ident) [self performSelector:@selector(_checkLastReferenceForIdentifier:) withObject:[self _concatenateKeyWithIBCreatorID:ident] afterDelay:0.1]; } - (void)_postPreferencesChangesNotification { if (!pthread_main_np()) { [self performSelectorOnMainThread:_cmd withObject:nil waitUntilDone:NO]; return; } [[NSNotificationCenter defaultCenter] postNotificationName:WebPreferencesChangedNotification object:self userInfo:nil]; } + (CFStringEncoding)_systemCFStringEncoding { return WKGetWebDefaultCFStringEncoding(); } + (void)_setInitialDefaultTextEncodingToSystemEncoding { NSString *systemEncodingName = (NSString *)CFStringConvertEncodingToIANACharSetName([self _systemCFStringEncoding]); // CFStringConvertEncodingToIANACharSetName() returns cp949 for kTextEncodingDOSKorean AKA "extended EUC-KR" AKA windows-939. // ICU uses this name for a different encoding, so we need to change the name to a value that actually gives us windows-939. // In addition, this value must match what is used in Safari, see <rdar://problem/5579292>. // On some OS versions, the result is CP949 (uppercase). if ([systemEncodingName _webkit_isCaseInsensitiveEqualToString:@"cp949"]) systemEncodingName = @"ks_c_5601-1987"; [[NSUserDefaults standardUserDefaults] registerDefaults: [NSDictionary dictionaryWithObject:systemEncodingName forKey:WebKitDefaultTextEncodingNamePreferenceKey]]; } static NSString *classIBCreatorID = nil; + (void)_setIBCreatorID:(NSString *)string { NSString *old = classIBCreatorID; classIBCreatorID = [string copy]; [old release]; } - (BOOL)isDOMPasteAllowed { return [self _boolValueForKey:WebKitDOMPasteAllowedPreferenceKey]; } - (void)setDOMPasteAllowed:(BOOL)DOMPasteAllowed { [self _setBoolValue:DOMPasteAllowed forKey:WebKitDOMPasteAllowedPreferenceKey]; } - (NSString *)_localStorageDatabasePath { return [[self _stringValueForKey:WebKitLocalStorageDatabasePathPreferenceKey] stringByStandardizingPath]; } - (void)_setLocalStorageDatabasePath:(NSString *)path { [self _setStringValue:[path stringByStandardizingPath] forKey:WebKitLocalStorageDatabasePathPreferenceKey]; } - (NSString *)_ftpDirectoryTemplatePath { return [[self _stringValueForKey:WebKitFTPDirectoryTemplatePath] stringByStandardizingPath]; } - (void)_setFTPDirectoryTemplatePath:(NSString *)path { [self _setStringValue:[path stringByStandardizingPath] forKey:WebKitFTPDirectoryTemplatePath]; } - (BOOL)_forceFTPDirectoryListings { return [self _boolValueForKey:WebKitForceFTPDirectoryListings]; } - (void)_setForceFTPDirectoryListings:(BOOL)force { [self _setBoolValue:force forKey:WebKitForceFTPDirectoryListings]; } - (BOOL)acceleratedCompositingEnabled { return [self _boolValueForKey:WebKitAcceleratedCompositingEnabledPreferenceKey]; } - (void)setAcceleratedCompositingEnabled:(BOOL)enabled { [self _setBoolValue:enabled forKey:WebKitAcceleratedCompositingEnabledPreferenceKey]; } - (BOOL)webGLEnabled { return [self _boolValueForKey:WebKitWebGLEnabledPreferenceKey]; } - (void)setWebGLEnabled:(BOOL)enabled { [self _setBoolValue:enabled forKey:WebKitWebGLEnabledPreferenceKey]; } - (BOOL)pluginHalterEnabled { return [self _boolValueForKey:WebKitPluginHalterEnabledPreferenceKey]; } - (void)setPluginHalterEnabled:(BOOL)enabled { [self _setBoolValue:enabled forKey:WebKitPluginHalterEnabledPreferenceKey]; } - (void)didRemoveFromWebView { ASSERT(_private->numWebViews); if (--_private->numWebViews == 0) [[NSNotificationCenter defaultCenter] postNotificationName:WebPreferencesRemovedNotification object:self userInfo:nil]; } - (void)willAddToWebView { ++_private->numWebViews; } - (void)_setPreferenceForTestWithValue:(NSString *)value forKey:(NSString *)key { [self _setStringValue:value forKey:key]; } @end @implementation WebPreferences (WebInternal) + (NSString *)_IBCreatorID { return classIBCreatorID; } + (NSString *)_concatenateKeyWithIBCreatorID:(NSString *)key { NSString *IBCreatorID = [WebPreferences _IBCreatorID]; if (!IBCreatorID) return key; return [IBCreatorID stringByAppendingString:key]; } @end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebHTMLView.mm�������������������������������������������������������������������0000644�0001750�0001750�00000676243�11254766750�015076� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * (C) 2006, 2007 Graham Dennis (graham.dennis@gmail.com) * * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebHTMLView.h" #import "DOMCSSStyleDeclarationInternal.h" #import "DOMDocumentFragmentInternal.h" #import "DOMDocumentInternal.h" #import "DOMNodeInternal.h" #import "DOMRangeInternal.h" #import "WebArchive.h" #import "WebClipView.h" #import "WebDOMOperationsInternal.h" #import "WebDataSourceInternal.h" #import "WebDefaultUIDelegate.h" #import "WebDelegateImplementationCaching.h" #import "WebDocumentInternal.h" #import "WebDynamicScrollBarsView.h" #import "WebEditingDelegate.h" #import "WebElementDictionary.h" #import "WebFrameInternal.h" #import "WebFramePrivate.h" #import "WebFrameViewInternal.h" #import "WebHTMLRepresentationPrivate.h" #import "WebHTMLViewInternal.h" #import "WebKitLogging.h" #import "WebKitNSStringExtras.h" #import "WebKitVersionChecks.h" #import "WebLocalizableStrings.h" #import "WebNSAttributedStringExtras.h" #import "WebNSEventExtras.h" #import "WebNSFileManagerExtras.h" #import "WebNSImageExtras.h" #import "WebNSObjectExtras.h" #import "WebNSPasteboardExtras.h" #import "WebNSPrintOperationExtras.h" #import "WebNSURLExtras.h" #import "WebNSViewExtras.h" #import "WebNetscapePluginView.h" #import "WebNodeHighlight.h" #import "WebPluginController.h" #import "WebPreferences.h" #import "WebPreferencesPrivate.h" #import "WebResourcePrivate.h" #import "WebStringTruncator.h" #import "WebTextCompletionController.h" #import "WebTypesInternal.h" #import "WebUIDelegatePrivate.h" #import "WebViewInternal.h" #import <AppKit/NSAccessibility.h> #import <ApplicationServices/ApplicationServices.h> #import <WebCore/CSSMutableStyleDeclaration.h> #import <WebCore/CachedImage.h> #import <WebCore/CachedResourceClient.h> #import <WebCore/ColorMac.h> #import <WebCore/ContextMenu.h> #import <WebCore/ContextMenuController.h> #import <WebCore/Document.h> #import <WebCore/DocumentFragment.h> #import <WebCore/DragController.h> #import <WebCore/Editor.h> #import <WebCore/EditorDeleteAction.h> #import <WebCore/Element.h> #import <WebCore/EventHandler.h> #import <WebCore/ExceptionHandlers.h> #import <WebCore/FloatRect.h> #import <WebCore/FocusController.h> #import <WebCore/Frame.h> #import <WebCore/FrameLoader.h> #import <WebCore/FrameView.h> #import <WebCore/HTMLNames.h> #import <WebCore/HitTestResult.h> #import <WebCore/Image.h> #import <WebCore/KeyboardEvent.h> #import <WebCore/LegacyWebArchive.h> #import <WebCore/MIMETypeRegistry.h> #import <WebCore/Page.h> #import <WebCore/PlatformKeyboardEvent.h> #import <WebCore/Range.h> #import <WebCore/SelectionController.h> #import <WebCore/SharedBuffer.h> #import <WebCore/SimpleFontData.h> #import <WebCore/Text.h> #import <WebCore/WebCoreObjCExtras.h> #import <WebCore/WebFontCache.h> #import <WebCore/markup.h> #import <WebKit/DOM.h> #import <WebKit/DOMExtensions.h> #import <WebKit/DOMPrivate.h> #import <WebKitSystemInterface.h> #import <dlfcn.h> #import <limits> #import <runtime/InitializeThreading.h> #if USE(ACCELERATED_COMPOSITING) #import <QuartzCore/QuartzCore.h> #endif using namespace WebCore; using namespace HTMLNames; using namespace WTF; using namespace std; @interface NSWindow (BorderViewAccess) - (NSView*)_web_borderView; @end @implementation NSWindow (BorderViewAccess) - (NSView*)_web_borderView { return _borderView; } @end @interface WebResponderChainSink : NSResponder { NSResponder* _lastResponderInChain; BOOL _receivedUnhandledCommand; } - (id)initWithResponderChain:(NSResponder *)chain; - (void)detach; - (BOOL)receivedUnhandledCommand; @end static IMP oldSetCursorIMP = NULL; #ifdef BUILDING_ON_TIGER static IMP oldResetCursorRectsIMP = NULL; static BOOL canSetCursor = YES; static void resetCursorRects(NSWindow* self, SEL cmd) { NSPoint point = [self mouseLocationOutsideOfEventStream]; NSView* view = [[self _web_borderView] hitTest:point]; if ([view isKindOfClass:[WebHTMLView class]]) { WebHTMLView *htmlView = (WebHTMLView*)view; NSPoint localPoint = [htmlView convertPoint:point fromView:nil]; NSDictionary *dict = [htmlView elementAtPoint:localPoint allowShadowContent:NO]; DOMElement *element = [dict objectForKey:WebElementDOMNodeKey]; if (![element isKindOfClass:[DOMHTMLAppletElement class]] && ![element isKindOfClass:[DOMHTMLObjectElement class]] && ![element isKindOfClass:[DOMHTMLEmbedElement class]]) canSetCursor = NO; } oldResetCursorRectsIMP(self, cmd); canSetCursor = YES; } static void setCursor(NSCursor* self, SEL cmd) { if (canSetCursor) oldSetCursorIMP(self, cmd); } #else static void setCursor(NSWindow* self, SEL cmd, NSPoint point) { NSView* view = [[self _web_borderView] hitTest:point]; if ([view isKindOfClass:[WebHTMLView class]]) { WebHTMLView *htmlView = (WebHTMLView*)view; NSPoint localPoint = [htmlView convertPoint:point fromView:nil]; NSDictionary *dict = [htmlView elementAtPoint:localPoint allowShadowContent:NO]; DOMElement *element = [dict objectForKey:WebElementDOMNodeKey]; if (![element isKindOfClass:[DOMHTMLAppletElement class]] && ![element isKindOfClass:[DOMHTMLObjectElement class]] && ![element isKindOfClass:[DOMHTMLEmbedElement class]]) return; } oldSetCursorIMP(self, cmd, point); } #endif extern "C" { // Need to declare these attribute names because AppKit exports them but does not make them available in API or SPI headers. extern NSString *NSMarkedClauseSegmentAttributeName; extern NSString *NSTextInputReplacementRangeAttributeName; } @interface NSView (WebNSViewDetails) - (void)_recursiveDisplayRectIfNeededIgnoringOpacity:(NSRect)rect isVisibleRect:(BOOL)isVisibleRect rectIsVisibleRectForView:(NSView *)visibleView topView:(BOOL)topView; - (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)needsLockFocus visRect:(NSRect)visRect; - (void)_recursive:(BOOL)recurse displayRectIgnoringOpacity:(NSRect)displayRect inContext:(NSGraphicsContext *)context topView:(BOOL)topView; - (NSRect)_dirtyRect; - (void)_setDrawsOwnDescendants:(BOOL)drawsOwnDescendants; - (void)_propagateDirtyRectsToOpaqueAncestors; - (void)_windowChangedKeyState; #if USE(ACCELERATED_COMPOSITING) && defined(BUILDING_ON_LEOPARD) - (void)_updateLayerGeometryFromView; #endif @end @interface NSApplication (WebNSApplicationDetails) - (void)speakString:(NSString *)string; @end @interface NSWindow (WebNSWindowDetails) - (id)_newFirstResponderAfterResigning; @end @interface NSAttributedString (WebNSAttributedStringDetails) - (id)_initWithDOMRange:(DOMRange *)range; - (DOMDocumentFragment *)_documentFromRange:(NSRange)range document:(DOMDocument *)document documentAttributes:(NSDictionary *)dict subresources:(NSArray **)subresources; @end @interface NSSpellChecker (WebNSSpellCheckerDetails) - (void)learnWord:(NSString *)word; @end // By imaging to a width a little wider than the available pixels, // thin pages will be scaled down a little, matching the way they // print in IE and Camino. This lets them use fewer sheets than they // would otherwise, which is presumably why other browsers do this. // Wide pages will be scaled down more than this. #define PrintingMinimumShrinkFactor 1.25f // This number determines how small we are willing to reduce the page content // in order to accommodate the widest line. If the page would have to be // reduced smaller to make the widest line fit, we just clip instead (this // behavior matches MacIE and Mozilla, at least) #define PrintingMaximumShrinkFactor 2.0f // This number determines how short the last printed page of a multi-page print session // can be before we try to shrink the scale in order to reduce the number of pages, and // thus eliminate the orphan. #define LastPrintedPageOrphanRatio 0.1f // This number determines the amount the scale factor is adjusted to try to eliminate orphans. // It has no direct mathematical relationship to LastPrintedPageOrphanRatio, due to variable // numbers of pages, logic to avoid breaking elements, and CSS-supplied hard page breaks. #define PrintingOrphanShrinkAdjustment 1.1f #define AUTOSCROLL_INTERVAL 0.1f #define DRAG_LABEL_BORDER_X 4.0f //Keep border_y in synch with DragController::LinkDragBorderInset #define DRAG_LABEL_BORDER_Y 2.0f #define DRAG_LABEL_RADIUS 5.0f #define DRAG_LABEL_BORDER_Y_OFFSET 2.0f #define MIN_DRAG_LABEL_WIDTH_BEFORE_CLIP 120.0f #define MAX_DRAG_LABEL_WIDTH 320.0f #define DRAG_LINK_LABEL_FONT_SIZE 11.0f #define DRAG_LINK_URL_FONT_SIZE 10.0f // Any non-zero value will do, but using something recognizable might help us debug some day. #define TRACKING_RECT_TAG 0xBADFACE // FIXME: This constant is copied from AppKit's _NXSmartPaste constant. #define WebSmartPastePboardType @"NeXT smart paste pasteboard type" #define STANDARD_WEIGHT 5 #define MIN_BOLD_WEIGHT 7 #define STANDARD_BOLD_WEIGHT 9 // Fake URL scheme. #define WebDataProtocolScheme @"webkit-fake-url" // <rdar://problem/4985524> References to WebCoreScrollView as a subview of a WebHTMLView may be present // in some NIB files, so NSUnarchiver must be still able to look up this now-unused class. @interface WebCoreScrollView : NSScrollView @end @implementation WebCoreScrollView @end // if YES, do the standard NSView hit test (which can't give the right result when HTML overlaps a view) static BOOL forceNSViewHitTest; // if YES, do the "top WebHTMLView" hit test (which we'd like to do all the time but can't because of Java requirements [see bug 4349721]) static BOOL forceWebHTMLViewHitTest; static WebHTMLView *lastHitView; // We need this to be able to safely reference the CachedImage for the promised drag data static CachedResourceClient* promisedDataClient() { static CachedResourceClient* staticCachedResourceClient = new CachedResourceClient; return staticCachedResourceClient; } @interface WebHTMLView (WebHTMLViewFileInternal) - (BOOL)_imageExistsAtPaths:(NSArray *)paths; - (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard inContext:(DOMRange *)context allowPlainText:(BOOL)allowPlainText; - (NSString *)_plainTextFromPasteboard:(NSPasteboard *)pasteboard; - (void)_pasteWithPasteboard:(NSPasteboard *)pasteboard allowPlainText:(BOOL)allowPlainText; - (void)_pasteAsPlainTextWithPasteboard:(NSPasteboard *)pasteboard; - (void)_removeMouseMovedObserverUnconditionally; - (void)_removeSuperviewObservers; - (void)_removeWindowObservers; - (BOOL)_shouldInsertFragment:(DOMDocumentFragment *)fragment replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action; - (BOOL)_shouldInsertText:(NSString *)text replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action; - (BOOL)_shouldReplaceSelectionWithText:(NSString *)text givenAction:(WebViewInsertAction)action; - (float)_calculatePrintHeight; - (DOMRange *)_selectedRange; - (BOOL)_shouldDeleteRange:(DOMRange *)range; - (NSView *)_hitViewForEvent:(NSEvent *)event; - (void)_writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard cachedAttributedString:(NSAttributedString *)attributedString; - (DOMRange *)_documentRange; - (void)_setMouseDownEvent:(NSEvent *)event; - (WebHTMLView *)_topHTMLView; - (BOOL)_isTopHTMLView; - (void)_web_setPrintingModeRecursive; - (void)_web_setPrintingModeRecursiveAndAdjustViewSize; - (void)_web_clearPrintingModeRecursive; @end #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) @interface WebHTMLView (WebHTMLViewTextCheckingInternal) - (void)orderFrontSubstitutionsPanel:(id)sender; - (BOOL)smartInsertDeleteEnabled; - (void)setSmartInsertDeleteEnabled:(BOOL)flag; - (void)toggleSmartInsertDelete:(id)sender; - (BOOL)isAutomaticQuoteSubstitutionEnabled; - (void)setAutomaticQuoteSubstitutionEnabled:(BOOL)flag; - (void)toggleAutomaticQuoteSubstitution:(id)sender; - (BOOL)isAutomaticLinkDetectionEnabled; - (void)setAutomaticLinkDetectionEnabled:(BOOL)flag; - (void)toggleAutomaticLinkDetection:(id)sender; - (BOOL)isAutomaticDashSubstitutionEnabled; - (void)setAutomaticDashSubstitutionEnabled:(BOOL)flag; - (void)toggleAutomaticDashSubstitution:(id)sender; - (BOOL)isAutomaticTextReplacementEnabled; - (void)setAutomaticTextReplacementEnabled:(BOOL)flag; - (void)toggleAutomaticTextReplacement:(id)sender; - (BOOL)isAutomaticSpellingCorrectionEnabled; - (void)setAutomaticSpellingCorrectionEnabled:(BOOL)flag; - (void)toggleAutomaticSpellingCorrection:(id)sender; @end #endif @interface WebHTMLView (WebForwardDeclaration) // FIXME: Put this in a normal category and stop doing the forward declaration trick. - (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize; @end @class NSTextInputContext; @interface NSResponder (AppKitDetails) - (NSTextInputContext *)inputContext; @end @interface NSObject (NSTextInputContextDetails) - (BOOL)wantsToHandleMouseEvents; - (BOOL)handleMouseEvent:(NSEvent *)event; @end @interface WebHTMLView (WebNSTextInputSupport) <NSTextInput> - (void)_updateSelectionForInputManager; @end @interface WebHTMLView (WebEditingStyleSupport) - (DOMCSSStyleDeclaration *)_emptyStyle; - (NSString *)_colorAsString:(NSColor *)color; @end @interface NSView (WebHTMLViewFileInternal) - (void)_web_addDescendantWebHTMLViewsToArray:(NSMutableArray *) array; @end @interface NSMutableDictionary (WebHTMLViewFileInternal) - (void)_web_setObjectIfNotNil:(id)object forKey:(id)key; @end struct WebHTMLViewInterpretKeyEventsParameters { KeyboardEvent* event; BOOL eventWasHandled; BOOL shouldSaveCommand; // The Input Method may consume an event and not tell us, in // which case we should not bubble the event up the DOM BOOL consumedByIM; }; @interface WebHTMLViewPrivate : NSObject { @public BOOL closed; BOOL needsToApplyStyles; BOOL ignoringMouseDraggedEvents; BOOL printing; BOOL avoidingPrintOrphan; BOOL observingMouseMovedNotifications; BOOL observingSuperviewNotifications; BOOL observingWindowNotifications; id savedSubviews; BOOL subviewsSetAside; #if USE(ACCELERATED_COMPOSITING) NSView *layerHostingView; #endif NSEvent *mouseDownEvent; // Kept after handling the event. BOOL handlingMouseDownEvent; NSEvent *keyDownEvent; // Kept after handling the event. // A WebHTMLView has a single input context, but we return nil when in non-editable content to avoid making input methods do their work. // This state is saved each time selection changes, because computing it causes style recalc, which is not always safe to do. BOOL exposeInputContext; NSPoint lastScrollPosition; WebPluginController *pluginController; NSString *toolTip; NSToolTipTag lastToolTipTag; id trackingRectOwner; void *trackingRectUserData; NSTimer *autoscrollTimer; NSEvent *autoscrollTriggerEvent; NSArray *pageRects; NSMutableDictionary *highlighters; #ifdef BUILDING_ON_TIGER BOOL nextResponderDisabledOnce; #endif WebTextCompletionController *completionController; BOOL transparentBackground; WebHTMLViewInterpretKeyEventsParameters* interpretKeyEventsParameters; BOOL receivedNOOP; WebDataSource *dataSource; WebCore::CachedImage* promisedDragTIFFDataSource; CFRunLoopTimerRef updateMouseoverTimer; SEL selectorForDoCommandBySelector; #ifndef NDEBUG BOOL enumeratingSubviews; #endif } - (void)clear; @end static NSCellStateValue kit(TriState state) { switch (state) { case FalseTriState: return NSOffState; case TrueTriState: return NSOnState; case MixedTriState: return NSMixedState; } ASSERT_NOT_REACHED(); return NSOffState; } @implementation WebHTMLViewPrivate + (void)initialize { JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif if (!oldSetCursorIMP) { #ifdef BUILDING_ON_TIGER Method setCursorMethod = class_getInstanceMethod([NSCursor class], @selector(set)); #else Method setCursorMethod = class_getInstanceMethod([NSWindow class], @selector(_setCursorForMouseLocation:)); #endif ASSERT(setCursorMethod); oldSetCursorIMP = method_setImplementation(setCursorMethod, (IMP)setCursor); ASSERT(oldSetCursorIMP); } #ifdef BUILDING_ON_TIGER if (!oldResetCursorRectsIMP) { Method resetCursorRectsMethod = class_getInstanceMethod([NSWindow class], @selector(resetCursorRects)); ASSERT(resetCursorRectsMethod); oldResetCursorRectsIMP = method_setImplementation(resetCursorRectsMethod, (IMP)resetCursorRects); ASSERT(oldResetCursorRectsIMP); } #endif } - (void)dealloc { if (WebCoreObjCScheduleDeallocateOnMainThread([WebHTMLViewPrivate class], self)) return; ASSERT(!autoscrollTimer); ASSERT(!autoscrollTriggerEvent); ASSERT(!updateMouseoverTimer); [mouseDownEvent release]; [keyDownEvent release]; [pluginController release]; [toolTip release]; [completionController release]; [dataSource release]; [highlighters release]; if (promisedDragTIFFDataSource) promisedDragTIFFDataSource->removeClient(promisedDataClient()); [super dealloc]; } - (void)finalize { ASSERT_MAIN_THREAD(); if (promisedDragTIFFDataSource) promisedDragTIFFDataSource->removeClient(promisedDataClient()); [super finalize]; } - (void)clear { [mouseDownEvent release]; [keyDownEvent release]; [pluginController release]; [toolTip release]; [completionController release]; [dataSource release]; [highlighters release]; if (promisedDragTIFFDataSource) promisedDragTIFFDataSource->removeClient(promisedDataClient()); mouseDownEvent = nil; keyDownEvent = nil; pluginController = nil; toolTip = nil; completionController = nil; dataSource = nil; highlighters = nil; promisedDragTIFFDataSource = 0; #if USE(ACCELERATED_COMPOSITING) layerHostingView = nil; #endif } @end @implementation WebHTMLView (WebHTMLViewFileInternal) - (DOMRange *)_documentRange { return [[[self _frame] DOMDocument] _documentRange]; } - (BOOL)_imageExistsAtPaths:(NSArray *)paths { NSEnumerator *enumerator = [paths objectEnumerator]; NSString *path; while ((path = [enumerator nextObject]) != nil) { NSString *MIMEType = WKGetMIMETypeForExtension([path pathExtension]); if (MIMETypeRegistry::isSupportedImageResourceMIMEType(MIMEType)) return YES; } return NO; } - (WebDataSource *)_dataSource { return _private->dataSource; } - (WebView *)_webView { return [_private->dataSource _webView]; } - (WebFrameView *)_frameView { return [[_private->dataSource webFrame] frameView]; } - (DOMDocumentFragment *)_documentFragmentWithPaths:(NSArray *)paths { DOMDocumentFragment *fragment; NSEnumerator *enumerator = [paths objectEnumerator]; NSMutableArray *domNodes = [[NSMutableArray alloc] init]; NSString *path; while ((path = [enumerator nextObject]) != nil) { // Non-image file types; _web_userVisibleString is appropriate here because this will // be pasted as visible text. NSString *url = [[[NSURL fileURLWithPath:path] _webkit_canonicalize] _web_userVisibleString]; [domNodes addObject:[[[self _frame] DOMDocument] createTextNode: url]]; } fragment = [[self _frame] _documentFragmentWithNodesAsParagraphs:domNodes]; [domNodes release]; return [fragment firstChild] != nil ? fragment : nil; } + (NSArray *)_excludedElementsForAttributedStringConversion { static NSArray *elements = nil; if (elements == nil) { elements = [[NSArray alloc] initWithObjects: // Omit style since we want style to be inline so the fragment can be easily inserted. @"style", // Omit xml so the result is not XHTML. @"xml", // Omit tags that will get stripped when converted to a fragment anyway. @"doctype", @"html", @"head", @"body", // Omit deprecated tags. @"applet", @"basefont", @"center", @"dir", @"font", @"isindex", @"menu", @"s", @"strike", @"u", // Omit object so no file attachments are part of the fragment. @"object", nil]; CFRetain(elements); } return elements; } static NSURL* uniqueURLWithRelativePart(NSString *relativePart) { CFUUIDRef UUIDRef = CFUUIDCreate(kCFAllocatorDefault); NSString *UUIDString = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, UUIDRef); CFRelease(UUIDRef); NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@/%@", WebDataProtocolScheme, UUIDString, relativePart]]; CFRelease(UUIDString); return URL; } - (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard inContext:(DOMRange *)context allowPlainText:(BOOL)allowPlainText { NSArray *types = [pasteboard types]; DOMDocumentFragment *fragment = nil; if ([types containsObject:WebArchivePboardType] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:WebArchivePboardType inContext:context subresources:0])) return fragment; if ([types containsObject:NSFilenamesPboardType] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:NSFilenamesPboardType inContext:context subresources:0])) return fragment; if ([types containsObject:NSHTMLPboardType] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:NSHTMLPboardType inContext:context subresources:0])) return fragment; if ([types containsObject:NSRTFDPboardType] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:NSRTFDPboardType inContext:context subresources:0])) return fragment; if ([types containsObject:NSRTFPboardType] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:NSRTFPboardType inContext:context subresources:0])) return fragment; if ([types containsObject:NSTIFFPboardType] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:NSTIFFPboardType inContext:context subresources:0])) return fragment; if ([types containsObject:NSPDFPboardType] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:NSPDFPboardType inContext:context subresources:0])) return fragment; #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) if ([types containsObject:NSPICTPboardType] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:NSPICTPboardType inContext:context subresources:0])) return fragment; #endif // Only 10.5 and higher support setting and retrieving pasteboard types with UTIs, but we don't believe // that any applications on Tiger put types for which we only have a UTI, like PNG, on the pasteboard. if ([types containsObject:(NSString*)kUTTypePNG] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:(NSString*)kUTTypePNG inContext:context subresources:0])) return fragment; if ([types containsObject:NSURLPboardType] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:NSURLPboardType inContext:context subresources:0])) return fragment; if (allowPlainText && [types containsObject:NSStringPboardType] && (fragment = [self _documentFragmentFromPasteboard:pasteboard forType:NSStringPboardType inContext:context subresources:0])) { return fragment; } return nil; } - (NSString *)_plainTextFromPasteboard:(NSPasteboard *)pasteboard { NSArray *types = [pasteboard types]; if ([types containsObject:NSStringPboardType]) return [[pasteboard stringForType:NSStringPboardType] precomposedStringWithCanonicalMapping]; NSAttributedString *attributedString = nil; NSString *string; if ([types containsObject:NSRTFDPboardType]) attributedString = [[NSAttributedString alloc] initWithRTFD:[pasteboard dataForType:NSRTFDPboardType] documentAttributes:NULL]; if (attributedString == nil && [types containsObject:NSRTFPboardType]) attributedString = [[NSAttributedString alloc] initWithRTF:[pasteboard dataForType:NSRTFPboardType] documentAttributes:NULL]; if (attributedString != nil) { string = [[attributedString string] copy]; [attributedString release]; return [string autorelease]; } if ([types containsObject:NSFilenamesPboardType]) { string = [[pasteboard propertyListForType:NSFilenamesPboardType] componentsJoinedByString:@"\n"]; if (string != nil) return string; } NSURL *URL; if ((URL = [NSURL URLFromPasteboard:pasteboard])) { string = [URL _web_userVisibleString]; if ([string length] > 0) return string; } return nil; } - (void)_pasteWithPasteboard:(NSPasteboard *)pasteboard allowPlainText:(BOOL)allowPlainText { WebView *webView = [[self _webView] retain]; [webView _setInsertionPasteboard:pasteboard]; DOMRange *range = [self _selectedRange]; DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText]; if (fragment && [self _shouldInsertFragment:fragment replacingDOMRange:range givenAction:WebViewInsertActionPasted]) [[self _frame] _replaceSelectionWithFragment:fragment selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard] matchStyle:NO]; [webView _setInsertionPasteboard:nil]; [webView release]; } - (void)_pasteAsPlainTextWithPasteboard:(NSPasteboard *)pasteboard { WebView *webView = [[self _webView] retain]; [webView _setInsertionPasteboard:pasteboard]; NSString *text = [self _plainTextFromPasteboard:pasteboard]; if ([self _shouldReplaceSelectionWithText:text givenAction:WebViewInsertActionPasted]) [[self _frame] _replaceSelectionWithText:text selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard]]; [webView _setInsertionPasteboard:nil]; [webView release]; } - (void)_removeMouseMovedObserverUnconditionally { if (!_private || !_private->observingMouseMovedNotifications) return; [[NSNotificationCenter defaultCenter] removeObserver:self name:WKMouseMovedNotification() object:nil]; _private->observingMouseMovedNotifications = false; } - (void)_removeSuperviewObservers { if (!_private || !_private->observingSuperviewNotifications) return; NSView *superview = [self superview]; if (!superview || ![self window]) return; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter removeObserver:self name:NSViewFrameDidChangeNotification object:superview]; [notificationCenter removeObserver:self name:NSViewBoundsDidChangeNotification object:superview]; _private->observingSuperviewNotifications = false; } - (void)_removeWindowObservers { if (!_private->observingWindowNotifications) return; NSWindow *window = [self window]; if (!window) return; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter removeObserver:self name:NSWindowDidBecomeKeyNotification object:nil]; [notificationCenter removeObserver:self name:NSWindowDidResignKeyNotification object:nil]; [notificationCenter removeObserver:self name:NSWindowWillCloseNotification object:window]; _private->observingWindowNotifications = false; } - (BOOL)_shouldInsertFragment:(DOMDocumentFragment *)fragment replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action { WebView *webView = [self _webView]; DOMNode *child = [fragment firstChild]; if ([fragment lastChild] == child && [child isKindOfClass:[DOMCharacterData class]]) return [[webView _editingDelegateForwarder] webView:webView shouldInsertText:[(DOMCharacterData *)child data] replacingDOMRange:range givenAction:action]; return [[webView _editingDelegateForwarder] webView:webView shouldInsertNode:fragment replacingDOMRange:range givenAction:action]; } - (BOOL)_shouldInsertText:(NSString *)text replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action { WebView *webView = [self _webView]; return [[webView _editingDelegateForwarder] webView:webView shouldInsertText:text replacingDOMRange:range givenAction:action]; } - (BOOL)_shouldReplaceSelectionWithText:(NSString *)text givenAction:(WebViewInsertAction)action { return [self _shouldInsertText:text replacingDOMRange:[self _selectedRange] givenAction:action]; } // Calculate the vertical size of the view that fits on a single page - (float)_calculatePrintHeight { // Obtain the print info object for the current operation NSPrintInfo *pi = [[NSPrintOperation currentOperation] printInfo]; // Calculate the page height in points NSSize paperSize = [pi paperSize]; return paperSize.height - [pi topMargin] - [pi bottomMargin]; } - (DOMRange *)_selectedRange { Frame* coreFrame = core([self _frame]); return coreFrame ? kit(coreFrame->selection()->toNormalizedRange().get()) : nil; } - (BOOL)_shouldDeleteRange:(DOMRange *)range { Frame* coreFrame = core([self _frame]); return coreFrame && coreFrame->editor()->shouldDeleteRange(core(range)); } - (NSView *)_hitViewForEvent:(NSEvent *)event { // Usually, we hack AK's hitTest method to catch all events at the topmost WebHTMLView. // Callers of this method, however, want to query the deepest view instead. forceNSViewHitTest = YES; NSView *hitView = [[[self window] contentView] hitTest:[event locationInWindow]]; forceNSViewHitTest = NO; return hitView; } - (void)_writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard cachedAttributedString:(NSAttributedString *)attributedString { // Put HTML on the pasteboard. if ([types containsObject:WebArchivePboardType]) { if (RefPtr<LegacyWebArchive> coreArchive = LegacyWebArchive::createFromSelection(core([self _frame]))) { if (RetainPtr<CFDataRef> data = coreArchive ? coreArchive->rawDataRepresentation() : 0) [pasteboard setData:(NSData *)data.get() forType:WebArchivePboardType]; } } // Put the attributed string on the pasteboard (RTF/RTFD format). if ([types containsObject:NSRTFDPboardType]) { if (attributedString == nil) { attributedString = [self selectedAttributedString]; } NSData *RTFDData = [attributedString RTFDFromRange:NSMakeRange(0, [attributedString length]) documentAttributes:nil]; [pasteboard setData:RTFDData forType:NSRTFDPboardType]; } if ([types containsObject:NSRTFPboardType]) { if (attributedString == nil) { attributedString = [self selectedAttributedString]; } if ([attributedString containsAttachments]) { attributedString = [attributedString _web_attributedStringByStrippingAttachmentCharacters]; } NSData *RTFData = [attributedString RTFFromRange:NSMakeRange(0, [attributedString length]) documentAttributes:nil]; [pasteboard setData:RTFData forType:NSRTFPboardType]; } // Put plain string on the pasteboard. if ([types containsObject:NSStringPboardType]) { // Map   to a plain old space because this is better for source code, other browsers do it, // and because HTML forces you to do this any time you want two spaces in a row. NSMutableString *s = [[self selectedString] mutableCopy]; const unichar NonBreakingSpaceCharacter = 0xA0; NSString *NonBreakingSpaceString = [NSString stringWithCharacters:&NonBreakingSpaceCharacter length:1]; [s replaceOccurrencesOfString:NonBreakingSpaceString withString:@" " options:0 range:NSMakeRange(0, [s length])]; [pasteboard setString:s forType:NSStringPboardType]; [s release]; } if ([self _canSmartCopyOrDelete] && [types containsObject:WebSmartPastePboardType]) { [pasteboard setData:nil forType:WebSmartPastePboardType]; } } - (void)_setMouseDownEvent:(NSEvent *)event { ASSERT(!event || [event type] == NSLeftMouseDown || [event type] == NSRightMouseDown || [event type] == NSOtherMouseDown); if (event == _private->mouseDownEvent) return; [event retain]; [_private->mouseDownEvent release]; _private->mouseDownEvent = event; } - (void)_cancelUpdateMouseoverTimer { if (_private->updateMouseoverTimer) { CFRunLoopTimerInvalidate(_private->updateMouseoverTimer); CFRelease(_private->updateMouseoverTimer); _private->updateMouseoverTimer = NULL; } } - (WebHTMLView *)_topHTMLView { // FIXME: this can fail if the dataSource is nil, which happens when the WebView is tearing down from the window closing. WebHTMLView *view = (WebHTMLView *)[[[[_private->dataSource _webView] mainFrame] frameView] documentView]; ASSERT(!view || [view isKindOfClass:[WebHTMLView class]]); return view; } - (BOOL)_isTopHTMLView { // FIXME: this should be a cached boolean that doesn't rely on _topHTMLView since that can fail (see _topHTMLView). return self == [self _topHTMLView]; } - (void)_web_setPrintingModeRecursive { [self _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; #ifndef NDEBUG _private->enumeratingSubviews = YES; #endif NSMutableArray *descendantWebHTMLViews = [[NSMutableArray alloc] init]; [self _web_addDescendantWebHTMLViewsToArray:descendantWebHTMLViews]; unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; [descendantWebHTMLViews release]; #ifndef NDEBUG _private->enumeratingSubviews = NO; #endif } - (void)_web_clearPrintingModeRecursive { [self _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; #ifndef NDEBUG _private->enumeratingSubviews = YES; #endif NSMutableArray *descendantWebHTMLViews = [[NSMutableArray alloc] init]; [self _web_addDescendantWebHTMLViewsToArray:descendantWebHTMLViews]; unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; [descendantWebHTMLViews release]; #ifndef NDEBUG _private->enumeratingSubviews = NO; #endif } - (void)_web_setPrintingModeRecursiveAndAdjustViewSize { [self _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:YES]; #ifndef NDEBUG _private->enumeratingSubviews = YES; #endif NSMutableArray *descendantWebHTMLViews = [[NSMutableArray alloc] init]; [self _web_addDescendantWebHTMLViewsToArray:descendantWebHTMLViews]; unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:YES]; [descendantWebHTMLViews release]; #ifndef NDEBUG _private->enumeratingSubviews = NO; #endif } @end @implementation WebHTMLView (WebPrivate) + (NSArray *)supportedMIMETypes { return [WebHTMLRepresentation supportedMIMETypes]; } + (NSArray *)supportedImageMIMETypes { return [WebHTMLRepresentation supportedImageMIMETypes]; } + (NSArray *)supportedNonImageMIMETypes { return [WebHTMLRepresentation supportedNonImageMIMETypes]; } + (NSArray *)unsupportedTextMIMETypes { return [NSArray arrayWithObjects: @"text/calendar", // iCal @"text/x-calendar", @"text/x-vcalendar", @"text/vcalendar", @"text/vcard", // vCard @"text/x-vcard", @"text/directory", @"text/ldif", // Netscape Address Book @"text/qif", // Quicken @"text/x-qif", @"text/x-csv", // CSV (for Address Book and Microsoft Outlook) @"text/x-vcf", // vCard type used in Sun affinity app @"text/rtf", // Rich Text Format nil]; } + (void)_postFlagsChangedEvent:(NSEvent *)flagsChangedEvent { // This is a workaround for: <rdar://problem/2981619> NSResponder_Private should include notification for FlagsChanged NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:[[flagsChangedEvent window] convertScreenToBase:[NSEvent mouseLocation]] modifierFlags:[flagsChangedEvent modifierFlags] timestamp:[flagsChangedEvent timestamp] windowNumber:[flagsChangedEvent windowNumber] context:[flagsChangedEvent context] eventNumber:0 clickCount:0 pressure:0]; // Pretend it's a mouse move. [[NSNotificationCenter defaultCenter] postNotificationName:WKMouseMovedNotification() object:self userInfo:[NSDictionary dictionaryWithObject:fakeEvent forKey:@"NSEvent"]]; } - (id)_bridge { // This method exists to maintain compatibility with Leopard's Dictionary.app, since it // calls _bridge to get access to convertNSRangeToDOMRange: and convertDOMRangeToNSRange:. // Return the WebFrame, which implements the compatibility methods. <rdar://problem/6002160> return [self _frame]; } - (void)_updateMouseoverWithFakeEvent { [self _cancelUpdateMouseoverTimer]; NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:[[self window] convertScreenToBase:[NSEvent mouseLocation]] modifierFlags:[[NSApp currentEvent] modifierFlags] timestamp:[NSDate timeIntervalSinceReferenceDate] windowNumber:[[self window] windowNumber] context:[[NSApp currentEvent] context] eventNumber:0 clickCount:0 pressure:0]; [self _updateMouseoverWithEvent:fakeEvent]; } static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) { WebHTMLView *view = (WebHTMLView *)info; [view _updateMouseoverWithFakeEvent]; } - (void)_frameOrBoundsChanged { NSPoint origin = [[self superview] bounds].origin; if (!NSEqualPoints(_private->lastScrollPosition, origin)) { if (Frame* coreFrame = core([self _frame])) { if (FrameView* coreView = coreFrame->view()) coreView->scrollPositionChanged(); } [_private->completionController endRevertingChange:NO moveLeft:NO]; WebView *webView = [self _webView]; [[webView _UIDelegateForwarder] webView:webView didScrollDocumentInFrameView:[self _frameView]]; } _private->lastScrollPosition = origin; if ([self window] && !_private->closed && !_private->updateMouseoverTimer) { CFRunLoopTimerContext context = { 0, self, NULL, NULL, NULL }; // Use a 100ms delay so that the synthetic mouse over update doesn't cause cursor thrashing when pages are loading // and scrolling rapidly back to back. _private->updateMouseoverTimer = CFRunLoopTimerCreate(NULL, CFAbsoluteTimeGetCurrent() + 0.1, 0, 0, 0, _updateMouseoverTimerCallback, &context); CFRunLoopAddTimer(CFRunLoopGetCurrent(), _private->updateMouseoverTimer, kCFRunLoopDefaultMode); } #if USE(ACCELERATED_COMPOSITING) && defined(BUILDING_ON_LEOPARD) [self _updateLayerHostingViewPosition]; #endif } - (void)_setAsideSubviews { ASSERT(!_private->subviewsSetAside); ASSERT(_private->savedSubviews == nil); _private->savedSubviews = _subviews; #if USE(ACCELERATED_COMPOSITING) // We need to keep the layer-hosting view in the subviews, otherwise the layers flash. if (_private->layerHostingView) { NSArray* newSubviews = [[NSArray alloc] initWithObjects:_private->layerHostingView, nil]; _subviews = newSubviews; } else _subviews = nil; #else _subviews = nil; #endif _private->subviewsSetAside = YES; } - (void)_restoreSubviews { ASSERT(_private->subviewsSetAside); #if USE(ACCELERATED_COMPOSITING) if (_private->layerHostingView) { [_subviews release]; _subviews = _private->savedSubviews; } else { ASSERT(_subviews == nil); _subviews = _private->savedSubviews; } #else ASSERT(_subviews == nil); _subviews = _private->savedSubviews; #endif _private->savedSubviews = nil; _private->subviewsSetAside = NO; } #ifndef NDEBUG - (void)didAddSubview:(NSView *)subview { if (_private->enumeratingSubviews) LOG(View, "A view of class %s was added during subview enumeration for layout or printing mode change. This view might paint without first receiving layout.", object_getClassName([subview class])); } - (void)willRemoveSubview:(NSView *)subview { // Have to null-check _private, since this can be called via -dealloc when // cleaning up the the layerHostingView. if (_private && _private->enumeratingSubviews) LOG(View, "A view of class %s was removed during subview enumeration for layout or printing mode change. We will still do layout or the printing mode change even though this view is no longer in the view hierarchy.", object_getClassName([subview class])); } #endif #ifdef BUILDING_ON_TIGER // This is called when we are about to draw, but before our dirty rect is propagated to our ancestors. // That's the perfect time to do a layout, except that ideally we'd want to be sure that we're dirty // before doing it. As a compromise, when we're opaque we do the layout only when actually asked to // draw, but when we're transparent we do the layout at this stage so views behind us know that they // need to be redrawn (in case the layout causes some things to get dirtied). - (void)_propagateDirtyRectsToOpaqueAncestors { if (![[self _webView] drawsBackground]) [self _web_layoutIfNeededRecursive]; [super _propagateDirtyRectsToOpaqueAncestors]; } #else - (void)viewWillDraw { // On window close we will be called when the datasource is nil, then hit an assert in _topHTMLView // So check if the dataSource is nil before calling [self _isTopHTMLView], this can be removed // once the FIXME in _isTopHTMLView is fixed. if (_private->dataSource && [self _isTopHTMLView]) [self _web_layoutIfNeededRecursive]; [super viewWillDraw]; } #endif // Don't let AppKit even draw subviews. We take care of that. - (void)_recursiveDisplayRectIfNeededIgnoringOpacity:(NSRect)rect isVisibleRect:(BOOL)isVisibleRect rectIsVisibleRectForView:(NSView *)visibleView topView:(BOOL)topView { // This helps when we print as part of a larger print process. // If the WebHTMLView itself is what we're printing, then we will never have to do this. BOOL wasInPrintingMode = _private->printing; BOOL isPrinting = ![NSGraphicsContext currentContextDrawingToScreen]; if (isPrinting) { if (!wasInPrintingMode) [self _web_setPrintingModeRecursive]; #ifndef BUILDING_ON_TIGER else [self _web_layoutIfNeededRecursive]; #endif } else if (wasInPrintingMode) [self _web_clearPrintingModeRecursive]; #ifndef BUILDING_ON_TIGER // There are known cases where -viewWillDraw is not called on all views being drawn. // See <rdar://problem/6964278> for example. Performing layout at this point prevents us from // trying to paint without layout (which WebCore now refuses to do, instead bailing out without // drawing at all), but we may still fail to update and regions dirtied by the layout which are // not already dirty. if ([self _needsLayout]) { LOG_ERROR("View needs layout. Either -viewWillDraw wasn't called or layout was invalidated during the display operation. Performing layout now."); [self _web_layoutIfNeededRecursive]; } #else // Because Tiger does not have viewWillDraw we need to do layout here. [self _web_layoutIfNeededRecursive]; [_subviews makeObjectsPerformSelector:@selector(_propagateDirtyRectsToOpaqueAncestors)]; #endif [self _setAsideSubviews]; [super _recursiveDisplayRectIfNeededIgnoringOpacity:rect isVisibleRect:isVisibleRect rectIsVisibleRectForView:visibleView topView:topView]; [self _restoreSubviews]; if (wasInPrintingMode != isPrinting) { if (wasInPrintingMode) [self _web_setPrintingModeRecursive]; else [self _web_clearPrintingModeRecursive]; } } // Don't let AppKit even draw subviews. We take care of that. - (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)needsLockFocus visRect:(NSRect)visRect { BOOL needToSetAsideSubviews = !_private->subviewsSetAside; BOOL wasInPrintingMode = _private->printing; BOOL isPrinting = ![NSGraphicsContext currentContextDrawingToScreen]; if (needToSetAsideSubviews) { // This helps when we print as part of a larger print process. // If the WebHTMLView itself is what we're printing, then we will never have to do this. if (isPrinting) { if (!wasInPrintingMode) [self _web_setPrintingModeRecursive]; #ifndef BUILDING_ON_TIGER else [self _web_layoutIfNeededRecursive]; #endif } else if (wasInPrintingMode) [self _web_clearPrintingModeRecursive]; #ifdef BUILDING_ON_TIGER // Because Tiger does not have viewWillDraw we need to do layout here. NSRect boundsBeforeLayout = [self bounds]; if (!NSIsEmptyRect(visRect)) [self _web_layoutIfNeededRecursive]; // If layout changes the view's bounds, then we need to recompute the visRect. // That's because the visRect passed to us was based on the bounds at the time // we were called. This method is only displayed to draw "all", so it's safe // to just call visibleRect to compute the entire rectangle. if (!NSEqualRects(boundsBeforeLayout, [self bounds])) visRect = [self visibleRect]; #endif [self _setAsideSubviews]; } [super _recursiveDisplayAllDirtyWithLockFocus:needsLockFocus visRect:visRect]; if (needToSetAsideSubviews) { if (wasInPrintingMode != isPrinting) { if (wasInPrintingMode) [self _web_setPrintingModeRecursive]; else [self _web_clearPrintingModeRecursive]; } [self _restoreSubviews]; } } // Don't let AppKit even draw subviews. We take care of that. - (void)_recursive:(BOOL)recurse displayRectIgnoringOpacity:(NSRect)displayRect inContext:(NSGraphicsContext *)context topView:(BOOL)topView { #ifdef BUILDING_ON_TIGER // Because Tiger does not have viewWillDraw we need to do layout here. [self _web_layoutIfNeededRecursive]; #endif [self _setAsideSubviews]; [super _recursive:recurse displayRectIgnoringOpacity:displayRect inContext:context topView:topView]; [self _restoreSubviews]; } - (BOOL)_insideAnotherHTMLView { return self != [self _topHTMLView]; } - (NSView *)hitTest:(NSPoint)point { // WebHTMLView objects handle all events for objects inside them. // To get those events, we prevent hit testing from AppKit. // But there are three exceptions to this: // 1) For right mouse clicks and control clicks we don't yet have an implementation // that works for nested views, so we let the hit testing go through the // standard NSView code path (needs to be fixed, see bug 4361618). // 2) Java depends on doing a hit test inside it's mouse moved handling, // so we let the hit testing go through the standard NSView code path // when the current event is a mouse move (except when we are calling // from _updateMouseoverWithEvent, so we have to use a global, // forceWebHTMLViewHitTest, for that) // 3) The acceptsFirstMouse: and shouldDelayWindowOrderingForEvent: methods // both need to figure out which view to check with inside the WebHTMLView. // They use a global to change the behavior of hitTest: so they can get the // right view. The global is forceNSViewHitTest and the method they use to // do the hit testing is _hitViewForEvent:. (But this does not work correctly // when there is HTML overlapping the view, see bug 4361626) // 4) NSAccessibilityHitTest relies on this for checking the cursor position. // Our check for that is whether the event is NSFlagsChanged. This works // for VoiceOver's Control-Option-F5 command (move focus to item under cursor) // and Dictionary's Command-Control-D (open dictionary popup for item under cursor). // This is of course a hack. if (_private->closed) return nil; BOOL captureHitsOnSubviews; if (forceNSViewHitTest) captureHitsOnSubviews = NO; else if (forceWebHTMLViewHitTest) captureHitsOnSubviews = YES; else { NSEvent *event = [[self window] currentEvent]; captureHitsOnSubviews = !([event type] == NSMouseMoved || [event type] == NSRightMouseDown || ([event type] == NSLeftMouseDown && ([event modifierFlags] & NSControlKeyMask) != 0) || [event type] == NSFlagsChanged); } if (!captureHitsOnSubviews) { NSView* hitView = [super hitTest:point]; #if USE(ACCELERATED_COMPOSITING) if (_private && hitView == _private->layerHostingView) hitView = self; #endif return hitView; } if ([[self superview] mouse:point inRect:[self frame]]) return self; return nil; } - (void)_clearLastHitViewIfSelf { if (lastHitView == self) lastHitView = nil; } - (NSTrackingRectTag)addTrackingRect:(NSRect)rect owner:(id)owner userData:(void *)data assumeInside:(BOOL)assumeInside { ASSERT(_private->trackingRectOwner == nil); _private->trackingRectOwner = owner; _private->trackingRectUserData = data; return TRACKING_RECT_TAG; } - (NSTrackingRectTag)_addTrackingRect:(NSRect)rect owner:(id)owner userData:(void *)data assumeInside:(BOOL)assumeInside useTrackingNum:(int)tag { ASSERT(tag == 0 || tag == TRACKING_RECT_TAG); ASSERT(_private->trackingRectOwner == nil); _private->trackingRectOwner = owner; _private->trackingRectUserData = data; return TRACKING_RECT_TAG; } - (void)_addTrackingRects:(NSRect *)rects owner:(id)owner userDataList:(void **)userDataList assumeInsideList:(BOOL *)assumeInsideList trackingNums:(NSTrackingRectTag *)trackingNums count:(int)count { ASSERT(count == 1); ASSERT(trackingNums[0] == 0 || trackingNums[0] == TRACKING_RECT_TAG); ASSERT(_private->trackingRectOwner == nil); _private->trackingRectOwner = owner; _private->trackingRectUserData = userDataList[0]; trackingNums[0] = TRACKING_RECT_TAG; } - (void)removeTrackingRect:(NSTrackingRectTag)tag { if (tag == 0) return; if (_private && (tag == TRACKING_RECT_TAG)) { _private->trackingRectOwner = nil; return; } if (_private && (tag == _private->lastToolTipTag)) { [super removeTrackingRect:tag]; _private->lastToolTipTag = 0; return; } // If any other tracking rect is being removed, we don't know how it was created // and it's possible there's a leak involved (see 3500217) ASSERT_NOT_REACHED(); } - (void)_removeTrackingRects:(NSTrackingRectTag *)tags count:(int)count { int i; for (i = 0; i < count; ++i) { int tag = tags[i]; if (tag == 0) continue; ASSERT(tag == TRACKING_RECT_TAG); if (_private != nil) { _private->trackingRectOwner = nil; } } } - (void)_sendToolTipMouseExited { // Nothing matters except window, trackingNumber, and userData. NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSMouseExited location:NSMakePoint(0, 0) modifierFlags:0 timestamp:0 windowNumber:[[self window] windowNumber] context:NULL eventNumber:0 trackingNumber:TRACKING_RECT_TAG userData:_private->trackingRectUserData]; [_private->trackingRectOwner mouseExited:fakeEvent]; } - (void)_sendToolTipMouseEntered { // Nothing matters except window, trackingNumber, and userData. NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSMouseEntered location:NSMakePoint(0, 0) modifierFlags:0 timestamp:0 windowNumber:[[self window] windowNumber] context:NULL eventNumber:0 trackingNumber:TRACKING_RECT_TAG userData:_private->trackingRectUserData]; [_private->trackingRectOwner mouseEntered:fakeEvent]; } - (void)_setToolTip:(NSString *)string { NSString *toolTip = [string length] == 0 ? nil : string; NSString *oldToolTip = _private->toolTip; if ((toolTip == nil || oldToolTip == nil) ? toolTip == oldToolTip : [toolTip isEqualToString:oldToolTip]) { return; } if (oldToolTip) { [self _sendToolTipMouseExited]; [oldToolTip release]; } _private->toolTip = [toolTip copy]; if (toolTip) { // See radar 3500217 for why we remove all tooltips rather than just the single one we created. [self removeAllToolTips]; NSRect wideOpenRect = NSMakeRect(-100000, -100000, 200000, 200000); _private->lastToolTipTag = [self addToolTipRect:wideOpenRect owner:self userData:NULL]; [self _sendToolTipMouseEntered]; } } - (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:(void *)data { return [[_private->toolTip copy] autorelease]; } - (void)_updateMouseoverWithEvent:(NSEvent *)event { if (_private->closed) return; NSView *contentView = [[event window] contentView]; NSPoint locationForHitTest = [[contentView superview] convertPoint:[event locationInWindow] fromView:nil]; forceWebHTMLViewHitTest = YES; NSView *hitView = [contentView hitTest:locationForHitTest]; forceWebHTMLViewHitTest = NO; WebHTMLView *view = nil; if ([hitView isKindOfClass:[WebHTMLView class]] && ![[(WebHTMLView *)hitView _webView] isHoverFeedbackSuspended]) view = (WebHTMLView *)hitView; if (view) [view retain]; if (lastHitView != view && lastHitView && [lastHitView _frame]) { // If we are moving out of a view (or frame), let's pretend the mouse moved // all the way out of that view. But we have to account for scrolling, because // WebCore doesn't understand our clipping. NSRect visibleRect = [[[[lastHitView _frame] frameView] _scrollView] documentVisibleRect]; float yScroll = visibleRect.origin.y; float xScroll = visibleRect.origin.x; NSEvent *event = [NSEvent mouseEventWithType:NSMouseMoved location:NSMakePoint(-1 - xScroll, -1 - yScroll) modifierFlags:[[NSApp currentEvent] modifierFlags] timestamp:[NSDate timeIntervalSinceReferenceDate] windowNumber:[[view window] windowNumber] context:[[NSApp currentEvent] context] eventNumber:0 clickCount:0 pressure:0]; if (Frame* lastHitCoreFrame = core([lastHitView _frame])) lastHitCoreFrame->eventHandler()->mouseMoved(event); } lastHitView = view; if (view) { if (Frame* coreFrame = core([view _frame])) coreFrame->eventHandler()->mouseMoved(event); [view release]; } } // keep in sync with WebPasteboardHelper::insertablePasteboardTypes + (NSArray *)_insertablePasteboardTypes { static NSArray *types = nil; if (!types) { types = [[NSArray alloc] initWithObjects:WebArchivePboardType, NSHTMLPboardType, NSFilenamesPboardType, NSTIFFPboardType, NSPDFPboardType, #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) NSPICTPboardType, #endif NSURLPboardType, NSRTFDPboardType, NSRTFPboardType, NSStringPboardType, NSColorPboardType, kUTTypePNG, nil]; CFRetain(types); } return types; } + (NSArray *)_selectionPasteboardTypes { // FIXME: We should put data for NSHTMLPboardType on the pasteboard but Microsoft Excel doesn't like our format of HTML (3640423). return [NSArray arrayWithObjects:WebArchivePboardType, NSRTFDPboardType, NSRTFPboardType, NSStringPboardType, nil]; } - (NSImage *)_dragImageForURL:(NSString*)urlString withLabel:(NSString*)label { BOOL drawURLString = YES; BOOL clipURLString = NO, clipLabelString = NO; if (!label) { drawURLString = NO; label = urlString; } NSFont *labelFont = [[NSFontManager sharedFontManager] convertFont:[NSFont systemFontOfSize:DRAG_LINK_LABEL_FONT_SIZE] toHaveTrait:NSBoldFontMask]; NSFont *urlFont = [NSFont systemFontOfSize: DRAG_LINK_URL_FONT_SIZE]; NSSize labelSize; labelSize.width = [label _web_widthWithFont: labelFont]; labelSize.height = [labelFont ascender] - [labelFont descender]; if (labelSize.width > MAX_DRAG_LABEL_WIDTH){ labelSize.width = MAX_DRAG_LABEL_WIDTH; clipLabelString = YES; } NSSize imageSize, urlStringSize; imageSize.width = labelSize.width + DRAG_LABEL_BORDER_X * 2.0f; imageSize.height = labelSize.height + DRAG_LABEL_BORDER_Y * 2.0f; if (drawURLString) { urlStringSize.width = [urlString _web_widthWithFont: urlFont]; urlStringSize.height = [urlFont ascender] - [urlFont descender]; imageSize.height += urlStringSize.height; if (urlStringSize.width > MAX_DRAG_LABEL_WIDTH) { imageSize.width = max(MAX_DRAG_LABEL_WIDTH + DRAG_LABEL_BORDER_X * 2, MIN_DRAG_LABEL_WIDTH_BEFORE_CLIP); clipURLString = YES; } else { imageSize.width = max(labelSize.width + DRAG_LABEL_BORDER_X * 2, urlStringSize.width + DRAG_LABEL_BORDER_X * 2); } } NSImage *dragImage = [[[NSImage alloc] initWithSize: imageSize] autorelease]; [dragImage lockFocus]; [[NSColor colorWithDeviceRed: 0.7f green: 0.7f blue: 0.7f alpha: 0.8f] set]; // Drag a rectangle with rounded corners/ NSBezierPath *path = [NSBezierPath bezierPath]; [path appendBezierPathWithOvalInRect: NSMakeRect(0.0f, 0.0f, DRAG_LABEL_RADIUS * 2.0f, DRAG_LABEL_RADIUS * 2.0f)]; [path appendBezierPathWithOvalInRect: NSMakeRect(0, imageSize.height - DRAG_LABEL_RADIUS * 2.0f, DRAG_LABEL_RADIUS * 2.0f, DRAG_LABEL_RADIUS * 2.0f)]; [path appendBezierPathWithOvalInRect: NSMakeRect(imageSize.width - DRAG_LABEL_RADIUS * 2.0f, imageSize.height - DRAG_LABEL_RADIUS * 2.0f, DRAG_LABEL_RADIUS * 2.0f, DRAG_LABEL_RADIUS * 2.0f)]; [path appendBezierPathWithOvalInRect: NSMakeRect(imageSize.width - DRAG_LABEL_RADIUS * 2.0f, 0.0f, DRAG_LABEL_RADIUS * 2.0f, DRAG_LABEL_RADIUS * 2.0f)]; [path appendBezierPathWithRect: NSMakeRect(DRAG_LABEL_RADIUS, 0.0f, imageSize.width - DRAG_LABEL_RADIUS * 2.0f, imageSize.height)]; [path appendBezierPathWithRect: NSMakeRect(0.0f, DRAG_LABEL_RADIUS, DRAG_LABEL_RADIUS + 10.0f, imageSize.height - 2.0f * DRAG_LABEL_RADIUS)]; [path appendBezierPathWithRect: NSMakeRect(imageSize.width - DRAG_LABEL_RADIUS - 20.0f, DRAG_LABEL_RADIUS, DRAG_LABEL_RADIUS + 20.0f, imageSize.height - 2.0f * DRAG_LABEL_RADIUS)]; [path fill]; NSColor *topColor = [NSColor colorWithDeviceWhite:0.0f alpha:0.75f]; NSColor *bottomColor = [NSColor colorWithDeviceWhite:1.0f alpha:0.5f]; if (drawURLString) { if (clipURLString) urlString = [WebStringTruncator centerTruncateString: urlString toWidth:imageSize.width - (DRAG_LABEL_BORDER_X * 2.0f) withFont:urlFont]; [urlString _web_drawDoubledAtPoint:NSMakePoint(DRAG_LABEL_BORDER_X, DRAG_LABEL_BORDER_Y - [urlFont descender]) withTopColor:topColor bottomColor:bottomColor font:urlFont]; } if (clipLabelString) label = [WebStringTruncator rightTruncateString: label toWidth:imageSize.width - (DRAG_LABEL_BORDER_X * 2.0f) withFont:labelFont]; [label _web_drawDoubledAtPoint:NSMakePoint (DRAG_LABEL_BORDER_X, imageSize.height - DRAG_LABEL_BORDER_Y_OFFSET - [labelFont pointSize]) withTopColor:topColor bottomColor:bottomColor font:labelFont]; [dragImage unlockFocus]; return dragImage; } - (NSImage *)_dragImageForLinkElement:(NSDictionary *)element { NSURL *linkURL = [element objectForKey: WebElementLinkURLKey]; NSString *label = [element objectForKey: WebElementLinkLabelKey]; NSString *urlString = [linkURL _web_userVisibleString]; return [self _dragImageForURL:urlString withLabel:label]; } - (void)pasteboardChangedOwner:(NSPasteboard *)pasteboard { [self setPromisedDragTIFFDataSource:0]; } - (void)pasteboard:(NSPasteboard *)pasteboard provideDataForType:(NSString *)type { if ([type isEqual:NSRTFDPboardType] && [[pasteboard types] containsObject:WebArchivePboardType]) { WebArchive *archive = [[WebArchive alloc] initWithData:[pasteboard dataForType:WebArchivePboardType]]; [pasteboard _web_writePromisedRTFDFromArchive:archive containsImage:[[pasteboard types] containsObject:NSTIFFPboardType]]; [archive release]; } else if ([type isEqual:NSTIFFPboardType] && [self promisedDragTIFFDataSource]) { if (Image* image = [self promisedDragTIFFDataSource]->image()) [pasteboard setData:(NSData *)image->getTIFFRepresentation() forType:NSTIFFPboardType]; [self setPromisedDragTIFFDataSource:0]; } } - (void)_handleAutoscrollForMouseDragged:(NSEvent *)event { [self autoscroll:event]; [self _startAutoscrollTimer:event]; } - (WebPluginController *)_pluginController { return _private->pluginController; } - (void)_layoutForPrinting { // Set printing mode temporarily so we can adjust the size of the view. This will allow // AppKit's pagination code to use the correct height for the page content. Leaving printing // mode on indefinitely would interfere with Mail's printing mechanism (at least), so we just // turn it off again after adjusting the size. [self _web_setPrintingModeRecursiveAndAdjustViewSize]; [self _web_clearPrintingModeRecursive]; } - (void)_smartInsertForString:(NSString *)pasteString replacingRange:(DOMRange *)rangeToReplace beforeString:(NSString **)beforeString afterString:(NSString **)afterString { if (!pasteString || !rangeToReplace || ![[self _webView] smartInsertDeleteEnabled]) { if (beforeString) *beforeString = nil; if (afterString) *afterString = nil; return; } [[self _frame] _smartInsertForString:pasteString replacingRange:rangeToReplace beforeString:beforeString afterString:afterString]; } - (BOOL)_canSmartReplaceWithPasteboard:(NSPasteboard *)pasteboard { return [[self _webView] smartInsertDeleteEnabled] && [[pasteboard types] containsObject:WebSmartPastePboardType]; } - (void)_startAutoscrollTimer:(NSEvent *)triggerEvent { if (_private->autoscrollTimer == nil) { _private->autoscrollTimer = [[NSTimer scheduledTimerWithTimeInterval:AUTOSCROLL_INTERVAL target:self selector:@selector(_autoscroll) userInfo:nil repeats:YES] retain]; _private->autoscrollTriggerEvent = [triggerEvent retain]; } } // FIXME: _selectionRect is deprecated in favor of selectionRect, which is in protocol WebDocumentSelection. // We can't remove this yet because it's still in use by Mail. - (NSRect)_selectionRect { return [self selectionRect]; } - (void)_stopAutoscrollTimer { NSTimer *timer = _private->autoscrollTimer; _private->autoscrollTimer = nil; [_private->autoscrollTriggerEvent release]; _private->autoscrollTriggerEvent = nil; [timer invalidate]; [timer release]; } - (void)_autoscroll { // Guarantee that the autoscroll timer is invalidated, even if we don't receive // a mouse up event. BOOL isStillDown = CGEventSourceButtonState(kCGEventSourceStateCombinedSessionState, kCGMouseButtonLeft); if (!isStillDown){ [self _stopAutoscrollTimer]; return; } NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSLeftMouseDragged location:[[self window] convertScreenToBase:[NSEvent mouseLocation]] modifierFlags:[[NSApp currentEvent] modifierFlags] timestamp:[NSDate timeIntervalSinceReferenceDate] windowNumber:[[self window] windowNumber] context:[[NSApp currentEvent] context] eventNumber:0 clickCount:0 pressure:0]; [self mouseDragged:fakeEvent]; } - (BOOL)_canEdit { Frame* coreFrame = core([self _frame]); return coreFrame && coreFrame->editor()->canEdit(); } - (BOOL)_canEditRichly { Frame* coreFrame = core([self _frame]); return coreFrame && coreFrame->editor()->canEditRichly(); } - (BOOL)_canAlterCurrentSelection { return [self _hasSelectionOrInsertionPoint] && [self _isEditable]; } - (BOOL)_hasSelection { Frame* coreFrame = core([self _frame]); return coreFrame && coreFrame->selection()->isRange(); } - (BOOL)_hasSelectionOrInsertionPoint { Frame* coreFrame = core([self _frame]); return coreFrame && coreFrame->selection()->isCaretOrRange(); } - (BOOL)_hasInsertionPoint { Frame* coreFrame = core([self _frame]); return coreFrame && coreFrame->selection()->isCaret(); } - (BOOL)_isEditable { Frame* coreFrame = core([self _frame]); return coreFrame && coreFrame->selection()->isContentEditable(); } - (BOOL)_transparentBackground { return _private->transparentBackground; } - (void)_setTransparentBackground:(BOOL)f { _private->transparentBackground = f; } - (NSImage *)_selectionDraggingImage { if ([self _hasSelection]) { NSImage *dragImage = core([self _frame])->selectionImage(); [dragImage _web_dissolveToFraction:WebDragImageAlpha]; return dragImage; } return nil; } - (NSRect)_selectionDraggingRect { // Mail currently calls this method. We can eliminate it when Mail no longer calls it. return [self selectionRect]; } - (DOMNode *)_insertOrderedList { Frame* coreFrame = core([self _frame]); return coreFrame ? kit(coreFrame->editor()->insertOrderedList().get()) : nil; } - (DOMNode *)_insertUnorderedList { Frame* coreFrame = core([self _frame]); return coreFrame ? kit(coreFrame->editor()->insertUnorderedList().get()) : nil; } - (BOOL)_canIncreaseSelectionListLevel { Frame* coreFrame = core([self _frame]); return coreFrame && coreFrame->editor()->canIncreaseSelectionListLevel(); } - (BOOL)_canDecreaseSelectionListLevel { Frame* coreFrame = core([self _frame]); return coreFrame && coreFrame->editor()->canDecreaseSelectionListLevel(); } - (DOMNode *)_increaseSelectionListLevel { Frame* coreFrame = core([self _frame]); return coreFrame ? kit(coreFrame->editor()->increaseSelectionListLevel().get()) : nil; } - (DOMNode *)_increaseSelectionListLevelOrdered { Frame* coreFrame = core([self _frame]); return coreFrame ? kit(coreFrame->editor()->increaseSelectionListLevelOrdered().get()) : nil; } - (DOMNode *)_increaseSelectionListLevelUnordered { Frame* coreFrame = core([self _frame]); return coreFrame ? kit(coreFrame->editor()->increaseSelectionListLevelUnordered().get()) : nil; } - (void)_decreaseSelectionListLevel { Frame* coreFrame = core([self _frame]); if (coreFrame) coreFrame->editor()->decreaseSelectionListLevel(); } - (void)_setHighlighter:(id<WebHTMLHighlighter>)highlighter ofType:(NSString*)type { if (!_private->highlighters) _private->highlighters = [[NSMutableDictionary alloc] init]; [_private->highlighters setObject:highlighter forKey:type]; } - (void)_removeHighlighterOfType:(NSString*)type { [_private->highlighters removeObjectForKey:type]; } - (void)_writeSelectionToPasteboard:(NSPasteboard *)pasteboard { ASSERT([self _hasSelection]); NSArray *types = [self pasteboardTypesForSelection]; // Don't write RTFD to the pasteboard when the copied attributed string has no attachments. NSAttributedString *attributedString = [self selectedAttributedString]; NSMutableArray *mutableTypes = nil; if (![attributedString containsAttachments]) { mutableTypes = [types mutableCopy]; [mutableTypes removeObject:NSRTFDPboardType]; types = mutableTypes; } [pasteboard declareTypes:types owner:[self _topHTMLView]]; [self _writeSelectionWithPasteboardTypes:types toPasteboard:pasteboard cachedAttributedString:attributedString]; [mutableTypes release]; } - (void)close { // Check for a nil _private here in case we were created with initWithCoder. In that case, the WebView is just throwing // out the archived WebHTMLView and recreating a new one if needed. So close doesn't need to do anything in that case. if (!_private || _private->closed) return; _private->closed = YES; [self _cancelUpdateMouseoverTimer]; [self _clearLastHitViewIfSelf]; [self _removeMouseMovedObserverUnconditionally]; [self _removeWindowObservers]; [self _removeSuperviewObservers]; [_private->pluginController destroyAllPlugins]; [_private->pluginController setDataSource:nil]; // remove tooltips before clearing _private so removeTrackingRect: will work correctly [self removeAllToolTips]; #if USE(ACCELERATED_COMPOSITING) if (_private->layerHostingView) [[self _webView] _stoppedAcceleratedCompositingForFrame:[self _frame]]; #endif [_private clear]; Page* page = core([self _webView]); if (page) page->dragController()->setDraggingImageURL(KURL()); } - (BOOL)_hasHTMLDocument { Frame* coreFrame = core([self _frame]); if (!coreFrame) return NO; Document* document = coreFrame->document(); return document && document->isHTMLDocument(); } - (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard forType:(NSString *)pboardType inContext:(DOMRange *)context subresources:(NSArray **)subresources { if (pboardType == WebArchivePboardType) { WebArchive *archive = [[WebArchive alloc] initWithData:[pasteboard dataForType:WebArchivePboardType]]; if (subresources) *subresources = [archive subresources]; DOMDocumentFragment *fragment = [[self _dataSource] _documentFragmentWithArchive:archive]; [archive release]; return fragment; } if (pboardType == NSFilenamesPboardType) return [self _documentFragmentWithPaths:[pasteboard propertyListForType:NSFilenamesPboardType]]; if (pboardType == NSHTMLPboardType) { NSString *HTMLString = [pasteboard stringForType:NSHTMLPboardType]; // This is a hack to make Microsoft's HTML pasteboard data work. See 3778785. if ([HTMLString hasPrefix:@"Version:"]) { NSRange range = [HTMLString rangeOfString:@"<html" options:NSCaseInsensitiveSearch]; if (range.location != NSNotFound) HTMLString = [HTMLString substringFromIndex:range.location]; } if ([HTMLString length] == 0) return nil; return [[self _frame] _documentFragmentWithMarkupString:HTMLString baseURLString:nil]; } // The _hasHTMLDocument clause here is a workaround for a bug in NSAttributedString: Radar 5052369. // If we call _documentFromRange on an XML document we'll get "setInnerHTML: method not found". // FIXME: Remove this once bug 5052369 is fixed. if ([self _hasHTMLDocument] && pboardType == NSRTFPboardType || pboardType == NSRTFDPboardType) { NSAttributedString *string = nil; if (pboardType == NSRTFDPboardType) string = [[NSAttributedString alloc] initWithRTFD:[pasteboard dataForType:NSRTFDPboardType] documentAttributes:NULL]; if (string == nil) string = [[NSAttributedString alloc] initWithRTF:[pasteboard dataForType:NSRTFPboardType] documentAttributes:NULL]; if (string == nil) return nil; NSDictionary *documentAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [[self class] _excludedElementsForAttributedStringConversion], NSExcludedElementsDocumentAttribute, self, @"WebResourceHandler", nil]; NSArray *s; BOOL wasDeferringCallbacks = [[self _webView] defersCallbacks]; if (!wasDeferringCallbacks) [[self _webView] setDefersCallbacks:YES]; DOMDocumentFragment *fragment = [string _documentFromRange:NSMakeRange(0, [string length]) document:[[self _frame] DOMDocument] documentAttributes:documentAttributes subresources:&s]; if (subresources) *subresources = s; NSEnumerator *e = [s objectEnumerator]; WebResource *r; while ((r = [e nextObject])) [[self _dataSource] addSubresource:r]; if (!wasDeferringCallbacks) [[self _webView] setDefersCallbacks:NO]; [documentAttributes release]; [string release]; return fragment; } if (pboardType == NSTIFFPboardType) { WebResource *resource = [[WebResource alloc] initWithData:[pasteboard dataForType:NSTIFFPboardType] URL:uniqueURLWithRelativePart(@"image.tiff") MIMEType:@"image/tiff" textEncodingName:nil frameName:nil]; DOMDocumentFragment *fragment = [[self _dataSource] _documentFragmentWithImageResource:resource]; [resource release]; return fragment; } if (pboardType == NSPDFPboardType) { WebResource *resource = [[WebResource alloc] initWithData:[pasteboard dataForType:NSPDFPboardType] URL:uniqueURLWithRelativePart(@"application.pdf") MIMEType:@"application/pdf" textEncodingName:nil frameName:nil]; DOMDocumentFragment *fragment = [[self _dataSource] _documentFragmentWithImageResource:resource]; [resource release]; return fragment; } #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) if (pboardType == NSPICTPboardType) { WebResource *resource = [[WebResource alloc] initWithData:[pasteboard dataForType:NSPICTPboardType] URL:uniqueURLWithRelativePart(@"image.pict") MIMEType:@"image/pict" textEncodingName:nil frameName:nil]; DOMDocumentFragment *fragment = [[self _dataSource] _documentFragmentWithImageResource:resource]; [resource release]; return fragment; } #endif // Only 10.5 and higher support setting and retrieving pasteboard types with UTIs, but we don't believe // that any applications on Tiger put types for which we only have a UTI, like PNG, on the pasteboard. if ([pboardType isEqualToString:(NSString*)kUTTypePNG]) { WebResource *resource = [[WebResource alloc] initWithData:[pasteboard dataForType:(NSString*)kUTTypePNG] URL:uniqueURLWithRelativePart(@"image.png") MIMEType:@"image/png" textEncodingName:nil frameName:nil]; DOMDocumentFragment *fragment = [[self _dataSource] _documentFragmentWithImageResource:resource]; [resource release]; return fragment; } if (pboardType == NSURLPboardType) { NSURL *URL = [NSURL URLFromPasteboard:pasteboard]; DOMDocument* document = [[self _frame] DOMDocument]; ASSERT(document); if (!document) return nil; DOMHTMLAnchorElement *anchor = (DOMHTMLAnchorElement *)[document createElement:@"a"]; NSString *URLString = [URL _web_originalDataAsString]; // Original data is ASCII-only, so there is no need to precompose. if ([URLString length] == 0) return nil; NSString *URLTitleString = [[pasteboard stringForType:WebURLNamePboardType] precomposedStringWithCanonicalMapping]; DOMText *text = [document createTextNode:URLTitleString]; [anchor setHref:URLString]; [anchor appendChild:text]; DOMDocumentFragment *fragment = [document createDocumentFragment]; [fragment appendChild:anchor]; return fragment; } if (pboardType == NSStringPboardType) return kit(createFragmentFromText(core(context), [[pasteboard stringForType:NSStringPboardType] precomposedStringWithCanonicalMapping]).get()); return nil; } #if ENABLE(NETSCAPE_PLUGIN_API) - (void)_pauseNullEventsForAllNetscapePlugins { NSArray *subviews = [self subviews]; unsigned int subviewCount = [subviews count]; unsigned int subviewIndex; for (subviewIndex = 0; subviewIndex < subviewCount; subviewIndex++) { NSView *subview = [subviews objectAtIndex:subviewIndex]; if ([subview isKindOfClass:[WebBaseNetscapePluginView class]]) [(WebBaseNetscapePluginView *)subview stopTimers]; } } #endif #if ENABLE(NETSCAPE_PLUGIN_API) - (void)_resumeNullEventsForAllNetscapePlugins { NSArray *subviews = [self subviews]; unsigned int subviewCount = [subviews count]; unsigned int subviewIndex; for (subviewIndex = 0; subviewIndex < subviewCount; subviewIndex++) { NSView *subview = [subviews objectAtIndex:subviewIndex]; if ([subview isKindOfClass:[WebBaseNetscapePluginView class]]) [(WebBaseNetscapePluginView *)subview restartTimers]; } } #endif - (BOOL)_isUsingAcceleratedCompositing { #if USE(ACCELERATED_COMPOSITING) return _private->layerHostingView != nil; #else return NO; #endif } @end @implementation NSView (WebHTMLViewFileInternal) - (void)_web_addDescendantWebHTMLViewsToArray:(NSMutableArray *)array { unsigned count = [_subviews count]; for (unsigned i = 0; i < count; ++i) { NSView *child = [_subviews objectAtIndex:i]; if ([child isKindOfClass:[WebHTMLView class]]) [array addObject:child]; [child _web_addDescendantWebHTMLViewsToArray:array]; } } @end @implementation NSMutableDictionary (WebHTMLViewFileInternal) - (void)_web_setObjectIfNotNil:(id)object forKey:(id)key { if (object == nil) { [self removeObjectForKey:key]; } else { [self setObject:object forKey:key]; } } @end static bool matchesExtensionOrEquivalent(NSString *filename, NSString *extension) { NSString *extensionAsSuffix = [@"." stringByAppendingString:extension]; return [filename _webkit_hasCaseInsensitiveSuffix:extensionAsSuffix] || ([extension _webkit_isCaseInsensitiveEqualToString:@"jpeg"] && [filename _webkit_hasCaseInsensitiveSuffix:@".jpg"]); } #ifdef BUILDING_ON_TIGER // The following is a workaround for // <rdar://problem/3429631> window stops getting mouse moved events after first tooltip appears // The trick is to define a category on NSToolTipPanel that implements setAcceptsMouseMovedEvents:. // Since the category will be searched before the real class, we'll prevent the flag from being // set on the tool tip panel. @interface NSToolTipPanel : NSPanel @end @interface NSToolTipPanel (WebHTMLViewFileInternal) @end @implementation NSToolTipPanel (WebHTMLViewFileInternal) - (void)setAcceptsMouseMovedEvents:(BOOL)flag { // Do nothing, preventing the tool tip panel from trying to accept mouse-moved events. } @end #endif @interface NSArray (WebHTMLView) - (void)_web_makePluginViewsPerformSelector:(SEL)selector withObject:(id)object; @end @implementation WebHTMLView + (void)initialize { [NSApp registerServicesMenuSendTypes:[[self class] _selectionPasteboardTypes] returnTypes:[[self class] _insertablePasteboardTypes]]; JSC::initializeThreading(); #ifndef BUILDING_ON_TIGER WebCoreObjCFinalizeOnMainThread(self); #endif } - (id)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (!self) return nil; [self setFocusRingType:NSFocusRingTypeNone]; // Make all drawing go through us instead of subviews. [self _setDrawsOwnDescendants:YES]; _private = [[WebHTMLViewPrivate alloc] init]; _private->pluginController = [[WebPluginController alloc] initWithDocumentView:self]; return self; } - (void)dealloc { if (WebCoreObjCScheduleDeallocateOnMainThread([WebHTMLView class], self)) return; // We can't assert that close has already been called because // this view can be removed from it's superview, even though // it could be needed later, so close if needed. [self close]; [_private release]; _private = nil; [super dealloc]; } - (void)finalize { ASSERT_MAIN_THREAD(); // We can't assert that close has already been called because // this view can be removed from it's superview, even though // it could be needed later, so close if needed. [self close]; [super finalize]; } // Returns YES if the delegate returns YES (so we should do no more work). - (BOOL)callDelegateDoCommandBySelectorIfNeeded:(SEL)selector { BOOL callerAlreadyCalledDelegate = _private->selectorForDoCommandBySelector == selector; _private->selectorForDoCommandBySelector = 0; if (callerAlreadyCalledDelegate) return NO; WebView *webView = [self _webView]; return [[webView _editingDelegateForwarder] webView:webView doCommandBySelector:selector]; } typedef HashMap<SEL, String> SelectorNameMap; // Map selectors into Editor command names. // This is not needed for any selectors that have the same name as the Editor command. static const SelectorNameMap* createSelectorExceptionMap() { SelectorNameMap* map = new HashMap<SEL, String>; map->add(@selector(insertNewlineIgnoringFieldEditor:), "InsertNewline"); map->add(@selector(insertParagraphSeparator:), "InsertNewline"); map->add(@selector(insertTabIgnoringFieldEditor:), "InsertTab"); map->add(@selector(pageDown:), "MovePageDown"); map->add(@selector(pageDownAndModifySelection:), "MovePageDownAndModifySelection"); map->add(@selector(pageUp:), "MovePageUp"); map->add(@selector(pageUpAndModifySelection:), "MovePageUpAndModifySelection"); return map; } static String commandNameForSelector(SEL selector) { // Check the exception map first. static const SelectorNameMap* exceptionMap = createSelectorExceptionMap(); SelectorNameMap::const_iterator it = exceptionMap->find(selector); if (it != exceptionMap->end()) return it->second; // Remove the trailing colon. // No need to capitalize the command name since Editor command names are // not case sensitive. const char* selectorName = sel_getName(selector); size_t selectorNameLength = strlen(selectorName); if (selectorNameLength < 2 || selectorName[selectorNameLength - 1] != ':') return String(); return String(selectorName, selectorNameLength - 1); } - (Editor::Command)coreCommandBySelector:(SEL)selector { Frame* coreFrame = core([self _frame]); if (!coreFrame) return Editor::Command(); return coreFrame->editor()->command(commandNameForSelector(selector)); } - (Editor::Command)coreCommandByName:(const char*)name { Frame* coreFrame = core([self _frame]); if (!coreFrame) return Editor::Command(); return coreFrame->editor()->command(name); } - (void)executeCoreCommandBySelector:(SEL)selector { if ([self callDelegateDoCommandBySelectorIfNeeded:selector]) return; [self coreCommandBySelector:selector].execute(); } - (void)executeCoreCommandByName:(const char*)name { [self coreCommandByName:name].execute(); } // These commands are forwarded to the Editor object in WebCore. // Ideally we'd do this for all editing commands; more of the code // should be moved from here to there, and more commands should be // added to this list. // FIXME: Maybe we should set things up so that all these share a single method implementation function. // The functions are identical. #define WEBCORE_COMMAND(command) - (void)command:(id)sender { [self executeCoreCommandBySelector:_cmd]; } WEBCORE_COMMAND(alignCenter) WEBCORE_COMMAND(alignJustified) WEBCORE_COMMAND(alignLeft) WEBCORE_COMMAND(alignRight) WEBCORE_COMMAND(copy) WEBCORE_COMMAND(cut) WEBCORE_COMMAND(delete) WEBCORE_COMMAND(deleteBackward) WEBCORE_COMMAND(deleteBackwardByDecomposingPreviousCharacter) WEBCORE_COMMAND(deleteForward) WEBCORE_COMMAND(deleteToBeginningOfLine) WEBCORE_COMMAND(deleteToBeginningOfParagraph) WEBCORE_COMMAND(deleteToEndOfLine) WEBCORE_COMMAND(deleteToEndOfParagraph) WEBCORE_COMMAND(deleteToMark) WEBCORE_COMMAND(deleteWordBackward) WEBCORE_COMMAND(deleteWordForward) WEBCORE_COMMAND(ignoreSpelling) WEBCORE_COMMAND(indent) WEBCORE_COMMAND(insertBacktab) WEBCORE_COMMAND(insertLineBreak) WEBCORE_COMMAND(insertNewline) WEBCORE_COMMAND(insertNewlineIgnoringFieldEditor) WEBCORE_COMMAND(insertParagraphSeparator) WEBCORE_COMMAND(insertTab) WEBCORE_COMMAND(insertTabIgnoringFieldEditor) WEBCORE_COMMAND(makeTextWritingDirectionLeftToRight) WEBCORE_COMMAND(makeTextWritingDirectionNatural) WEBCORE_COMMAND(makeTextWritingDirectionRightToLeft) WEBCORE_COMMAND(moveBackward) WEBCORE_COMMAND(moveBackwardAndModifySelection) WEBCORE_COMMAND(moveDown) WEBCORE_COMMAND(moveDownAndModifySelection) WEBCORE_COMMAND(moveForward) WEBCORE_COMMAND(moveForwardAndModifySelection) WEBCORE_COMMAND(moveLeft) WEBCORE_COMMAND(moveLeftAndModifySelection) WEBCORE_COMMAND(moveParagraphBackwardAndModifySelection) WEBCORE_COMMAND(moveParagraphForwardAndModifySelection) WEBCORE_COMMAND(moveRight) WEBCORE_COMMAND(moveRightAndModifySelection) WEBCORE_COMMAND(moveToBeginningOfDocument) WEBCORE_COMMAND(moveToBeginningOfDocumentAndModifySelection) WEBCORE_COMMAND(moveToBeginningOfLine) WEBCORE_COMMAND(moveToBeginningOfLineAndModifySelection) WEBCORE_COMMAND(moveToBeginningOfParagraph) WEBCORE_COMMAND(moveToBeginningOfParagraphAndModifySelection) WEBCORE_COMMAND(moveToBeginningOfSentence) WEBCORE_COMMAND(moveToBeginningOfSentenceAndModifySelection) WEBCORE_COMMAND(moveToEndOfDocument) WEBCORE_COMMAND(moveToEndOfDocumentAndModifySelection) WEBCORE_COMMAND(moveToEndOfLine) WEBCORE_COMMAND(moveToEndOfLineAndModifySelection) WEBCORE_COMMAND(moveToEndOfParagraph) WEBCORE_COMMAND(moveToEndOfParagraphAndModifySelection) WEBCORE_COMMAND(moveToEndOfSentence) WEBCORE_COMMAND(moveToEndOfSentenceAndModifySelection) WEBCORE_COMMAND(moveToLeftEndOfLine) WEBCORE_COMMAND(moveToLeftEndOfLineAndModifySelection) WEBCORE_COMMAND(moveToRightEndOfLine) WEBCORE_COMMAND(moveToRightEndOfLineAndModifySelection) WEBCORE_COMMAND(moveUp) WEBCORE_COMMAND(moveUpAndModifySelection) WEBCORE_COMMAND(moveWordBackward) WEBCORE_COMMAND(moveWordBackwardAndModifySelection) WEBCORE_COMMAND(moveWordForward) WEBCORE_COMMAND(moveWordForwardAndModifySelection) WEBCORE_COMMAND(moveWordLeft) WEBCORE_COMMAND(moveWordLeftAndModifySelection) WEBCORE_COMMAND(moveWordRight) WEBCORE_COMMAND(moveWordRightAndModifySelection) WEBCORE_COMMAND(outdent) WEBCORE_COMMAND(pageDown) WEBCORE_COMMAND(pageDownAndModifySelection) WEBCORE_COMMAND(pageUp) WEBCORE_COMMAND(pageUpAndModifySelection) WEBCORE_COMMAND(selectAll) WEBCORE_COMMAND(selectLine) WEBCORE_COMMAND(selectParagraph) WEBCORE_COMMAND(selectSentence) WEBCORE_COMMAND(selectToMark) WEBCORE_COMMAND(selectWord) WEBCORE_COMMAND(setMark) WEBCORE_COMMAND(subscript) WEBCORE_COMMAND(superscript) WEBCORE_COMMAND(swapWithMark) WEBCORE_COMMAND(transpose) WEBCORE_COMMAND(underline) WEBCORE_COMMAND(unscript) WEBCORE_COMMAND(yank) WEBCORE_COMMAND(yankAndSelect) #undef WEBCORE_COMMAND #define COMMAND_PROLOGUE if ([self callDelegateDoCommandBySelectorIfNeeded:_cmd]) return; - (IBAction)takeFindStringFromSelection:(id)sender { COMMAND_PROLOGUE if (![self _hasSelection]) { NSBeep(); return; } [NSPasteboard _web_setFindPasteboardString:[self selectedString] withOwner:self]; } - (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pasteboard types:(NSArray *)types { [pasteboard declareTypes:types owner:[self _topHTMLView]]; [self writeSelectionWithPasteboardTypes:types toPasteboard:pasteboard]; return YES; } - (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pasteboard { Frame* coreFrame = core([self _frame]); if (!coreFrame) return NO; if (coreFrame->selection()->isContentRichlyEditable()) [self _pasteWithPasteboard:pasteboard allowPlainText:YES]; else [self _pasteAsPlainTextWithPasteboard:pasteboard]; return YES; } - (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType { BOOL isSendTypeOK = !sendType || ([[self pasteboardTypesForSelection] containsObject:sendType] && [self _hasSelection]); BOOL isReturnTypeOK = !returnType || ([[[self class] _insertablePasteboardTypes] containsObject:returnType] && [self _isEditable]); if (isSendTypeOK && isReturnTypeOK) return self; return [[self nextResponder] validRequestorForSendType:sendType returnType:returnType]; } // jumpToSelection is the old name for what AppKit now calls centerSelectionInVisibleArea. Safari // was using the old jumpToSelection selector in its menu. Newer versions of Safari will use the // selector centerSelectionInVisibleArea. We'll leave the old selector in place for two reasons: // (1) Compatibility between older Safari and newer WebKit; (2) other WebKit-based applications // might be using the selector, and we don't want to break them. - (void)jumpToSelection:(id)sender { COMMAND_PROLOGUE if (Frame* coreFrame = core([self _frame])) coreFrame->revealSelection(ScrollAlignment::alignCenterAlways); } - (NSCellStateValue)selectionHasStyle:(CSSStyleDeclaration*)style { Frame* coreFrame = core([self _frame]); if (!coreFrame) return NSOffState; return kit(coreFrame->editor()->selectionHasStyle(style)); } - (BOOL)validateUserInterfaceItemWithoutDelegate:(id <NSValidatedUserInterfaceItem>)item { SEL action = [item action]; RefPtr<Frame> frame = core([self _frame]); if (!frame) return NO; if (Document* doc = frame->document()) { if (doc->isPluginDocument()) return NO; if (doc->isImageDocument()) { if (action == @selector(copy:)) return frame->loader()->isComplete(); return NO; } } if (action == @selector(changeSpelling:) || action == @selector(_changeSpellingFromMenu:) || action == @selector(checkSpelling:) || action == @selector(complete:) || action == @selector(pasteFont:)) return [self _canEdit]; if (action == @selector(showGuessPanel:)) { #ifndef BUILDING_ON_TIGER // Match OS X AppKit behavior for post-Tiger. Don't change Tiger behavior. NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) { BOOL panelShowing = [[[NSSpellChecker sharedSpellChecker] spellingPanel] isVisible]; [menuItem setTitle:panelShowing ? UI_STRING("Hide Spelling and Grammar", "menu item title") : UI_STRING("Show Spelling and Grammar", "menu item title")]; } #endif return [self _canEdit]; } if (action == @selector(changeBaseWritingDirection:) || action == @selector(makeBaseWritingDirectionLeftToRight:) || action == @selector(makeBaseWritingDirectionRightToLeft:)) { NSWritingDirection writingDirection; if (action == @selector(changeBaseWritingDirection:)) { writingDirection = static_cast<NSWritingDirection>([item tag]); if (writingDirection == NSWritingDirectionNatural) return NO; } else if (action == @selector(makeBaseWritingDirectionLeftToRight:)) writingDirection = NSWritingDirectionLeftToRight; else writingDirection = NSWritingDirectionRightToLeft; NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) { RefPtr<CSSStyleDeclaration> style = CSSMutableStyleDeclaration::create(); ExceptionCode ec; style->setProperty("direction", writingDirection == NSWritingDirectionLeftToRight ? "LTR" : "RTL", ec); [menuItem setState:frame->editor()->selectionHasStyle(style.get())]; } return [self _canEdit]; } if (action == @selector(makeBaseWritingDirectionNatural:)) { NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) [menuItem setState:NSOffState]; return NO; } if (action == @selector(toggleBaseWritingDirection:)) { NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) { RefPtr<CSSStyleDeclaration> style = CSSMutableStyleDeclaration::create(); ExceptionCode ec; style->setProperty("direction", "RTL", ec); // Take control of the title of the menu item instead of just checking/unchecking it because // a check would be ambiguous. [menuItem setTitle:frame->editor()->selectionHasStyle(style.get()) ? UI_STRING("Left to Right", "Left to Right context menu item") : UI_STRING("Right to Left", "Right to Left context menu item")]; } return [self _canEdit]; } if (action == @selector(changeAttributes:) || action == @selector(changeColor:) || action == @selector(changeFont:)) return [self _canEditRichly]; if (action == @selector(capitalizeWord:) || action == @selector(lowercaseWord:) || action == @selector(uppercaseWord:)) return [self _hasSelection] && [self _isEditable]; if (action == @selector(centerSelectionInVisibleArea:) || action == @selector(jumpToSelection:) || action == @selector(copyFont:)) return [self _hasSelection] || ([self _isEditable] && [self _hasInsertionPoint]); if (action == @selector(changeDocumentBackgroundColor:)) return [[self _webView] isEditable] && [self _canEditRichly]; if (action == @selector(_ignoreSpellingFromMenu:) || action == @selector(_learnSpellingFromMenu:) || action == @selector(takeFindStringFromSelection:)) return [self _hasSelection]; if (action == @selector(paste:) || action == @selector(pasteAsPlainText:)) return frame && (frame->editor()->canDHTMLPaste() || frame->editor()->canPaste()); if (action == @selector(pasteAsRichText:)) return frame && (frame->editor()->canDHTMLPaste() || (frame->editor()->canPaste() && frame->selection()->isContentRichlyEditable())); if (action == @selector(performFindPanelAction:)) return NO; if (action == @selector(_lookUpInDictionaryFromMenu:)) return [self _hasSelection]; #ifndef BUILDING_ON_TIGER if (action == @selector(toggleGrammarChecking:)) { // FIXME 4799134: WebView is the bottleneck for this grammar-checking logic, but we must validate // the selector here because we implement it here, and we must implement it here because the AppKit // code checks the first responder. NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) [menuItem setState:[self isGrammarCheckingEnabled] ? NSOnState : NSOffState]; return YES; } #endif #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) if (action == @selector(orderFrontSubstitutionsPanel:)) { NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) { BOOL panelShowing = [[[NSSpellChecker sharedSpellChecker] substitutionsPanel] isVisible]; [menuItem setTitle:panelShowing ? UI_STRING("Hide Substitutions", "menu item title") : UI_STRING("Show Substitutions", "menu item title")]; } return [self _canEdit]; } // FIXME 4799134: WebView is the bottleneck for this logic, but we must validate // the selector here because we implement it here, and we must implement it here because the AppKit // code checks the first responder. if (action == @selector(toggleSmartInsertDelete:)) { NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) [menuItem setState:[self smartInsertDeleteEnabled] ? NSOnState : NSOffState]; return [self _canEdit]; } if (action == @selector(toggleAutomaticQuoteSubstitution:)) { NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) [menuItem setState:[self isAutomaticQuoteSubstitutionEnabled] ? NSOnState : NSOffState]; return [self _canEdit]; } if (action == @selector(toggleAutomaticLinkDetection:)) { NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) [menuItem setState:[self isAutomaticLinkDetectionEnabled] ? NSOnState : NSOffState]; return [self _canEdit]; } if (action == @selector(toggleAutomaticDashSubstitution:)) { NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) [menuItem setState:[self isAutomaticDashSubstitutionEnabled] ? NSOnState : NSOffState]; return [self _canEdit]; } if (action == @selector(toggleAutomaticTextReplacement:)) { NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) [menuItem setState:[self isAutomaticTextReplacementEnabled] ? NSOnState : NSOffState]; return [self _canEdit]; } if (action == @selector(toggleAutomaticSpellingCorrection:)) { NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) [menuItem setState:[self isAutomaticSpellingCorrectionEnabled] ? NSOnState : NSOffState]; return [self _canEdit]; } #endif Editor::Command command = [self coreCommandBySelector:action]; if (command.isSupported()) { NSMenuItem *menuItem = (NSMenuItem *)item; if ([menuItem isKindOfClass:[NSMenuItem class]]) [menuItem setState:kit(command.state())]; return command.isEnabled(); } return YES; } - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item { // This can be called during teardown when _webView is nil. Return NO when this happens, because CallUIDelegateReturningBoolean // assumes the WebVIew is non-nil. if (![self _webView]) return NO; BOOL result = [self validateUserInterfaceItemWithoutDelegate:item]; return CallUIDelegateReturningBoolean(result, [self _webView], @selector(webView:validateUserInterfaceItem:defaultValidation:), item, result); } - (BOOL)acceptsFirstResponder { // Don't accept first responder when we first click on this view. // We have to pass the event down through WebCore first to be sure we don't hit a subview. // Do accept first responder at any other time, for example from keyboard events, // or from calls back from WebCore once we begin mouse-down event handling. NSEvent *event = [NSApp currentEvent]; if ([event type] == NSLeftMouseDown && !_private->handlingMouseDownEvent && NSPointInRect([event locationInWindow], [self convertRect:[self visibleRect] toView:nil])) { return NO; } return YES; } - (BOOL)maintainsInactiveSelection { // This method helps to determine whether the WebHTMLView should maintain // an inactive selection when it's not first responder. // Traditionally, these views have not maintained such selections, // clearing them when the view was not first responder. However, // to fix bugs like this one: // <rdar://problem/3672088>: "Editable WebViews should maintain a selection even // when they're not firstResponder" // it was decided to add a switch to act more like an NSTextView. if ([[self _webView] maintainsInactiveSelection]) return YES; // Predict the case where we are losing first responder status only to // gain it back again. Want to keep the selection in that case. id nextResponder = [[self window] _newFirstResponderAfterResigning]; if ([nextResponder isKindOfClass:[NSScrollView class]]) { id contentView = [nextResponder contentView]; if (contentView) nextResponder = contentView; } if ([nextResponder isKindOfClass:[NSClipView class]]) { id documentView = [nextResponder documentView]; if (documentView) nextResponder = documentView; } if (nextResponder == self) return YES; Frame* coreFrame = core([self _frame]); bool selectionIsEditable = coreFrame && coreFrame->selection()->isContentEditable(); bool nextResponderIsInWebView = [nextResponder isKindOfClass:[NSView class]] && [nextResponder isDescendantOf:[[[self _webView] mainFrame] frameView]]; return selectionIsEditable && nextResponderIsInWebView; } - (void)addMouseMovedObserver { if (!_private->dataSource || ![self _isTopHTMLView] || _private->observingMouseMovedNotifications) return; // Unless the Dashboard asks us to do this for all windows, keep an observer going only for the key window. if (!([[self window] isKeyWindow] #if ENABLE(DASHBOARD_SUPPORT) || [[self _webView] _dashboardBehavior:WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows] #endif )) return; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mouseMovedNotification:) name:WKMouseMovedNotification() object:nil]; [self _frameOrBoundsChanged]; _private->observingMouseMovedNotifications = true; } - (void)removeMouseMovedObserver { #if ENABLE(DASHBOARD_SUPPORT) // Don't remove the observer if we're running the Dashboard. if ([[self _webView] _dashboardBehavior:WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows]) return; #endif [[self _webView] _mouseDidMoveOverElement:nil modifierFlags:0]; [self _removeMouseMovedObserverUnconditionally]; } - (void)addSuperviewObservers { if (_private->observingSuperviewNotifications) return; NSView *superview = [self superview]; if (!superview || ![self window]) return; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter addObserver:self selector:@selector(_frameOrBoundsChanged) name:NSViewFrameDidChangeNotification object:superview]; [notificationCenter addObserver:self selector:@selector(_frameOrBoundsChanged) name:NSViewBoundsDidChangeNotification object:superview]; // In addition to registering for frame/bounds change notifications, call -_frameOrBoundsChanged. // It will check the current scroll against the previous layout's scroll. We need to // do this here to catch the case where the WebView is laid out at one size, removed from its // window, resized, and inserted into another window. Our frame/bounds changed notifications // will not be sent in that situation, since we only watch for changes while in the view hierarchy. [self _frameOrBoundsChanged]; _private->observingSuperviewNotifications = true; } - (void)addWindowObservers { if (_private->observingWindowNotifications) return; NSWindow *window = [self window]; if (!window) return; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:nil]; [notificationCenter addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:nil]; [notificationCenter addObserver:self selector:@selector(windowWillClose:) name:NSWindowWillCloseNotification object:window]; _private->observingWindowNotifications = true; } - (void)viewWillMoveToSuperview:(NSView *)newSuperview { [self _removeSuperviewObservers]; } - (void)viewDidMoveToSuperview { if ([self superview] != nil) [self addSuperviewObservers]; } - (void)viewWillMoveToWindow:(NSWindow *)window { // Don't do anything if we aren't initialized. This happens // when decoding a WebView. When WebViews are decoded their subviews // are created by initWithCoder: and so won't be normally // initialized. The stub views are discarded by WebView. if (!_private) return; // FIXME: Some of these calls may not work because this view may be already removed from it's superview. [self _removeMouseMovedObserverUnconditionally]; [self _removeWindowObservers]; [self _removeSuperviewObservers]; [self _cancelUpdateMouseoverTimer]; [[self _pluginController] stopAllPlugins]; } - (void)viewDidMoveToWindow { // Don't do anything if we aren't initialized. This happens // when decoding a WebView. When WebViews are decoded their subviews // are created by initWithCoder: and so won't be normally // initialized. The stub views are discarded by WebView. if (!_private || _private->closed) return; [self _stopAutoscrollTimer]; if ([self window]) { _private->lastScrollPosition = [[self superview] bounds].origin; [self addWindowObservers]; [self addSuperviewObservers]; [self addMouseMovedObserver]; [[self _pluginController] startAllPlugins]; _private->lastScrollPosition = NSZeroPoint; } } - (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow { [[self subviews] _web_makePluginViewsPerformSelector:@selector(viewWillMoveToHostWindow:) withObject:hostWindow]; } - (void)viewDidMoveToHostWindow { [[self subviews] _web_makePluginViewsPerformSelector:@selector(viewDidMoveToHostWindow) withObject:nil]; } - (void)addSubview:(NSView *)view { [super addSubview:view]; if ([WebPluginController isPlugInView:view]) [[self _pluginController] addPlugin:view]; } - (void)willRemoveSubview:(NSView *)subview { if ([WebPluginController isPlugInView:subview]) [[self _pluginController] destroyPlugin:subview]; [super willRemoveSubview:subview]; } - (void)reapplyStyles { if (!_private->needsToApplyStyles) return; #ifdef LOG_TIMES double start = CFAbsoluteTimeGetCurrent(); #endif if (Frame* coreFrame = core([self _frame])) { if (FrameView* coreView = coreFrame->view()) coreView->setMediaType(_private->printing ? "print" : "screen"); if (Document* document = coreFrame->document()) document->setPrinting(_private->printing); coreFrame->reapplyStyles(); } #ifdef LOG_TIMES double thisTime = CFAbsoluteTimeGetCurrent() - start; LOG(Timing, "%s apply style seconds = %f", [self URL], thisTime); #endif _private->needsToApplyStyles = NO; } // Do a layout, but set up a new fixed width for the purposes of doing printing layout. // minPageWidth==0 implies a non-printing layout - (void)layoutToMinimumPageWidth:(float)minPageWidth maximumPageWidth:(float)maxPageWidth adjustingViewSize:(BOOL)adjustViewSize { [self reapplyStyles]; if (![self _needsLayout]) return; #ifdef LOG_TIMES double start = CFAbsoluteTimeGetCurrent(); #endif LOG(View, "%@ doing layout", self); Frame* coreFrame = core([self _frame]); if (!coreFrame) return; if (FrameView* coreView = coreFrame->view()) { if (minPageWidth > 0.0) coreView->forceLayoutWithPageWidthRange(minPageWidth, maxPageWidth, adjustViewSize); else { coreView->forceLayout(!adjustViewSize); if (adjustViewSize) coreView->adjustViewSize(); } } #ifdef LOG_TIMES double thisTime = CFAbsoluteTimeGetCurrent() - start; LOG(Timing, "%s layout seconds = %f", [self URL], thisTime); #endif } - (void)layout { [self layoutToMinimumPageWidth:0.0f maximumPageWidth:0.0f adjustingViewSize:NO]; } // Deliver mouseup events to the DOM for button 2. - (void)rightMouseUp:(NSEvent *)event { // There's a chance that if we run a nested event loop the event will be released. // Retaining and then autoreleasing prevents that from causing a problem later here or // inside AppKit code. [[event retain] autorelease]; [super rightMouseUp:event]; if (Frame* coreframe = core([self _frame])) coreframe->eventHandler()->mouseUp(event); } - (NSMenu *)menuForEvent:(NSEvent *)event { // There's a chance that if we run a nested event loop the event will be released. // Retaining and then autoreleasing prevents that from causing a problem later here or // inside AppKit code. [[event retain] autorelease]; [_private->completionController endRevertingChange:NO moveLeft:NO]; RefPtr<Frame> coreFrame = core([self _frame]); if (!coreFrame) return nil; Page* page = coreFrame->page(); if (!page) return nil; // Match behavior of other browsers by sending a mousedown event for right clicks. _private->handlingMouseDownEvent = YES; page->contextMenuController()->clearContextMenu(); coreFrame->eventHandler()->mouseDown(event); BOOL handledEvent = coreFrame->eventHandler()->sendContextMenuEvent(event); _private->handlingMouseDownEvent = NO; if (!handledEvent) return nil; // Re-get page, since it might have gone away during event handling. page = coreFrame->page(); if (!page) return nil; ContextMenu* coreMenu = page->contextMenuController()->contextMenu(); if (!coreMenu) return nil; NSArray* menuItems = coreMenu->platformDescription(); if (!menuItems) return nil; NSUInteger count = [menuItems count]; if (!count) return nil; NSMenu* menu = [[[NSMenu alloc] init] autorelease]; for (NSUInteger i = 0; i < count; i++) [menu addItem:[menuItems objectAtIndex:i]]; return menu; } - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag { return [self searchFor:string direction:forward caseSensitive:caseFlag wrap:wrapFlag startInSelection:NO]; } - (void)clearFocus { Frame* coreFrame = core([self _frame]); if (!coreFrame) return; Document* document = coreFrame->document(); if (!document) return; document->setFocusedNode(0); } - (BOOL)isOpaque { return [[self _webView] drawsBackground]; } - (void)setNeedsDisplay:(BOOL)flag { LOG(View, "%@ setNeedsDisplay:%@", self, flag ? @"YES" : @"NO"); [super setNeedsDisplay:flag]; } - (void)setNeedsLayout: (BOOL)flag { LOG(View, "%@ setNeedsLayout:%@", self, flag ? @"YES" : @"NO"); if (!flag) return; // There's no way to say you don't need a layout. if (Frame* frame = core([self _frame])) { if (frame->document() && frame->document()->inPageCache()) return; if (FrameView* view = frame->view()) view->setNeedsLayout(); } } - (void)setNeedsToApplyStyles: (BOOL)flag { LOG(View, "%@ setNeedsToApplyStyles:%@", self, flag ? @"YES" : @"NO"); _private->needsToApplyStyles = flag; } - (void)drawSingleRect:(NSRect)rect { [NSGraphicsContext saveGraphicsState]; NSRectClip(rect); ASSERT([[self superview] isKindOfClass:[WebClipView class]]); [(WebClipView *)[self superview] setAdditionalClip:rect]; @try { if ([self _transparentBackground]) { [[NSColor clearColor] set]; NSRectFill (rect); } [[self _frame] _drawRect:rect contentsOnly:YES]; WebView *webView = [self _webView]; // This hack is needed for <rdar://problem/5023545>. We can hit a race condition where drawRect will be // called after the WebView has closed. If the client did not properly close the WebView and set the // UIDelegate to nil, then the UIDelegate will be stale and this code will crash. static BOOL version3OrLaterClient = WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_QUICKBOOKS_QUIRK); if (version3OrLaterClient) [[webView _UIDelegateForwarder] webView:webView didDrawRect:[webView convertRect:rect fromView:self]]; if (WebNodeHighlight *currentHighlight = [webView currentNodeHighlight]) [currentHighlight setNeedsUpdateInTargetViewRect:[self convertRect:rect toView:[currentHighlight targetView]]]; [(WebClipView *)[self superview] resetAdditionalClip]; [NSGraphicsContext restoreGraphicsState]; } @catch (NSException *localException) { [(WebClipView *)[self superview] resetAdditionalClip]; [NSGraphicsContext restoreGraphicsState]; LOG_ERROR("Exception caught while drawing: %@", localException); [localException raise]; } } - (void)drawRect:(NSRect)rect { ASSERT_MAIN_THREAD(); LOG(View, "%@ drawing", self); const NSRect *rects; NSInteger count; [self getRectsBeingDrawn:&rects count:&count]; BOOL subviewsWereSetAside = _private->subviewsSetAside; if (subviewsWereSetAside) [self _restoreSubviews]; #ifdef LOG_TIMES double start = CFAbsoluteTimeGetCurrent(); #endif if ([[self _webView] _mustDrawUnionedRect:rect singleRects:rects count:count]) [self drawSingleRect:rect]; else for (int i = 0; i < count; ++i) [self drawSingleRect:rects[i]]; #ifdef LOG_TIMES double thisTime = CFAbsoluteTimeGetCurrent() - start; LOG(Timing, "%s draw seconds = %f", widget->part()->baseURL().URL().latin1(), thisTime); #endif if (subviewsWereSetAside) [self _setAsideSubviews]; #if USE(ACCELERATED_COMPOSITING) if ([[self _webView] _needsOneShotDrawingSynchronization]) { // Disable screen updates so that any layer changes committed here // don't show up on the screen before the window flush at the end // of the current window display. [[self window] disableScreenUpdatesUntilFlush]; // Make sure any layer changes that happened as a result of layout // via -viewWillDraw are committed. [CATransaction flush]; [[self _webView] _setNeedsOneShotDrawingSynchronization:NO]; } #endif } // Turn off the additional clip while computing our visibleRect. - (NSRect)visibleRect { if (!([[self superview] isKindOfClass:[WebClipView class]])) return [super visibleRect]; WebClipView *clipView = (WebClipView *)[self superview]; BOOL hasAdditionalClip = [clipView hasAdditionalClip]; if (!hasAdditionalClip) { return [super visibleRect]; } NSRect additionalClip = [clipView additionalClip]; [clipView resetAdditionalClip]; NSRect visibleRect = [super visibleRect]; [clipView setAdditionalClip:additionalClip]; return visibleRect; } - (BOOL)isFlipped { return YES; } - (void)windowDidBecomeKey:(NSNotification *)notification { if (!pthread_main_np()) { [self performSelectorOnMainThread:_cmd withObject:notification waitUntilDone:NO]; return; } NSWindow *keyWindow = [notification object]; if (keyWindow == [self window]) [self addMouseMovedObserver]; } - (void)windowDidResignKey:(NSNotification *)notification { if (!pthread_main_np()) { [self performSelectorOnMainThread:_cmd withObject:notification waitUntilDone:NO]; return; } NSWindow *formerKeyWindow = [notification object]; if (formerKeyWindow == [self window]) [self removeMouseMovedObserver]; if (formerKeyWindow == [self window] || formerKeyWindow == [[self window] attachedSheet]) [_private->completionController endRevertingChange:NO moveLeft:NO]; } - (void)windowWillClose:(NSNotification *)notification { if (!pthread_main_np()) { [self performSelectorOnMainThread:_cmd withObject:notification waitUntilDone:NO]; return; } [_private->completionController endRevertingChange:NO moveLeft:NO]; [[self _pluginController] destroyAllPlugins]; } - (void)scrollWheel:(NSEvent *)event { // There's a chance that responding to this event will run a nested event loop, and // fetching a new event might release the old one. Retaining and then autoreleasing // the current event prevents that from causing a problem inside WebKit or AppKit code. [[event retain] autorelease]; Frame* frame = core([self _frame]); if (!frame || !frame->eventHandler()->wheelEvent(event)) [super scrollWheel:event]; } - (BOOL)_isSelectionEvent:(NSEvent *)event { NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil]; return [[[self elementAtPoint:point allowShadowContent:YES] objectForKey:WebElementIsSelectedKey] boolValue]; } - (BOOL)acceptsFirstMouse:(NSEvent *)event { // There's a chance that responding to this event will run a nested event loop, and // fetching a new event might release the old one. Retaining and then autoreleasing // the current event prevents that from causing a problem inside WebKit or AppKit code. [[event retain] autorelease]; NSView *hitView = [self _hitViewForEvent:event]; WebHTMLView *hitHTMLView = [hitView isKindOfClass:[self class]] ? (WebHTMLView *)hitView : nil; #if ENABLE(DASHBOARD_SUPPORT) if ([[self _webView] _dashboardBehavior:WebDashboardBehaviorAlwaysAcceptsFirstMouse]) return YES; #endif if (hitHTMLView) { bool result = false; if (Frame* coreFrame = core([hitHTMLView _frame])) { coreFrame->eventHandler()->setActivationEventNumber([event eventNumber]); [hitHTMLView _setMouseDownEvent:event]; if ([hitHTMLView _isSelectionEvent:event]) result = coreFrame->eventHandler()->eventMayStartDrag(event); [hitHTMLView _setMouseDownEvent:nil]; } return result; } return [hitView acceptsFirstMouse:event]; } - (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)event { // There's a chance that responding to this event will run a nested event loop, and // fetching a new event might release the old one. Retaining and then autoreleasing // the current event prevents that from causing a problem inside WebKit or AppKit code. [[event retain] autorelease]; NSView *hitView = [self _hitViewForEvent:event]; WebHTMLView *hitHTMLView = [hitView isKindOfClass:[self class]] ? (WebHTMLView *)hitView : nil; if (hitHTMLView) { bool result = false; if ([hitHTMLView _isSelectionEvent:event]) { if (Frame* coreFrame = core([hitHTMLView _frame])) { [hitHTMLView _setMouseDownEvent:event]; result = coreFrame->eventHandler()->eventMayStartDrag(event); [hitHTMLView _setMouseDownEvent:nil]; } } return result; } return [hitView shouldDelayWindowOrderingForEvent:event]; } - (void)mouseDown:(NSEvent *)event { // There's a chance that responding to this event will run a nested event loop, and // fetching a new event might release the old one. Retaining and then autoreleasing // the current event prevents that from causing a problem inside WebKit or AppKit code. [[event retain] autorelease]; RetainPtr<WebHTMLView> protector = self; if ([[self inputContext] wantsToHandleMouseEvents] && [[self inputContext] handleMouseEvent:event]) return; _private->handlingMouseDownEvent = YES; // Record the mouse down position so we can determine drag hysteresis. [self _setMouseDownEvent:event]; NSInputManager *currentInputManager = [NSInputManager currentInputManager]; if ([currentInputManager wantsToHandleMouseEvents] && [currentInputManager handleMouseEvent:event]) goto done; [_private->completionController endRevertingChange:NO moveLeft:NO]; // If the web page handles the context menu event and menuForEvent: returns nil, we'll get control click events here. // We don't want to pass them along to KHTML a second time. if (!([event modifierFlags] & NSControlKeyMask)) { _private->ignoringMouseDraggedEvents = NO; // Don't do any mouseover while the mouse is down. [self _cancelUpdateMouseoverTimer]; // Let WebCore get a chance to deal with the event. This will call back to us // to start the autoscroll timer if appropriate. if (Frame* coreframe = core([self _frame])) coreframe->eventHandler()->mouseDown(event); } done: _private->handlingMouseDownEvent = NO; } - (void)dragImage:(NSImage *)dragImage at:(NSPoint)at offset:(NSSize)offset event:(NSEvent *)event pasteboard:(NSPasteboard *)pasteboard source:(id)source slideBack:(BOOL)slideBack { ASSERT(self == [self _topHTMLView]); [super dragImage:dragImage at:at offset:offset event:event pasteboard:pasteboard source:source slideBack:slideBack]; } - (void)mouseDragged:(NSEvent *)event { // There's a chance that responding to this event will run a nested event loop, and // fetching a new event might release the old one. Retaining and then autoreleasing // the current event prevents that from causing a problem inside WebKit or AppKit code. [[event retain] autorelease]; NSInputManager *currentInputManager = [NSInputManager currentInputManager]; if ([currentInputManager wantsToHandleMouseEvents] && [currentInputManager handleMouseEvent:event]) return; [self retain]; if (!_private->ignoringMouseDraggedEvents) { if (Frame* frame = core([self _frame])) { if (Page* page = frame->page()) page->mainFrame()->eventHandler()->mouseDragged(event); } } [self release]; } - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { ASSERT(![self _webView] || [self _isTopHTMLView]); Page* page = core([self _webView]); if (!page) return NSDragOperationNone; // FIXME: Why do we override the source provided operation here? Why not in DragController::startDrag if (page->dragController()->sourceDragOperation() == DragOperationNone) return NSDragOperationGeneric | NSDragOperationCopy; return (NSDragOperation)page->dragController()->sourceDragOperation(); } - (void)draggedImage:(NSImage *)image movedTo:(NSPoint)screenLoc { ASSERT(![self _webView] || [self _isTopHTMLView]); NSPoint windowImageLoc = [[self window] convertScreenToBase:screenLoc]; NSPoint windowMouseLoc = windowImageLoc; if (Page* page = core([self _webView])) { DragController* dragController = page->dragController(); NSPoint windowMouseLoc = NSMakePoint(windowImageLoc.x + dragController->dragOffset().x(), windowImageLoc.y + dragController->dragOffset().y()); } [[self _frame] _dragSourceMovedTo:windowMouseLoc]; } - (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation { ASSERT(![self _webView] || [self _isTopHTMLView]); NSPoint windowImageLoc = [[self window] convertScreenToBase:aPoint]; NSPoint windowMouseLoc = windowImageLoc; if (Page* page = core([self _webView])) { DragController* dragController = page->dragController(); windowMouseLoc = NSMakePoint(windowImageLoc.x + dragController->dragOffset().x(), windowImageLoc.y + dragController->dragOffset().y()); dragController->dragEnded(); } [[self _frame] _dragSourceEndedAt:windowMouseLoc operation:operation]; // Prevent queued mouseDragged events from coming after the drag and fake mouseUp event. _private->ignoringMouseDraggedEvents = YES; // Once the dragging machinery kicks in, we no longer get mouse drags or the up event. // WebCore expects to get balanced down/up's, so we must fake up a mouseup. NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSLeftMouseUp location:windowMouseLoc modifierFlags:[[NSApp currentEvent] modifierFlags] timestamp:[NSDate timeIntervalSinceReferenceDate] windowNumber:[[self window] windowNumber] context:[[NSApp currentEvent] context] eventNumber:0 clickCount:0 pressure:0]; [self mouseUp:fakeEvent]; // This will also update the mouseover state. } - (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination { NSFileWrapper *wrapper = nil; NSURL *draggingImageURL = nil; if (WebCore::CachedImage* tiffResource = [self promisedDragTIFFDataSource]) { SharedBuffer *buffer = static_cast<CachedResource*>(tiffResource)->data(); if (!buffer) goto noPromisedData; NSData *data = buffer->createNSData(); NSURLResponse *response = tiffResource->response().nsURLResponse(); draggingImageURL = [response URL]; wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:data] autorelease]; NSString* filename = [response suggestedFilename]; NSString* trueExtension(tiffResource->image()->filenameExtension()); if (!matchesExtensionOrEquivalent(filename, trueExtension)) filename = [[filename stringByAppendingString:@"."] stringByAppendingString:trueExtension]; [wrapper setPreferredFilename:filename]; } noPromisedData: if (!wrapper) { ASSERT(![self _webView] || [self _isTopHTMLView]); Page* page = core([self _webView]); //If a load occurs midway through a drag, the view may be detached, which gives //us no ability to get to the original Page, so we cannot access any drag state //FIXME: is there a way to recover? if (!page) return nil; const KURL& imageURL = page->dragController()->draggingImageURL(); ASSERT(!imageURL.isEmpty()); draggingImageURL = imageURL; wrapper = [[self _dataSource] _fileWrapperForURL:draggingImageURL]; } if (wrapper == nil) { LOG_ERROR("Failed to create image file."); return nil; } // FIXME: Report an error if we fail to create a file. NSString *path = [[dropDestination path] stringByAppendingPathComponent:[wrapper preferredFilename]]; path = [[NSFileManager defaultManager] _webkit_pathWithUniqueFilenameForPath:path]; if (![wrapper writeToFile:path atomically:NO updateFilenames:YES]) LOG_ERROR("Failed to create image file via -[NSFileWrapper writeToFile:atomically:updateFilenames:]"); if (draggingImageURL) [[NSFileManager defaultManager] _webkit_setMetadataURL:[draggingImageURL absoluteString] referrer:nil atPath:path]; return [NSArray arrayWithObject:[path lastPathComponent]]; } - (void)mouseUp:(NSEvent *)event { // There's a chance that responding to this event will run a nested event loop, and // fetching a new event might release the old one. Retaining and then autoreleasing // the current event prevents that from causing a problem inside WebKit or AppKit code. [[event retain] autorelease]; [self _setMouseDownEvent:nil]; NSInputManager *currentInputManager = [NSInputManager currentInputManager]; if ([currentInputManager wantsToHandleMouseEvents] && [currentInputManager handleMouseEvent:event]) return; [self retain]; [self _stopAutoscrollTimer]; if (Frame* frame = core([self _frame])) { if (Page* page = frame->page()) page->mainFrame()->eventHandler()->mouseUp(event); } [self _updateMouseoverWithFakeEvent]; [self release]; } - (void)mouseMovedNotification:(NSNotification *)notification { [self _updateMouseoverWithEvent:[[notification userInfo] objectForKey:@"NSEvent"]]; } // returning YES from this method is the way we tell AppKit that it is ok for this view // to be in the key loop even when "tab to all controls" is not on. - (BOOL)needsPanelToBecomeKey { return YES; } // Utility function to make sure we don't return anything through the NSTextInput // API when an editable region is not currently focused. static BOOL isTextInput(Frame* coreFrame) { return coreFrame && !coreFrame->selection()->isNone() && coreFrame->selection()->isContentEditable(); } static BOOL isInPasswordField(Frame* coreFrame) { return coreFrame && coreFrame->selection()->isInPasswordField(); } - (BOOL)becomeFirstResponder { NSSelectionDirection direction = NSDirectSelection; if (![[self _webView] _isPerformingProgrammaticFocus]) direction = [[self window] keyViewSelectionDirection]; [self _updateFontPanel]; Frame* frame = core([self _frame]); if (!frame) return YES; BOOL exposeInputContext = isTextInput(frame) && !isInPasswordField(frame); if (exposeInputContext != _private->exposeInputContext) { _private->exposeInputContext = exposeInputContext; [NSApp updateWindows]; } frame->editor()->setStartNewKillRingSequence(true); Page* page = frame->page(); if (!page) return YES; if (![[self _webView] _isPerformingProgrammaticFocus]) page->focusController()->setFocusedFrame(frame); page->focusController()->setFocused(true); if (direction == NSDirectSelection) return YES; if (Document* document = frame->document()) document->setFocusedNode(0); page->focusController()->setInitialFocus(direction == NSSelectingNext ? FocusDirectionForward : FocusDirectionBackward, frame->eventHandler()->currentKeyboardEvent().get()); return YES; } - (BOOL)resignFirstResponder { BOOL resign = [super resignFirstResponder]; if (resign) { [_private->completionController endRevertingChange:NO moveLeft:NO]; Frame* coreFrame = core([self _frame]); if (!coreFrame) return resign; Page* page = coreFrame->page(); if (!page) return resign; if (![self maintainsInactiveSelection]) { [self deselectAll]; if (![[self _webView] _isPerformingProgrammaticFocus]) [self clearFocus]; } id nextResponder = [[self window] _newFirstResponderAfterResigning]; bool nextResponderIsInWebView = [nextResponder isKindOfClass:[NSView class]] && [nextResponder isDescendantOf:[[[self _webView] mainFrame] frameView]]; if (!nextResponderIsInWebView) page->focusController()->setFocused(false); } return resign; } - (void)setDataSource:(WebDataSource *)dataSource { ASSERT(dataSource); if (_private->dataSource != dataSource) { ASSERT(!_private->closed); BOOL hadDataSource = _private->dataSource != nil; [dataSource retain]; [_private->dataSource release]; _private->dataSource = dataSource; [_private->pluginController setDataSource:dataSource]; if (!hadDataSource) [self addMouseMovedObserver]; } } - (void)dataSourceUpdated:(WebDataSource *)dataSource { } // This is an override of an NSControl method that wants to repaint the entire view when the window resigns/becomes // key. WebHTMLView is an NSControl only because it hosts NSCells that are painted by WebCore's Aqua theme // renderer (and those cells must be hosted by an enclosing NSControl in order to paint properly). - (void)updateCell:(NSCell*)cell { } // Does setNeedsDisplay:NO as a side effect when printing is ending. // pageWidth != 0 implies we will relayout to a new width - (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize { WebFrame *frame = [self _frame]; NSArray *subframes = [frame childFrames]; unsigned n = [subframes count]; unsigned i; for (i = 0; i != n; ++i) { WebFrame *subframe = [subframes objectAtIndex:i]; WebFrameView *frameView = [subframe frameView]; if ([[subframe _dataSource] _isDocumentHTML]) { [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:adjustViewSize]; } } if (printing != _private->printing) { [_private->pageRects release]; _private->pageRects = nil; _private->printing = printing; if (!printing) _private->avoidingPrintOrphan = NO; [self setNeedsToApplyStyles:YES]; [self setNeedsLayout:YES]; [self layoutToMinimumPageWidth:minPageWidth maximumPageWidth:maxPageWidth adjustingViewSize:adjustViewSize]; if (!printing) { // Can't do this when starting printing or nested printing won't work, see 3491427. [self setNeedsDisplay:NO]; } } } - (BOOL)canPrintHeadersAndFooters { return YES; } // This is needed for the case where the webview is embedded in the view that's being printed. // It shouldn't be called when the webview is being printed directly. - (void)adjustPageHeightNew:(CGFloat *)newBottom top:(CGFloat)oldTop bottom:(CGFloat)oldBottom limit:(CGFloat)bottomLimit { // This helps when we print as part of a larger print process. // If the WebHTMLView itself is what we're printing, then we will never have to do this. BOOL wasInPrintingMode = _private->printing; if (!wasInPrintingMode) [self _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; float newBottomFloat = *newBottom; if (Frame* frame = core([self _frame])) { if (FrameView* view = frame->view()) view->adjustPageHeight(&newBottomFloat, oldTop, oldBottom, bottomLimit); } #ifdef __LP64__ // If the new bottom is equal to the old bottom (when both are treated as floats), we just copy // oldBottom over to newBottom. This prevents rounding errors that can occur when converting newBottomFloat to a double. if (fabs((float)oldBottom - newBottomFloat) <= numeric_limits<float>::epsilon()) *newBottom = oldBottom; else #endif *newBottom = newBottomFloat; if (!wasInPrintingMode) { NSPrintOperation *currenPrintOperation = [NSPrintOperation currentOperation]; if (currenPrintOperation) // delay _setPrinting:NO until back to main loop as this method may get called repeatedly [self performSelector:@selector(_delayedEndPrintMode:) withObject:currenPrintOperation afterDelay:0]; else // not sure if this is actually ever invoked, it probably shouldn't be [self _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; } } - (float)_availablePaperWidthForPrintOperation:(NSPrintOperation *)printOperation { NSPrintInfo *printInfo = [printOperation printInfo]; return [printInfo paperSize].width - [printInfo leftMargin] - [printInfo rightMargin]; } - (float)_scaleFactorForPrintOperation:(NSPrintOperation *)printOperation { float viewWidth = NSWidth([self bounds]); if (viewWidth < 1) { LOG_ERROR("%@ has no width when printing", self); return 1.0f; } float userScaleFactor = [printOperation _web_pageSetupScaleFactor]; float maxShrinkToFitScaleFactor = 1.0f / PrintingMaximumShrinkFactor; float shrinkToFitScaleFactor = [self _availablePaperWidthForPrintOperation:printOperation]/viewWidth; float shrinkToAvoidOrphan = _private->avoidingPrintOrphan ? (1.0f / PrintingOrphanShrinkAdjustment) : 1.0f; return userScaleFactor * max(maxShrinkToFitScaleFactor, shrinkToFitScaleFactor) * shrinkToAvoidOrphan; } // FIXME 3491344: This is a secret AppKit-internal method that we need to override in order // to get our shrink-to-fit to work with a custom pagination scheme. We can do this better // if AppKit makes it SPI/API. - (CGFloat)_provideTotalScaleFactorForPrintOperation:(NSPrintOperation *)printOperation { return [self _scaleFactorForPrintOperation:printOperation]; } // This is used for Carbon printing. At some point we might want to make this public API. - (void)setPageWidthForPrinting:(float)pageWidth { [self _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO]; [self _setPrinting:YES minimumPageWidth:pageWidth maximumPageWidth:pageWidth adjustViewSize:YES]; } - (void)_endPrintMode { [self _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:YES]; [[self window] setAutodisplay:YES]; } - (void)_delayedEndPrintMode:(NSPrintOperation *)initiatingOperation { ASSERT_ARG(initiatingOperation, initiatingOperation != nil); NSPrintOperation *currentOperation = [NSPrintOperation currentOperation]; if (initiatingOperation == currentOperation) { // The print operation is still underway. We don't expect this to ever happen, hence the assert, but we're // being extra paranoid here since the printing code is so fragile. Delay the cleanup // further. ASSERT_NOT_REACHED(); [self performSelector:@selector(_delayedEndPrintMode:) withObject:initiatingOperation afterDelay:0]; } else if ([currentOperation view] == self) { // A new print job has started, but it is printing the same WebHTMLView again. We don't expect // this to ever happen, hence the assert, but we're being extra paranoid here since the printing code is so // fragile. Do nothing, because we don't want to break the print job currently in progress, and // the print job currently in progress is responsible for its own cleanup. ASSERT_NOT_REACHED(); } else { // The print job that kicked off this delayed call has finished, and this view is not being // printed again. We expect that no other print job has started. Since this delayed call wasn't // cancelled, beginDocument and endDocument must not have been called, and we need to clean up // the print mode here. ASSERT(currentOperation == nil); [self _endPrintMode]; } } // Return the number of pages available for printing - (BOOL)knowsPageRange:(NSRangePointer)range { // Must do this explicit display here, because otherwise the view might redisplay while the print // sheet was up, using printer fonts (and looking different). [self displayIfNeeded]; [[self window] setAutodisplay:NO]; // If we are a frameset just print with the layout we have onscreen, otherwise relayout // according to the paper size float minLayoutWidth = 0.0f; float maxLayoutWidth = 0.0f; Frame* frame = core([self _frame]); if (!frame) return NO; if (!frame->document() || !frame->document()->isFrameSet()) { float paperWidth = [self _availablePaperWidthForPrintOperation:[NSPrintOperation currentOperation]]; minLayoutWidth = paperWidth * PrintingMinimumShrinkFactor; maxLayoutWidth = paperWidth * PrintingMaximumShrinkFactor; } [self _setPrinting:YES minimumPageWidth:minLayoutWidth maximumPageWidth:maxLayoutWidth adjustViewSize:YES]; // will relayout NSPrintOperation *printOperation = [NSPrintOperation currentOperation]; // Certain types of errors, including invalid page ranges, can cause beginDocument and // endDocument to be skipped after we've put ourselves in print mode (see 4145905). In those cases // we need to get out of print mode without relying on any more callbacks from the printing mechanism. // If we get as far as beginDocument without trouble, then this delayed request will be cancelled. // If not cancelled, this delayed call will be invoked in the next pass through the main event loop, // which is after beginDocument and endDocument would be called. [self performSelector:@selector(_delayedEndPrintMode:) withObject:printOperation afterDelay:0]; [[self _webView] _adjustPrintingMarginsForHeaderAndFooter]; // There is a theoretical chance that someone could do some drawing between here and endDocument, // if something caused setNeedsDisplay after this point. If so, it's not a big tragedy, because // you'd simply see the printer fonts on screen. As of this writing, this does not happen with Safari. range->location = 1; float totalScaleFactor = [self _scaleFactorForPrintOperation:printOperation]; float userScaleFactor = [printOperation _web_pageSetupScaleFactor]; [_private->pageRects release]; float fullPageHeight = floorf([self _calculatePrintHeight]/totalScaleFactor); NSArray *newPageRects = [[self _frame] _computePageRectsWithPrintWidthScaleFactor:userScaleFactor printHeight:fullPageHeight]; // AppKit gets all messed up if you give it a zero-length page count (see 3576334), so if we // hit that case we'll pass along a degenerate 1 pixel square to print. This will print // a blank page (with correct-looking header and footer if that option is on), which matches // the behavior of IE and Camino at least. if ([newPageRects count] == 0) newPageRects = [NSArray arrayWithObject:[NSValue valueWithRect:NSMakeRect(0, 0, 1, 1)]]; else if ([newPageRects count] > 1) { // If the last page is a short orphan, try adjusting the print height slightly to see if this will squeeze the // content onto one fewer page. If it does, use the adjusted scale. If not, use the original scale. float lastPageHeight = NSHeight([[newPageRects lastObject] rectValue]); if (lastPageHeight/fullPageHeight < LastPrintedPageOrphanRatio) { NSArray *adjustedPageRects = [[self _frame] _computePageRectsWithPrintWidthScaleFactor:userScaleFactor printHeight:fullPageHeight*PrintingOrphanShrinkAdjustment]; // Use the adjusted rects only if the page count went down if ([adjustedPageRects count] < [newPageRects count]) { newPageRects = adjustedPageRects; _private->avoidingPrintOrphan = YES; } } } _private->pageRects = [newPageRects retain]; range->length = [_private->pageRects count]; return YES; } // Return the drawing rectangle for a particular page number - (NSRect)rectForPage:(NSInteger)page { return [[_private->pageRects objectAtIndex:page - 1] rectValue]; } - (void)drawPageBorderWithSize:(NSSize)borderSize { ASSERT(NSEqualSizes(borderSize, [[[NSPrintOperation currentOperation] printInfo] paperSize])); [[self _webView] _drawHeaderAndFooter]; } - (void)beginDocument { @try { // From now on we'll get a chance to call _endPrintMode in either beginDocument or // endDocument, so we can cancel the "just in case" pending call. [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(_delayedEndPrintMode:) object:[NSPrintOperation currentOperation]]; [super beginDocument]; } @catch (NSException *localException) { // Exception during [super beginDocument] means that endDocument will not get called, // so we need to clean up our "print mode" here. [self _endPrintMode]; } } - (void)endDocument { [super endDocument]; // Note sadly at this point [NSGraphicsContext currentContextDrawingToScreen] is still NO [self _endPrintMode]; } - (void)keyDown:(NSEvent *)event { // There's a chance that responding to this event will run a nested event loop, and // fetching a new event might release the old one. Retaining and then autoreleasing // the current event prevents that from causing a problem inside WebKit or AppKit code. [[event retain] autorelease]; RetainPtr<WebHTMLView> selfProtector = self; BOOL eventWasSentToWebCore = (_private->keyDownEvent == event); BOOL callSuper = NO; [_private->keyDownEvent release]; _private->keyDownEvent = [event retain]; BOOL completionPopupWasOpen = _private->completionController && [_private->completionController popupWindowIsOpen]; Frame* coreFrame = core([self _frame]); if (!eventWasSentToWebCore && coreFrame && coreFrame->eventHandler()->keyEvent(event)) { // WebCore processed a key event, bail on any preexisting complete: UI if (completionPopupWasOpen) [_private->completionController endRevertingChange:YES moveLeft:NO]; } else if (!_private->completionController || ![_private->completionController filterKeyDown:event]) { // Not consumed by complete: popup window [_private->completionController endRevertingChange:YES moveLeft:NO]; callSuper = YES; } if (callSuper) [super keyDown:event]; else [NSCursor setHiddenUntilMouseMoves:YES]; } - (void)keyUp:(NSEvent *)event { // There's a chance that responding to this event will run a nested event loop, and // fetching a new event might release the old one. Retaining and then autoreleasing // the current event prevents that from causing a problem inside WebKit or AppKit code. [[event retain] autorelease]; BOOL eventWasSentToWebCore = (_private->keyDownEvent == event); RetainPtr<WebHTMLView> selfProtector = self; Frame* coreFrame = core([self _frame]); if (coreFrame && !eventWasSentToWebCore) coreFrame->eventHandler()->keyEvent(event); else [super keyUp:event]; } - (void)flagsChanged:(NSEvent *)event { // There's a chance that responding to this event will run a nested event loop, and // fetching a new event might release the old one. Retaining and then autoreleasing // the current event prevents that from causing a problem inside WebKit or AppKit code. [[event retain] autorelease]; Frame* coreFrame = core([self _frame]); if (coreFrame) coreFrame->eventHandler()->capsLockStateMayHaveChanged(); RetainPtr<WebHTMLView> selfProtector = self; unsigned short keyCode = [event keyCode]; //Don't make an event from the num lock and function keys if (coreFrame && keyCode != 0 && keyCode != 10 && keyCode != 63) { coreFrame->eventHandler()->keyEvent(PlatformKeyboardEvent(event)); return; } [super flagsChanged:event]; } - (id)accessibilityAttributeValue:(NSString*)attributeName { if ([attributeName isEqualToString: NSAccessibilityChildrenAttribute]) { id accTree = [[self _frame] _accessibilityTree]; if (accTree) return [NSArray arrayWithObject:accTree]; return nil; } return [super accessibilityAttributeValue:attributeName]; } - (id)accessibilityFocusedUIElement { id accTree = [[self _frame] _accessibilityTree]; if (accTree) return [accTree accessibilityFocusedUIElement]; return self; } - (id)accessibilityHitTest:(NSPoint)point { id accTree = [[self _frame] _accessibilityTree]; if (accTree) { NSPoint windowCoord = [[self window] convertScreenToBase:point]; return [accTree accessibilityHitTest:[self convertPoint:windowCoord fromView:nil]]; } return self; } - (id)_accessibilityParentForSubview:(NSView *)subview { id accTree = [[self _frame] _accessibilityTree]; if (!accTree) return self; id parent = [accTree _accessibilityParentForSubview:subview]; if (!parent) return self; return parent; } - (void)centerSelectionInVisibleArea:(id)sender { COMMAND_PROLOGUE if (Frame* coreFrame = core([self _frame])) coreFrame->revealSelection(ScrollAlignment::alignCenterAlways); } - (NSData *)_selectionStartFontAttributesAsRTF { Frame* coreFrame = core([self _frame]); NSAttributedString *string = [[NSAttributedString alloc] initWithString:@"x" attributes:coreFrame ? coreFrame->fontAttributesForSelectionStart() : nil]; NSData *data = [string RTFFromRange:NSMakeRange(0, [string length]) documentAttributes:nil]; [string release]; return data; } - (NSDictionary *)_fontAttributesFromFontPasteboard { NSPasteboard *fontPasteboard = [NSPasteboard pasteboardWithName:NSFontPboard]; if (fontPasteboard == nil) return nil; NSData *data = [fontPasteboard dataForType:NSFontPboardType]; if (data == nil || [data length] == 0) return nil; // NSTextView does something more efficient by parsing the attributes only, but that's not available in API. NSAttributedString *string = [[[NSAttributedString alloc] initWithRTF:data documentAttributes:NULL] autorelease]; if (string == nil || [string length] == 0) return nil; return [string fontAttributesInRange:NSMakeRange(0, 1)]; } - (DOMCSSStyleDeclaration *)_emptyStyle { return [[[self _frame] DOMDocument] createCSSStyleDeclaration]; } - (NSString *)_colorAsString:(NSColor *)color { NSColor *rgbColor = [color colorUsingColorSpaceName:NSDeviceRGBColorSpace]; // FIXME: If color is non-nil and rgbColor is nil, that means we got some kind // of fancy color that can't be converted to RGB. Changing that to "transparent" // might not be great, but it's probably OK. if (rgbColor == nil) return @"transparent"; float r = [rgbColor redComponent]; float g = [rgbColor greenComponent]; float b = [rgbColor blueComponent]; float a = [rgbColor alphaComponent]; if (a == 0) return @"transparent"; if (r == 0 && g == 0 && b == 0 && a == 1) return @"black"; if (r == 1 && g == 1 && b == 1 && a == 1) return @"white"; // FIXME: Lots more named colors. Maybe we could use the table in WebCore? if (a == 1) return [NSString stringWithFormat:@"rgb(%.0f,%.0f,%.0f)", r * 255, g * 255, b * 255]; return [NSString stringWithFormat:@"rgba(%.0f,%.0f,%.0f,%f)", r * 255, g * 255, b * 255, a]; } - (NSString *)_shadowAsString:(NSShadow *)shadow { if (shadow == nil) return @"none"; NSSize offset = [shadow shadowOffset]; float blurRadius = [shadow shadowBlurRadius]; if (offset.width == 0 && offset.height == 0 && blurRadius == 0) return @"none"; NSColor *color = [shadow shadowColor]; if (color == nil) return @"none"; // FIXME: Handle non-integral values here? if (blurRadius == 0) return [NSString stringWithFormat:@"%@ %.0fpx %.0fpx", [self _colorAsString:color], offset.width, offset.height]; return [NSString stringWithFormat:@"%@ %.0fpx %.0fpx %.0fpx", [self _colorAsString:color], offset.width, offset.height, blurRadius]; } - (DOMCSSStyleDeclaration *)_styleFromFontAttributes:(NSDictionary *)dictionary { DOMCSSStyleDeclaration *style = [self _emptyStyle]; NSColor *color = [dictionary objectForKey:NSBackgroundColorAttributeName]; [style setBackgroundColor:[self _colorAsString:color]]; NSFont *font = [dictionary objectForKey:NSFontAttributeName]; if (!font) { [style setFontFamily:@"Helvetica"]; [style setFontSize:@"12px"]; [style setFontWeight:@"normal"]; [style setFontStyle:@"normal"]; } else { NSFontManager *fm = [NSFontManager sharedFontManager]; // FIXME: Need more sophisticated escaping code if we want to handle family names // with characters like single quote or backslash in their names. [style setFontFamily:[NSString stringWithFormat:@"'%@'", [font familyName]]]; [style setFontSize:[NSString stringWithFormat:@"%0.fpx", [font pointSize]]]; // FIXME: Map to the entire range of CSS weight values. if ([fm weightOfFont:font] >= MIN_BOLD_WEIGHT) [style setFontWeight:@"bold"]; else [style setFontWeight:@"normal"]; if ([fm traitsOfFont:font] & NSItalicFontMask) [style setFontStyle:@"italic"]; else [style setFontStyle:@"normal"]; } color = [dictionary objectForKey:NSForegroundColorAttributeName]; [style setColor:color ? [self _colorAsString:color] : (NSString *)@"black"]; NSShadow *shadow = [dictionary objectForKey:NSShadowAttributeName]; [style setTextShadow:[self _shadowAsString:shadow]]; int strikethroughInt = [[dictionary objectForKey:NSStrikethroughStyleAttributeName] intValue]; int superscriptInt = [[dictionary objectForKey:NSSuperscriptAttributeName] intValue]; if (superscriptInt > 0) [style setVerticalAlign:@"super"]; else if (superscriptInt < 0) [style setVerticalAlign:@"sub"]; else [style setVerticalAlign:@"baseline"]; int underlineInt = [[dictionary objectForKey:NSUnderlineStyleAttributeName] intValue]; // FIXME: Underline wins here if we have both (see bug 3790443). if (strikethroughInt == NSUnderlineStyleNone && underlineInt == NSUnderlineStyleNone) [style setProperty:@"-khtml-text-decorations-in-effect" value:@"none" priority:@""]; else if (underlineInt == NSUnderlineStyleNone) [style setProperty:@"-khtml-text-decorations-in-effect" value:@"line-through" priority:@""]; else [style setProperty:@"-khtml-text-decorations-in-effect" value:@"underline" priority:@""]; return style; } - (void)_applyStyleToSelection:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction { if (Frame* coreFrame = core([self _frame])) coreFrame->editor()->applyStyleToSelection(core(style), undoAction); } - (void)_applyParagraphStyleToSelection:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction { if (Frame* coreFrame = core([self _frame])) coreFrame->editor()->applyParagraphStyleToSelection(core(style), undoAction); } - (BOOL)_handleStyleKeyEquivalent:(NSEvent *)event { ASSERT([self _webView]); if (![[[self _webView] preferences] respectStandardStyleKeyEquivalents]) return NO; if (![self _canEdit]) return NO; if (([event modifierFlags] & NSDeviceIndependentModifierFlagsMask) != NSCommandKeyMask) return NO; NSString *string = [event characters]; if ([string caseInsensitiveCompare:@"b"] == NSOrderedSame) { [self executeCoreCommandByName:"ToggleBold"]; return YES; } if ([string caseInsensitiveCompare:@"i"] == NSOrderedSame) { [self executeCoreCommandByName:"ToggleItalic"]; return YES; } return NO; } - (BOOL)performKeyEquivalent:(NSEvent *)event { // There's a chance that responding to this event will run a nested event loop, and // fetching a new event might release the old one. Retaining and then autoreleasing // the current event prevents that from causing a problem inside WebKit or AppKit code. [[event retain] autorelease]; if ([self _handleStyleKeyEquivalent:event]) return YES; BOOL eventWasSentToWebCore = (_private->keyDownEvent == event); BOOL ret = NO; [_private->keyDownEvent release]; _private->keyDownEvent = [event retain]; [self retain]; // Pass command-key combos through WebCore if there is a key binding available for // this event. This lets web pages have a crack at intercepting command-modified keypresses. // But don't do it if we have already handled the event. // Pressing Esc results in a fake event being sent - don't pass it to WebCore. if (!eventWasSentToWebCore && event == [NSApp currentEvent] && self == [[self window] firstResponder]) if (Frame* frame = core([self _frame])) ret = frame->eventHandler()->keyEvent(event); if (!ret) ret = [super performKeyEquivalent:event]; [self release]; return ret; } - (void)copyFont:(id)sender { COMMAND_PROLOGUE // Put RTF with font attributes on the pasteboard. // Maybe later we should add a pasteboard type that contains CSS text for "native" copy and paste font. NSPasteboard *fontPasteboard = [NSPasteboard pasteboardWithName:NSFontPboard]; [fontPasteboard declareTypes:[NSArray arrayWithObject:NSFontPboardType] owner:nil]; [fontPasteboard setData:[self _selectionStartFontAttributesAsRTF] forType:NSFontPboardType]; } - (void)pasteFont:(id)sender { COMMAND_PROLOGUE // Read RTF with font attributes from the pasteboard. // Maybe later we should add a pasteboard type that contains CSS text for "native" copy and paste font. [self _applyStyleToSelection:[self _styleFromFontAttributes:[self _fontAttributesFromFontPasteboard]] withUndoAction:EditActionPasteFont]; } - (void)pasteAsRichText:(id)sender { COMMAND_PROLOGUE // Since rich text always beats plain text when both are on the pasteboard, it's not // clear how this is different from plain old paste. [self _pasteWithPasteboard:[NSPasteboard generalPasteboard] allowPlainText:NO]; } - (NSFont *)_originalFontA { return [[NSFontManager sharedFontManager] fontWithFamily:@"Helvetica" traits:0 weight:STANDARD_WEIGHT size:10.0f]; } - (NSFont *)_originalFontB { return [[NSFontManager sharedFontManager] fontWithFamily:@"Times" traits:NSFontItalicTrait weight:STANDARD_BOLD_WEIGHT size:12.0f]; } - (void)_addToStyle:(DOMCSSStyleDeclaration *)style fontA:(NSFont *)a fontB:(NSFont *)b { // Since there's no way to directly ask NSFontManager what style change it's going to do // we instead pass two "specimen" fonts to it and let it change them. We then deduce what // style change it was doing by looking at what happened to each of the two fonts. // So if it was making the text bold, both fonts will be bold after the fact. if (a == nil || b == nil) return; NSFontManager *fm = [NSFontManager sharedFontManager]; NSFont *oa = [self _originalFontA]; NSString *aFamilyName = [a familyName]; NSString *bFamilyName = [b familyName]; int aPointSize = (int)[a pointSize]; int bPointSize = (int)[b pointSize]; int aWeight = [fm weightOfFont:a]; int bWeight = [fm weightOfFont:b]; BOOL aIsItalic = ([fm traitsOfFont:a] & NSItalicFontMask) != 0; BOOL bIsItalic = ([fm traitsOfFont:b] & NSItalicFontMask) != 0; BOOL aIsBold = aWeight > MIN_BOLD_WEIGHT; if ([aFamilyName isEqualToString:bFamilyName]) { NSString *familyNameForCSS = aFamilyName; // The family name may not be specific enough to get us the font specified. // In some cases, the only way to get exactly what we are looking for is to use // the Postscript name. // Find the font the same way the rendering code would later if it encountered this CSS. NSFontTraitMask traits = aIsItalic ? NSFontItalicTrait : 0; int weight = aIsBold ? STANDARD_BOLD_WEIGHT : STANDARD_WEIGHT; NSFont *foundFont = [WebFontCache fontWithFamily:aFamilyName traits:traits weight:weight size:aPointSize]; // If we don't find a font with the same Postscript name, then we'll have to use the // Postscript name to make the CSS specific enough. if (![[foundFont fontName] isEqualToString:[a fontName]]) familyNameForCSS = [a fontName]; // FIXME: Need more sophisticated escaping code if we want to handle family names // with characters like single quote or backslash in their names. [style setFontFamily:[NSString stringWithFormat:@"'%@'", familyNameForCSS]]; } int soa = (int)[oa pointSize]; if (aPointSize == bPointSize) [style setFontSize:[NSString stringWithFormat:@"%dpx", aPointSize]]; else if (aPointSize < soa) [style _setFontSizeDelta:@"-1px"]; else if (aPointSize > soa) [style _setFontSizeDelta:@"1px"]; // FIXME: Map to the entire range of CSS weight values. if (aWeight == bWeight) [style setFontWeight:aIsBold ? @"bold" : @"normal"]; if (aIsItalic == bIsItalic) [style setFontStyle:aIsItalic ? @"italic" : @"normal"]; } - (DOMCSSStyleDeclaration *)_styleFromFontManagerOperation { DOMCSSStyleDeclaration *style = [self _emptyStyle]; NSFontManager *fm = [NSFontManager sharedFontManager]; NSFont *oa = [self _originalFontA]; NSFont *ob = [self _originalFontB]; [self _addToStyle:style fontA:[fm convertFont:oa] fontB:[fm convertFont:ob]]; return style; } - (void)changeFont:(id)sender { COMMAND_PROLOGUE [self _applyStyleToSelection:[self _styleFromFontManagerOperation] withUndoAction:EditActionSetFont]; } - (DOMCSSStyleDeclaration *)_styleForAttributeChange:(id)sender { DOMCSSStyleDeclaration *style = [self _emptyStyle]; NSShadow *shadow = [[NSShadow alloc] init]; [shadow setShadowOffset:NSMakeSize(1, 1)]; NSDictionary *oa = [NSDictionary dictionaryWithObjectsAndKeys: [self _originalFontA], NSFontAttributeName, nil]; NSDictionary *ob = [NSDictionary dictionaryWithObjectsAndKeys: [NSColor blackColor], NSBackgroundColorAttributeName, [self _originalFontB], NSFontAttributeName, [NSColor whiteColor], NSForegroundColorAttributeName, shadow, NSShadowAttributeName, [NSNumber numberWithInt:NSUnderlineStyleSingle], NSStrikethroughStyleAttributeName, [NSNumber numberWithInt:1], NSSuperscriptAttributeName, [NSNumber numberWithInt:NSUnderlineStyleSingle], NSUnderlineStyleAttributeName, nil]; [shadow release]; #if 0 NSObliquenessAttributeName /* float; skew to be applied to glyphs, default 0: no skew */ // font-style, but that is just an on-off switch NSExpansionAttributeName /* float; log of expansion factor to be applied to glyphs, default 0: no expansion */ // font-stretch? NSKernAttributeName /* float, amount to modify default kerning, if 0, kerning off */ // letter-spacing? probably not good enough NSUnderlineColorAttributeName /* NSColor, default nil: same as foreground color */ NSStrikethroughColorAttributeName /* NSColor, default nil: same as foreground color */ // text-decoration-color? NSLigatureAttributeName /* int, default 1: default ligatures, 0: no ligatures, 2: all ligatures */ NSBaselineOffsetAttributeName /* float, in points; offset from baseline, default 0 */ NSStrokeWidthAttributeName /* float, in percent of font point size, default 0: no stroke; positive for stroke alone, negative for stroke and fill (a typical value for outlined text would be 3.0) */ NSStrokeColorAttributeName /* NSColor, default nil: same as foreground color */ // need extensions? #endif NSDictionary *a = [sender convertAttributes:oa]; NSDictionary *b = [sender convertAttributes:ob]; NSColor *ca = [a objectForKey:NSBackgroundColorAttributeName]; NSColor *cb = [b objectForKey:NSBackgroundColorAttributeName]; if (ca == cb) { [style setBackgroundColor:[self _colorAsString:ca]]; } [self _addToStyle:style fontA:[a objectForKey:NSFontAttributeName] fontB:[b objectForKey:NSFontAttributeName]]; ca = [a objectForKey:NSForegroundColorAttributeName]; cb = [b objectForKey:NSForegroundColorAttributeName]; if (ca == cb) { [style setColor:[self _colorAsString:ca]]; } NSShadow *sha = [a objectForKey:NSShadowAttributeName]; if (sha) [style setTextShadow:[self _shadowAsString:sha]]; else if ([b objectForKey:NSShadowAttributeName] == nil) [style setTextShadow:@"none"]; int sa = [[a objectForKey:NSStrikethroughStyleAttributeName] intValue]; int sb = [[b objectForKey:NSStrikethroughStyleAttributeName] intValue]; if (sa == sb) { if (sa == NSUnderlineStyleNone) [style setProperty:@"-khtml-text-decorations-in-effect" value:@"none" priority:@""]; // we really mean "no line-through" rather than "none" else [style setProperty:@"-khtml-text-decorations-in-effect" value:@"line-through" priority:@""]; // we really mean "add line-through" rather than "line-through" } sa = [[a objectForKey:NSSuperscriptAttributeName] intValue]; sb = [[b objectForKey:NSSuperscriptAttributeName] intValue]; if (sa == sb) { if (sa > 0) [style setVerticalAlign:@"super"]; else if (sa < 0) [style setVerticalAlign:@"sub"]; else [style setVerticalAlign:@"baseline"]; } int ua = [[a objectForKey:NSUnderlineStyleAttributeName] intValue]; int ub = [[b objectForKey:NSUnderlineStyleAttributeName] intValue]; if (ua == ub) { if (ua == NSUnderlineStyleNone) [style setProperty:@"-khtml-text-decorations-in-effect" value:@"none" priority:@""]; // we really mean "no underline" rather than "none" else [style setProperty:@"-khtml-text-decorations-in-effect" value:@"underline" priority:@""]; // we really mean "add underline" rather than "underline" } return style; } - (void)changeAttributes:(id)sender { COMMAND_PROLOGUE [self _applyStyleToSelection:[self _styleForAttributeChange:sender] withUndoAction:EditActionChangeAttributes]; } - (DOMCSSStyleDeclaration *)_styleFromColorPanelWithSelector:(SEL)selector { DOMCSSStyleDeclaration *style = [self _emptyStyle]; ASSERT([style respondsToSelector:selector]); [style performSelector:selector withObject:[self _colorAsString:[[NSColorPanel sharedColorPanel] color]]]; return style; } - (EditAction)_undoActionFromColorPanelWithSelector:(SEL)selector { if (selector == @selector(setBackgroundColor:)) return EditActionSetBackgroundColor; return EditActionSetColor; } - (void)_changeCSSColorUsingSelector:(SEL)selector inRange:(DOMRange *)range { DOMCSSStyleDeclaration *style = [self _styleFromColorPanelWithSelector:selector]; WebView *webView = [self _webView]; if ([[webView _editingDelegateForwarder] webView:webView shouldApplyStyle:style toElementsInDOMRange:range]) if (Frame* coreFrame = core([self _frame])) coreFrame->editor()->applyStyle(core(style), [self _undoActionFromColorPanelWithSelector:selector]); } - (void)changeDocumentBackgroundColor:(id)sender { COMMAND_PROLOGUE // Mimicking NSTextView, this method sets the background color for the // entire document. There is no NSTextView API for setting the background // color on the selected range only. Note that this method is currently // never called from the UI (see comment in changeColor:). // FIXME: this actually has no effect when called, probably due to 3654850. _documentRange seems // to do the right thing because it works in startSpeaking:, and I know setBackgroundColor: does the // right thing because I tested it with [self _selectedRange]. // FIXME: This won't actually apply the style to the entire range here, because it ends up calling // [frame _applyStyle:], which operates on the current selection. To make this work right, we'll // need to save off the selection, temporarily set it to the entire range, make the change, then // restore the old selection. [self _changeCSSColorUsingSelector:@selector(setBackgroundColor:) inRange:[self _documentRange]]; } - (void)changeColor:(id)sender { COMMAND_PROLOGUE // FIXME: in NSTextView, this method calls changeDocumentBackgroundColor: when a // private call has earlier been made by [NSFontFontEffectsBox changeColor:], see 3674493. // AppKit will have to be revised to allow this to work with anything that isn't an // NSTextView. However, this might not be required for Tiger, since the background-color // changing box in the font panel doesn't work in Mail (3674481), though it does in TextEdit. [self _applyStyleToSelection:[self _styleFromColorPanelWithSelector:@selector(setColor:)] withUndoAction:EditActionSetColor]; } - (void)_changeWordCaseWithSelector:(SEL)selector { if (![self _canEdit]) return; WebFrame *frame = [self _frame]; [self selectWord:nil]; NSString *word = [[frame _selectedString] performSelector:selector]; // FIXME: Does this need a different action context other than "typed"? if ([self _shouldReplaceSelectionWithText:word givenAction:WebViewInsertActionTyped]) [frame _replaceSelectionWithText:word selectReplacement:NO smartReplace:NO]; } - (void)uppercaseWord:(id)sender { COMMAND_PROLOGUE [self _changeWordCaseWithSelector:@selector(uppercaseString)]; } - (void)lowercaseWord:(id)sender { COMMAND_PROLOGUE [self _changeWordCaseWithSelector:@selector(lowercaseString)]; } - (void)capitalizeWord:(id)sender { COMMAND_PROLOGUE [self _changeWordCaseWithSelector:@selector(capitalizedString)]; } - (void)complete:(id)sender { COMMAND_PROLOGUE if (![self _canEdit]) return; if (!_private->completionController) _private->completionController = [[WebTextCompletionController alloc] initWithWebView:[self _webView] HTMLView:self]; [_private->completionController doCompletion]; } - (void)checkSpelling:(id)sender { COMMAND_PROLOGUE if (Frame* coreFrame = core([self _frame])) coreFrame->editor()->advanceToNextMisspelling(); } - (void)showGuessPanel:(id)sender { COMMAND_PROLOGUE NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker]; if (!checker) { LOG_ERROR("No NSSpellChecker"); return; } NSPanel *spellingPanel = [checker spellingPanel]; #ifndef BUILDING_ON_TIGER // Post-Tiger, this menu item is a show/hide toggle, to match AppKit. Leave Tiger behavior alone // to match rest of OS X. if ([spellingPanel isVisible]) { [spellingPanel orderOut:sender]; return; } #endif if (Frame* coreFrame = core([self _frame])) coreFrame->editor()->advanceToNextMisspelling(true); [spellingPanel orderFront:sender]; } - (void)_changeSpellingToWord:(NSString *)newWord { if (![self _canEdit]) return; // Don't correct to empty string. (AppKit checked this, we might as well too.) if (![NSSpellChecker sharedSpellChecker]) { LOG_ERROR("No NSSpellChecker"); return; } if ([newWord isEqualToString:@""]) return; if ([self _shouldReplaceSelectionWithText:newWord givenAction:WebViewInsertActionPasted]) [[self _frame] _replaceSelectionWithText:newWord selectReplacement:YES smartReplace:NO]; } - (void)changeSpelling:(id)sender { COMMAND_PROLOGUE [self _changeSpellingToWord:[[sender selectedCell] stringValue]]; } - (void)performFindPanelAction:(id)sender { COMMAND_PROLOGUE // Implementing this will probably require copying all of NSFindPanel.h and .m. // We need *almost* the same thing as AppKit, but not quite. LOG_ERROR("unimplemented"); } - (void)startSpeaking:(id)sender { COMMAND_PROLOGUE WebFrame *frame = [self _frame]; DOMRange *range = [self _selectedRange]; if (!range || [range collapsed]) range = [self _documentRange]; [NSApp speakString:[frame _stringForRange:range]]; } - (void)stopSpeaking:(id)sender { COMMAND_PROLOGUE [NSApp stopSpeaking:sender]; } - (void)toggleBaseWritingDirection:(id)sender { COMMAND_PROLOGUE if (![self _canEdit]) return; Frame* coreFrame = core([self _frame]); if (!coreFrame) return; WritingDirection direction = RightToLeftWritingDirection; switch (coreFrame->baseWritingDirectionForSelectionStart()) { case NSWritingDirectionLeftToRight: break; case NSWritingDirectionRightToLeft: direction = LeftToRightWritingDirection; break; // The writingDirectionForSelectionStart method will never return "natural". It // will always return a concrete direction. So, keep the compiler happy, and assert not reached. case NSWritingDirectionNatural: ASSERT_NOT_REACHED(); break; } if (Frame* coreFrame = core([self _frame])) coreFrame->editor()->setBaseWritingDirection(direction); } - (void)changeBaseWritingDirection:(id)sender { COMMAND_PROLOGUE if (![self _canEdit]) return; NSWritingDirection writingDirection = static_cast<NSWritingDirection>([sender tag]); // We disable the menu item that performs this action because we can't implement // NSWritingDirectionNatural's behavior using CSS. ASSERT(writingDirection != NSWritingDirectionNatural); if (Frame* coreFrame = core([self _frame])) coreFrame->editor()->setBaseWritingDirection(writingDirection == NSWritingDirectionLeftToRight ? LeftToRightWritingDirection : RightToLeftWritingDirection); } static BOOL writingDirectionKeyBindingsEnabled() { #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) return YES; #else NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; return [defaults boolForKey:@"NSAllowsBaseWritingDirectionKeyBindings"] || [defaults boolForKey:@"AppleTextDirection"]; #endif } - (void)_changeBaseWritingDirectionTo:(NSWritingDirection)direction { if (![self _canEdit]) return; static BOOL bindingsEnabled = writingDirectionKeyBindingsEnabled(); if (!bindingsEnabled) { NSBeep(); return; } if (Frame* coreFrame = core([self _frame])) coreFrame->editor()->setBaseWritingDirection(direction == NSWritingDirectionLeftToRight ? LeftToRightWritingDirection : RightToLeftWritingDirection); } - (void)makeBaseWritingDirectionLeftToRight:(id)sender { COMMAND_PROLOGUE [self _changeBaseWritingDirectionTo:NSWritingDirectionLeftToRight]; } - (void)makeBaseWritingDirectionRightToLeft:(id)sender { COMMAND_PROLOGUE [self _changeBaseWritingDirectionTo:NSWritingDirectionRightToLeft]; } #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) - (void)changeBaseWritingDirectionToLTR:(id)sender { [self makeBaseWritingDirectionLeftToRight:sender]; } - (void)changeBaseWritingDirectionToRTL:(id)sender { [self makeBaseWritingDirectionRightToLeft:sender]; } #endif - (void)makeBaseWritingDirectionNatural:(id)sender { LOG_ERROR("Sent from %@.", sender); } #if 0 // CSS does not have a way to specify an outline font, which may make this difficult to implement. // Maybe a special case of text-shadow? - (void)outline:(id)sender; // This is part of table support, which may be in NSTextView for Tiger. // It's probably simple to do the equivalent thing for WebKit. - (void)insertTable:(id)sender; // This could be important. - (void)toggleTraditionalCharacterShape:(id)sender; // I'm not sure what the equivalents of these in the web world are. - (void)insertLineSeparator:(id)sender; - (void)insertPageBreak:(id)sender; // These methods are not implemented in NSTextView yet at the time of this writing. - (void)changeCaseOfLetter:(id)sender; - (void)transposeWords:(id)sender; #endif #ifndef BUILDING_ON_TIGER // Override this so that AppKit will send us arrow keys as key down events so we can // support them via the key bindings mechanism. - (BOOL)_wantsKeyDownForEvent:(NSEvent *)event { bool haveWebCoreFrame = core([self _frame]); // If we have a frame, our keyDown method will handle key bindings after sending // the event through the DOM, so ask AppKit not to do its early special key binding // mapping. If we don't have a frame, just let things work the normal way without // a keyDown. return haveWebCoreFrame; } #else // Super-hack alert. // All this code accomplishes the same thing as the _wantsKeyDownForEvent method above. // Returns a selector only if called while: // 1) first responder is self // 2) handling a key down event // 3) not yet inside keyDown: method // 4) key is an arrow key // The selector is the one that gets sent by -[NSWindow _processKeyboardUIKey] for this key. - (SEL)_arrowKeyDownEventSelectorIfPreprocessing { NSWindow *w = [self window]; if ([w firstResponder] != self) return NULL; NSEvent *e = [w currentEvent]; if ([e type] != NSKeyDown) return NULL; if (e == _private->keyDownEvent) return NULL; NSString *s = [e charactersIgnoringModifiers]; if ([s length] == 0) return NULL; switch ([s characterAtIndex:0]) { case NSDownArrowFunctionKey: return @selector(moveDown:); case NSLeftArrowFunctionKey: return @selector(moveLeft:); case NSRightArrowFunctionKey: return @selector(moveRight:); case NSUpArrowFunctionKey: return @selector(moveUp:); default: return NULL; } } // Returns NO instead of YES if called on the selector that the // _arrowKeyDownEventSelectorIfPreprocessing method returns. // This should only happen inside -[NSWindow _processKeyboardUIKey], // and together with the change below should cause that method // to return NO rather than handling the key. // Also set a 1-shot flag for the nextResponder check below. - (BOOL)respondsToSelector:(SEL)selector { if (![super respondsToSelector:selector]) return NO; SEL arrowKeySelector = [self _arrowKeyDownEventSelectorIfPreprocessing]; if (selector != arrowKeySelector) return YES; _private->nextResponderDisabledOnce = YES; return NO; } // Returns nil instead of the next responder if called when the // one-shot flag is set, and _arrowKeyDownEventSelectorIfPreprocessing // returns something other than NULL. This should only happen inside // -[NSWindow _processKeyboardUIKey] and together with the change above // should cause that method to return NO rather than handling the key. - (NSResponder *)nextResponder { BOOL disabled = _private->nextResponderDisabledOnce; _private->nextResponderDisabledOnce = NO; if (disabled && [self _arrowKeyDownEventSelectorIfPreprocessing] != NULL) return nil; return [super nextResponder]; } #endif - (void)_updateControlTints { Frame* frame = core([self _frame]); if (!frame) return; FrameView* view = frame->view(); if (!view) return; view->updateControlTints(); } // Despite its name, this is called at different times than windowDidBecomeKey is. // It takes into account all the other factors that determine when NSCell draws // with different tints, so it's the right call to use for control tints. We'd prefer // to do this with API. <rdar://problem/5136760> - (void)_windowChangedKeyState { if (pthread_main_np()) [self _updateControlTints]; else [self performSelectorOnMainThread:@selector(_updateControlTints) withObject:nil waitUntilDone:NO]; [super _windowChangedKeyState]; } - (void)otherMouseDown:(NSEvent *)event { if ([event buttonNumber] == 2) [self mouseDown:event]; else [super otherMouseDown:event]; } - (void)otherMouseDragged:(NSEvent *)event { if ([event buttonNumber] == 2) [self mouseDragged:event]; else [super otherMouseDragged:event]; } - (void)otherMouseUp:(NSEvent *)event { if ([event buttonNumber] == 2) [self mouseUp:event]; else [super otherMouseUp:event]; } @end @implementation NSArray (WebHTMLView) - (void)_web_makePluginViewsPerformSelector:(SEL)selector withObject:(id)object { #if ENABLE(NETSCAPE_PLUGIN_API) NSEnumerator *enumerator = [self objectEnumerator]; WebNetscapePluginView *view; while ((view = [enumerator nextObject]) != nil) if ([view isKindOfClass:[WebBaseNetscapePluginView class]]) [view performSelector:selector withObject:object]; #endif } @end @implementation WebHTMLView (WebInternal) - (void)_selectionChanged { [self _updateSelectionForInputManager]; [self _updateFontPanel]; if (Frame* coreFrame = core([self _frame])) coreFrame->editor()->setStartNewKillRingSequence(true); } - (void)_updateFontPanel { // FIXME: NSTextView bails out if becoming or resigning first responder, for which it has ivar flags. Not // sure if we need to do something similar. if (![self _canEdit]) return; NSWindow *window = [self window]; // FIXME: is this first-responder check correct? What happens if a subframe is editable and is first responder? if ([NSApp keyWindow] != window || [window firstResponder] != self) return; bool multipleFonts = false; NSFont *font = nil; if (Frame* coreFrame = core([self _frame])) { if (const SimpleFontData* fd = coreFrame->editor()->fontForSelection(multipleFonts)) font = fd->getNSFont(); } // FIXME: for now, return a bogus font that distinguishes the empty selection from the non-empty // selection. We should be able to remove this once the rest of this code works properly. if (font == nil) font = [self _hasSelection] ? [NSFont menuFontOfSize:23] : [NSFont toolTipsFontOfSize:17]; ASSERT(font != nil); [[NSFontManager sharedFontManager] setSelectedFont:font isMultiple:multipleFonts]; // FIXME: we don't keep track of selected attributes, or set them on the font panel. This // appears to have no effect on the UI. E.g., underlined text in Mail or TextEdit is // not reflected in the font panel. Maybe someday this will change. } - (BOOL)_canSmartCopyOrDelete { if (![[self _webView] smartInsertDeleteEnabled]) return NO; Frame* coreFrame = core([self _frame]); return coreFrame && coreFrame->selectionGranularity() == WordGranularity; } - (NSEvent *)_mouseDownEvent { return _private->mouseDownEvent; } - (id<WebHTMLHighlighter>)_highlighterForType:(NSString*)type { return [_private->highlighters objectForKey:type]; } - (WebFrame *)_frame { return [_private->dataSource webFrame]; } - (void)paste:(id)sender { COMMAND_PROLOGUE RetainPtr<WebHTMLView> selfProtector = self; RefPtr<Frame> coreFrame = core([self _frame]); if (!coreFrame) return; if (coreFrame->editor()->tryDHTMLPaste()) return; // DHTML did the whole operation if (!coreFrame->editor()->canPaste()) return; if (coreFrame->selection()->isContentRichlyEditable()) [self _pasteWithPasteboard:[NSPasteboard generalPasteboard] allowPlainText:YES]; else coreFrame->editor()->pasteAsPlainText(); } - (void)pasteAsPlainText:(id)sender { COMMAND_PROLOGUE if (![self _canEdit]) return; [self _pasteAsPlainTextWithPasteboard:[NSPasteboard generalPasteboard]]; } - (void)closeIfNotCurrentView { if ([[[self _frame] frameView] documentView] != self) [self close]; } - (DOMDocumentFragment*)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard { return [self _documentFragmentFromPasteboard:pasteboard inContext:nil allowPlainText:NO]; } #ifndef BUILDING_ON_TIGER - (BOOL)isGrammarCheckingEnabled { // FIXME 4799134: WebView is the bottleneck for this grammar-checking logic, but we must implement the method here because // the AppKit code checks the first responder. return [[self _webView] isGrammarCheckingEnabled]; } - (void)setGrammarCheckingEnabled:(BOOL)flag { // FIXME 4799134: WebView is the bottleneck for this grammar-checking logic, but we must implement the method here because // the AppKit code checks the first responder. [[self _webView] setGrammarCheckingEnabled:flag]; } - (void)toggleGrammarChecking:(id)sender { // FIXME 4799134: WebView is the bottleneck for this grammar-checking logic, but we must implement the method here because // the AppKit code checks the first responder. [[self _webView] toggleGrammarChecking:sender]; } static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) { NSArray *screens = [NSScreen screens]; if ([screens count] == 0) { // You could theoretically get here if running with no monitor, in which case it doesn't matter // much where the "on-screen" point is. return CGPointMake(point.x, point.y); } // Flip the y coordinate from the top of the menu bar screen -- see 4636390 return CGPointMake(point.x, NSMaxY([[screens objectAtIndex:0] frame]) - point.y); } #endif #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) - (void)orderFrontSubstitutionsPanel:(id)sender { COMMAND_PROLOGUE NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker]; if (!checker) { LOG_ERROR("No NSSpellChecker"); return; } NSPanel *substitutionsPanel = [checker substitutionsPanel]; if ([substitutionsPanel isVisible]) { [substitutionsPanel orderOut:sender]; return; } [substitutionsPanel orderFront:sender]; } // FIXME 4799134: WebView is the bottleneck for this logic, but we must implement these methods here because // the AppKit code checks the first responder. - (BOOL)smartInsertDeleteEnabled { return [[self _webView] smartInsertDeleteEnabled]; } - (void)setSmartInsertDeleteEnabled:(BOOL)flag { [[self _webView] setSmartInsertDeleteEnabled:flag]; } - (void)toggleSmartInsertDelete:(id)sender { [[self _webView] toggleSmartInsertDelete:sender]; } - (BOOL)isAutomaticQuoteSubstitutionEnabled { return [[self _webView] isAutomaticQuoteSubstitutionEnabled]; } - (void)setAutomaticQuoteSubstitutionEnabled:(BOOL)flag { [[self _webView] setAutomaticQuoteSubstitutionEnabled:flag]; } - (void)toggleAutomaticQuoteSubstitution:(id)sender { [[self _webView] toggleAutomaticQuoteSubstitution:sender]; } - (BOOL)isAutomaticLinkDetectionEnabled { return [[self _webView] isAutomaticLinkDetectionEnabled]; } - (void)setAutomaticLinkDetectionEnabled:(BOOL)flag { [[self _webView] setAutomaticLinkDetectionEnabled:flag]; } - (void)toggleAutomaticLinkDetection:(id)sender { [[self _webView] toggleAutomaticLinkDetection:sender]; } - (BOOL)isAutomaticDashSubstitutionEnabled { return [[self _webView] isAutomaticDashSubstitutionEnabled]; } - (void)setAutomaticDashSubstitutionEnabled:(BOOL)flag { [[self _webView] setAutomaticDashSubstitutionEnabled:flag]; } - (void)toggleAutomaticDashSubstitution:(id)sender { [[self _webView] toggleAutomaticDashSubstitution:sender]; } - (BOOL)isAutomaticTextReplacementEnabled { return [[self _webView] isAutomaticTextReplacementEnabled]; } - (void)setAutomaticTextReplacementEnabled:(BOOL)flag { [[self _webView] setAutomaticTextReplacementEnabled:flag]; } - (void)toggleAutomaticTextReplacement:(id)sender { [[self _webView] toggleAutomaticTextReplacement:sender]; } - (BOOL)isAutomaticSpellingCorrectionEnabled { return [[self _webView] isAutomaticSpellingCorrectionEnabled]; } - (void)setAutomaticSpellingCorrectionEnabled:(BOOL)flag { [[self _webView] setAutomaticSpellingCorrectionEnabled:flag]; } - (void)toggleAutomaticSpellingCorrection:(id)sender { [[self _webView] toggleAutomaticSpellingCorrection:sender]; } #endif - (void)_lookUpInDictionaryFromMenu:(id)sender { // Dictionary API will accept a whitespace-only string and display UI as if it were real text, // so bail out early to avoid that. if ([[[self selectedString] _webkit_stringByTrimmingWhitespace] length] == 0) return; NSAttributedString *attrString = [self selectedAttributedString]; Frame* coreFrame = core([self _frame]); if (!coreFrame) return; NSRect rect = coreFrame->selectionBounds(); #ifndef BUILDING_ON_TIGER NSDictionary *attributes = [attrString fontAttributesInRange:NSMakeRange(0,1)]; NSFont *font = [attributes objectForKey:NSFontAttributeName]; if (font) rect.origin.y += [font ascender]; #endif #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) [self showDefinitionForAttributedString:attrString atPoint:rect.origin]; return; #endif // We soft link to get the function that displays the dictionary (either pop-up window or app) to avoid the performance // penalty of linking to another framework. This function changed signature as well as framework between Tiger and Leopard, // so the two cases are handled separately. #ifdef BUILDING_ON_TIGER typedef OSStatus (*ServiceWindowShowFunction)(id inWordString, NSRect inWordBoundary, UInt16 inLineDirection); const char *frameworkPath = "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LangAnalysis.framework/LangAnalysis"; const char *functionName = "DCMDictionaryServiceWindowShow"; #else typedef void (*ServiceWindowShowFunction)(id unusedDictionaryRef, id inWordString, CFRange selectionRange, id unusedFont, CGPoint textOrigin, Boolean verticalText, id unusedTransform); const char *frameworkPath = "/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/HIToolbox"; const char *functionName = "HIDictionaryWindowShow"; #endif static bool lookedForFunction = false; static ServiceWindowShowFunction dictionaryServiceWindowShow = NULL; if (!lookedForFunction) { void* langAnalysisFramework = dlopen(frameworkPath, RTLD_LAZY); ASSERT(langAnalysisFramework); if (langAnalysisFramework) dictionaryServiceWindowShow = (ServiceWindowShowFunction)dlsym(langAnalysisFramework, functionName); lookedForFunction = true; } ASSERT(dictionaryServiceWindowShow); if (!dictionaryServiceWindowShow) { NSLog(@"Couldn't find the %s function in %s", functionName, frameworkPath); return; } #ifdef BUILDING_ON_TIGER // FIXME: must check for right-to-left here NSWritingDirection writingDirection = NSWritingDirectionLeftToRight; // FIXME: the dictionary API expects the rect for the first line of selection. Passing // the rect for the entire selection, as we do here, positions the pop-up window near // the bottom of the selection rather than at the selected word. rect = [self convertRect:rect toView:nil]; rect.origin = [[self window] convertBaseToScreen:rect.origin]; NSData *data = [attrString RTFFromRange:NSMakeRange(0, [attrString length]) documentAttributes:nil]; dictionaryServiceWindowShow(data, rect, (writingDirection == NSWritingDirectionRightToLeft) ? 1 : 0); #else // The HIDictionaryWindowShow function requires the origin, in CG screen coordinates, of the first character of text in the selection. // FIXME 4945808: We approximate this in a way that works well when a single word is selected, and less well in some other cases // (but no worse than we did in Tiger) NSPoint windowPoint = [self convertPoint:rect.origin toView:nil]; NSPoint screenPoint = [[self window] convertBaseToScreen:windowPoint]; dictionaryServiceWindowShow(nil, attrString, CFRangeMake(0, [attrString length]), nil, coreGraphicsScreenPointForAppKitScreenPoint(screenPoint), false, nil); #endif } - (void)_hoverFeedbackSuspendedChanged { [self _updateMouseoverWithFakeEvent]; } - (BOOL)_interceptEditingKeyEvent:(KeyboardEvent*)event shouldSaveCommand:(BOOL)shouldSave { // Ask AppKit to process the key event -- it will call back with either insertText or doCommandBySelector. WebHTMLViewInterpretKeyEventsParameters parameters; parameters.eventWasHandled = false; parameters.shouldSaveCommand = shouldSave; // If we're intercepting the initial IM call we assume that the IM has consumed the event, // and only change this assumption if one of the NSTextInput/Responder callbacks is used. // We assume the IM will *not* consume hotkey sequences parameters.consumedByIM = !event->metaKey() && shouldSave; if (const PlatformKeyboardEvent* platformEvent = event->keyEvent()) { NSEvent *macEvent = platformEvent->macEvent(); if ([macEvent type] == NSKeyDown && [_private->completionController filterKeyDown:macEvent]) return true; if ([macEvent type] == NSFlagsChanged) return false; parameters.event = event; _private->interpretKeyEventsParameters = ¶meters; _private->receivedNOOP = NO; const Vector<KeypressCommand>& commands = event->keypressCommands(); bool hasKeypressCommand = !commands.isEmpty(); // FIXME: interpretKeyEvents doesn't match application key equivalents (such as Cmd+A), // and sends noop: for those. As a result, we don't handle those from within WebCore, // but send a full sequence of DOM events, including an unneeded keypress. if (parameters.shouldSaveCommand || !hasKeypressCommand) [self interpretKeyEvents:[NSArray arrayWithObject:macEvent]]; else { size_t size = commands.size(); // Are there commands that would just cause text insertion if executed via Editor? // WebKit doesn't have enough information about mode to decide how they should be treated, so we leave it upon WebCore // to either handle them immediately (e.g. Tab that changes focus) or let a keypress event be generated // (e.g. Tab that inserts a Tab character, or Enter). bool haveTextInsertionCommands = false; for (size_t i = 0; i < size; ++i) { if ([self coreCommandBySelector:NSSelectorFromString(commands[i].commandName)].isTextInsertion()) haveTextInsertionCommands = true; } if (!haveTextInsertionCommands || platformEvent->type() == PlatformKeyboardEvent::Char) { for (size_t i = 0; i < size; ++i) { if (commands[i].commandName == "insertText:") [self insertText:commands[i].text]; else [self doCommandBySelector:NSSelectorFromString(commands[i].commandName)]; } } } _private->interpretKeyEventsParameters = 0; } return (!_private->receivedNOOP && parameters.eventWasHandled) || parameters.consumedByIM; } - (WebCore::CachedImage*)promisedDragTIFFDataSource { return _private->promisedDragTIFFDataSource; } - (void)setPromisedDragTIFFDataSource:(WebCore::CachedImage*)source { if (source) source->addClient(promisedDataClient()); if (_private->promisedDragTIFFDataSource) _private->promisedDragTIFFDataSource->removeClient(promisedDataClient()); _private->promisedDragTIFFDataSource = source; } #undef COMMAND_PROLOGUE - (void)_layoutIfNeeded { ASSERT(!_private->subviewsSetAside); if (_private->needsToApplyStyles || [self _needsLayout]) [self layout]; } - (void)_web_layoutIfNeededRecursive { [self _layoutIfNeeded]; #ifndef NDEBUG _private->enumeratingSubviews = YES; #endif NSMutableArray *descendantWebHTMLViews = [[NSMutableArray alloc] init]; [self _web_addDescendantWebHTMLViewsToArray:descendantWebHTMLViews]; unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) [[descendantWebHTMLViews objectAtIndex:i] _layoutIfNeeded]; [descendantWebHTMLViews release]; #ifndef NDEBUG _private->enumeratingSubviews = NO; #endif } - (void) _destroyAllWebPlugins { [[self _pluginController] destroyAllPlugins]; } - (BOOL)_needsLayout { return [[self _frame] _needsLayout]; } #if USE(ACCELERATED_COMPOSITING) - (void)attachRootLayer:(CALayer*)layer { if (!_private->layerHostingView) { NSView* hostingView = [[NSView alloc] initWithFrame:[self bounds]]; #if !defined(BUILDING_ON_LEOPARD) [hostingView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; #endif [self addSubview:hostingView]; [hostingView release]; // hostingView is owned by being a subview of self _private->layerHostingView = hostingView; [[self _webView] _startedAcceleratedCompositingForFrame:[self _frame]]; } // Make a container layer, which will get sized/positioned by AppKit and CA. CALayer* viewLayer = [CALayer layer]; #if defined(BUILDING_ON_LEOPARD) // Turn off default animations. NSNull *nullValue = [NSNull null]; NSDictionary *actions = [NSDictionary dictionaryWithObjectsAndKeys: nullValue, @"anchorPoint", nullValue, @"bounds", nullValue, @"contents", nullValue, @"contentsRect", nullValue, @"opacity", nullValue, @"position", nullValue, @"sublayerTransform", nullValue, @"sublayers", nullValue, @"transform", nil]; [viewLayer setStyle:[NSDictionary dictionaryWithObject:actions forKey:@"actions"]]; #endif [_private->layerHostingView setLayer:viewLayer]; [_private->layerHostingView setWantsLayer:YES]; // Parent our root layer in the container layer [viewLayer addSublayer:layer]; #if defined(BUILDING_ON_LEOPARD) [self _updateLayerHostingViewPosition]; #endif } - (void)detachRootLayer { if (_private->layerHostingView) { [_private->layerHostingView setLayer:nil]; [_private->layerHostingView setWantsLayer:NO]; [_private->layerHostingView removeFromSuperview]; _private->layerHostingView = nil; [[self _webView] _stoppedAcceleratedCompositingForFrame:[self _frame]]; } } #if defined(BUILDING_ON_LEOPARD) // This method is necessary on Leopard to work around <rdar://problem/7067892>. - (void)_updateLayerHostingViewPosition { if (!_private->layerHostingView) return; const CGFloat maxHeight = 2048; NSRect layerViewFrame = [self bounds]; if (layerViewFrame.size.height > maxHeight) { CGFloat documentHeight = layerViewFrame.size.height; // Clamp the size of the view to <= maxHeight to avoid the bug. layerViewFrame.size.height = maxHeight; NSRect visibleRect = [[self enclosingScrollView] documentVisibleRect]; // Place the top of the layer-hosting view at the top of the visibleRect. CGFloat topOffset = NSMinY(visibleRect); layerViewFrame.origin.y = topOffset; // Compensate for the moved view by adjusting the sublayer transform on the view's layer (using flipped coords). CGFloat bottomOffset = documentHeight - layerViewFrame.size.height - topOffset; [[_private->layerHostingView layer] setSublayerTransform:CATransform3DMakeTranslation(0, -bottomOffset, 0)]; } [_private->layerHostingView _updateLayerGeometryFromView]; // Workaround for <rdar://problem/7071636> [_private->layerHostingView setFrame:layerViewFrame]; } #endif // defined(BUILDING_ON_LEOPARD) #endif // USE(ACCELERATED_COMPOSITING) @end @implementation WebHTMLView (WebNSTextInputSupport) - (NSArray *)validAttributesForMarkedText { static NSArray *validAttributes; if (!validAttributes) { validAttributes = [[NSArray alloc] initWithObjects: NSUnderlineStyleAttributeName, NSUnderlineColorAttributeName, NSMarkedClauseSegmentAttributeName, NSTextInputReplacementRangeAttributeName, nil]; // NSText also supports the following attributes, but it's // hard to tell which are really required for text input to // work well; I have not seen any input method make use of them yet. // NSFontAttributeName, NSForegroundColorAttributeName, // NSBackgroundColorAttributeName, NSLanguageAttributeName. CFRetain(validAttributes); } LOG(TextInput, "validAttributesForMarkedText -> (...)"); return validAttributes; } - (NSTextInputContext *)inputContext { return _private->exposeInputContext ? [super inputContext] : nil; } - (NSAttributedString *)textStorage { if (!_private->exposeInputContext) { LOG(TextInput, "textStorage -> nil"); return nil; } NSAttributedString *result = [self attributedSubstringFromRange:NSMakeRange(0, UINT_MAX)]; LOG(TextInput, "textStorage -> \"%@\"", result ? [result string] : @""); // We have to return an empty string rather than null to prevent TSM from calling -string return result ? result : [[[NSAttributedString alloc] initWithString:@""] autorelease]; } - (NSUInteger)characterIndexForPoint:(NSPoint)thePoint { NSWindow *window = [self window]; WebFrame *frame = [self _frame]; if (window) thePoint = [window convertScreenToBase:thePoint]; thePoint = [self convertPoint:thePoint fromView:nil]; DOMRange *range = [frame _characterRangeAtPoint:thePoint]; if (!range) { LOG(TextInput, "characterIndexForPoint:(%f, %f) -> NSNotFound", thePoint.x, thePoint.y); return NSNotFound; } unsigned result = [frame _convertDOMRangeToNSRange:range].location; LOG(TextInput, "characterIndexForPoint:(%f, %f) -> %u", thePoint.x, thePoint.y, result); return result; } - (NSRect)firstRectForCharacterRange:(NSRange)theRange { WebFrame *frame = [self _frame]; // Just to match NSTextView's behavior. Regression tests cannot detect this; // to reproduce, use a test application from http://bugs.webkit.org/show_bug.cgi?id=4682 // (type something; try ranges (1, -1) and (2, -1). if ((theRange.location + theRange.length < theRange.location) && (theRange.location + theRange.length != 0)) theRange.length = 0; DOMRange *range = [frame _convertNSRangeToDOMRange:theRange]; if (!range) { LOG(TextInput, "firstRectForCharacterRange:(%u, %u) -> (0, 0, 0, 0)", theRange.location, theRange.length); return NSMakeRect(0, 0, 0, 0); } ASSERT([range startContainer]); ASSERT([range endContainer]); NSRect resultRect = [frame _firstRectForDOMRange:range]; resultRect = [self convertRect:resultRect toView:nil]; NSWindow *window = [self window]; if (window) resultRect.origin = [window convertBaseToScreen:resultRect.origin]; LOG(TextInput, "firstRectForCharacterRange:(%u, %u) -> (%f, %f, %f, %f)", theRange.location, theRange.length, resultRect.origin.x, resultRect.origin.y, resultRect.size.width, resultRect.size.height); return resultRect; } - (NSRange)selectedRange { if (!isTextInput(core([self _frame]))) { LOG(TextInput, "selectedRange -> (NSNotFound, 0)"); return NSMakeRange(NSNotFound, 0); } NSRange result = [[self _frame] _selectedNSRange]; LOG(TextInput, "selectedRange -> (%u, %u)", result.location, result.length); return result; } - (NSRange)markedRange { WebFrame *webFrame = [self _frame]; Frame* coreFrame = core(webFrame); if (!coreFrame) return NSMakeRange(0, 0); NSRange result = [webFrame _convertToNSRange:coreFrame->editor()->compositionRange().get()]; LOG(TextInput, "markedRange -> (%u, %u)", result.location, result.length); return result; } - (NSAttributedString *)attributedSubstringFromRange:(NSRange)nsRange { WebFrame *frame = [self _frame]; Frame* coreFrame = core(frame); if (!isTextInput(coreFrame) || isInPasswordField(coreFrame)) { LOG(TextInput, "attributedSubstringFromRange:(%u, %u) -> nil", nsRange.location, nsRange.length); return nil; } DOMRange *domRange = [frame _convertNSRangeToDOMRange:nsRange]; if (!domRange) { LOG(TextInput, "attributedSubstringFromRange:(%u, %u) -> nil", nsRange.location, nsRange.length); return nil; } NSAttributedString *result = [NSAttributedString _web_attributedStringFromRange:core(domRange)]; // [NSAttributedString(WebKitExtras) _web_attributedStringFromRange:] insists on inserting a trailing // whitespace at the end of the string which breaks the ATOK input method. <rdar://problem/5400551> // To work around this we truncate the resultant string to the correct length. if ([result length] > nsRange.length) { ASSERT([result length] == nsRange.length + 1); ASSERT([[result string] characterAtIndex:nsRange.length] == '\n' || [[result string] characterAtIndex:nsRange.length] == ' '); result = [result attributedSubstringFromRange:NSMakeRange(0, nsRange.length)]; } LOG(TextInput, "attributedSubstringFromRange:(%u, %u) -> \"%@\"", nsRange.location, nsRange.length, [result string]); return result; } // test for 10.4 because of <rdar://problem/4243463> #ifdef BUILDING_ON_TIGER - (long)conversationIdentifier { return (long)self; } #else - (NSInteger)conversationIdentifier { return (NSInteger)self; } #endif - (BOOL)hasMarkedText { Frame* coreFrame = core([self _frame]); BOOL result = coreFrame && coreFrame->editor()->hasComposition(); LOG(TextInput, "hasMarkedText -> %u", result); return result; } - (void)unmarkText { LOG(TextInput, "unmarkText"); // Use pointer to get parameters passed to us by the caller of interpretKeyEvents. WebHTMLViewInterpretKeyEventsParameters* parameters = _private->interpretKeyEventsParameters; _private->interpretKeyEventsParameters = 0; if (parameters) { parameters->eventWasHandled = YES; parameters->consumedByIM = NO; } if (Frame* coreFrame = core([self _frame])) coreFrame->editor()->confirmComposition(); } static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnderline>& result) { int length = [[string string] length]; int i = 0; while (i < length) { NSRange range; NSDictionary *attrs = [string attributesAtIndex:i longestEffectiveRange:&range inRange:NSMakeRange(i, length - i)]; if (NSNumber *style = [attrs objectForKey:NSUnderlineStyleAttributeName]) { Color color = Color::black; if (NSColor *colorAttr = [attrs objectForKey:NSUnderlineColorAttributeName]) color = colorFromNSColor([colorAttr colorUsingColorSpaceName:NSDeviceRGBColorSpace]); result.append(CompositionUnderline(range.location, NSMaxRange(range), color, [style intValue] > 1)); } i = range.location + range.length; } } - (void)setMarkedText:(id)string selectedRange:(NSRange)newSelRange { BOOL isAttributedString = [string isKindOfClass:[NSAttributedString class]]; // Otherwise, NSString LOG(TextInput, "setMarkedText:\"%@\" selectedRange:(%u, %u)", isAttributedString ? [string string] : string, newSelRange.location, newSelRange.length); // Use pointer to get parameters passed to us by the caller of interpretKeyEvents. WebHTMLViewInterpretKeyEventsParameters* parameters = _private->interpretKeyEventsParameters; _private->interpretKeyEventsParameters = 0; if (parameters) { parameters->eventWasHandled = YES; parameters->consumedByIM = NO; } Frame* coreFrame = core([self _frame]); if (!coreFrame) return; if (![self _isEditable]) return; Vector<CompositionUnderline> underlines; NSString *text = string; if (isAttributedString) { unsigned markedTextLength = [(NSString *)string length]; NSString *rangeString = [string attribute:NSTextInputReplacementRangeAttributeName atIndex:0 longestEffectiveRange:NULL inRange:NSMakeRange(0, markedTextLength)]; LOG(TextInput, " ReplacementRange: %@", rangeString); // The AppKit adds a 'secret' property to the string that contains the replacement range. // The replacement range is the range of the the text that should be replaced with the new string. if (rangeString) [[self _frame] _selectNSRange:NSRangeFromString(rangeString)]; text = [string string]; extractUnderlines(string, underlines); } coreFrame->editor()->setComposition(text, underlines, newSelRange.location, NSMaxRange(newSelRange)); } - (void)doCommandBySelector:(SEL)selector { LOG(TextInput, "doCommandBySelector:\"%s\"", sel_getName(selector)); // Use pointer to get parameters passed to us by the caller of interpretKeyEvents. // The same call to interpretKeyEvents can do more than one command. WebHTMLViewInterpretKeyEventsParameters* parameters = _private->interpretKeyEventsParameters; if (parameters) parameters->consumedByIM = NO; if (selector == @selector(noop:)) { _private->receivedNOOP = YES; return; } KeyboardEvent* event = parameters ? parameters->event : 0; bool shouldSaveCommand = parameters && parameters->shouldSaveCommand; if (event && shouldSaveCommand) event->keypressCommands().append(KeypressCommand(NSStringFromSelector(selector))); else { // Make sure that only direct calls to doCommandBySelector: see the parameters by setting to 0. _private->interpretKeyEventsParameters = 0; bool eventWasHandled; WebView *webView = [self _webView]; if ([[webView _editingDelegateForwarder] webView:webView doCommandBySelector:selector]) eventWasHandled = true; else { Editor::Command command = [self coreCommandBySelector:selector]; if (command.isSupported()) eventWasHandled = command.execute(event); else { // If WebKit does not support this command, we need to pass the selector to super. _private->selectorForDoCommandBySelector = selector; // The sink does two things: 1) Tells us if the responder went unhandled, and // 2) prevents any NSBeep; we don't ever want to beep here. WebResponderChainSink *sink = [[WebResponderChainSink alloc] initWithResponderChain:self]; [super doCommandBySelector:selector]; eventWasHandled = ![sink receivedUnhandledCommand]; [sink detach]; [sink release]; _private->selectorForDoCommandBySelector = 0; } } if (parameters) parameters->eventWasHandled = eventWasHandled; // Restore the parameters so that other calls to doCommandBySelector: see them, // and other commands can participate in setting the "eventWasHandled" flag. _private->interpretKeyEventsParameters = parameters; } } - (void)insertText:(id)string { BOOL isAttributedString = [string isKindOfClass:[NSAttributedString class]]; // Otherwise, NSString LOG(TextInput, "insertText:\"%@\"", isAttributedString ? [string string] : string); WebHTMLViewInterpretKeyEventsParameters* parameters = _private->interpretKeyEventsParameters; _private->interpretKeyEventsParameters = 0; if (parameters) parameters->consumedByIM = NO; // We don't support inserting an attributed string but input methods don't appear to require this. RefPtr<Frame> coreFrame = core([self _frame]); NSString *text; bool isFromInputMethod = coreFrame && coreFrame->editor()->hasComposition(); if (isAttributedString) { text = [string string]; // We deal with the NSTextInputReplacementRangeAttributeName attribute from NSAttributedString here // simply because it is used by at least one Input Method -- it corresonds to the kEventParamTextInputSendReplaceRange // event in TSM. This behaviour matches that of -[WebHTMLView setMarkedText:selectedRange:] when it receives an // NSAttributedString NSString *rangeString = [string attribute:NSTextInputReplacementRangeAttributeName atIndex:0 longestEffectiveRange:NULL inRange:NSMakeRange(0, [text length])]; LOG(TextInput, " ReplacementRange: %@", rangeString); if (rangeString) { [[self _frame] _selectNSRange:NSRangeFromString(rangeString)]; isFromInputMethod = YES; } } else text = string; bool eventHandled = false; if ([text length]) { KeyboardEvent* event = parameters ? parameters->event : 0; // insertText can be called from an input method or from normal key event processing // If its from normal key event processing, we may need to save the action to perform it later. // If its from an input method, then we should go ahead and insert the text now. // We assume it's from the input method if we have marked text. // FIXME: In theory, this could be wrong for some input methods, so we should try to find // another way to determine if the call is from the input method bool shouldSaveCommand = parameters && parameters->shouldSaveCommand; if (event && shouldSaveCommand && !isFromInputMethod) { event->keypressCommands().append(KeypressCommand("insertText:", text)); _private->interpretKeyEventsParameters = parameters; return; } String eventText = text; eventText.replace(NSBackTabCharacter, NSTabCharacter); // same thing is done in KeyEventMac.mm in WebCore if (coreFrame && coreFrame->editor()->canEdit()) { if (!coreFrame->editor()->hasComposition()) eventHandled = coreFrame->editor()->insertText(eventText, event); else { eventHandled = true; coreFrame->editor()->confirmComposition(eventText); } } } if (!parameters) return; if (isFromInputMethod) { // Allow doCommandBySelector: to be called after insertText: by resetting interpretKeyEventsParameters _private->interpretKeyEventsParameters = parameters; parameters->consumedByIM = YES; return; } parameters->eventWasHandled = eventHandled; } - (void)_updateSelectionForInputManager { Frame* coreFrame = core([self _frame]); if (!coreFrame) return; BOOL exposeInputContext = isTextInput(coreFrame) && !isInPasswordField(coreFrame); if (exposeInputContext != _private->exposeInputContext) { _private->exposeInputContext = exposeInputContext; // Let AppKit cache a potentially changed input context. // WebCore routinely sets the selection to None when editing, and IMs become unhappy when an input context suddenly turns nil, see bug 26009. if (!coreFrame->selection()->isNone()) [NSApp updateWindows]; } if (!coreFrame->editor()->hasComposition()) return; if (coreFrame->editor()->ignoreCompositionSelectionChange()) return; unsigned start; unsigned end; if (coreFrame->editor()->getCompositionSelection(start, end)) [[NSInputManager currentInputManager] markedTextSelectionChanged:NSMakeRange(start, end - start) client:self]; else { coreFrame->editor()->confirmCompositionWithoutDisturbingSelection(); [[NSInputManager currentInputManager] markedTextAbandoned:self]; } } @end @implementation WebHTMLView (WebDocumentPrivateProtocols) - (NSRect)selectionRect { if ([self _hasSelection]) return core([self _frame])->selectionBounds(); return NSZeroRect; } - (NSArray *)selectionTextRects { if (![self _hasSelection]) return nil; Vector<FloatRect> list; if (Frame* coreFrame = core([self _frame])) coreFrame->selectionTextRects(list); unsigned size = list.size(); NSMutableArray *result = [[[NSMutableArray alloc] initWithCapacity:size] autorelease]; for (unsigned i = 0; i < size; ++i) [result addObject:[NSValue valueWithRect:list[i]]]; return result; } - (NSView *)selectionView { return self; } - (NSImage *)selectionImageForcingBlackText:(BOOL)forceBlackText { if ([self _hasSelection]) return core([self _frame])->selectionImage(forceBlackText); return nil; } - (NSRect)selectionImageRect { if ([self _hasSelection]) return core([self _frame])->selectionBounds(); return NSZeroRect; } - (NSArray *)pasteboardTypesForSelection { if ([self _canSmartCopyOrDelete]) { NSMutableArray *types = [[[[self class] _selectionPasteboardTypes] mutableCopy] autorelease]; [types addObject:WebSmartPastePboardType]; return types; } else { return [[self class] _selectionPasteboardTypes]; } } - (void)writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard { [self _writeSelectionWithPasteboardTypes:types toPasteboard:pasteboard cachedAttributedString:nil]; } - (void)selectAll { Frame* coreFrame = core([self _frame]); if (coreFrame) coreFrame->selection()->selectAll(); } - (void)deselectAll { Frame* coreFrame = core([self _frame]); if (!coreFrame) return; coreFrame->selection()->clear(); } - (NSString *)string { return [[self _frame] _stringForRange:[self _documentRange]]; } - (NSAttributedString *)_attributeStringFromDOMRange:(DOMRange *)range { NSAttributedString *attributedString; #if !LOG_DISABLED double start = CFAbsoluteTimeGetCurrent(); #endif attributedString = [[[NSAttributedString alloc] _initWithDOMRange:range] autorelease]; #if !LOG_DISABLED double duration = CFAbsoluteTimeGetCurrent() - start; LOG(Timing, "creating attributed string from selection took %f seconds.", duration); #endif return attributedString; } - (NSAttributedString *)attributedString { DOMDocument *document = [[self _frame] DOMDocument]; NSAttributedString *attributedString = [self _attributeStringFromDOMRange:[document _documentRange]]; if (!attributedString) { Document* coreDocument = core(document); attributedString = [NSAttributedString _web_attributedStringFromRange:Range::create(coreDocument, coreDocument, 0, coreDocument, coreDocument->childNodeCount()).get()]; } return attributedString; } - (NSString *)selectedString { return [[self _frame] _selectedString]; } - (NSAttributedString *)selectedAttributedString { NSAttributedString *attributedString = [self _attributeStringFromDOMRange:[self _selectedRange]]; if (!attributedString) { Frame* coreFrame = core([self _frame]); if (coreFrame) { RefPtr<Range> range = coreFrame->selection()->selection().toNormalizedRange(); attributedString = [NSAttributedString _web_attributedStringFromRange:range.get()]; } } return attributedString; } - (BOOL)supportsTextEncoding { return YES; } - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag startInSelection:(BOOL)startInSelection { if (![string length]) return NO; Frame* coreFrame = core([self _frame]); return coreFrame && coreFrame->findString(string, forward, caseFlag, wrapFlag, startInSelection); } @end @implementation WebHTMLView (WebDocumentInternalProtocols) - (NSDictionary *)elementAtPoint:(NSPoint)point { return [self elementAtPoint:point allowShadowContent:NO]; } - (NSDictionary *)elementAtPoint:(NSPoint)point allowShadowContent:(BOOL)allow { Frame* coreFrame = core([self _frame]); if (!coreFrame) return nil; return [[[WebElementDictionary alloc] initWithHitTestResult:coreFrame->eventHandler()->hitTestResultAtPoint(IntPoint(point), allow)] autorelease]; } - (NSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag limit:(NSUInteger)limit { Frame* coreFrame = core([self _frame]); if (!coreFrame) return 0; return coreFrame->markAllMatchesForText(string, caseFlag, limit); } - (void)setMarkedTextMatchesAreHighlighted:(BOOL)newValue { Frame* coreFrame = core([self _frame]); if (!coreFrame) return; coreFrame->setMarkedTextMatchesAreHighlighted(newValue); } - (BOOL)markedTextMatchesAreHighlighted { Frame* coreFrame = core([self _frame]); return coreFrame && coreFrame->markedTextMatchesAreHighlighted(); } - (void)unmarkAllTextMatches { Frame* coreFrame = core([self _frame]); if (!coreFrame) return; Document* document = coreFrame->document(); if (!document) return; document->removeMarkers(DocumentMarker::TextMatch); } - (NSArray *)rectsForTextMatches { Frame* coreFrame = core([self _frame]); if (!coreFrame) return [NSArray array]; Document* document = coreFrame->document(); if (!document) return [NSArray array]; Vector<IntRect> rects = document->renderedRectsForMarkers(DocumentMarker::TextMatch); unsigned count = rects.size(); NSMutableArray *result = [NSMutableArray arrayWithCapacity:count]; for (unsigned index = 0; index < count; ++index) [result addObject:[NSValue valueWithRect:rects[index]]]; return result; } @end // This is used by AppKit and is included here so that WebDataProtocolScheme is only defined once. @implementation NSURL (WebDataURL) + (NSURL *)_web_uniqueWebDataURL { CFUUIDRef UUIDRef = CFUUIDCreate(kCFAllocatorDefault); NSString *UUIDString = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, UUIDRef); CFRelease(UUIDRef); NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@", WebDataProtocolScheme, UUIDString]]; CFRelease(UUIDString); return URL; } @end @implementation WebResponderChainSink - (id)initWithResponderChain:(NSResponder *)chain { self = [super init]; _lastResponderInChain = chain; while (NSResponder *next = [_lastResponderInChain nextResponder]) _lastResponderInChain = next; [_lastResponderInChain setNextResponder:self]; return self; } - (void)detach { [_lastResponderInChain setNextResponder:nil]; _lastResponderInChain = nil; } - (BOOL)receivedUnhandledCommand { return _receivedUnhandledCommand; } - (void)noResponderFor:(SEL)selector { _receivedUnhandledCommand = YES; } - (void)doCommandBySelector:(SEL)selector { _receivedUnhandledCommand = YES; } - (BOOL)tryToPerform:(SEL)action with:(id)object { _receivedUnhandledCommand = YES; return YES; } @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebResourceInternal.h������������������������������������������������������������0000644�0001750�0001750�00000004304�11124255324�016542� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebResourcePrivate.h" #import <wtf/PassRefPtr.h> #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) #define MAIL_THREAD_WORKAROUND 1 #endif namespace WebCore { class ArchiveResource; } @interface WebResource (WebResourceInternal) - (id)_initWithCoreResource:(PassRefPtr<WebCore::ArchiveResource>)coreResource; - (WebCore::ArchiveResource*)_coreResource; @end #ifdef MAIL_THREAD_WORKAROUND @interface WebResource (WebMailThreadWorkaround) + (BOOL)_needMailThreadWorkaroundIfCalledOffMainThread; @end inline bool needMailThreadWorkaround() { return !pthread_main_np() && [WebResource _needMailThreadWorkaroundIfCalledOffMainThread]; } #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/WebView/WebHTMLViewPrivate.h�������������������������������������������������������������0000644�0001750�0001750�00000012242�11211771535�016214� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2005, 2006, 2007, 2008 Apple 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebKit/WebHTMLView.h> #if !defined(ENABLE_NETSCAPE_PLUGIN_API) #define ENABLE_NETSCAPE_PLUGIN_API 1 #endif @class DOMDocumentFragment; @class DOMNode; @class DOMRange; @class WebPluginController; @protocol WebHTMLHighlighter - (NSRect)highlightRectForLine:(NSRect)lineRect representedNode:(DOMNode *)node; - (void)paintHighlightForBox:(NSRect)boxRect onLine:(NSRect)lineRect behindText:(BOOL)text entireLine:(BOOL)line representedNode:(DOMNode *)node; // the following methods are deprecated and will be removed once Mail switches to the new methods <rdar://problem/5050528> - (NSRect)highlightRectForLine:(NSRect)lineRect; - (void)paintHighlightForBox:(NSRect)boxRect onLine:(NSRect)lineRect behindText:(BOOL)text entireLine:(BOOL)line; @end @interface WebHTMLView (WebPrivate) + (NSArray *)supportedMIMETypes; + (NSArray *)supportedImageMIMETypes; + (NSArray *)supportedNonImageMIMETypes; + (NSArray *)unsupportedTextMIMETypes; - (void)close; // Modifier (flagsChanged) tracking SPI + (void)_postFlagsChangedEvent:(NSEvent *)flagsChangedEvent; - (void)_updateMouseoverWithFakeEvent; - (void)_setAsideSubviews; - (void)_restoreSubviews; - (BOOL)_insideAnotherHTMLView; - (void)_clearLastHitViewIfSelf; - (void)_updateMouseoverWithEvent:(NSEvent *)event; + (NSArray *)_insertablePasteboardTypes; + (NSArray *)_selectionPasteboardTypes; - (void)_writeSelectionToPasteboard:(NSPasteboard *)pasteboard; - (void)_frameOrBoundsChanged; - (NSImage *)_dragImageForLinkElement:(NSDictionary *)element; - (NSImage *)_dragImageForURL:(NSString*)linkURL withLabel:(NSString*)label; - (void)_handleAutoscrollForMouseDragged:(NSEvent *)event; - (WebPluginController *)_pluginController; // FIXME: _selectionRect is deprecated in favor of selectionRect, which is in protocol WebDocumentSelection. // We can't remove this yet because it's still in use by Mail. - (NSRect)_selectionRect; - (void)_startAutoscrollTimer:(NSEvent *)event; - (void)_stopAutoscrollTimer; - (BOOL)_canEdit; - (BOOL)_canEditRichly; - (BOOL)_canAlterCurrentSelection; - (BOOL)_hasSelection; - (BOOL)_hasSelectionOrInsertionPoint; - (BOOL)_isEditable; - (BOOL)_transparentBackground; - (void)_setTransparentBackground:(BOOL)isBackgroundTransparent; - (void)_setToolTip:(NSString *)string; // SPI used by Mail. // FIXME: These should all be moved to WebView; we won't always have a WebHTMLView. - (NSImage *)_selectionDraggingImage; - (NSRect)_selectionDraggingRect; - (DOMNode *)_insertOrderedList; - (DOMNode *)_insertUnorderedList; - (BOOL)_canIncreaseSelectionListLevel; - (BOOL)_canDecreaseSelectionListLevel; - (DOMNode *)_increaseSelectionListLevel; - (DOMNode *)_increaseSelectionListLevelOrdered; - (DOMNode *)_increaseSelectionListLevelUnordered; - (void)_decreaseSelectionListLevel; - (void)_setHighlighter:(id <WebHTMLHighlighter>)highlighter ofType:(NSString *)type; - (void)_removeHighlighterOfType:(NSString *)type; - (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard forType:(NSString *)pboardType inContext:(DOMRange *)context subresources:(NSArray **)subresources; #if ENABLE_NETSCAPE_PLUGIN_API - (void)_resumeNullEventsForAllNetscapePlugins; - (void)_pauseNullEventsForAllNetscapePlugins; #endif // SPI for DumpRenderTree - (BOOL)_isUsingAcceleratedCompositing; // SPI for printing (should be converted to API someday). When the WebHTMLView isn't being printed // directly, this method must be called before paginating, or the computed height might be incorrect. // Typically this would be called from inside an override of -[NSView knowsPageRange:]. - (void)_layoutForPrinting; - (BOOL)_canSmartReplaceWithPasteboard:(NSPasteboard *)pasteboard; @end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Resources/�������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024256�013055� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Resources/nullplugin.tiff����������������������������������������������������������������0000644�0001750�0001750�00000003032�10361116220�016102� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������MM�*��T€� P8$ „BaP¸d6ˆDbPTN(•KJÕªù“ …‚ìX”JePàL(5·¶;A´çt;žÏ÷Ãéù<Ÿ?Ý.ùÜÖo1™Ëeòºe6/ŒÆÈÄ’eDÚq».דáþô{¾ßö;%–Íc°X«•êÅj©V¨T©×8<šE$2\Ž·£ýäö}?ßÏë:UdÔ´ÛîÛ=“ŒÃb,¸;ÿ{¾ÞnòXµÒJ ›SÛ šÙt:Þwû想Z_ë+}þ`E¯öûÞëqºÚmžx …›]?Õk,ÍF‹I ¦ †cA²M.œQ9/ÎYþ£^6Ÿêö&Ùºæx¿ßoÌ'ŸÓäÛaš¯ö;YÓãò¿Ó‹v¿ëøü6Ï«îG•¦‘þT˜áþm‡þŸ°\Á'ù:\?®ó´î:Îäê"¨ðR™e‘†h›Ž;Âð$ *eÑÿFQ¤gÆñàK˜ÇùœmgùÌvž­jƒHr, $‘†‰#Ñm(JR¤§(Êò© S™ÑZÇEé–m„¢ b¢yeáqd‚i�Q˜Ðvž/9䔥ñ¶Žäá‹$1y@PSäýgc‹G¬æY³ “åÉ°Ä©ˆ‰ÃñoLSGý+K›g#Òpœ§Qâ Da€ Šdéò ¥ ÿ4ÍgüÕ6WgøZA—§pÖH•f ô}½t‚ÌF•†Œ[Ÿæ1¬tçyè|Ú¶½£iÙð5™gYK+\õŒ#Ù4`‚¢,wV•µÚÝõÅy\×·­è>á"U†]”<Q!XÈTŸø ƒ`¸ƒáXeÄñbe"qn]øÍkxcwŠ{^y u\Ž…”^ÄQ!rdšpRÈ÷äÙlþŒ„q€‡caœgGþk›æOî`²—F~ 3>5wcºn™§Öøýé©äEѲÆEÓmfGþKMÓ€–?”FRw=7 qœçYâÕµ}cYãd‘`iŸæ»GEÙ³Žj^¢‡dDdN¿ÃüCÒ3t½{_Ø6‹cÙ,mÆ~\·=Óuð[îþ >}›,ÙÿÕãÜ&©ÆW¼…/Å׺Ëlj ï zßÕøe‘DÙbe⸿wŽdÉŽù>_²ŠšÏY§phow×úóg²û=…sãú—~í¼&‘ÍÕú1–õG|…åïd^î¬Æ+áû׿o§[t0js«|cýô¿¸ ûÞë…vCýÜЖ&Öt uïê =H_q‚^Ø$È„€ÂoáìBTÙ 2ïuOþ�‡ZC@8 Z6àøÿ¢Q.×» Ÿ tF—¨Bˆ™` ‚ð–J� ÀH†‘00+‹~¥ŠÃØM !<Ap1‰æ<§NÍÜ b8p€@it� €`:ÃðŸp­pÀø#áüd… Yl:¥ÞB�y��ð0gˆXA|<Cé䙌jØPÈ'À�€H  ‚T¢ai,ü^üšˆË¸* ñø0HR”Ï� < Á°+âÜsÊ÷„H‰@ Б/&�À@ àL… Ï˜Ó 0’"†ÜnŽFrp@8 xCŠ¸s $DŠ�@)Ë=Èx A¬CÈ6?Àh3 "fPÊ9ñAȘ¡00á1GËùc²Ô~�He£EÌ0dàÜ]"`xLÉFéD¥†0Ì€À. )M1¦T̃�������� ������� �������������������������������������������������K������ �������������(�������R���������������� ü€��'� ü€��'������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/Resources/url_icon.tiff������������������������������������������������������������������0000644�0001750�0001750�00000001770�10361116220�015532� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������MM�*��2€� P8$ „BaP¸d „¢¡â^9(¯H$ÓSš7ŠKÑ8°|‚‚¢èl,/‚A¡âøÈ„hm ·ú‘nѯšN‡û°ê¤•Œ·ù© ©Œˆf–ÔÊi/�e°)|º+!\æ´½1¶çz¿Ýo7ÓýØò¶Ûí¬÷ÅþwS¶æ$‹þ& žà€ez‚Å Àñ‰º#0­çå[mþçx>î—‹ç7Ïç’‹‡ ü Žh?Æ'¦3ü6[Y?Ác;t� a� `É�%ŸàŠÕþkO5Ÿí×KÙþŠY¸ìVÓÁþcMòƒÆ¶ü4ha?Á¦%ëüX\?ÀäÃüoàà ùaz(+¼F%óüf=™'ù~kÇù,^‡øÀMšçøÚQ²ÁhòdáPí #yŠ‚£9€€Â±^÷/²†cÉÌ¿‡øJ8¯ÁˆøfáÙÔ%[JI—‡9þ%hªJ/B)iŸáÁ�gáXí�ƒ#I‚!àüs!�P}+„ƒÂiþ#‘®PšI2‰0é ÄÙÄ”¦QÞ‰ö‘…ʈ%îP|C5!`ñ ‚b9, à€r4¡€îð‰$t,“³xÌRjiV» …iæž'¹ýPTGùÌxŸ‡ù˜p¹Â‘,máá�¿Áõ„áHŒBCÉv‹äÞ5•«°ð\U#ù~~Ÿä §UGÇùæÏç“5RTcFsâað‚ဒù À( ¡¢ønÛGIþ>¶a)&©þ’piþL/UñTÔ5IJiYƒXvŸâ ÖL› H ·HX&Bè¤@'9�`-¤Ã,”Väáwå¹×f³<c5Ic-¢ñ`ààR‹¬8`(‡�ðf'¢ÁZä!ƒ†úÒUÖa¼wÓæ‘ËL¦%¸/ũΑŸh�v ¡�   €0$‰ ˜J! ž6ˆæH›ƒ1UCYVBðúM›Ü[¡0~<î[¦Ý¸m[b·Íóœê€€�����������������������à�����������������������������������������)������è������ð�������(�������R���������������� ü€��'� ü€��'��������WebKit/mac/Resources/IDNScriptWhiteList.txt���������������������������������������������������������0000644�0001750�0001750�00000000361�10360512352�017243� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Default Web Kit International Domain Name Script White List. Common Inherited Arabic Armenian Bopomofo Canadian_Aboriginal Devanagari Deseret Gujarati Gurmukhi Hangul Han Hebrew Hiragana Katakana_Or_Hiragana Katakana Latin Tamil Thai Yi �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/ChangeLog-2002-12-03���������������������������������������������������������������������0000644�0001750�0001750�00003137612�10714225174�013712� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������2002-12-03 Trey Matteson <trey@apple.com> Re-fix of 3113393 - Clients side redirects shouldn't always add item to back/forward list Fix 3116980 - REGRESSION: Back button goes back twice Fix 3099631 - assertion failure at http://www.calendarlive.com/ when pop-up blocking is off The earlier fix for the first bug was to consider any redirect happening within one second as a continuation of the previous load. To fix the regressions I re-cast that fix using a similar, pre-existing mechanism. Reviewed by: Richwill * WebView.subproj/WebFramePrivate.h: Nuke shortRedirectComing, rename instantRedirectComing to quickRedirectComing. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _createOrUpdateItem]): Remove code related to shortRedirectComing, the fix that brought the regressions. (-[WebFrame _setState:]): Don't cache the page we're leaving if we're doing a redirect (since we don't want the redirecting page in the cache). (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:request:]): Above rename. (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): Above rename. (-[WebFrame _loadURL:intoChild:]): Comment fix. (-[WebFrame _clientRedirectedTo:delay:fireDate:]): Use 1 second instead of 0 seconds as the metric of a client redirect. Do not consider whether the frame state is completed as part of the decision. (-[WebFrame _clientRedirectCancelled]): Above rename. 2002-12-03 John Sullivan <sullivan@apple.com> Reviewed by: Darin - REALLY changed the default state for block pop-ups to be off. * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): change default for letting JavaScript open windows automatically to YES 2002-12-03 Darin Adler <darin@apple.com> - fixed 3117135 -- world leak: drag any image, get a leak of 1 WebFrame Reviewed by John. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): Retain the URL of the dragged image, not the entire element dictionary. The element dictionary creates a reference cycle since it includes a reference to the WebFrame. (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Use the URL rather than extracting it from the dictionary with a WebElementImageURLKey. * WebView.subproj/WebHTMLViewPrivate.h: URL, not element dictionary. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLViewPrivate dealloc]): Release the URL, not the element dictionary. 2002-12-03 Richard Williamson <rjw@apple.com> Added a preference to change the page cache size, i.e.: Alexander.app/Contents/MacOS/Alexander -WebKitPageCacheSizePreferenceKey 4 Reviewed by: hyatt * History.subproj/WebBackForwardList.m: (+[WebBackForwardList setPageCacheSize:]): (+[WebBackForwardList pageCacheSize]): * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): (-[WebPreferences _initialTimedLayoutSize]): (-[WebPreferences _pageCacheSize]): * WebView.subproj/WebPreferencesPrivate.h: 2002-12-03 Richard Williamson <rjw@apple.com> Fixed 3019986. Use an array of font families instead of a single font family to support CSS family lists. r=hyatt * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _web_widthForString:font:]): * Misc.subproj/WebStringTruncator.m: (+[WebStringTruncator rightTruncateString:toWidth:withFont:]): (+[WebStringTruncator centerTruncateString:toWidth:withFont:]): * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer substituteFontForString:families:]): (-[WebTextRenderer substituteFontForCharacters:length:families:]): (-[WebTextRenderer widthForCharacters:length:]): (-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:rightToLeft:letterSpacing:wordSpacing:fontFamilies:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:characterPosition:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:letterSpacing:wordSpacing:fontFamilies:]): (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:letterSpacing:wordSpacing:fontFamilies:]): * WebCoreSupport.subproj/WebTextRendererFactory.h: * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory fontWithFamilies:traits:size:]): (-[WebTextRendererFactory fontWithFamily:traits:size:]): (+[WebTextRendererFactory fallbackFontWithTraits:size:]): (-[WebTextRendererFactory cachedFontFromFamily:traits:size:]): (-[WebTextRendererFactory cachedFontFromFamilies:traits:size:]): (-[WebTextRendererFactory rendererWithFamilies:traits:size:]): 2002-12-03 Chris Blumenberg <cblu@apple.com> Fixed: 3115073 - REGRESSION: plants.com is crashing in WebIconDB with bad retain count The plants.com favicon was marked to be removed from disk and thus it had no retain count. The problem was that it was still on disk and _hasIconForIconURL would return YES. If hasIconForIconURL returns YES, its is ok to call _setIconURL:forSiteURL:. Since there was no retain count, the assert in _setIconURL:forSiteURL: would be hit. We now consider icons without retain counts to not exist even if they're on disk. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _updateFileDatabase]): (-[WebIconDatabase _setIconURL:forSiteURL:]): 2002-12-03 Chris Blumenberg <cblu@apple.com> Fixed: 3112477 - REGRESSION: dropping image within window loads image in current window Fix: Unregister the parent webview for dragging when the drag starts, reregister after the drag ends. 3116423 - Dragged images sometimes have the wrong promised-file file type Fix: Make the - [NSView_web_dragPromisedImage...] method take a file type rather than deriving the file type from the URL 3115768 - REGRESSION: contextual menu item "copy url to clipboard" doesn't work Fix: In [NSPastboard _web_writeURL:andTitle:withOwner:] adding pboard types doesn't work for the general pasteboard, have to redeclare. 3116594 - Image on the drag pasteboard shouldn't have applied transparency and scaling Fix: In - [NSView_web_dragPromisedImage...] put the original image on the pboard Reviewed by John. * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeURL:andTitle:withOwner:]): don't use addTypes as it doesn't work as I expected * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragPromisedImage:origin:URL:fileType:title:event:]): put the original image on the pboard, not the drag image * WebView.subproj/WebHTMLView.m: (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): (-[WebHTMLView mouseDragged:]): call _web_dragPromisedImage (-[WebHTMLView draggedImage:endedAt:operation:]): call -[WebView _reregisterDraggedTypes] * WebView.subproj/WebImageView.m: (-[WebImageView mouseDragged:]): call _web_dragPromisedImage (-[WebImageView draggedImage:endedAt:operation:]): call -[WebView _reregisterDraggedTypes] * WebView.subproj/WebView.m: (-[WebView initWithFrame:]): call _reregisterDraggedTypes (-[WebView draggingEntered:]): simplified, don't need to check drag source * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _reregisterDraggedTypes]): 2002-12-03 Darin Adler <darin@apple.com> - fixed 3114796 -- WORLD LEAKS: 1 WebFrame leaked on trivial source file with <html> tag only (probably fixed a ton of other bugs too, since this always leaks) Reviewed by Chris. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementAtPoint:]): Added a missing autorelease. 2002-12-03 Darin Adler <darin@apple.com> Reviewed by Maciej. * WebView.subproj/WebView.m: Fixed a pair of strings that conflict. * English.lproj/Localizable.strings: Regenerated. * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2002-12-02 Trey Matteson <trey@apple.com> Refined bookmark notifications to be more detailed. We now have added, removed, willChange and didChange. * Bookmarks.subproj/WebBookmarkGroup.h: New API. * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup _sendNotification:forBookmark:children:]): (-[WebBookmarkGroup _setTopBookmark:]): (-[WebBookmarkGroup _bookmarkWillChange:]): (-[WebBookmarkGroup _bookmarkDidChange:]): (-[WebBookmarkGroup _bookmarkChildren:wereAddedToParent:]): (-[WebBookmarkGroup _bookmarkChildren:wereRemovedToParent:]): All just small pieces of flow control for posting the notes. * Bookmarks.subproj/WebBookmarkGroupPrivate.h: Internal methods for posting the notes. * Bookmarks.subproj/WebBookmarkLeaf.m: (-[WebBookmarkLeaf setTitle:]): Post da note (-[WebBookmarkLeaf setURLString:]): Post da note (-[WebBookmarkLeaf description]): Added for debugging. * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList setTitle:]): Post da note (-[WebBookmarkList removeChild:]): Post da note (-[WebBookmarkList insertChild:atIndex:]): Post da note * Bookmarks.subproj/WebBookmarkProxy.m: (-[WebBookmarkProxy setTitle:]): Post da note * English.lproj/StringsNotToBeLocalized.txt: New strings. * WebKit.exp: New strings. 2002-12-02 Maciej Stachowiak <mjs@apple.com> - added original URL field to action dictionary so that policy delegates can avoid prompting over and over on redirects. * WebKit.exp: * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebControllerPolicyDelegate.m: * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithRequest:]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): * WebView.subproj/WebFrame.m: (-[WebFrame loadRequest:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _actionInformationForNavigationType:event:originalURL:]): (-[WebFrame _checkNavigationPolicyForRequest:dataSource:andCall:withSelector:]): (-[WebFrame _addExtraFieldsToRequest:]): (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): (-[WebFrame _postWithURL:data:contentType:triggeringEvent:]): 2002-11-28 Darin Adler <darin@apple.com> * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler createFileIfNecessary]): Add a FIXME. (-[WebDownloadHandler writeDataForkData:resourceForkData:]): Notify that the file system has changed so the Finder can respond to the size change. (-[WebDownloadHandler finishedLoading]): Notify that the file system has changed now that the download has completed and the files are closed (may be redundant now that we have the above, but will do no harm). * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): Use _web_isCaseInsensitiveEqualToString instead of lowercaseString. * Misc.subproj/WebNSViewExtras.m: Tweak formatting. 2002-11-27 Richard Williamson <rjw@apple.com> Fixed 3113393. Client side redirects that happen <= 1 second update the current back/forward item, rather than creating a new one. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _addBackForwardItemClippedAtTarget:]): (-[WebFrame _createOrUpdateItem]): (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _clientRedirectedTo:delay:fireDate:]): (-[WebFrame _clientRedirectCancelled]): 2002-11-27 Richard Williamson <rjw@apple.com> Fixed measurement error for Ahem font (and any font that has a tiny fractional value). 3112745, 3112742 * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer initWithFont:]): 2002-11-26 Chris Blumenberg <cblu@apple.com> Fixed: 3090834 - Launch WMP (Window Media Player) when encountering WMP content Added contentURL to WebPluginError. * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage initWithPath:]): * Plugins.subproj/WebNullPluginView.m: (-[WebNullPluginView viewDidMoveToWindow]): * Plugins.subproj/WebPluginError.h: * Plugins.subproj/WebPluginError.m: (-[WebPluginErrorPrivate dealloc]): (-[WebPluginError dealloc]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]): === Alexander-34 === 2002-11-26 Richard Williamson <rjw@apple.com> Only cache page if the load has completed. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setState:]): 2002-11-26 Chris Blumenberg <cblu@apple.com> Removed some logging. * WebView.subproj/WebControllerPrivate.m: (+[WebController _supportedImageMIMETypes]): 2002-11-26 Chris Blumenberg <cblu@apple.com> Fixed: 3112003 - Show standalone tiffs using AppKit not QT plug-in We now dynamically check NSImage for supported image types when registering WebImageView's and WebImageRepresentation's supported MIME types. * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (+[WebController _supportedImageMIMETypes]): convert NSImage types to mime types * WebView.subproj/WebDataSourcePrivate.m: (+[WebDataSource _repTypes]): use _supportedImageMIMETypes to register mime types of WebImageRepresentation * WebView.subproj/WebViewPrivate.m: (+[WebView _viewTypes]): use _supportedImageMIMETypes to register mime types of WebImageView 2002-11-26 Chris Blumenberg <cblu@apple.com> Fixed: 3061174 - javascript: URLs sent by plugins don't work For "Javascript:" URLs. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): lowercase the scheme 2002-11-26 Richard Williamson <rjw@apple.com> More work on back/forward cache. It's ready for more general testing. Although, to be safe I've left it disabled by default for tomorrow's release. It will log when a page is save and restored from the page cache. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge saveDocumentToPageCache:]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): (-[WebDataSource _commitIfReady:]): (-[WebDataSource _loadIcon]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): (-[WebFrame _setState:]): (-[WebFrame _loadItem:fromItem:withLoadType:]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]): (-[WebFrame _setProvisionalDataSource:]): 2002-11-25 Richard Williamson <rjw@apple.com> Cleanup leaking objects in page cache. Cleaned up API a bit. * History.subproj/WebBackForwardList.h: * History.subproj/WebBackForwardList.m: (-[WebBackForwardList dealloc]): (+[WebBackForwardList setUsesPageCache:]): (+[WebBackForwardList usesPageCache]): (+[WebBackForwardList setPageCacheSize:]): (+[WebBackForwardList pageCacheSize]): * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem setHasPageCache:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge saveDocumentToPageCache:]): * WebKit.exp: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _canCachePage]): (-[WebFrame _purgePageCache]): (-[WebFrame _setState:]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]): 2002-11-25 Richard Williamson <rjw@apple.com> Changed ordering of cachability check. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setState:]): 2002-11-25 Richard Williamson <rjw@apple.com> Changes fro back/forward cache. * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (+[WebHistoryItem setUsePageCache:]): (+[WebHistoryItem usePageCache]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge saveDocumentToPageCache:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _detachFromParent]): (-[WebFrame _canCachePage]): (-[WebFrame _setState:]): 2002-11-25 Chris Blumenberg <cblu@apple.com> Fixed 2 drag-related crashes. Oops. * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragPromisedImage:fromOrigin:withURL:title:event:]): put nil at the end of the array list. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): retain self before drag 2002-11-25 Chris Blumenberg <cblu@apple.com> - Allow missing icons to be restored when going to the page of the missing icon. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _setIconURL:forSiteURL:]): 2002-11-25 Richard Williamson <rjw@apple.com> Changes for back/forward. Currently disabled. * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem dealloc]): (-[WebHistoryItem setPageCacheEnabled:]): (-[WebHistoryItem pageCache]): * Misc.subproj/WebKitLogging.h: * Misc.subproj/WebKitLogging.m: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge saveDocumentToPageCache:]): * WebView.subproj/WebDataSource.m: (-[WebDataSource startLoading]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): (-[WebDataSource _startLoading]): (-[WebDataSource _commitIfReady:]): (-[WebDataSource _commitIfReady]): (-[WebDataSource _setStoredInPageCache:]): (-[WebDataSource _storedInPageCache]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted:]): (-[WebFrame _canCachePage]): (-[WebFrame _purgePageCache]): (-[WebFrame _setState:]): (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:request:]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]): 2002-11-25 Richard Williamson <rjw@apple.com> Fixed exception thrown often when creating mouseover status text (3110186). * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementAtPoint:]): 2002-11-25 Darin Adler <darin@apple.com> - fixed a problem I discovered in testing where multiple identical bookmarks confuse us * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList removeChild:]): Use indexOfObjectIdenticalTo: and removeObjectIdenticalTo: instead of containsObject: and removeObject:. (-[WebBookmarkList insertChild:atIndex:]): Use indexOfObjectIdenticalTo: instead of containsObject: in the assertion. 2002-11-25 Chris Blumenberg <cblu@apple.com> Fixed: 3084350 - No URL flavors provided for images * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragPromisedImage:fromOrigin:withURL:title:event:]): renamed, simplifies dragging an image (-[WebFilePromiseDragSource initWithSource:]): subclass of NSFilePromiseDragSource, to be used later (-[WebFilePromiseDragSource draggingSource]): (-[WebFilePromiseDragSource dealloc]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): call _web_dragPromisedImage:fromOrigin:withURL:title:event:, retain self (-[WebHTMLView draggedImage:endedAt:operation:]): added, release self * WebView.subproj/WebImageView.m: (-[WebImageView mouseDragged:]): call _web_dragPromisedImage:fromOrigin:withURL:title:event:, retain self (-[WebImageView draggedImage:endedAt:operation:]): added, release self * WebView.subproj/WebView.m: (-[WebView isDocumentHTML]): call isKindOfClass instead of className (-[WebView draggingEntered:]): check for WebFilePromiseDragSource 2002-11-24 Trey Matteson <trey@apple.com> Added URLString method to WebHistoryItem to avoid silly conversions between NSURL and NSString. When the dust settles with our plans for NSURL we can rationalize this API with the rest of WebKit. * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem URLString]): 2002-11-24 Chris Blumenberg <cblu@apple.com> Added element keys for the image ALT and link TITLE attributes. This will eventually be used to fix other bugs. Also made WebKit and WebCore use the same element keys to simplify the conversion of the element dictionary. * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementAtPoint:]): 2002-11-24 Chris Blumenberg <cblu@apple.com> Fixed: 3109945 - Assertion failure in -[WebIconDatabase_largestIconFromDictionary:] Added error strings for download decoding errors. * English.lproj/Localizable.strings: Added error strings for download decoding errors * English.lproj/StringsNotToBeLocalized.txt: * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _loadIconDictionaries]): tweak (-[WebIconDatabase _updateFileDatabase]): more error checking to prevent assert (-[WebIconDatabase _setIconURL:forSiteURL:]): added asserts to prevent a site URL <-> icon URL mapping without a icon URL -> icon mapping (-[WebIconDatabase _largestIconFromDictionary:]): tweak * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeURL:andTitle:withOwner:]): declare pboard types if none have been declared, else append types * WebView.subproj/WebView.m: (+[WebView initialize]): Added error strings for download decoding errors 2002-11-24 Maciej Stachowiak <mjs@apple.com> - fixed 3067939 - no support for window.document.lastModified * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady]): Pass last modified date to WebCore. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:request:]): Pass nil last modified date. 2002-11-23 Chris Blumenberg <cblu@apple.com> Fixed: 3109835 - Download errors aren't communicated to client Cleaned-up WebMainResourceClient and WebBaseResourceHandleDelegate a little. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase defaultIconWithSize:]): tweak (-[WebIconDatabase releaseIconForSiteURL:]): don't retain site URL here (-[WebIconDatabase _setIcon:forIconURL:]): tweak (-[WebIconDatabase _setIconURL:forSiteURL:]): tweak (-[WebIconDatabase _releaseIconForIconURLString:]): retain site URL here (-[WebIconDatabase _releaseFutureIconForSiteURL:]): tweak (-[WebIconDatabase _sendNotificationForSiteURL:]): tweak * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate cancelWithError:]): made public (-[WebBaseResourceHandleDelegate cancel]): cancel downloads too, call cancelWithError (-[WebBaseResourceHandleDelegate cancelQuietly]): call cancelWithError (-[WebBaseResourceHandleDelegate cancelledError]): tweak (-[WebBaseResourceHandleDelegate notifyDelegatesOfInterruptionByPolicyChange]): tweak * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:]): stop downloadHandler if downloading, else notify controller (-[WebMainResourceClient cancel]): call receivedError (-[WebMainResourceClient checkContentPolicyForResponse:andCallSelector:]): tweak (-[WebMainResourceClient handle:didReceiveData:]): stop load for download errors, report error (-[WebMainResourceClient handleDidFinishLoading:]): call didFailLoadingWithError is download error (-[WebMainResourceClient handle:didFailLoadingWithError:]): call receivedError 2002-11-22 Darin Adler <darin@apple.com> * Misc.subproj/WebCoreStatistics.h: * Misc.subproj/WebCoreStatistics.m: (+[WebCoreStatistics javaScriptRootObjectClasses]): Update for name change -- root object classes, not all live object classes. 2002-11-22 Chris Blumenberg <cblu@apple.com> Fixed assertion while loading local files. * Misc.subproj/WebIconDatabase.m: we don't have icon URLs for files * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): Only try loading favicon as the root of server if scheme is http or https. This isn't really a feature of other protocols. 2002-11-22 Chris Blumenberg <cblu@apple.com> * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): Added a FIXME around saveFilenameForResponse:andRequest: because the API expects a path but is asking for a filename. 2002-11-22 Chris Blumenberg <cblu@apple.com> Fixed: 3104693 - QT movie doesn't show video while still downloading The initial size of plug-in should be 0,0 instead of 1,1 or else we don't get the layout * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView initWithFrame:]): 2002-11-22 Chris Blumenberg <cblu@apple.com> Fixed: 3078737 - Crash in -[WebHistoryItem dealloc] after closing last window * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase releaseIconForSiteURL:]): retain the site URL string because it may get released from beneath (-[WebIconDatabase _updateFileDatabase]): tweak (-[WebIconDatabase _iconsForIconURLString:]): disable timings for deployment build (-[WebIconDatabase _setIconURL:forSiteURL:]): tweak (-[WebIconDatabase _releaseIconForIconURLString:]): tweak (-[WebIconDatabase _scaleIcon:toSize:]): disable timings for deployment build * Misc.subproj/WebIconDatabasePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _updateIconDatabaseWithURL:]): new, does the db binding (-[WebDataSource _loadIcon]): call _updateIconDatabaseWithURL 2002-11-22 Chris Blumenberg <cblu@apple.com> Attempt to fix: 3078737 - Crash in -[WebHistoryItem dealloc] after closing last window I haven't found anything that would cause the crash. I did some clean-up, added asserts and error messages in hopes that this help me track this down. * Misc.subproj/WebIconDatabase.h: * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase init]): (-[WebIconDatabase iconForSiteURL:withSize:cache:]): (-[WebIconDatabase iconForSiteURL:withSize:]): (-[WebIconDatabase retainIconForSiteURL:]): (-[WebIconDatabase releaseIconForSiteURL:]): (-[WebIconDatabase delayDatabaseCleanup]): (-[WebIconDatabase allowDatabaseCleanup]): (-[WebIconDatabase _iconDictionariesAreGood]): (-[WebIconDatabase _loadIconDictionaries]): (-[WebIconDatabase _updateFileDatabase]): (-[WebIconDatabase _hasIconForSiteURL:]): (-[WebIconDatabase _iconsForIconURLString:]): (-[WebIconDatabase _iconForFileURL:withSize:]): (-[WebIconDatabase _setIcon:forIconURL:]): (-[WebIconDatabase _setIconURL:forSiteURL:]): (-[WebIconDatabase _retainIconForIconURLString:]): (-[WebIconDatabase _releaseIconForIconURLString:]): (-[WebIconDatabase _retainFutureIconForSiteURL:]): (-[WebIconDatabase _releaseFutureIconForSiteURL:]): (-[WebIconDatabase _releaseOriginalIconsOnDisk]): (-[WebIconDatabase _sendNotificationForSiteURL:]): (-[WebIconDatabase _addObject:toSetForKey:inDictionary:]): (-[WebIconDatabase _largestIconFromDictionary:]): (-[WebIconDatabase _iconsBySplittingRepresentationsOfIcon:]): (-[WebIconDatabase _iconFromDictionary:forSize:cache:]): (-[WebIconDatabase _scaleIcon:toSize:]): * Misc.subproj/WebIconDatabasePrivate.h: * WebKit.exp: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): 2002-11-22 Richard Williamson <rjw@apple.com> Fixed rendering issues associated with 3100120. We now correctly map surrogate pairs in UTF-16. khtml still has issues dealing with characters outside BMP. These are tracked with 3109251 and 3109258. Surrogate pairs are treated as exceptions and have their own character to glyph map. * Misc.subproj/WebUnicode.h: * Misc.subproj/WebUnicode.m: (shapedString): * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (glyphForUnicodeCharacter): (findLengthOfCharacterCluster): (-[WebTextRenderer substituteFontForString:]): (-[WebTextRenderer convertUnicodeCharacters:length:toGlyphs:]): (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:letterSpacing:wordSpacing:]): (-[WebTextRenderer extendUnicodeCharacterToGlyphMapToInclude:]): (-[WebTextRenderer extendCharacterToGlyphMapToInclude:]): 2002-11-22 John Sullivan <sullivan@apple.com> * Resources/url_icon.tiff: new generic URL icon -- little blue globe, pretty nice * WebKit.exp: removed symbol for WebTextRendererFactory which was in here to support an obsolete SPI hack 2002-11-22 Trey Matteson <trey@apple.com> Added more detailed notifications on history changes. All changes below are just posting the new notes at the right time. * English.lproj/StringsNotToBeLocalized.txt: * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: (-[WebHistory _sendNotification:entries:]): (-[WebHistory addEntry:]): (-[WebHistory removeEntry:]): (-[WebHistory removeEntries:]): (-[WebHistory removeAllEntries]): (-[WebHistory addEntries:]): (-[WebHistory loadHistory]): * WebKit.exp: 2002-11-22 Richard Williamson <rjw@apple.com> Changed NSString category methods to include _web_ prefix. * Misc.subproj/WebKitNSStringExtras.h: * Misc.subproj/WebKitNSStringExtras.m: (-[NSString _web_widthForString:font:]): 2002-11-22 Richard Williamson <rjw@apple.com> Simplified drawing and measuring SPI for use by Alex. * Misc.subproj/WebKitNSStringExtras.h: Added. * Misc.subproj/WebKitNSStringExtras.m: Added. (-[NSString widthForString:font:]): * WebKit.pbproj/project.pbxproj: 2002-11-21 Chris Blumenberg <cblu@apple.com> Removed workaround for: 3093170 - Handle clients receive data with length 0 as it's now fixed. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler receivedData:]): remove workaround * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveData:]): added asserts 2002-11-21 Richard Williamson <rjw@apple.com> A different fix to 3078065 that doesn't depend on the appkit's idea of fixed pitch font. The fix is to adjust the width of all characters that have the same width as the space character to match the adjustment of the space character. This has the slight downside that non-monospace fonts that contain glyphs with the same width as the space character will have an extra adjustment. In practice this is not noticeable as the adjustment is always sub-pixel. Nor of course does this cause any mislayout, as it's done at the lowest level for both measurement and drawing. Until we move kthml internals to floats this will be just fine. * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (widthForGlyph): (-[WebTextRenderer initWithFont:]): (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:letterSpacing:wordSpacing:]): tAfterNavigationPolicy:request:]): 2002-11-21 Maciej Stachowiak <mjs@apple.com> * Makefile.am: Pass symroots for this tree to pbxbuild. 2002-11-21 Chris Blumenberg <cblu@apple.com> Fixed: 3009881 - plugins get mouse-overs even when mouse is in menus Fixed: 3108240 - Loading datasource sometimes doesn't have cancelled error when cancelled * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendNullEvent]): check if menus are showing (-[WebBaseNetscapePluginView restartNullEvents]): tweak * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _stopLoading]): set cancelled error if main handle is gone === Alexander-33 === 2002-11-20 Darin Adler <darin@apple.com> * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): Unescape the string before executing it, so we don't suffer from bug 3083043 here in the javascript: URLs that come from plug-ins. * English.lproj/StringsNotToBeLocalized.txt: Update. 2002-11-20 Chris Blumenberg <cblu@apple.com> Fixed: 3079134 - Throttle plug-ins while in background * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendNullEvent]): new (-[WebBaseNetscapePluginView stopNullEvents]): stops timer (-[WebBaseNetscapePluginView restartNullEvents]): stops timer if there is one, and starts a new one based on window activation state (-[WebBaseNetscapePluginView start]): call restartNullEvents (-[WebBaseNetscapePluginView stop]): call stopNullEvents (-[WebBaseNetscapePluginView windowBecameKey:]): call restartNullEvents (-[WebBaseNetscapePluginView windowResignedKey:]): call restartNullEvents (-[WebBaseNetscapePluginView windowDidMiniaturize:]): call stopNullEvents (-[WebBaseNetscapePluginView windowDidDeminiaturize:]): call restartNullEvents * Plugins.subproj/WebNetscapePluginNullEventSender.h: Removed. No need for another class, use a timer. * Plugins.subproj/WebNetscapePluginNullEventSender.m: Removed. No need for another class, use a timer. * WebKit.pbproj/project.pbxproj: 2002-11-20 Richard Williamson <rjw@apple.com> Fixed 3107007. Letter-spacing is causing width to be miscalculated. This also fixed some selection problems. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:letterSpacing:wordSpacing:]): 2002-11-20 Richard Williamson <rjw@apple.com> Fixed mono spaced fonts to always render with mono spacing! (3078065) * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (widthForGlyph): (-[WebTextRenderer initWithFont:]): 2002-11-20 Chris Blumenberg <cblu@apple.com> Fixed: 3074926 - crash in BitsToPix() trying to print cnet page * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView drawRect:]): disable experimental plug-in printing code. 2002-11-20 Chris Blumenberg <cblu@apple.com> Minor clean-up, logging and more error checking in plug-in code. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setResponse:]): (-[WebBaseNetscapePluginStream receivedData:]): (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): * Plugins.subproj/npapi.m: (NPN_UserAgent): (NPN_MemFree): (NPN_MemFlush): (NPN_ReloadPlugins): 2002-11-20 Chris Blumenberg <cblu@apple.com> Fixed: 3061174 - javascript: URLs sent by plugins don't work * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): 2002-11-20 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2002-11-19 Chris Blumenberg <cblu@apple.com> Fixed: 3106061 - REGRESSION: Copy in text view copies all text not just selection * Misc.subproj/WebSearchableTextView.m: (-[WebSearchableTextView copy:]): 2002-11-19 Chris Blumenberg <cblu@apple.com> Fixed: 3092588 - redraw errors in QT controller if window is in background We need to send update events after we activate/deactivate after all. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView windowBecameKey:]): (-[WebBaseNetscapePluginView windowResignedKey:]): 2002-11-19 Chris Blumenberg <cblu@apple.com> Fixed: 3020720 - dropping a folder in the page address makes the folder open in Finder, empties the field * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_bestURL]): Don't accept directories. 2002-11-19 Chris Blumenberg <cblu@apple.com> Fixed: 3068112 - extra line breaks when copying from source window * Misc.subproj/WebSearchableTextView.m: (-[WebSearchableTextView copy:]): Convert CRLF to LF 2002-11-19 David Hyatt <hyatt@apple.com> Make sure that if the scrollers are shown/hidden that we force an immediate layout, since if we don't, an intervening display can cause us to show scrollbars when they really shouldn't be there. * WebView.subproj/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): 2002-11-19 Chris Blumenberg <cblu@apple.com> Fixed: 3100597 - repro NSArray exception using contextual menu * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeURL:andTitle:withOwner:]): more error checking 2002-11-19 Trey Matteson <trey@apple.com> Just a tweak to the description printout. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem description]): 2002-11-18 Chris Blumenberg <cblu@apple.com> Real fix for: 3104183 - Assert loading www.louisvuitton.com Since we don't consider plug-in content as a subresource, attaching plug-in streams to the datasource has no affect on the loading state of the datasource. Both stopLoading on WebFrame and _stopLoading datasource, would not stop plug-ins streams after th e data source was done loading. Because of this, I've decided to not keep a list of plug-in streams attached to the data source and pulled my previous change. To fix this bug, WebBaseResourceHandleDelegate now retains the controller. * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream start]): (-[WebNetscapePluginStream cancel]): (-[WebNetscapePluginStream handleDidFinishLoading:]): (-[WebNetscapePluginStream handle:didFailLoadingWithError:]): * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate _releaseResources]): (-[WebBaseResourceHandleDelegate setDataSource:]): (-[WebBaseResourceHandleDelegate handle:willSendRequest:]): (-[WebBaseResourceHandleDelegate handleDidFinishLoading:]): (-[WebBaseResourceHandleDelegate handle:didFailLoadingWithError:]): (-[WebBaseResourceHandleDelegate _cancelWithError:]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _stopLoading]): (-[WebDataSource _makeHandleDelegates:deferCallbacks:]): (-[WebDataSource _defersCallbacksChanged]): 2002-11-18 Chris Blumenberg <cblu@apple.com> Fixed: 3104183 - Assert loading www.louisvuitton.com We need to treat plug-in streams like subresources except they don't change the loading state of the data source. * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream start]): call _addPluginStream (-[WebNetscapePluginStream cancel]): call _removePluginStream (-[WebNetscapePluginStream handleDidFinishLoading:]): call _removePluginStream (-[WebNetscapePluginStream handle:didFailLoadingWithError:]): call _removePluginStream * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): release pluginStreams (-[WebDataSource _addPluginStream:]): just like addSubresourceClient except don't change the loading state. (-[WebDataSource _removePluginStream:]): just like removeSubresourceClient except don't change the loading state. (-[WebDataSource _stopLoading]): stop plug-ins streams (-[WebDataSource _makeHandleDelegates:deferCallbacks:]): (-[WebDataSource _defersCallbacksChanged]): call _makeHandleDelegates:deferCallbacks: for subresources and plug-in streams. 2002-11-18 Richard Williamson <rjw@apple.com> Check for usesBackForwardList was excluding all load types. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): 2002-11-18 Chris Blumenberg <cblu@apple.com> Fixed: 3098767 - REGRESSION: standalone quicktime content just shows blank window Check the instance not the class for the class type. * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedData:withDataSource:]): 2002-11-18 Ken Kocienda <kocienda@apple.com> Added feature to import bookmarks/favorites from MSIE. This fixes Radar 2961230 (import Mac IE bookmarks). * Bookmarks.subproj/WebBookmarkImporter.h: Added. * Bookmarks.subproj/WebBookmarkImporter.m: Added. (_breakStringIntoLines): (_HREFRangeFromSpec): (_HREFTextFromSpec): (_linkTextRangeFromSpec): (_linkTextFromSpec): (-[WebBookmarkImporter initWithPath:group:]): (-[WebBookmarkImporter topBookmark]): (-[WebBookmarkImporter error]): (-[WebBookmarkImporter dealloc]): * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList init]): Create the bookmark list object. This was not created with the -init initializer, causing bookmark lists to fail. * English.lproj/Localizable.strings: * English.lproj/StringsNotToBeLocalized.txt: * WebKit.exp: * WebKit.pbproj/project.pbxproj: 2002-11-17 Trey Matteson <trey@apple.com> Code cleanup to make some internal methods return autoreleased objects. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _addBackForwardItemClippedAtTarget:]): (-[WebFrame _createItem]): (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]): (-[WebFrame _transitionToCommitted]): 2002-11-17 Trey Matteson <trey@apple.com> Fixed 3102076 - REGRESSION: infinite recursion involving bridge end Fixed 3100929 - REGRESSION: serverRedirectedForDataSource: not sent on server redirects Fixed 3103381 - REGRESSION: Going back from anchor doesn't restore scroll position * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate handle:willSendRequest:]): Return the copy of the request that we make instead of the original. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:willSendRequest:]): Call super after we make our mods to the request, so the copy that super makes for us includes those mods. * WebView.subproj/WebFramePrivate.h: Added new state, WebFrameStateCompleting. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToLayoutAcceptable]): Completing state is a NOP. (-[WebFrame _transitionToCommitted]): Completing state is a NOP. (-[WebFrame _isLoadComplete]): Go to Completing state before calling [bridge end]. Go to Completed state afterwards, only if no new loads started in the meantime. (-[WebFrame _loadItem:fromItem:withLoadType:]): When doing anchor nav to get to the item, save and restore scroll state, and set the current item. (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:request:]): Reorder the steps so the right scroll state gets saved to the right place. Also, don't add a backForward item if we're doing a client redirect to an anchor. 2002-11-17 David Hyatt <hyatt@apple.com> Back out my previous fix. I have a better one that is confined to WebCore. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _isLoadComplete]): 2002-11-17 David Hyatt <hyatt@apple.com> The needsdisplay is necessary even for HTML documents. I over-optimized here. Fixes the directory.apple.com regression and the santa clara library regression. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _isLoadComplete]): 2002-11-17 Darin Adler <darin@apple.com> - update for change to WebCore API so it never uses NSURL * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): Take NSString instead of NSURL. (-[WebBridge startLoadingResource:withURL:]): Ditto. (-[WebBridge objectLoadedFromCacheWithURL:response:size:]): Ditto. (-[WebBridge reportClientRedirectToURL:delay:fireDate:]): Ditto. (-[WebBridge setIconURL:]): Ditto. (-[WebBridge setIconURL:withType:]): Ditto. (-[WebBridge loadURL:reload:triggeringEvent:isFormSubmission:]): Ditto. (-[WebBridge postWithURL:data:contentType:triggeringEvent:]): Ditto. (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Ditto. (-[WebBridge userAgentForURL:]): Ditto. (-[WebBridge requestedURL]): Return NSString instead of NSURL. (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): Take NSString instead of NSURL. (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]): Take NSString instead of NSURL. * WebCoreSupport.subproj/WebCookieAdapter.m: (-[WebCookieAdapter cookiesForURL:]): Take NSString instead of NSURL. (-[WebCookieAdapter setCookies:forURL:policyBaseURL:]): Ditto. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady]): Pass NSString instead of NSURL. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:request:]): Pass NSString instead of NSURL (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): Turn bridge URL into NSURL so we can call _web_URLByRemovingFragment on it. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementAtPoint:]): Convert NSString to NSURL when making the WebKit element dictionary. 2002-11-17 Maciej Stachowiak <mjs@apple.com> - fixed 2949193 - implement onKeyDown, onKeyPress, and onKeyUp event handlers * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (+[WebHTMLView load]): Pose as NSWindow too now. (-[WebHTMLView _interceptKeyEvent:toView:]): Pass event to WebCore and see if WebCore wants to block it. (-[WebNSWindow sendEvent:]): For all key events that would go to a subview of a WebHTMLView, let the WebHTMLView take a first crack at it. 2002-11-15 Darin Adler <darin@apple.com> - fixed 3079214 -- text/plain page shows up slowly, a few pages at a time * WebView.subproj/WebTextView.m: (-[WebTextView initWithFrame:]): Remove unneeded setWidthTracksTextView:, because that's the default. (-[WebTextView dataSourceUpdated:]): Replace the thing each time in the RTF case. (-[WebTextView viewDidMoveToSuperview]): Here's where we resize, but only the width. Resizing the height was causing the bug. (-[WebTextView layout]): Do nothing. (-[WebTextView setAcceptsDrags:]): Update to new name. Since we weren't importing WebDocument.h, we never noticed that this file got out of sync. (-[WebTextView acceptsDrags]): Ditto. (-[WebTextView setAcceptsDrops:]): Ditto. (-[WebTextView acceptsDrops]): Ditto. * WebView.subproj/WebDocument.h: Fix typo. It said setAcceptsDrags: twice. 2002-11-15 Darin Adler <darin@apple.com> * WebView.subproj/WebFramePrivate.m: Removed a bunch of tabs and fixed indenting. 2002-11-15 Maciej Stachowiak <mjs@apple.com> - fixed 3102016 - REGRESSION: Command-clicking on a link can open _two_ windows. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setJustOpenedForTargetedLink:]): (-[WebDataSource _justOpenedForTargetedLink]): * WebView.subproj/WebFrame.m: (-[WebFrame findOrCreateFramedNamed:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueAfterNavigationPolicy:]): (-[WebFrame _loadDataSource:withLoadType:]): (-[WebFrame _downloadRequest:toPath:]): (-[WebFrame _setJustOpenedForTargetedLink:]): 2002-11-15 Darin Adler <darin@apple.com> * WebView.subproj/WebFramePrivate.m: (-[WebFrame _checkNavigationPolicyForRequest:dataSource:andCall:withSelector:]): Give the listener a slightly longer lifetime, to make this API a bit more foolproof. 2002-11-15 Maciej Stachowiak <mjs@apple.com> Fix world leak I introduced, and also add an early return when needed. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _invalidatePendingPolicyDecisionCallingDefaultAction:]): (-[WebFrame _checkNavigationPolicyForRequest:dataSource:andCall:withSelector:]): 2002-11-15 Maciej Stachowiak <mjs@apple.com> Make navigation policy asynchronous for real. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebControllerPolicyDelegate.m: (-[WebPolicyDecisionListenerPrivate initWithTarget:action:]): (-[WebPolicyDecisionListenerPrivate dealloc]): (-[WebPolicyDecisionListener usePolicy:]): (-[WebPolicyDecisionListener _initWithTarget:action:]): (-[WebPolicyDecisionListener dealloc]): (-[WebPolicyDecisionListener _invalidate]): * WebView.subproj/WebControllerPolicyDelegatePrivate.h: Added. * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate decideNavigationPolicyForAction:andRequest:inFrame:decisionListener:]): * WebView.subproj/WebFrame.m: (-[WebFrame stopLoading]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate dealloc]): (-[WebFrame _invalidatePendingPolicyDecisionCallingDefaultAction:]): (-[WebFrame _checkNavigationPolicyForRequest:dataSource:andCall:withSelector:]): (-[WebFrame _continueAfterNavigationPolicy:]): (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): (-[WebFrame _loadDataSource:withLoadType:]): 2002-11-15 Maciej Stachowiak <mjs@apple.com> Wrap content policy invocation to look asynchronous. * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient continueAfterContentPolicy:response:]): (-[WebMainResourceClient checkContentPolicyForResponse:andCallSelector:]): (-[WebMainResourceClient handle:didReceiveResponse:]): 2002-11-15 Maciej Stachowiak <mjs@apple.com> Refactor so that all invocations of navigation policy are set up to be asynchronous. However, the actually delegate method is not async yet. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _checkNavigationPolicyForRequest:dataSource:andCall:withSelector:]): (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:request:]): (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]): (-[WebFrame _loadDataSource:withLoadType:]): * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient stopLoadingForPolicyChange]): (-[WebMainResourceClient continueAfterNavigationPolicy:request:]): (-[WebMainResourceClient handle:willSendRequest:]): (-[WebMainResourceClient handle:didReceiveResponse:]): 2002-11-14 Maciej Stachowiak <mjs@apple.com> Refactor things a bit so all loads bottleneck through a single method (_loadDataSource:withLoadType:). * WebView.subproj/WebFrame.m: (-[WebFrame loadRequest:]): (-[WebFrame reload]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadItem:fromItem:withLoadType:]): (-[WebFrame _loadRequest:triggeringAction:loadType:]): (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): (-[WebFrame _postWithURL:data:contentType:triggeringEvent:]): (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]): (-[WebFrame _loadDataSource:withLoadType:]): (-[WebFrame _downloadRequest:toPath:]): 2002-11-14 Maciej Stachowiak <mjs@apple.com> Change things so the public interface to loading is loadRequest: and everything else is private. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): * Plugins.subproj/WebPluginController.m: (-[WebPluginController showURL:inFrame:]): * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController init]): * WebView.subproj/WebControllerPrivate.m: (-[WebController _createFrameNamed:inParent:allowsScrolling:]): (-[WebController _downloadURL:toPath:]): * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (-[WebFrame init]): (-[WebFrame initWithName:webView:controller:]): (-[WebFrame loadRequest:]): (-[WebFrame reload]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _timedLayout:]): (-[WebFrame _clearProvisionalDataSource]): (-[WebFrame _loadItem:fromItem:withLoadType:]): (-[WebFrame _loadRequest:triggeringAction:]): (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]): (-[WebFrame _itemForRestoringDocState]): (-[WebFrame _setProvisionalDataSource:]): (-[WebFrame _startLoading]): (-[WebFrame _downloadRequest:toPath:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:willSendRequest:]): (-[WebMainResourceClient stopLoadingAfterContentPolicy]): (-[WebMainResourceClient handle:didReceiveResponse:]): * WebView.subproj/WebView.m: (-[WebView concludeDragOperation:]): 2002-11-14 David Hyatt <hyatt@apple.com> Move text measurement and layout beyond onload. This shoudl speed up i-bench substantially and morrison's PLT test slightly. Note that the adjustFrames layout stuff has been removed from isLoadComplete. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _timedLayout:]): (-[WebFrame _isLoadComplete]): 2002-11-14 Darin Adler <darin@apple.com> * English.lproj/Localizable.strings: Updated to include the new error messages that Maciej just added. I wonder what effect this will have if we see those errors in Alex-32? === Alexander-32 === 2002-11-14 Don Melton <gramps@apple.com> * WebView.subproj/WebControllerPolicyDelegate.h: Added missing semi-colon in definition of WebPolicyDecisionListener to fix build error. 2002-11-14 Maciej Stachowiak <mjs@apple.com> Combined file URL policy with content policy. We don't actually bother to ask earlier for file URLs yet, since that will make things more complicated. * Misc.subproj/WebKitErrors.h: * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _handleUnimplementablePolicy:errorCode:forURL:]): (-[WebFrame _continueAfterNavigationPolicyForRequest:dataSource:]): * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient stopLoadingAfterContentPolicy]): (-[WebMainResourceClient handle:didReceiveResponse:]): * WebView.subproj/WebView.m: (+[WebView initialize]): 2002-11-14 Darin Adler <darin@apple.com> - fixed 3099240 -- REGRESSION: repro assert d->m_doc->parsing Make the reload flag pass across the bridge. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady]): Pass a reload flag, based on the load type, to the bridge. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): Pass a reload flag of NO in the anchor case. Preserve reload load types even when doing client redirects (have to talk with Trey about this tomorrow). 2002-11-14 Darin Adler <darin@apple.com> - fixed 3100235 -- nil-deference in khtml::RenderTable at money.cnn.com * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): If the WebCore side needs layout, then do layout before trying to draw. 2002-11-13 Trey Matteson <trey@apple.com> Fixed client redirects, some more. The upshot is that they do not generate two items in the back-forward list. iBench still works. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportClientRedirectTo:delay:fireDate:]): Call straight to the frame for all impl. (-[WebBridge reportClientRedirectCancelled]): Call straight to the frame for all impl. (-[WebBridge loadURL:reload:triggeringEvent:isFormSubmission:]): clientRedirect param removed when sending _loadURL: to frame. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadURL:loadType:triggeringEvent:isFormSubmission:]): clientRedirect param removed. Check our own ivar to know if we are in client redirect case. (-[WebFrame _loadURL:intoChild:]): clientRedirect param removed when sending _loadURL: . (-[WebFrame _clientRedirectedTo:delay:fireDate:]): Note that we are doing a redirect if time=0 and we're not completed. Also includes previous impl moved from Bridge. (-[WebFrame _clientRedirectCancelled]): Previous impl moved from Bridge. 2002-11-13 Maciej Stachowiak <mjs@apple.com> Pass mime type instead of full response to content policy delegate method, in preparation for merging it with the file URL policy. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveResponse:]): 2002-11-13 Darin Adler <darin@apple.com> - fixed 3083982 -- Logging into AOL gives null view Turns out AOL was using a refresh header, which we were not supporting. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady]): Call openURL: and pass headers in. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadURL:loadType:clientRedirect:triggeringEvent:isFormSubmission:]): Pass nil for headers in this case, since we know it's just an anchor change. - other things * WebCoreSupport.subproj/WebBridge.h: Remove dataSourceChanged and dataSource methods. We try to keep the bridge methods down to actual bridging. * WebCoreSupport.subproj/WebBridge.m: Remove dataSourceChanged altogether, and move dataSource up in the file. * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation setDataSource:]): Keep the data source around, so we don't need to ask the bridge for it. (-[WebHTMLRepresentation documentSource]): Use it here. 2002-11-13 Trey Matteson <trey@apple.com> Fixed 3100084 - REGRESSION: web page is not first responder after visiting web page * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady]): Make the rep before _transitionToCommitted. This is the way it used to be. (-[WebDataSource _makeRepresentation]): Don't make the docView here. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): Make the docView here, after we save the scroll state but before notifying the delegate. 2002-11-13 Darin Adler <darin@apple.com> - fixed 3100013 -- REGRESSION: Can't get results from i-Bench anymore * WebView.subproj/WebFramePrivate.m: (-[WebFrame _isLoadComplete]): Don't set the state to WebFrameStateComplete if it has already been set to WebFrameStateProvisional. If it has, that means we already began a new load; that one is not yet complete. 2002-11-13 John Sullivan <sullivan@apple.com> - fixed 3099922 -- REGRESSION: Back button always pops up menu * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragShouldBeginFromMouseDown:withExpiration:xHysteresis:yHysteresis:]: Fixed a copy/paste error I made yesterday -- this method was never noticing the mouse-up events because it was checking the event type against the wrong number. Also changed the hysteresis values from unsigneds to floats (unsigned was just wrong). 2002-11-13 Maciej Stachowiak <mjs@apple.com> - fixed 3050447 - Policy handlers have no way of telling client that the proposed navigation is a form post Now we pass form submissions through all the normal policy steps. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:reload:triggeringEvent:isFormSubmission:]): (-[WebBridge postWithURL:data:contentType:triggeringEvent:]): (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _setTriggeringAction:]): (-[WebDataSource _triggeringAction]): (-[WebDataSource _lastCheckedRequest]): (-[WebDataSource _setLastCheckedRequest:]): * WebView.subproj/WebFrame.m: (-[WebFrame setProvisionalDataSource:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _shouldShowRequest:]): (-[WebFrame _loadRequest:triggeringAction:]): (-[WebFrame _actionInformationForNavigationType:event:]): (-[WebFrame _continueAfterNavigationPolicyForRequest:dataSource:]): (-[WebFrame _loadURL:loadType:clientRedirect:triggeringEvent:isFormSubmission:]): (-[WebFrame _loadURL:intoChild:]): (-[WebFrame _postWithURL:data:contentType:triggeringEvent:]): 2002-11-12 Maciej Stachowiak <mjs@apple.com> Combine click policy and URL policy into navigation policy. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate navigationPolicyForAction:andRequest:inFrame:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _shouldShowRequest:]): (-[WebFrame _actionInformationForNavigationType:event:]): (-[WebFrame _continueAfterFileURLPolicyForRequest:]): (-[WebFrame _continueAfterNavigationPolicyForRequest:event:]): (-[WebFrame _loadURL:loadType:clientRedirect:triggeringEvent:]): 2002-11-12 Trey Matteson <trey@apple.com> fixed 3096030 - Crash in -[WebBackForwardList goToEntry:] when playing with SnapBack and dictionary.com * WebView.subproj/WebFramePrivate.m: (-[WebFrame _isLoadComplete]): Set state=completed only after we tell the bridge to end the load. This allows client redirects to be processed before we think we're complete. (-[WebFrame _loadURL:loadType:clientRedirect:triggeringEvent:]): Only process client redirects as such if we are not already complete. This makes JS driven navigations after load-time work like the user would expect, as normal navigations. 2002-11-12 Maciej Stachowiak <mjs@apple.com> - fixed 3099487 - REGRESSION: dragging an image always puts it in the download directory * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _downloadURL:]): Call _downloadURL:toPath: with nil path. (-[WebController _downloadURL:toPath:]): New method that predetermines the path to download to (needed for DnD). * WebView.subproj/WebHTMLView.m: (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Use _downloadURL:toPath: * WebView.subproj/WebImageView.m: (-[WebImageView namesOfPromisedFilesDroppedAtDestination:]): Use _downloadURL:toPath: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveResponse:]): Don't ask delegate for download path if we already have one. 2002-11-12 Richard Williamson <rjw@apple.com> Fixed likely cause of 3099047 (and others). Width buffer could underrun in some situations. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:letterSpacing:wordSpacing:]): 2002-11-12 John Sullivan <sullivan@apple.com> * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragShouldBeginFromMouseDown:withExpiration:xHysteresis:yHysteresis:]): new method (-[NSView _web_dragShouldBeginFromMouseDown:withExpiration:]): now calls the new method, passing the default hysteresis values 2002-11-12 Richard Williamson <rjw@apple.com> Implemented letter-spacing and word-spacing CSS properties. * Misc.subproj/WebStringTruncator.m: (+[WebStringTruncator rightTruncateString:toWidth:withFont:]): (+[WebStringTruncator centerTruncateString:toWidth:withFont:]): * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer widthForCharacters:length:]): (-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:rightToLeft:letterSpacing:wordSpacing:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:characterPosition:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:letterSpacing:wordSpacing:]): (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:letterSpacing:wordSpacing:]): 2002-11-12 Maciej Stachowiak <mjs@apple.com> Removed policy classes and instead use the policy enums directly, since we no longer hold the path in the enum. * Downloads.subproj/WebDownloadHandler.m: * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebControllerPolicyDelegate.m: * WebView.subproj/WebControllerPolicyDelegatePrivate.h: Removed. * WebView.subproj/WebControllerPrivate.m: * WebView.subproj/WebDefaultPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: (+[WebDefaultPolicyDelegate defaultURLPolicyForRequest:]): (-[WebDefaultPolicyDelegate URLPolicyForRequest:inFrame:]): (-[WebDefaultPolicyDelegate fileURLPolicyForMIMEType:andRequest:inFrame:]): (-[WebDefaultPolicyDelegate unableToImplementPolicy:error:forURL:inFrame:]): (-[WebDefaultPolicyDelegate clickPolicyForAction:andRequest:inFrame:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame handleUnimplementablePolicy:errorCode:forURL:]): (-[WebFrame _shouldShowRequest:]): (-[WebFrame _continueAfterClickPolicyForEvent:request:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveResponse:]): 2002-11-12 Maciej Stachowiak <mjs@apple.com> Keep the triggering event around on the data source, so it can be used with redirects. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _loadRequest:triggeringEvent:]): (-[WebFrame _loadURL:loadType:clientRedirect:triggeringEvent:]): (-[WebFrame _postWithURL:data:contentType:]): 2002-11-12 Darin Adler <darin@apple.com> - improved the code that manages observing the window and superview * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addSuperviewObservers]): Added. (-[WebHTMLView removeSuperviewObservers]): Added. (-[WebHTMLView addWindowObservers]): Added. (-[WebHTMLView removeWindowObservers]): Added. (-[WebHTMLView viewWillMoveToSuperview:]): Call removeSuperviewObservers. (-[WebHTMLView viewDidMoveToSuperview]): Call addSuperviewObservers. (-[WebHTMLView viewWillMoveToWindow:]): Call removeWindowObservers and removeSuperviewObservers. (-[WebHTMLView viewDidMoveToWindow]): Call addWindowObservers and addSuperviewObservers. 2002-11-11 Maciej Stachowiak <mjs@apple.com> Remove contentPolicy parameter from _downloadURL, and remove remaining traces of path from policy object. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebControllerPolicyDelegate.m: (-[WebPolicyPrivate dealloc]): (+[WebURLPolicy webPolicyWithURLAction:]): (+[WebFileURLPolicy webPolicyWithFileAction:]): (+[WebContentPolicy webPolicyWithContentAction:]): (+[WebClickPolicy webPolicyWithClickAction:]): * WebView.subproj/WebControllerPolicyDelegatePrivate.h: * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _downloadURL:]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate downloadURL:]): * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate clickPolicyForAction:andRequest:inFrame:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueAfterClickPolicyForEvent:request:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): * WebView.subproj/WebImageView.m: (-[WebImageView namesOfPromisedFilesDroppedAtDestination:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveResponse:]): 2002-11-11 Darin Adler <darin@apple.com> * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): Use fileSystemRepresentationWithPath, not cString, to turn a path into something to pass to FSPathMakeRef. * English.lproj/StringsNotToBeLocalized.txt: Update. 2002-11-11 Darin Adler <darin@apple.com> - tighten up cursor handling a bit more * WebView.subproj/WebDynamicScrollBarsView.m: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addMouseMovedObserver]): Call _frameOrBoundsChanged so we emit a mouse moved event right away. (-[WebHTMLView viewWillMoveToSuperview:]): Remove the colon since I removed the parameter from _frameOrBoundsChanged. * WebView.subproj/WebHTMLViewPrivate.h: Declare _frameOrBoundsChanged. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _frameOrBoundsChanged]): Remove parameter. 2002-11-11 Trey Matteson <trey@apple.com> Fixed 3015884 - Reloading a page should remember the scroll position * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): Save scroll position on reload (-[WebFrame _isLoadComplete]): Restore position on reload 2002-11-11 Trey Matteson <trey@apple.com> * History.subproj/WebBackForwardList.m: (-[WebBackForwardList addEntry:]): Yank code to avoid adding a duplicate entry, to catch the refresh case. That's dealt with in WebFramePrivate now. (-[WebBackForwardList description]): Enhanced to print more info. * History.subproj/WebHistoryItem.h: History items now hold an array of subitems to mirror the frame tree. One item in the tree is designated the target of the navigation. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem dealloc]): Release new ivars. (-[WebHistoryItem isTargetItem]): (-[WebHistoryItem setIsTargetItem:]): New setter and setter. (-[WebHistoryItem _recurseToFindTargetItem]): (-[WebHistoryItem targetItem]): Search the tree to find the target item. (-[WebHistoryItem children]): (-[WebHistoryItem addChildItem:]): (-[WebHistoryItem childItemWithName:]): Maintain and search new child item list. (-[WebHistoryItem description]): Enhanced to print out the tree of items. (-[WebHistoryItem dictionaryRepresentation]): (-[WebHistoryItem initFromDictionaryRepresentation:]): Save and load the new state. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge generateFrameName]): New call from KWQ, just forwards to Frame. (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Call new frame method dedicated to this case. (-[WebBridge saveDocumentState:]): (-[WebBridge documentState]): Call frame methods to get the right item to save/restore to/from. * WebView.subproj/WebController.m: (-[WebController _goToItem:withLoadType:]): Stop any current loading before going to a new item. (-[WebController goBack]): (-[WebController goForward]): (-[WebController goBackOrForwardToItem:]): Name change of private method (for consistency) * WebView.subproj/WebDataSourcePrivate.h: ProvisionalItem and PreviousItem are moved back up to WebFrame, where we know more about the state transitions that happen during loading. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): Don't release removed ivars. (-[WebDataSource _commitIfReady]): Make the view representations -after- the transition to committed. This allows us to save away the scroll location successfully, since making the view was resetting it. * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (-[WebFrame setProvisionalDataSource:]): Saving the scroll location has moved elsewhere to handle frames. (-[WebFrame stopLoading]): Skip all the work if we're already state=complete. * WebView.subproj/WebFramePrivate.h: The frame now holds a ref to the current, previous and provisional back-forward items. * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate dealloc]): Release new state. (-[WebFramePrivate setProvisionalItem:]): (-[WebFramePrivate setPreviousItem:]): (-[WebFramePrivate setCurrentItem:]): New setters (1 line getters were missed by script) (-[WebFrame _addBackForwardItemClippedAtTarget:]): Adds a BF item to the top of the BF list. (-[WebFrame _createItem]): Create a single BF item. (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]): Create a tree of BF items, which mirror the frame tree. (-[WebFrame _immediateChildFrameNamed:]): New frame search utility (doesn't recurse) (-[WebFrame _detachFromParent]): Save the scroll position when detaching a frame. (-[WebFrame _transitionToCommitted]): Maintain new item ivars. Save scroll position when appropriate. Hook up items for child frames to their parent, as they are created. (-[WebFrame _setState:]): Clear previousItem whenever we reach committed. (-[WebFrame _isLoadComplete]): Clear previousItem if we are committed. (-[WebFrame _childFramesMatchItem:]): Does the frame's frame tree match the one held by the item? (-[WebFrame _loadItem:fromItem:withLoadType:]): Only do simple anchor navigation if the frame has no children (fixes oddball corner case with a frame reloading itself). Set provisional item. (-[WebFrame _recursiveGoToItem:fromItem:withLoadType:]): Heart of returning to an item that had frames. We either find that the existing content is good, or initiate a load. (-[WebFrame _goToItem:withLoadType:]): Adjust the BF list cursor, and recurse to do the work. (-[WebFrame _loadURL:loadType:clientRedirect:triggeringEvent:]): Only do anchor-style nav if the destination URL has a fragment. Save scroll position. (-[WebFrame _loadURL:intoChild:]): If returning to an item with frames, possibly replace the new content with the stuff that was there at the time, substituting the URL. (-[WebFrame _saveScrollPositionToItem:]): Don't croak on nil item or view. (-[WebFrame _restoreScrollPosition]): Do croak (ASSERT) on nil item. (-[WebFrame _scrollToTop]): Nit cleanup. (-[WebFrame _addFramePathToString:]): Add a component for our frame to the frame name we're generating. (-[WebFrame _generateFrameName]): Generate a frame name that is repeatable. (-[WebFrame _itemForSavingDocState]): Returns correct item to use for formstate save. (-[WebFrame _itemForRestoringDocState]): Returns correct item to use for formstate restore 2002-11-11 Maciej Stachowiak <mjs@apple.com> Store path and the fact that we're downloading in the data source, instead of storing the content policy. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler cleanUpAfterFailure]): (-[WebDownloadHandler createFileIfNecessary]): (-[WebDownloadHandler finishedLoading]): * WebView.subproj/WebControllerPrivate.m: (-[WebController _downloadURL:withContentPolicy:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (+[WebDataSource registerRepresentationClass:forMIMEType:]): (-[WebDataSource isDownloading]): (-[WebDataSource downloadPath]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _commitIfReady]): (-[WebDataSource _setIsDownloading:]): (-[WebDataSource _setDownloadPath:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:]): (-[WebMainResourceClient handle:didReceiveResponse:]): (-[WebMainResourceClient handleDidFinishLoading:]): 2002-11-11 Maciej Stachowiak <mjs@apple.com> Don't ask for the content policy any more if the previous policies said to save - in effect this means to ask only if the previous policies said to use the content policy. Also, remove now-useless previous content policy parameter from content policy delegate. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setContentPolicy:]): Retain new policy before releasing the old one. * WebView.subproj/WebDefaultPolicyDelegate.m: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveResponse:]): Don't ask for content policy if the delegate already decided to save. 2002-11-11 Maciej Stachowiak <mjs@apple.com> Added new policy delegate callback to get the filename - this won't be up to the content policy any more. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate saveFilenameForResponse:andRequest:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveResponse:]): 2002-11-11 Darin Adler <darin@apple.com> - made some improvements to cursor setting for greater speed and correctness * WebView.subproj/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView setCursor:]): Just use setDocumentCursor: instead of our own logic. This allows us to remove code and may fix some bugs or anomalies as well. (-[WebDynamicScrollBarsView dealloc]): Release the cursor. I think we were leaking before. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView viewWillMoveToSuperview:]): Use _frameOrBoundsChanged: method now, which has been moved into the private file. (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): Don't bother finding topmost WebHTMLView to call _updateMouseoverWithEvent: on; now it works fine no matter which level it's called at. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _frameOrBoundsChanged:]): Moved the code here that was formerly in the _setNeedsLayoutIfSizeChanged method, also added code that does _updateMouseoverWithEvent: so that we get properly updated cursor when we scroll. (-[WebHTMLView _updateMouseoverWithEvent:]): Remove unneeded assert. This method works equally well no matter which WebHTMLView calls it; everything is done at the window and controller level. * WebView.subproj/WebControllerPrivate.h: Added lastElementWasNotNil field and _mouseDidMoveOverElement:modifierFlags: method. * WebView.subproj/WebControllerPrivate.m: (-[WebController _mouseDidMoveOverElement:modifierFlags:]): Call through to the delegate, but don't do multiple calls if they are all nil. * WebCoreSupport.subproj/WebBridge.m: Remove unused modifierTrackingEnabled method. * WebView.subproj/WebHTMLViewPrivate.h: Remove unused _setModifierTrackingEnabled and _modifierTrackingEnabled methods. 2002-11-10 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2002-11-10 Chris Blumenberg <cblu@apple.com> Fixed: 3021681 - downloaded files' creation and modification dates are not set * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler createFileIfNecessary]): call [response creationDate] and [response lastModifiedDate] when setting file attributes. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setResponse:]): call [response lastModifiedDate] when giving content to plug-ins. 2002-11-10 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2002-11-09 Darin Adler <darin@apple.com> - fixed 3095156 -- reproducible leak of WebDataSource due to bad URL in stylesheet * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): Check for errors by looking at the return value from loadWithRequest: rather than making a separate call to canInitWithRequest. * WebView.subproj/WebBaseResourceHandleDelegate.h: Add boolean success/failure result loadWithRequest:. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate loadWithRequest:]): Return NO if we fail to make a handle. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading]): Check result of loadWithRequest: and complain if it's NO. * WebView.subproj/WebMainResourceClient.m: Tweak whitespace. 2002-11-09 Chris Blumenberg <cblu@apple.com> Fixed: 2991610 - Alexander should support services, including Speech * WebView.subproj/WebHTMLView.m: (+[WebHTMLView initialize]): register for service types (-[WebHTMLView dealloc]): moved to top of file (-[WebHTMLView copy:]): call _writeSelectionToPasteboard (-[WebHTMLView writeSelectionToPasteboard:types:]): call _writeSelectionToPasteboard (-[WebHTMLView validRequestorForSendType:returnType:]): return self for our pboard types * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (+[WebHTMLView _pasteboardTypes]): new, returns the array of supported pboard types (-[WebHTMLView _writeSelectionToPasteboard:]): new, adds data to pboard * WebView.subproj/WebImageView.m: (-[WebImageView initialize]): register for service types (-[WebImageView validateUserInterfaceItem:]): respond to copy (-[WebImageView validRequestorForSendType:returnType:]): return self for images (-[WebImageView writeImageToPasteboard:]): writes image data to pboard (-[WebImageView copy:]): calls writeImageToPasteboard (-[WebImageView writeSelectionToPasteboard:types:]): calls writeImageToPasteboard 2002-11-08 Darin Adler <darin@apple.com> * History.subproj/WebHistoryItem.m: (-[WebHistoryItem setTitle:]): Use display title if it matches, so we don't end up with two identical strings, as when reading from the property list. (-[WebHistoryItem setDisplayTitle:]): The same thing, the other way round. 2002-11-08 Darin Adler <darin@apple.com> - fixed 3095078 -- image loop counts still not handled right * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer blockHasGIFExtensionSignature:length:]): Look for the tag "NETSCAPE2.0", not "NETSCAPE1.0". (-[WebImageRenderer nextFrame:]): Remove special handling for last frames with a duration of 0. That was just a misunderstanding. 2002-11-08 Darin Adler <darin@apple.com> * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setRequest:]): Slightly better fix. Essentially just take out the assert. 2002-11-08 Darin Adler <darin@apple.com> - fixed an assert I am seeing a lot * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setRequest:]): Oops. 2002-11-08 Richard Williamson <rjw@apple.com> Solved missing glyph problem, but it's very slow, so it's disabled for now. I'll turn back on after extending the character to glyph map in each renderer to include substituted font. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer substituteFontForString:]): (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]): 2002-11-08 Darin Adler <darin@apple.com> - separate WebBaseNetscapePluginStream more cleanly from its subclasses by making most fields private * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setResponse:]): * Plugins.subproj/WebNetscapePluginStream.h: * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:]): (-[WebNetscapePluginStream dealloc]): (-[WebNetscapePluginStream start]): (-[WebNetscapePluginStream handle:didReceiveData:]): (-[WebNetscapePluginStream handle:didFailLoadingWithError:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handle:didReceiveResponse:]): (-[WebSubresourceClient handle:didReceiveData:]): (-[WebSubresourceClient handleDidFinishLoading:]): (-[WebSubresourceClient handle:didFailLoadingWithError:]): (-[WebSubresourceClient cancel]): * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate handle:willSendRequest:]): (-[WebBaseResourceHandleDelegate handle:didFailLoadingWithError:]): (-[WebBaseResourceHandleDelegate _cancelWithError:]): (-[WebBaseResourceHandleDelegate cancel]): (-[WebBaseResourceHandleDelegate cancelQuietly]): (-[WebBaseResourceHandleDelegate cancelledError]): (-[WebBaseResourceHandleDelegate notifyDelegatesOfInterruptionByPolicyChange]): * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient cancel]): (-[WebMainResourceClient handle:willSendRequest:]): (-[WebMainResourceClient notifyDelegatesOfInterruptionByPolicyChange]): (-[WebMainResourceClient handle:didReceiveResponse:]): (-[WebMainResourceClient handle:didReceiveData:]): (-[WebMainResourceClient handleDidFinishLoading:]): 2002-11-08 Darin Adler <darin@apple.com> - changed persistent dictionaries to use NSString instead of NSURL because of impact on memory footprint Also changed WebIconDatabase code to verify what it reads from disk, and ignore it if it can't verify the format. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase iconForSiteURL:withSize:cache:]): (-[WebIconDatabase retainIconForSiteURL:]): (-[WebIconDatabase releaseIconForSiteURL:]): (-[WebIconDatabase _iconDictionariesAreGood]): (-[WebIconDatabase _loadIconDictionaries]): (-[WebIconDatabase _updateFileDatabase]): (-[WebIconDatabase _hasIconForSiteURL:]): (-[WebIconDatabase _iconsForIconURLString:]): (-[WebIconDatabase _setIcon:forIconURL:]): (-[WebIconDatabase _setIconURL:forSiteURL:]): (-[WebIconDatabase _setBuiltInIconAtPath:forHost:]): (-[WebIconDatabase _retainIconForIconURLString:]): (-[WebIconDatabase _releaseIconForIconURLString:]): (-[WebIconDatabase _retainFutureIconForSiteURL:]): (-[WebIconDatabase _releaseFutureIconForSiteURL:]): (-[WebIconDatabase _retainOriginalIconsOnDisk]): (-[WebIconDatabase _releaseOriginalIconsOnDisk]): (-[NSEnumerator _web_isAllStrings]): * Panels.subproj/WebStandardPanels.m: (-[WebStandardPanels didStartLoadingURL:inWindow:]): (-[WebStandardPanels didStopLoadingURL:inWindow:]): (-[WebStandardPanels _didStartLoadingURL:inController:]): (-[WebStandardPanels _didStopLoadingURL:inController:]): (-[WebStandardPanels frontmostWindowLoadingURL:]): 2002-11-08 Darin Adler <darin@apple.com> - fixed crash on boot that Don was seeing * History.subproj/WebHistoryItem.m: (-[WebHistoryItem URL]): Make this work when _URLString is nil. (-[WebHistoryItem initFromDictionaryRepresentation:]): Make this work for nil URL. - my own private war on the cString method * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler initWithDataSource:]): Use %@ in LOG to avoid cString. (-[WebDownloadHandler finishedLoading]): Ditto. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady]): Ditto. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _timedLayout:]): Ditto. (-[WebFrame _setState:]): More of the same. (-[WebFrame _isLoadComplete]): Ditto. 2002-11-08 Ken Kocienda <kocienda@apple.com> Fix deployment build breaker: a variable was used only in a LOG statement, causing the variable to become usused when building with the Deployment build style. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler finishedLoading]) 2002-11-07 Darin Adler <darin@apple.com> * History.subproj/WebHistoryItem.h: Replace _URL with _URLString. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem _retainIconInDatabase:]): Get the URL with [self URL]. (-[WebHistoryItem initWithURL:target:parent:title:]): Set up _URLString. (-[WebHistoryItem dealloc]): Release _URLString. (-[WebHistoryItem URL]): Make a URL from _URLString. (-[WebHistoryItem icon]): Use [self URL] instead of _URL. (-[WebHistoryItem setURL:]): Store a URL string. (-[WebHistoryItem hash]): Use the URL string's hash. (-[WebHistoryItem isEqual:]): Compare the URL strings. (-[WebHistoryItem description]): Use _URLString. (-[WebHistoryItem dictionaryRepresentation]): Use _URLString. (-[WebHistoryItem initFromDictionaryRepresentation:]): Call through to the other init functions so we have only one designated initializer. Leave the date as nil if there's no date in the dictionary instead of setting the date to 0. 2002-11-07 Maciej Stachowiak <mjs@apple.com> Removed SaveAndOpenExternally policy. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler finishedLoading]): * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueAfterClickPolicyForEvent:request:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:]): (-[WebMainResourceClient handle:didReceiveResponse:]): (-[WebMainResourceClient handleDidFinishLoading:]): 2002-11-07 Chris Blumenberg <cblu@apple.com> * WebKit.pbproj/project.pbxproj: 2002-11-07 Richard Williamson <rjw@apple.com> * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer stopAnimation]): 2002-11-07 Maciej Stachowiak <mjs@apple.com> - fixed 3095628 - REGRESSION: exception when clicking on link to load content into iframe * WebView.subproj/WebFramePrivate.m: (-[WebFrame _actionInformationForNavigationType:event:]): Get the element info from the HTML view where the click originally happened, not the current document view. Add some asserts to make sure this is working. 2002-11-07 Richard Williamson <rjw@apple.com> Tweaks * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer convertCharacters:length:toGlyphs:skipControlCharacters:]): (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]): === Alexander-31 === 2002-11-07 Maciej Stachowiak <mjs@apple.com> - fixed 3094778 - REGRESSION: Assert on logout from schwab.com (probably fixed it anyway - I'm flying blind on this one) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): Use a nil request if the URL was nil, instead of making a request that contains a nil URL. 2002-11-07 Maciej Stachowiak <mjs@apple.com> Changed things so that creating a window takes a request rather than a URL and referrer. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _openNewWindowWithRequest:behind:]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _setTriggeringEvent:]): (-[WebDataSource _triggeringEvent]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate openNewWindowWithURL:]): * WebView.subproj/WebFrame.m: (-[WebFrame setProvisionalDataSource:]): (-[WebFrame findOrCreateFramedNamed:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueAfterClickPolicyForEvent:request:]): * WebView.subproj/WebWindowOperationsDelegate.h: 2002-11-06 Darin Adler <darin@apple.com> - fixed problem where files small enough to fit entirely in the buffer (8K or less) would not be decoded * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler decodeData:]): Added. Moved most of the code from receivedData into here. (-[WebDownloadHandler receivedData:]): Changed to call decodeData. (-[WebDownloadHandler finishedLoading]): Call decodeData on any remaining bytes rather than writing them straight out to the data fork. 2002-11-06 Richard Williamson <rjw@apple.com> More work on rendering scripts. Now most complex scripts render correctly. Working new features include: bidi, diacriticals, cursive forms, and arabic ligatures. Selection of text rendered in these scripts, is however, not working. Also, line height is incorrect when renderering combined below glyphs. ajami is, sadly, horrendously broken. * Misc.subproj/WebUnicode.m: (glyphVariantLogical): (shapedString): * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:rightToLeft:]): (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]): 2002-11-06 John Sullivan <sullivan@apple.com> * Bookmarks.subproj/WebBookmark.m: (+[WebBookmark bookmarkOfType:]): made this handle WebBookmarkTypeProxy 2002-11-06 Darin Adler <darin@apple.com> - fixed bug that affected BinHex-encoded files with no resource fork * Downloads.subproj/WebBinHexDecoder.m: (-[WebBinHexDecoder decodeData:dataForkData:resourceForkData:]): Don't decode the resource fork unless done with the data fork. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler receivedData:]): Set the forks to nil before calling through. 2002-11-06 Darin Adler <darin@apple.com> * Downloads.subproj/WebMacBinaryDecoder.m: (+[WebMacBinaryDecoder canDecodeHeaderData:]): Fix == 129 check that was supposed to be <= 129. * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2002-11-06 Darin Adler <darin@apple.com> * Downloads.subproj/WebBinHexDecoder.m: (-[WebBinHexDecoder decodeIntoBuffer:size:]): Fix an off-by-one error handling repeat counts. * WebKit.pbproj/project.pbxproj: Fix group name I accidentally mangled. 2002-11-06 Darin Adler <darin@apple.com> - added a BinHex decoder and did a little work on the MacBinary decoder I'm not supposed to be working on this, but I didn't feel like doing "real" work. * Downloads.subproj/WebBinHexDecoder.h: Added. * Downloads.subproj/WebBinHexDecoder.m: Added. * WebKit.pbproj/project.pbxproj: Added WebBinHexDecoder. * Downloads.subproj/WebDownloadDecoder.h: Added WEB_DOWNLOAD_DECODER_MINIMUM_HEADER_LENGTH. * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler closeFile]): Check to be sure we don't close the same file twice. * Downloads.subproj/WebMacBinaryDecoder.h: Added _scriptCode. * Downloads.subproj/WebMacBinaryDecoder.m: (+[WebMacBinaryDecoder canDecodeHeaderData:]): Added check of MacBinary version field. (-[WebMacBinaryDecoder decodeData:dataForkData:resourceForkData:]): Added MacBinary III part that gets the script code. (-[WebMacBinaryDecoder filename]): Use the script code. 2002-11-06 Maciej Stachowiak <mjs@apple.com> Took URL field out of click policy - open in new window policy will always open the request URL. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebControllerPolicyDelegate.m: (-[WebPolicyPrivate dealloc]): (+[WebURLPolicy webPolicyWithURLAction:]): (+[WebFileURLPolicy webPolicyWithFileAction:]): (+[WebContentPolicy webPolicyWithContentAction:andPath:]): * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate clickPolicyForAction:andRequest:inFrame:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueAfterClickPolicyForEvent:request:]): 2002-11-06 Chris Blumenberg <cblu@apple.com> Support MacBinary I by checking that bytes 99-127 are 0. Also check byte 82 for all formats. * Downloads.subproj/WebMacBinaryDecoder.m: (+[WebMacBinaryDecoder canDecodeHeaderData:]): 2002-11-06 Ken Kocienda <kocienda@apple.com> Call new WebHTTPResourceRequest method to set the amount of time to cache a 404 response when trying to fetch a favicon. This change helps to fix this bug: Radar 3004422 (Loader should cache misses) * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]) 2002-11-05 Maciej Stachowiak <mjs@apple.com> Reworked clickPolicy arguments to be closer to proposed version. * WebKit.exp: * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebControllerPolicyDelegate.m: * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate clickPolicyForAction:andRequest:inFrame:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _actionInformationForNavigationType:event:]): (-[WebFrame _continueAfterClickPolicyForEvent:request:]): 2002-11-05 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebTextRenderer.m: Made a slightly simpler and faster version of the new "lose precision" CEIL_TO_INT macro. 2002-11-05 Richard Williamson <rjw@apple.com> Fixed a couple of issues that Dave highlighted w/ his whitespace fixes. CG sometimes introduces very small 'error' in metrics, specifically we saw character widths of 20.0000019 that should have been 20. As a work-around we loose precision beyond the 1000th place. Also, always ceil spaces. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]): 2002-11-05 Darin Adler <darin@apple.com> - fixed 3084704 -- crash in HTMLTokenizer on page with JavaScript HTMLDocument::Close inside a <script> * WebView.subproj/WebFramePrivate.m: (-[WebFrame _detachFromParent]): We need to stop loading here. Otherwise we might do loading after closeURL, which could lead to a problem like the one above. 2002-11-05 Darin Adler <darin@apple.com> - changed our MacBinary decoding to not pay any attention to the comment Before we would "fail to decode" if the comment was truncated, now we just don't worry about it. * Downloads.subproj/WebMacBinaryDecoder.h: Remove _commentLength and _commentEnd. * Downloads.subproj/WebMacBinaryDecoder.m: (-[WebMacBinaryDecoder decodeData:dataForkData:resourceForkData:]): Remove code to get _commentLength and code to compute _commentEnd. (-[WebMacBinaryDecoder finishDecoding]): Check offset against the resource fork end rather than the comment end to see if we got enough data. 2002-11-05 John Sullivan <sullivan@apple.com> * Resources/url_icon.tiff: reverted generic URL icon back to the one that looks like a document until we get something from HI that SJ likes 2002-11-05 Chris Blumenberg <cblu@apple.com> Fixed: 3074108 - Decode macbinary files during download * Downloads.subproj/WebDownloadDecoder.h: * Downloads.subproj/WebDownloadHandler.h: * Downloads.subproj/WebDownloadHandler.m: (-[WebDownloadHandler initWithDataSource:]): (-[WebDownloadHandler dealloc]): (-[WebDownloadHandler decodeHeaderData:dataForkData:resourceForkData:]): (-[WebDownloadHandler decodeData:dataForkData:resourceForkData:]): (-[WebDownloadHandler closeFile]): (-[WebDownloadHandler cleanUpAfterFailure]): (-[WebDownloadHandler createFileIfNecessary]): (-[WebDownloadHandler writeData:toFork:]): (-[WebDownloadHandler writeDataForkData:resourceForkData:]): (-[WebDownloadHandler dataIfDoneBufferingData:]): (-[WebDownloadHandler receivedData:]): (-[WebDownloadHandler finishDecoding]): (-[WebDownloadHandler finishedLoading]): (-[WebDownloadHandler cancel]): * Downloads.subproj/WebMacBinaryDecoder.h: * Downloads.subproj/WebMacBinaryDecoder.m: (-[WebMacBinaryDecoder decodeData:dataForkData:resourceForkData:]): (-[WebMacBinaryDecoder fileAttributes]): (-[WebMacBinaryDecoder filename]): * Misc.subproj/WebKitErrors.h: added new errors * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveResponse:]): don't send response to download handler (-[WebMainResourceClient handle:didReceiveData:]): watch for decoding errors 2002-11-05 Ken Kocienda <kocienda@apple.com> Fix for this bug: Radar 3092747 (javascript cookieEnabled property returns incorrect value) Now, we return "true" for navigator.cookieEnabled when "Only accept cookies from the same domain as the current page" option is selected is user preferences. * WebCoreSupport.subproj/WebCookieAdapter.m: (-[WebCookieAdapter cookiesEnabled]) 2002-11-05 John Sullivan <sullivan@apple.com> - fixed 3091271 -- missing plug-in icon is on white background, not transparent. * Resources/nullplugin.tiff: Photoshopped the white away. It's still ugly, but that's a separate bug (3091274) 2002-11-05 Maciej Stachowiak <mjs@apple.com> - fixed 3083732 - SJ: window comes out blank on samsung site * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Don't start loading if the URL is exactly the same as the parent URL. We may need a more stringent check, but this seems to match the tolerance of other browsers OK. 2002-11-05 Maciej Stachowiak <mjs@apple.com> Added request and frame to click policy callback. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate clickPolicyForElement:button:modifierFlags:request:inFrame:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueAfterClickPolicyForEvent:request:]): (-[WebFrame _loadURL:loadType:clientRedirect:triggeringEvent:]): 2002-11-04 Richard Williamson <rjw@apple.com> Changes to support cursive letter forms. It works, but I've disabled it for now. It's buggy and needs cleanup. Arabic now renders correctly except for ligature substitution. * Misc.subproj/WebUnicode.h: * Misc.subproj/WebUnicode.m: (_unicodeIsMark): (getShape): (prevChar): (nextChar): (prevLogicalCharJoins): (nextLogicalCharJoins): (glyphVariantLogical): (shapedString): * Misc.subproj/WebUnicodeTables.m: * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:rightToLeft:]): (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]): * WebKitPrefix.h: 2002-11-04 Maciej Stachowiak <mjs@apple.com> Changes to send NSEvents all the way through WebCore and then pass them back out to WebKit, so that click policy can have a WebResourceRequest added. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:reload:triggeringEvent:]): (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _continueAfterClickPolicyForEvent:]): (-[WebFrame _loadURL:loadType:clientRedirect:triggeringEvent:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseUp:]): * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: 2002-11-04 Chris Blumenberg <cblu@apple.com> Fixed - 3091658: REGRESSION: cmd-left for back doesn't work in plain-text viewer We now pass text field key events to the next responder which would be WebView in this case. * WebView.subproj/WebTextView.m: (-[WebTextView keyDown:]): (-[WebTextView keyUp:]): 2002-11-04 Darin Adler <darin@apple.com> - fixed 3090257 -- "leak the world" using the Wallace and Gromit "console" * Plugins.subproj/WebNetscapePluginStream.m: Update for changes to the base delegate. (-[WebNetscapePluginStream start]): Use loadWithRequest:. (-[WebNetscapePluginStream stop]): Call cancel instead of just canceling the handle directly. This fixes the world leak. (-[WebNetscapePluginStream cancel]): Do some of the work that was formerly in "stop". * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:willSendRequest:]): Call the "stop loading URL" whenever we cancel I/O, so we don't leak the world. (-[WebMainResourceClient handle:didReceiveResponse:]): Ditto. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCache:response:size:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handleDidFinishLoading:]): * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _finishedLoadingResourceFromDataSource:]): Fix a typo in the word "finished". * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate handle:willSendRequest:]): Tweak. (-[WebBaseResourceHandleDelegate cancel]): Tweak. * Panels.subproj/WebStandardPanels.m: (-[WebStandardPanels didStartLoadingURL:inWindow:]): Add assertions. (-[WebStandardPanels didStopLoadingURL:inWindow:]): Ditto. (-[WebStandardPanels _didStartLoadingURL:inController:]): Ditto. (-[WebStandardPanels _didStopLoadingURL:inController:]): Ditto. 2002-11-04 Darin Adler <darin@apple.com> * Downloads.subproj/WebMacBinaryDecoder.h: Removed many unneeded fields. * Downloads.subproj/WebMacBinaryDecoder.m: (+[WebMacBinaryDecoder canDecodeHeaderData:]): Added comments. Changed maximum filename length to 63 as the format supports, rather than the 31 that's based on historical HFS limitations. Fix endian dependency in CRC check. (-[WebMacBinaryDecoder decodeData:dataForkData:resourceForkData:]): Simplified this, and removed the state machine and the accumulator. Also added some asserts. Fixed endian dependency in the code to extract the header. (-[WebMacBinaryDecoder finishDecoding]): New simpler check now that we don't have a _streamComplete boolean. (-[WebMacBinaryDecoder fileAttributes]): Rewrote to take advantage of the above changes, and also to use kCFAbsoluteTimeIntervalSince1904 rather than parsing a date string. * Downloads.subproj/crc16.h: Tweaks. * Downloads.subproj/crc16.m: Tweaks. 2002-11-04 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer dealloc]): Replaced a useless call to stopAnimation with a couple of asserts. 2002-11-04 John Sullivan <sullivan@apple.com> * Resources/url_icon.tiff: new "generic URL" icon from HI -- this one looks like a red ribbon (!) 2002-11-03 Darin Adler <darin@apple.com> * Plugins.subproj/WebPluginError.h: * Plugins.subproj/WebPluginError.m: Not __MyCompanyName__, but rather Apple Computer. 2002-11-03 Darin Adler <darin@apple.com> * Plugins.subproj/WebPlugin.h: Fix comment. * Plugins.subproj/WebPluginError.m: (-[WebPluginErrorPrivate dealloc]): Fix leak by calling [super dealloc]. * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate dealloc]): Remove the timer invalidate since, as Trey pointed out, it's pointless to invalidate a timer in dealloc if it's retaining this object while valid. 2002-11-03 Chris Blumenberg <cblu@apple.com> - Added MacBinary decoding code. Not yet used. * Downloads.subproj/WebMacBinaryDecoder.h: Added. * Downloads.subproj/WebMacBinaryDecoder.m: Added. (+[WebMacBinaryDecoder canDecodeHeaderData:]): (-[WebMacBinaryDecoder init]): (-[WebMacBinaryDecoder dealloc]): (-[WebMacBinaryDecoder decodeData:dataForkData:resourceForkData:]): (-[WebMacBinaryDecoder finishDecoding]): (-[WebMacBinaryDecoder fileAttributes]): * Downloads.subproj/crc16.h: Added. * Downloads.subproj/crc16.m: Added. (CRC16): * Plugins.subproj/WebPluginPackage.m: (-[WebPluginPackage isLoaded]): * WebKit.pbproj/project.pbxproj: 2002-11-03 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes both to the code here and to the extract script. 2002-11-03 Darin Adler <darin@apple.com> - fixed 3091300 -- "prelighting" on local page is still slow, despite recent bug fix Turns out all updating would be slow if any resources on the page failed to load. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): Call the new reportError instead of cancel. (-[WebSubresourceClient handle:didFailLoadingWithError:]): Ditto. 2002-11-02 Darin Adler <darin@apple.com> * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForRequest:]): Do the previous fix one better by using _web_hostWithPort. 2002-11-02 Darin Adler <darin@apple.com> - fixed bug where the address of an NSNumber object would be used for the port number * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForRequest:]): Call intValue on the object returned from [NSURL port]. 2002-11-01 Darin Adler <darin@apple.com> * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendEvent:]): Fixed uninitialized variable problem. 2002-11-01 Darin Adler <darin@apple.com> - fixed 3090239 -- crash on window close * WebView.subproj/WebFramePrivate.m: (-[WebFrame _detachFromParent]): Nil out the bridge and release it so we don't close the URL twice. - fixed 3058598 -- animated gif animates repeatedly in Alex, but only once in other browsers * WebCoreSupport.subproj/WebImageRenderer.h: Added fields used by bug workaround. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer blockHasGIFExtensionSignature:length:]): Helper method for bug workaround. (-[WebImageRenderer checkDataForGIFExtensionSignature:]): Checks incoming data for the GIF extension signatures. (-[WebImageRenderer initWithData:]): Override to call checkDataForGIFExtensionSignature. (-[WebImageRenderer incrementalLoadWithBytes:length:complete:]): Call checkDataForGIFExtensionSignature. (-[WebImageRenderer repetitionCount]): Return 1 if we were going to return 0, but we didn't see a GIF extension signature. This workaround can be removed once we require a system new enough to have the bug fix for bug 3090341. (-[WebImageRenderer nextFrame:]): Stop on last frame, don't wrap around to first. * WebCoreSupport.subproj/WebImageRendererFactory.h: Update for changes to WebCore. * WebCoreSupport.subproj/WebImageRendererFactory.m: Tweaks. * WebView.subproj/WebImageRepresentation.m: Update imports. * WebView.subproj/WebImageView.m: Update imports. 2002-11-01 Richard Williamson <rjw@apple.com> Implemented rendering of diacriticals. * Misc.subproj/WebUnicode.h: * Misc.subproj/WebUnicode.m: (_unicodeDigitValue): (_unicodeCategory): (_unicodeDirection): (_unicodeJoining): (_unicodeDecompositionTag): (_unicodeMirrored): (_unicodeCombiningClass): (_unicodeLower): (_unicodeUpper): * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:rightToLeft:]): (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]): (-[WebTextRenderer extendCharacterToGlyphMapToInclude:]): 2002-11-01 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2002-11-01 Chris Blumenberg <cblu@apple.com> Check that the plug-in is loaded before calling it. * Plugins.subproj/WebBaseNetscapePluginStream.h: * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream dealloc]): (-[WebBaseNetscapePluginStream setPluginPointer:]): (-[WebBaseNetscapePluginStream setResponse:]): (-[WebBaseNetscapePluginStream receivedData:]): (-[WebBaseNetscapePluginStream destroyStreamWithReason:]): (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): * Plugins.subproj/WebBasePluginPackage.h: * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage isLoaded]): * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage isLoaded]): * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedData:withDataSource:]): 2002-11-01 Chris Blumenberg <cblu@apple.com> - Moved plug-in error handling to WebResourceLoadDelegate - Report plug-in load failure, java load failure, and plug-in not found errors. - Added WebPluginError, subclass of WebError. - Attempted fix: 3090675 - Standalone WMP (Window Media Player) content crashes Alexander * English.lproj/Localizable.strings: * Misc.subproj/WebKitErrors.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendEvent:]): don't send event to null function * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): report plug-in load failure * Plugins.subproj/WebNullPluginView.h: * Plugins.subproj/WebNullPluginView.m: take a WebPluginError (-[WebNullPluginView dealloc]): (-[WebNullPluginView viewDidMoveToWindow]): * Plugins.subproj/WebPluginError.h: Added. * Plugins.subproj/WebPluginError.m: Added. (-[WebPluginErrorPrivate dealloc]): (-[WebPluginError dealloc]): (-[WebPluginError pluginPageURL]): (-[WebPluginError pluginName]): (-[WebPluginError MIMEType]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): report plug-in load failure (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]): report plug-in load failure * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.m: (-[WebResourceLoadDelegate pluginFailedWithError:dataSource:]): added, does nothing * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebView.m: (+[WebView initialize]): added new error strings 2002-11-01 John Sullivan <sullivan@apple.com> - some weaning of WebBookmark API from WebBookmarkGroup * Bookmarks.subproj/WebBookmark.m: (-[WebBookmark dealloc]): set group to nil instead of asserting that it's non-nil * Bookmarks.subproj/WebBookmarkGroup.h: removed obsolete ivar _bookmarksByID * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup initWithFile:]): removed obsolete ivar _bookmarksByID (-[WebBookmarkGroup dealloc]): removed obsolete ivar _bookmarksByID (-[WebBookmarkGroup removeBookmark:]): removed this unnecessary method; callers need to use [[bookmark parent] removeChild:bookmark] instead 2002-11-01 Trey Matteson <trey@apple.com> Moved involved code for loading URLs from WebBridge up to WebFrame, with a little consolidation along the way. I need to get all this stuff in one place in prep for doing back-forward properly with frames. There should be no change in functionality as a result of these changes. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:reload:]): (-[WebBridge postWithURL:data:contentType:]): (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Much of the guts of these is moved to WebFramePrivate. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setIsClientRedirect:]): (-[WebDataSource _isClientRedirect]): Keep state of whether we're processing a redirect in DataSource. I had previously to do this with a loadType, but that failed because cliRedir is orthogonal. * WebView.subproj/WebFramePrivate.h: WebFrameLoadTypeClientRedirect is gone. * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate init]): Initialize loadType explicitly. (-[WebFrame _transitionToCommitted]): Test [dataSource _isClientRedirect] instead of looking at loadType. (-[WebFrame _isLoadComplete]): Nuke WebFrameLoadTypeClientRedirect (-[WebFrame _goToItem:withFrameLoadType:]): Nuke WebFrameLoadTypeClientRedirect. (-[WebFrame _loadRequest:]): Helper method moved from WebBridge. (-[WebFrame _loadURL:loadType:clientRedirect:]): Core impl moved up from WebBridge. (-[WebFrame _postWithURL:data:contentType:]): Core impl moved up from WebBridge. 2002-11-01 Darin Adler <darin@apple.com> - implemented loop counts * WebCoreSupport.subproj/WebImageRenderer.h: Added repetitionsComplete field. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer repetitionCount]): Get NSImageLoopCount. (-[WebImageRenderer nextFrame:]): Check repetitionCount and stop once we hit it. 2002-10-31 Darin Adler <darin@apple.com> * WebView.subproj/WebFrame.m: (-[WebFrame setController:]): Add an assert, hoping to catch a reported bug earlier or disprove one theory. 2002-10-31 Trey Matteson <trey@apple.com> Added API to support 3072505 - SnapBack for user-entered page address Refixed 3041616 - Extra page added in back button history Previous fix was stepped on by a later checkin. Re-established that fix, then went on to make sure we have the final URL and title in the BF item in the case of a client redirect. Also handles redirects that happen within frames. Fixed 3078560 - div added to "back" list * History.subproj/WebBackForwardList.h: * History.subproj/WebBackForwardList.m: (-[WebBackForwardList containsEntry:]): Added new API for 3072505. * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportClientRedirectTo:delay:fireDate:]): (-[WebBridge reportClientRedirectCancelled]): (-[WebBridge loadURL:reload:]): Added logging. Renamed flag. Establish the right loadtype and set BF items from the old dataSource onto the new dataSource in the case of a client redirect. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setRequest:]): Add logging. (-[WebDataSource _addBackForwardItem:]): (-[WebDataSource _addBackForwardItems:]): (-[WebDataSource _backForwardItems]): New setters/getters to support setting up the new dataSource of a client redirect. * WebView.subproj/WebFramePrivate.h: New loadType WebFrameLoadTypeClientRedirect. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): Update the URL in the BF list in the client redirect case. (-[WebFrame _isLoadComplete]): NOP case for WebFrameLoadTypeClientRedirect (-[WebFrame _goToItem:withFrameLoadType:]): ASSERT_NOT_REACHED case for WebFrameLoadTypeClientRedirect 2002-10-31 Richard Williamson <rjw@apple.com> Corrected extern definitions of lookup tables. * Misc.subproj/WebUnicode.h: * Misc.subproj/WebUnicode.m: (_unicodeDirection): * WebCoreSupport.subproj/WebTextRenderer.m: (+[WebTextRenderer initialize]): === Alexander-30 === 2002-10-30 Richard Williamson <rjw@apple.com> More work on bidi and contextual forms. Table lookup code for unicode characters attributes. * Misc.subproj/WebUnicode.h: Added. * Misc.subproj/WebUnicode.m: Added. (_unicodeDigitValue): (_unicodeCategory): (_unicodeDirection): (_unicodeJoining): (_unicodeDecompositionTag): (_unicodeMirrored): (_unicodeMirroredChar): (_unicodeCombiningClass): (_unicodeLower): (_unicodeUpper): (WebKitInitializeUnicode): * Misc.subproj/WebUnicodeTables.m: Added. * WebKit.pbproj/project.pbxproj: Additional logging parameter. * Misc.subproj/WebKitLogging.h: * Misc.subproj/WebKitLogging.m: 2002-10-30 Maciej Stachowiak <mjs@apple.com> Pass WebResourceRequest rather than just NSURL to URL policy delegate method. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: (+[WebDefaultPolicyDelegate defaultURLPolicyForRequest:]): (-[WebDefaultPolicyDelegate URLPolicyForRequest:inFrame:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _shouldShowRequest:]): 2002-10-30 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2002-10-30 Chris Blumenberg <cblu@apple.com> Fixed: 3088122 - Assertion failure/crash closing window with QuickTime streaming in * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setMainDocumentError:]): call receivedError on the representation. 2002-10-30 Darin Adler <darin@apple.com> - fixed memory leaks in plugin package creation code * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage initWithPath:]): Rearrange this code, and make sure that it does a [self release] if it's going to return nil instead of self. (-[WebNetscapePluginPackage unload]): Set bundle to 0 when we release it. (-[WebNetscapePluginPackage dealloc]): Release the bundle if it's not 0. * Plugins.subproj/WebPluginPackage.m: (-[WebPluginPackage initWithPath:]): Rearrange this code, and make sure that it does a [self release] if it's going to return nil instead of self. 2002-10-30 Darin Adler <darin@apple.com> - fixed 3086564 -- REGRESSION: meta-refresh to the same page doesn't refresh The key is to respect the new reload: parameter from the bridge. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:reload:]): Don't ever treat a reload as a redirect. Set the cache policy to WebRequestCachePolicyLoadFromOrigin if it's a reload. - fixed 3087214 -- REGRESSION: <WebKit/WebKit.h> contains #import of non-existent header * Misc.subproj/WebKit.h: Removed import of WebControllerSets.h, which is private. 2002-10-30 Maciej Stachowiak <mjs@apple.com> Another step towards the policy API change - add request argument to file URL policy and remove isDirectory argument. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate fileURLPolicyForMIMEType:andRequest:inFrame:]): * WebView.subproj/WebFrame.m: (-[WebFrame setProvisionalDataSource:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _shouldShowRequest:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:willSendRequest:]): 2002-10-29 Maciej Stachowiak <mjs@apple.com> First step towards policy API change. Pass request instead of URL to content policy delegate method. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveResponse:]): 2002-10-29 Maciej Stachowiak <mjs@apple.com> - fixed 3087548 - REGRESSION: two windows open for netflix confirmation * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _findFrameInThisWindowNamed:]): Added this function back, and added check for top-level frame name. (-[WebController _findFrameNamed:]): Use _findFrameInThisWindowNamed: to make sure top-level frame names get checked. 2002-10-29 Chris Blumenberg <cblu@apple.com> Created Downloads.subproj to hold the to-be-implemented download decoders. * Downloads.subproj/WebDownloadDecoder.h: Added. * Downloads.subproj/WebDownloadHandler.h: Added. * Downloads.subproj/WebDownloadHandler.m: Added. (-[WebDownloadHandler initWithDataSource:]): (-[WebDownloadHandler dealloc]): (-[WebDownloadHandler errorWithCode:]): (-[WebDownloadHandler receivedResponse:]): (-[WebDownloadHandler receivedData:]): (-[WebDownloadHandler finishedLoading]): (-[WebDownloadHandler cancel]): * Misc.subproj/WebDownloadHandler.h: Removed. * Misc.subproj/WebDownloadHandler.m: Removed. * WebKit.pbproj/project.pbxproj: 2002-10-28 Darin Adler <darin@apple.com> - fixed crash I just introduced * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase init]): Remove the release call here. When I added the autorelease, I didn't realize that the caller was doing a release. 2002-10-28 Trey Matteson <trey@apple.com> Fixed 3041616 - Extra page added in back button history Client-side redirects would always put an extra item in the backforward list. According to Darin this is a regression all the way back from functionality moving from WebBrowser to WebKit. * WebCoreSupport.subproj/WebBridge.h: Added state to know if we're doing an "internal" type of load * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportClientRedirectTo:delay:fireDate:]): Set internalLoad bit if delay==0 (-[WebBridge reportClientRedirectCancelled]): Clear internalLoad (-[WebBridge loadURL:]): Set frame's loadType if doing an internal load (similar to what we do when loading child frames) 2002-10-28 Darin Adler <darin@apple.com> - fixed storage leak of WebNetscapePluginPackage objects * Plugins.subproj/WebBasePluginPackage.m: (+[WebBasePluginPackage pluginWithPath:]): Add missing autorelease. * Plugins.subproj/WebBasePluginPackage.h: * Plugins.subproj/WebPluginController.h: * Plugins.subproj/WebPluginController.m: * Plugins.subproj/WebPluginPackage.h: * Plugins.subproj/WebPluginPackage.m: Not __MyCompanyName__, but rather Apple Computer. 2002-10-28 Darin Adler <darin@apple.com> - fixed bug that caused us to leak all WebResourceHandles used for subresources * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient dealloc]): Remove bogus "currentURL == nil" assert. (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): Use the new loadWithRequest: call instead of making handle and doing loadWithDelegate:. This is where the leak was, because no one ever released the handle, but releasing it right away would be too soon. * WebView.subproj/WebBaseResourceHandleDelegate.h: Added defersCallbacks field, loadWithRequest: method, and setDefersCallbacks: method. Removed handle method. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate loadWithRequest:]): New method. Sets up the handle, set the defersCallbacks state on it, and calls loadWithDelegate:. (-[WebBaseResourceHandleDelegate setDefersCallbacks:]): Stores defersCallbacks state, and also sets it on the handle, if any. (-[WebBaseResourceHandleDelegate handle:willSendRequest:]): Remove code to set up the handle, since we now do that at loadWithRequest: time. * WebView.subproj/WebDataSourcePrivate.h: Remove mainHandle field. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): Don't release mainHandle. (-[WebDataSource _setPrimaryLoadComplete:]): Ditto. (-[WebDataSource _startLoading]): Use loadWithRequest: on the client, no need to deal with the handle directly at all. (-[WebDataSource _addSubresourceClient:]): Call setDefersCallbacks: on the client. (-[WebDataSource _defersCallbacksChanged]): Ditto. * WebView.subproj/WebControllerPrivate.m: Remove unneeded include. * WebView.subproj/WebMainResourceClient.m: Ditto. 2002-10-28 Chris Blumenberg <cblu@apple.com> Fixed: 3056726 - View Source window always displays the source in current system encoding Fixed: 3019352 - Text encoding is not handled when viewing plain text * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource stringWithData:]): added, creates a string using the specified encoding. * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation documentSource]): uses the bridge specified encoding when creating the string * WebView.subproj/WebTextView.h: * WebView.subproj/WebTextView.m: (-[WebTextView dataSourceUpdated:]): use stringWithData: (-[WebTextView supportsTextEncoding]): Yup 2002-10-28 Richard Williamson <rjw@apple.com> Fixed crasher. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]): 2002-10-28 John Sullivan <sullivan@apple.com> * Bookmarks.subproj/WebBookmark.h: * Bookmarks.subproj/WebBookmark.m: (-[WebBookmark contentMatches:]): new method, returns YES if two bookmarks are the same, ignoring group and parent. 2002-10-28 Trey Matteson <trey@apple.com> Finished 2998200 - access to most-recent in submenu of back & forward buttons * WebView.subproj/WebDataSourcePrivate.h: The BF items we are going to and from were moved here from WebFrame because of timing problems among multiple data sources when using the BF buttons during a load. In addition, the datasource has a list of relevant BF items for which it keeps their titles up to date. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): Free new state. (-[WebDataSource _setTitle:]): Update titles of BF items. (-[WebDataSource _provisionalBackForwardItem]): (-[WebDataSource _setProvisionalBackForwardItem:]): (-[WebDataSource _previousBackForwardItem]): (-[WebDataSource _setPreviousBackForwardItem:]): (-[WebDataSource _addBackForwardItem:]): Maintain new state. (-[WebDataSource _commitIfReady]): Free up previous and provisional BF items after commit. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:]): Add the new BF item to the datasource. (-[WebBridge saveDocumentState:]): Use the right BF item to save the doc state. * WebView.subproj/WebFramePrivate.h: Previous and provisional BF are moved to datasource. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): Use provisional BF from datasource to set position in BF list. Add new BF item to datasource. (-[WebFrame _isLoadComplete]): (-[WebFrame _checkLoadComplete]): Comments, whitespace. (-[WebFrame _goToItem:withFrameLoadType:]): Set item we will use to saveDocState at commit time. 2002-10-27 Darin Adler <darin@apple.com> - WebKit part of filename width fix * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileButton drawRect:]): Compute left position by starting at the right side of the button frame rather than by starting at the right side of the overall bounds. Removes dependency on fixed-width filename area. (-[WebFileButton updateLabel]): Added. Computes ellipsized filename. (-[WebFileButton setFilename:]): Use updateLabel instead of code in line here. (-[WebFileButton setFrameSize:]): Call updateLabel. (-[WebFileButton bestVisualFrameSizeForCharacterCount:]): Compute a width based on the count passed in rather than a hardcoded 200-pixel constant. 2002-10-27 Darin Adler <darin@apple.com> - fixed 3037369 -- Status text not cleared after start of drag from page * WebView.subproj/WebHTMLView.m: (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): Find the highest-level enclosing WebHTMLView, and call _updateMouseoverWithEvent: with the mouseUp event after the drag is done. (-[WebHTMLView mouseMovedNotification:]): Just call _updateMouseoverWithEvent:, the code from here was moved into there. * WebView.subproj/WebHTMLViewPrivate.h: Declare _updateMouseoverWithEvent. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _updateMouseoverWithEvent:]): Moved all the code from mouseMovedNotification: in here so it could be used twice. 2002-10-27 Don Melton <gramps@apple.com> * WebView.subproj/WebController.m: (-[WebController userAgentForURL:]): Changed default user agent to Mozilla 1.1. 2002-10-27 Darin Adler <darin@apple.com> * Bookmarks.subproj/WebBookmarkProxy.m: (-[WebBookmarkProxy dealloc]): Added, so we don't leak the title. * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup removeBookmark:]): * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList removeChild:]): Added retain/release pairs so we don't use an object after it's deallocated. In practice this doesn't happen the way these are used by Alex since they are in an array, but they have windows of vulnerability depending on exactly how they are used. 2002-10-26 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory inputElementAltText]): Added. (-[WebViewFactory resetButtonDefaultLabel]): Added. (-[WebViewFactory searchableIndexIntroduction]): Added. (-[WebViewFactory submitButtonDefaultLabel]): Added. (-[WebViewFactory defaultLanguageCode]): Added. * English.lproj/Localizable.strings: Update. * English.lproj/StringsNotToBeLocalized.txt: Update. 2002-10-25 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory runJavaScriptAlertPanelWithMessage:]): Added. (-[WebViewFactory runJavaScriptConfirmPanelWithMessage:]): Added. * English.lproj/Localizable.strings: Update. * English.lproj/StringsNotToBeLocalized.txt: Update. 2002-10-25 Richard Williamson <rjw@apple.com> Implemented support for bidi text layout. * WebCoreSupport.subproj/WebTextRenderer.m: (_drawGlyphs): (-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:rightToLeft:]): 2002-10-25 Chris Blumenberg <cblu@apple.com> Made frameNamed private in WebController and renamed it to _findFrameNamed. Got rid of _frameInThisWindowNamed in WebController because it isn't needed anymore. * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController _goToItem:withFrameLoadType:]): call _findFrameNamed * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _findFrameNamed:]): renamed, made private, got rid of call to _frameInThisWindowNamed as it is not needed * WebView.subproj/WebFrame.m: (-[WebFrame findFrameNamed:]): call [WebController _findFrameNamed:] 2002-10-25 Chris Blumenberg <cblu@apple.com> - Fix case where we would name a new window _blank - If a data source can't be created for a plug-in request, don't create the frame or open a window. - cleaned up plug-in stream notifications * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView initWithFrame:]): create streamNotifications dict (-[WebBaseNetscapePluginView dealloc]): release streamNotifications dict (-[WebBaseNetscapePluginView frameStateChanged:]): cleaned up (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): create data source before frame * Plugins.subproj/WebPluginController.m: (-[WebPluginController showURL:inFrame:]): create data source before frame * WebView.subproj/WebControllerPrivate.m: (-[WebController _setTopLevelFrameName:]): don't allow _blank frames * WebView.subproj/WebFrame.m: (-[WebFrame findOrCreateFramedNamed:]): no need to check for _blank 2002-10-25 Darin Adler <darin@apple.com> Tighten up the code that observes mouse moved events. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView initWithFrame:]): Don't set up observers here. (-[WebHTMLView addMouseMovedObserver]): Added some assertions. (-[WebHTMLView viewWillMoveToWindow:]): Stop observing the "become main" and "resign main" notifications here. (-[WebHTMLView viewDidMoveToWindow]): Start observing them here. (-[WebHTMLView windowDidBecomeMain:]): Assert that the notification is for this window, instead of checking with if. (-[WebHTMLView windowDidResignMain:]): Assert that the notification is for this window. 2002-10-25 Chris Blumenberg <cblu@apple.com> Cleaned up the frame searching shenanigans. Things are much cleaner and clearer now. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): call findOrCreateFramedNamed * Plugins.subproj/WebPluginController.m: (-[WebPluginController showURL:inFrame:]): call findOrCreateFramedNamed * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge childFrames]): moved (-[WebBridge mainFrame]): moved (-[WebBridge findOrCreateFramedNamed:]): call findOrCreateFramedNamed on the frame (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): call _pluginController * WebView.subproj/WebControllerPrivate.m: (-[WebController _frameInThisWindowNamed:]): call _descendantFrameNamed * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (-[WebFrame findFrameNamed:]): was frameNamed. First checks special-case frame names, descendant frames, then the whole controller, then other controllers. (-[WebFrame findOrCreateFramedNamed:]): calls findFrameNamed, opens new window if necessary * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _descendantFrameNamed:]): searches children, children's children etc. (-[WebFrame _pluginController]): this method needed an "_" * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addSubview:]): call _pluginController * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementAtPoint:]): no need to special case for "_blank" since findFrameNamed will return nil for that name 2002-10-25 Trey Matteson <trey@apple.com> 2919039 - Implement limit on back/forward history list 2998200 - access to most-recent in submenu of back & forward buttons 3022566 - need WebKit API for accessing and visiting back/forward list items 3084051 - forward button incorrectly enabled after going forward all the way Remaining issues at this point are getting the title of the pages into the menu items (instead of the URL), and saving document state properly when you jump around in the list. Solutions are known and coming soon. * History.subproj/WebBackForwardList.h: Added doc comments to API. Made ivars private. Replaced index- based API with item-based API. Added a sizelimit to the overall list. Tweaked API to get back and forward lists. * History.subproj/WebBackForwardList.m: Straightforward impl of the above, with the note that I dumped WebHistoryList from the API and impl in favor of an NSArray, which is efficient for this sort of use (queue, stack). (-[WebBackForwardList init]): (-[WebBackForwardList dealloc]): (-[WebBackForwardList goBack]): (-[WebBackForwardList goForward]): (-[WebBackForwardList goToEntry:]): (-[WebBackForwardList backEntry]): (-[WebBackForwardList forwardEntry]): (-[WebBackForwardList maximumSize]): (-[WebBackForwardList setMaximumSize:]): (-[WebBackForwardList description]): * History.subproj/WebHistoryList.h: Removed. Nuked from API, per above. * History.subproj/WebHistoryList.m: Removed. * Misc.subproj/WebKit.h: WebHistoryList gone from API. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:]): Use if/else instead of buried "return;", so next person doesn;t make the same mis-read I did. (-[WebBridge saveDocumentState:]): Site of future work. * WebKit.pbproj/project.pbxproj: Nuked WebHistoryList. * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController goBackOrForwardToItem:]): New method to support random access nav in backforward list. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setTitle:]): Site of future work (fixing title in items) * WebView.subproj/WebFramePrivate.h: WebFrameLoadTypeIndexedBack/WebFrameLoadTypeIndexedForward are collapsed into WebFrameLoadTypeIndexedBackForward. Vestigial WebFrameLoadTypeIntermediateBack is nuked. * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate setBackForwardItem:]): (-[WebFrame _setBackForwardItem:]): (-[WebFrame _backForwardItem]): Must remember the BF item we're going to so we can update the BF list on commit. (-[WebFrame _transitionToCommitted]): Update the BF list on commit. (-[WebFrame _isLoadComplete]): (-[WebFrame _goToItem:withFrameLoadType:]): Update BF list on within-page nav. Remember BF item we are going to for later update on commit. 2002-10-25 Chris Blumenberg <cblu@apple.com> Minor non-mentionable clean-up. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): 2002-10-25 Chris Blumenberg <cblu@apple.com> Cleaned up the plug-in API headers so they can be sent to other groups. * Plugins.subproj/WebPlugin.h: * Plugins.subproj/WebPluginContainer.h: * Plugins.subproj/WebPluginViewFactory.h: 2002-10-24 Richard Williamson <rjw@apple.com> Fixed many font substitution related bugs, at least including: 3006966, 3026675, 3071106, and more... (each of these bugs has a list of related bugs). Needs little more cleanup to correctly deal with non base characters. * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:]): (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]): Against Darin's better judgement prevent extra layout when not in live resize. If this introduces any regressions I owe darin a good bottle of wine. * WebView.subproj/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): 2002-10-24 Chris Blumenberg <cblu@apple.com> New Java plug-in works! Much faster to load and no spinny cursor! Unfortunately, it very unstable. * Plugins.subproj/WebPluginController.m: cleaned-up the logging messages. (-[WebPluginController addPluginView:]): (-[WebPluginController didAddPluginView:]): (-[WebPluginController startAllPlugins]): (-[WebPluginController stopAllPlugins]): (-[WebPluginController destroyAllPlugins]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]): make height and width an attribute. 2002-10-24 Chris Blumenberg <cblu@apple.com> Some clean-up and bug fixes for new plug-in support. * Plugins.subproj/WebPluginController.m: (-[WebPluginController initWithWebFrame:]): need a colon after windowWillClose (-[WebPluginController addPluginView:]): added logging (-[WebPluginController didAddPluginView:]): added logging (-[WebPluginController startAllPlugins]): added logging (-[WebPluginController stopAllPlugins]): added logging (-[WebPluginController destroyAllPlugins]): added logging * Plugins.subproj/WebPluginPackage.m: (-[WebPluginPackage getMIMEInformation]): use correct dict key for getting MIME descriptions * WebCoreSupport.subproj/WebBridge.m: no more didAddSubview * WebView.subproj/WebFramePrivate.h: no more didAddSubview * WebView.subproj/WebFramePrivate.m: no more didAddSubview * WebView.subproj/WebHTMLView.m: (-[WebHTMLView addSubview:]): call didAddPluginView on WebPluginController 2002-10-24 John Sullivan <sullivan@apple.com> * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCache:response:size:]): added ASSERT(response != nil), leftover from debugging session on Tuesday, seems worth leaving in. 2002-10-24 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2002-10-24 Chris Blumenberg <cblu@apple.com> Changed some method names in WebPluginController. * Plugins.subproj/WebPluginController.h: * Plugins.subproj/WebPluginController.m: (-[WebPluginController didAddPluginView:]): (-[WebPluginController startAllPlugins]): (-[WebPluginController stopAllPlugins]): (-[WebPluginController destroyAllPlugins]): (-[WebPluginController windowWillClose:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): (-[WebFrame _didAddSubview:]): === Alexander-29 === 2002-10-24 Richard Williamson <rjw@apple.com> Don't leak request. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate handle:willSendRequest:]): 2002-10-24 Richard Williamson <rjw@apple.com> Always copy request, we can't count on it being immutable. This was the cause of the ASSERT from last night's checkin. * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate handle:willSendRequest:]): Only send serverRedirectedForDataSource: if URL changed. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setRequest:]): 2002-10-24 Chris Blumenberg <cblu@apple.com> - Use "MIMEType" instead of "serviceType". * Plugins.subproj/WebBasePluginPackage.h: * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage load]): (-[WebBasePluginPackage dealloc]): (-[WebBasePluginPackage filename]): (-[WebBasePluginPackage setPath:]): * Plugins.subproj/WebNetscapePluginEmbeddedView.h: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:MIMEType:attributes:]): * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage getMIMEInformation]): changed name. (-[WebNetscapePluginPackage initWithPath:]): * Plugins.subproj/WebNullPluginView.h: * Plugins.subproj/WebNullPluginView.m: (-[WebNullPluginView initWithFrame:MIMEType:attributes:]): (-[WebNullPluginView dealloc]): (-[WebNullPluginView viewDidMoveToWindow]): send missing plug-ins notification here * Plugins.subproj/WebPluginPackage.m: (-[WebPluginPackage getMIMEInformation]): new, gets MIME info from plist (-[WebPluginPackage initWithPath:]): (-[WebPluginPackage dealloc]): (-[WebPluginPackage viewFactory]): (-[WebPluginPackage load]): (-[WebPluginPackage unload]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]): (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]): 2002-10-24 Richard Williamson <rjw@apple.com> Flag error instead of ASSERTing as a result of fix to 3083013. Not clear why this condition occurs, but better than ASSERTing for Alex 29. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setRequest:]): 2002-10-24 Darin Adler <darin@apple.com> - fixed a crash I ran into in the new delegate code * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate _releaseResources]): Retain self across this deallocation to avoid reentering and being deallocated midstream. This happens because the handle holds the only reference to us, and we may be releasing the last reference to it. (-[WebBaseResourceHandleDelegate dealloc]): Add call to [super dealloc]. * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage dealloc]): Add call to [super dealloc]. * WebView.subproj/WebMainResourceClient.m: Tweak. 2002-10-23 Darin Adler <darin@apple.com> - fixed 3083013 -- REGRESSION: Cookie refused at http://directory/ even on reload Restore a bit of the cruft. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:willSendRequest:]): We need to change the request on the data source when a redirect happens, because the data source goes on to ultimately communicate this to WebCore. Restored the code that did that, with some changes to fit into the new regime. 2002-10-23 Richard Williamson <rjw@apple.com> Cleaned up months of accumulated cruft. Added base class to the three WebResourceHandleDelegate implementors. Removed superfluous handle references to controller callbacks. More can still be done. All in the name of fixing 3076050. * Misc.subproj/WebKitErrors.h: * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setResponse:]): * Plugins.subproj/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedData:withDataSource:]): (-[WebNetscapePluginRepresentation receivedError:withDataSource:]): (-[WebNetscapePluginRepresentation finishedLoadingWithDataSource:]): * Plugins.subproj/WebNetscapePluginStream.h: * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:]): (-[WebNetscapePluginStream dealloc]): (-[WebNetscapePluginStream start]): (-[WebNetscapePluginStream stop]): (-[WebNetscapePluginStream handle:willSendRequest:]): (-[WebNetscapePluginStream handle:didReceiveResponse:]): (-[WebNetscapePluginStream handle:didReceiveData:]): (-[WebNetscapePluginStream handleDidFinishLoading:]): (-[WebNetscapePluginStream handle:didFailLoadingWithError:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportBadURL:]): * WebCoreSupport.subproj/WebSubresourceClient.h: * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient initWithLoader:dataSource:]): (-[WebSubresourceClient dealloc]): (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): (-[WebSubresourceClient receivedError:]): (-[WebSubresourceClient handle:willSendRequest:]): (-[WebSubresourceClient handle:didReceiveResponse:]): (-[WebSubresourceClient handle:didReceiveData:]): (-[WebSubresourceClient handleDidFinishLoading:]): (-[WebSubresourceClient handle:didFailLoadingWithError:]): (-[WebSubresourceClient cancel]): * WebView.subproj/WebBaseResourceHandleDelegate.h: * WebView.subproj/WebBaseResourceHandleDelegate.m: (-[WebBaseResourceHandleDelegate init]): (-[WebBaseResourceHandleDelegate _releaseResources]): (-[WebBaseResourceHandleDelegate dealloc]): (-[WebBaseResourceHandleDelegate setDataSource:]): (-[WebBaseResourceHandleDelegate dataSource]): (-[WebBaseResourceHandleDelegate resourceLoadDelegate]): (-[WebBaseResourceHandleDelegate downloadDelegate]): (-[WebBaseResourceHandleDelegate setIsDownload:]): (-[WebBaseResourceHandleDelegate isDownload]): (-[WebBaseResourceHandleDelegate handle:willSendRequest:]): (-[WebBaseResourceHandleDelegate handle:didReceiveResponse:]): (-[WebBaseResourceHandleDelegate handle:didReceiveData:]): (-[WebBaseResourceHandleDelegate handleDidFinishLoading:]): (-[WebBaseResourceHandleDelegate handle:didFailLoadingWithError:]): (-[WebBaseResourceHandleDelegate cancel]): (-[WebBaseResourceHandleDelegate handle]): * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _mainReceivedBytesSoFar:fromDataSource:complete:]): (-[WebController _receivedError:fromDataSource:]): (-[WebController _mainReceivedError:fromDataSource:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _startLoading]): (-[WebDataSource _stopLoading]): (-[WebDataSource _clearErrors]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _isLoadComplete]): * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient initWithDataSource:]): (-[WebMainResourceClient dealloc]): (-[WebMainResourceClient receivedError:]): (-[WebMainResourceClient cancel]): (-[WebMainResourceClient handle:willSendRequest:]): (-[WebMainResourceClient _notifyDelegatesOfInterruptionByPolicyChange]): (-[WebMainResourceClient handle:didReceiveResponse:]): (-[WebMainResourceClient handle:didReceiveData:]): (-[WebMainResourceClient handleDidFinishLoading:]): (-[WebMainResourceClient handle:didFailLoadingWithError:]): * WebView.subproj/WebResourceLoadDelegate.h: 2002-10-23 Chris Blumenberg <cblu@apple.com> Support for new plug-in API. This is about as much as I can do without the new java plug-in and java root. * Plugins.subproj/WebPluginController.h: * Plugins.subproj/WebPluginController.m: (-[WebPluginController initWithWebFrame:]): observe window close changes (-[WebPluginController dealloc]): remove observer, assert if we're still tracking plug-ins (-[WebPluginController didAddSubview:]): start the plug-in (-[WebPluginController stopAllPlugins]): stop and destroy all plug-ins. (-[WebPluginController windowWillClose:]): call stopAllPlugins if the window in question is closing * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): call stopAllPlugins on WebPluginController 2002-10-23 Chris Blumenberg <cblu@apple.com> Changed the plug-in package API to return key enumerators instead dictionaries. * Plugins.subproj/WebBasePluginPackage.h: * Plugins.subproj/WebBasePluginPackage.m: (-[WebBasePluginPackage initWithPath:]): (-[WebBasePluginPackage load]): (-[WebBasePluginPackage unload]): (-[WebBasePluginPackage dealloc]): (-[WebBasePluginPackage extensionEnumerator]): (-[WebBasePluginPackage MIMETypeEnumerator]): (-[WebBasePluginPackage descriptionForMIMEType:]): (-[WebBasePluginPackage MIMETypeForExtension:]): (-[WebBasePluginPackage extensionsForMIMEType:]): (-[WebBasePluginPackage setName:]): (-[WebBasePluginPackage setPath:]): (-[WebBasePluginPackage setFilename:]): (-[WebBasePluginPackage setPluginDescription:]): (-[WebBasePluginPackage setMIMEToDescriptionDictionary:]): (-[WebBasePluginPackage setMIMEToExtensionsDictionary:]): * Plugins.subproj/WebNetscapePluginPackage.h: * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage getPluginInfo]): (-[WebNetscapePluginPackage pathByResolvingSymlinksAndAliasesInPath:]): (-[WebNetscapePluginPackage initWithPath:]): (-[WebNetscapePluginPackage executableType]): * Plugins.subproj/WebPluginController.h: * Plugins.subproj/WebPluginController.m: (-[WebPluginController didAddSubview:]): * Plugins.subproj/WebPluginDatabase.h: * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): (-[WebPluginDatabase pluginForMIMEType:]): (-[WebPluginDatabase pluginForExtension:]): (-[WebPluginDatabase MIMETypes]): (-[WebPluginDatabase init]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge viewForPluginWithURL:attributes:baseURL:serviceType:]): (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]): (-[WebBridge didAddSubview:]): new * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _didAddSubview:]): new 2002-10-23 Darin Adler <darin@apple.com> - finished up the job of moving the file button here from WebCore. I did this mainly for localization reasons. * WebCoreSupport.subproj/WebFileButton.m: (-[WebFileButton initWithFrame:]): Set up button control size, font, bezel style, target, and action. Also add it as a subview. (-[WebFileButton drawRect:]): Center icon in the "visual frame" part of the view, not the entire bounds. (-[WebFileButton setFilename:]): Don't show any icon when the filename is empty. (-[WebFileButton bestVisualFrameSize]): Implemented this. (-[WebFileButton visualFrame]): Ditto. (-[WebFileButton setVisualFrame:]): Ditto. (-[WebFileButton baseline]): Ditto. (-[WebFileButton beginSheet]): Added. Shared between button presses and other clicks. (-[WebFileButton chooseButtonPressed:]): Call beginSheet. (-[WebFileButton mouseDown:]): Ditto. (-[WebFileButton openPanelDidEnd:returnCode:contextInfo:]): Send the notification, WebCoreFileButtonFilenameChanged, when the filename is changed. * WebView.subproj/WebController.m: (-[WebController policyDelegate]): Add a FIXME about the leak I found here. 2002-10-23 Chris Blumenberg <cblu@apple.com> Call the arguments for plug-ins "attributes" everywhere. * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView setAttributes:]): * Plugins.subproj/WebNetscapePluginEmbeddedView.h: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:mime:attributes:]): * Plugins.subproj/WebNullPluginView.h: * Plugins.subproj/WebNullPluginView.m: (-[WebNullPluginView initWithFrame:mimeType:attributes:]): (-[WebNullPluginView drawRect:]): * Plugins.subproj/WebPluginController.h: * Plugins.subproj/WebPluginController.m: (-[WebPluginController initWithWebFrame:]): (-[WebPluginController dealloc]): (-[WebPluginController addPluginView:]): * Plugins.subproj/WebPluginPackage.h: * Plugins.subproj/WebPluginPackage.m: (-[WebPluginPackage viewFactory]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge pluginViewWithPackage:attributes:baseURL:]): (-[WebBridge viewForPluginWithURL:attributes:baseURL:serviceType:]): (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]): 2002-10-23 Chris Blumenberg <cblu@apple.com> * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge requestedURL]): (-[WebBridge viewForPluginWithURL:serviceType:arguments:baseURL:]): (-[WebBridge viewForJavaAppletWithFrame:baseURL:parameters:]): * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory fileButton]): (-[WebViewFactory pluginsInfo]): 2002-10-23 Darin Adler <darin@apple.com> - fix bug where plugins crashed closing a stream that was never opened * Plugins.subproj/WebBaseNetscapePluginStream.h: Change type for parameter of receivedError: to NPReason. It's not NPError. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream dealloc]): Assert that stream is destroyed by checking stream.ndata. (-[WebBaseNetscapePluginStream setResponse:]): Set stream.ndata to nil if the stream is not successfully created by NPP_NewStream. (-[WebBaseNetscapePluginStream destroyStreamWithReason:]): Added. Destroys the stream, but only if it's present. Also set stream.ndata to nil. This was the bug fix. (-[WebBaseNetscapePluginStream receivedError:]): Call destroyStreamWithReason:. (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): Call destroyStreamWithReason:. * English.lproj/Localizable.strings: Update. * English.lproj/StringsNotToBeLocalized.txt: Update. 2002-10-23 Chris Blumenberg <cblu@apple.com> Forgot to add WebPluginController back to the project after I had a project conflict. * WebKit.pbproj/project.pbxproj: 2002-10-23 Chris Blumenberg <cblu@apple.com> Added WebPluginController which controls and reacts to plug-in requests. Its owned by the WebFrame. * Plugins.subproj/WebPluginController.h: Added. * Plugins.subproj/WebPluginController.m: Added. (-[WebPluginController initWithWebFrame:]): (-[WebPluginController showURL:inFrame:]): (-[WebPluginController showStatus:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate dealloc]): (-[WebFrame pluginController]): 2002-10-23 Darin Adler <darin@apple.com> Add WebFileButton, to be used by WebCore soon. It's about 1/2 done right now. Compiles but not used yet. * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory fileButton]): Added. * WebCoreSupport.subproj/WebFileButton.h: Added. * WebCoreSupport.subproj/WebFileButton.m: Added. * WebKit.pbproj/project.pbxproj: Added WebFileButton files. * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handle:didReceiveResponse:]): Add an assertion. 2002-10-23 Maciej Stachowiak <mjs@apple.com> - fixed 2876448 - The authentication panel should give a note when the user tried to log in and failed Also, made the message different (and more helpful) when the authentication is for a proxy server. * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForRequest:]): Use different messages depending on proxy and previous failure count. Updated localized strings: * English.lproj/Localizable.strings: * English.lproj/StringsNotToBeLocalized.txt: 2002-10-23 Maciej Stachowiak <mjs@apple.com> - fixed 2876446 - The label in the authentication panel needs to adjust its height depending on content Also improved [NSControl sizeToFitAndAdjustWindowHeight] method. * Panels.subproj/English.lproj/WebAuthenticationPanel.nib: Adjusted springs. * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForRequest:]): Use sizeToFitAndAdjustWindowHeight on main label. * Misc.subproj/WebNSControlExtras.m: (-[NSControl sizeToFitAndAdjustWindowHeight]): Improved the logic so the best height is picked while leaving the width alone. Before, the label would always come out to be a very wide single line. 2002-10-22 Maciej Stachowiak <mjs@apple.com> * WebKit.pbproj/project.pbxproj: Made WebControllerSets.h private. Also alphabetized headers in target pane and subproject folders. 2002-10-22 Chris Blumenberg <cblu@apple.com> load and unload is only a WebNetscapePluginPackage thing since you can't unload an NSBundle. * Plugins.subproj/WebBasePluginPackage.h: * Plugins.subproj/WebBasePluginPackage.m: * Plugins.subproj/WebNetscapePluginPackage.h: 2002-10-22 Chris Blumenberg <cblu@apple.com> More moving stuff around for the new plug-in API. Added WebBasePluginPackage and added subclass WebPluginPackage. Also made WebNetscapePluginPackage a subclass of WebBasePluginPackage. * Plugins.subproj/WebBasePluginPackage.h: Added. * Plugins.subproj/WebBasePluginPackage.m: Added. (+[WebBasePluginPackage pluginWithPath:]): creates a WebPluginPackage or WebNetscapePluginPackage (-[WebBasePluginPackage initWithPath:]): (-[WebBasePluginPackage name]): (-[WebBasePluginPackage path]): (-[WebBasePluginPackage filename]): (-[WebBasePluginPackage pluginDescription]): (-[WebBasePluginPackage extensionToMIMEDictionary]): (-[WebBasePluginPackage MIMEToExtensionsDictionary]): (-[WebBasePluginPackage MIMEToDescriptionDictionary]): (-[WebBasePluginPackage load]): (-[WebBasePluginPackage unload]): (-[WebBasePluginPackage isLoaded]): (-[WebBasePluginPackage description]): * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebNetscapePluginPackage.h: * Plugins.subproj/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage initWithPath:]): * Plugins.subproj/WebPluginDatabase.h: * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase pluginForMIMEType:]): (-[WebPluginDatabase pluginForExtension:]): (-[WebPluginDatabase pluginForFilename:]): (-[WebPluginDatabase MIMETypes]): (-[WebPluginDatabase init]): * Plugins.subproj/WebPluginPackage.h: Added. * Plugins.subproj/WebPluginPackage.m: Added. (-[WebPluginPackage initWithPath:]): * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]): check the class of the plug-in when deciding which view to create. (-[WebViewFactory viewForJavaAppletWithFrame:baseURL:parameters:]): same here. * WebKit.pbproj/project.pbxproj: 2002-10-22 David Hyatt <hyatt@apple.com> Getting XML docs at least made for XML files... * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation setDataSource:]): 2002-10-22 Chris Blumenberg <cblu@apple.com> Made new plug-in API headers private. * WebKit.pbproj/project.pbxproj: 2002-10-22 Darin Adler <darin@apple.com> * Misc.subproj/WebKitErrors.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:willSendRequest:]): (-[WebMainResourceClient handle:didReceiveResponse:]): Rename WebErrorLocationChangeInterruptedByURLPolicyChange to WebErrorLocationChangeInterruptedByPolicyChange. 2002-10-22 Darin Adler <darin@apple.com> * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveResponse:]): Send the new error whenever a policy change happens. The old code was sending a successful completion in the download and ignore cases. 2002-10-22 John Sullivan <sullivan@apple.com> - fixed 3080873 -- Error in console when no bookmark file found -[WebBookmarkGroup _loadBookmarkGroupGuts] * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup _loadBookmarkGroupGuts]): removed ERROR that was useful only long ago. 2002-10-22 Richard Williamson <rjw@apple.com> Added stubs from common WebResourceHandleDelegate base class. * Plugins.subproj/WebBaseNetscapePluginStream.h: * Plugins.subproj/WebNetscapePluginStream.h: * WebCoreSupport.subproj/WebSubresourceClient.h: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebBaseResourceHandleDelegate.h: Added. * WebView.subproj/WebBaseResourceHandleDelegate.m: Added. * WebView.subproj/WebMainResourceClient.h: 2002-10-22 Darin Adler <darin@apple.com> Make the panel position itself above the main window. Too bad we can't use a sheet, but this is better than a random position. * WebCoreSupport.subproj/WebJavaScriptTextInputPanel.m: (-[WebJavaScriptTextInputPanel initWithPrompt:text:]): Use the new [NSWindow sizeToFitAndAdjustWindowHeight] and [NSControl sizeToFitAndAdjustWindowHeight]. * Misc.subproj/WebNSControlExtras.h: Added. * Misc.subproj/WebNSControlExtras.m: Added. * Misc.subproj/WebNSWindowExtras.h: Added. * Misc.subproj/WebNSWindowExtras.m: Added. * WebKit.pbproj/project.pbxproj: Added above files. * English.lproj/StringsNotToBeLocalized.txt: Update. 2002-10-22 Ken Kocienda <kocienda@apple.com> * Misc.subproj/WebKitErrors.h: Add new error code to signify that a location change has been interrupted by a change in the URLPolicy governing the load. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:willSendRequest:]): Add code to check the URLPolicy for the URL in the request that is submitted to us in this delegate method. Send a locationChangeDone:forDataSource: message with an error using the newly-defined code in cases where the location change should be cancelled. 2002-10-22 Chris Blumenberg <cblu@apple.com> Added protocol headers for new plug-in API. * Plugins.subproj/WebPlugin.h: Added. * Plugins.subproj/WebPluginContainer.h: Added. * Plugins.subproj/WebPluginViewFactory.h: Added. * WebKit.pbproj/project.pbxproj: 2002-10-22 Chris Blumenberg <cblu@apple.com> - Moved things around to make room for new plug-in API. - Renamed WebNetscapePlugin to WebNetscapePluginPackage. - Renamed WebNetscapePluginDatabase to WebPluginDatabase. * Plugins.subproj/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setPluginPointer:]): * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView plugin]): * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebNetscapePluginEmbeddedView.h: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:mime:arguments:]): * Plugins.subproj/WebNetscapePluginNullEventSender.h: Added. * Plugins.subproj/WebNetscapePluginNullEventSender.m: Added. (-[WebNetscapePluginNullEventSender initWithPluginView:]): (-[WebNetscapePluginNullEventSender dealloc]): (-[WebNetscapePluginNullEventSender sendNullEvents]): (-[WebNetscapePluginNullEventSender stop]): * Plugins.subproj/WebNetscapePluginPackage.h: Added. * Plugins.subproj/WebNetscapePluginPackage.m: Added. (-[WebNetscapePluginPackage openResourceFile]): (-[WebNetscapePluginPackage closeResourceFile:]): (-[WebNetscapePluginPackage stringForStringListID:andIndex:]): (-[WebNetscapePluginPackage getPluginInfo]): (-[WebNetscapePluginPackage stringByResolvingSymlinksAndAliasesInPath:]): (-[WebNetscapePluginPackage initWithPath:]): (-[WebNetscapePluginPackage load]): (-[WebNetscapePluginPackage unload]): (-[WebNetscapePluginPackage NPP_SetWindow]): (-[WebNetscapePluginPackage NPP_New]): (-[WebNetscapePluginPackage NPP_Destroy]): (-[WebNetscapePluginPackage NPP_NewStream]): (-[WebNetscapePluginPackage NPP_StreamAsFile]): (-[WebNetscapePluginPackage NPP_DestroyStream]): (-[WebNetscapePluginPackage NPP_WriteReady]): (-[WebNetscapePluginPackage NPP_Write]): (-[WebNetscapePluginPackage NPP_HandleEvent]): (-[WebNetscapePluginPackage NPP_URLNotify]): (-[WebNetscapePluginPackage NPP_GetValue]): (-[WebNetscapePluginPackage NPP_SetValue]): (-[WebNetscapePluginPackage NPP_Print]): (-[WebNetscapePluginPackage MIMEToExtensionsDictionary]): (-[WebNetscapePluginPackage extensionToMIMEDictionary]): (-[WebNetscapePluginPackage MIMEToDescriptionDictionary]): (-[WebNetscapePluginPackage name]): (-[WebNetscapePluginPackage filename]): (-[WebNetscapePluginPackage path]): (-[WebNetscapePluginPackage isLoaded]): (-[WebNetscapePluginPackage pluginDescription]): (-[WebNetscapePluginPackage description]): (functionPointerForTVector): (tVectorForFunctionPointer): * Plugins.subproj/WebPlugin.h: Removed. * Plugins.subproj/WebPlugin.m: Removed. * Plugins.subproj/WebPluginDatabase.h: * Plugins.subproj/WebPluginDatabase.m: (+[WebPluginDatabase installedPlugins]): (-[WebPluginDatabase pluginForMIMEType:]): (-[WebPluginDatabase pluginForExtension:]): (-[WebPluginDatabase pluginForFilename:]): (-[WebPluginDatabase MIMETypes]): (-[WebPluginDatabase init]): * Plugins.subproj/WebPluginNullEventSender.h: Removed. * Plugins.subproj/WebPluginNullEventSender.m: Removed. * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]): (-[WebViewFactory pluginsInfo]): (-[WebViewFactory viewForJavaAppletWithFrame:baseURL:parameters:]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.m: (+[WebController canShowMIMEType:]): 2002-10-22 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebJavaScriptTextInputPanel.m: Added missing import. 2002-10-22 Darin Adler <darin@apple.com> - fixed 3077305 -- js dialog not yet implemented - crash (fatal error) * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory runJavaScriptTextInputPanelWithPrompt:defaultText:returningText:]): Create a WebJavaScriptTextInputPanel and run it. * English.lproj/WebJavaScriptTextInputPanel.nib: Added. * WebCoreSupport.subproj/WebJavaScriptTextInputPanel.h: Added. * WebCoreSupport.subproj/WebJavaScriptTextInputPanel.m: Added. * WebKit.pbproj/project.pbxproj: Added 2002-10-22 Chris Blumenberg <cblu@apple.com> Use the mouseDown point instead of the mouseDragged point to determine the mouseOffset when dragging images. When you drag an image now, the point where you clicked is the point where the cursor is in relation to the drag image. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDown:]): retain the mouse down event (-[WebHTMLView mouseDragged:]): use the mouse down event * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLViewPrivate dealloc]): release the mouse down event 2002-10-21 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebViewFactory.h: Changed to use new protocol scheme so we get an error if we forget to implement something. * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory runJavaScriptTextInputPanelWithPrompt:defaultText:returningText:]): Stub. 2002-10-21 Richard Williamson <rjw@apple.com> More incremental tweaks. Will be factoring common handle delegate behavior into base class. * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream handle:didReceiveData:]): (-[WebNetscapePluginStream handleDidFinishLoading:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCache:response:size:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): (-[WebSubresourceClient handle:didReceiveData:]): (-[WebSubresourceClient handleDidFinishLoading:]): * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _finsishedLoadingResourceFromDataSource:]): 2002-10-21 Trey Matteson trey@apple.com Fixed typos and other doc comment errors found during API review. * WebView.subproj/WebController.h: 2002-10-21 Richard Williamson <rjw@apple.com> Changed WebResourceLoadDelegate methods to include an identifier as first parameter. This will help clients track callbacks relating to a particular resource. Added identifierForInitialRequest:fromDataSource: so clients can create their own identifier. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCache:response:size:]): * WebCoreSupport.subproj/WebSubresourceClient.h: * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handle:willSendRequest:]): (-[WebSubresourceClient handle:didReceiveResponse:]): (-[WebSubresourceClient handle:didReceiveData:]): (-[WebSubresourceClient handleDidFinishLoading:]): (-[WebSubresourceClient handle:didFailLoadingWithError:]): * WebView.subproj/WebController.m: (-[WebResourceLoadDelegate identifierForInitialRequest:fromDataSource:]): (-[WebResourceLoadDelegate resource:willSendRequest:fromDataSource:]): (-[WebResourceLoadDelegate resource:didReceiveResponse:fromDataSource:]): (-[WebResourceLoadDelegate resource:didReceiveContentLength:fromDataSource:]): (-[WebResourceLoadDelegate resource:didFinishLoadingFromDataSource:]): (-[WebResourceLoadDelegate resource:didFailLoadingWithError:fromDataSource:]): * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:forHandle:]): (-[WebMainResourceClient handleDidFinishLoading:]): (-[WebMainResourceClient handle:willSendRequest:]): (-[WebMainResourceClient handle:didReceiveResponse:]): (-[WebMainResourceClient handle:didReceiveData:]): (-[WebMainResourceClient handle:didFailLoadingWithError:]): * WebView.subproj/WebResourceLoadDelegate.h: 2002-10-21 Chris Blumenberg <cblu@apple.com> Changed content policy API to pass a response instead of MIME type so client can get the mime type and filename from one class. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveResponse:]): 2002-10-21 Darin Adler <darin@apple.com> - fixed 3080512 -- REGRESSION: moving from old page to new one, we get blank white before the new one is ready Roll out a bunch of my changes, because they weren't complete. Added FIXMEs for the problems I was unsuccessfully trying to fix. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setState:]): * WebView.subproj/WebView.m: (-[WebView initWithFrame:]), (-[WebView isOpaque]), (-[WebView drawRect:]): Roll back. 2002-10-21 Darin Adler <darin@apple.com> - fixed 3080246 -- REGRESSION: Animated GIFs sometimes disappear after drag or scroll Once more, with feeling. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _setNeedsLayoutIfSizeChanged:]): Added setNeedsDisplay:YES here. The lack of this is what caused the bug. But also don't do any work when the size doesn't change. This prevents this from being called at all in the scrolling case, which is what we want. (-[WebHTMLView viewWillMoveToSuperview:]): Just the name change. (-[WebHTMLView layout]): Store the layout size for the above methods. * WebView.subproj/WebHTMLViewPrivate.h: Add a place to store the size. * WebView.subproj/WebImageView.m: (-[WebImageView layout]): Roll this change back in. 2002-10-21 Darin Adler <darin@apple.com> - fixed 3080246 -- REGRESSION: Animated GIFs sometimes disappear after drag or scroll * WebView.subproj/WebImageView.m: (-[WebImageView layout]): My change to this caused the regression. Not sure why, but I'll just back out because the change wasn't important. 2002-10-20 Chris Blumenberg <cblu@apple.com> Fixed: 3025847 - Can't use any menu command keys after clicking on a plugin Don't give plug-ins command-modified keys anymore because the ability wasn't worth the annoyance. If only plug-ins truthfully responded t events! Anyway, filed 3080103 so that I can look into a way to make this work for everybody. * Plugins.subproj/WebBaseNetscapePluginView.m: 2002-10-20 Chris Blumenberg <cblu@apple.com> Fixed: 3025868 - Plugin context menu disappears then reappears if you click off of it Also fixed some rare dragging weirdness in WebHTMLView. If you attempted to drag a plug-in after dragging an image, the image would drag again. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView mouseDragged:]): subclass and do nothing to prevent calling mouseDragged in WebHTMLView (-[WebBaseNetscapePluginView performKeyEquivalent:]): no changes to this method, removed menuForEvent, wasn't needed after all * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream stop]): minor clean-up 2002-10-20 Darin Adler <darin@apple.com> - fixed a minor problem with autorelease I just ran into * WebView.subproj/WebHTMLViewPrivate.m: (+[WebHTMLView load]): Create an autorelease pool for the benefit of the class initialize functions that will be called. 2002-10-20 Chris Blumenberg <cblu@apple.com> Fixed 3050010: Should show contextual menu for WebImageView Also made drags from WebImageView work. * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: added _web_setPromisedImageDragImage which does the hackery to extend the promised file drag for images * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _menuForElement:]): added, gets menu items from delegate and creates menu * WebView.subproj/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): simplified, gets element and calls -[WebController _menuForElement:] (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): call _web_setPromisedImageDragImage: when dragging image * WebView.subproj/WebImageRepresentation.h: * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation dealloc]): release the URL (-[WebImageRepresentation URL]): added so WebImageView can get the URL (-[WebImageRepresentation setDataSource:]): retain the URL * WebView.subproj/WebImageView.h: use new drag bools * WebView.subproj/WebImageView.m: (-[WebImageView initWithFrame:]): ditto (-[WebImageView setAcceptsDrags:]): ditto (-[WebImageView acceptsDrags]): ditto (-[WebImageView setAcceptsDrops:]): ditto (-[WebImageView acceptsDrops]): ditto (-[WebImageView controller]): new (-[WebImageView menuForEvent:]): new, creates element and calls -[WebController _menuForElement:] (-[WebImageView mouseDragged:]): drag promised file (-[WebImageView dragImage:at:offset:event:pasteboard:source:slideBack:]): call _web_setPromisedImageDragImage: (-[WebImageView namesOfPromisedFilesDroppedAtDestination:]): new 2002-10-20 Darin Adler <darin@apple.com> - fixed a problem where you would get garbage bits when resizing while loading a standalone image Cleaned up some of the complexity of how we were handling resizing. * WebView.subproj/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): Do the update twice to properly handle the case where a disappearing scroller makes a second scroller appear or vice versa. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setState:]): Remove the code that was trying to set the setDrawsBackground flag on the scroll view. It was doing it wrong, causing bugs with drawing non-HTML views while loading. Also, it wasn't working as an optimization, since the window was still drawing the metallic background behind. We can revisit adding an optimization at the WebHTMLView level if it creates a measurable speed increase, but we must be careful to test loading with non-HTML views along with the HTML cases. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _setNeedsLayoutToYes:]): Added. Calls setNeedsLayout:YES. (-[WebHTMLView viewWillMoveToSuperview:]): Added. Registers so we get _setNeedsLayoutToYes: calls when the superview's size changes. This allows us to do a layout at all the right times. (-[WebHTMLView layout]): Call setNeedsDisplay:YES, because if we do a layout without a complete display the screen will look bad. Also do a reapplyStyles, because if there are pending style changes we want to apply them before doing a layout since they could affect the layout. (-[WebHTMLView drawRect:]): Remove the special case that says to always relayout during live resize, because it works without a special case now. For the other live resize case, turn it from a special case into a general one. Any time layout is done, make sure to draw the entire view, not just the passed-in rectangle, and call setNeedsDisplay:NO so we don't do it all over again. * WebView.subproj/WebImageView.m: (-[WebImageView layout]): Explicitly set frame size to 0,0 when there is no image. * WebView.subproj/WebView.m: Remove now-unnecessary viewWillStartLiveResize, setFrame:, viewDidEndLiveResize, isOpaque, and drawRect overrides. (-[WebView initWithFrame:]): Don't call setDrawsBackground:NO for the reasons above. Don't set scroll bar visibility because the dynamic scroll bars view handles that already. 2002-10-19 Darin Adler <darin@apple.com> - fixed 3073693 -- flash drawn to screen even when window minimized * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView start]): Set up additional notifications. Don't start the null event sender if the window is miniaturized. (-[WebBaseNetscapePluginView windowDidMiniaturize:]): Stop the null event sender. (-[WebBaseNetscapePluginView windowDidDeminiaturize:]): Start the null event sender. 2002-10-19 Darin Adler <darin@apple.com> * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): Removed stray printf. 2002-10-18 Richard Williamson <rjw@apple.com> Changed name to setUsesBackForwardList: from setUseBackForwardList. ditto for useBackForwardList * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController setUsesBackForwardList:]): (-[WebController usesBackForwardList]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): (-[WebFrame _isLoadComplete]): Fixed history items that have "untitled" title after redirect. (3078577). * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setTitle:]): 2002-10-18 Darin Adler <darin@apple.com> * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController stringByEvaluatingJavaScriptFromString:]): Changed to return a string and changed name. 2002-10-18 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2002-10-18 Ken Kocienda <kocienda@apple.com> Removed unneeded import of WebFoundation/WebResourceLoadManager.h * Misc.subproj/WebIconLoader.m 2002-10-18 Darin Adler <darin@apple.com> * Makefile.am: Move dependency so clean happens before build. 2002-10-18 Darin Adler <darin@apple.com> * force-clean-timestamp: Dependencies don't work well enough, so we need a clean build here after the WebFoundation domain change. 2002-10-18 Darin Adler <darin@apple.com> Update for WebFoundation error domain changes. * Misc.subproj/WebKitErrors.h: Put WebErrorDomainWebKit in here. Also remove WebErrorNoError and the WebErrorCode name for the enum. * WebKit.exp: Export the WebErrorDomainWebKit constant. * WebView.subproj/WebView.m: Define the WebErrorDomainWebKit. * WebKit.pbproj/project.pbxproj: Always use WebKit.exp. * Makefile.am: Don't generate WebKit-combined.exp any more. * WebKit-tests.exp: Removed. 2002-10-17 Darin Adler <darin@apple.com> - fixed 3078644 -- Odd clipping in frame * WebView.subproj/WebClipView.h: Add hasAdditionalClip and additionalClip methods. * WebView.subproj/WebClipView.m: (-[WebClipView resetAdditionalClip]): Add an assertion. (-[WebClipView setAdditionalClip:]): Ditto. (-[WebClipView hasAdditionalClip]): Added. (-[WebClipView additionalClip]): Added. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView visibleRect]): Turn off the additional clip while computing our visibleRect. This way, the additional clip only affects people who ask for the clip view's visibleRect directly, which basically means just the focus rectangle drawing code we are trying to influence. 2002-10-17 Richard Williamson <rjw@apple.com> Support for drawing frame borders (fixes 2982466). * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _drawBorder:]): (-[WebHTMLView drawRect:]): 2002-10-17 John Sullivan <sullivan@apple.com> - added support for bookmark identifiers, to be used for marking bookmark proxies uniquely (independent of localized title). This is not the old unique-identifier scheme; now identifiers are optional, and initially nil, but the client can use them for its own purposes. * Bookmarks.subproj/WebBookmark.h: * Bookmarks.subproj/WebBookmark.m: (-[WebBookmark dealloc]): release identifier (-[WebBookmark identifier]): return identifier (-[WebBookmark setIdentifier:]): set identifier * Bookmarks.subproj/WebBookmarkLeaf.m: (-[WebBookmarkLeaf initFromDictionaryRepresentation:withGroup:]): restore identifier (-[WebBookmarkLeaf dictionaryRepresentation]): save identifier (-[WebBookmarkLeaf copyWithZone:]): copy identifier * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList initFromDictionaryRepresentation:withGroup:]): restore identifier (-[WebBookmarkList dictionaryRepresentation]): save identifier (-[WebBookmarkList copyWithZone:]): copy identifier * Bookmarks.subproj/WebBookmarkPrivate.h: * Bookmarks.subproj/WebBookmarkProxy.m: (-[WebBookmarkProxy initFromDictionaryRepresentation:withGroup:]): restore identifier (-[WebBookmarkProxy dictionaryRepresentation]): save identifier (-[WebBookmarkProxy copyWithZone:]): copy identifier === Alexander-28 === 2002-10-17 Darin Adler <darin@apple.com> - fixed 3062613 -- too many redirects at nytimes.com and apple Our cookie policy was rejecting the cookies from nytimes.com -- the policy base URL was still the news.com URL from before the redirect. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:willSendRequest:]): Update the cookie policy URL when a redirect changes the data source's URL. 2002-10-17 Darin Adler <darin@apple.com> - fixed 3077910 -- REGRESSION: download window open at startup time -> no scrollbars * WebView.subproj/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): Check for WebDocumentView protocol before making the layout method call. Prevents exception when WebDynamicScrollBarsView is used with a document that is not a WebDocumentView. 2002-10-16 Richard Williamson <rjw@apple.com> Added some drawing debug code (ifdef excluded). * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): 2002-10-16 Darin Adler <darin@apple.com> Fixed anomalies with plugin positioning caused by my switch to NSViewFocusDidChangeNotification. Turns out that is not sent during live resize, but we need things to work during live resize. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView start]): Register for changes in the bounds and frame of all superviews again, instead of using NSViewFocusDidChangeNotification. 2002-10-16 Richard Williamson <rjw@apple.com> Fixed 2969367. Ensure layout happens before doing check to determine if scrollbars are needed. Ahhh, dynamic scrollbars work so much better now. * WebView.subproj/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): 2002-10-16 Darin Adler <darin@apple.com> Fixed the problem where we would leave white bits when making the window larger. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): During live resize, use the visible rectangle after doing layout, not before. 2002-10-16 Richard Williamson <rjw@apple.com> Fixed regression in visited links due to change is semantics of [dataSource request], added [dataSource _originalRequest]. Items always need to be added to history with the original request. * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithRequest:]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _defersCallbacksChanged]): (-[WebDataSource _originalRequest]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): 2002-10-16 Darin Adler <darin@apple.com> - fixed 3017152 -- intra-page anchors not updating page address field * WebView.subproj/WebLocationChangeDelegate.h: Rearrange methods so they are in the order they are delivered. Add locationChangedWithinPageForDataSource method. Renamed the redirect methods to match the verb tenses used in the others. Removed the URL parameter from the server redirect method. * WebView.subproj/WebLocationChangeDelegate.m: Update the class to match the changes to the protocol. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportClientRedirectTo:delay:fireDate:]): Update for change to clientWillRedirectTo method name. (-[WebBridge loadURL:]): Call locationChangedWithinPageForDataSource:. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setRequest:]): Update for change to serverRedirectedForDataSource method name. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseMovedNotification:]): Remove overzealous assert that was firing for me. * WebCoreSupport.subproj/WebSubresourceClient.m: Update comment. * WebView.subproj/WebDataSource.h: Fix comment. 2002-10-15 Darin Adler <darin@apple.com> - fixed 3062393 -- need to send proper referrer for "open in new window" menu items and keyboard shortcuts * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:frameName:]): Don't take a referrer parameter any more. Get the referrer by calling to the other side of the bridge, instead. (-[WebBridge startLoadingResource:withURL:]): Ditto. (-[WebBridge loadURL:]): Ditto. (-[WebBridge postWithURL:data:contentType:]): Ditto. (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Ditto. * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate openNewWindowWithURL:]): Don't take a referrer parameter, which was always nil anyway. Instead, get the referrer from the bridge. (-[WebDefaultContextMenuDelegate openLinkInNewWindow:]): Don't pass nil for referrer. (-[WebDefaultContextMenuDelegate openImageInNewWindow:]): Ditto. (-[WebDefaultContextMenuDelegate openFrameInNewWindow:]): Ditto. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _continueAfterClickPolicyForEvent:]): Pass a referrer from the bridge, rather than nil, for both WebClickPolicyOpenNewWindow and WebClickPolicyOpenNewWindowBehind. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): Add a FIXME. 2002-10-15 Darin Adler <darin@apple.com> * WebView.subproj/WebDataSourcePrivate.h: Remove unused stuff. * WebView.subproj/WebDataSourcePrivate.m: Ditto. 2002-10-15 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadURL:referrer:]): Add a special case for when the URL is the same as the previous URL for the same frame. This relies on some logic in KHTML's openURL method that handles this case too. * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithRequest:]): Don't bother keeping an inputURL. (-[WebDataSource URL]): Just return [[self request] URL]. Maybe we can remove this altogether. * WebView.subproj/WebDataSourcePrivate.h: Remove inputURL, finalURL. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): No need to release inputURL, finalURL. (-[WebDataSource _setURL:]): Used only by the new code above. Makes a copy of the request, changes the URL, and then drops the old request. (-[WebDataSource _setRequest:]): Changed to no longer call _setURL. Now does much of the work that _setURL used to do. 2002-10-15 Darin Adler <darin@apple.com> WebKit part of improved frame name support. * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:provisionalDataSource:controller:]): Call setName on the newly created part. 2002-10-15 John Sullivan <sullivan@apple.com> - fixed 3075777 -- hysteresis for dragging links on web pages is still too large * WebView.subproj/WebHTMLView.m: changed hysteresis constants; added comment. 2002-10-15 Darin Adler <darin@apple.com> Fix problem where timer was lasting after window was closed. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _detachFromParent]): Add a call to [_private->bridge closeURL]. 2002-10-15 Richard Williamson <rjw@apple.com> Added attributed string to pasteboard. Fixes 3006760. We may want to scale back the content that is included in the attributed string. Currently all text nodes in the selection are converted. This include text nodes for non-visible content, i.e. scripts. [Note we may also want to put HTML snippet on the pboard. The appkit does support reading text using htmldisplay today. Of course this should eventually migrate to use WebView.] * WebView.subproj/WebHTMLView.m: (-[WebHTMLView copy:]): 2002-10-15 Darin Adler <darin@apple.com> Fixed bug where URLs dragged to the content area were not made canonical the way URLs dragged to the page address field are. * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_bestURL]): Make URLs canonical before returning them. 2002-10-15 Chris Blumenberg <cblu@apple.com> If a file is renamed during download because a file of the same name already exists, show this in the UI. * Misc.subproj/WebDownloadHandler.h: * Misc.subproj/WebDownloadHandler.m: (-[WebDownloadHandler receivedResponse:]): added, create file here (-[WebDownloadHandler receivedData:]): don't create file here * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidFinishLoading:]): call [dataSource _setPrimaryLoadComplete:YES] for downloads (-[WebMainResourceClient handle:didReceiveResponse:]): call [WebDownloadHandler receivedResponse:] (-[WebMainResourceClient handle:didReceiveData:]): no download error to handle 2002-10-14 Chris Blumenberg <cblu@apple.com> - Made all downloads no matter how prompted, pass through the content policy API so the client can properly choose the file name and correct the extension if necessary. We now ask for the content policy even if one has been predetermined. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _downloadURL:withContentPolicy:]): Renamed, set the predetermined content policy. * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate downloadURL:]): call [WebController _downloadURL:withContentPolicy:] * WebView.subproj/WebDefaultPolicyDelegate.m: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): call [WebController _downloadURL:withContentPolicy:] * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _continueAfterClickPolicyForEvent:]): call [WebController _downloadURL:withContentPolicy:] * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveResponse:]): ask for content policy even if one is predetermined 2002-10-14 Chris Blumenberg <cblu@apple.com> - Cleaned up download handler and download progress delegate interactions. - Got rid of error suppression junk. - Only send 1 final message to the download progress delegate * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:forHandle:]): no error suppression (-[WebMainResourceClient didCancelWithHandle:]): ignore cancel errors because 1 download error is enough (-[WebMainResourceClient handleDidFinishLoading:]): don't send the special and odd final message to the download progress delegate (-[WebMainResourceClient handle:didReceiveData:]): no error suppression (-[WebMainResourceClient handle:didFailLoadingWithError:]): ignore cancel errors because 1 download error is enough 2002-10-14 Darin Adler <darin@apple.com> * Bookmarks.subproj/WebBookmark.m: (+[WebBookmark bookmarkFromDictionaryRepresentation:withGroup:]): * Bookmarks.subproj/WebBookmarkLeaf.m: (-[WebBookmarkLeaf initFromDictionaryRepresentation:withGroup:]): * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList initFromDictionaryRepresentation:withGroup:]): * Bookmarks.subproj/WebBookmarkProxy.m: (-[WebBookmarkProxy initFromDictionaryRepresentation:withGroup:]): Add checking since we don't "trust" the dictionary passed in. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem initFromDictionaryRepresentation:]): Add FIXME about adding the checking. * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup initWithFile:]): Use copy, not retain. * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate dealloc]): Fix storage leak by releasing the default context menu delegate. * WebView.subproj/WebControllerPrivate.h: Tweak. 2002-10-14 Chris Blumenberg <cblu@apple.com> Made WebNetscapePluginStream retain a WebNetscapePluginEmbeddedView not a WebBaseNetscapePluginView. * Plugins.subproj/WebNetscapePluginStream.h: * Plugins.subproj/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:]): 2002-10-13 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Added strings from WebBookmarkProxy.m. 2002-10-13 Chris Blumenberg <cblu@apple.com> - Eliminated the dual-role behavior of WebPluginStream. Renamed WebPluginStream to WebBaseNetscapePluginStream. WebNetscapePluginRepresentation, a subclass of WebBaseNetscapePluginStream, is the document representation for standalone plug-ins. WebNetscapePluginStream, also a subclass of WebBaseNetscapePluginStream, is the general plug-in stream loader for embedded plug-ins or plug-in requested streams. 23 plug-in source files with more likely to come! * Plugins.subproj/WebBaseNetscapePluginStream.h: Added. * Plugins.subproj/WebBaseNetscapePluginStream.m: Added. (-[WebBaseNetscapePluginStream dealloc]): (-[WebBaseNetscapePluginStream setPluginPointer:]): (-[WebBaseNetscapePluginStream setResponse:]): (-[WebBaseNetscapePluginStream receivedData:]): (-[WebBaseNetscapePluginStream receivedError:]): (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView setWindow]): (-[WebBaseNetscapePluginView pluginPointer]): (-[WebBaseNetscapePluginView drawRect:]): (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): * Plugins.subproj/WebNetscapePluginDocumentView.m: * Plugins.subproj/WebNetscapePluginRepresentation.h: Added. * Plugins.subproj/WebNetscapePluginRepresentation.m: Added. (-[WebNetscapePluginRepresentation setDataSource:]): (-[WebNetscapePluginRepresentation receivedData:withDataSource:]): (-[WebNetscapePluginRepresentation receivedError:withDataSource:]): (-[WebNetscapePluginRepresentation finishedLoadingWithDataSource:]): * Plugins.subproj/WebNetscapePluginStream.h: Added. * Plugins.subproj/WebNetscapePluginStream.m: Added. (-[WebNetscapePluginStream setCurrentURL:]): (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:]): (-[WebNetscapePluginStream dealloc]): (-[WebNetscapePluginStream start]): (-[WebNetscapePluginStream stop]): (-[WebNetscapePluginStream loadEnded]): (-[WebNetscapePluginStream handle:willSendRequest:]): (-[WebNetscapePluginStream handle:didReceiveResponse:]): (-[WebNetscapePluginStream handle:didReceiveData:]): (-[WebNetscapePluginStream handleDidFinishLoading:]): (-[WebNetscapePluginStream handle:didFailLoadingWithError:]): * Plugins.subproj/WebPluginDatabase.m: (-[WebNetscapePluginDatabase init]): * Plugins.subproj/WebPluginStream.h: Removed. * Plugins.subproj/WebPluginStream.m: Removed. * WebKit.pbproj/project.pbxproj: 2002-10-11 Richard Williamson <rjw@apple.com> More DOM/attributed string work. * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation attributedStringFrom:startOffset:to:endOffset:]): * WebView.subproj/WebHTMLRepresentationPrivate.h: 2002-10-11 Richard Williamson <rjw@apple.com> * WebView.subproj/WebHTMLRepresentation.m: * WebView.subproj/WebHTMLRepresentationPrivate.h: 2002-10-11 Ken Kocienda <kocienda@apple.com> Fixed uninitialized variable build breaker I got when doing a Deployment build. * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup insertNewBookmarkAtIndex:ofBookmark:withTitle:URLString:type:]): 2002-10-11 John Sullivan <sullivan@apple.com> Added the concept of bookmark proxies; items that can be stored and displayed with other bookmarks but represent a source of bookmark-like items (e.g. Rendezvous, History) * Bookmarks.subproj/WebBookmarkProxy.h: Added. * Bookmarks.subproj/WebBookmarkProxy.m: Added. (-[WebBookmarkProxy initFromDictionaryRepresentation:withGroup:]): (-[WebBookmarkProxy dictionaryRepresentation]): (-[WebBookmarkProxy bookmarkType]): (-[WebBookmarkProxy copyWithZone:]): (-[WebBookmarkProxy title]): (-[WebBookmarkProxy setTitle:]): (-[WebBookmarkProxy icon]): New class, has a title and that's about it * Bookmarks.subproj/WebBookmark.h: * Bookmarks.subproj/WebBookmark.m: (+[WebBookmark bookmarkFromDictionaryRepresentation:withGroup:]): Handle proxy case * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup insertNewBookmarkAtIndex:ofBookmark:withTitle:URLString:type:]): Handle proxy case * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList initFromDictionaryRepresentation:withGroup:]), (-[WebBookmarkList dictionaryRepresentation]): Handle proxy case * Bookmarks.subproj/WebBookmarkPrivate.h: Add #define for proxy * WebKit.pbproj/project.pbxproj: updated for new files 2002-10-11 Chris Blumenberg <cblu@apple.com> Thought I has checking for nil enough, but not enough as I raised an exception on Avie's machine. * Plugins.subproj/WebPlugin.m: (-[WebNetscapePlugin getPluginInfo]): check for the nil extension case 2002-10-11 Darin Adler <darin@apple.com> Apply a simplified technique I learned while working on the Favorites button class in the browser code. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView start]): Use the NSViewFocusDidChangeNotification to track the plugin rectangles instead of the NSViewFrameDidChangeNotification and NSViewBoundsDidChangeNotification on all the superviews. 2002-10-11 John Sullivan <sullivan@apple.com> * Resources/url_icon.tiff: new generic URL icon -- no more @! 2002-10-10 Darin Adler <darin@apple.com> - fixed 3069366 -- REGRESSION: no pop-up window at inkfinder.com The window now pops up, but it doesn't seem to work right. But I think the window working right is a separate issue. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:willSendRequest:]): Make sure we use the copy of the request that we're keeping around when we call _setRequest on the data source, rather than the copy we're returning which can be modified by WebFoundation. Also rearrange things so we're more likely to get things right when the delegate changes the URL on the request. 2002-10-10 Chris Blumenberg <cblu@apple.com> No need to send update event when activating/deactivating. This was as old workaround for the plug-in drawing problems. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView windowBecameKey:]): (-[WebBaseNetscapePluginView windowResignedKey:]): === Alexander-27 === 2002-10-10 Darin Adler <darin@apple.com> - fixed 3071799 -- REGRESSION: hang and strange download loading about:blank Chris fixed the strange download earlier. This fixes the "hang' by making sure we commit even if we receive 0 bytes of data. * WebView.subproj/WebDataSourcePrivate.h: Added a _finishedLoading method. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _finishedLoading]): Added. Sets the "first byte of data received" flag, and calls _commitIfReady. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidFinishLoading:]): Call _finishedLoading. 2002-10-10 Darin Adler <darin@apple.com> - fixed 3072015 -- REGRESSION: frames multiply endlessly * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setFrame:]): Remove code that sets the parent from here, because it's too early, always nil. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _addChild:]): Do it here instead. 2002-10-09 Richard Williamson <rjw@apple.com> * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handleDidFinishLoading:]): * WebKit.exp: * WebView.subproj/WebController.m: (-[WebResourceLoadDelegate resourceRequest:willSendRequest:fromDataSource:]): (-[WebResourceLoadDelegate resourceRequest:didReceiveResponse:fromDataSource:]): (-[WebResourceLoadDelegate resourceRequest:didReceiveContentLength:fromDataSource:]): (-[WebResourceLoadDelegate resourceRequest:didFinishLoadingFromDataSource:]): (-[WebResourceLoadDelegate resourceRequest:didFailLoadingWithError:fromDataSource:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidFinishLoading:]): * WebView.subproj/WebResourceLoadDelegate.h: 2002-10-09 John Sullivan <sullivan@apple.com> - removed unnecessary concept of unique identifiers for bookmarks * Bookmarks.subproj/WebBookmark.h: * Bookmarks.subproj/WebBookmark.m: (-[WebBookmark dealloc]): (-[WebBookmark _setGroup:]): * Bookmarks.subproj/WebBookmarkGroup.h: * Bookmarks.subproj/WebBookmarkGroup.m: * Bookmarks.subproj/WebBookmarkGroupPrivate.h: removed all references to unique identifiers 2002-10-09 Darin Adler <darin@apple.com> WebKit support for creating windows and then showing them later after setting them up. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createWindowWithURL:referrer:frameName:]): Replaced the old openNewWindowWithURL with this. It calls the new window operations delegate method. (-[WebBridge showWindow]): Added. Calls the window operations delegate showWindow method. (-[WebBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]): Call _createFrameNamed instead of createFrameNamed. * WebView.subproj/WebWindowOperationsDelegate.h: Replaced the openNewWindowWithURL method with a new method named createWindowWithURL. Added showWindow and showWindowBehindFrontmost. * WebView.subproj/WebControllerPrivate.h: Renamed createFrameNamed to _createFrameNamed and removed the data source parameter. Added _openNewWindowWithURL:referrer:behind: for the convenience of those who used to call the window operations delegate directly to open the window. * WebView.subproj/WebControllerPrivate.m: (-[WebController _createFrameNamed:inParent:allowsScrolling:]): Renamed, and removed the data source parameter. (-[WebController _openNewWindowWithURL:referrer:behind:]): Added. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate openNewWindowWithURL:referrer:]): * WebView.subproj/WebFrame.m: (-[WebFrame frameNamed:]): * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _continueAfterClickPolicyForEvent:]): Use a private WebController method instead of calling the delegate directly, because it now takes two method calls to create and display a new window. * Misc.subproj/WebNSViewExtras.m: * WebCoreSupport.subproj/WebSubresourceClient.m: * WebView.subproj/WebController.m: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebHTMLView.m: * WebView.subproj/WebMainResourceClient.m: * WebView.subproj/WebPreferences.m: * WebView.subproj/WebView.m: * WebView.subproj/WebViewPrivate.m: Tweaked comments. 2002-10-09 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): Fix positioning of progressively loading images that are flipped. 2002-10-09 Darin Adler <darin@apple.com> - fixed 3069764 -- REGRESSION: Plug-ins sometimes don't respond to update events, causes disappearing * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView drawRect:]): Set the visible region of the port to the port bounds to work around the fact that NSWindow tries to help us by doing a BeginUpdate call. This ensures we can draw where we think we are dirty, not just where Carbon thinks we are dirty. * Plugins.subproj/WebNetscapePluginDocumentView.m: Tweak includes. * Plugins.subproj/WebNetscapePluginEmbeddedView.m: Tweak includes. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge openNewWindowWithURL:referrer:frameName:]): Tweak. * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2002-10-08 Darin Adler <darin@apple.com> Make WebFrame do the entire frame hierarchy, instead of having the parent and child pointers in the data source. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge childFrames]): Get children from the frame, not the data source. (-[WebBridge setFrame:]): Do the setParent: call on the bridge here, instead of in dataSourceChanged, since the parent relationship is now established even without having the data source. (-[WebBridge dataSourceChanged]): Remove the setParent: call. (-[WebBridge loadRequest:]): Remove the parent parameter. It's already set up at this point so we don't need to set it. (-[WebBridge loadURL:referrer:]): Don't pass a parent. (-[WebBridge postWithURL:referrer:data:contentType:]): Don't pass a parent. (-[WebBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]): Don't pass a parent. (-[WebBridge addBackForwardItemWithURL:anchor:]): Get the parent frame by just calling the parent method instead of the more roundabout way that it was doing it before. * WebView.subproj/WebController.m: (-[WebController _frameForDataSource:fromFrame:]): Get the children list from the frame, no need to ask the data source. And no need to deal with the provisional data source, since those can't have children any more. (-[WebController _frameForView:fromFrame:]): Ditto. * WebView.subproj/WebControllerPrivate.h: Change parent parameter when creating a new frame to be a frame, not a data source. * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate _clearControllerReferences:]): Get the children list from the frame. (-[WebControllerPrivate dealloc]): Rename the _reset method _controllerWillBeDeallocated to be more concrete. More simplification can happen here later. (-[WebController createFrameNamed:for:inParent:allowsScrolling:]): Call _addChild on the parent frame rather than calling addFrame on the parent data source. * WebView.subproj/WebDataSource.h: Remove the parent, children, frameNamed, frameNames, and frameExists methods. * WebView.subproj/WebDataSource.m: (-[WebDataSource controller]): Remove the assertion here about parents, since we don't have a parent pointer any more. (-[WebDataSource isLoading]): Get the list of children from the frame. * WebView.subproj/WebDataSourcePrivate.h: Remove the parent pointer and the frames dictionary, also remove the _setParent: and addFrame: methods. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): Don't release the frames list. (-[WebDataSource _recursiveStopLoading]): Get the frames list from the frame. (-[WebDataSource _layoutChildren]): Ditto. (-[WebDataSource _defersCallbacksChanged]): Ditto. * WebView.subproj/WebFrame.h: Add parent and children methods. * WebView.subproj/WebFrame.m: (-[WebFrame dealloc]): Call _detachFromParent. (-[WebFrame setProvisionalDataSource:]): Set the encoding of the data source to match the encoding of the parent's data source. This used to be done in [WebDataSource _setParent:]. Further simplification can probably be done here. (-[WebFrame reload]): Remove the call to [WebDataSource _setParent:]. (+[WebFrame _frameNamed:fromFrame:]): Get the children from the frame. (-[WebFrame frameNamed:]): Get the parent from the frame. (-[WebFrame parent]): Added. (-[WebFrame children]): Added. * WebView.subproj/WebFramePrivate.h: Added parent and children fields, changed reset to _controllerWillBeDeallocated, changed _parentDataSourceWillBeDeallocated to _detachFromParent, added _addChild method. Further simplification can probably be done here. * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate dealloc]): Release the children array. (-[WebFrame _controllerWillBeDeallocated]): Renamed from reset. Now just calls _detachFromParent. (-[WebFrame _detachFromParent]): Does all the work that reset and _parentDataSourceWillBeDeallocated used to do. (-[WebFrame _setDataSource:]): Call _detachFromParent on all the children and release them before setting up the new data source. (-[WebFrame _transitionToCommitted]): Get the parent from self instead of the data source. (-[WebFrame _isLoadComplete]): Ditto. (+[WebFrame _recursiveCheckCompleteFromFrame:]): Get the children from self instead of the data source. (-[WebFrame _textSizeMultiplierChanged]): Ditto. (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]): Remove the call to [WebDataSource _setParent:]. (-[WebFrame _addChild:]): Added. Puts the child in a children list, and also sets the override encoding of the child based on our data source's override encoding. 2002-10-08 John Sullivan <sullivan@apple.com> * WebKit.pbproj/project.pbxproj: Project Builder says I changed it only by setting "hasScannedForEncodings" to 1 -- version wars again? 2002-10-08 Richard Williamson <rjw@apple.com> Removed unnecessary (and incorrect) include. The *.m files in DOM.subproj might be removed, they are empty now. * DOM.subproj/WebDOMDocument.m: 2002-10-08 Richard Williamson <rjw@apple.com> Added selection API. * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation setSelectionFrom:startOffset:to:endOffset:]): 2002-10-08 Richard Williamson <rjw@apple.com> Add accessor for DOM document. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation DOMDocument]): 2002-10-08 Richard Williamson <rjw@apple.com> Made getAttributeNodeNamed match spec, changed to getAttributeNode. * DOM.subproj/WebDOMElement.h: 2002-10-08 John Sullivan <sullivan@apple.com> - WebKit part of fix for 3069150 -- eliminate "separator" feature from Bookmarks * Bookmarks.subproj/WebBookmarkSeparator.h: Removed. * Bookmarks.subproj/WebBookmarkSeparator.m: Removed. Removed class * Bookmarks.subproj/WebBookmark.h: * Bookmarks.subproj/WebBookmark.m: (+[WebBookmark bookmarkOfType:]): (+[WebBookmark bookmarkFromDictionaryRepresentation:withGroup:]): * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup insertNewBookmarkAtIndex:ofBookmark:withTitle:URLString:type:]): * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList initFromDictionaryRepresentation:withGroup:]): * Bookmarks.subproj/WebBookmarkPrivate.h: * English.lproj/StringsNotToBeLocalized.txt: Removed all references to class. * WebKit.pbproj/project.pbxproj: Updated for removed files. 2002-10-08 Richard Williamson <rjw@apple.com> Fixes to the DOM API. * DOM.subproj/WebDOMDocument.h: * DOM.subproj/WebDOMDocument.m: * DOM.subproj/WebDOMNode.h: * DOM.subproj/WebDOMNode.m: * DOM.subproj/WebDOMNamedNodeMap.h: Removed. * DOM.subproj/WebDOMNamedNodeMap.m: Removed. * WebKit.pbproj/project.pbxproj: 2002-10-08 Ken Kocienda <kocienda@apple.com> Use WebFrameLoadType variable to set the request cache policy for the WebResourceRequest. This will help us to provide cached results for POST requests when the user navigates using the back/forward list or history for navigation, while making sure we do not use cached results when the user pokes the submit button for a form they have submitted previously. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _goToItem:withFrameLoadType:]) 2002-10-08 Chris Blumenberg <cblu@apple.com> Moved assumption that a resource without a content type or extension is HTML to WebFoundation. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveResponse:]): 2002-10-08 Chris Blumenberg <cblu@apple.com> Minor plug-in code clean-up. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendActivateEvent:]): (-[WebBaseNetscapePluginView sendUpdateEvent]): (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream receivedData:]): 2002-10-08 Chris Blumenberg <cblu@apple.com> Partial fix for 2967073 - should open all TEXT type files, at least * WebView.subproj/WebControllerPrivate.m: (+[WebController _MIMETypeForFile:]): Sniff for HTML in the fail case. 2002-10-07 Darin Adler <darin@apple.com> WebKit part of implementation of multipart forms posting. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge postWithURL:referrer:data:contentType:]): Add a contentType parameter to match change in WebCore API. Put the contentType value into the request. 2002-10-07 Chris Blumenberg <cblu@apple.com> Icing fix for: 3063517 - crash loading .png in separate window * Plugins.subproj/WebPluginDatabase.m: (-[WebNetscapePluginDatabase init]): Don't override document view and rep types for types that have already been registered. 2002-10-07 Darin Adler <darin@apple.com> WebKit part of the page up/down fix. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView scrollPoint:]): If we are called from the handling of a page up or page down keyboard event, then ignore the specific scrolling requested, and do our idea of page up and page down. This guarantees that we will get the smarter idea of how to page from WebView instead of the one that's hardcoded into NSTextView. * WebView.subproj/WebView.m: (-[WebView keyDown:]): Use scrollPageUp:, scrollPageDown:, scrollLineUp:, and scrollLineDown: instead of _pageUp, _pageDown, _lineUp, and _lineDown. This lets other classes see and use these selectors, which is useful when passing calls up the responder chain. * WebView.subproj/WebViewPrivate.h: Remove the private methods that are being changed to match the NSResponder keyboard methods. * WebView.subproj/WebViewPrivate.m: (-[WebView scrollPageUp:]): Rename from _pageUp, and also pass a scrollPageUp: selector along the responder chain if we are already scrolled to the top. (-[WebView scrollPageDown:]): Ditto. (-[WebView scrollLineUp:]): Rename from _lineUp. (-[WebView scrollLineDown:]): Rename from _lineDown. 2002-10-07 Richard Williamson <rjw@apple.com> 'Re'play the delegate messages when an item is loaded from the WebCore cache. Note that the client will NOT receive a willSendRequest: message. The client presumably already did any request substitution before the object was loaded into the cache. Allowing the delegate to override the request and replace the object in the WebCore cache would introduce significant complexity. Fixes 3069138. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCache:response:size:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handle:didReceiveResponse:]): 2002-10-05 Darin Adler <darin@apple.com> - fixed 3068323 -- nil object inserted in dictionary exception on mouse move * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementAtPoint:]): Add some assertions in the hope of finding if my assumptions about this are wrong, and use the version of the dictionary setter that does nothing if it's passed nil when putting in the frame found by name. 2002-10-04 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Add a localization exception for the WebKit bundle identifier. 2002-10-04 Darin Adler <darin@apple.com> * Misc.subproj/WebKitLocalizableStrings.m: Added. Contains the definition of the WebKitLocalizableStringsBundle. * WebKit.pbproj/project.pbxproj: Add -DFRAMEWORK_NAME=WebKit. 2002-10-04 Richard Williamson <rjw@apple.com> Stubs for DOM level 2 core API. * DOM.subproj/WebDOMDocument.h: Added. * DOM.subproj/WebDOMDocument.m: Added. * DOM.subproj/WebDOMElement.h: Added. * DOM.subproj/WebDOMElement.m: Added. * DOM.subproj/WebDOMNamedNodeMap.h: Added. * DOM.subproj/WebDOMNamedNodeMap.m: Added. * DOM.subproj/WebDOMNode.h: Added. * DOM.subproj/WebDOMNode.m: Added. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebHTMLViewPrivate.m: tweak. 2002-10-04 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Add the last few exceptions. We now have a completely-clean run of extract-localizable-strings in WebKit! 2002-10-04 Darin Adler <darin@apple.com> - fixed 3060140 -- REGRESSION: frames of animated gif drawn in wrong position. I got the "fromRect" and "toRect" parameters backwards when I made the changes to fix bug 3050810. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer nextFrame:]): Reverse targetRect and imageRect. * WebKit.pbproj/project.pbxproj: Mark some new files as UTF-8 because Project Builder asked me to. 2002-10-04 Darin Adler <darin@apple.com> * Panels.subproj/WebPanelCookieAcceptHandler.h: Removed. * Panels.subproj/WebPanelCookieAcceptHandler.m: Removed. 2002-10-04 Richard Williamson <rjw@apple.com> Danger Will Robinson. We have to poseAsClass: as early as possible so that any NSViews will be created with the appropriate poser. This problem manifested itself with SimpleViewer failing immediately. NSViews were created by loading a nib before WebHTMLView class initialization occured. After posing the already instantiated instances of NSView had a %NSView class, causing many things to break. * WebView.subproj/WebHTMLViewPrivate.m: (+[WebHTMLView load]): 2002-10-04 Richard Williamson <rjw@apple.com> Ensure that we return non-nil request from handle:willSendRequest: even when WK's laod delegate is nil. * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handle:willSendRequest:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:willSendRequest:]): 2002-10-04 Darin Adler <darin@apple.com> * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel loadNib]): Use ERROR instead of NSLog here. (-[WebAuthenticationPanel setUpForRequest:]): Mark some strings for localization. * WebKit.pbproj/project.pbxproj: Change the encoding on a lot more files to UTF-8. * English.lproj/StringsNotToBeLocalized.txt: Added some new exceptions. * English.lproj/Localizable.strings: Re-generated. 2002-10-04 Richard Williamson <rjw@apple.com> Changed WebDOMNode name to WebDebugDOMNode to make room for real node. * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDOMNode.h: Removed. * WebView.subproj/WebDOMNode.m: Removed. 2002-10-04 Richard Williamson <rjw@apple.com> * WebKit.pbproj/project.pbxproj: 2002-10-03 Richard Williamson <rjw@apple.com> Changed name of controller's resourceProgressDelegate methods to resourceLoadDelegate. * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient initWithLoader:dataSource:]): (-[WebSubresourceClient handle:didReceiveResponse:]): (-[WebSubresourceClient handle:didReceiveData:]): (-[WebSubresourceClient handleDidFinishLoading:]): (-[WebSubresourceClient handle:didFailLoadingWithError:]): * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController setResourceLoadDelegate:]): (-[WebController resourceLoadDelegate]): (-[WebController setDownloadDelegate:]): (-[WebController downloadDelegate]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient initWithDataSource:]): (-[WebMainResourceClient handle:didReceiveResponse:]): 2002-10-03 Richard Williamson <rjw@apple.com> Always call resourceRequest:willSendRequest: on resourceProgressDelegate. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:willSendRequest:]): 2002-10-03 Richard Williamson <rjw@apple.com> Add calls to downloadProgressDelegate. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:willSendRequest:]): (-[WebMainResourceClient handle:didReceiveResponse:]): (-[WebMainResourceClient handle:didReceiveData:]): (-[WebMainResourceClient handle:didFailLoadingWithError:]): 2002-10-03 Richard Williamson <rjw@apple.com> * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCache:size:]): Hack to prevent handle creation with nil delegate, still perform frame complete check. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient initWithDataSource:]): Removed unused code. (-[WebMainResourceClient handle:willSendRequest:]): Copy the request, ugh. 2002-10-03 Darin Adler <darin@apple.com> Add API for executing JavaScript. * WebView.subproj/WebController.h: Add method. * WebView.subproj/WebController.m: (-[WebController executeJavaScriptFromString:]): Call through to WebCore to do the heavy lifting. 2002-10-03 Darin Adler <darin@apple.com> * English.lproj/Localizable.strings: Generated by the script. * English.lproj/StringsNotToBeLocalized.txt: Added many more strings to ignore. * English.lproj/WebError.strings: Removed. * WebView.subproj/WebDefaultContextMenuDelegate.m: * WebView.subproj/WebView.m: Use UI_STRING instead of NSLocalizedString. * WebKit.pbproj/project.pbxproj: Changed encodings of some files to UTF-8. Removed WebError.strings. 2002-10-03 Richard Williamson <rjw@apple.com> Renamed WebResourceProgressDelegate.h to WebResourceLoadDelegate.h * Misc.subproj/WebKit.h: * WebCoreSupport.subproj/WebSubresourceClient.m: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.m: * WebView.subproj/WebControllerPrivate.m: * WebView.subproj/WebMainResourceClient.m: * WebView.subproj/WebResourceLoadDelegate.h: * WebView.subproj/WebResourceProgressDelegate.h: Removed. 2002-10-03 Richard Williamson <rjw@apple.com> Changed to reflect new WebResourceLoadDelegate API. * Misc.subproj/WebIconLoader.m: * Misc.subproj/WebKit.h: * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream handle:didReceiveData:]): (-[WebNetscapePluginStream handleDidFinishLoading:]): (-[WebNetscapePluginStream cancel]): (-[WebNetscapePluginStream handle:didFailLoadingWithError:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCache:size:]): (-[WebBridge reportBadURL:]): * WebCoreSupport.subproj/WebSubresourceClient.h: * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient initWithLoader:dataSource:]): (-[WebSubresourceClient dealloc]): (-[WebSubresourceClient receivedProgressWithComplete:]): (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): (-[WebSubresourceClient receivedError:]): (-[WebSubresourceClient handle:willSendRequest:]): (-[WebSubresourceClient handle:didReceiveResponse:]): (-[WebSubresourceClient handle:didReceiveData:]): (-[WebSubresourceClient handleDidFinishLoading:]): (-[WebSubresourceClient handle:didFailLoadingWithError:]): (-[WebSubresourceClient cancel]): * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController setResourceProgressDelegate:]): (-[WebController resourceProgressDelegate]): (-[WebController setDownloadProgressDelegate:]): (-[WebController downloadProgressDelegate]): * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _receivedProgressForResourceHandle:fromDataSource:complete:]): (-[WebController _mainReceivedProgressForResourceHandle:bytesSoFar:fromDataSource:complete:]): (-[WebController _receivedError:forResourceHandle:fromDataSource:]): (-[WebController _mainReceivedError:forResourceHandle:fromDataSource:]): * WebView.subproj/WebLoadProgress.h: Removed. * WebView.subproj/WebLoadProgress.m: Removed. * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient initWithDataSource:]): (-[WebMainResourceClient dealloc]): (-[WebMainResourceClient receivedProgressWithHandle:complete:]): (-[WebMainResourceClient receivedError:forHandle:]): (-[WebMainResourceClient handleDidFinishLoading:]): (-[WebMainResourceClient handle:willSendRequest:]): (-[WebMainResourceClient handle:didReceiveResponse:]): (-[WebMainResourceClient handle:didReceiveData:]): (-[WebMainResourceClient handle:didFailLoadingWithError:]): * WebView.subproj/WebResourceProgressDelegate.h: === Alexander-26 === 2002-10-02 Maciej Stachowiak <mjs@apple.com> - Added "remember my password" checkbox (underlying feature not yet implemented). - Fixed a bug that caused a crash when cancelling the auth sheet. * Panels.subproj/English.lproj/WebAuthenticationPanel.nib: Added "remember this password" checkbox. * Panels.subproj/WebAuthenticationPanel.h: * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel cancel:]): Make sure the panel gets retained a bit longer, so the cleanup that happens after this message is sent can use the panel object. (-[WebAuthenticationPanel logIn:]): Make sure the panel gets retained a bit longer, so the cleanup that happens after this message is sent can use the panel object. (-[WebAuthenticationPanel runAsModalDialogWithRequest:]): Pass proper remembered value with credential. (-[WebAuthenticationPanel sheetDidEnd:returnCode:contextInfo:]): Pass proper remembered value with credential. * WebKit.pbproj/project.pbxproj: Project Builder had its way with this file. 2002-10-02 Darin Adler <darin@apple.com> Machinery so we can handle mouseover feedback at the browser level. * WebView.subproj/WebWindowOperationsDelegate.h: Added mouseDidMoveOverElement:modifierFlags:. * WebKit.exp: Export WebElementLinkTargetFrameKey. * WebView.subproj/WebController.h: Add WebElementLinkTargetFrameKey. * WebView.subproj/WebController.m: Ditto. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView removeMouseMovedObserver]): Send a callback when we stop tracking the mouse altogether. (-[WebHTMLView viewDidMoveToWindow]): Only set up the mouse moved observer if we are the top-level HTML view. (-[WebHTMLView windowDidBecomeMain:]): Ditto. (-[WebHTMLView mouseMovedNotification:]): Handle mouse over if we are over any subview of the HTML view. Also send the callback. * WebView.subproj/WebHTMLViewPrivate.h: Added lastMouseOverElementWasNotNil, _mouseOverElement:modifierFlags: and _insideAnotherHTMLView. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementAtPoint:]): Copy over each element separately so we don't rely on keys matching. Find the target frame given the target string, and include it in the dictionary. (-[WebHTMLView _mouseOverElement:modifierFlags]): Added. Calls the window operations delegate method, but doesn't call it over and over again if the information is still "nil". (-[WebHTMLView _insideAnotherHTMLView]): Added. (-[NSMutableDictionary _web_setObjectIfNotNil:forKey:]): Added. Helper for the _elementAtPoint method which could be moved to WebNSDictionaryExtras some day. 2002-10-02 Ken Kocienda <kocienda@apple.com> Implemented HTTP-specific subclass for WebResourceResponse. * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream receivedData:]): Add import for WebHTTPResourceResponse. 2002-10-02 Darin Adler <darin@apple.com> Add return value to willSendRequest callback. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader handle:willSendRequest:]): * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream handle:willSendRequest:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handle:willSendRequest:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:willSendRequest:]): Update to return the request. 2002-10-02 Darin Adler <darin@apple.com> Use the text encoding name from the response and got rid of [WebDataSource encoding]. Also remove the "first chunk" logic since we now get a separate callback for the response. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge receivedData:withDataSource:]): Get the encoding name from the response, or fall back on the default. * WebView.subproj/WebDataSource.h: Removed encoding. * WebView.subproj/WebDataSource.m: Ditto. * WebView.subproj/WebDataSourcePrivate.h: Removed _setEncoding. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): No need to release encoding any more. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient initWithDataSource:]): No isFirstChunk to initialize. (-[WebMainResourceClient handle:didReceiveResponse:]): Moved the response handling in here, including the policy logic. (-[WebMainResourceClient handle:didReceiveData:]): This has only what's left. 2002-10-02 Chris Blumenberg <cblu@apple.com> Replaced contentType on WebDataSource to response. * Plugins.subproj/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView setDataSource:]): * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream receivedData:]): (-[WebNetscapePluginStream setResponse:]): (-[WebNetscapePluginStream setDataSource:]): (-[WebNetscapePluginStream receivedData:withDataSource:]): (-[WebNetscapePluginStream handle:didReceiveResponse:]): (-[WebNetscapePluginStream handle:didReceiveData:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource response]): (-[WebDataSource fileType]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _representationClass]): (-[WebDataSource _setResponse:]): (-[WebDataSource _setContentPolicy:]): * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient dealloc]): (-[WebMainResourceClient handleDidFinishLoading:]): (-[WebMainResourceClient handle:didReceiveResponse:]): (-[WebMainResourceClient handle:didReceiveData:]): * WebView.subproj/WebTextView.m: (-[WebTextView dataSourceUpdated:]): * WebView.subproj/WebViewPrivate.m: (-[WebView _makeDocumentViewForDataSource:]): 2002-10-02 Darin Adler <darin@apple.com> More work on "open window behind". * WebView.subproj/WebControllerPolicyDelegate.h: Add new OpenNewWindowBehind constants to the enums. * WebView.subproj/WebWindowOperationsDelegate.h: Add a behind: parameter to the openNewWindowWithURL method. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _continueAfterClickPolicyForEvent:]): In the new WebClickPolicyOpenNewWindowBehind case, pass YES for behind. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge openNewWindowWithURL:referrer:frameName:]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate openNewWindowWithURL:referrer:]): * WebView.subproj/WebFrame.m: (-[WebFrame frameNamed:]): Pass NO for behind. 2002-10-02 Darin Adler <darin@apple.com> Cut down on unnecessary use of WebFoundation private stuff. * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream startLoad]): Remove unnecessary use of [WebResourceHandle _request]. * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handleDidFinishLoading:]): Remove assert about status code, since status codes are going away. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient didCancelWithHandle:]): Use currentURL for logging. (-[WebMainResourceClient handleDidFinishLoading:]): Ditto. (-[WebMainResourceClient handle:didReceiveData:]): Ditto. 2002-10-02 Darin Adler <darin@apple.com> * WebView.subproj/WebControllerPolicyDelegate.h: Change modifierMask to modifierFlags to match NSEvent. * WebView.subproj/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate clickPolicyForElement:button:modifierFlags:]): Ditto. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _continueAfterClickPolicyForEvent:]): Ditto. 2002-10-02 Darin Adler <darin@apple.com> Get rid of uses of canonicalURL. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): Start with normal URL. The change to the canonical URL will come in as a redirect. (-[WebSubresourceClient handle:didReceiveData:]): Remove assert. (-[WebSubresourceClient handleDidFinishLoading:]): Ditto. * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithRequest:]):Start with normal URL. The change to the canonical URL will come in as a redirect. 2002-10-02 Ken Kocienda <kocienda@apple.com> Added import of WebHTTPResourceRequest.h to get access to methods which have moved to the HTTP-sepcific request category. * WebView.subproj/WebDataSourcePrivate.m 2002-10-01 John Sullivan <sullivan@apple.com> * WebKit.exp: added .objc_class_name_WebTextRendererFactory so I could use it from WebBrowser. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge startLoadingResource:withURL:referrer:]): Just changed whitespace so the .exp change would be built. 2002-10-01 Chris Blumenberg <cblu@apple.com> Fixed build breakage. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView setWindow]): 2002-10-01 Ken Kocienda <kocienda@apple.com> Implemented WebResourceRequest "category" design for extending a request with protocol-specific data. * WebCoreSupport.subproj/WebBridge.m: Now imports WebHTTPResourceRequest.h. * WebCoreSupport.subproj/WebSubresourceClient.m: Ditto. * WebView.subproj/WebMainResourceClient.m: Ditto. 2002-10-01 Chris Blumenberg <cblu@apple.com> - Added debug drawing - removed unnecessary ifdef'ing. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendActivateEvent:]): (-[WebBaseNetscapePluginView becomeFirstResponder]): (-[WebBaseNetscapePluginView resignFirstResponder]): (-[WebBaseNetscapePluginView mouseDown:]): (-[WebBaseNetscapePluginView mouseUp:]): (-[WebBaseNetscapePluginView mouseEntered:]): (-[WebBaseNetscapePluginView mouseExited:]): (-[WebBaseNetscapePluginView menuForEvent:]): (-[WebBaseNetscapePluginView setWindow]): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView drawRect:]): 2002-10-01 Ken Kocienda <kocienda@apple.com> * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handleDidFinishLoading:]): Fixed Development build breakage. Call to [response statusCode] now calls the handle's private method to get the status code. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidFinishLoading:]): Ditto. (-[WebMainResourceClient handle:didReceiveData:]): Calls new textEncodingName method, replacing call to characterSet. 2002-10-01 Ken Kocienda <kocienda@apple.com> * WebView.subproj/WebLoadProgress.m: (-[WebLoadProgress initWithResourceHandle:]): Status code moved from WebResourceResponse to WebResourceHandle private API. 2002-10-01 Ken Kocienda <kocienda@apple.com> Changed WebResourceHandle so that the init method no longer starts the loading of the request to begin. Added new loadWithDelegate: method which is called separatetly from the init method, to start loads. All of the changes here update code that depends on WebResourceHandle. The changes move the code to the modified API. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]) * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream startLoad]) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCache:size:]) * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]) * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading]) 2002-10-01 Chris Blumenberg <cblu@apple.com> Fixed copyright comments. * Plugins.subproj/WebBaseNetscapePluginView.h: * Plugins.subproj/WebBaseNetscapePluginViewPrivate.h: * Plugins.subproj/WebNetscapePluginDocumentView.h: * Plugins.subproj/WebNetscapePluginDocumentView.m: * Plugins.subproj/WebNetscapePluginEmbeddedView.h: * Plugins.subproj/WebNetscapePluginEmbeddedView.m: * Plugins.subproj/WebNullPluginView.h: * Plugins.subproj/WebNullPluginView.m: * Plugins.subproj/WebPlugin.h: * Plugins.subproj/WebPlugin.m: * Plugins.subproj/WebPluginDatabase.h: * Plugins.subproj/WebPluginDatabase.m: * Plugins.subproj/WebPluginNullEventSender.h: * Plugins.subproj/WebPluginNullEventSender.m: * Plugins.subproj/WebPluginStream.h: * Plugins.subproj/WebPluginStream.m: * Plugins.subproj/npapi.h: * Plugins.subproj/npapi.m: 2002-10-01 Ken Kocienda <kocienda@apple.com> Many changes to coincide with API work in WebFoundation. Most of the modifications here have to do with changes for the new callback scheme. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader handleDidFinishLoading:]) (-[WebIconLoader handle:willSendRequest:]): New method. A no-op here. (-[WebIconLoader handle:didReceiveResponse:]): Ditto. * Plugins.subproj/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView stop]): Fix for Deployment build breakage. * Plugins.subproj/WebPluginStream.h: Add response ivar. * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream startLoad]): Tweak method name for new API. (-[WebNetscapePluginStream receivedData:withHandle:]): (-[WebNetscapePluginStream handle:willSendRequest:]): New method. Replaces old redirect callback. (-[WebNetscapePluginStream handle:didReceiveResponse:]): New method. Set the response ivar. * WebCoreSupport.subproj/WebSubresourceClient.h: Add response ivar. * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient dealloc]): Release response ivar. (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): Set the request user agent here. (-[WebSubresourceClient handle:willSendRequest:]): New method. Handle like a redirect. (-[WebSubresourceClient handle:didReceiveResponse:]): New method. Set the response ivar. (-[WebSubresourceClient handle:didReceiveData:]): Tweaks for new WebFoundation API and method names. (-[WebSubresourceClient handleDidFinishLoading:]): Ditto. (-[WebSubresourceClient handle:didFailLoadingWithError:]): Ditto. * WebView.subproj/WebControllerPrivate.m: (-[WebController _receivedError:forResourceHandle:partialProgress:fromDataSource:]): Ditto. * WebView.subproj/WebDataSourcePrivate.h: Add _setRequest method. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading]): Call didStartLoadingWithURL with request URL instead of handle URL. (-[WebDataSource _setRequest:]): Add implementation. * WebView.subproj/WebLoadProgress.m: (-[WebLoadProgress initWithResourceHandle:]): Tweaks for new WebFoundation API and method names. * WebView.subproj/WebMainResourceClient.h: Add response ivar. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient initWithDataSource:]): Set user agent on request here. (-[WebMainResourceClient dealloc]): Release response ivar. (-[WebMainResourceClient didCancelWithHandle:]): Tweaks for new WebFoundation API and method names. (-[WebMainResourceClient handleDidFinishLoading:]): Tweaks for new WebFoundation API and method names. (-[WebMainResourceClient handle:willSendRequest:]): New method. Handle like a redirect. (-[WebMainResourceClient handle:didReceiveResponse:]): New method. Set the response ivar. (-[WebMainResourceClient handle:didReceiveData:]): Tweaks for new WebFoundation API and method names. (-[WebMainResourceClient handle:didFailLoadingWithError:]): Ditto. 2002-09-30 Chris Blumenberg <cblu@apple.com> A ton o' plugin view clean-up and arch changes. Turned WebPluginView into WebBaseNetscapePluginView. New classes WebNetscapePluginEmbeddedView and WebNetscapePluginDocumentView are subclasses of WebBaseNetscapePluginView. WebNetscapePluginDocumentView ha ndles non-HTML plug-in content and WebNetscapePluginEmbeddedView is the WebHTMLView subview. Found that we leak the world on complex pages with plug-ins such as macromedia.com and marvel.com when closing the window. Still need to figure this out. * Plugins.subproj/WebBaseNetscapePluginView.h: Added. * Plugins.subproj/WebBaseNetscapePluginView.m: Added. (+[WebBaseNetscapePluginView getCarbonEvent:]): (-[WebBaseNetscapePluginView getCarbonEvent:]): (-[WebBaseNetscapePluginView modifiersForEvent:]): (-[WebBaseNetscapePluginView getCarbonEvent:withEvent:]): (-[WebBaseNetscapePluginView keyMessageForEvent:]): (-[WebBaseNetscapePluginView sendEvent:]): (-[WebBaseNetscapePluginView sendActivateEvent:]): (-[WebBaseNetscapePluginView sendUpdateEvent]): (-[WebBaseNetscapePluginView acceptsFirstResponder]): (-[WebBaseNetscapePluginView becomeFirstResponder]): (-[WebBaseNetscapePluginView resignFirstResponder]): (-[WebBaseNetscapePluginView mouseDown:]): (-[WebBaseNetscapePluginView mouseUp:]): (-[WebBaseNetscapePluginView mouseEntered:]): (-[WebBaseNetscapePluginView mouseExited:]): (-[WebBaseNetscapePluginView keyUp:]): (-[WebBaseNetscapePluginView keyDown:]): (-[WebBaseNetscapePluginView isInResponderChain]): (-[WebBaseNetscapePluginView performKeyEquivalent:]): (-[WebBaseNetscapePluginView menuForEvent:]): (-[WebBaseNetscapePluginView setUpWindowAndPort]): (-[WebBaseNetscapePluginView setWindow]): (-[WebBaseNetscapePluginView removeTrackingRect]): (-[WebBaseNetscapePluginView resetTrackingRect]): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView stop]): (-[WebBaseNetscapePluginView dataSource]): (-[WebBaseNetscapePluginView webFrame]): (-[WebBaseNetscapePluginView controller]): (-[WebBaseNetscapePluginView plugin]): (-[WebBaseNetscapePluginView setMIMEType:]): (-[WebBaseNetscapePluginView setBaseURL:]): (-[WebBaseNetscapePluginView setArguments:]): (-[WebBaseNetscapePluginView setMode:]): (-[WebBaseNetscapePluginView initWithFrame:]): (-[WebBaseNetscapePluginView dealloc]): (-[WebBaseNetscapePluginView drawRect:]): (-[WebBaseNetscapePluginView isFlipped]): (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): (-[WebBaseNetscapePluginView viewDidMoveToWindow]): (-[WebBaseNetscapePluginView viewHasMoved:]): (-[WebBaseNetscapePluginView windowWillClose:]): (-[WebBaseNetscapePluginView windowBecameKey:]): (-[WebBaseNetscapePluginView windowResignedKey:]): (-[WebBaseNetscapePluginView defaultsHaveChanged:]): (-[WebBaseNetscapePluginView frameStateChanged:]): (-[WebBaseNetscapePluginView pluginInstance]): (-[WebBaseNetscapePluginView pluginURLFromCString:]): (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]): (-[WebBaseNetscapePluginView getURLNotify:target:notifyData:]): (-[WebBaseNetscapePluginView getURL:target:]): (-[WebBaseNetscapePluginView postURLNotify:target:len:buf:file:notifyData:]): (-[WebBaseNetscapePluginView postURL:target:len:buf:file:]): (-[WebBaseNetscapePluginView newStream:target:stream:]): (-[WebBaseNetscapePluginView write:len:buffer:]): (-[WebBaseNetscapePluginView destroyStream:reason:]): (-[WebBaseNetscapePluginView status:]): (-[WebBaseNetscapePluginView invalidateRect:]): (-[WebBaseNetscapePluginView invalidateRegion:]): (-[WebBaseNetscapePluginView forceRedraw]): * Plugins.subproj/WebBaseNetscapePluginViewPrivate.h: Added. * Plugins.subproj/WebNetscapePluginDocumentView.h: Added. * Plugins.subproj/WebNetscapePluginDocumentView.m: Added. (-[WebNetscapePluginDocumentView initWithFrame:]): (-[WebNetscapePluginDocumentView dealloc]): (-[WebNetscapePluginDocumentView drawRect:]): (-[WebNetscapePluginDocumentView dataSource]): (-[WebNetscapePluginDocumentView setDataSource:]): (-[WebNetscapePluginDocumentView dataSourceUpdated:]): (-[WebNetscapePluginDocumentView setNeedsLayout:]): (-[WebNetscapePluginDocumentView layout]): * Plugins.subproj/WebNetscapePluginEmbeddedView.h: Added. * Plugins.subproj/WebNetscapePluginEmbeddedView.m: Added. (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:mime:arguments:]): (-[WebNetscapePluginEmbeddedView dealloc]): (-[WebNetscapePluginEmbeddedView viewDidMoveToWindow]): (-[WebNetscapePluginEmbeddedView start]): (-[WebNetscapePluginEmbeddedView dataSource]): * Plugins.subproj/WebNetscapePluginViewPrivate.h: Removed. * Plugins.subproj/WebPluginDatabase.m: (-[WebNetscapePluginDatabase init]): * Plugins.subproj/WebPluginNullEventSender.h: * Plugins.subproj/WebPluginNullEventSender.m: (-[WebNetscapePluginNullEventSender initWithPluginView:]): (-[WebNetscapePluginNullEventSender sendNullEvents]): * Plugins.subproj/WebPluginStream.h: * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream getFunctionPointersFromPluginView:]): (-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:]): (-[WebNetscapePluginStream dealloc]): (-[WebNetscapePluginStream startLoad]): (-[WebNetscapePluginStream receivedData:withDataSource:]): (-[WebNetscapePluginStream handleWillUseUserAgent:forURL:]): (-[WebNetscapePluginStream handle:didReceiveData:]): (-[WebNetscapePluginStream handleDidFinishLoading:]): (-[WebNetscapePluginStream cancel]): (-[WebNetscapePluginStream handle:didFailLoadingWithError:]): (-[WebNetscapePluginStream handleDidRedirect:toURL:]): * Plugins.subproj/WebPluginView.h: Removed. * Plugins.subproj/WebPluginView.m: Removed. * Plugins.subproj/npapi.m: (NPN_GetURLNotify): (NPN_GetURL): (NPN_PostURLNotify): (NPN_PostURL): (NPN_NewStream): (NPN_Write): (NPN_DestroyStream): (NPN_Status): (NPN_InvalidateRect): (NPN_InvalidateRegion): (NPN_ForceRedraw): * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]): (-[WebViewFactory viewForJavaAppletWithFrame:baseURL:parameters:]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebHTMLViewPrivate.m: (-[NSView _web_stopIfPluginView]): 2002-09-30 Darin Adler <darin@apple.com> * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithRequest:]): Remove the ill-advised "don't even create a WebDataSource if WebResourceHandle can't handle this request" code. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading]): Rearrange checks so we won't get confused if we can't create a handle. 2002-09-30 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Added. 2002-09-30 Darin Adler <darin@apple.com> - fixed crashing part of 3063517 -- crash loading .png in separate window * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView start]): Don't try to start if the NPP_New is 0. This indicates the the plugin hasn't been loaded. 2002-09-30 Darin Adler <darin@apple.com> * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setLoading:]): Remove extra quotes in use of ASSERT_ARG. 2002-09-29 Darin Adler <darin@apple.com> * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _iconForFileURL:withSize:]): Don't be case sensitive about filename extensions. * Misc.subproj/WebDownloadHandler.m: * Misc.subproj/WebIconLoader.m: * Plugins.subproj/WebPluginStream.m: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDefaultContextMenuDelegate.m: * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebView.m: Don't use WebFoundation.h -- faster building to just import what we really use. 2002-09-29 Chris Blumenberg <cblu@apple.com> Fixed: 2978258 - quake3arena.com sends me to the flash=false site The page has a flash plugin that once loaded, requests the flash=true page. If the plugin doesn't load, the meta refresh tag to the flash=false page fires after 3 seconds. This is how this site's flash detection works. The reason this doesn't work for us is because the flash movie is at the bottom of the page. Plugins don't start until the initial drawRect. Since the movie is at the bottom of the page and out of site, the plugin never gets the drawRect and thus, never starts. We now start plug-ins when they are added to the window. Fixed: 3062224 - context menu includes "Download Item to Disk" for mailto links - Fixed click then click and drag causes crash. * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView drawRect:]): don't start plug-in here (-[WebNetscapePluginView viewDidMoveToWindow]): start it here * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate contextMenuItemsForElement:defaultMenuItems:]): don't provide "Download Link To Disk" and "Open Link In New Window" items for URLs we cant handle. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): clean-up (-[WebHTMLView mouseDragged:]): Don't allow drag if the frame has a provisional data source because this view may be released and the drag callbacks might reference this released view. 2002-09-28 Darin Adler <darin@apple.com> * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithRequest:]): Catch a request that we can't use here instead of failing later. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading]): Added an assert so the failure was less confusing; good idea to leave it in. 2002-09-28 Chris Blumenberg <cblu@apple.com> Support for latest Flash plug-in. It requests a javascript URL for every plug-in instance. Until javascript URLs work, we return an error to the plug-in. Fixed: 3035582 - flash animations don't work after upgrading flash Fixed: 3021936 - links in flash at foggypetronasracing.com doesn't work * Plugins.subproj/WebPluginStream.h: * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:]): Make the request here and return nil if we can't create a handle with it. (-[WebNetscapePluginStream dealloc]): release the request (-[WebNetscapePluginStream startLoad]): use the request when creating the handle 2002-09-28 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setNeedsLayout]): Added. 2002-09-27 Chris Blumenberg <cblu@apple.com> Fixed KJS crasher caused by nil plug-in returned from WebPlugin. Got the RealPlayer plug-in loaded, nothing playing yet. * Plugins.subproj/WebPlugin.m: (-[WebNetscapePlugin getPluginInfo]): check for nil plug-in names/descriptions (-[WebNetscapePlugin stringByResolvingSymlinksAndAliasesInPath:]): new, resolves old-style aliases (-[WebNetscapePlugin initWithPath:]): call stringByResolvingSymlinksAndAliasesInPath 2002-09-27 Richard Williamson <rjw@apple.com> Fix 3058315: crash in WebHTMLRepresentation receivedData:withDataSource http://www.u2.com/lite/ does some whacky things with its framset's onLoad handler. The fix ensures that data isn't sent to the bridge once the bridge has been dealloced. * WebKit.pbproj/project.pbxproj: Nothing changed. PB dorkiness. * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation receivedData:withDataSource:]): 2002-09-27 Chris Blumenberg <cblu@apple.com> Fixed: 3056559 - QT plugin doesn't load Fixed: 3042850 - Enable Java by default Cleaned up WebPlugin and WebPluginDatabase. * Plugins.subproj/WebPlugin.h: * Plugins.subproj/WebPlugin.m: (-[WebNetscapePlugin openResourceFile]): (-[WebNetscapePlugin closeResourceFile:]): (-[WebNetscapePlugin stringForStringListID:andIndex:]): (-[WebNetscapePlugin getPluginInfo]): (-[WebNetscapePlugin initWithPath:]): (-[WebNetscapePlugin load]): (-[WebNetscapePlugin unload]): (-[WebNetscapePlugin MIMEToExtensionsDictionary]): (-[WebNetscapePlugin extensionToMIMEDictionary]): (-[WebNetscapePlugin MIMEToDescriptionDictionary]): (-[WebNetscapePlugin description]): * Plugins.subproj/WebPluginDatabase.h: * Plugins.subproj/WebPluginDatabase.m: (-[WebNetscapePluginDatabase pluginForMIMEType:]): (-[WebNetscapePluginDatabase pluginForExtension:]): (-[WebNetscapePluginDatabase pluginForFilename:]): (-[WebNetscapePluginDatabase MIMETypes]): (-[WebNetscapePluginDatabase init]): * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView setDataSource:]): * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]): (-[WebViewFactory viewForJavaAppletWithFrame:baseURL:parameters:]): * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): Enable Java by default 2002-09-27 Richard Williamson <rjw@apple.com> Fixed 3060158: REGRESSION: iframes added to session history Also moved setting title in history to WebKit. * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: (+[WebHistory sharedHistory]): (+[WebHistory webHistoryWithFile:]): (-[WebHistory addEntryForURL:]): (-[WebHistory addEntries:]): * History.subproj/WebHistoryPrivate.h: * History.subproj/WebHistoryPrivate.m: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge requestedURL]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setTitle:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): 2002-09-26 Richard Williamson <rjw@apple.com> More twiddling. Changed the color of the drag labels to match the favorites bar. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): 2002-09-27 Chris Blumenberg <cblu@apple.com> Added support for dragging links the the dock. Created new pasteboard types WebURLPboardType WebURLNamePboardType that the dock requires. * Misc.subproj/WebNSPasteboardExtras.h: * Misc.subproj/WebNSPasteboardExtras.m: (+[NSPasteboard initialize]): set WebURLPboardType and WebURLNamePboardType (-[NSPasteboard _web_writeURL:andTitle:withOwner:]): use WebURLPboardType and WebURLNamePboardType * WebKit.exp: export WebURLPboardType and WebURLNamePboardType 2002-09-27 Maciej Stachowiak <mjs@apple.com> * Panels.subproj/WebAuthenticationPanel.m: (-[WebAuthenticationPanel setUpForRequest:]): (-[WebAuthenticationPanel runAsModalDialogWithRequest:]): (-[WebAuthenticationPanel sheetDidEnd:returnCode:contextInfo:]): * Panels.subproj/WebPanelAuthenticationHandler.h: * Panels.subproj/WebPanelAuthenticationHandler.m: (-[WebPanelAuthenticationHandler isReadyToStartAuthentication:]): (-[WebPanelAuthenticationHandler startAuthentication:]): (-[WebPanelAuthenticationHandler _authenticationDoneWithRequest:result:]): 2002-09-26 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge receivedData:withDataSource:]): Use NSString for encoding. * WebView.subproj/WebController.h: Update names to use separate boolean for user agent and strings for text encodings instead of CFStringEncoding. * WebView.subproj/WebController.m: (-[WebController setCustomUserAgent:]): Name change. (-[WebController resetUserAgent]): Added. (-[WebController hasCustomUserAgent]): Added. (-[WebController customUserAgent]): Name change. (-[WebController setCustomTextEncodingName:]): Take NSString. (-[WebController resetTextEncoding]): Update for NSString. (-[WebController _mainFrameOverrideEncoding]): Ditto. (-[WebController hasCustomTextEncoding]): Ditto. (-[WebController customTextEncodingName]): Return NSString. * WebView.subproj/WebDataSourcePrivate.h: Use NSString instead of CFStringEncoding. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate init]): No need to init. (-[WebDataSource _setContentType:]): Copy, don't retain. (-[WebDataSource _setEncoding:]): Copy, don't retain. (-[WebDataSource _setOverrideEncoding:]): Use NSString. (-[WebDataSource _overrideEncoding]): Use NSString. * WebView.subproj/WebFramePrivate.h: Use NSString. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]): Use NSString. * WebView.subproj/WebPreferences.h: Use NSString instead of CFStringEncoding. * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): Use NSString. (-[WebPreferences defaultTextEncodingName]): Use NSString. (-[WebPreferences setDefaultTextEncodingName:]): Use NSString. 2002-09-26 Chris Blumenberg <cblu@apple.com> Made WebTextView super-private. * WebKit.pbproj/project.pbxproj: 2002-09-26 Richard Williamson <rjw@apple.com> Use a rectangle with rounded corners for dragged label. Put a subtle shadow behind text in label. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): 2002-09-26 Chris Blumenberg <cblu@apple.com> - When dragging an image, use the image itself for the drag image - Support promised file and image data drag types for dragged images. * Misc.subproj/WebNSImageExtras.h: Added. * Misc.subproj/WebNSImageExtras.m: Added. (-[NSImage _web_scaleToMaxSize:]): new, scales an image is greater than max (-[NSImage _web_dissolveToFraction:]): new, dissolves image in place * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.h: Added WebElementImageLocationKey to the element dictionary * WebView.subproj/WebController.m: ditto * WebView.subproj/WebHTMLView.m: (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): subclassed for only for image drags (-[WebHTMLView mouseDragged:]): use the promised file api again. (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): use the retained element dictionary instead of the dragged URL which I deleted. * WebView.subproj/WebHTMLViewPrivate.h: === Alexander-25 === 2002-09-25 Richard Williamson <rjw@apple.com> API tweaks. * Misc.subproj/WebKit.h: Added headers. * Misc.subproj/WebKitErrors.h: Removed #defines. * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading]): (-[WebDataSource _loadIcon]): * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate contextMenuItemsForElement:defaultMenuItems:]): Removed isMainDocument. Moved errors string #defines here. * WebView.subproj/WebView.m: 2002-09-25 John Sullivan <sullivan@apple.com> - fixed 3060773 -- Wrong title proposed when image link dropped on favorites bar * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): Claim the pasteboard (via declareTypes:) before putting data on it. 2002-09-25 Richard Williamson <rjw@apple.com> API and documentation tweaks. WebDocumentDragSettings: canDrag -> acceptsDrag WebDataSource: removed originalURL WebStandardPanels: use -> uses * History.subproj/WebBackForwardList.h: * Misc.subproj/WebDownloadHandler.m: (-[WebDownloadHandler initWithDataSource:]): * Panels.subproj/WebStandardPanels.h: * Panels.subproj/WebStandardPanels.m: (-[WebStandardPanels setUsesStandardAuthenticationPanel:]): (-[WebStandardPanels usesStandardAuthenticationPanel]): * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView frameStateChanged:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient cancel]): * WebView.subproj/WebController.h: * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady]): * WebView.subproj/WebDocument.h: * WebView.subproj/WebFrame.m: (-[WebFrame setProvisionalDataSource:]): (-[WebFrame startLoading]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): (-[WebFrame _setState:]): (-[WebFrame _goToItem:withFrameLoadType:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView setAcceptsDrags:]): (-[WebHTMLView acceptsDrags]): (-[WebHTMLView setAcceptsDrops:]): (-[WebHTMLView acceptsDrops]): * WebView.subproj/WebImageView.m: (-[WebImageView setAcceptsDrags:]): (-[WebImageView acceptsDrags]): (-[WebImageView setAcceptsDrops:]): (-[WebImageView acceptsDrops]): * WebView.subproj/WebLoadProgress.h: * WebView.subproj/WebLocationChangeDelegate.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient didCancelWithHandle:]): * WebView.subproj/WebView.h: 2002-09-25 Ken Kocienda <kocienda@apple.com> Changes to move the WebResourceHandle API closer to the specified design. This includes: - Removed loadInBackground method from the public interface. - Start asynchronous loading in WebResourceHandle init method. This required some code reorganization in callers. - Remove loadInForeground: from WebResourceHandle interface. - Move WebResourceHandle callback deferral methods to SPI header file. - Change name of WebResourceHandle cancelLoadInBackground method to cancel. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]) (-[WebIconLoader stopLoading]) * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream startLoad]) (-[WebNetscapePluginStream cancel]) * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]) (-[WebSubresourceClient cancel]) * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading]) (-[WebDataSource _addSubresourceClient:]) (-[WebDataSource _stopLoading]) (-[WebDataSource _defersCallbacksChanged]) * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveData:]) 2002-09-25 Chris Blumenberg <cblu@apple.com> Fixed: 3050665 - REGRESSION: mp3 audio loads and plays, but no progress or play control is visible * Plugins.subproj/WebPluginView.h: * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView setNeedsLayout:]): (-[WebNetscapePluginView layout]): (-[WebNetscapePluginView drawRect:]): 2002-09-25 Darin Adler <darin@apple.com> Make the "set aside subviews" logic stronger so it can handle a display while inside drawRect. But note, this recursive display is most likely the cause of the redrawing problems we have while resizing, like bug 2969367. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): Restore views and then set them aside again, but don't leave the "views set aside" boolean set. * WebView.subproj/WebHTMLViewPrivate.h: Add private _setAsideSubviews and _restoreSubviews methods. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _setAsideSubviews]): Added. (-[WebHTMLView _restoreSubviews]): Added. (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]): Use the new _setAsideSubviews and _restoreSubviews methods. (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): Ditto. 2002-09-25 Ken Kocienda <kocienda@apple.com> Removed this method from WebResourceHandle: +(BOOL)canInitWithURL:(NSURL *)theURL; replaced with: +(BOOL)canInitWithRequest:(WebResourceRequest *)request; Callers have been updated to reflect the change. * WebView.subproj/WebDefaultPolicyDelegate.m: (+[WebDefaultPolicyDelegate defaultURLPolicyForURL:]) * WebView.subproj/WebFramePrivate.m: (-[WebFrame _shouldShowURL:]) 2002-09-25 Ken Kocienda <kocienda@apple.com> More moves to the new WebResourceHandleDelegate API. This change moves all WebResourceHandleDelegate implementors to: -(void)handle:(WebResourceHandle *)handle didReceiveData:(NSData *)data; * Misc.subproj/WebIconLoader.m: (-[WebIconLoader handle:didReceiveData:]) * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream handle:didReceiveData:]) * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handle:didReceiveData:]) * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didReceiveData:]) 2002-09-25 Ken Kocienda <kocienda@apple.com> Moving to the new WebResourceHandleDelegate API. This change moves all WebResourceHandleDelegate implementors to: - (void)handle:(WebResourceHandle *)handle didFailLoadingWithError:(WebError *)result; * Misc.subproj/WebIconLoader.m: (-[WebIconLoader handle:didFailLoadingWithError:]) * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream handle:didFailLoadingWithError:]) * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handle:didFailLoadingWithError:]) * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handle:didFailLoadingWithError:]) 2002-09-25 Ken Kocienda <kocienda@apple.com> Begin change from WebResourceClient to WebResourceHandleDelegate. In this step, I have just changed the name of the protocol; the protocol interface is the same. I made other cosmetic changes to variable names and such. * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]) * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream startLoad]) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCache:size:]) * WebCoreSupport.subproj/WebSubresourceClient.h: * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]) * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading]) * WebView.subproj/WebMainResourceClient.h: 2002-09-25 Maciej Stachowiak <mjs@apple.com> - fixed 2854536 - New cookie policy: "accept cookies only from the same domain as the main page" * WebCoreSupport.subproj/WebCookieAdapter.h: * WebCoreSupport.subproj/WebCookieAdapter.m: (-[WebCookieAdapter setCookies:forURL:policyBaseURL:]): * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): (-[WebSubresourceClient handleDidRedirect:toURL:]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidRedirect:toURL:]): 2002-09-24 Richard Williamson <rjw@apple.com> More documentation tweaks. * History.subproj/WebHistory.h: * History.subproj/WebHistoryItem.h: * WebView.subproj/WebContextMenuDelegate.h: * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebLocationChangeDelegate.h: * WebView.subproj/WebResourceProgressDelegate.h: 2002-09-24 Darin Adler <darin@apple.com> - fixed 3059513 -- REGRESSION: Scrolling to fragment doesn't work Turns out it was better to just put the extra smarts into the clip view that we are already creating. Making WebHTMLView be a second clip view was silly and broke things. * WebView.subproj/WebView.m: (-[WebView initWithFrame:]): Create a WebClipView and use it as the content view rather than the NSClipView created by default. * WebKit.pbproj/project.pbxproj: Added WebClipView. * WebView.subproj/WebClipView.h: Added. * WebView.subproj/WebClipView.m: Added. * WebView.subproj/WebHTMLView.h: Don't be a subclass of NSClipView any more. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): Call setAdditionalClip and resetAdditionalClip on the clip view. * WebView.subproj/WebHTMLViewPrivate.h: Remove inDrawRect and drawRect. * WebView.subproj/WebHTMLViewPrivate.m: Remove visibleRect override. This is now in WebClipView. 2002-09-24 Chris Blumenberg <cblu@apple.com> More documentation changes. * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebDefaultContextMenuDelegate.h: * WebView.subproj/WebDocument.h: 2002-09-24 Richard Williamson <rjw@apple.com> Added FIXME note about unresolved issue with CFStringEncoding/NSStringEncoding. * WebView.subproj/WebController.h: 2002-09-24 Richard Williamson <rjw@apple.com> Documentation for WebDataSource and WebFrame. * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource frameExists:]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource addFrame:]): * WebView.subproj/WebFrame.h: 2002-09-24 Darin Adler <darin@apple.com> - fixed 3059266 -- REGRESSION: clicking in web view when location field is focused does not focus web view * WebView.subproj/WebHTMLView.m: (-[WebHTMLView needsPanelToBecomeKey]): Must override this to return YES, because NSClipView makes it return NO even though we accept the first responder. 2002-09-24 John Sullivan <sullivan@apple.com> - fixed 3056158 -- REGRESSION: Page up/down should scroll one whole contentView minus at least one readable line of text This was broken a while back when the keyboard scrolling code migrated into WebKit. * WebView.subproj/WebViewPrivate.m: (-[WebView _verticalKeyboardScrollAmount]), (-[WebView _horizontalKeyboardScrollAmount]): New private methods, return one arrow key's worth of scrolling. (-[WebView _scrollLineVertically:]), (-[WebView _scrollLineHorizontally:]): Now use the broken-out methods. (-[WebView _pageVertically:]), (-[WebView _pageHorizontally:]): overlap by one arrow key's worth of scrolling instead of the teensy-weensy one click's worth. 2002-09-24 Chris Blumenberg <cblu@apple.com> Documentation for WebHTMLView * WebView.subproj/WebHTMLView.h: 2002-09-24 Richard Williamson <rjw@apple.com> Documentation changes. Removal of imports from some headers required modification of .m. * Plugins.subproj/WebNullPluginView.m: * WebCoreSupport.subproj/WebBridge.m: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebDefaultPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: (+[WebDefaultPolicyDelegate defaultURLPolicyForURL:]): (-[WebDefaultPolicyDelegate URLPolicyForURL:inFrame:]): * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebHTMLViewPrivate.m: 2002-09-24 Chris Blumenberg <cblu@apple.com> Renamed element info keys to WebElement* instead of WebContextMenuElement* Added WebKit API documentation * Plugins.subproj/WebPlugin.m: (-[WebNetscapePlugin load]): clean-up * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebContextMenuDelegate.h: * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: * WebView.subproj/WebControllerPolicyDelegate.h: * WebView.subproj/WebDefaultContextMenuDelegate.h: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate contextMenuItemsForElement:defaultMenuItems:]): (-[WebDefaultContextMenuDelegate openNewWindowWithURL:referrer:]): (-[WebDefaultContextMenuDelegate downloadURL:]): (-[WebDefaultContextMenuDelegate openLinkInNewWindow:]): (-[WebDefaultContextMenuDelegate downloadLinkToDisk:]): (-[WebDefaultContextMenuDelegate copyLinkToClipboard:]): (-[WebDefaultContextMenuDelegate openImageInNewWindow:]): (-[WebDefaultContextMenuDelegate downloadImageToDisk:]): (-[WebDefaultContextMenuDelegate copyImageToClipboard:]): (-[WebDefaultContextMenuDelegate openFrameInNewWindow:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementAtPoint:]): 2002-09-24 Darin Adler <darin@apple.com> Cleaned up some loose ends from adding setNeedsLayout to the WebDocumentView protocol. Was causing exceptions. * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView setNeedsLayout:]): * WebView.subproj/WebTextView.m: (-[WebTextView setNeedsLayout:]): Added missing stubs. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setNeedsReapplyStyles]): Removed unneeded cast. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _isLoadComplete]): Remove an unneeded cast and call to isDocumentHTML. * WebView.subproj/WebHTMLView.h: No need to re-declare setNeedsLayout. * WebView.subproj/WebView.m: (-[WebView setFrame:]): Get rid of unneeded check of isDocumentHTML. 2002-09-24 Darin Adler <darin@apple.com> - fixed 3057383 -- focus rectangles are being drawn multiple times - fixed 3051025 -- focus ring on password field gets darker and darker To make focus rings clip too, we have to do more than just set the clip. We also have to set the visible rectangle to make clipping happen, and we need to be a subclass of NSClipView so that the focus ring drawing code will consult us rather than one of our superviews. * WebView.subproj/WebHTMLView.h: Be a subclass of NSClipView. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): Set a inDrawRect flag, and a drawRect rectangle. This tells us to clip to this rectangle. what we need to clip to. * WebView.subproj/WebHTMLViewPrivate.h: Added inDrawRect and drawRect. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView visibleRect]): Clip the visible rect based on the drawRect while inDrawRect is set. 2002-09-23 Chris Blumenberg <cblu@apple.com> Factored URL pasteboard initialization to 1 place. Fixed: 3048924 - regression: drag & drop broken for initial empty page Fixed: 3045997 - Dragging a link from one Alex window to another one doesn't work * Misc.subproj/WebNSPasteboardExtras.h: * Misc.subproj/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeURL:andTitle:withOwner:]): new * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate copyLinkToClipboard:]): call -[NSPasteboard _web_writeURL:andTitle:withOwner:] * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): call -[NSPasteboard _web_writeURL:andTitle:withOwner:] * WebView.subproj/WebView.m: (-[WebView draggingEntered:]): handle nil cases 2002-09-23 Maciej Stachowiak <mjs@apple.com> Added documentation for these two delegate protocols. * WebView.subproj/WebLocationChangeDelegate.h: * WebView.subproj/WebResourceProgressDelegate.h: 2002-09-23 Richard Williamson <rjw@apple.com> Made WebIconLoader and WebIconDatabase SPI. * WebKit.pbproj/project.pbxproj: 2002-09-23 Richard Williamson <rjw@apple.com> WebContextMenuHandler becomes WebContextMenuDelegate WebControllerPolicyHandler becomes WebControllerPolicyDelegate WebLocationChangeHandler becomes WebLocationChangeDelegate WebResourceProgressHandler becomes WebResourceProgressDelegate WebWindowContext becomes WebWindowOperationsDelegate * Misc.subproj/WebDownloadHandler.m: * Plugins.subproj/WebNullPluginView.m: (-[WebNullPluginView drawRect:]): * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView loadRequest:inTarget:withNotifyData:]): (-[WebNetscapePluginView status:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge openNewWindowWithURL:referrer:frameName:]): (-[WebBridge areToolbarsVisible]): (-[WebBridge setToolbarsVisible:]): (-[WebBridge isStatusBarVisible]): (-[WebBridge setStatusBarVisible:]): (-[WebBridge setWindowFrame:]): (-[WebBridge window]): (-[WebBridge setStatusText:]): (-[WebBridge reportClientRedirectTo:delay:fireDate:]): (-[WebBridge reportClientRedirectCancelled]): * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebContextMenuDelegate.h: * WebView.subproj/WebContextMenuHandler.h: Removed. * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController setWindowOperationsDelegate:]): (-[WebController windowOperationsDelegate]): (-[WebController setResourceProgressDelegate:]): (-[WebController resourceProgressDelegate]): (-[WebController setDownloadProgressDelegate:]): (-[WebController downloadProgressDelegate]): (-[WebController setContextMenuDelegate:]): (-[WebController contextMenuDelegate]): (-[WebController setPolicyDelegate:]): (-[WebController policyDelegate]): (-[WebController setLocationChangeDelegate:]): (-[WebController locationChangeDelegate]): * WebView.subproj/WebControllerPolicyDelegate.m: Added. (-[WebPolicyPrivate dealloc]): (-[WebPolicy _setPolicyAction:]): (-[WebPolicy policyAction]): (-[WebPolicy path]): (-[WebPolicy URL]): (-[WebPolicy _setPath:]): (-[WebPolicy dealloc]): (+[WebURLPolicy webPolicyWithURLAction:]): (+[WebFileURLPolicy webPolicyWithFileAction:]): (+[WebContentPolicy webPolicyWithContentAction:andPath:]): * WebView.subproj/WebControllerPolicyDelegatePrivate.h: * WebView.subproj/WebControllerPolicyHandler.h: Removed. * WebView.subproj/WebControllerPolicyHandler.m: Removed. * WebView.subproj/WebControllerPolicyHandlerPrivate.h: Removed. * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate init]): (-[WebControllerPrivate dealloc]): (-[WebController _defaultContextMenuDelegate]): (-[WebController _receivedProgress:forResourceHandle:fromDataSource:complete:]): (-[WebController _mainReceivedProgress:forResourceHandle:fromDataSource:complete:]): (-[WebController _receivedError:forResourceHandle:partialProgress:fromDataSource:]): (-[WebController _mainReceivedError:forResourceHandle:partialProgress:fromDataSource:]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading]): (-[WebDataSource _setTitle:]): (-[WebDataSource _setURL:]): (-[WebDataSource _loadIcon]): * WebView.subproj/WebDefaultContextMenuDelegate.h: * WebView.subproj/WebDefaultContextMenuDelegate.m: (-[WebDefaultContextMenuDelegate openNewWindowWithURL:referrer:]): (-[WebDefaultContextMenuDelegate downloadURL:]): * WebView.subproj/WebDefaultContextMenuHandler.h: Removed. * WebView.subproj/WebDefaultContextMenuHandler.m: Removed. * WebView.subproj/WebDefaultPolicyDelegate.h: * WebView.subproj/WebDefaultPolicyDelegate.m: * WebView.subproj/WebDefaultPolicyHandler.h: Removed. * WebView.subproj/WebDefaultPolicyHandler.m: Removed. * WebView.subproj/WebDocument.h: * WebView.subproj/WebFrame.m: (-[WebFrame setProvisionalDataSource:]): (-[WebFrame frameNamed:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _timedLayout:]): (-[WebFrame _transitionToCommitted]): (-[WebFrame _isLoadComplete]): (-[WebFrame handleUnimplementablePolicy:errorCode:forURL:]): (-[WebFrame _shouldShowURL:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _continueAfterClickPolicyForEvent:]): * WebView.subproj/WebImageView.m: (-[WebImageView setNeedsLayout:]): * WebView.subproj/WebLocationChangeDelegate.h: * WebView.subproj/WebLocationChangeDelegate.m: * WebView.subproj/WebLocationChangeHandler.h: Removed. * WebView.subproj/WebLocationChangeHandler.m: Removed. * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient dealloc]): (-[WebMainResourceClient receivedProgressWithHandle:complete:]): (-[WebMainResourceClient receivedError:forHandle:]): (-[WebMainResourceClient handleDidReceiveData:data:]): * WebView.subproj/WebResourceProgressDelegate.h: * WebView.subproj/WebResourceProgressHandler.h: Removed. * WebView.subproj/WebView.m: (-[WebView window]): * WebView.subproj/WebWindowContext.h: Removed. * WebView.subproj/WebWindowOperationsDelegate.h: 2002-09-23 Darin Adler <darin@apple.com> - fixed 3052543 -- iframes don't work with z-index - fixed 3057382 -- code to prevent subviews from drawing not working perfectly for subframes * WebView.subproj/WebHTMLView.m: (-[WebHTMLView isOpaque]): Change this back to always return YES. We handle this issue at another level now. (-[WebHTMLView drawRect:]): Clip to the passed-in rect. This was the big change that fixed most of the trouble. * WebView.subproj/WebHTMLViewPrivate.h: Remove _isMainFrame. * WebView.subproj/WebHTMLViewPrivate.m: (+[WebHTMLView initialize]): Add an imposter for NSView too, so we can make opaqueAncestor do what we need it to do. This will only work if the application doesn't also poseAsClass NSView, but it does work. (-[WebNSView opaqueAncestor]): Always return the topmost WebHTMLView if the object is inside one, even if there is an intervening opaque object. * WebView.subproj/WebView.m: (-[WebView setFrame:]): Do the display call at the window level so the topmost WebHTMLView always gets involved. * WebView.subproj/WebViewPrivate.h: Remove _controller, since we already have a public controller method. Add _isMainFrame. * WebView.subproj/WebViewPrivate.m: (-[WebView _isMainFrame]): Added. 2002-09-23 Maciej Stachowiak <mjs@apple.com> * Panels.subproj/WebStandardPanels.h: Added inline header docs. 2002-09-23 Maciej Stachowiak <mjs@apple.com> * WebView.subproj/WebWindowContext.h: Added inline header docs. 2002-09-23 Ken Kocienda <kocienda@apple.com> Fixes for some build problems I missed earlier due to the fact that PB can't handle header dependencies, and I did not do a clean build of WebKit. * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream receivedError:withDataSource:]): WebFoundation error constant name change. (-[WebNetscapePluginStream cancel]): Ditto. * WebCoreSupport.subproj/WebCookieAdapter.m: (-[WebCookieAdapter cookiesEnabled]): Modified to use [[WebCookieManager sharedCookieManager] acceptPolicy] rather than reaching down into CFPreferences directly. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): WebFoundation error constant name change. (-[WebSubresourceClient cancel]): Ditto. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient didCancelWithHandle:]): Ditto. 2002-09-23 Darin Adler <darin@apple.com> * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]): Don't special case the top level frame's view so much. (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): Ditto. (-[NSView _web_propagateDirtyRectToAncestor]): Use public method here instead of private. 2002-09-23 Ken Kocienda <kocienda@apple.com> * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportBadURL:]): WebFoundation error code constant name change * WebView.subproj/WebView.m: (+[WebView initialize]): WebError addErrorsFromDictionary changed to addErrorsWithCodesAndDescriptions 2002-09-22 Darin Adler <darin@apple.com> - fixed 3057380 -- insertion point shows through elements in front of text fields * WebView.subproj/WebHTMLViewPrivate.m: (+[WebHTMLView initialize]): Make WebNSTextView pose as NSTextView. (-[WebNSTextView _web_inHTMLView]): Helper method. (-[WebNSTextView isOpaque]): Override to return NO for all text views that are inside an WebHTMLView, so they don't try to do insertion point caching. (-[WebNSTextView drawInsertionPointInRect:color:turnedOn:]): Use setNeedsDisplayInRect to trigger insertion point drawing outside drawRect instead of drawing right away. (-[WebNSTextView _drawRect:clip:]): Set flag so the above can know when it's inside drawRect and when it's not. 2002-09-21 Darin Adler <darin@apple.com> WebKit part of the new approach to AppKit drawing control. Works better than the previous try. Once we fix anomalies with focus rectangles and a some remaining problems with subframes this should work perfectly. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView isOpaque]): Return NO for frames other than the main frame. (-[WebHTMLView drawRect:]): Restore the subviews that were set aside. * WebView.subproj/WebHTMLViewPrivate.h: Add _isMainFrame. Add savedSubviews and subviewsSetAside. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _isMainFrame]): Added. (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]): Added. If this is the main frame, get all the dirty rects from the subviews and then set them aside so the AppKit machinery won't draw them. (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): Ditto. (-[NSView _web_propagateDirtyRectToAncestor]): Added. Propagates dirty rects the same way that AppKit does, but always does it, ignoring the value of isOpaque. 2002-09-20 Darin Adler <darin@apple.com> * History.subproj/WebHistory.m: (-[WebHistory addEntryForURLString:]): Use _web_URLWithString so we can handle unusual characters. * WebView.subproj/WebDefaultPolicyHandler.m: Remove stray semicolon. 2002-09-20 Chris Blumenberg <cblu@apple.com> Fixed wasteful memory usage in the WebIconDatabase: - Rather than have multiple NSImages with multiple representations at multiple sizes, have 1 NSImage per size - Added API to allow client to control memory caching * Misc.subproj/WebIconDatabase.h: * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase iconForSiteURL:withSize:]): call iconForSiteURL:withSize:cache:YES (-[WebIconDatabase iconForSiteURL:withSize:cache:]): new, was iconForSiteURL:withSize: (-[WebIconDatabase defaultIconWithSize:]): call _iconFromDictionary:forSize:cache: (-[WebIconDatabase _updateFileDatabase]): write the largest icon to disk (-[WebIconDatabase _hasIconForSiteURL:]): cleaned-up (-[WebIconDatabase _iconsForIconURL:]): call _iconFromDictionary:forSize:cache: (-[WebIconDatabase _iconForFileURL:withSize:]): call _iconFromDictionary:forSize:cache: (-[WebIconDatabase _builtInIconsForHost:]): call _iconFromDictionary:forSize:cache: (-[WebIconDatabase _setIcon:forIconURL:]): _iconsBySplittingRepresentationsOfIcon: (-[WebIconDatabase _releaseIconForIconURL:]): icons at different sizes are now stored in dictionaries (-[WebIconDatabase _largestIconFromDictionary:]): new, scans the icon dictionary (-[WebIconDatabase _iconsBySplittingRepresentationsOfIcon:]): creates the icon dictionary (-[WebIconDatabase _iconFromDictionary:forSize:cache:]): returns icon from dict, resizes if necessary (-[WebIconDatabase _iconByScalingIcon:toSize:]): tweak * Misc.subproj/WebIconDatabasePrivate.h: * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]): don't call _iconsForIconURL: because it doesn't exist. 2002-09-19 Maciej Stachowiak <mjs@apple.com> * Makefile.am: Make `doc' target depend on `all'. * WebView.subproj/WebContextMenuHandler.h: Fix typo found by `make doc'. * WebView.subproj/WebLocationChangeHandler.h: Likewise. 2002-09-19 Maciej Stachowiak <mjs@apple.com> * Makefile.am: Added `make doc' target. 2002-09-19 John Sullivan <sullivan@apple.com> - cleaned up some SPI for handling URLs on pasteboard * Misc.subproj/WebNSPasteboardExtras.h: Added. * Misc.subproj/WebNSPasteboardExtras.m: Added. (+[NSPasteboard _web_dragTypesForURL]): Moved this here; was -[NSView _web_acceptableDragTypes] (-[NSPasteboard _web_bestURL]): Moved this here; was +[NSView _web_bestURLFromPasteboard:] * WebView.subproj/WebView.m: (-[WebView initWithFrame:]), (-[WebView draggingEntered:]), (-[WebView concludeDragOperation:]): Updated for SPI change; also removed methods now in NSPasteboard. * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragOperationForDraggingInfo:]): Updated for SPI change. * WebKit.pbproj/project.pbxproj: Updated for new files. === Alexander-24 === 2002-09-18 Darin Adler <darin@apple.com> Fix two problems that led to an assertion now that a bogus load progress doesn't pass the "bytesReceived == total" test. * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream handleDidFinishLoading:]): Nil out the resource at the start of the function so that a cancel doesn't do anything if called in the middle when we stop. (-[WebNetscapePluginStream cancel]): Send a cancel error instead of a _receivedProgress. And make a partial progress rather than sending an empty progress. (-[WebNetscapePluginStream handleDidFailLoading:withError:]): Same as handleDidFinishLoading. 2002-09-18 Richard Williamson <rjw@apple.com> More documentation stuff. Added attributed text API as requested (yuck!). Add reconstructedDocumentSource API as requested. Removed cruft (stale API, bogus comments). * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation reconstructedDocumentSource]): (-[WebHTMLRepresentation attributedText]): * WebView.subproj/WebHTMLRepresentationPrivate.h: * WebView.subproj/WebHTMLView.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView selectedAttributedText]): (-[WebHTMLView selectedText]): * WebView.subproj/WebView.h: 2002-09-18 Richard Williamson <rjw@apple.com> Added document keywords to headers. Made bookmark related APIs private (for now). * Misc.subproj/WebIconDatabase.h: * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebKitErrors.h: * Panels.subproj/WebStandardPanels.h: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDefaultContextMenuHandler.h: * WebView.subproj/WebLoadProgress.h: * WebView.subproj/WebLocationChangeHandler.h: * WebView.subproj/WebPreferences.h: Made public * WebHTMLRepresentation.h * WebHTMLRepresentation.m 2002-09-18 John Sullivan <sullivan@apple.com> WebKit part of fix for - 3000823 -- special-case drag of webloc file to bookmarks - 3004466 -- favorites bar doesn't accept drops of URL strings or webloc files * Misc.subproj/WebNSViewExtras.h: - make _web_bestURLForDraggingInfo: a class method and have it take an NSPasteboard * instead of an NSDraggingInfo *; change name to _web_bestURLFromPasteboard: * Misc.subproj/WebNSViewExtras.m: (+[NSView _web_bestURLFromPasteboard:]): - make this a class method and have it take an NSPasteboard * instead of an NSDraggingInfo * (-[NSView _web_dragOperationForDraggingInfo:]): Updated for SPI change. * WebView.subproj/WebView.m: (-[WebView draggingEntered:]), (-[WebView concludeDragOperation:]): Updated for SPI change. 2002-09-18 Richard Williamson <rjw@apple.com> Added documentation keywords to headers. Create seperate files for the protocols that were defined in WebController.h. Made -[WebController createFrameNamed:for:inParent:allowsScrolling:]): private. * Plugins.subproj/WebPluginView.m: * WebCoreSupport.subproj/WebBridge.m: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebContextMenuHandler.h: Added. * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: * WebView.subproj/WebDefaultContextMenuHandler.m: * WebView.subproj/WebFrame.m: * WebView.subproj/WebHTMLView.m: * WebView.subproj/WebHTMLViewPrivate.m: * WebView.subproj/WebMainResourceClient.m: * WebView.subproj/WebResourceProgressHandler.h: Added. * WebView.subproj/WebView.m: * WebView.subproj/WebWindowContext.h: Added. 2002-09-18 Richard Williamson <rjw@apple.com> Added documentation keywords to header. * WebView.subproj/WebControllerPolicyHandler.h: Made WebDynamicScrollBarsView private * WebKit.pbproj/project.pbxproj: 2002-09-18 Darin Adler <darin@apple.com> - fixed 3053155 -- REGRESSION: Activity Window thinks 0-byte images are "complete" I thought I had fixed it before, but this is needed too. * WebView.subproj/WebLoadProgress.m: (-[WebLoadProgress init]): Set "bytes so far" to 0, not -1. (-[WebLoadProgress initWithResourceHandle:]): Make sure we set total to -1, not 0, when the response is nil. 2002-09-18 Richard Williamson <rjw@apple.com> Added documentation keywords to header. * WebView.subproj/WebDocument.h: 2002-09-18 Richard Williamson <rjw@apple.com> Added documentation keywords to headers. Made reset a private method. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame reset]): 2002-09-18 Richard Williamson <rjw@apple.com> Added documentation keywords to headers. * WebView.subproj/WebView.h: 2002-09-18 Richard Williamson <rjw@apple.com> Added documentation keywords to headers. * WebView.subproj/WebDataSource.h: 2002-09-18 Darin Adler <darin@apple.com> * WebView.subproj/WebController.h: Fix typo. 2002-09-18 Darin Adler <darin@apple.com> * WebView.subproj/WebController.h: Add getters. * WebView.subproj/WebController.m: (-[WebController applicationNameForUserAgent]): Added. (-[WebController userAgent]): Added. 2002-09-17 Darin Adler <darin@apple.com> Fix bug where image documents were broken. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): loadStatus of 0 means the whole image is ready, not 0 scan lines; so check > 0, not >= 0. * WebKit.pbproj/project.pbxproj: Let Project Builder be the boss of me. 2002-09-17 Richard Williamson <rjw@apple.com> * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: (-[WebHistory addEntryForURLString:]): (-[WebHistory containsEntryForURLString:]): Added URL string API. We should remove use of NSURL from this API. * History.subproj/WebHistoryPrivate.h: * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate _entryForURLString:]): (-[WebHistoryPrivate containsEntryForURLString:]): Implementation of above. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawGlyphs:numGlyphs:fromGlyphPosition:toGlyphPosition:atPoint:withPadding:withTextColor:backgroundColor:]): (-[WebTextRenderer slowFloatWidthForCharacters:stringLength:fromCharacterPostion:numberOfCharacters:applyRounding:]): Use ((int)(x + (1.0 - FLT_EPSILON))) instead of ceil(). 2002-09-16 Darin Adler <darin@apple.com> * History.subproj/WebHistoryPrivate.m: Do that for real. 2002-09-16 Richard Williamson <rjw@apple.com> Remove fix (according to John, partial fix) for 3051288. Canonicalizing the URL strings used in the history db is very slow! ~8% slower. * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate addEntry:]): (-[WebHistoryPrivate removeEntry:]): (-[WebHistoryPrivate containsURL:]): (-[WebHistoryPrivate entryForURL:]): * WebView.subproj/WebHTMLView.h: Removed cruft from header. 2002-09-16 Darin Adler <darin@apple.com> - fixed 3050810 -- while an image is loading progressively, it draws white rather then page background * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer drawClippedToValidInRect:fromRect:]): Added. Used instead of a direct call to drawInRect:fromRect:operation:fraction:, this only draws the part of the image that is valid according to loadStatus. (-[WebImageRenderer nextFrame:]): Use drawClippedToValidInRect:fromRect:. (-[WebImageRenderer beginAnimationInRect:fromRect:]): Ditto. (-[WebImageRenderer tileInRect:fromPoint:]): Ditto. 2002-09-13 Richard Williamson (Home) <rjw@apple.com> Fixed 3051288. URLs were not being canonicalized, so matching failed. * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate addEntry:]): (-[WebHistoryPrivate removeEntry:]): (-[WebHistoryPrivate containsURL:]): (-[WebHistoryPrivate entryForURL:]): 2002-09-13 Richard Williamson (Home) <rjw@apple.com> Fixed 3050636. 90% solution. The "Display Images Automatically" preference will be used to disallow image draggging. So if this is set after pages have loaded, their images will not be draggable, and vice-versa. Not disastrous as dragging in either case has little or no negative consequences. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): 2002-09-13 Maciej Stachowiak <mjs@apple.com> WebKit changes for: - fixed 3032238 - Eliminate "Ask each time" choice for cookies * Panels.subproj/WebStandardPanels.h: * Panels.subproj/WebStandardPanels.m: (-[WebStandardPanels useStandardAuthenticationPanel]): * WebCoreSupport.subproj/WebCookieAdapter.m: (-[WebCookieAdapter cookiesEnabled]): * WebKit.pbproj/project.pbxproj: 2002-09-13 Darin Adler <darin@apple.com> Added assertions, and dealt with some breakage I created while trying to fix, here, what I broke in WebCore. * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView start]): Do get the dataSource from our parent when we are being used as an object in a view rather than a document view. * Plugins.subproj/WebPluginStream.m: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebFrame.m: Leave in the assertions I used to debug. 2002-09-13 Darin Adler <darin@apple.com> - fixed 3031685 -- The text encoding setting is not propagated to subframes * WebView.subproj/WebDocument.h: Remove old WebDocumentTextEncoding methods, add supportsTextEncoding. * WebView.subproj/WebController.m: (-[WebController supportsTextEncoding]): Check the document view to see if it supports WebDocumentTextEncoding and returns YES. (-[WebController setCustomTextEncoding:]): Call _reloadAllowingStaleDataWithOverrideEncoding. (-[WebController resetTextEncoding]): Ditto. (-[WebController _mainFrameOverrideEncoding]): Added. Gets encoding from the data source of the main frame; provisional if there, main if not. (-[WebController hasCustomTextEncoding]): Call _mainFrameOverrideEncoding. (-[WebController customTextEncoding]): Ditto. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setParent:]): Set the override encoding to the parent's. * WebView.subproj/WebFrame.m: (-[WebFrame reload]): Release request to fix storage leak. Set the override encoding on the new data source to match the old. * WebView.subproj/WebFramePrivate.h: New name for stale data reload method. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _reloadAllowingStaleDataWithOverrideEncoding:]): Do pretty much the same thing reload does with a few differences. Get the encoding from the parameter rather than the old data source, and set the policy to the one that uses data from the cache, even stale data, if present * WebView.subproj/WebHTMLView.m: (-[WebHTMLView supportsTextEncoding]): Return YES. 2002-09-13 Richard Williamson (Home) <rjw@apple.com> Adding padding and widths buffer to our canonical measurement method. The padding argument is used to 'pad' measurements in that same way that drawing is padded. The widths parameter allows a caller to pass a buffer to get all the individual character widths for the run of characters in the string. * Misc.subproj/WebStringTruncator.m: (+[WebStringTruncator rightTruncateString:toWidth:withFont:]): (+[WebStringTruncator centerTruncateString:toWidth:withFont:]): * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer widthForCharacters:length:]): (-[WebTextRenderer drawGlyphs:numGlyphs:fromGlyphPosition:toGlyphPosition:atPoint:withPadding:withTextColor:backgroundColor:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:characterPosition:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:]): 2002-09-13 Darin Adler <darin@apple.com> Fix dataSource-related plugin crash. * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView start]): Don't grab dataSource here. It's too early. (-[WebNetscapePluginView setDataSource:]): Grab it here. * Plugins.subproj/WebPluginStream.h: * Plugins.subproj/WebPluginStream.m: Simplified includes and added asserts while debugging. 2002-09-13 Richard Williamson (Home) <rjw@apple.com> Changed drag hysteresis to 5 and disallow selection initiation within a link. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): 2002-09-12 Darin Adler <darin@apple.com> Prep work for fixes to the text encoding for subframes. * WebCoreSupport.subproj/WebBridge.h: Remove [loadURL:withParent:]. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]): Added referrer parameter. * WebView.subproj/WebController.h: Add new methods, not implemented yet. * WebView.subproj/WebController.m: (-[WebController supportsTextEncoding]): Here is one. (-[WebController setCustomTextEncoding:]): Another. (-[WebController resetTextEncoding]): Etc. (-[WebController hasCustomTextEncoding]): Etc. (-[WebController customTextEncoding]): Etc. * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource startLoading]): Remove the forceRefresh flag. This is now controlled by the WebResourceRequest. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading]): Same for this private version. * WebView.subproj/WebFrame.h: * WebView.subproj/WebFrame.m: (-[WebFrame startLoading]): Remove the forceRefresh flag. (-[WebFrame reload]): Remove the forceRefresh flag. A reload without a forceRefresh is only used internally, not requested by the caller. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): Add handling for the case where we reload, but allow stale data. (-[WebFrame _isLoadComplete]): Ditto. (-[WebFrame _reloadAllowingStaleData]): Placeholder, not implemented yet. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView setTextEncoding:]): Update for new API, but this is going away. (-[WebHTMLView setDefaultTextEncoding]): Ditto. 2002-09-12 Richard Williamson <rjw@apple.com> Don't initiate a drag if an autoscroll happened. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): 2002-09-12 Richard Williamson <rjw@apple.com> Added absolute position column to render node for render tree view. * WebView.subproj/WebRenderNode.h: * WebView.subproj/WebRenderNode.m: (-[WebRenderNode initWithName:position:rect:view:children:]): (-[WebRenderNode absolutePositionString]): (-[WebKitRenderTreeCopier nodeWithName:position:rect:view:children:]): 2002-09-12 David Hyatt <hyatt@apple.com> Add text/xml to our list of MIME types that should use the Web view. With this fix we now render XML and XHTML correctly! * WebView.subproj/WebDataSourcePrivate.m: (+[WebDataSource _repTypes]): * WebView.subproj/WebViewPrivate.m: (+[WebView _viewTypes]): 2002-09-12 Ken Kocienda <kocienda@apple.com> Removed load flags as a design concept. Replaced with new "caching policy" concept which are set on a WebResourceRequest. These policies determine how a load will be processed with regards to the cache. * WebCoreSupport.subproj/WebBridge.h: Removed flags from loadURL method. * WebCoreSupport.subproj/WebBridge.m: Removed calls to load flags and replaced with calls to new request policies. (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): (-[WebBridge isReloading]): Ditto. (-[WebBridge loadURL:referrer:]): Ditto. (-[WebBridge loadURL:withParent:]): Removed flags from loadURL method. (-[WebBridge postWithURL:referrer:data:]): Removed calls to load flags and replaced with calls to new request policies. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): Ditto. * WebView.subproj/WebDataSource.h: Removed flags from init method. * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithURL:]): Ditto. (-[WebDataSource initWithRequest:]): Ditto. * WebView.subproj/WebDataSourcePrivate.h: Removed flags ivar, and dangling attributes ivar. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): Ditto. * WebView.subproj/WebFrame.m: (-[WebFrame reload:]): Removed calls to load flags and replaced with calls to new request policies. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _goToItem:withFrameLoadType:]): Ditto. 2002-09-12 Chris Blumenberg <cblu@apple.com> Make WebTextView private and exported. * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebTextView.h: 2002-09-11 Maciej Stachowiak <mjs@apple.com> Combined provisionalDataSourceChanged: and provisionalDataSourceCommitted: methods into a single setDataSource:, since they are always called one immediately after the other. * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView setDataSource:]): (-[WebNetscapePluginView loadRequest:inTarget:withNotifyData:]): * WebView.subproj/WebDocument.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView setDataSource:]): * WebView.subproj/WebImageView.m: (-[WebImageView setDataSource:]): * WebView.subproj/WebTextView.m: (-[WebTextView setDataSource:]): * WebView.subproj/WebViewPrivate.m: (-[WebView _makeDocumentViewForDataSource:]): 2002-09-11 Richard Williamson <rjw@apple.com> Better fix for previous problem. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:applyRounding:attemptFontSubstitution:]): 2002-09-11 Richard Williamson (Local) <rjw@apple.com> Remove ceiling of text width at end of fragment. This was screwing up intra fragment text measurements. Selection of justified text is still screwed up. This is a fundamental problem in khtml and will require a rewrite of their justification code. Konq has the same problems selecting justified text. The drawing of code applies the justification factor, but checking the selection doesn't add the justification factor, so selection will be incorrect by the justification amount. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:applyRounding:attemptFontSubstitution:]): 2002-09-11 Darin Adler <darin@apple.com> * WebView.subproj/WebFrame.m: (-[WebFrame reload:]): Use the current URL, not the original URL, when doing a reload. This prevents the URL from changing back and forth when you reload on a page that involved a redirect. 2002-09-11 Darin Adler <darin@apple.com> Add machinery needed for fix to 3021137, changing font prefs doesn't redraw frames other than the main frame. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setNeedsReapplyStyles]): Added. Lets the web views know that they need to reapply styles. If we did this over on the WebCore side, we'd have to do it right away. Maybe that would be OK; we can move that that later. * WebView.subproj/WebTextView.m: (-[WebTextView setFixedWidthFont]): Use the fixed-width size, rather than using the other size with the fixed-width family. 2002-09-11 Ken Kocienda <kocienda@apple.com> Major change to the API and design of WebFoundation. WebKit has been modified to use the new API. WebFoundation attributes, as a design concept, are now completely gone. The old usages of attributes have been replaced with new API on the WebResourceRequest and WebResourceResponse classes. * Plugins.subproj/WebPluginStream.h: Removed attribute usage in init API. No need for replacement. * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream initWithURL:pluginPointer:]): Removed attribute usage in init API. (-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:]): Ditto. (-[WebNetscapePluginStream dealloc]): Remove attribute release. (-[WebNetscapePluginStream startLoad]): Removed attribute usage. Replace with calls to new API. (-[WebNetscapePluginStream receivedData:withHandle:]): Ditto. * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView pluginURLFromCString:]): Added this helper method. (-[WebNetscapePluginView loadRequest:inTarget:withNotifyData:]): Added. (-[WebNetscapePluginView getURLNotify:target:notifyData:]): Modified to call new loadRequest:inTarget:withNotifyData: method. (-[WebNetscapePluginView getURL:target:]): Ditto. (-[WebNetscapePluginView postURLNotify:target:len:buf:file:notifyData:]): Ditto. * WebCoreSupport.subproj/WebBridge.h: Removed attribute usage in loadURL API. No need for replacement. * WebCoreSupport.subproj/WebBridge.m: Added loadRequest:withParent: (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): (-[WebBridge startLoadingResource:withURL:referrer:]): Removed attribute usage. Replace with calls to new API. (-[WebBridge isReloading]): Ditto. (-[WebBridge loadRequest:withParent:]): Added. (-[WebBridge loadURL:]): Modified to use new loadRequest:withParent: API (-[WebBridge loadURL:referrer:]): Ditto. (-[WebBridge loadURL:flags:withParent:]): Ditto. (-[WebBridge postWithURL:data:]): Ditto. * WebCoreSupport.subproj/WebSubresourceClient.h: Changed API to use an NSString referrer instead of an attributes dictionary. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:referrer:forDataSource:]): Removed attribute usage. Replace with calls to new API. * WebView.subproj/WebDataSource.h: Added initWithRequest: method. * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithURL:]): Removed attribute usage in init API. (-[WebDataSource initWithURL:flags:]): Ditto. (-[WebDataSource initWithRequest:]): Added. (-[WebDataSource request]): Added. * WebView.subproj/WebDataSourcePrivate.h: Added WebResourceRequest ivar. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): Added WebResourceRequest ivar. (-[WebDataSource _startLoading:]): Removed attribute usage. Replace with calls to new API. * WebView.subproj/WebFrame.m: (-[WebFrame reload:]): Removed attribute usage. Replace with calls to new API. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _goToItem:withFrameLoadType:]): Use new WebDataSource init API. 2002-09-10 Darin Adler <darin@apple.com> WebKit part of support for the "Referer" header. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge openNewWindowWithURL:referrer:frameName:]): Add referrer parameter, and pass it on to the window context method. (-[WebBridge addAttributeForReferrer:toDictionary:]): Added. (-[WebBridge attributesForReferrer:]): Added. (-[WebBridge startLoadingResource:withURL:referrer:]): Put the referrer into an attributes dictionary and pass it to the WebSubresourceClient method. (-[WebBridge loadURL:referrer:]): Put the referrer into an attributes dictionary and pass it along. (-[WebBridge postWithURL:referrer:data:]): Put the referrer into an attributes dictionary and pass it along. * WebCoreSupport.subproj/WebSubresourceClient.h: Add an attributes parameter to the method that starts loading. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:attributes:forDataSource:]): Put the attributes into the WebResourceRequest. * WebView.subproj/WebController.h: Add a referrer parameter to the WebWindowContext openNewWindowWithURL method. * WebView.subproj/WebDefaultContextMenuHandler.m: (-[WebDefaultContextMenuHandler openNewWindowWithURL:referrer:]): Pass the referrer on to the window context. (-[WebDefaultContextMenuHandler openLinkInNewWindow:]): Pass nil for the referrer for now. Not sure if this is best. (-[WebDefaultContextMenuHandler openImageInNewWindow:]): Ditto. (-[WebDefaultContextMenuHandler openFrameInNewWindow:]): Ditto. * WebView.subproj/WebFrame.m: (-[WebFrame frameNamed:]): Pass nil for the referrer here where we are creating a new empty window. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _continueAfterClickPolicyForEvent:]): Pass nil for the referrer here in the WebClickPolicyOpenNewWindow. The policy API doesn't provide a way for the policy handler to specify the referrer; we might want to change that later. * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView loadURL:inTarget:withNotifyData:andHandleAttributes:]): Pass nil for the referrer here. But it seems wrong that this function discards the handle attributes that are passed in for the case where it opens a new window. 2002-09-11 Chris Blumenberg <cblu@apple.com> Fixed: 3048158 - Crash at google in _destroyInitializingClassList * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient didCancelWithHandle:]): 2002-09-10 Richard Williamson (Local) <rjw@apple.com> Renamed method. * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (-[WebPreferences _updateWebCoreSettings]): (-[WebPreferences setWillLoadImagesAutomatically:]): (-[WebPreferences willLoadImagesAutomatically]): 2002-09-10 Chris Blumenberg <cblu@apple.com> Report download handler errors Renamed error constants Added new errors * Misc.subproj/WebDownloadHandler.h: * Misc.subproj/WebDownloadHandler.m: (-[WebDownloadHandler errorWithCode:]): added (-[WebDownloadHandler receivedData:]): return an error (-[WebDownloadHandler finishedLoading]): return an error (-[WebDownloadHandler cancel]): return an error * Misc.subproj/WebKitErrors.h: added new errors * WebView.subproj/WebFramePrivate.m: (-[WebFrame _shouldShowURL:]): use renamed error constants * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedError:forHandle:]): don't send an error when errors are suppressed (-[WebMainResourceClient didCancelWithHandle:]): report download handler errors (-[WebMainResourceClient handleDidFinishLoading:]): report download handler errors (-[WebMainResourceClient handleDidReceiveData:data:]): report download handler errors (-[WebMainResourceClient handleDidFailLoading:withError:]): report download handler errors * WebView.subproj/WebView.m: (+[WebView initialize]): add new errors to WebError 2002-09-10 John Sullivan <sullivan@apple.com> * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate _loadHistoryGuts:]): removed the ERROR message in the case where the history file was not found, as this is normal initial-state behavior. 2002-09-10 Maciej Stachowiak <mjs@apple.com> WebKit part of fix for: 2952837 - Slide shows on homepage.mac.com don't show pictures, captions 2942073 - Deferring [BrowserDocument goToInitialURL] can cause problems 3021360 - second window pops up on 'Search' at chrysler.com 3030485 - Unexpected new window created with no scroll bars at sony.com This is done by adding a concept of named controller sets, so that less browser-like uses of WebKit won't be affected. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge openNewWindowWithURL:frameName:]): Pass frameName parameter to controller initializer. * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController init]): Pass nil for controllerSetName. (-[WebController dealloc]): (-[WebController frameNamed:]): Check other windows in the same set too. * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate dealloc]): (-[WebController _setDefersCallbacks:]): (-[WebController _setTopLevelFrameName:]): (-[WebController _frameInThisWindowNamed:]): * WebView.subproj/WebControllerSets.h: Added. * WebView.subproj/WebControllerSets.m: Added. (+[WebControllerSets addController:toSetNamed:]): Method to maintain controller sets. (+[WebControllerSets removeController:fromSetNamed:]): Likewise. * WebKit.pbproj/project.pbxproj: Add new files. 2002-09-10 Ken Kocienda <kocienda@apple.com> Changed API for setting the WebResourceClient for a request/load. This has been removed from WebResourceRequest, and has been moved to WebResourceHandle. The result is that the init method for a WebResourceHandle now takes a WebResourceRequest and a WebResourceClient. All of the changes below are simple code modifications to use the new API. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]) * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream startLoad]) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCache:size:]) * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]) * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]) 2002-09-10 Chris Blumenberg <cblu@apple.com> * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: (-[WebHistory entryForURL:]): added * History.subproj/WebHistoryPrivate.h: * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate entryForURL:]): added * Misc.subproj/WebIconDatabase.h: added WebIconLargeSize * Misc.subproj/WebIconDatabase.m: added WebIconLargeSize * WebKit.exp: export link label key and WebIconLargeSize 2002-09-10 Darin Adler <darin@apple.com> WebKit part of weaning WebCore from getting directly at WebKit defaults. * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (-[WebPreferences _updateWebCoreSettings]): Added. Propagates all preferences to WebCore. This way WebCore doesn't have to actively ask for the values of preferences using defaults keys that are WebKit secrets. (+[WebPreferences load]): Set up an observer that calls _updateWebCoreSettings whenever NSUserDefaultsDidChangeNotification is posted. (-[WebPreferences setStandardFontFamily:]): Call _updateWebCoreSettings right away, don't wait for NSUserDefaultsDidChangeNotification. (-[WebPreferences setFixedFontFamily:]): Ditto. (-[WebPreferences setSerifFontFamily:]): Ditto. (-[WebPreferences setSansSerifFontFamily:]): Ditto. (-[WebPreferences setCursiveFontFamily:]): Ditto. (-[WebPreferences setFantasyFontFamily:]): Ditto. (-[WebPreferences setDefaultFontSize:]): Ditto. (-[WebPreferences setDefaultFixedFontSize:]): Ditto. (-[WebPreferences setMinimumFontSize:]): Ditto. (-[WebPreferences setUserStyleSheetEnabled:]): Ditto. (-[WebPreferences setUserStyleSheetLocation:]): Ditto. (-[WebPreferences setJavaEnabled:]): Ditto. (-[WebPreferences setJavaScriptEnabled:]): Ditto. (-[WebPreferences setJavaScriptCanOpenWindowsAutomatically:]): Ditto. (-[WebPreferences setPluginsEnabled:]): Ditto. (-[WebPreferences setDisplayImages:]): Ditto. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportBadURL:]): Add this method, which replaces reportError. Now WebCore doesn't use WebFoundation directly at all! Pretty neat. 2002-09-09 Richard Williamson (Home) <rjw@apple.com> Implemented disable images automatically (2896319). * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): (-[WebPreferences setDisplayImages:]): (-[WebPreferences displayImages]): 2002-09-09 Darin Adler <darin@apple.com> - fixed 3003605 -- Leaking 1 WebView after second run of static PLT Fixing this should also help with footprint. * WebView.subproj/WebFrame.m: (-[WebFrame dealloc]): Remove old workaround for problem where we always deallocated the frames from timer cleanup. I found a better fix for this. (-[WebFrame stopLoading]): Explicitly fire the scheduled layout timer if any when we stop loading, rather than leaving it hanging. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setState:]): Explicitly fire the scheduled layout timer if any. * WebView.subproj/WebDataSource.m: (-[WebDataSource isLoading]): Use an autorelease pool here so we don't end up putting all the frames in the main event loop's autorelease pool. * Bookmarks.subproj/WebBookmark.m: (-[WebBookmark init]): Use copy instead of retain. (-[WebBookmark identifier]): Use copy instead of retain. 2002-09-09 ken <kocienda@apple.com> Missed one call through asking WebResourceHandle for contentLength instead of WebResourceResponse. * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream receivedData:withHandle:]): 2002-09-09 ken <kocienda@apple.com> Content length information now accessible via WebResourceResponse object, rather than from WebResourceHandle. * WebView.subproj/WebLoadProgress.m: (-[WebLoadProgress initWithResourceHandle:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidReceiveData:data:]): 2002-09-09 Richard Williamson <rjw@apple.com> Make both calls to adjust CG font cache dynamic. The new CGFontCacheSetMaxSize() adds a font cache parameter. Ugh! This is needed so we can compile w/o warnings on stock Jag. * WebCoreSupport.subproj/WebTextRendererFactory.m: 2002-09-09 Ken Kocienda <kocienda@apple.com> Character set information now accessible via WebResourceResponse object, rather than from WebResourceHandle. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidReceiveData:data:]): 2002-09-09 Chris Blumenberg <cblu@apple.com> Re-enable wizzy scaling. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _iconByScalingIcon:toSize:]): 2002-09-09 Ken Kocienda <kocienda@apple.com> WebResourcehandle no longer has a contentType method. Call through to WebResourceResponse object to get content type. * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream receivedData:withHandle:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidReceiveData:data:]): 2002-09-09 Darin Adler <darin@apple.com> Fixed lifetime problems happening due to new cancel mechanism. * WebCoreSupport.subproj/WebSubresourceClient.m: Add comments explaining why retain/release is needed. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _recursiveStopLoading]): Add a retain/release so that we don't run into problems if _stopLoading causes the data source to go away. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient didCancelWithHandle:]): Add retain/release for similar reasons, with comment explaining why. (-[WebMainResourceClient handleDidFinishLoading:]): Ditto. (-[WebMainResourceClient handleDidFailLoading:withError:]): Ditto. Fixed the problem that was leading to the NSImage exception, but didn't turn on the whizzy scaling -- leaving that to Chris. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase iconForSiteURL:withSize:]): Eliminate the "size 0x0" feature. It was only implemented in one place, and tons of other places would actually make a size 0x0 icon. But also, we don't need it any more. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource iconLoader: receivedPageIcon:), (-[WebDataSource _loadIcon]): Don't bother actually passing the icon to [WebLocationChangeHandler receivedPageIcon:forDataSource:]. We should probably eventually either just get rid of this method, or remove the icon parameter. 2002-09-09 Chris Blumenberg <cblu@apple.com> * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _iconByScalingIcon:toSize:]): Commented out wizzy scaling as it was causing an NSImage exception to be raised. * Plugins.subproj/WebPlugin.m: (-[WebNetscapePlugin _getPluginInfo]): Check Resource Manager errors 2002-09-08 Darin Adler <darin@apple.com> * Plugins.subproj/WebPluginStream.m: * Plugins.subproj/WebPluginView.m: Use #if ! rather than #ifndef with LOG_DISABLED, since it is set to 0 rather than not defined when LOG is enabled. 2002-09-08 Darin Adler <darin@apple.com> * Bookmarks.subproj/WebBookmarkGroup.m: * History.subproj/WebHistoryPrivate.m: * History.subproj/WebURLsWithTitles.m: * Misc.subproj/WebDownloadHandler.m: * Misc.subproj/WebIconDatabase.m: * Misc.subproj/WebIconLoader.m: * WebView.subproj/WebController.m: * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebHTMLView.m: * WebView.subproj/WebHTMLViewPrivate.m: * WebView.subproj/WebMainResourceClient.m: * WebView.subproj/WebPreferences.m: * WebView.subproj/WebViewPrivate.m: Remove unnecessary includes. 2002-09-08 Darin Adler <darin@apple.com> Update logging to use new implementation. Remove old. * Misc.subproj/WebKitDebug.h: Removed. * Misc.subproj/WebKitDebug.m: Removed. * Misc.subproj/WebKitLogging.h: Added. * Misc.subproj/WebKitLogging.m: Added. * Misc.subproj/WebKitReallyPrivate.h: Removed. * WebKit.pbproj/project.pbxproj: Update for above changes. * WebKit-tests.exp: Now empty. * History.subproj/WebHistoryItem.m: Remove unneeded include. * Bookmarks.subproj/WebBookmarkGroup.m: * History.subproj/WebHistoryPrivate.m: * Misc.subproj/WebDownloadHandler.m: * Misc.subproj/WebIconDatabase.m: * Plugins.subproj/WebPlugin.m: * Plugins.subproj/WebPluginDatabase.m: * Plugins.subproj/WebPluginNullEventSender.m: * Plugins.subproj/WebPluginStream.m: * Plugins.subproj/WebPluginView.m: * Plugins.subproj/npapi.m: * WebCoreSupport.subproj/WebTextRenderer.m: * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebHTMLView.m: * WebView.subproj/WebMainResourceClient.m: Change to use new log channels. 2002-09-08 Darin Adler <darin@apple.com> Remove empty handleDidBeginLoading and handleDidCancelLoading methods, now that they will never be called. * Misc.subproj/WebIconLoader.m: * Plugins.subproj/WebPluginStream.m: * WebCoreSupport.subproj/WebSubresourceClient.m: * WebView.subproj/WebMainResourceClient.m: 2002-09-08 Darin Adler <darin@apple.com> Forgot to save out files from the editor in my last change. * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: Oops. 2002-09-08 Darin Adler <darin@apple.com> Finished weaning us from handleDidCancelLoading. Now I will remove both handleDidBeginLoading and handleDidCancelLoading. * WebCoreSupport.subproj/WebSubresourceClient.h: Add a handle method. * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handleDidCancelLoading:]): Remove guts, move to cancel. (-[WebSubresourceClient handleDidFinishLoading:]): Remove the client from the data source now, not the handle. (-[WebSubresourceClient handleDidFailLoading:withError:]): Ditto. (-[WebSubresourceClient cancel]): Move guts here, also make the above change. (-[WebSubresourceClient handle]): Added. * WebView.subproj/WebDataSource.m: Use clients list, not handles list. * WebView.subproj/WebDataSourcePrivate.h: Keep a list of subresource clients rather than a list of handles for the subresources. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): Update to match new field names. (-[WebDataSource _updateLoading]): Use clients, not handles. (-[WebDataSource _startLoading:]): Move line about starting loading out of the if statement. I suspect the if statement is always true, though. (-[WebDataSource _addSubresourceClient:]): New name. Keep client pointer instead of handle now. (-[WebDataSource _removeSubresourceClient:]): Ditto. (-[WebDataSource _stopLoading]): Move download handler line into WebMainResourceClient since the "not sent when application is quitting" issue is gone now. Stop the subresource clients using the cancel call, not by cancelling the handle directly. (-[WebDataSource _defersCallbacksChanged]): Update for clients list, not handles list. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient didCancelWithHandle:]): Cancel the download handler here. (-[WebMainResourceClient handleDidReceiveData:data:]): Call didCancelWithHandle here. A loose end from the previous change. 2002-09-07 Chris Blumenberg <cblu@apple.com> Made the wizzy scaling an experiment. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _iconByScalingIcon:toSize:]): 2002-09-06 Darin Adler <darin@apple.com> Almost weaned WebKit entirely from the handleDidBeginLoading and handleDidCancelLoading loading callbacks. We are planning to remove both of them. * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream startLoad]): Call _didStartLoading here so we don't need to rely on handleDidBeginLoading any more. (-[WebNetscapePluginStream stop]): Call cancel here so we don't need to rely on handleDidCancelLoading any more. (-[WebNetscapePluginStream handleDidBeginLoading:]): Empty out. (-[WebNetscapePluginStream handleDidFinishLoading:]): Nil out resource here. (-[WebNetscapePluginStream handleDidCancelLoading:]): Empty out. (-[WebNetscapePluginStream cancel]): Put cancel code here. (-[WebNetscapePluginStream handleDidFailLoading:withError:]): Nil out resource here. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge startLoadingResource:withURL:]): Change to use WebCoreResourceHandle. * WebCoreSupport.subproj/WebSubresourceClient.h: Change to use WebCoreResourceHandle. * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient dealloc]): Release handle too, now that we have it. (-[WebSubresourceClient receivedProgressWithComplete:]): Moved up here and removed handle parameter. (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]): Do work here so we don't need to rely on handleDidBeginLoading any more. (-[WebSubresourceClient receivedError:]): Removed handle parameter. (-[WebSubresourceClient handleWillUseUserAgent:forURL:]): (-[WebSubresourceClient handleDidBeginLoading:]): Emptied out. (-[WebSubresourceClient handleDidCancelLoading:]): Updated, still needs to be emptied out. (-[WebSubresourceClient handleDidFinishLoading:]): Nil out handle. (-[WebSubresourceClient handleDidFailLoading:withError:]): Nil out handle. (-[WebSubresourceClient cancel]): New method, used by WebCore. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer widthForCharacters:length:]): Moved up in the file to fix build failure. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): Call didStartLoadingWithURL so we don't have to rely on handleDidBeginLoading. (-[WebDataSource _stopLoading]): Call didCancelWithHandle so we don't have to rely on handleDidCancelLoading. * WebView.subproj/WebMainResourceClient.h: Add didStartLoadingWithURL and didCancelWithHandle to the public methods. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient initWithDataSource:]): (-[WebMainResourceClient handleDidBeginLoading:]): Empty out. (-[WebMainResourceClient didCancelWithHandle:]): Move the bulk of handleDidCancelLoading here. (-[WebMainResourceClient handleDidCancelLoading:]): Empty out. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): Move the mouse up a little bit so it's "on" the dragged area, but not over the text. 2002-09-06 Richard Williamson <rjw@apple.com> Added support for khtml's justified text drawing. Additional padding is distributed to space widths. (Sites like www.osnews.com now render correctly.) Change word end rounding hack to use ceil of word width. I'm still noticing a spacing anomaly that is fixed by a reload. Occasionally text runs are still crammed together, but a reload uses correct spacing. This anomaly is often visible on www.arstechnica.com. Still investigating. * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawGlyphs:numGlyphs:fromGlyphPosition:toGlyphPosition:atPoint:withPadding:withTextColor:backgroundColor:]): (-[WebTextRenderer slowDrawCharacters:length:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:attemptFontSubstitution:]): (-[WebTextRenderer _drawCharacters:length:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:]): (-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:]): (-[WebTextRenderer slowFloatWidthForCharacters:stringLength:fromCharacterPostion:numberOfCharacters:applyRounding:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:applyRounding:attemptFontSubstitution:]): Tweaks to dragged image. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): 2002-09-06 Richard Williamson (Home) <rjw@apple.com> Fixed symbol lookup problem. NSLookupAndBindSymbol() dies horribly if symbol is missing. Use NSIsSymbolNameDefined() first to check if symbol is present. * WebCoreSupport.subproj/WebTextRendererFactory.m: 2002-09-06 Darin Adler <darin@apple.com> Fix some minor anomalies and leaks. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem initWithURL:target:parent:title:]): Use copy, not retain. (-[WebHistoryItem dealloc]): Release the anchor, fix leak. (-[WebHistoryItem setURL:]): Check for URLs that are equal, not just ==. (-[WebHistoryItem setTitle:]): Copy, not retain. (-[WebHistoryItem setTarget:]): Copy, not retain. (-[WebHistoryItem setParent:]): Copy, not retain. (-[WebHistoryItem setDisplayTitle:]): Copy, not retain. (-[WebHistoryItem setAnchor:]): Copy, not retain. * WebView.subproj/WebControllerPolicyHandler.m: (-[WebPolicyPrivate dealloc]): Release the URL, call super, fix leaks. (-[WebPolicy _setPath:]): Use copy, not retain. * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate dealloc]): Release downloadProgressHandler, contextMenuHandler, locationChangeHandler, fix leaks. Some fun with Richard's new code. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): Center image around mouse instead of putting it up and to the right. Add more X space than Y space. 2002-09-06 Richard Williamson (Home) <rjw@apple.com> * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): More fun and games with dragged links. Draw both a label and url (in a smaller font) into the dragged image. * Misc.subproj/WebStringTruncator.h: * Misc.subproj/WebStringTruncator.m: (+[WebStringTruncator rightTruncateString:toWidth:withFont:]): Added right string truncator. Not optimized, but not used very often. Currently just for dragged link experiment. === Alexander-22 === 2002-09-06 Ken Kocienda <kocienda@apple.com> Declaration and initialization of variable on one line caused unused variable warning when building under deployment since the only use of the variable was in a debug statement. * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream receivedError:]) 2002-09-05 Richard Williamson (Local) <rjw@apple.com> Experiment w/ dragging link label as drag image. Needs some visual tweaking, but good concept, I think. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): 2002-09-05 Richard Williamson (Local) <rjw@apple.com> Use the first text child node of the link element as the title for a dragged link. We'll use this for the dragged image later too. * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementAtPoint:]): 2002-09-05 Richard Williamson (Local) <rjw@apple.com> Correctly save of document state in current document when going back. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge saveDocumentState:]): (-[WebBridge documentState]): 2002-09-05 Richard Williamson (Local) <rjw@apple.com> Fixed 3043505. Disallows drag drops on originating view. * WebView.subproj/WebView.m: (-[WebView draggingEntered:]): 2002-09-05 Darin Adler <darin@apple.com> Update to use the new style of assertions. A few places still use the WebKitDebug.h, for logging. * Bookmarks.subproj/WebBookmark.m: * Bookmarks.subproj/WebBookmarkGroup.m: * Bookmarks.subproj/WebBookmarkLeaf.m: * Bookmarks.subproj/WebBookmarkList.m: * Bookmarks.subproj/WebBookmarkSeparator.m: * History.subproj/WebHistory.m: * History.subproj/WebHistoryList.m: * History.subproj/WebHistoryPrivate.m: * History.subproj/WebURLsWithTitles.m: * Misc.subproj/WebDownloadHandler.m: * Misc.subproj/WebIconDatabase.m: * Misc.subproj/WebIconLoader.m: * Misc.subproj/WebKitDebug.h: * Misc.subproj/WebStringTruncator.m: * Panels.subproj/WebAuthenticationPanel.m: * Plugins.subproj/WebPlugin.m: * Plugins.subproj/WebPluginDatabase.m: * Plugins.subproj/WebPluginNullEventSender.m: * Plugins.subproj/WebPluginStream.m: * Plugins.subproj/WebPluginView.m: * Plugins.subproj/npapi.m: * WebCoreSupport.subproj/WebBridge.m: * WebCoreSupport.subproj/WebCookieAdapter.m: * WebCoreSupport.subproj/WebImageRenderer.m: * WebCoreSupport.subproj/WebImageRendererFactory.m: * WebCoreSupport.subproj/WebSubresourceClient.m: * WebCoreSupport.subproj/WebTextRenderer.m: * WebCoreSupport.subproj/WebTextRendererFactory.m: * WebCoreSupport.subproj/WebViewFactory.m: * WebView.subproj/WebController.m: * WebView.subproj/WebControllerPrivate.m: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.m: * WebView.subproj/WebDefaultPolicyHandler.m: * WebView.subproj/WebFrame.m: * WebView.subproj/WebFramePrivate.m: * WebView.subproj/WebHTMLView.m: * WebView.subproj/WebHTMLViewPrivate.m: * WebView.subproj/WebMainResourceClient.m: * WebView.subproj/WebPreferences.m: * WebView.subproj/WebViewPrivate.m: Use new assertions. 2002-09-05 Richard Williamson (Local) <rjw@apple.com> Removed debugging. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList addEntry:]): 2002-09-05 Richard Williamson (Local) <rjw@apple.com> Added support for saving/restoring document state in back/forward list. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList addEntry:]): * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem dealloc]): (-[WebHistoryItem setLastVisitedDate:]): (-[WebHistoryItem documentState]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge saveDocumentState:]): (-[WebBridge documentState]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): Lookup post Jaguar CG SPI. Can now run and build w/o patched CG. * WebCoreSupport.subproj/WebTextRendererFactory.m: Changed image links to drag file contents. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): 2002-09-05 Ken Kocienda <kocienda@apple.com> The WebError object has been removed from WebResourceHandle. Objects of that class now rely on the WebError object in WebResourceResponse. This code has been updated to ask WebResourceResponse for it WebError object, rather than asking WebResourceHandle. * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handleDidFinishLoading:]) * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidFinishLoading:]) 2002-09-05 Chris Blumenberg <cblu@apple.com> Fixed 3021365 - Crash failing to load plugin from local file * Plugins.subproj/WebPluginStream.h: * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream receivedData:withHandle:]): (-[WebNetscapePluginStream receivedError:]): (-[WebNetscapePluginStream receivedData:withDataSource:]): (-[WebNetscapePluginStream handleDidReceiveData:data:]): 2002-09-05 Ken Kocienda <kocienda@apple.com> The first use of the WebResourceResponse object. This is just a baby step, though. I only use one variable in the new class, the statusCode, but all the code in the framework has been updated to use the statusCode from the response object. Each of these methods was modified to call through to a WebResourceResponse to get the status code. * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handleDidFinishLoading:]) * WebView.subproj/WebLoadProgress.m: (-[WebLoadProgress initWithResourceHandle:]) * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidFinishLoading:]) 2002-09-05 Richard Williamson (Local) <rjw@apple.com> Only disable timed expiration of CG glyph cache if SPI is available. (per Bertrand's request) * WebCoreSupport.subproj/WebTextRendererFactory.m: 2002-09-05 John Sullivan <sullivan@apple.com> * Resources/url_icon.tiff: New generic icon from Steve Lemay. The @ sign lives, but does not spring. 2002-09-04 Darin Adler <darin@apple.com> One more pass of refinement on that last change. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList addEntry:]): Replace the last entry instead of just ignoring if this one matches. * History.subproj/WebHistoryList.h: Add replaceEntryAtIndex. Remove addURL: and removeURL:. * History.subproj/WebHistoryList.m: (-[WebHistoryList addEntry:]): Call removeEntry: rather than using an entire pasted copy here. (-[WebHistoryList removeEntry:]): Use a hash of the URL and the URL rather than relying on the fact that WebHistoryItem hashes and does isEqual based on the URL only. (-[WebHistoryList replaceEntryAtIndex:withEntry:]): Added. Used by the code above. 2002-09-04 Darin Adler <darin@apple.com> Fix bug where doing a reload adds an entry to the back/forward list. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList addEntry:]): If URL, target, and parent all match, then don't add an entry. * WebKit.pbproj/project.pbxproj: Let Project Builder be the boss; I guess this means Chris is still using the old version. 2002-09-04 Chris Blumenberg <cblu@apple.com> - don't set nil data on the web file db - store absolute URLs in the db, not base URL/path combination URLs - support for multiple hosts with the same built-in icon * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase init]): renamed some dictionaries (-[WebIconDatabase iconForSiteURL:withSize:]): call _builtInIconsForHost (-[WebIconDatabase _updateFileDatabase]): check for nil (-[WebIconDatabase _hasIconForSiteURL:]): call _pathForBuiltInIconForHost (-[WebIconDatabase _pathForBuiltInIconForHost:]): new (-[WebIconDatabase _builtInIconsForHost:]): call _pathForBuiltInIconForHost * Misc.subproj/WebIconDatabasePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): use absolute URL 2002-09-04 Chris Blumenberg <cblu@apple.com> Made the icon DB take a a path for built-in icons so that we only load them when necessary. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase init]): (-[WebIconDatabase iconForSiteURL:withSize:]): (-[WebIconDatabase _hasIconForSiteURL:]): (-[WebIconDatabase _builtInIconsForHost:]): (-[WebIconDatabase _setBuiltInIconAtPath:forHost:]): * Misc.subproj/WebIconDatabasePrivate.h: * WebKit.pbproj/project.pbxproj: 2002-09-04 Darin Adler <darin@apple.com> Fix unused variable warnings for deployment builds. * Plugins.subproj/WebPluginView.m: Add ifndef NDEBUG around variable used only in log statements. 2002-09-04 Darin Adler <darin@apple.com> Removed the now-unnecessary iconURL from bookmarks and history. * Bookmarks.subproj/WebBookmark.h: * Bookmarks.subproj/WebBookmark.m: * Bookmarks.subproj/WebBookmarkGroup.h: * Bookmarks.subproj/WebBookmarkGroup.m: * Bookmarks.subproj/WebBookmarkLeaf.h: * Bookmarks.subproj/WebBookmarkLeaf.m: * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: * History.subproj/WebHistoryPrivate.h: * History.subproj/WebHistoryPrivate.m: Removed iconURL instance variables, methods, and parameters. 2002-09-04 Darin Adler <darin@apple.com> Did some minor plugin cleanup, mostly to make sure we don't change pages while a plugin is tracking. * Plugins.subproj/WebPluginView.h: Add sendEvent and sendUpdateEvent. Remove the NPP_HandleEvent method. * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView sendEvent:]): Sets up the "defersCallbacks" state, then sends the event. * Plugins.subproj/WebNetscapePluginViewPrivate.h: Added. This stuff was shared in a different way before, and it hadn't even been renamed. * WebKit.pbproj/project.pbxproj: Added file. * Plugins.subproj/npapi.m: Use the new private header. * Plugins.subproj/WebPluginNullEventSender.h: Hold a reference to the view. * Plugins.subproj/WebPluginNullEventSender.m: (-[WebNetscapePluginNullEventSender initWithPluginView:]): Retain the view. (-[WebNetscapePluginNullEventSender dealloc]): Release the view. (-[WebNetscapePluginNullEventSender sendNullEvents]): Use sendEvent:. (-[WebNetscapePluginNullEventSender stop]): No need for shouldStop. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate init]): Don't set contentPolicy to an enum value, when it's an object reference. (-[WebDataSourcePrivate dealloc]): Release contentPolicy to fix a leak. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): Set draggedURL to nil in the else case, it was uninitialized before. Also center the icon better when dragging, but shouldn't we be dragging something more than the icon here? * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase defaultIconWithSize:]): Add a call to release. Doesn't really plug a leak, but cleaner this way. * Plugins.subproj/WebPlugin.m: Tweaks. * WebView.subproj/WebMainResourceClient.m: Tweaks only. 2002-09-04 Ken Kocienda <kocienda@apple.com> Made more adjustments for API and behavior change that occurred in WebFoundation, now that WebResourceHandle objects no buffer resource data as it is loaded. Where necessary, the WebKit objects now do their own buffering, however, in many cases, buffering is not necessary to maintain correct behavior. * Misc.subproj/WebIconLoader.m: (-[WebIconLoaderPrivate dealloc]): Release new buffered resource data object. (-[WebIconLoader initWithURL:]): Allocate new buffered resource data object. (-[WebIconLoader handleDidFinishLoading:]): Modify API to remove data parameter. (-[WebIconLoader handleDidReceiveData:data:]): Buffer data as it is received. * Plugins.subproj/WebPluginStream.h: Added new buffered resource data object. * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:attributes:]): Allocate new buffered resource data object. (-[WebNetscapePluginStream dealloc]): Release new buffered resource data object. (-[WebNetscapePluginStream receivedData:]): Buffer data as it is received (when necessary maintain correct behavior). (-[WebNetscapePluginStream handleDidFinishLoading:]): Modify API to remove data parameter. * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient handleDidFinishLoading:]): Modify API to remove data parameter. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidFinishLoading:]): Modify API to remove data parameter. (-[WebMainResourceClient handleDidReceiveData:data:]): Buffer data as it is received (when necessary maintain correct behavior). 2002-09-04 Chris Blumenberg <cblu@apple.com> Fixed: 3043024 - Built-in icons should match on *whatever.com or *whatever.whatever implemented wizzy scaling, but ifdef'd it out * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase iconForSiteURL:withSize:]): call _builtItIconsForHost (-[WebIconDatabase _hasIconForSiteURL:]): call _builtItIconsForHost (-[WebIconDatabase _iconForFileURL:withSize:]): call _iconByScalingIcon:toSize: (-[WebIconDatabase _builtItIconsForHost:]): use better host matching (-[WebIconDatabase _cachedIconFromArray:withSize:]): call _iconByScalingIcon:toSize: (-[WebIconDatabase _iconByScalingIcon:toSize:]): renamed, ifdef'd out wizzy scaling 2002-09-04 Ken Kocienda <kocienda@apple.com> Changed WebKit so that it no longer relies on WebResourceHandle to buffer resource data as it is loaded. Instead, this buffering task has been moved out to the WebResourceClient, WebMainResourceClient in this case. This change is a "proof of concept" for the upcoming change where the API in WebFoundation for buffering resource data in WebResourceHandle will be removed altogether. * WebView.subproj/WebDataSource.m: (-[WebDataSource data]): Changed to call WebMainResourceClient when resource data is needed. * WebView.subproj/WebMainResourceClient.h: Added mutable data ivar. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient initWithDataSource:]): Added mutable data ivar. (-[WebMainResourceClient dealloc]): Release new mutable data ivar. (-[WebMainResourceClient resourceData]): Added accessor method. (-[WebMainResourceClient handleDidReceiveData:data:]): Append received data to the new mutable data object. 2002-09-03 John Sullivan <sullivan@apple.com> * Resources/url_icon.tiff: New image (still a placeholder) from HI. For the moment the default page icon is the legendary @-sign-on-a-spring. I've been promised a replacement by tomorrow sometime. 2002-09-03 John Sullivan <sullivan@apple.com> - removed small folder image used for bookmark lists; it is now up to clients to display an icon for bookmark lists. * Bookmarks.subproj/WebBookmarkList.h: Removed _icon ivar * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList dealloc]): Don't release _icon (-[WebBookmarkList icon]): just return nil * Resources/bookmark_folder.tiff: Removed. * WebKit.pbproj/project.pbxproj: Updated for removed file. 2002-09-03 Chris Blumenberg <cblu@apple.com> - Moved the default icon method to WebIconDatabase - Removed "icon URL" from the location change handler API * History.subproj/WebHistoryItem.m: (-[WebHistoryItem icon]): don't worry about iconForSiteURL:withSize: returning nil * Misc.subproj/WebIconDatabase.h: * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase iconForSiteURL:withSize:]): return defaultIconWithSize if none found (-[WebIconDatabase defaultIconWithSize:]): added, loads, caches default icon (-[WebIconDatabase _hasIconForSiteURL:]): added, called by webdatasource to determine if icon is necessary * Misc.subproj/WebIconDatabasePrivate.h: added _hasIconForSiteURL * Misc.subproj/WebIconLoader.h: removed default icon method * Misc.subproj/WebIconLoader.m: removed default icon method * Resources/url_icon.tiff: resized to 32 x 32 * WebKit.exp: export symbol for a dictionary key * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): call _hasIconForSiteURL * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): call defaultIconWithSize * WebView.subproj/WebLocationChangeHandler.h: * WebView.subproj/WebLocationChangeHandler.m: (-[WebLocationChangeHandler receivedPageIcon:forDataSource:]): renamed 2002-09-03 Ken Kocienda <kocienda@apple.com> Modify calls into WebFoundation to use the new WebResourceRequest class, and the modified API that kicks off load requests using WebResourceHandle. More changes are planned for this code as the WebFoundation API modifications progress. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _iconForFileURL:withSize:]) * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]) * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream startLoad]) * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCache:size:]) * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]) * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebControllerPrivate.m: (-[WebController _receivedError:forResourceHandle:partialProgress:fromDataSource:]) * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]) 2002-09-03 Darin Adler <darin@apple.com> Fix a reproducible crash pulling down the Go menu. * Misc.subproj/WebIconDatabase.m: (-[WebIconDatabase _iconForFileURL:withSize:]): Add a missing retain. * WebKit.pbproj/project.pbxproj: Project Builder wants what it wants. 2002-09-02 Chris Blumenberg <cblu@apple.com> Icon DB. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem _retainIconInDatabase:]): calls retainIconForSiteURL: or releaseIconForSiteURL: (-[WebHistoryItem initWithURL:target:parent:title:]): call _retainIconInDatabase: (-[WebHistoryItem dealloc]): call _retainIconInDatabase: (-[WebHistoryItem icon]): call iconForSiteURL:withSize: (-[WebHistoryItem setURL:]): call _retainIconInDatabase: (-[WebHistoryItem initFromDictionaryRepresentation:]): call _retainIconInDatabase: * Misc.subproj/WebIconDatabase.h: Added. * Misc.subproj/WebIconDatabase.m: Added. (+[WebIconDatabase sharedIconDatabase]): (-[WebIconDatabase init]): (-[WebIconDatabase iconForSiteURL:withSize:]): (-[WebIconDatabase setIcon:forSiteURL:]): (-[WebIconDatabase setIcon:forHost:]): (-[WebIconDatabase retainIconForSiteURL:]): (-[WebIconDatabase releaseIconForSiteURL:]): (-[WebIconDatabase delayDatabaseCleanup]): (-[WebIconDatabase allowDatabaseCleanup]): (-[WebIconDatabase applicationWillTerminate:]): (-[WebIconDatabase _createFileDatabase]): (-[WebIconDatabase _loadIconDictionaries]): (-[WebIconDatabase _updateFileDatabase]): (-[WebIconDatabase _iconForIconURL:]): (-[WebIconDatabase _iconsForIconURL:]): (-[WebIconDatabase _iconForFileURL:withSize:]): (-[WebIconDatabase _setIcon:forIconURL:]): (-[WebIconDatabase _setIconURL:forSiteURL:]): (-[WebIconDatabase _setBuiltInIcon:forHost:]): (-[WebIconDatabase _retainIconForIconURL:]): (-[WebIconDatabase _releaseIconForIconURL:]): (-[WebIconDatabase _retainFutureIconForSiteURL:]): (-[WebIconDatabase _releaseFutureIconForSiteURL:]): (-[WebIconDatabase _retainOriginalIconsOnDisk]): (-[WebIconDatabase _releaseOriginalIconsOnDisk]): (-[WebIconDatabase _sendNotificationForSiteURL:]): (-[WebIconDatabase _addObject:toSetForKey:inDictionary:]): (-[WebIconDatabase _uniqueIconURL]): (-[WebIconDatabase _cachedIconFromArray:withSize:]): (-[WebIconDatabase _scaleIcon:toSize:]): * Misc.subproj/WebIconDatabasePrivate.h: Added. * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebIconLoader.m: (+[WebIconLoader iconForFileAtPath:]): (-[WebIconLoader startLoading]): (-[WebIconLoader handleDidFinishLoading:data:]): * WebKit.exp: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): 2002-08-30 Ken Kocienda <kocienda@apple.com> Removed one last reference to the now-removed WebDefaultMIMEType symbol. I missed it earlier. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidReceiveData:data:]) 2002-08-30 Ken Kocienda <kocienda@apple.com> Failed to remove debugging spam before my last checkin. Sorry. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebControllerPrivate.m: (+[WebController _MIMETypeForFile:]) 2002-08-30 Ken Kocienda <kocienda@apple.com> * WebView.subproj/WebControllerPrivate.m: (+[WebController _MIMETypeForFile:]): Small tweak to account for change in behavior of a WebFoundation method upon which this method depends. The WebFoundation now returns nil when it cannot find a suitable mime type rather than returning a default. This function now checks for a nil return value and sets @"application/octet-stream" in that case. 2002-08-30 Richard Williamson (Home) <rjw@apple.com> Change link dragging behavior. Drags URL, not URL contents. Still need to generate better image for dragging, will copy OmniWeb and drag link text. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): 2002-08-30 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Allowed the new Project Builder to put in encodings for each file. === Alexander-21 === 2002-08-28 Darin Adler <darin@apple.com> - fixed 3036440 -- Crash running PLT with "Check for 'world leaks'" enabled * WebView.subproj/WebDataSourcePrivate.h: Add defersCallbacks boolean. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setController:]): Don't try to look at the controller before, it might already be deallocated. (-[WebDataSource _defersCallbacksChanged]): Use a boolean to record whether the "defers callbacks" state changed since last time and do no work if it didn't. This replaces the check in _setController:. 2002-08-28 Richard Williamson (Local) <rjw@apple.com> Tell CG to not use time expiration of glyph cache and increase it's size. THIS CHANGE REQUIRES THAT YOU INSTALL THE CG ROOT. * WebCoreSupport.subproj/WebTextRendererFactory.m: 2002-08-28 Richard Williamson (Home) <rjw@apple.com> Fixed selection horkage I introduced with drag fix yesterday. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): 2002-08-27 Richard Williamson (Local) <rjw@apple.com> * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDown:]): (-[WebHTMLView mouseDragged:]): (-[WebHTMLView mouseMovedNotification:]): * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: Fixed active link style. Cleaned up and fixed drag initiation for links and images. Dotted lines not drawing correcly, but other styles are applied correctly. * WebKit.exp: * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: Added some constants. * WebCoreSupport.subproj/WebTextRendererFactory.m: Code to change CG caching policy. Not enabled until we receive a root from CG team. 2002-08-27 Darin Adler <darin@apple.com> - fixed 3031583 -- directory.apple.com now gives "unsupported" redirect * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithURL:attributes:flags:]): Don't create the resource handle here. It's a bit too early. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): Create the resource handle here, now that we have a controller to get a user agent from. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleWillUseUserAgent:forURL:]): Add an assert that will catch any future problems of this kind. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge defersLoading]): Added. New call for use in WebCore. (-[WebBridge setDefersLoading:]): Added. New call for use in WebCore. 2002-08-26 Darin Adler <darin@apple.com> Add machinery for deferring callbacks. Not used yet. * WebView.subproj/WebControllerPrivate.h: Add methods. * WebView.subproj/WebControllerPrivate.m: (-[WebController _defersCallbacks]): Returns old state. (-[WebController _setDefersCallbacks:]): Changes state and calls _defersCallbacksChanged on the main frame. * WebView.subproj/WebFramePrivate.h: Add _defersCallbacksChanged. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _defersCallbacksChanged]): Calls _defersCallbacksChanged on both data sources. * WebView.subproj/WebDataSourcePrivate.h: Add _defersCallbacksChanged. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setController:]): Call _defersCallbacksChanged if changing the controller changes the state. (-[WebDataSource _addResourceHandle:]): Call setDefersCallbacks:YES on the new handle if we are already attached to a controller that defers callbacks. (-[WebDataSource _defersCallbacksChanged]): Call setDefersCallbacks on all the handles, and call _defersCallbacksChanged on the child frames as well. * WebView.subproj/WebDataSource.m: (-[WebDataSource controller]): We need to know about all controller changes, so it's unacceptable to consult our parent about the controller. But we already do know about it and this code was unnecessary. Leave the old code around as an assert only. 2002-08-26 Richard Williamson <rjw@apple.com> * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: (+[WebHistory webHistoryWithFile:]): Stage 1, set the shared history instance. This'll move to WebKit soon. * WebView.subproj/WebView.m: (-[WebView setFrame:]): Only force display if in live resize. 2002-08-26 John Sullivan <sullivan@apple.com> - fixed bug where dragging a separator in the Bookmarks window would hit an assertion. * Bookmarks.subproj/WebBookmarkSeparator.m: (-[WebBookmarkSeparator initWithGroup:]): Removed obsolete assertion that group is not nil. * Bookmarks.subproj/WebBookmarkLeaf.m: (-[WebBookmarkLeaf initWithTitle:group:]): Removed a similar obsolete assertion here. * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList initWithTitle:group:]): Removed a similar obsolete assertion here. 2002-08-23 Darin Adler <darin@apple.com> * WebView.subproj/WebFrame.m: (-[WebFrame reset]): Remove unneeded call to _reset. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _setDataSource:]): Add code that removes the KHTML stuff from the frame when switching to another type of view. It would be better to do this at some other level, but without this code, we end up leaving the entire KHTMLView behind when we switch to a non-HTML page. 2002-08-22 Richard Williamson <rjw@apple.com> Changed public string from #define to extern NSString. * WebKit.exp: * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: * WebView.subproj/WebDefaultContextMenuHandler.m: (-[WebDefaultContextMenuHandler contextMenuItemsForElement:defaultMenuItems:]): (-[WebDefaultContextMenuHandler openNewWindowWithURL:]): (-[WebDefaultContextMenuHandler downloadURL:]): (-[WebDefaultContextMenuHandler openLinkInNewWindow:]): (-[WebDefaultContextMenuHandler downloadLinkToDisk:]): (-[WebDefaultContextMenuHandler copyLinkToClipboard:]): (-[WebDefaultContextMenuHandler openImageInNewWindow:]): (-[WebDefaultContextMenuHandler downloadImageToDisk:]): (-[WebDefaultContextMenuHandler copyImageToClipboard:]): (-[WebDefaultContextMenuHandler openFrameInNewWindow:]): * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementAtPoint:]): (-[WebHTMLView _continueAfterCheckingDragForEvent:]): 2002-08-22 Ken Kocienda <kocienda@apple.com> Passing the main load's attributes to the subresource loads causes breakage (most visible when we POST). Right now, we just rely on flags to handle "back/forward" loads, so the attributes were not actually being used. A better fix needs to be put in place when the soon-to-be-done attributes/flags rework is done. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]): === Alexander-20 === 2002-08-21 Richard Williamson <rjw@apple.com> Simple name change. Plugin -> NetscapePlugin in anticipation of other plugin related API. Removed vestigal WebDocumentLoading. * Plugins.subproj/WebPlugin.h: * Plugins.subproj/WebPlugin.m: (-[WebNetscapePlugin load]): * Plugins.subproj/WebPluginDatabase.h: * Plugins.subproj/WebPluginDatabase.m: (+[WebNetscapePluginDatabase installedPlugins]): (-[WebNetscapePluginDatabase pluginForMimeType:]): (-[WebNetscapePluginDatabase pluginForExtension:]): (-[WebNetscapePluginDatabase pluginWithFilename:]): (-[WebNetscapePluginDatabase MIMETypes]): (-[WebNetscapePluginDatabase init]): * Plugins.subproj/WebPluginNullEventSender.h: * Plugins.subproj/WebPluginNullEventSender.m: (-[WebNetscapePluginNullEventSender initWithPluginView:]): (-[WebNetscapePluginNullEventSender sendNullEvents]): * Plugins.subproj/WebPluginStream.h: * Plugins.subproj/WebPluginStream.m: (-[WebNetscapePluginStream getFunctionPointersFromPluginView:]): (-[WebNetscapePluginStream initWithURL:pluginPointer:notifyData:attributes:]): * Plugins.subproj/WebPluginView.h: * Plugins.subproj/WebPluginView.m: (-[WebNetscapePluginView initWithFrame:plugin:URL:baseURL:mime:arguments:]): (-[WebNetscapePluginView start]): (-[WebNetscapePluginView provisionalDataSourceChanged:]): (-[WebNetscapePluginView loadURL:inTarget:withNotifyData:andHandleAttributes:]): (-[WebNetscapePluginView destroyStream:reason:]): * WebCoreSupport.subproj/WebViewFactory.m: (-[WebViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]): (-[WebViewFactory pluginsInfo]): (-[WebViewFactory viewForJavaAppletWithFrame:baseURL:parameters:]): * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (+[WebController canShowMIMEType:]): * WebView.subproj/WebDocument.h: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView provisionalDataSourceChanged:]): (-[WebHTMLView provisionalDataSourceCommitted:]): (-[WebHTMLView dataSourceUpdated:]): * WebView.subproj/WebHTMLViewPrivate.m: (-[NSView _web_stopIfPluginView]): * WebView.subproj/WebImageView.h: * WebView.subproj/WebTextView.h: * WebView.subproj/WebView.h: * WebView.subproj/WebViewPrivate.h: * WebView.subproj/WebViewPrivate.m: (-[WebView _makeDocumentViewForDataSource:]): Still need to muck with cvs server to change file names. 2002-08-20 David Hyatt <hyatt@apple.com> Raising the layout delay from 0.75 to 1.00. This should be a little more conservative and matches the value used by Gecko. * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): 2002-08-20 David Hyatt <hyatt@apple.com> Lower the paint/layout delay from 1.85 to 0.75, since we've gotten a lot faster. * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): 2002-08-20 John Sullivan <sullivan@apple.com> * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidReceiveData:data:]): Fixed uninitialized variable that Maciej's deployment build found. 2002-08-20 John Sullivan <sullivan@apple.com> Fixed problem with previous checkin that was causing drag-and-drop for files to fail (at least). * WebView.subproj/WebFramePrivate.m: (-[WebFrame _shouldShowURL:]): pass isDirectory, not YES, to fileURLPolicyForMIMEType:inFrame:isDirectory: 2002-08-20 John Sullivan <sullivan@apple.com> WebKit part of fixes for: - 3027491 -- failure loading frame's resource leads to misbehaving panel - 3027494 -- failure loading frame's resource leads to error message in Alex, silence in IE - 3027697 -- alert box for missing file covered by browser window; should be a sheet - 3014123 -- error sheet when iframe has URL with bad path Cleaned up the WebPolicy APIs to pass frames and URLs consistently. Also cleaned up _shouldShowURL: (formerly _shouldShowDataSource:) method quite a bit. * WebView.subproj/WebControllerPolicyHandler.h: * WebView.subproj/WebDefaultContextMenuHandler.m: (-[WebDefaultContextMenuHandler downloadURL:]): * WebView.subproj/WebDefaultPolicyHandler.m: (-[WebDefaultPolicyHandler URLPolicyForURL:inFrame:]): (-[WebDefaultPolicyHandler fileURLPolicyForMIMEType:inFrame:isDirectory:]): (-[WebDefaultPolicyHandler unableToImplementPolicy:error:forURL:inFrame:]): * WebView.subproj/WebFrame.m: (-[WebFrame setProvisionalDataSource:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient handleDidReceiveData:data:]): Made various Policy-related methods pass the frame and when necessary the URL instead of the dataSource (or not even that in some broken cases). Collapsed the three unableToImplementXXXPolicy: methods into one. * WebView.subproj/WebFramePrivate.h: Change _shouldShowDataSource: to _shouldShowURL: * WebView.subproj/WebFramePrivate.m: (-[WebFrame handleUnimplementablePolicy:errorCode:forURL:]): New helper method. (-[WebFrame _shouldShowURL:]): use case statements instead of nested ifs; use handleUnimplementablePolicy: to reduce duplicated code; update for API changes; eliminate non-useful local variables. 2002-08-20 Darin Adler <darin@apple.com> - fixed 3023076 -- Strange font chosen, widths screwed up, when text includes 007F characters * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer convertCharacters:length:toGlyphs:skipControlCharacters:]): (-[WebTextRenderer _drawCharacters:length:fromCharacterPosition:toCharacterPosition:atPoint:withTextColor:backgroundColor:]): (-[WebTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:applyRounding:attemptFontSubstitution:]): Treat 007F as a control character, skipping it just as we do other control characters. 2002-08-20 Darin Adler <darin@apple.com> * WebView.subproj/WebController.m: (-[WebController setApplicationNameForUserAgent:]): Lock in here, in anticipation of actually using the name in the user agent string. 2002-08-20 Darin Adler <darin@apple.com> WebKit part of support for tabbing into and out of the toolbar. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge nextKeyViewOutsideWebViews]): Ask the main WebView for its nextKeyView on behalf of WebCore. (-[WebBridge previousKeyViewOutsideWebViews]): Ask the main WebView for its previousKeyView on behalf of WebCore. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView becomeFirstResponder]): When we are being tabbed-into, make the first or last view in the bridge first responder, instead of taking it ourselves. * WebView.subproj/WebView.m: (-[WebView becomeFirstResponder]): Always make the document view the first responder instead of taking it ourselves. 2002-08-19 Chris Blumenberg <cblu@apple.com> Fixed 3025019: "only-if-cached" attribute fetches data from network if cached but expired * Misc.subproj/WebIconLoader.m: (-[WebIconLoader iconFromCache]): 2002-08-19 Darin Adler <darin@apple.com> - fixed 2863025 -- Need to implement TABing between widgets in forms Implemented tabbing into a web view's fields. I now consider the task of tabbing between widgets done. But there are many loose ends, each with its own bug report. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView dealloc]): Set _private to nil so we can properly handle calls that come from NSView dealloc. (-[WebHTMLView provisionalDataSourceChanged:]): No need to pass width and height to createKHTMLViewWithNSView any more. Also, just pass self rather than making the roung trip to the WebFrame and the WebView back here. (-[WebHTMLView nextKeyView]): Added. Calls the bridge version when we are called from nextValidKeyView, the normal version the rest of the time. (-[WebHTMLView previousKeyView]): Added. Calls the bridge version when we are called from nextValidKeyView, the normal version the rest of the time. (-[WebHTMLView nextValidKeyView]): Set inNextValidKeyView and call super. (-[WebHTMLView previousValidKeyView]): Set inNextValidKeyView and call super. * WebView.subproj/WebHTMLViewPrivate.h: Add inNextValidKeyView flag. 2002-08-18 Darin Adler <darin@apple.com> Update WebResourceClient instances for new API, including adding the handleWillUseUserAgent:forURL: method. * Misc.subproj/WebIconLoader.m: * Plugins.subproj/WebPluginStream.m: * WebCoreSupport.subproj/WebSubresourceClient.m: * WebView.subproj/WebMainResourceClient.m: These were all the clients that needed updating. * WebView.subproj/WebController.m: (-[WebController setUserAgent:]): Lock so that we can set the user agent even though another thread could be calling userAgentForURL:. (-[WebController userAgentForURL:]): Ditto. * WebView.subproj/WebControllerPrivate.h: Add lock. * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate init]): Create lock. (-[WebControllerPrivate dealloc]): Release lock. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _stopLoading]): Improve comment. 2002-08-18 Darin Adler <darin@apple.com> * Misc.subproj/WebIconLoader.m: (-[WebIconLoader iconFromCache]): (-[WebIconLoader WebResourceHandleDidFinishLoading:data:]): Don't process each icon twice. We need to have the loader as a client even for the synchronous case because of the user agent issue, but that causes double work. 2002-08-16 Darin Adler <darin@apple.com> Step 3 in adding user agent API to WebKit and WebFoundation. Add the calls to WebKit to configure the user-agent string. Change WebCore to get the user-agent from WebKit via the bridge. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge userAgentForURL:]): Added. Calls [WebController userAgentForURL:]. * WebView.subproj/WebController.h: Add three new methods. * WebView.subproj/WebController.m: (-[WebController setApplicationNameForUserAgent:]): Store an application name that will be used to build up the user-agent string. (-[WebController setUserAgent:]): Set an override user agent; mainly useful for testing user-agent strings different from the one WebKit supplies. (-[WebController userAgentForURL:]): Public API for getting the user agent string that the WebController will use for a particular URL. * WebView.subproj/WebControllerPrivate.h: Add fields for the user-agent parameters. * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate dealloc]): Release both strings when the controller goes away. 2002-08-16 Darin Adler <darin@apple.com> Missed one call to [WebResourceHandle initWithURL:]. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge objectLoadedFromCache:size:]): Change to call [WebResourceHandle initWithClient:URL:] with nil for the client. 2002-08-16 Darin Adler <darin@apple.com> Oops. Forgot to save in Project Builder before committing. * Plugins.subproj/WebPluginStream.m: * WebView.subproj/WebDataSource.m: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: 2002-08-16 Darin Adler <darin@apple.com> Update for change to the WebResourceHandle API where the client is passed in at init time. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader iconFromCache]): Pass self as client when creating handle for foreground "only if cached" load. Also don't put the handle into the class's data structure in this case. (-[WebIconLoader startLoading]): Pass self as client when creating handle instead of making a separate addClient call. Also fix potential leak if this is called when we are already loading. (-[WebIconLoader stopLoading]): Release the handle and nil it out right here. * Plugins.subproj/WebPluginStream.m: (-[WebPluginStream startLoad]): Pass client when creating handle rather than doing an addClient afterward. (-[WebPluginStream stop]): Don't do a removeClient. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]): * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithURL:attributes:flags:]): Pass client when creating handle. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _startLoading:]): Since client is not created in init, don't bother creating it here. 2002-08-16 John Sullivan <sullivan@apple.com> Split searchability out from WebTextView so it could be used elsewhere (specifically, in DOM window). * Misc.subproj/WebSearchableTextView.h: Added. * Misc.subproj/WebSearchableTextView.m: Added. (-[WebSearchableTextView searchFor:direction:caseSensitive:]): (-[NSString findString:selectedRange:options:wrap:]): New class, split out from WebTextView, which now inherits from it. * WebView.subproj/WebTextView.h: * WebView.subproj/WebTextView.m: Took out the searching stuff and put it in WebSearchableTextView; made WebTextView inherit from WebSearchableTextView. * WebKit.pbproj/project.pbxproj: Added new files, made WebSearchableTextView.h be Private. 2002-08-16 John Sullivan <sullivan@apple.com> - fixed 3025394 -- Bookmarks & History items do not remember their icons across launches - fixed 3025421 -- Dragging from location field proxy icon to favorites bar loses page icon - part of fix for 3026279 -- Bookmarks should lose their favIcons when the URL is edited * Bookmarks.subproj/WebBookmarkLeaf.m: (-[WebBookmarkLeaf initFromDictionaryRepresentation:withGroup:]): (-[WebBookmarkLeaf dictionaryRepresentation]): Removed the #ifdeffed-out code for storing iconURL in dictionary; this was unnecessary because it is also done by the lower-level WebHistoryItem. * History.subproj/WebHistoryItem.m: (-[WebHistoryItem _setIcon:]): New method, extracted from -icon for clarity. (-[WebHistoryItem icon]): Fixed problem where once an icon was set it would never be changed, even if the iconURL is changed. Also, use _setIcon for clarity and to fix retainCount bugs. (-[WebHistoryItem dictionaryRepresentation]): Removed the #ifdef around the line that stores the URL in the dictionary. Gramps decided that this architecture is OK after all. 2002-08-16 Darin Adler <darin@apple.com> Fixed broken build. * Misc.subproj/WebTestController.m: Added empty placeholder methods. 2002-08-15 John Sullivan <sullivan@apple.com> - fixed 3025770 -- "New Bookmark" button hits assertion and crashes * Bookmarks.subproj/WebBookmarkLeaf.m: (-[WebBookmarkLeaf setURLString:]): Instead of asserting that parameter is not nil, handle the nil case by converting to empty string. This was another regression from yesterday's favIcon changes. === Alexander-19 === 2002-08-15 John Sullivan <sullivan@apple.com> Disabled support for storing favIcon URLs in bookmarks; Gramps realized this is an architecture problem that needs a better solution, and he didn't want to ship Alex-18 with this problem. * Bookmarks.subproj/WebBookmarkLeaf.m: (-[WebBookmarkLeaf dictionaryRepresentation]): * History.subproj/WebHistoryItem.m: (-[WebHistoryItem dictionaryRepresentation]): Commented out the code that added the iconURLString in the dictionary used for writing out file. This dictionary is also used on the pasteboard, so this change causes the favIcon not to be remembered when you drag from proxy icon to favorites bar. === Alexander-18 === 2002-08-14 Chris Blumenberg <cblu@apple.com> Support for showing favicons in bookmarks and history. Renamed "image" to "icon" in all places. Made history and bookmarks take and save an icon URL * Bookmarks.subproj/WebBookmark.h: * Bookmarks.subproj/WebBookmark.m: (-[WebBookmark icon]): (-[WebBookmark iconURL]): (-[WebBookmark setIconURL:]): * Bookmarks.subproj/WebBookmarkGroup.h: * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup _setTopBookmark:]): (-[WebBookmarkGroup addNewBookmarkToBookmark:withTitle:iconURL:URLString:type:]): (-[WebBookmarkGroup insertNewBookmarkAtIndex:ofBookmark:withTitle:iconURL:URLString:type:]): * Bookmarks.subproj/WebBookmarkLeaf.h: * Bookmarks.subproj/WebBookmarkLeaf.m: (-[WebBookmarkLeaf initFromDictionaryRepresentation:withGroup:]): (-[WebBookmarkLeaf dictionaryRepresentation]): (-[WebBookmarkLeaf copyWithZone:]): (-[WebBookmarkLeaf icon]): (-[WebBookmarkLeaf iconURL]): (-[WebBookmarkLeaf setIconURL:]): (-[WebBookmarkLeaf setURLString:]): * Bookmarks.subproj/WebBookmarkList.h: * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList initWithTitle:group:]): (-[WebBookmarkList dealloc]): (-[WebBookmarkList copyWithZone:]): (-[WebBookmarkList icon]): * Bookmarks.subproj/WebBookmarkSeparator.m: (-[WebBookmarkSeparator icon]): * History.subproj/WebHistory.h: * History.subproj/WebHistory.m: (-[WebHistory updateURL:title:displayTitle:iconURL:forURL:]): * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem init]): (-[WebHistoryItem initWithURL:title:]): (-[WebHistoryItem initWithURL:target:parent:title:]): (-[WebHistoryItem dealloc]): (-[WebHistoryItem iconURL]): (-[WebHistoryItem icon]): (-[WebHistoryItem setIconURL:]): (-[WebHistoryItem dictionaryRepresentation]): (-[WebHistoryItem initFromDictionaryRepresentation:]): * History.subproj/WebHistoryPrivate.h: * History.subproj/WebHistoryPrivate.m: (-[WebHistoryPrivate updateURL:title:displayTitle:iconURL:forURL:]): * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebIconLoader.m: (+[WebIconLoader iconLoaderWithURL:]): (-[WebIconLoader initWithURL:]): (-[WebIconLoader URL]): (-[WebIconLoader _icons]): (-[WebIconLoader delegate]): (-[WebIconLoader iconFromCache]): (-[WebIconLoader startLoading]): (-[WebIconLoader WebResourceHandleDidFinishLoading:data:]): * WebCoreSupport.subproj/WebBridge.m: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): * WebView.subproj/WebLocationChangeHandler.h: * WebView.subproj/WebLocationChangeHandler.m: (-[WebLocationChangeHandler receivedPageIcon:fromURL:forDataSource:]): 2002-08-14 Darin Adler <darin@apple.com> Remove some unused things. Fix minor problems. * Plugins.subproj/WebPluginNullEventSender.m: * Plugins.subproj/WebPluginView.m: * WebCoreSupport.subproj/WebTextRenderer.m: Fixed places that were using the C++ bool instead of the Objective C BOOL. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _receivedData:]): Remove old code related to the dummy data source. * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:provisionalDataSource:controller:]): Remove _changeBridge, since we don't any more. Hoist the creation of the bridge up here. * WebView.subproj/WebFramePrivate.h: Remove _changeBridge. * WebView.subproj/WebFramePrivate.m: Remove _changeBridge. * WebView.subproj/WebHTMLRepresentation.h: * WebView.subproj/WebHTMLView.h: * WebView.subproj/WebImageRepresentation.h: * WebView.subproj/WebTextRepresentation.h: * WebView.subproj/WebTextView.h: Don't re-declare methods that are part of protocols we implement. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView initWithFrame:]): Don't add the mouse moved observer until the view gets put into a window. (-[WebHTMLView addMouseMovedObserver]): Added. (-[WebHTMLView removeMouseMovedObserver]): Added. (-[WebHTMLView viewWillMoveToWindow:]): Remove observer if we were in the main window. (-[WebHTMLView viewDidMoveToWindow]): Add observer if we are now in the main window. * WebView.subproj/WebHTMLViewPrivate.h: Add _frame method. Remove unused controller and cursor instance variables. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _frame]): Added. (-[WebHTMLView _bridge]): Call _frame. * WebView.subproj/WebTextRepresentation.m: Add now-needed import. * WebView.subproj/WebHTMLRepresentation.m: Tweak. 2002-08-13 Maciej Stachowiak <mjs@apple.com> Add the ability to determine the classes of live JavaScript objects, to help with leak fixing. * Misc.subproj/WebCoreStatistics.h: * Misc.subproj/WebCoreStatistics.m: (+[WebCoreStatistics javaScriptLiveObjectClasses]): 2002-08-12 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge isReloading]): Change dataSourceIsReloading to isReloading. 2002-08-12 Maciej Stachowiak <mjs@apple.com> * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: Remove private _flags and _attributes accessors, now that Ken added public versions. * WebView.subproj/WebFrame.m: (-[WebFrame reload:]): Remove sole use thereof. === Alexander-17 === 2002-08-10 Ken Kocienda <kocienda@apple.com> Added support for "stale mode" (loads triggered by use of back/forward), and added support for reload. Also added a bridge function so the WebCore cache can tell if a load is a reload. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge dataSourceIsReloading]): New method. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]): Use same flags that were used for main resource load. * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource attributes]): New accessor. (-[WebDataSource flags]): New accessor. * WebView.subproj/WebFrame.m: (-[WebFrame reload:]): Reload adds WebResourceHandleFlagLoadFromOrigin flag to load. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _goToItem:withFrameLoadType:]): Adds flags so that WebFoundation can tell when back/forward has been used. === milestone 0.5 === === Alexander-16 === 2002-08-09 Chris Blumenberg <cblu@apple.com> - Cache icon image for HTML files - resize the icon in WebIconLoader instead of in multiple places elsewhere * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebIconLoader.m: (+[WebIconLoader _resizeImage:]): (+[WebIconLoader defaultIcon]): call _resizeImage (+[WebIconLoader iconForFileAtPath:]): added, caches html icon (-[WebIconLoader WebResourceHandleDidFinishLoading:data:]): call _resizeImage * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): call iconForFileAtPath 2002-08-08 Maciej Stachowiak <mjs@apple.com> Fix to get onLoad to fire, so the iBench test works. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Return the bridge for the new child frame. 2002-08-08 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Change the group name back to Debug. 2002-08-08 Richard Williamson <rjw@apple.com> Added flag to turn on/off buffered text drawing to help determine if we get any speed boost. Run from console with "-BufferTextDrawing YES" to enable buffered text drawing. Moved buffered text drawing out of web core. * WebCoreSupport.subproj/WebTextRenderer.h: * WebCoreSupport.subproj/WebTextRenderer.m: (+[WebTextRenderer shouldBufferTextDrawing]): (+[WebTextRenderer initialize]): (-[WebTextRenderer drawGlyphs:numGlyphs:fromGlyphPosition:toGlyphPosition:atPoint:withTextColor:backgroundColor:]): * WebCoreSupport.subproj/WebTextRendererFactory.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): 2002-08-08 Darin Adler <darin@apple.com> Placeholders for the "drawing observer" method that I'll be using to implement the "dump page as diffable text" feature. * Misc.subproj/WebTestController.h: Added. * Misc.subproj/WebTestController.m: Added. * WebKit.pbproj/project.pbxproj: Mention new files. * WebKit.exp: Mention new class. * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: Changed "fixed font size" to "default fixed font size". 2002-08-08 Chris Blumenberg <cblu@apple.com> * Plugins.subproj/WebPluginStream.m: (-[WebPluginStream finishedLoadingWithData:]): call [NSFileManager _web_carbonPathForPath:] 2002-08-08 Maciej Stachowiak <mjs@apple.com> - fixed 2957197 - Need API for getting/setting default text encoding * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate init]): Set default encoding if no other is set. * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): Added support for default text encoding pref. (-[WebPreferences defaultTextEncoding]): Likewise. (-[WebPreferences setDefaultTextEncoding:]): Likewise. 2002-08-08 Richard Williamson <rjw@apple.com> Changes to coalesce all drawing calls of the same text style and color into one call to CG. Significantly improves drawing time. My tests should about 7-8% on ALL pages. Disabled the code for now until I can verify on speed improvements on Ken's test rig. * WebCoreSupport.subproj/WebGlyphBuffer.h: Added. * WebCoreSupport.subproj/WebGlyphBuffer.m: Added. (-[WebGlyphBuffer initWithFont:color:]): (-[WebGlyphBuffer font]): (-[WebGlyphBuffer color]): (-[WebGlyphBuffer reset]): (-[WebGlyphBuffer dealloc]): (-[WebGlyphBuffer drawInView:]): (-[WebGlyphBuffer addGlyphs:advances:count:at::]): * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawGlyphs:numGlyphs:fromGlyphPosition:toGlyphPosition:atPoint:withTextColor:backgroundColor:]): * WebCoreSupport.subproj/WebTextRendererFactory.h: * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory coalesceTextDrawing]): (-[WebTextRendererFactory startCoalesceTextDrawing]): (-[WebTextRendererFactory endCoalesceTextDrawing]): (-[WebTextRendererFactory glyphBufferForFont:andColor:]): (-[WebTextRendererFactory dealloc]): * WebKit.pbproj/project.pbxproj: 2002-08-07 Maciej Stachowiak <mjs@apple.com> WebKit work for: - fixed 2956008 - Need API for getting/setting text encoding for current page * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge receivedData:withDataSource:]): Handle override encoding, if any. * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithURL:attributes:flags:]): Remember the flags and attributes. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate init]): Initialize overrideEncoding (-[WebDataSourcePrivate dealloc]): Release attributes (-[WebDataSource _setOverrideEncoding:]): Added. (-[WebDataSource _overrideEncoding]): Added. (-[WebDataSource _flags]): Added. (-[WebDataSource _attributes]): Added. * WebView.subproj/WebFrame.m: (-[WebFrame startLoading]): Pass proper forceRefresh value to data source based on load type (but the data source will ignore it). (-[WebFrame reload:]): Made this work a bit better. Now instead of crashing, it will actually reload, but it won't force a refresh (and may not handle the back/forward issues properly). * WebView.subproj/WebDocument.h: Defined new WebDocumentTextEncoding protocol. * WebView.subproj/WebHTMLView.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView textEncoding]): Implemented WebDocumentTextEncoding protocol. (-[WebHTMLView setTextEncoding:]): Implemented WebDocumentTextEncoding protocol. (-[WebHTMLView setDefaultTextEncoding]): Implemented WebDocumentTextEncoding protocol. (-[WebHTMLView usingDefaultTextEncoding]): Implemented WebDocumentTextEncoding protocol. 2002-08-07 John Sullivan <sullivan@apple.com> - fixed 3017245 -- Shift-Delete should go forward * WebView.subproj/WebView.m: (-[WebView keyDown:]): Check for shift-delete. 2002-08-07 Richard Williamson <rjw@apple.com> Fixed scrollview related drawing turd problems. (3000844 and 2896459). * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]): * WebView.subproj/WebView.m: (-[WebView setFrame:]): 2002-08-07 Darin Adler <darin@apple.com> * WebView.subproj/WebFrame.m: (-[WebFrame setProvisionalDataSource:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _goToItem:withFrameLoadType:]): Call _web_URLWithoutFragment by its new name _web_URLByRemovingFragment. 2002-08-07 Chris Blumenberg <cblu@apple.com> Fixed: 3018632 - the show javascript files inline bug * WebView.subproj/WebDataSourcePrivate.m: (+[WebDataSource _repTypes]): support application/x-javascript * WebView.subproj/WebViewPrivate.m: (+[WebView _viewTypes]): support application/x-javascript 2002-08-07 John Sullivan <sullivan@apple.com> * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_superviewOfClass:]): Changed name from _web_superviewWithName: and made it take a Class object instead of a string. * Plugins.subproj/WebNullPluginView.m: (-[WebNullPluginView drawRect:]): * Plugins.subproj/WebPluginView.m: (-[WebPluginView start]): (-[WebPluginView layout]): Updated callers of _web_superviewWithName: * WebKit.pbproj/project.pbxproj: Changed WebNSViewExtras.h from Public to Private 2002-08-06 Darin Adler <darin@apple.com> Fix assert I saw while fixing bug 2965321. * WebView.subproj/WebControllerPrivate.m: (-[WebController _receivedError:forResourceHandle:partialProgress:fromDataSource:]): Create a suitable resource identifier from the failing URL in the WebError for cases where we fail before we are able to construct a resource handle. 2002-08-06 Darin Adler <darin@apple.com> - fixed 2970516 -- Activate Events don't appear to be coming in to the Java Applet.plugin correctly. * Plugins.subproj/WebPluginView.m: (-[WebPluginView sendActivateEvent:]): Use activeFlag to set modifiers, not activMask, which is an event mask. 2002-08-06 John Sullivan <sullivan@apple.com> Add mechanism to store userStyleSheet preferences in WebKit in preparation for Dave wiring up the implementation. * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (-[WebPreferences userStyleSheetEnabled]), (-[WebPreferences setUserStyleSheetEnabled:]), (-[WebPreferences userStyleSheetLocation]), (-[WebPreferences setUserStyleSheetLocation:]): New methods, read and write UserDefaults values. (+[WebPreferences load]): Set initial values for userStyleSheetEnabled and userStyleSheetLocation 2002-08-06 Maciej Stachowiak <mjs@apple.com> Removed some APPLE_CHANGES no longer needed after the part change. * WebCoreSupport.subproj/WebBridge.m: Remove setOpenedByScript: and openedByScript methods now that they are not needed. * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: Remove setOpenedByScript: and openedByScript methods now that they are not needed. 2002-08-06 Darin Adler <darin@apple.com> - fixed 3017761 -- dataSource != nil assertion navigating at yahoo.com * WebView.subproj/WebLocationChangeHandler.h: * WebView.subproj/WebLocationChangeHandler.m: Change client redirect calls to pass the frame, not the data source. At the time a client redirect is requested, it's not even clear yet which data source will be involved. We may want to make some of the other calls pass frames, also, aside from the "start", "committed", "done", calls, which must specify the data source. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportClientRedirectTo:delay:fireDate:]): Pass frame, not data source. (-[WebBridge reportClientRedirectCancelled]): Pass frame, not data source. 2002-08-06 Darin Adler <darin@apple.com> * lots of files: Changed url to URL in many places and renamed URL-related methods. 2002-08-06 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge dataSourceChanged]): Call setParent:. * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate init]): Initialize the text size multiplier to 1. * WebView.subproj/WebDataSource.h: Removed [redirectedURL], deprecated [inputURL], added [URL]. * WebView.subproj/WebDataSource.m: (-[WebDataSource URL]): Added. Returns current URL, without requiring separate logic for the redirected and not-yet-redirected cases. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): Use [WebDataSource URL]. * WebView.subproj/WebDefaultContextMenuHandler.m: (-[WebDefaultContextMenuHandler openFrameInNewWindow:]): Use [WebDataSource URL]. 2002-08-06 John Sullivan <sullivan@apple.com> WebKit part of fix for 3017539 -- Replace Serif and Sans-serif font preferences with Default preference; let fixed width font size be independent. * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): Add default value for fixed width size (-[WebPreferences fixedFontSize]), (-[WebPreferences setFixedFontSize:]): New methods. 2002-08-06 Darin Adler <darin@apple.com> - fixed 3017536 -- Change default font to Lucida Grande 14 pt. * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): Changed default font and sans serif font family names to Lucida Grande. Changed default font size to 14 point. 2002-08-05 Maciej Stachowiak <mjs@apple.com> fixed 2974993 - window.open does not return the right window object fixed 3017140 - WebKit creates a new KHTMLPart per page; should reuse it like KHTML does * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation setDataSource:]): Don't swap the part at this point. Now it gets reused. 2002-08-05 Maciej Stachowiak <mjs@apple.com> * WebKit.pbproj/project.pbxproj: Fix tyops that broke Development build. 2002-08-05 Darin Adler <darin@apple.com> * .cvsignore: Ignore WebCore-combined.exp. 2002-08-05 Maciej Stachowiak <mjs@apple.com> - fixed 3007072 - need to be able to build fat * WebKit.pbproj/project.pbxproj: Fixed DeploymentFat build. * Makefile.am: Build WebCore-combined.exp for Development and Mixed build. * WebKit-tests.exp: Added. * WebKit.exp: Remove test-only function. 2002-08-05 Darin Adler <darin@apple.com> Do the wiring for the "text size multiplier" feature. The rest of the work will probably be done at the WebCore level. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setFrame:]): Set the text size multiplier. * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController setTextSizeMultiplier:]): Added. Calls _textSizeMultiplierChanged on the main frame. (-[WebController textSizeMultiplier]): Added. * WebView.subproj/WebControllerPrivate.h: Added textSizeMultiplier instance variable. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _textSizeMultiplierChanged]): Added. Calls setTextSizeMultiplier: on the bridge, and _textSizeMultiplierChanged on all the child frames. 2002-08-05 Chris Blumenberg <cblu@apple.com> Renamed icon loader delegate method to include the icon loader. * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebIconLoader.m: (-[WebIconLoader WebResourceHandleDidFinishLoading:data:]): * WebView.subproj/WebDataSourcePrivate.m: 2002-08-05 Richard Williamson <rjw@apple.com> Added additional check to find appropriate fonts with available weight, rather than always using a weight of 5. Regarding "kCGErrorFailure : can't find name id 4 for font id 8395" errors: CG appears to be lying to us about some fonts, Verdana in particular. It claims to have an available Verdana font w/ the correct traits, but spits errors when we request that font. Further, the Font Panel behaves oddly when you request Verdana. The panel displays the font but if you select the font it doesn't 'stick'. A mystery. * WebCoreSupport.subproj/WebTextRendererFactory.m: (-[WebTextRendererFactory fontWithFamily:traits:size:]): 2002-08-05 Darin Adler <darin@apple.com> - fixed 2986567 -- suppress return characters from title in title bar, status bar, menu items * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setTitle:]): Call _web_stringByCollapsingNonPrintingCharacters. 2002-08-05 Richard Williamson <rjw@apple.com> Added exported symbols file. * WebKit.exp: Added. * WebKit.pbproj/project.pbxproj: 2002-08-05 Darin Adler <darin@apple.com> - fixed 3014122 -- spinner never stops spinning when iframe has URL with bad path * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:provisionalDataSource:controller:]): Initialize the state in WebFramePrivate init instead. * WebView.subproj/WebFramePrivate.h: Remove WebFrameStateUninitialized. * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate init]): Set initial state to WebFrameStateComplete. (-[WebFrame _transitionToLayoutAcceptable]): Remove WebFrameStateUninitialized case. (-[WebFrame _transitionToCommitted]): Remove WebFrameStateUninitialized case. (-[WebFrame _isLoadComplete]): Remove WebFrameStateUninitialized case. * WebView.subproj/WebDataSource.h: Tweak. * WebView.subproj/WebDataSource.m: (-[WebDataSource stopLoading]): Move downloadHandler logic from here into _stopLoading. (-[WebDataSource isLoading]): Rewrite for simplicity. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _stopLoading]): Move downloadHandler logic here from stopLoading. Also make this work even if handles are removed from the list during the stop process. (-[WebDataSource _recursiveStopLoading]): Simplify a lot by using WebFrame's stopLoading. (-[WebDataSource _setTitle:]): Use the committed boolean rather than the state to check if the title change should be sent to the location change handler. 2002-08-05 Maciej Stachowiak <mjs@apple.com> * Misc.subproj/WebKitDebug.h: Put WEBKIT_ASSERT_NOT_REACHED() inside the appropriate #ifdef, and remove the various _log macros, which are onsolete in WebKit. 2002-08-05 Maciej Stachowiak <mjs@apple.com> Some changes related to re-merging the KHTMLPart end() method: * Misc.subproj/WebKitDebug.h: Added WEBKIT_ASSERT_NOT_REACHED(). * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToLayoutAcceptable]): Replace NSException with ASSERT_NOT_REACHED (this is an internal consistency check, not an argument check on a public API, so an assert is more appropriate than an exception). (-[WebFrame _transitionToCommitted]): Likewise. (-[WebFrame _isLoadComplete]): Likewise; also, remove bridge call to scrollToBaseAnchor:, since that will now happen automatically when calling end. 2002-08-02 Darin Adler <darin@apple.com> WebKit support for feature where client redirects are treated as if the page was continuing to load. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportClientRedirectTo:delay:fireDate:]): Added. Passes the client redirect along to the location change handler. (-[WebBridge reportClientRedirectCancelled]): Passes client redirect cancel along to the location change handler. (-[WebBridge dataSourceChanged]): Remove hack related to dummy data source. (-[WebBridge dataSource]): Remove hack related to dummy data source. * WebView.subproj/WebLocationChangeHandler.h: Added client redirect methods. Added class for base implementation of protocol. Updated stale comment. * WebView.subproj/WebLocationChangeHandler.m: Added. Provides base implementation of the WebLocationChangeHandler protocol so that clients don't need to implement all the methods if they are only interested in some of them. * WebKit.pbproj/project.pbxproj: Added WebLocationChangeHandler.m. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _goToItem:withFrameLoadType:]): Call scrollToAnchor under its new name. * Misc.subproj/WebIconLoader.h: * Misc.subproj/WebIconLoader.m: * WebView.subproj/WebControllerPolicyHandler.m: * WebView.subproj/WebControllerPolicyHandlerPrivate.h: Replaced __MyCompanyName__ with the actual name of our company. 2002-08-02 John Sullivan <sullivan@apple.com> - fixed 3015705 -- Command-up-arrow and -down-arrow should go to beginning and end of web page * WebView.subproj/WebView.m: (-[WebView keyDown:]): Added checks for command key. 2002-08-01 Richard Williamson <rjw@apple.com> Effort towards 3014555 (going back to frame), but not fixed. Need to think more about appropriate solution and compromises. * History.subproj/WebBackForwardList.h: * History.subproj/WebBackForwardList.m: (-[WebBackForwardList backEntryAtIndex:]): * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem initWithURL:title:]): (-[WebHistoryItem initWithURL:title:image:]): (-[WebHistoryItem initWithURL:target:parent:title:image:]): (-[WebHistoryItem dealloc]): (-[WebHistoryItem parent]): (-[WebHistoryItem setTitle:]): (-[WebHistoryItem setTarget:]): (-[WebHistoryItem setParent:]): (-[WebHistoryItem setDisplayTitle:]): * WebCoreSupport.subproj/WebBridge.m: * WebView.subproj/WebController.m: (-[WebController _goToItem:withFrameLoadType:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): (-[WebFrame _isLoadComplete]): (-[WebFrame _scrollToTop]): 2002-08-01 Chris Blumenberg <cblu@apple.com> Only send command key events if the plug-in is in the responder chain. * Plugins.subproj/WebPluginView.m: (-[WebPluginView isInResponderChain]): (-[WebPluginView performKeyEquivalent:]): (-[WebPluginView setWindow]): added some more logging 2002-08-01 Chris Blumenberg <cblu@apple.com> Only send command keyDown once by ignoring the keyDown that comes after performKeyEquivalent. * Plugins.subproj/WebPluginView.m: (-[WebPluginView keyDown:]): 2002-08-01 Chris Blumenberg <cblu@apple.com> Fixed: 2970530 - Command keys are not getting passed in to plugins * Plugins.subproj/WebPluginView.m: (-[WebPluginView performKeyEquivalent:]): 2002-08-01 Richard Williamson <rjw@apple.com> More back/forward work. Support for restoring scroll position. We still have a big remaining issue. We don't record the entire frame tree in back/forward items. This means going back or forward to a frame will looose the context of the containing frameset, see 3014555. * History.subproj/WebBackForwardList.m: (-[WebBackForwardList currentEntry]): * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem anchor]): (-[WebHistoryItem setAnchor:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportError:]): * WebView.subproj/WebController.m: (-[WebController _goToItem:withFrameLoadType:]): (-[WebController goBack]): (-[WebController goForward]): * WebView.subproj/WebFrame.m: (-[WebFrame setProvisionalDataSource:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): (-[WebFrame _isLoadComplete]): (-[WebFrame _goToItem:withFrameLoadType:]): (-[WebFrame _restoreScrollPosition]): (-[WebFrame _scrollToTop]): 2002-08-01 Chris Blumenberg <cblu@apple.com> Fixed: 2938010 - PLUGINS: right-click support 2938011 - PLUGINS: extended key events support 2970523 - Arrow key events not correctly passed to applets * Plugins.subproj/WebPluginView.m: (-[WebPluginView modifiersForEvent:]): (-[WebPluginView getCarbonEvent:withEvent:]): (-[WebPluginView mouseDown:]): (-[WebPluginView keyUp:]): (-[WebPluginView keyDown:]): (-[WebPluginView menuForEvent:]): === Alexander-15 === 2002-08-01 Don Melton <gramps@apple.com> Fixed deployment build compile problem. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): 2002-08-01 Maciej Stachowiak <mjs@apple.com> Remove stuff formerly useful for "View Reconstructed Source" feature but now useless. * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource documentTextFromDOM]): Removed. 2002-07-31 Maciej Stachowiak <mjs@apple.com> Changed things around so that WebFrame, not WebDataSource, owns WebBridge. This allows us to remove the dummy data source. * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:provisionalDataSource:controller:]): Remove all dummy data source-related crud, but call _changeBridge to create the initial bridge. (-[WebFrame setProvisionalDataSource:]): Remove dummy data source-related epicycles. * WebView.subproj/WebFramePrivate.h: Add bridge member to private class. * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate setDataSource:]): Don't remove old data source from frame, this is no longer needed and may even be harmful. (-[WebFrame _transitionToCommitted]): Remove much now-unneeded code. (-[WebFrame _isLoadComplete]): Get location change handler from controller. Don't call end on the bridge if the document is not html. (-[WebFrame _changeBridge]): Free the old bridge and make a new one. (-[WebFrame _bridge]): Get it directly, not from the data source. * WebView.subproj/WebDataSourcePrivate.h: Remove everything related to the `dummy' concept. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setFinalURL:]): Reorder code a bit. (-[WebDataSource _bridge]): Get bridge from frame. (-[WebDataSource _commitIfReady]): No more need to set the bridge's frame. (-[WebDataSource _makeRepresentation]): Set data source on the rep. (-[WebDataSource _startLoading:]): Get location change handler from controller. (-[WebDataSource _setTitle:]): Likewise. (-[WebDataSource receivedPageIcon:]): Likewise. (-[WebDataSource _loadIcon]): Likewise. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient WebResourceHandle:dataDidBecomeAvailable:]): Get location change handler from the controller. * WebView.subproj/WebViewPrivate.m: (-[WebView _makeDocumentViewForDataSource:]): Change *and* commit the data source. This could probably be collapsed down to one method now. * WebView.subproj/WebDocument.h: Added setDataSource: method to the WebDocumentRepresenation protocol. For now it is only useful for the HTML representation, but could potentially be useful for other representation classes. It should also allow the data source to be removed as a parameter from other methods, but I have not done that yet. It may be even better still to pass the data source as a paremeter to the init method. * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation init]): Remove allocation of bridge. (-[WebHTMLRepresentation dealloc]): Remove release of bridge. (-[WebHTMLRepresentation setDataSource:]): Store unretained reference to the data source's frame's bridge. * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _bridge]): Fetch the bridge from the frame, not the data source. * WebView.subproj/WebImageRepresentation.m: (-[WebImageRepresentation setDataSource:]): Added empty implementation. * WebView.subproj/WebTextRepresentation.m: (-[WebTextRepresentation setDataSource:]): Added empty implementation. * Plugins.subproj/WebPluginStream.m: (-[WebPluginStream setDataSource:]): Added empty implementation. 2002-07-30 Maciej Stachowiak <mjs@apple.com> Fixes of various bugs that prevented Alexander from running the Mozilla page load test. - fixed 3008682 - Alexander cannot run Mozilla-PLT * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge dataSourceChanged]): Don't call setURL: to set a URL that we got from a redirect; just pass it directly to openURL:. The inputURL is irrelevant. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setFinalURL:]): Don't call setURL: on the bridge; instead, assert that the data source is committed, because it would be a mistake to get a redirect after having received data. 2002-07-30 Richard Williamson <rjw@apple.com> Remove annoying log, it's really annoying. Added FIX ME comment instead. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): 2002-07-30 John Sullivan <sullivan@apple.com> - fixed 3012083 "Looked for URLs on the pasteboard, but found none" spam dragging nil-target bookmark * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_bestURLForDraggingInfo:]): This method was getting data for types on the pasteboard without first checking whether the types were on the pasteboard, a no-no. Restructured this method and tweaked it here and there also. (-[NSView _web_dragOperationForDraggingInfo:]): moved a fast test in front of a slow test 2002-07-29 Richard Williamson <rjw@apple.com> Removed setDirectsAllLinksToSystemBrowser: method, not needed and antiquated by the policy APIs. * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: 2002-07-29 Richard Williamson <rjw@apple.com> Changes to support the migration of back/forward list to WebKit. Back/forward in frames now works (2946164), still not done w/ restoring scroll positions (2927633). * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (+[WebHistoryItem entryWithURL:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController initWithView:provisionalDataSource:]): (-[WebController setUseBackForwardList:]): (-[WebController useBackForwardList]): (-[WebController goBack]): (-[WebController goForward]): * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebFrame.m: (-[WebFrame setProvisionalDataSource:]): * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): (-[WebFrame _setProvisionalDataSource:]): (-[WebFrame _goToURL:withFrameLoadType:]): * WebView.subproj/WebViewPrivate.m: (-[WebView _goBack]): (-[WebView _goForward]): 2002-07-29 Richard Williamson <rjw@apple.com> Fixed 3009074. Added [WebHTMLView jumpToSelection:] and related user interface item validation. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView jumpToSelection:]): (-[WebHTMLView validateUserInterfaceItem:]): 2002-07-29 Richard Williamson <rjw@apple.com> Fixed 3009085. Implemented takeFindStringFromSelection: on WebHTMLView and WebTextView. Also added user interface item validation for that method. * WebView.subproj/WebHTMLView.m: (-[WebHTMLView hasSelection]): (-[WebHTMLView takeFindStringFromSelection:]): (-[WebHTMLView validateUserInterfaceItem:]): * WebView.subproj/WebTextView.m: (-[WebTextView canTakeFindStringFromSelection]): (-[WebTextView takeFindStringFromSelection:]): 2002-07-29 Chris Blumenberg <cblu@apple.com> Fixed: 2971845 - text view uses default "user font" (Helvetica), not fonts chosen in Alexander preferences * WebView.subproj/WebTextView.m: (-[WebTextView initWithFrame:]): add observer (-[WebTextView dealloc]): remove observer (-[WebTextView setFixedWidthFont]): added, checks defaults (-[WebTextView dataSourceUpdated:]): calls setFixedWidthFont (-[WebTextView searchFor:direction:caseSensitive:]): no changes (-[WebTextView defaultsChanged:]): calls setFixedWidthFont 2002-07-27 Chris Blumenberg <cblu@apple.com> Implemented click policy, support for option-click Implemented dragging of links and images from WebHTMLView * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_dragShouldBeginFromMouseDown:withExpiration:]): added, moved from WebBrowser (-[NSView _web_dragOperationForDraggingInfo:]): don't accept drag if source == destination * WebView.subproj/WebControllerPolicyHandler.h: * WebView.subproj/WebControllerPolicyHandler.m: (-[WebPolicy URL]): needed for click policy (+[WebURLPolicy webPolicyWithURLAction:]): (+[WebFileURLPolicy webPolicyWithFileAction:]): (+[WebContentPolicy webPolicyWithContentAction:andPath:]): * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebController _downloadURL:toPath:]): added, simply downloads a URL * WebView.subproj/WebDefaultContextMenuHandler.m: (-[WebDefaultContextMenuHandler downloadURL:]): calls [WebController _downloadURL:toPath:] * WebView.subproj/WebDefaultPolicyHandler.m: (-[WebDefaultPolicyHandler clickPolicyForElement:button:modifierMask:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDown:]): calls _continueAfterCheckingDragForEvent (-[WebHTMLView mouseUp:]): calls _continueAfterClickPolicyForEvent (-[WebHTMLView draggingSourceOperationMaskForLocal:]): added (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): added, starts download * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLViewPrivate dealloc]): (-[WebHTMLView _elementAtPoint:]): (-[WebHTMLView _continueAfterClickPolicyForEvent:]): added, implements click policy (-[WebHTMLView _continueAfterCheckingDragForEvent:]): added, checks if mouse event is a drag 2002-07-26 Richard Williamson <rjw@apple.com> WebframeLoadType enum first value wasn't explicitly set, so 0 was used. I assumed 0 was unitialized, and depended on that to not execute some 'transitional' back/forward. This problem broke back/forward. * WebView.subproj/WebFramePrivate.h: 2002-07-26 John Sullivan <sullivan@apple.com> WebKit part of fix for 3009404 -- Back/Forward menu items should use [ and ], but command-arrows should still work too. * WebView.subproj/WebController.h: - added goForward to windowContext protocol. This is temporary, just like goBack here is temporary; they can be migrated into the new back-forward-in-WebKit design together. * WebView.subproj/WebView.m: (-[WebView keyDown:]): call _goBack and _goForward for command-arrow keys * WebView.subproj/WebViewPrivate.h, * WebView.subproj/WebViewPrivate.m: (-[WebView _goForward]): add _goForward, parallel to _existing goBack. 2002-07-26 Chris Blumenberg <cblu@apple.com> Fixed crash in unknown_text Fixed full-window plug-ins. I think darin broken this :) Cleaned up WebPluginStream a bit * Plugins.subproj/WebPluginDatabase.m: (-[WebPluginDatabase init]): * Plugins.subproj/WebPluginStream.m: (-[WebPluginStream getFunctionPointersFromPluginView:]): (-[WebPluginStream initWithURL:pluginPointer:notifyData:attributes:]): (-[WebPluginStream startLoad]): (-[WebPluginStream stop]): (-[WebPluginStream setUpGlobalsWithHandle:]): (-[WebPluginStream receivedError:]): (-[WebPluginStream receivedData:withDataSource:]): (-[WebPluginStream receivedError:withDataSource:]): (-[WebPluginStream WebResourceHandle:dataDidBecomeAvailable:]): (-[WebPluginStream WebResourceHandleDidCancelLoading:]): (-[WebPluginStream WebResourceHandle:didFailLoadingWithResult:]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _mainHandle]): added, WebPluginStream needs this 2002-07-25 Richard Williamson <rjw@apple.com> More incremental changes for back/forward migration. * History.subproj/WebBackForwardList.h: * History.subproj/WebBackForwardList.m: (-[WebBackForwardList init]): (-[WebBackForwardList dealloc]): (-[WebBackForwardList addEntry:]): (-[WebBackForwardList goBack]): (-[WebBackForwardList goBackToIndex:]): (-[WebBackForwardList backEntry]): (-[WebBackForwardList currentEntry]): (-[WebBackForwardList forwardEntry]): (-[WebBackForwardList goForward]): (-[WebBackForwardList goForwardToIndex:]): (-[WebBackForwardList canGoBack]): (-[WebBackForwardList canGoForward]): (-[WebBackForwardList description]): * History.subproj/WebHistoryItem.h: * History.subproj/WebHistoryItem.m: (-[WebHistoryItem initWithURL:title:]): (-[WebHistoryItem initWithURL:title:image:]): (-[WebHistoryItem initWithURL:target:title:image:]): (-[WebHistoryItem dealloc]): (-[WebHistoryItem target]): (-[WebHistoryItem setTarget:]): (-[WebHistoryItem setLastVisitedDate:]): (-[WebHistoryItem scrollPoint]): (-[WebHistoryItem setScrollPoint:]): * History.subproj/WebHistoryList.m: * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate setLoadType:]): (-[WebFrame _setLoadType:]): (-[WebFrame _loadType]): (-[WebFrame _transitionToCommitted]): 2002-07-25 Chris Blumenberg <cblu@apple.com> Made some WebPolicy API's private Added support for download link/image to disk * Misc.subproj/WebDownloadHandler.m: (-[WebDownloadHandler receivedData:]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebControllerPolicyHandler.h: * WebView.subproj/WebControllerPolicyHandler.m: (-[WebPolicyPrivate dealloc]): (-[WebPolicy _setPolicyAction:]): (-[WebPolicy policyAction]): (-[WebPolicy path]): (-[WebPolicy _setPath:]): (-[WebPolicy dealloc]): (+[WebURLPolicy webPolicyWithURLAction:]): (+[WebFileURLPolicy webPolicyWithFileAction:]): (+[WebContentPolicy webPolicyWithContentAction:andPath:]): (+[WebClickPolicy webPolicyWithClickAction:andPath:]): * WebView.subproj/WebControllerPolicyHandlerPrivate.h: Added. * WebView.subproj/WebDefaultContextMenuHandler.m: (-[WebDefaultContextMenuHandler downloadURL:]): (-[WebDefaultContextMenuHandler downloadLinkToDisk:]): (-[WebDefaultContextMenuHandler openImageInNewWindow:]): (-[WebDefaultContextMenuHandler downloadImageToDisk:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient WebResourceHandle:dataDidBecomeAvailable:]): 2002-07-25 Chris Blumenberg <cblu@apple.com> Fixed crasher caused by not retaining the content policy. * WebView.subproj/WebControllerPolicyHandler.h: * WebView.subproj/WebMainResourceClient.h: * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient WebResourceHandle:dataDidBecomeAvailable:]): 2002-07-25 Chris Blumenberg <cblu@apple.com> Made policy APIs return a WebPolicy object. Added click policy. * Misc.subproj/WebDownloadHandler.m: (-[WebDownloadHandler receivedData:]): (-[WebDownloadHandler finishedLoading]): (-[WebDownloadHandler cancel]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (+[WebController defaultURLPolicyForURL:]): * WebView.subproj/WebControllerPolicyHandler.h: * WebView.subproj/WebControllerPolicyHandler.m: Added. (-[WebPolicy initWithPolicyAction:]): (-[WebPolicy policyAction]): (+[WebURLPolicy webPolicyWithURLAction:]): (+[WebFileURLPolicy webPolicyWithFileAction:]): (+[WebContentPolicy webPolicyWithContentAction:andPath:]): (-[WebContentPolicy initWithContentPolicyAction:andPath:]): (-[WebContentPolicy dealloc]): (-[WebContentPolicy path]): (-[WebClickPolicy initWithClickPolicyAction:andPath:]): (+[WebClickPolicy webPolicyWithClickAction:andPath:]): (-[WebClickPolicy dealloc]): (-[WebClickPolicy path]): * WebView.subproj/WebControllerPrivate.m: (-[WebController _receivedError:forResourceHandle:partialProgress:fromDataSource:]): * WebView.subproj/WebDataSource.h: * WebView.subproj/WebDataSource.m: (-[WebDataSource contentPolicy]): (-[WebDataSource fileType]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _setContentPolicy:]): (-[WebDataSource _commitIfReady]): (-[WebDataSource _isReadyForData]): * WebView.subproj/WebDefaultPolicyHandler.m: (-[WebDefaultPolicyHandler URLPolicyForURL:]): (-[WebDefaultPolicyHandler fileURLPolicyForMIMEType:dataSource:isDirectory:]): (-[WebDefaultPolicyHandler unableToImplementFileURLPolicy:error:forDataSource:]): (-[WebDefaultPolicyHandler unableToImplementURLPolicy:error:forURL:]): (-[WebDefaultPolicyHandler pluginNotFoundForMIMEType:pluginPageURL:]): (-[WebDefaultPolicyHandler clickPolicyForElement:button:modifierMask:]): * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:provisionalDataSource:controller:]): * WebView.subproj/WebFramePrivate.m: (-[WebFrame _shouldShowDataSource:]): * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient receivedProgressWithHandle:complete:]): (-[WebMainResourceClient receivedError:forHandle:]): (-[WebMainResourceClient WebResourceHandleDidFinishLoading:data:]): (-[WebMainResourceClient WebResourceHandle:dataDidBecomeAvailable:]): 2002-07-25 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Add DeploymentFat build style. 2002-07-25 Darin Adler <darin@apple.com> WebKit part of fix for 3006054 -- assert error failingURL != nil * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge reportError:]): New. Passes the error to the controller associated with the dataSource. * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]): Call absoluteString. (-[WebSubresourceClient WebResourceHandleDidCancelLoading:]): Call absoluteString. * WebView.subproj/WebController.m: (-[WebController haveContentPolicy:andPath:forDataSource:]): Call absoluteString. * WebView.subproj/WebControllerPrivate.m: (-[WebController _receivedError:forResourceHandle:partialProgress:fromDataSource:]): Don't call absoluteString. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _shouldShowDataSource:]): Call absoluteString. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient WebResourceHandleDidCancelLoading:]): Call absoluteString. 2002-07-25 Chris Blumenberg <cblu@apple.com> Remove reloadImage until its implemented. * WebView.subproj/WebDefaultContextMenuHandler.m: (-[WebDefaultContextMenuHandler contextMenuItemsForElement:defaultMenuItems:]): 2002-07-25 Chris Blumenberg <cblu@apple.com> Renamed elementInfoAtPoint to elementAtPoint * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDefaultContextMenuHandler.h: * WebView.subproj/WebDefaultContextMenuHandler.m: (+[WebDefaultContextMenuHandler addMenuItemWithTitle:action:target:toArray:]): renamed (-[WebDefaultContextMenuHandler contextMenuItemsForElement:defaultMenuItems:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementAtPoint:]): 2002-07-24 Chris Blumenberg <cblu@apple.com> tiny change * WebView.subproj/WebDefaultContextMenuHandler.m: 2002-07-24 Chris Blumenberg <cblu@apple.com> Added implmentations for a few context menu items. * WebView.subproj/WebController.h: * WebView.subproj/WebDefaultContextMenuHandler.h: * WebView.subproj/WebDefaultContextMenuHandler.m: (-[WebDefaultContextMenuHandler dealloc]): (-[WebDefaultContextMenuHandler contextMenuItemsForElement:defaultMenuItems:]): (-[WebDefaultContextMenuHandler validateUserInterfaceItem:]): (-[WebDefaultContextMenuHandler openNewWindowWithURL:]): (-[WebDefaultContextMenuHandler openLinkInNewWindow:]): (-[WebDefaultContextMenuHandler copyLinkToClipboard:]): (-[WebDefaultContextMenuHandler openImageInNewWindow:]): (-[WebDefaultContextMenuHandler copyImageToClipboard:]): (-[WebDefaultContextMenuHandler reloadImage:]): (-[WebDefaultContextMenuHandler openFrameInNewWindow:]): * WebView.subproj/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): 2002-07-24 Richard Williamson <rjw@apple.com> Removed vestigal locationChangeHandler ivar. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): 2002-07-24 Chris Blumenberg <cblu@apple.com> Call [self _locationChangeHandler] instead of _private-locationChangeHandler * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource receivedPageIcon:]): 2002-07-24 Richard Williamson <rjw@apple.com> Implemented find for text views. * WebView.subproj/WebTextView.m: (-[NSString findString:selectedRange:options:wrap:]): (-[WebTextView searchFor:direction:caseSensitive:]): 2002-07-24 Chris Blumenberg <cblu@apple.com> Implemented initial contextual menus. None activated yet. * WebView.subproj/WebDefaultContextMenuHandler.h: * WebView.subproj/WebDefaultContextMenuHandler.m: (-[WebDefaultContextMenuHandler dealloc]): added (-[WebDefaultContextMenuHandler addMenuItemWithTitle:action:toArray:]): added (-[WebDefaultContextMenuHandler contextMenuItemsForElementInfo:defaultMenuItems:]): create menu items * WebView.subproj/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): 2002-07-24 Chris Blumenberg <cblu@apple.com> More renaming for WebDefaultPolicyHandler. * WebView.subproj/WebController.m: (-[WebController policyHandler]): * WebView.subproj/WebDefaultPolicyHandler.h: * WebView.subproj/WebDefaultPolicyHandler.m: 2002-07-24 Chris Blumenberg <cblu@apple.com> Renamed WebDefaultControllerPolicyHandler to WebDefaultPolicyHandler. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebDefaultControllerPolicyHandler.h: Removed. * WebView.subproj/WebDefaultControllerPolicyHandler.m: Removed. * WebView.subproj/WebDefaultPolicyHandler.h: Added. * WebView.subproj/WebDefaultPolicyHandler.m: Added. (-[WebDefaultControllerPolicyHandler initWithWebController:]): (-[WebDefaultControllerPolicyHandler URLPolicyForURL:]): (-[WebDefaultControllerPolicyHandler fileURLPolicyForMIMEType:dataSource:isDirectory:]): (-[WebDefaultControllerPolicyHandler unableToImplementFileURLPolicy:forDataSource:]): (-[WebDefaultControllerPolicyHandler requestContentPolicyForMIMEType:dataSource:]): (-[WebDefaultControllerPolicyHandler unableToImplementURLPolicyForURL:error:]): (-[WebDefaultControllerPolicyHandler unableToImplementContentPolicy:forDataSource:]): (-[WebDefaultControllerPolicyHandler pluginNotFoundForMIMEType:pluginPageURL:]): 2002-07-24 Chris Blumenberg <cblu@apple.com> More plumbing for contextual menu support. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController setContextMenuHandler:]): added (-[WebController contextMenuHandler]): added * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate init]): alloc WebDefaultContextMenuHandler (-[WebControllerPrivate dealloc]): dealloc WebDefaultContextMenuHandler (-[WebController _defaultContextMenuHandler]): * WebView.subproj/WebDefaultContextMenuHandler.h: Added. * WebView.subproj/WebDefaultContextMenuHandler.m: Added. (-[WebDefaultContextMenuHandler contextMenuItemsForElementInfo:defaultMenuItems:]): new * WebView.subproj/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): call contextMenuHandlers * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _setController:]): added comment (-[WebHTMLView _controller]): added 2002-07-24 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer xHeight]): Added. Calls [NSFont xHeight]. * WebView.subproj/WebPreferences.h: * WebView.subproj/WebPreferences.m: (+[WebPreferences load]): (-[WebPreferences defaultFontSize]): (-[WebPreferences setDefaultFontSize:]): Renamed minimumFont to defaultFont, and changed it from 11 to 16. Also changed default monospaced font to Courier instead of Monaco. 2002-07-24 Richard Williamson <rjw@apple.com> Support for find in HTML, find in text view coming soon. * WebView.subproj/WebDocument.h: * WebView.subproj/WebHTMLView.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView searchFor:direction:caseSensitive:]): * WebView.subproj/WebTextView.h: * WebView.subproj/WebTextView.m: (-[WebTextView searchFor:direction:caseSensitive:]): 2002-07-23 Chris Blumenberg <cblu@apple.com> More plumbing for contextual menu support. * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): * WebView.subproj/WebHTMLViewPrivate.h: * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView _elementInfoAtPoint:]): added 2002-07-23 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Fix file reference types to be more consistent. 2002-07-23 Chris Blumenberg <cblu@apple.com> Initial plumbing for contextual menu support. * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge elementInfoForMouseEvent:]): added * WebView.subproj/WebController.h: * WebView.subproj/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): added 2002-07-23 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Fix paths for newly added files. 2002-07-23 Richard Williamson <rjw@apple.com> Cleaned up LocationChangeHandler. We now have one per controller. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController policyHandler]): (-[WebController setLocationChangeHandler:]): (-[WebController locationChangeHandler]): * WebView.subproj/WebControllerPolicyHandler.h: * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _setIsDummy:) (-[WebDataSource _isDummy]): Hack on hack. MJS will remove when the dummy data source hack is removed. (-[WebDataSource _locationChangeHandler]): (-[WebDataSource _removeFromFrame]): (-[WebFrame initWithName:webView:provisionalDataSource:controller:]): (-[WebFrame setProvisionalDataSource:]): * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate dealloc]): Added default policy handler. This is used if no policy handler is set on the controller. * WebView.subproj/WebDefaultControllerPolicyHandler.h: Added. * WebView.subproj/WebDefaultControllerPolicyHandler.m: Added. (-[WebDefaultControllerPolicyHandler initWithWebController:]): (-[WebDefaultControllerPolicyHandler URLPolicyForURL:]): (-[WebDefaultControllerPolicyHandler fileURLPolicyForMIMEType:dataSource:isDirectory:]): (-[WebDefaultControllerPolicyHandler unableToImplementFileURLPolicy:forDataSource:]): (-[WebDefaultControllerPolicyHandler requestContentPolicyForMIMEType:dataSource:]): (-[WebDefaultControllerPolicyHandler unableToImplementURLPolicyForURL:error:]): (-[WebDefaultControllerPolicyHandler unableToImplementContentPolicy:forDataSource:]): (-[WebDefaultControllerPolicyHandler pluginNotFoundForMIMEType:pluginPageURL:]): * WebView.subproj/WebFrame.m: 2002-07-23 Darin Adler <darin@apple.com> * Makefile.am: Clean based on all, not all-am, so it happens before subdirs if any. 2002-07-23 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebTextRenderer.m: (-[WebTextRenderer drawUnderlineForCharacters:stringLength:atPoint:withColor:]): Change API to take character array instead of a string. * WebKit.pbproj/project.pbxproj: Took "subproj" off the names of some groups. === Alexander-14 === 2002-07-22 Richard Williamson <rjw@apple.com> Moved back/forward list from Alex's document to WebController. First step to address a series of back/forward related issues. * WebView.subproj/WebController.h: * WebView.subproj/WebController.m: (-[WebController backForwardList]): * WebView.subproj/WebControllerPrivate.h: * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate init]): (-[WebControllerPrivate dealloc]): 2002-07-22 Chris Blumenberg <cblu@apple.com> Strip white space before and after URL string 2998696 * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_bestURLForDraggingInfo:]): 2002-07-22 Ken Kocienda <kocienda@apple.com> * WebView.subproj/WebHTMLView.m: import of removed WebFrame bridge header was left in, causing a build break. 2002-07-22 Maciej Stachowiak <mjs@apple.com> Merged WebBridge and WebFrameBridge. * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge childFrames]): Return bridges, not frameBridges. (-[WebBridge descendantFrameNamed:]): Return bridge, not frameBridge. (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Return a bridge, not a frameBridge. (-[WebBridge mainFrame]): Return a bridge, not a frameBridge. (-[WebBridge frameNamed:]):Return a bridge, not a frameBridge. (-[WebBridge loadURL:attributes:flags:withParent:]): Moved from WebFrameBridge. (-[WebBridge loadURL:]): Moved from WebFrameBridge. (-[WebBridge postWithURL:data:]): Moved from WebFrameBridge. * WebCoreSupport.subproj/WebFrameBridge.h: Removed. * WebCoreSupport.subproj/WebFrameBridge.m: Removed. * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:provisionalDataSource:controller:]): Don't create a WebFrameBridge. * WebView.subproj/WebFramePrivate.h: * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate dealloc]): No longer dealloc frameBridge, since we don't have one. (-[WebFrame _transitionToCommitted]): Pass along the frame's render part, if any. (-[WebFrame _frameBridge]): Removed. * WebKit.pbproj/project.pbxproj: Removed deleted files. 2002-07-22 Maciej Stachowiak <mjs@apple.com> Change WebBridge to hold on to a WebFrame instead of a WebDataSource. Since we will no longer ever have a bridge for a provisional data source, we'll just bind the bridge to a frame. Which means we can merge the bridge and the frame bridge next. * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: Changed below methods to work with direct knowledge of the frame but not the bridge (mostly a simplification). (-[WebBridge frame]): (-[WebBridge parent]): (-[WebBridge childFrames]): (-[WebBridge descendantFrameNamed:]): (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): (-[WebBridge openNewWindowWithURL:]): (-[WebBridge areToolbarsVisible]): (-[WebBridge setToolbarsVisible:]): (-[WebBridge areScrollbarsVisible]): (-[WebBridge setScrollbarsVisible:]): (-[WebBridge isStatusBarVisible]): (-[WebBridge setStatusBarVisible:]): (-[WebBridge setWindowFrame:]): (-[WebBridge window]): (-[WebBridge setStatusText:]): (-[WebBridge mainFrame]): (-[WebBridge frameNamed:]): (-[WebBridge receivedData:withDataSource:]): (-[WebBridge objectLoadedFromCache:size:]): (-[WebBridge setFrame:]): (-[WebBridge dataSourceChanged]): (-[WebBridge dataSource]): (-[WebBridge openedByScript]): (-[WebBridge setOpenedByScript:]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady]): Set bridge's frame and notify that the data source changed. * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:provisionalDataSource:controller:]): Set bridge's frame. * WebView.subproj/WebFramePrivate.h, WebView.subproj/WebFramePrivate.m: (-[WebFrame _bridge]): Method to get the bridge. 2002-07-21 Maciej Stachowiak <mjs@apple.com> Removed provisional/committed distinction from WebCore and the WebCore SPI. WebCore will never see a provisional data source or provisional anything, any more. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge descendantFrameNamed:]): Don't bother with the provisional bridge - no such thing. (-[WebBridge setDataSource:]): Assert the data source is committed. * WebCoreSupport.subproj/WebFrameBridge.m: (-[WebFrameBridge bridge]): Return committed bridge always, and remove committed bridge method. 2002-07-21 Maciej Stachowiak <mjs@apple.com> Fix a regression in my recent refactoring that broke JavaScript window opening, by doing some trickery to make a frame's initial dummy data source committed. * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:provisionalDataSource:controller:]): Create dummy data source as committed, not provisional. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToCommitted]): Allow the documentView to be nil if there is no webView either; this is temporarily needed to handle the special initial dummy data source, which will be going away soon. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _receivedData:]): Add temporary special case to avoid sending empty NSData to the representation, to avoid triggering WebCore assertions. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge openNewWindowWithURL:]): Get the committed data source, not the provisional one. 2002-07-21 Chris Blumenberg <cblu@apple.com> Used darin-inspired code factoring to fix 3000801 (alex doesn't accept drag of webloc file) in 3 places where we accept drags. * Misc.subproj/WebNSViewExtras.h: * Misc.subproj/WebNSViewExtras.m: (-[NSView _web_parentWebView]): no changes (-[NSView _web_acceptableDragTypes]): added (-[NSView _web_bestURLForDraggingInfo:]): added (-[NSView _web_dragOperationForDraggingInfo:]): added * WebKit.pbproj/project.pbxproj: made WebNSViewExtras.h public * WebView.subproj/WebView.m: (-[WebView initWithFrame:]): calls _web_acceptableDragTypes (-[WebView draggingEntered:]): calls _web_dragOperationForDraggingInfo (-[WebView concludeDragOperation:]): calls _web_bestURLForDraggingInfo 2002-07-21 Chris Blumenberg <cblu@apple.com> - We were loading icons when page loads ended in error. Fixed. - Special-case file URLs once instead of twice by moving NSWorkspace call out of WebIconLoader * Misc.subproj/WebIconLoader.m: (-[WebIconLoader startLoading]): removed file URL special-case * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): check for document error, send file icon to client if none has been set with the LINK tag 2002-07-21 Maciej Stachowiak <mjs@apple.com> * Makefile.am: Remove products from symroots on `make clean'. 2002-07-21 Maciej Stachowiak <mjs@apple.com> * WebKit.pbproj/project.pbxproj: Set directories for the group folders, so that creating new files in them will put them in the right directory by default. 2002-07-21 Maciej Stachowiak <mjs@apple.com> More refactoring. Change bridge to get the data source via a method instead of straight from the ivar, and in the method, assert that the data source is not nil and is not provisional. Turns out no one was using it while provisional, which is great. This means we can eliminate the provisional concept from the bridge interface as the next step. * WebCoreSupport.subproj/WebBridge.h: * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge dataSource]): New method to get data source - assert it is not nil, and committed. (-[WebBridge frame]): Get data source from method. (-[WebBridge childFrames]): Likewise. (-[WebBridge descendantFrameNamed:]): Likewise. (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Likewise. (-[WebBridge openNewWindowWithURL:]): Likewise. (-[WebBridge areToolbarsVisible]): Likewise. (-[WebBridge setToolbarsVisible:]): Likewise. (-[WebBridge areScrollbarsVisible]): Likewise. (-[WebBridge setScrollbarsVisible:]): Likewise. (-[WebBridge isStatusBarVisible]): Likewise. (-[WebBridge setStatusBarVisible:]): Likewise. (-[WebBridge setWindowFrame:]): Likewise. (-[WebBridge window]): Likewise. (-[WebBridge setTitle:]): Likewise. (-[WebBridge setStatusText:]): Likewise. (-[WebBridge mainFrame]): Likewise. (-[WebBridge frameNamed:]): Likewise. (-[WebBridge receivedData:withDataSource:]): Likewise. (-[WebBridge startLoadingResource:withURL:]): Likewise. (-[WebBridge objectLoadedFromCache:size:]): Likewise. (-[WebBridge setDataSource:]): Likewise. (-[WebBridge openedByScript]): Likewise. (-[WebBridge setOpenedByScript:]): Likewise. (-[WebBridge setIconURL:]): Likewise. (-[WebBridge setIconURL:withType:]): Likewise. * WebView.subproj/WebDataSourcePrivate.h, WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _isCommitted]): New private method to check if a data source is committed, for the benefit of WebBridge assertions. 2002-07-20 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Turn stricter warnings back on now that we don't use C++ any more. * Plugins.subproj/WebPluginView.m: (-[WebPluginView sendActivateEvent:]): Fix cast that stricter warning didn't like. (-[WebPluginView sendUpdateEvent]): Fix cast that stricter warning didn't like. (-[WebPluginView frameStateChanged:]): Remove unneeded cast that stricter warning didn't like. 2002-07-20 Darin Adler <darin@apple.com> - fixed 2999643 -- Leak of NSSet in -[IFStandardPanels _didStartLoadingURL:inController:] This is another case of the leak I fixed a month ago. I don't know how I managed to overlook this other code path with the identical bug. * Panels.subproj/WebStandardPanels.m: (-[WebStandardPanels _didStopLoadingURL:inController:]): Fix a leak caused by calling the wrong method. This was calling objectForKey: instead of removeObjectForKey:. 2002-07-20 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge areToolbarsVisible]): (-[WebBridge isStatusBarVisible]): Fix misspelling of visible. 2002-07-20 Maciej Stachowiak <mjs@apple.com> Changed the code to handle "icon" and "SHORTCUT ICON" links separately, and give higher priority to the former. Also, we don't start loading the icon the moment khtml finds one in the document any more, instead we wait until the document is done loading, in case there are both "icon" and "SHORTCUT ICON" link tags. - fixed 3003672 - Assertion failure related to iconloader on metafilter * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge setIconURL:]): Forward to the data source. (-[WebBridge setIconURL:withType:]): Likewise. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): Release iconURL. (-[WebDataSource _setDefaultIconURLIfUnset]): Renamed from _loadPageIconIfNecessary, and changed to only set iconURL rather than actually loading. (-[WebDataSource _setPrimaryLoadComplete:]): Call _loadIcon instead of _loadPageIconIfNecessary, since we defer all loads to this point. (-[WebDataSource _loadIcon]): Load current iconURL if set. (-[WebDataSource _setIconURL:]): Set iconURL if not set already (since typed icons are higher priority). (-[WebDataSource _setIconURL:withType:]): Set the iconURL. 2002-07-20 Darin Adler <darin@apple.com> - fixed 2999616 -- Possible leak in +[IFPluginDatabase installedPlugins] * Plugins.subproj/WebPluginDatabase.m: (+[WebPluginDatabase installedPlugins]): Move the code into an init function. (pluginLocations): Simplified. (-[WebPluginDatabase init]): Added. Cleaned up a bit, and made it release the WebPlugin objects -- this was the leak. (-[WebPluginDatabase dealloc]): Added. * Plugins.subproj/WebPluginDatabase.h: Tweaked formatting. * Plugins.subproj/WebPluginStream.h: * Plugins.subproj/WebPluginStream.m: (-[WebPluginStream startLoad]): (-[WebPluginStream stop]): * WebCoreSupport.subproj/WebSubresourceClient.m: (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]): (-[WebSubresourceClient WebResourceHandleDidCancelLoading:]): (-[WebSubresourceClient WebResourceHandleDidFinishLoading:data:]): (-[WebSubresourceClient WebResourceHandle:didFailLoadingWithResult:]): * WebView.subproj/WebDataSource.m: (-[WebDataSource stopLoading]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _setPrimaryLoadComplete:]): (-[WebDataSource _startLoading:]): (-[WebDataSource _addResourceHandle:]): (-[WebDataSource _removeResourceHandle:]): Changed code that called it a URLHandle to say resourceHandle. * WebView.subproj/WebFrame.m: (-[WebFrame dealloc]): Add an autorelease pool here since this is called from a timer and AppKit does not use an explicit autorelease pool in that case. This makes the "world leak check" work better, and is mildly helpful in other cases too. Radar 3003650 is a request for the AppKit team to fix this, but this workaround will do for now. 2002-07-19 Darin Adler <darin@apple.com> - fixed 3001951 -- Massive memory leak after running base or static PLT * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _makeRepresentation]): Add a missing release. Reduced our use of autorelease. This allows the page load test to detect leaks of the world much more easily. We may later find we need to use the "retain autorelease" idiom in a few more places, but I did a lot of testing and that did not show up. * Bookmarks.subproj/WebBookmarkGroup.m: (-[WebBookmarkGroup _setTopBookmark:]): Use a plain release. (-[WebBookmarkGroup _loadBookmarkGroupGuts]): Use a plain release. * Bookmarks.subproj/WebBookmarkList.m: (-[WebBookmarkList copyWithZone:]): Use a plain release. * Misc.subproj/WebIconLoader.m: (-[WebIconLoader WebResourceHandleDidFinishLoading:data:]): Use a plain release. * Plugins.subproj/WebPluginView.m: (-[WebPluginView loadURL:inTarget:withNotifyData:andHandleAttributes:]): Use a plain release. * WebView.subproj/WebController.m: (-[WebController createFrameNamed:for:inParent:allowsScrolling:]): Use a plain release. (-[WebController setWindowContext:]): Use a plain release. (-[WebController setResourceProgressHandler:]): Use a plain release. (-[WebController setDownloadProgressHandler:]): Use a plain release. (-[WebController setPolicyHandler:]): Use a plain release. * WebView.subproj/WebControllerPrivate.m: (-[WebControllerPrivate dealloc]): Use plain release. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): Use plain release. (-[WebDataSource _setPrimaryLoadComplete:]): Use plain release. (-[WebDataSource _setTitle:]): Use plain release. * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:provisionalDataSource:controller:]): Use plain release. (-[WebFrame reset]): Invalidate and release the timer. * WebView.subproj/WebFramePrivate.h: Keep a reference to the timer. * WebView.subproj/WebFramePrivate.m: (-[WebFramePrivate dealloc]): Invalidate and release the timer. Use plain release. (-[WebFramePrivate setName:]): Use plain release. (-[WebFramePrivate setWebView:]): Use plain release. (-[WebFramePrivate setDataSource:]): Use plain release. (-[WebFramePrivate setProvisionalDataSource:]): Use plain release. (-[WebFrame _scheduleLayout:]): Keep a reference to the timer. (-[WebFrame _timedLayout:]): Release and nil the timer. * WebView.subproj/WebRenderNode.m: (-[WebRenderNode initWithName:rect:view:children:]): Use plain release. * WebView.subproj/WebView.m: (-[WebView concludeDragOperation:]): Use plain release. * WebView.subproj/WebViewPrivate.m: (-[WebView _makeDocumentViewForDataSource:]): Use plain release. Other changes to make the new page load test feature work. * Misc.subproj/WebKitStatistics.h: * Misc.subproj/WebKitStatistics.m: (+[WebKitStatistics HTMLRepresentationCount]): Added a stat for WebHTMLRepresentation objects. * WebView.subproj/WebHTMLRepresentation.m: (-[WebHTMLRepresentation init]): Bump the count. (-[WebHTMLRepresentation dealloc]): Decrement the count. Renaming. * Misc.subproj/WebCoreStatistics.h: * Misc.subproj/WebKitStatisticsPrivate.h: * Misc.subproj/WebCoreStatistics.m: (+[WebCoreStatistics emptyCache]): (+[WebCoreStatistics setCacheDisabled:]): Renamed to include the word cache now that the class does not. * Plugins.subproj/WebPluginStream.m: * WebCoreSupport.subproj/WebSubresourceClient.m: * WebView.subproj/WebMainResourceClient.m: Updated for the WebFoundation renaming. 2002-07-19 Chris Blumenberg <cblu@apple.com> * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadPageIconIfNecessary]): use the correct relative string to request favicon.ico 2002-07-19 Chris Blumenberg <cblu@apple.com> * History.subproj/WebHistoryItem.m: (-[WebHistoryItem image]): call [WebIconLoader defaultIcon] * Misc.subproj/WebIconLoader.m: (+[WebIconLoader defaultIcon]): move bundle image loading code from [WebHistoryItem image] to here. 2002-07-19 Chris Blumenberg <cblu@apple.com> Added support favicons. * Misc.subproj/WebIconLoader.h: Added. * Misc.subproj/WebIconLoader.m: Added. (-[WebIconLoaderPrivate dealloc]): (+[WebIconLoader defaultIcon]): (-[WebIconLoader initWithURL:]): (-[WebIconLoader dealloc]): (-[WebIconLoader setDelegate:]): (-[WebIconLoader startLoading]): (-[WebIconLoader startLoadingOnlyFromCache]): (-[WebIconLoader stopLoading]): (-[WebIconLoader WebResourceHandleDidBeginLoading:]): (-[WebIconLoader WebResourceHandleDidCancelLoading:]): (-[WebIconLoader WebResourceHandleDidFinishLoading:data:]): (-[WebIconLoader WebResourceHandle:resourceDataDidBecomeAvailable:]): (-[WebIconLoader WebResourceHandle:resourceDidFailLoadingWithResult:]): (-[WebIconLoader WebResourceHandle:didRedirectToURL:]): * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge loadIcon:]): added * WebKit.pbproj/project.pbxproj: * WebView.subproj/WebControllerPrivate.m: (-[WebController _mainReceivedError:forResourceHandle:partialProgress:fromDataSource:]): * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _loadPageIconIfNecessary]): added (-[WebDataSource _setPrimaryLoadComplete:]): start loading icon (-[WebDataSource _stopLoading]): stop icon loader (-[WebDataSource receivedPageIcon:]): added (-[WebDataSource _loadIcon:]): added * WebView.subproj/WebLocationChangeHandler.h: 2002-07-19 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Forgot to export WebKitStatistics.h so it can be used by WebBrowser. 2002-07-19 Darin Adler <darin@apple.com> Added some stats that we can use to sniff out "leak the world" problems. * Misc.subproj/WebKitStatistics.h: Added. * Misc.subproj/WebKitStatistics.m: Added. * Misc.subproj/WebKitStatisticsPrivate.h: Added. * WebKit.pbproj/project.pbxproj: Added new files. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge init]): Bump count. (-[WebBridge dealloc]): Decrement count. * WebView.subproj/WebController.m: (-[WebController initWithView:provisionalDataSource:]): Bump count. (-[WebController dealloc]): Decrement count. * WebView.subproj/WebDataSource.m: (-[WebDataSource initWithURL:attributes:flags:): Bump count. (-[WebDataSource dealloc]): Decrement count. * WebView.subproj/WebFrame.m: (-[WebFrame initWithName:webView:provisionalDataSource:controller:]): Bump count. (-[WebFrame dealloc]): Decrement count. * WebView.subproj/WebView.m: (-[WebView initWithFrame:]): Bump count. (-[WebView dealloc]): Decrement count. 2002-07-19 Maciej Stachowiak <mjs@apple.com> More refactoring: Use assertions to make sure a provisional data source's bridge is never used - and then fix the places where it would have been used. :-) * WebView.subproj/WebDataSource.m: (-[WebDataSource documentTextFromDOM]): Return nil if the document is not committed. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _stopLoading]): Don't tell the bridge to stop if we're provisional, because we won't have one. (-[WebDataSource _setFinalURL:]): Don't try to set the bridge URL if we are not committed - it will get set at commit time. (-[WebDataSource _removeFromFrame]): Assert that the data soource is committed - a provisional data source should never be removed from a frame because it should never be in a frame in the first place. (-[WebDataSource _bridge]): Assert that the view is committed. (-[WebDataSource _commitIfReady]): Do nothing if already committed. (-[WebDataSource _receivedData:]): Notice that first byte was read, if appropriate, and commit when ready. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient WebResourceHandle:didRedirectToURL:]): Simplify code by using [WebDataSource _receivedData:] 2002-07-19 Maciej Stachowiak <mjs@apple.com> Fix a regression caused by a previous commit that broke frames. * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge receivedData:withDataSource:]): Instead setting the data source implicitly here, and doing other special first-time init, simply assert that we have a data source. (-[WebBridge setDataSource:]): Do the extra work when setting the data source here instead. * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady]): After making the representation, set the data source, because we no longer pass the first data chunk _before_ transitioning to committed, instead we do it right after, so the logic in WebBridge to do it implicitly was not going to cut it. 2002-07-18 Maciej Stachowiak <mjs@apple.com> More refactoring: Simplify a bit more by moving more logic into the data source. * WebView.subproj/WebDataSourcePrivate.h, WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _gotFirstByte]): Removed. (-[WebDataSource _setGotFirstByte]): Removed. (-[WebDataSource _isReadyForData]): Removed. (-[WebDataSource _receivedData:]): Commit if appropriate, and pass data to representation and documentView. * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient WebResourceHandle:resourceDataDidBecomeAvailable:]): Change the check back to policy != None, because the first chunk will trigger a commit in the policy == Show case, so there is no need to worry about it. 2002-07-18 Maciej Stachowiak <mjs@apple.com> Rename some methods for clarity. These two methods are defined by the end state, not the start state (in fact, transitionToLayoutAcceptable does most of it's work when it starts in the cimmitted state, not provisional). * WebView.subproj/WebFramePrivate.h, WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionToLayoutAcceptable]): Renamed from _transitionProvisionalToLayoutAcceptable. (-[WebFrame _transitionToCommitted]): Renamed from _transitionProvisionalToLayoutAcceptable. And adjust all the calls to them: * WebView.subproj/WebControllerPrivate.m: (-[WebController _receivedProgress:forResourceHandle:fromDataSource:complete:]): (-[WebController _mainReceivedProgress:forResourceHandle:fromDataSource:complete:]): * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady]): 2002-07-18 Maciej Stachowiak <mjs@apple.com> Even more exciting refactoring. Change the rules for committing the data source and creating the representation so that both happen when the first byte has been received _and_ the content policy has been set to show. Previously these actions happened at different times. Now we maintain the invariant that the data source has a representation if and only if it is committed. * WebView.subproj/WebController.m: (-[WebController haveContentPolicy:andPath:forDataSource:]): Simplify further by putting more of the work in WebDataSource. * WebView.subproj/WebControllerPrivate.m: (-[WebController _mainReceivedProgress:forResourceHandle:fromDataSource:complete:]): * WebView.subproj/WebDataSource.h, WebView.subproj/WebDataSource.m: Move makeRepresentation method to private file. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _setContentPolicy:]): If the policy is set to show, commit if we have already gotten the first byte. (-[WebDataSource _commitIfReady]): Create representation and commit if we have the first byte and have a policy of show. (-[WebDataSource _gotFirstByte]): Method to check if this data source has gotten the first byte yet. Commit here if ready. (-[WebDataSource _setGotFirstByte]): Method to report that some data has been received. (-[WebDataSource _makeRepresentation]): Make and set up teh document view too. (-[WebDataSource _isReadyForData]): Return TRUE if policy is set (and if the policy is Show, if we have also received the first byte. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionProvisionalToCommitted]): Don't call the datasource (it now calls us) * WebView.subproj/WebMainResourceClient.m: (-[WebMainResourceClient WebResourceHandle:resourceDataDidBecomeAvailable:]): * WebView.subproj/WebView.h, WebView.subproj/WebView.m: move makeDocumentViewForDataSource... * WebView.subproj/WebViewPrivate.h, WebView.subproj/WebViewPrivate.m: (-[WebView _makeDocumentViewForDataSource:]): To here. 2002-07-18 Maciej Stachowiak <mjs@apple.com> Avoid throwing an exception while stopping animations. Image renders were getting into the array multiple times, which means the code that iterated over the array backwards could throw an exception, because callling removeObject: on the array would remove all instances of the object. This probably fixes the following crashers, and a bunch of huge leaks: Radar 2999853 - Uninitialized memory access in plugins on theonion.com Radar 2999892 - Crash disconnecting view from next view chain on theonion.com Radar 2999911 - Infinite loop in [WebHTMLView dealloc], resulting in crash * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer scheduleFrame]): Move adding to array of image renderers from here... (-[WebImageRenderer beginAnimationInRect:fromRect:]): To here. === Alexander-13 === 2002-07-18 Maciej Stachowiak <mjs@apple.com> Yet still more refactoring in preparation for the KHTMLPart change. This is preparing things to change the commit rule to require receiving at least one byte of data, and having the content policy set to Show. * WebView.subproj/WebController.m: (-[WebController haveContentPolicy:andPath:forDataSource:]): Remove more code since makeRepresentation now does most of the work. * WebView.subproj/WebDataSource.m: (-[WebDataSource makeRepresentation]): Tell the WebView (if any) to create the documentView now too. * WebView.subproj/WebView.h: * WebView.subproj/WebView.m: (-[WebView makeDocumentViewForDataSource:]): Hook document view up to data source. 2002-07-18 Maciej Stachowiak <mjs@apple.com> Some refactoring in preparation for the KHTMLPart change. * WebView.subproj/WebDataSourcePrivate.h, WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _stopLoading]): Bail early if not loading. (-[WebDataSource _commit]): Method to mark when the data source is committed (it now knows whether it's committed or provisional). This will be useful for adding assertions later on about what operations may happen only when committed, and which can only happen when provisional. * WebView.subproj/WebFramePrivate.m: (-[WebFrame _transitionProvisionalToCommitted]): Call data source's _commit method. 2002-07-17 Richard Williamson <rjw@apple.com> * WebView.subproj/WebHTMLView.m: Removed unnecessary (and incorrect) lockFocus. 2002-07-17 Maciej Stachowiak <mjs@apple.com> Some refactoring in preparation for the KHTMLPart change. * WebView.subproj/WebController.m: (-[WebController haveContentPolicy:andPath:forDataSource:]): Move more of the work of creating and setting the representation and document view into WebDataSource and WebView. * WebView.subproj/WebDataSource.h, WebView.subproj/WebDataSource.m: (+[(id <WebDocumentRepresentation>) createRepresentationForMIMEType:]): Removed. (-[WebDataSource makeRepresentation]): A method to build the right kind of representation for the content type. * WebView.subproj/WebDataSourcePrivate.h: * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _representationClass]): Method to get the right representation class for the current content type. (-[WebDataSource _bridge]): Move here from WebBridge.[mh], so we can later add an assertion that the data source is not provisional. * WebView.subproj/WebHTMLViewPrivate.m: #import WebDataSourcePrivate.h * WebView.subproj/WebView.h, WebView.subproj/WebView.m: (+[(id <WebDocumentRepresentation>) createDocumentViewForMIMEType:]): Removed. (-[WebView makeDocumentViewForMIMEType:]): Method to build the right kind of document view for the specified MIME type. 2002-07-16 Darin Adler <darin@apple.com> * History.subproj/WebBackForwardList.m: Replace MyCompanyName with Apple Computer. (-[WebBackForwardList init]): Fix strange [super init] logic to be standard. * History.subproj/WebHistoryItem.h: Replace MyCompanyName with Apple Computer. * Misc.subproj/WebDownloadHandler.h: Replace MyCompanyName with Apple Computer. 2002-07-16 Darin Adler <darin@apple.com> - fixed 2997891 -- Alexander confused about base page URL for relative links * WebCoreSupport.subproj/WebSubresourceClient.m: (-[WebSubresourceClient WebResourceHandle:didRedirectToURL:]): Don't tell the bridge the URL changed. The bridge doesn't care about redirects for subresources (and if it did, we'd need some way to tell it that this was a subresource redirect). * WebCoreSupport.subproj/WebBridge.m: Formatting tweaks. * WebCoreSupport.subproj/WebImageRenderer.m: Formatting tweaks. * WebView.subproj/WebView.m: Formatting tweaks. 2002-07-16 Richard Williamson <rjw@apple.com> Really, stop animation if last frame has zero duration, like IE. Was checking adjustedFrameDuration, which is never zero. * WebCoreSupport.subproj/WebImageRenderer.m: (-[WebImageRenderer unadjustedFrameDuration]): (-[WebImageRenderer frameDuration]): (-[WebImageRenderer nextFrame:]): 2002-07-16 Maciej Stachowiak <mjs@apple.com> WebKit part of fix for: Radar 2982043 - Link mouse-over status should change in response to modifier keys * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge modifierTrackingEnabled]): Implemented by checking bit on WebHTMLView class. * WebKit.pbproj/project.pbxproj: Install WebHTMLViewPrivate as a Private header. * WebView.subproj/WebHTMLViewPrivate.h: Prototype new modifier tracking SPI. * WebView.subproj/WebHTMLViewPrivate.m: (+[WebHTMLView _setModifierTrackingEnabled:]): Method to inform WebHTMLView that modifier tracking is working. (+[WebHTMLView _modifierTrackingEnabled]): Obligatory getter. (+[WebHTMLView _postFlagsChangedEvent:]): Method to report flagsChanged events. Creates corresponding fake mouseMoved event and sends it as a notification. 2002-07-16 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/WebBridge.m: Remove childFrameNamed since it's not needed, and every one of these bridge methods adds potential confusion. (-[WebBridge descendantFrameNamed:]): Make this look for descendants in the provisional data sources first. This is the same change Richard made to childFrameNamed, but it turns out that this is the method that's really used. 2002-07-16 Darin Adler <darin@apple.com> * almost every file: Renamed IF* -> Web*. 2002-07-15 Richard Williamson <rjw@apple.com> Removed dependence on window resize notification. We now use the IFWebView setFrame: method to trigger layouts. Much cleaner. Cleaned up image animation timer scheduler. Stop animation if last frame has zero duration, like IE. Change minimum duration to 1/30th (used if zero frame duration is specified). This is closer to what I see in IE empirically. * WebCoreSupport.subproj/IFImageRenderer.h: * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer frameDuration]): (-[IFImageRenderer _scheduleFrame]): (-[IFImageRenderer nextFrame:]): (-[IFImageRenderer beginAnimationInRect:fromRect:]): * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView initWithFrame:]): (-[IFHTMLView removeNotifications]): * WebView.subproj/IFWebView.mm: (-[IFWebView setFrame:]): (-[IFWebView viewWillStartLiveResize]): (-[IFWebView viewDidEndLiveResize]): 2002-07-15 Maciej Stachowiak <mjs@apple.com> Fixed Radar 2957209 - Change "JavaScript can open new windows automatically" preference to off by default * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]): Switch default for "Allow JavaScript to open new windows automatically" to FALSE. 2002-07-15 Darin Adler <darin@apple.com> More weaning from C++. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:baseURL:mime:arguments:]): Use malloc instead of new. (-[IFPluginView dealloc]): Use free instead of delete. 2002-07-15 Darin Adler <darin@apple.com> Fixes so we are ready to compile as Objective C, not C++. The C++ front end misses a lot of things the C front end catches. * Plugins.subproj/IFNullPluginView.mm: (-[IFNullPluginView drawRect:]): Add missing cast. * Plugins.subproj/IFPluginStream.mm: (-[IFPluginStream IFURLHandle:resourceDidFailLoadingWithResult:]): Use [IFLoadProgress initWithURLHandle:] instead of getting at private fields. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView setUpWindowAndPort]): Remove unused windowFrame. (-[IFPluginView start]): Don't use a variable within a for statement. Add missing cast. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): Use [IFWebFrame _setProvisionalDataSource:] so we don't have to get at the protected field _private. * WebView.subproj/IFWebControllerPrivate.mm: (-[IFWebController _mainReceivedProgress:forResourceHandle:fromDataSource:complete:]): Use [IFProgress bytesSoFar] so we don't have to get at the protected field bytesSoFar. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): Add missing cast. (-[IFWebFrame _setProvisionalDataSource:]): Added. * WebView.subproj/IFHTMLRepresentation.mm: * WebView.subproj/IFHTMLViewPrivate.h: * WebView.subproj/IFWebControllerPrivate.h: * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebViewPrivate.h: Make data in private class @public, since the main class needs to get at it directly. 2002-07-15 Richard Williamson <rjw@apple.com> Only adjustFrames in parent if parent is a frame set. (Anywhere from 2% to 6% gain, depending on what you believe.) * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]): Increment initial layout from 1.5 seconds to 1.85 seconds. 2002-07-15 Darin Adler <darin@apple.com> * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): Tweak a comment that included the word WebController, to smooth things over a tiny bit for the coming renaming. 2002-07-15 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer widthForCharacters:length:]): Remove implementation of some unused methods, including at least one that was never used. 2002-07-15 Maciej Stachowiak <mjs@apple.com> WebKit part of fix for Radar 2896356 - cookie "ask for each site" not implemented yet * Panels.subproj/IFPanelCookieAcceptHandler.h: Added. * Panels.subproj/IFPanelCookieAcceptHandler.m: Added. (-[IFPanelCookieAcceptHandler init]): (-[IFPanelCookieAcceptHandler dealloc]): (-[IFPanelCookieAcceptHandler readyToStartCookieAcceptCheck:]): (-[IFPanelCookieAcceptHandler startCookieAcceptCheck:]): (-[IFPanelCookieAcceptHandler cancelCookieAcceptCheck:]): (-[IFPanelCookieAcceptHandler doneWithCheck:returnCode:contextInfo:]): * Panels.subproj/IFStandardPanels.m: (-[IFStandardPanels setUseStandardCookieAcceptPanel:]): (-[IFStandardPanels useStandardCookieAcceptPanel]): * WebKit.pbproj/project.pbxproj: 2002-07-14 Maciej Stachowiak <mjs@apple.com> More workarounds for the Objective C++ typecasting bug. * WebView.subproj/IFDOMNode.mm: (-[IFDOMNode initWithWebView:]): * WebView.subproj/IFHTMLViewPrivate.mm: (-[NSView _IF_stopIfPluginView]): * WebView.subproj/IFRenderNode.mm: (-[IFRenderNode initWithWebView:]): * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame reset]): 2002-07-14 Darin Adler <darin@apple.com> Wean WebKit completely from getting at the C++ parts of WebCore. We probably don't need to use C++ at all for WebKit any more. * WebKit.pbproj/project.pbxproj: Remove all the header search paths; we don't need any special ones now. * WebKitPrefix.h: Remove <config.h>; we don't need it any more. * Misc.subproj/IFCache.h: Rename getStatistics to statistics. * Misc.subproj/IFCache.mm: (+[IFCache statistics]): (+[IFCache empty]): (+[IFCache setDisabled:]): Call through WebCoreCache instead of going directly to khtml::Cache. (+[IFCache javaScriptObjectsCount]): (+[IFCache javaScriptInterpretersCount]): (+[IFCache javaScriptNoGCAllowedObjectsCount]): (+[IFCache javaScriptReferencedObjectsCount]): (+[IFCache garbageCollectJavaScriptObjects]): Call through WebCoreJavaScript instead of going directly to kjs::Collector. * WebCoreSupport.subproj/IFWebCoreFrame.m: (-[IFWebCoreFrame bridge]): Change to return bridge from the provisional data source if it exists. (-[IFWebCoreFrame committedBridge]): Do what [bridge] used to do, always returning the bridge from the committed data source and never the provisional one. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView provisionalDataSourceChanged:]): Don't store the provisional widget. It's stored in the bridge for the provisional data source. (-[IFHTMLView provisionalDataSourceCommitted:]): Use the bridge method installInFrame: to do most of the work that used to be here. The rest is don in removeFromFrame which is called elsewhere. (-[IFHTMLView mouseUp:]): Use the bridge's mouseUp method. (-[IFHTMLView mouseDown:]): Use the bridge's mouseDown method. (-[IFHTMLView mouseMovedNotification:]): Use the bridge's mouseMoved method. (-[IFHTMLView mouseDragged:]): Use the bridge's mouseDragged method. * WebView.subproj/IFHTMLViewPrivate.h: Remove the widget, widgetOwned, and provisionalWidget instance variables, and the _widget and _provisionalWidget methods. * WebView.subproj/IFHTMLViewPrivate.mm: (-[IFHTMLView _reset]): Remove the code that deleted the widget and the provisional widget. This is now handled elsewhere. * WebView.subproj/IFDOMNode.mm: Redo to use the copyDOMTree feature of the bridge. * WebView.subproj/IFRenderNode.mm: Redo to use the copyRenderTree feature of the bridge. * WebView.subproj/IFRenderNode.h: Use an NSRect instead of four integers (the switch to floating point is OK). * WebView.subproj/IFWebDataSourcePrivate.h: Add private _removeFromFrame method. * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _removeFromFrame]): Set the controller and location change handler references to nil, and also call [WebCoreBridge removeFromFrame]. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFramePrivate setDataSource:]): Use _removeFromFrame where we formerly would set the controller and location change handler references to nil. * WebCoreSupport.subproj/IFWebCoreBridge.h: Tweak. 2002-07-13 Darin Adler <darin@apple.com> * Plugins.subproj/IFNullPluginView.mm: (-[IFNullPluginView dealloc]): * WebView.subproj/IFImageRepresentation.m: (-[IFImageRepresentation dealloc]): Fix leaks by adding calls to [super dealloc]. 2002-07-13 Darin Adler <darin@apple.com> * Misc.subproj/IFNSEventExtras.h: Removed. * Misc.subproj/IFNSEventExtras.m: Removed. * WebKit.pbproj/project.pbxproj: Removed IFNSEventExtras.*. * WebCoreSupport.subproj/IFWebCoreBridge.mm: * WebView.subproj/IFWebFrame.mm: * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: Renamed all bridgeFrame to frameBridge for greater clarity. * WebView.subproj/IFHTMLView.mm: Updated comments and commented-out code. * WebView.subproj/IFWebDataSource.h: Fix comment that mentioned IFDefaultWebController. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _transitionProvisionalToCommitted]): Fix exception string that cited the wrong state name. 2002-07-13 Darin Adler <darin@apple.com> * History.subproj/IFURIEntry.m: (-[IFURIEntry image]): Use [IFURIEntry class] instead of [self class] so we get the icon from the WebKit bundle even if someone subclasses IFURIEntry. * Plugins.subproj/IFNullPluginView.mm: (-[IFNullPluginView initWithFrame:mimeType:arguments:]): Use bundleForClass instead of bundleWithIdentifier so things work even if we have two copies of WebKit installed on the same machine. * Makefile.am: Remove include of embed.am. * WebKit.pbproj/project.pbxproj: Use embed-into-alex instead of make embed. Also change bundle identifier to com.apple.WebKit instead of com.apple.webkit to match standard used by our other frameworks. (Checked that we no longer have any hard-coding of the bundle identifier anywhere in our code.) 2002-07-13 Richard Williamson <rjw@apple.com> Fixed 2981849 - frames don't always draw correctly. * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebCoreBridge childFrameNamed:]): Check provisional data source first. * WebView.subproj/IFHTMLViewPrivate.h: * WebView.subproj/IFHTMLViewPrivate.mm: (-[IFHTMLView _adjustFrames]): Added method to adjust frame geometry. * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _layoutChildren]): Added method to adjust child frame geometries. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): Removed unnecessary drawing now that frame geometry is calculated directly. 2002-07-12 Darin Adler <darin@apple.com> About 1/3 of the remaining work to wean WebKit from its special relationship with WebCore onto explicit interfaces. * Misc.subproj/IFCache.mm: * WebView.subproj/IFDOMNode.mm: * WebView.subproj/IFRenderNode.mm: Mark imports from inside WebCore with #ifndef WEBKIT_INDEPENDENT_OF_WEBCORE. Once these are all gone, the task is done. * Plugins.subproj/IFPlugin.h: * WebCoreSupport.subproj/IFCookieAdapter.h: * WebCoreSupport.subproj/IFImageRenderer.h: * WebCoreSupport.subproj/IFImageRendererFactory.h: * WebCoreSupport.subproj/IFResourceURLHandleClient.m: * WebCoreSupport.subproj/IFTextRenderer.h: * WebCoreSupport.subproj/IFTextRendererFactory.h: * WebCoreSupport.subproj/IFWebCoreBridge.h: * WebCoreSupport.subproj/IFWebCoreViewFactory.h: Use #import <WebCore/> for getting at WebCore headers so we don't need to use -I. * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebCoreBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Call setRenderPart on the WebCoreFrame rather than on the IFWebFrame. * WebCoreSupport.subproj/IFWebCoreFrame.h: Subclass from the WebCoreFrame class. * WebCoreSupport.subproj/IFWebCoreFrame.m: (-[IFWebCoreFrame HTMLView]): Add a cast. (-[IFWebCoreFrame widget]): Remove overzealous assert. * WebKit.pbproj/project.pbxproj: Rearranged things a bit. Removed unneeded build phase. * WebView.subproj/IFDocument.h: * WebView.subproj/IFDynamicScrollBarsView.h: * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebControllerPolicyHandler.h: Changed a few stray #include statements to #import statements. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView provisionalDataSourceCommitted:]): Move the logic for setting up the renderPart in here from IFWebView. (-[IFHTMLView reapplyStyles]): Use the bridge. (-[IFHTMLView layout]): Use the bridge. (-[IFHTMLView drawRect:]): Use the bridge. * WebView.subproj/IFHTMLViewPrivate.h: Remove _takeOwnershipOfWidget which is no longer needed. * WebView.subproj/IFHTMLViewPrivate.mm: (-[NSView _IF_stopIfPluginView]): Added. Use to clean up _reset a bit. (-[IFHTMLView _reset]): Use makeObjectsPerformSelector: for simplicity. * WebView.subproj/IFImageView.h: Remove unneeded IFWebDataSource declaration. * WebView.subproj/IFImageView.m: Just formatting tweaks. * WebView.subproj/IFWebControllerPrivate.mm: Removed unneeded import. * WebView.subproj/IFWebDataSource.mm: Removed unneeded import. * WebView.subproj/IFWebDataSourcePrivate.mm: Removed unneeded import. * WebView.subproj/IFWebFrame.mm: Removed unneeded import. * WebView.subproj/IFWebFramePrivate.h: Remove renderPart field and related declarations. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFramePrivate dealloc]): No need to let go of renderPart any more. (-[IFWebFrame _transitionProvisionalToCommitted]): Move logic into IFHTMLView. * WebView.subproj/IFWebView.h: Be a bit more specific about the type of documentView. 2002-07-12 Chris Blumenberg <cblu@apple.com> Only accept drags of 1 file. * WebView.subproj/IFWebView.mm: (-[IFWebView draggingEntered:]): 2002-07-12 Darin Adler <darin@apple.com> Fix cancelling. My recent check-in broke it for downloads. * WebCoreSupport.subproj/IFResourceURLHandleClient.m: (-[IFResourceURLHandleClient receivedError:forHandle:]): Helper function to save code. (-[IFResourceURLHandleClient IFURLHandleResourceDidCancelLoading:]): Use an error for cancel rather than -1,-1 progress. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient receivedProgressWithHandle:complete:]): Remove -1,-1 handling here; instead we treat it as an error. (-[IFMainURLHandleClient receivedError:forHandle:]): Remove most of the parameters since they are things we can compute ourselves. (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): Use an error for cancel rather than -1,-1 progress. * WebView.subproj/IFWebControllerPrivate.mm: (-[IFWebController _receivedProgress:forResourceHandle:fromDataSource:complete:]): Remove the -1,-1 cancel handling; we use an error instead. (-[IFWebController _mainReceivedProgress:forResourceHandle:fromDataSource:complete:]): Remove the -1,-1 cancel handling; we use an error instead. (-[IFWebController _receivedError:forResourceHandle:partialProgress:fromDataSource:]): Remove the _isStopping check. We want to do the additional work even if already stopping. (-[IFWebController _mainReceivedError:forResourceHandle:partialProgress:fromDataSource:]): Remove the _isStopping check. We want to do the additional work even if already stopping. * WebView.subproj/IFWebView.mm: (-[IFWebView keyDown:]): Use NSDeleteCharacter. 2002-07-12 Darin Adler <darin@apple.com> * WebView.subproj/IFWebDataSource.mm: (+[IFWebDataSource registerRepresentationClass:forMIMEType:]): Use self instead of [self class]. (+[IFWebDataSource createRepresentationForMIMEType:]): Use the new _IF_objectForMIMEType to simplify and use hash table instead of linear search. * WebView.subproj/IFWebDataSourcePrivate.mm: (+[IFWebDataSource _repTypes]): Use initWithObjectsAndKeys for brevity and a tiny tiny bit of efficiency. (+[IFWebDataSource _canShowMIMEType:]): Use the new _IF_objectForMIMEType to simplify and use hash table instead of linear search. * WebView.subproj/IFWebView.mm: (+[IFWebView registerViewClass:forMIMEType:]): Use self instead of [self class]. (+[IFWebView createViewForMIMEType:]): Use the new _IF_objectForMIMEType to simplify and use hash table instead of linear search. * WebView.subproj/IFWebViewPrivate.mm: (+[IFWebView _canShowMIMEType:]): Use the new _IF_objectForMIMEType to simplify and use hash table instead of linear search. 2002-07-12 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Re-added JavaScriptCore, which I removed by accident. 2002-07-12 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Don't include the html4.css file from WebCore any more. WebCore handles this on its own now. Also, don't include the document templates; we don't use them any more. * Resources/image_document_template.html: Removed. * Resources/plugin_document_template.html: Removed. * Resources/text_document_template.html: Removed. * Makefile.am: Small tweak to the force-clean-timestamp logic. 2002-07-11 Chris Blumenberg <cblu@apple.com> Fix for: 2986548 - Crash if you drop URL of frameset page onto frame 2953421 - document dragged into frame should replace frameset * WebView.subproj/IFWebView.mm: (-[IFWebView draggingEntered:]): removed obsolute comment (-[IFWebView performDragOperation:]): moved implementation from here (-[IFWebView concludeDragOperation:]): to here, added support for NSURL drags 2002-07-11 Darin Adler <darin@apple.com> * WebView.subproj/IFWebViewPrivate.mm: (+[IFWebView _viewTypes]): Changed back to a mutable dictionary. Oops. 2002-07-11 John Sullivan <sullivan@apple.com> - fixed 2980779 -- no scroll bar in history window * WebKit.pbproj/project.pbxproj: Removed nonexistent .h file from project list (IFGrabBag.h) * WebView.subproj/IFDynamicScrollBarsView.h: Renamed field allowsScrolling to disallowsScrolling * WebView.subproj/IFDynamicScrollBarsView.m: (-[IFDynamicScrollBarsView updateScrollers]): (-[IFDynamicScrollBarsView setAllowsScrolling:]): (-[IFDynamicScrollBarsView allowsScrolling]): Removed initWithFrame override, whose only purpose was to set allowsScrolling to the "default" value (but not good enough for load-from-nib case). Changed all users of allowsScrolling to !disallowsScrolling instead. 2002-07-11 Chris Blumenberg <cblu@apple.com> * Plugins.subproj/IFPluginNullEventSender.h: * Plugins.subproj/IFPluginNullEventSender.m: (-[IFPluginNullEventSender initWithPluginView:]): renamed, simplified (-[IFPluginNullEventSender stop]): call plugin debug function * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView start]): call new initWithPluginView (-[IFPluginView windowWillClose:]): added back to fix plugin view leak (-[IFPluginView NPP_HandleEvent]): added 2002-07-11 Darin Adler <darin@apple.com> - fixed 2930872 -- option-arrow keys should page up and down - fixed 2924727 -- Delete does not go to previous page * WebView.subproj/IFHTMLView.mm: Disable the keyDown and keyUp methods here. We don't really need to pass these events to KHTMLView at the moment. See the comment in this file for further explanation. This paves the way to handle keys other than arrow keys in IFWebView. * WebView.subproj/IFWebController.h: Add temporary goBack method to IFWindowContext. See comment for more. * WebView.subproj/IFWebView.mm: (-[IFWebView keyDown:]): Add handling for option arrow keys, space (page down), shift-space (page up), and delete (go back). Also make this call super if the key is not handled so keys make their way back to the superview in the application. * WebView.subproj/IFWebViewPrivate.h: Add _pageLeft, _pageRight, _goBack. * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _pageHorizontally:]): Added. (-[IFWebView _pageLeft]): Added. (-[IFWebView _pageRight]): Added. (+[IFWebView _viewTypes]): Simplify. (-[IFWebView _goBack]): Added. Calls [IFWindowContext goBack]. 2002-07-10 Darin Adler <darin@apple.com> - fixed 2973738 -- box characters To be consistent with other browsers, we need to draw nothing for 0000-001F. We were drawing boxes. * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer convertCharacters:length:toGlyphs:skipControlCharacters:]): Add the skipControlCharacters parameter. If YES, don't include glyphs for characters in the 0000-001F range. (-[IFTextRenderer slowPackGlyphsForCharacters:numCharacters:glyphBuffer:numGlyphs:]): Pass skipControlCharacters:YES. (-[IFTextRenderer _drawCharacters:length:fromCharacterPosition:toCharacterPosition:atPoint:withTextColor:backgroundColor:]): Skip control characters when creating the glyph array. (-[IFTextRenderer slowFloatWidthForCharacters:stringLength:fromCharacterPostion:numberOfCharacters:applyRounding:]): Pass skipControlCharacters:YES. (-[IFTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:applyRounding:attemptFontSubstitution:]): Skip control characters when computing the width. (-[IFTextRenderer extendCharacterToGlyphMapToInclude:]): Pass skipControlCharacters:NO. 2002-07-10 Darin Adler <darin@apple.com> - fixed 2986273 -- assert currentURL isEqual:[handle redirectedURL] ? [handle redirectedURL] : [handle url] Since cancel prevents further notification from getting through, currentURL can get out of sync before cancelling, so we can't assert in the cancel function. * WebCoreSupport.subproj/IFResourceURLHandleClient.m: (-[IFResourceURLHandleClient IFURLHandleResourceDidCancelLoading:]): Remove assert. * WebView.subproj/IFMainURLHandleClient.h: Remove unnecessary includes. Change type of dataSource to IFWebDataSource from id. Change url to currentURL to match IFResourceURLHandleClient. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient initWithDataSource:]): Simplify. (-[IFMainURLHandleClient didStartLoadingWithURL:]): Copied here from IFResourceURLHandleClient as a first step toward using a common superclass some day. (-[IFMainURLHandleClient didStopLoading]): Copied here from IFResourceURLHandleClient as a first step toward using a common superclass some day. (-[IFMainURLHandleClient dealloc]): Add an assert. (-[IFMainURLHandleClient receivedProgressWithHandle:complete:]): Removed most of the parameters to make this match the one in IFResourceURLHandleClient. (-[IFMainURLHandleClient IFURLHandleResourceDidBeginLoading:]): Use didStartLoadingWithURL. (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): Use receivedProgressWithHandle and didStopLoading. (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): Use receivedProgressWithHandle and didStopLoading. (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): Use receivedProgressWithHandle. (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): Use receivedProgressWithHandle and didStopLoading. (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): Use didStopLoading and didStartLoadingWithURL. 2002-07-10 Maciej Stachowiak <mjs@apple.com> WebKit part of fix for: Radar 2953250 - JavaScript window.focus() and window.blur() methods don't work * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebCoreBridge unfocusWindow]): Use private AppKit interface to cycle windows if the window is the key window. 2002-07-10 Darin Adler <darin@apple.com> - fixed 2983025 -- crash in sendEvent on pages with flash playing * Plugins.subproj/IFPluginView.mm: (-[IFPluginView removeTrackingRect]): New, removes tracking rect and releases window. (-[IFPluginView resetTrackingRect]): New, adds tracking rect and retains window. (-[IFPluginView start]): Use resetTrackingRect. (-[IFPluginView stop]): Use removeTrackingRect. (-[IFPluginView viewWillMoveToWindow:]): Call removeTrackingRect because the window will change by the time we get to viewDidMoveToWindow. (-[IFPluginView viewDidMoveToWindow]): Call resetTrackingRect. (-[IFPluginView viewHasMoved:]): Call resetTrackingRect. 2002-07-10 Darin Adler <darin@apple.com> * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _scrollToBottomLeft]): Fix this to use the document view to define what the bottom left is, not the content view (which is often much smaller than the document). 2002-07-10 Chris Blumenberg <cblu@apple.com> Fixes for: 2981866 - Download doesn't appear in Downloads window if link was command-clicked 2965312 - Download progress not shown when clicking on download link with Alex not running * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): retain the downloadProgressHandler before calling requestContentPolicy as the web controller may be released in requestContentPolicy 2002-07-10 Chris Blumenberg <cblu@apple.com> Fix for: 2976311 - Download fails if you close the window that started the download 2976308 - Can't navigate in window while download started in that window is in progress * WebView.subproj/IFMainURLHandleClient.h: * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient dealloc]): (-[IFMainURLHandleClient _receivedProgress:forResourceHandle:fromDataSource:complete:]): added, sends progress to correct handler (-[IFMainURLHandleClient _receivedError:forResourceHandle:partialProgress:fromDataSource:]): added, sends progress to correct handler (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): calls _receivedProgress (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): calls _receivedProgress (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): calls _receivedProgress (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): calls _receivedError * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebController.mm: (-[IFWebController setDownloadProgressHandler:]): added (-[IFWebController downloadProgressHandler]): added * WebView.subproj/IFWebControllerPrivate.h: * WebView.subproj/IFWebControllerPrivate.mm: (-[IFWebController _mainReceivedProgress:forResourceHandle:fromDataSource:complete:]): removed download special-casing 2002-07-10 Maciej Stachowiak <mjs@apple.com> * WebView.subproj/IFGrabBag.h: Removed. * WebView.subproj/IFWebController.h: Move IFContextMenuHandler here. 2002-07-10 Darin Adler <darin@apple.com> Did some tweaks that weren't really necessary. But at least one is a significant improvement so I decided to commit rather then just discarding the changes. * Bookmarks.subproj/IFBookmark.m: (-[IFBookmark title]): Take out special case for separator. (-[IFBookmark setTitle:]): Take out special case for separator. (-[IFBookmark image]): Take out special case for separator. (-[IFBookmark setImage:]): Take out special case for separator. (-[IFBookmark setURLString:]): Take out special case for non-leaf. (-[IFBookmark children]): Take out request for concrete implementation; this is not useful since it's specific to one subclass. (-[IFBookmark numberOfChildren]): Take out request for concrete implementation; this is not useful since it's specific to one subclass. (-[IFBookmark _numberOfDescendants]): Take out request for concrete implementation; this is not useful since it's specific to one subclass. (-[IFBookmark insertChild:atIndex:]): Take out special case for non-list. (-[IFBookmark removeChild:]): Take out special case for non-list. (+[IFBookmark bookmarkFromDictionaryRepresentation:withGroup:]): Refactored to eliminate repeated code. * Bookmarks.subproj/IFBookmarkLeaf.m: (-[IFBookmarkLeaf copyWithZone:]): Use allocWithZone to be more pedantically correct. * Bookmarks.subproj/IFBookmarkSeparator.m: (-[IFBookmarkSeparator title]): Override to return nil. (-[IFBookmarkSeparator image]): Override to return nil. 2002-07-10 Darin Adler <darin@apple.com> * Misc.subproj/WebKitDebug.m: Remove workaround for long-ago fixed C compiler bug. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView keyUp:]), (-[IFPluginView keyDown:]): Simplify keyboard scrolling code by passing along all events that the plug-in doesn't handle rather than special-casing certain events. Also use super rather than nextResponder to pass along the scroll events (super will do nextResponder). * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView keyDown:]), (-[IFHTMLView keyUp:]): Use super rather than nextResponder to pass along scroll events (super will do nextResponder). 2002-07-08 Chris Blumenberg <cblu@apple.com> Fixes for: 2955757 - Keyboard scrolling code needs to move to WebKit 2937231 - Left and right arrows should scroll the content area * Misc.subproj/IFNSEventExtras.h: Added. * Misc.subproj/IFNSEventExtras.m: Added. (-[NSEvent _IF_isScrollEvent]): new * Plugins.subproj/IFPluginView.mm: (-[IFPluginView keyUp:]): if plug-in doesn't accept it, send to nextResponder (-[IFPluginView keyDown:]): if plug-in doesn't accept it, send to nextResponder * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView keyDown:]): calls _IF_isScrollEvent, if so send to nextResponder (-[IFHTMLView keyUp:]): calls _IF_isScrollEvent, if so send to nextResponder * WebView.subproj/IFWebView.mm: (-[IFWebView acceptsFirstResponder]): added (-[IFWebView window]): no changes (-[IFWebView keyDown:]): added, does the scroll * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _contentView]): added (-[IFWebView _scrollVerticallyBy:]): added, moved from BrowserWindow.m (-[IFWebView _scrollHorizontallyBy:]): added, moved from BrowserWindow.m (-[IFWebView _pageVertically:]): added, moved from BrowserWindow.m (-[IFWebView _scrollLineVertically:]): added, moved from BrowserWindow.m (-[IFWebView _scrollLineHorizontally:]): added, moved from BrowserWindow.m (-[IFWebView _pageDown]): added, moved from BrowserWindow.m (-[IFWebView _pageUp]): added, moved from BrowserWindow.m (-[IFWebView _scrollToTopLeft]): added, moved from BrowserWindow.m (-[IFWebView _scrollToBottomLeft]): added, moved from BrowserWindow.m (-[IFWebView _lineDown]): added, moved from BrowserWindow.m (-[IFWebView _lineUp]): added, moved from BrowserWindow.m (-[IFWebView _lineLeft]): added, moved from BrowserWindow.m (-[IFWebView _lineRight]): added, moved from BrowserWindow.m 2002-07-08 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFWebCoreBridge.mm: Fix compiles under newer compiler (Jaguar 6C89 and newer) by adding missing include. 2002-07-07 Maciej Stachowiak <mjs@apple.com> WebCore part of fix for Radar 2953431 - JavaScript window.close() method is not working * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebCoreBridge openedByScript]): Implement by calling controller. (-[IFWebCoreBridge setOpenedByScript:]): Likewise. * WebView.subproj/IFWebControllerPrivate.h: * WebView.subproj/IFWebControllerPrivate.mm: (-[IFWebController _openedByScript]): Implement. (-[IFWebController _setOpenedByScript:]): Implement. 2002-07-05 Darin Adler <darin@apple.com> Fix crashes I saw with zombies enabled caused by messing with windows that are in the process of being destroyed. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView start]): Remove windowWillClose notification because we use viewDidMoveToWindow instead. (-[IFPluginView viewDidMoveToWindow]): Use this instead of viewWillMoveToWindow. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView viewDidMoveToWindow]): Use this instead of viewWillMoveToWindow. * WebView.subproj/IFHTMLViewPrivate.h: Need a boolean flag to tell window changes before the first time we are installed from window changes afterward. * WebView.subproj/IFImageView.m: (-[IFImageView viewDidMoveToWindow]): Use this instead of viewWillMoveToWindow. 2002-07-04 Maciej Stachowiak <mjs@apple.com> * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView mouseMovedNotification:]): Pass the modifier flags along for mouse move events. 2002-07-04 John Sullivan <sullivan@apple.com> * WebView.subproj/IFDynamicScrollBarsView.h: Updated FIXME to mention bug number. 2002-07-03 Chris Blumenberg <cblu@apple.com> - Fix for 2975750 - Removed Java workaround since that will be fixed soon. * Plugins.subproj/IFPlugin.h: * Plugins.subproj/IFPlugin.m: (-[IFPlugin _openResourceFile]): added (-[IFPlugin _closeResourceFile:]): added (-[IFPlugin _getPluginInfo]): rename (-[IFPlugin initWithPath:]): simplified (-[IFPlugin load]): calls _openResourceFile (-[IFPlugin unload]): calls _closeResourceFile * Plugins.subproj/IFPluginView.mm: (-[IFPluginView setUpWindowAndPort]): removed Java workaround 2002-07-03 Darin Adler <darin@apple.com> * Misc.subproj/IFException.h: Use Objective C header style rather than plain C. === Alexander-11 === 2002-07-03 Darin Adler <darin@apple.com> * Misc.subproj/IFDownloadHandler.mm: (-[IFDownloadHandler finishedLoading]): * WebView.subproj/IFWebController.h: A couple places where it still said IFContentPolicyOpenExternally. 2002-07-03 Maciej Stachowiak <mjs@apple.com> WebKit part of fixes for: Radar 2950616 - JavaScript window.screenX and window.screenY always return -1 Radar 2950614 - JavaScript window.screenLeft and window.screenTop properties are unimplemented Radar 2950609 - JavaScript window.outerHeight and window.outerWidth properties always return 0 * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView provisionalDataSourceChanged:]): Pass the real document view to the newly created bridge, since it will be ready by now and is needed by JavaScript. 2002-07-03 Maciej Stachowiak <mjs@apple.com> * Plugins.subproj/IFPluginView.mm: (-[IFPluginView status:]): Fix build problem. Why doesn't compiling catch these more reliably? 2002-07-03 Richard Williamson <rjw@apple.com> * Misc.subproj/IFNSViewExtras.m: (-[NSView _IF_printViewHierarchy:]): Debugging help. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView layout]): Added setLayouted(false). * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): Tweaks attempting to fix frame drawing problems. 2002-07-03 Maciej Stachowiak <mjs@apple.com> WebCore part of fix for: Radar 2943465 - JavaScript window.defaultStatus property not implemented Radar 2943464 - JavaScript window.status property is not implemented Radar 2926213 - show url of moused-over link in status bar * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebCoreBridge setStatusText:]): Connect bridge status text setting to window context. * WebView.subproj/IFWebController.h: 2002-07-02 Chris Blumenberg <cblu@apple.com> Added IFFileURLPolicyReveal. This makes things a little clearer for the client. * WebView.subproj/IFWebControllerPolicyHandler.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _shouldShowDataSource:]): support for IFFileURLPolicyReveal. 2002-07-02 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer incrementalLoadWithBytes:length:complete:]): Fixed a syntax error caused by a "just before committing" edit. 2002-07-02 Darin Adler <darin@apple.com> - fixed 2952837 -- image not rendered if height or width attributes specified incorrectly * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer incrementalLoadWithBytes:length:complete:]): Set the size of both the image and the image representation. 2002-07-02 Chris Blumenberg <cblu@apple.com> Can't call startLoading on a frame if setProvisionalDataSource returned NO. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView loadURL:inTarget:withNotifyData:andHandleAttributes:]): * WebCoreSupport.subproj/IFWebCoreFrame.m: (-[IFWebCoreFrame loadURL:attributes:flags:withParent:]): * WebView.subproj/IFWebView.mm: (-[IFWebView performDragOperation:]): 2002-07-02 Chris Blumenberg <cblu@apple.com> Fixed asseration failure caused by an iframe not having a correct mime type. We now assume that local files without extensions are html files. * WebView.subproj/IFWebControllerPrivate.mm: (+[IFWebController _MIMETypeForFile:]): 2002-07-02 Chris Blumenberg <cblu@apple.com> - Moved all policy methods to IFWebControllerPolicyHandler.h - Moved all file URL error checking to WebKit - Implemented file URL policy methods - Renamed IFContentPolicyOpenExternally to IFContentPolicySaveAndOpenExternally * Misc.subproj/IFWebKitErrors.h: Added. * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFLocationChangeHandler.h: removed content policy stuff * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): IFContentPolicySaveAndOpenExternally rename (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): call the policy handler for content policy stuff * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebController.mm: (-[IFWebController haveContentPolicy:andPath:forDataSource:]): sends a unableToImplementContentPolicy: (+[IFWebController canShowFile:]): now calls _MIMETypeForFile * WebView.subproj/IFWebControllerPolicyHandler.h: Added. * WebView.subproj/IFWebControllerPrivate.h: * WebView.subproj/IFWebControllerPrivate.mm: (-[IFWebController _mainReceivedProgress:forResourceHandle:fromDataSource:complete:]): IFContentPolicySaveAndOpenExternally rename (-[IFWebController _didStopLoading:]): no changes (+[IFWebController _MIMETypeForFile:]): added * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame setProvisionalDataSource:]): calls _shouldShowDataSource * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _bridgeFrame]): no changes (-[IFWebFrame _shouldShowDataSource:]): does the error handling * WebView.subproj/IFWebView.mm: (+[IFWebView initialize]): registers WebKit errors 2002-07-02 Richard Williamson <rjw@apple.com> * WebView.subproj/IFRenderNode.mm: (-[IFRenderNode initWithRenderObject:khtml::]): Fixed regression that prevented showing of nodes in subframes. 2002-07-02 Darin Adler <darin@apple.com> * Plugins.subproj/IFPluginView.mm: (-[IFPluginView setWindow]), (-[IFPluginView start]), (-[IFPluginView stop]): Fix unused variable issue that affects deployment builds. 2002-07-02 John Sullivan <sullivan@apple.com> Remove unnecessary code to fill with white from here; this code path has changed. Now it just bails out early in the case where there's no widget. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView drawRect:]): 2002-07-02 John Sullivan <sullivan@apple.com> Made IFWebView fill with white when there's no document view. This fixes: - 2978210 -- problems with "hide status bar" - 2978742 -- Resizing initially-empty Alexander window results in garbage in window * WebView.subproj/IFWebView.mm: (-[IFWebView drawRect:]): 2002-07-02 Darin Adler <darin@apple.com> * WebView.subproj/IFMainURLHandleClient.mm: Fix comment. 2002-07-02 Darin Adler <darin@apple.com> - fixed 2975790 - Ads on salon.com scribble all over page * Plugins.subproj/IFPluginView.mm: (-[IFPluginView setUpWindowAndPort]): New, sets up the window, but does not call NPP_SetWindow again. (-[IFPluginView setWindow]): Call [setUpWindowAndPort] then call NPP_SetWindow. (-[IFPluginView start]): Register for changes to the bounds or frame of any of our superviews, not just one particular one. Also, don't bother to register for notification when the window resizes. Finally, use the constants for the names of the notifications, not literal strings. (-[IFPluginView layout]): Just use [setUpWindowAndPort]; no need for a new call to NPP_SetWindow. (-[IFPluginView viewHasMoved:]): Just use [setUpWindowAndPort]; no need for a new call to NPP_SetWindow. 2002-07-01 Maciej Stachowiak <mjs@apple.com> * WebView.subproj/IFWebView.mm: (-[IFWebView window]): If the view hasn't been added to a window yet, get the window from the WindowContext. 2002-07-01 Richard Williamson <rjw@apple.com> * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): Ensure that _didStopLoading is called for both error case and non-error case. 2002-07-01 Richard Williamson <rjw@apple.com> * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): A completion message was being sent, as well as an error message. This, no doubt confused Alexander. No only send either the final error message or the completion message. 2002-07-01 Darin Adler <darin@apple.com> Ken fixed the load message sequencing problem in WebFoundation, so now we can go back to the original versions of the asserts. * WebCoreSupport.subproj/IFResourceURLHandleClient.m: (-[IFResourceURLHandleClient dealloc]): (-[IFResourceURLHandleClient IFURLHandleResourceDidCancelLoading:]): (-[IFResourceURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient dealloc]): (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): Roll out the stuff that's ifdef'd and marked with bug 2954901. 2002-07-01 Darin Adler <darin@apple.com> * WebView.subproj/IFDynamicScrollBarsView.m: (-[IFDynamicScrollBarsView updateScrollers]): After a closer reading of the NSScrollView source code, I see that we don't need to explicitly do tile or setNeedsDisplay: because the setters take care of that, so I made this simpler. (-[IFDynamicScrollBarsView reflectScrolledClipView:]): Replace the anti- recursion hack that I erroneously removed earlier. * WebView.subproj/IFTextView.h: Removed the isRTF flag. * WebView.subproj/IFTextView.m: (-[IFTextView provisionalDataSourceChanged:]): Do nothing here. (-[IFTextView dataSourceUpdated:]): Check the MIME type here. 2002-07-01 Richard Williamson <rjw@apple.com> Fixed 2976913. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView layout]): Augmented debugging info. (-[IFHTMLView setNeedsDisplay:]): Augmented debugging info. (-[IFHTMLView setNeedsLayout:]): Removed overload of this method to also set display flag. Why was this added? (-[IFHTMLView setNeedsToApplyStyles:]): Augmented debugging info. (-[IFHTMLView drawRect:]): Augmented debugging info. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _timedLayout:]): If the view size is zero (width or height) force a layout now, rather than depending on the lazy layout that will happen in display. If the view size is 0,0 the AppKit will optimize out the display. 2002-07-01 Chris Blumenberg <cblu@apple.com> Minor cleanup * Plugins.subproj/IFNullPluginView.mm: (-[IFNullPluginView initWithFrame:mimeType:arguments:]): (-[IFNullPluginView dealloc]): 2002-07-01 Darin Adler <darin@apple.com> * Plugins.subproj/IFPlugin.m: (-[IFPlugin _getPluginInfoForResourceFile:]): Fix off-by one error that would cause a memory trasher if we had a 255-character string. * WebView.subproj/IFHTMLView.mm: * WebView.subproj/IFRenderNode.mm: Touch these files so we don't have to do a full build of WebKit for my WebCore changes. 2002-07-01 Maciej Stachowiak <mjs@apple.com> Build fixes (don't know why a plain build didn't catch these): * Plugins.subproj/IFPluginView.mm: openNewWindowWithURL: is not a method of the controller any more, nor are the status-related calls. * WebView.subproj/IFWebController.h: Un-ifdef the status calls. 2002-07-01 Maciej Stachowiak <mjs@apple.com> Part of fix for Radar 2976618 - links targeting _blank hit assertion trying to set provisional data source * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame frameNamed:]): Show the window. 2002-07-01 Maciej Stachowiak <mjs@apple.com> Fix Radar 2953256 - Auth sheet appears detached when clicking directly on auth link with Alex not running * Panels.subproj/IFStandardPanels.m: (-[IFStandardPanels frontmostWindowLoadingURL:]): Don't consider windows that are not visible. 2002-06-29 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer tileInRect:fromPoint:]): Fix calculation of oneTileRect. I think this is finally correct now. 2002-06-29 Maciej Stachowiak <mjs@apple.com> WebKit part of fix for: Radar 2942074 - JavaScript size, positioning and feature parameters to window.open are ignored Also, renamed IFScriptContextHandler protocol to IFWindowContext, and made it a settable handler like the others rather than something implemented by the controller, so it can be used w/o subclassing. * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebCoreBridge openNewWindowWithURL:]): Forward to the WindowContext. (-[IFWebCoreBridge areToolbarsVisisble]): Likewise. (-[IFWebCoreBridge setToolbarsVisible:]): Likewise. (-[IFWebCoreBridge areScrollbarsVisible]): Likewise. (-[IFWebCoreBridge setScrollbarsVisible:]): Likewise. (-[IFWebCoreBridge isStatusBarVisisble]): Likewise. (-[IFWebCoreBridge setStatusBarVisible:]): Likewise. (-[IFWebCoreBridge setWindowFrame:]): Likewise. (-[IFWebCoreBridge window]): Likewise. * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebController.mm: (-[IFWebController setWindowContext:]): Setter for new WindowContext handler (-[IFWebController windowContext]): Likewise. * WebView.subproj/IFWebControllerPrivate.h: * WebView.subproj/IFWebControllerPrivate.mm: (-[IFWebControllerPrivate dealloc]): Release window context. * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame frameNamed:]): Open new windows via WindowContext. 2002-06-28 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFImageRenderer.h: Renamed statusOfCache to patternColorLoadStatus for clarity. * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer copyWithZone:]): Add FIXME. (-[IFImageRenderer tileInRect:fromPoint:]): Add optimization for the case where a single draw of the image will cover the entire area to be tiled. Also add comments and make other small improvements. 2002-06-28 Richard Williamson <rjw@apple.com> Use float character measurement to determine selection region. Necessary to ensure accuracy of selection region. First step towards weaning khtml off int measurements. * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer tileInRect:fromPoint:]): Cleaned up use of loadStatus. * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer slowFloatWidthForCharacters:stringLength:fromCharacterPostion:numberOfCharacters:applyRounding:]): (-[IFTextRenderer floatWidthForCharacters:stringLength:characterPosition:]): (-[IFTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:applyRounding:attemptFontSubstitution:]): 2002-06-28 Chris Blumenberg <cblu@apple.com> * WebView.subproj/IFMainURLHandleClient.h: * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient downloadHandler]): added (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): removed [downloadHandler cancel] * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource stopLoading]): call [downloadHandler cancel] here so clean up is done immediately. 2002-06-27 Richard Williamson <rjw@apple.com> Fixed tiling of progressively loaded images. * WebCoreSupport.subproj/IFImageRenderer.h: * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer initWithSize:]): (-[IFImageRenderer incrementalLoadWithBytes:length:complete:]): (-[IFImageRenderer loadStatus]): (-[IFImageRenderer tileInRect:fromPoint:]): 2002-06-27 Richard Williamson <rjw@apple.com> * WebCoreSupport.subproj/IFImageRenderer.h: * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer incrementalLoadWithBytes:length:complete:]): (-[IFImageRenderer loadStatus]): (-[IFImageRenderer tileInRect:fromPoint:]): 2002-06-27 Richard Williamson <rjw@apple.com> * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:applyRounding:attemptFontSubstitution:]): Fixed uninitialized variable warning. Compile being too aggressive, broke deployment build. 2002-06-27 Chris Blumenberg <cblu@apple.com> Fixed plug-in positioning. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:baseURL:mime:arguments:]): added some logging. (-[IFPluginView setWindow]): Use the window's content view as the guide for the port's coordinates. Also added a workaround for Java. 2002-06-27 Darin Adler <darin@apple.com> Fixed DOM tree viewer. * WebView.subproj/IFDOMNode.mm: (-[IFDOMNode initWithDOMNode:DOM::]): A typo got in here somehow, leading to an infinite loop. 2002-06-27 Darin Adler <darin@apple.com> - fixed 2973212 -- bad arg string != nil in _IF_URLWithString * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _startLoading:]): Get rid of essentially-dead code that computed but did not use a URL. Also order operations so that we first set the flag to say that we're loading, then tell the location change handler, and only then ask for the actual I/O to being. * WebView.subproj/IFBaseLocationChangeHandler.h: Removed. * WebView.subproj/IFBaseLocationChangeHandler.m: Removed. === Alexander-10 === 2002-06-27 Richard Williamson <rjw@apple.com> Method name changes in preparation for fixing TextSlave::checkSelectionPoint(). Stubbed only, no support for new parameters yet. * Misc.subproj/IFStringTruncator.m: (+[IFStringTruncator centerTruncateString:toWidth:withFont:]): * WebCoreSupport.subproj/IFTextRenderer.h: * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer slowFloatWidthForCharacters:stringLength:fromCharacterPostion:numberOfCharacters:applyRounding:]): (-[IFTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:]): (-[IFTextRenderer floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:applyRounding:attemptFontSubstitution:]): (-[IFTextRenderer widthForCharacters:length:]): (-[IFTextRenderer widthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:]): 2002-06-27 Richard Williamson <rjw@apple.com> Removed old methods and references. * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer drawString:atPoint:withColor:]): (-[IFTextRenderer slowDrawCharacters:length:fromCharacterPosition:toCharacterPosition:atPoint:withTextColor:backgroundColor:attemptFontSubstitution:]): (-[IFTextRenderer _drawCharacters:length:fromCharacterPosition:toCharacterPosition:atPoint:withTextColor:backgroundColor:]): Fixed final fragment rendering glitch. 2002-06-27 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFWebCoreViewFactory.m: (-[IFWebCoreViewFactory viewForJavaAppletWithFrame:baseURL:parameters:]): Pass baseURL as a separate parameter. * WebView.subproj/IFBaseLocationChangeHandler.m: Fix a typo. I think this file might be unneeded, but I won't delete it until I hear from Chris. 2002-06-27 Richard Williamson <rjw@apple.com> Fix selection in 'slow' code path (non-base characters and font substitution). * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer drawGlyphs:numGlyphs:fromGlyphPosition:toGlyphPosition:atPoint:withTextColor:backgroundColor:]): (-[IFTextRenderer slowDrawCharacters:length:fromCharacterPosition:toCharacterPosition:atPoint:withTextColor:backgroundColor:attemptFontSubstitution:]): 2002-06-27 Richard Williamson <rjw@apple.com> Implemented auto scrolling. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView mouseDragged:]): 2002-06-27 Richard Williamson <rjw@apple.com> Implement selectAll. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView selectAll:]): 2002-06-27 Maciej Stachowiak <mjs@apple.com> WebKit part of fixes for JavaScript cookie bugs: 2943749 - JavaScript navigator.cookieEnabled property is always "true" 2856039 - JavaScript document.cookies property is not implemented Thereby also fixing: 2944378 - Trying to log into my Yahoo web mail account sent Alexander into a loop * WebCoreSupport.subproj/IFCookieAdapter.h: Added. * WebCoreSupport.subproj/IFCookieAdapter.m: Added. (+[IFCookieAdapter createSharedAdapter]): Set up an instance of IFCookieAdapter as the WebCoreCookieAdapter shared instance. (-[IFCookieAdapter cookiesEnabled]): Implement in terms of WebFoundation stuff. (-[IFCookieAdapter cookiesForURL:]): Likewise. (-[IFCookieAdapter setCookies:forURL:]): Likewise. * WebKit.pbproj/project.pbxproj: Add new files to build. * WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]): Hook up the cookie adapter just like the various factory classes. 2002-06-27 Chris Blumenberg <cblu@apple.com> Support for Java. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:baseURL:mime:arguments:]): set DOCBASE argument * WebCoreSupport.subproj/IFWebCoreViewFactory.m: (-[IFWebCoreViewFactory viewForJavaAppletWithFrame:andArguments:]): renamed 2002-06-26 Richard Williamson <rjw@apple.com> Many improvements to selection. More Cocoa like, normalized all text drawing code paths for selected and unselected cases. Still need to work on: 1. 'slow' drawing cases, i.e. runs with non-base characters or runs requiring font substitution. 2. Select All menu item. 3. Auto scrolling. * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer drawString:atPoint:withColor:]): (-[IFTextRenderer drawGlyphs:numGlyphs:fromGlyphPosition:toGlyphPosition:atPoint:withTextColor:backgroundColor:]): (-[IFTextRenderer slowDrawCharacters:length:fromCharacterPosition:toCharacterPosition:atPoint:withTextColor:backgroundColor:attemptFontSubstitution:]): (-[IFTextRenderer _drawCharacters:length:fromCharacterPosition:toCharacterPosition:atPoint:withTextColor:backgroundColor:]): (-[IFTextRenderer drawCharacters:length:atPoint:withTextColor:backgroundColor:]): (-[IFTextRenderer drawCharacters:length:atPoint:withTextColor:]): (-[IFTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withTextColor:backgroundColor:]): 2002-06-26 Darin Adler <darin@apple.com> - fixed 2969280 -- if trailing / not specified for site, relative URLs are incorrectly expanded * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebCoreBridge receivedData:withDataSource:]): Update the URL for the case where we've already been redirected before we receive any data. 2002-06-26 Darin Adler <darin@apple.com> - fixed 2971532 -- crash with null KHTMLView at gramicci.com * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView reapplyStyles]): Handle widget == 0 case. (-[IFHTMLView layout]): Handle widget == 0 case. Fixed a crash I have seen many times where a data source tries to use its parent to locate the controller after its parent is deallocated. * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]): Use _parentDataSourceWillBeDeallocated instead of _setController:nil. * WebView.subproj/IFWebFramePrivate.h: Add _parentDataSourceWillBeDeallocated. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _parentDataSourceWillBeDeallocated]): Does both a _setController:nil, and a _setParent:nil on both data sources. 2002-06-26 John Sullivan <sullivan@apple.com> - fixed 2971024 -- wrong item is bookmarked -[IFWebDataSource redirectedURL] was returning the URL of a sub-page resource. * WebCoreSupport.subproj/IFResourceURLHandleClient.m: (-[IFResourceURLHandleClient IFURLHandle:didRedirectToURL:]): Removed evil call to _setFinalURL here. It had no right to live. 2002-06-26 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFImageRendererFactory.m: (-[IFImageRendererFactory imageRenderer]): Fix NSBitmapImageRep leak. 2002-06-26 Chris Blumenberg <cblu@apple.com> - added "complete" to to progress methods to indicate last progress message * Plugins.subproj/IFPluginView.mm: (-[IFPluginView setWindow]): added a draw test * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebControllerPrivate.mm: (-[IFWebController _receivedProgress:forResourceHandle:fromDataSource:complete:]): (-[IFWebController _mainReceivedProgress:forResourceHandle:fromDataSource:complete:]): 2002-06-26 Richard Williamson <rjw@apple.com> Fixed recursion problems. +[NSFont findFontLike:forString:withRange:inLanguage:] will alternate between suggested fonts with bogus answers. The work around involves adding an explicit flag indicating whether or not font substitution should be attempted. * Misc.subproj/IFStringTruncator.m: (+[IFStringTruncator centerTruncateString:toWidth:withFont:]): * WebCoreSupport.subproj/IFTextRenderer.h: * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer slowDrawCharacters:length:atPoint:withColor:attemptFontSubstitution:]): (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]): (-[IFTextRenderer floatWidthForCharacters:length:applyRounding:attemptFontSubstitution:]): (-[IFTextRenderer widthForCharacters:length:]): 2002-06-26 Darin Adler <darin@apple.com> * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView validateUserInterfaceItem:]): Switch to this instead of validateMenuItem: so that a Copy toolbar button would work. 2002-06-25 Richard Williamson <rjw@apple.com> Disable the copy menu item when IFHTMLView has is key and has no selection. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView validateMenuItem:]): Disable menu if selection is empty. (-[IFHTMLView copy:]): Factored code that gets the bridge. * WebView.subproj/IFHTMLViewPrivate.h: Added _bridge. * WebView.subproj/IFHTMLViewPrivate.mm: (-[IFHTMLView _bridge]): We need to access the bridge from the view to get the part's selection. 2002-06-25 Chris Blumenberg <cblu@apple.com> Remove downloaded file if cancelled. * Misc.subproj/IFDownloadHandler.mm: (-[IFDownloadHandler cancel]): 2002-06-25 Richard Williamson <rjw@apple.com> Support for rudimentary plain text 'copy'. * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer incrementalLoadWithBytes:length:complete:]): * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView copy:]): * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _controller]): 2002-06-25 Richard Williamson <rjw@apple.com> Enabled progressive image loading code. * WebCoreSupport.subproj/IFImageRenderer.h: * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer initWithSize:]): (-[IFImageRenderer incrementalLoadWithBytes:length:complete:]): * WebCoreSupport.subproj/IFImageRendererFactory.m: (-[IFImageRendererFactory imageRenderer]): 2002-06-25 Richard Williamson <rjw@apple.com> Extended our text measurement rounding work-around for integer-float mismatch to round on word boundaries as well as spaces. * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer drawGlyphs:numGlyphs:atPoint:withColor:]): (-[IFTextRenderer slowFloatWidthForCharacters:length:applyRounding:]): (-[IFTextRenderer floatWidthForCharacters:length:applyRounding:]): 2002-06-25 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFResourceURLHandleClient.m: (-[IFResourceURLHandleClient IFURLHandleResourceDidCancelLoading:]): (-[IFResourceURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): (-[IFResourceURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): Don't remove the URL handle from the data source until we've finished the loading process in KDE code. This may fix 2968527. * WebCoreSupport.subproj/IFTextRenderer.m: Keep around commented printfs so I can do the "dump all strings as they are rendered" again. * WebKit.pbproj/project.pbxproj: Re-add -Wmissing-format-attribute. 2002-06-25 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer tileInRect:fromPoint:]): Remove stray NSLog. 2002-06-25 Darin Adler <darin@apple.com> - fixed 2968298 -- IFImageRenderer crash at download.com * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer initWithSize:]): Override this instead of [init]. This is the designated initializer and all the others call this. (-[IFImageRenderer copyWithZone:]): Override to nil out fields that can't be shared by the copy. Fix leaks. * History.subproj/IFURIEntry.m: (-[IFURIEntry initWithURL:title:image:]): Use copy instead of retain in case we are passed a mutable string. (-[IFURIEntry dealloc]): Release _displayTitle. Fixes a leak. (-[IFURIEntry setTitle:]): Use copy instead of retain in case we are passed a mutable string. (-[IFURIEntry setDisplayTitle:]): Use copy instead of retain in case we are passed a mutable string. (-[IFURIEntry initFromDictionaryRepresentation:]): Lose the extra retain for _lastVisitedDate. Fixes a leak. 2002-06-24 Darin Adler <darin@apple.com> * Panels.subproj/IFStandardPanels.m: (-[IFStandardPanels didStopLoadingURL:inWindow:]): Fix a leak caused by calling the wrong method. This was calling objectForKey: instead of removeObjectForKey:. 2002-06-24 Richard Williamson <rjw@apple.com> Changed our usage of +[NSFont findFontLike:forString:withRange:inLanguage:] after talking with Aki. We were erroneously passing a complete string rather than a character cluster. Fixed 2964793. * WebCoreSupport.subproj/IFTextRenderer.m: (findLengthOfCharacterCluster): (-[IFTextRenderer slowPackGlyphsForCharacters:numCharacters:glyphBuffer:numGlyphs:]): (-[IFTextRenderer drawGlyphs:numGlyphs:atPoint:withColor:]): (-[IFTextRenderer slowDrawCharacters:length:atPoint:withColor:]): (-[IFTextRenderer _drawCharacters:length:atPoint:withColor:]): (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]): (-[IFTextRenderer floatWidthForCharacters:length:applyRounding:]): 2002-06-24 Darin Adler <darin@apple.com> * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _transitionProvisionalToCommitted]): Take ownership before doing the setWidget. The other way the widget was getting deleted. 2002-06-24 Chris Blumenberg <cblu@apple.com> * Plugins.subproj/IFPlugin.h: * Plugins.subproj/IFPlugin.m: (-[IFPlugin initWithPath:]): Close resource files when done. (-[IFPlugin load]): Remove Java plug-in workaround, load as mach-o * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:baseURL:mime:arguments:]): take NSURLs (-[IFPluginView dealloc]): release baseURL * WebCoreSupport.subproj/IFWebCoreViewFactory.m: (-[IFWebCoreViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]): take NSURLs (-[IFWebCoreViewFactory viewForJavaAppletWithArguments:]): 2002-06-24 Darin Adler <darin@apple.com> Remove some unused stuff. Other minor cleanup. * WebView.subproj/IFDynamicScrollBarsView.h: Remove breakRecursionCycle, don't declare updateScrollers or resetCursorRects. * WebView.subproj/IFDynamicScrollBarsView.m: (-[IFDynamicScrollBarsView updateScrollers]): Make this work even for a view that doesn't allow scrolling, turning off both scrollers in that case. (-[IFDynamicScrollBarsView reflectScrolledClipView:]): Call updateScrollers unconditionally, letting it decide what to do, rather than looking at allowsScrolling. Also, no need to use a boolean to break the recursion cycle, now that updateScrollers does no work if none is needed. (-[IFDynamicScrollBarsView setCursor:]): Do nothing if the cursor is not changing. Also handle arrowCursor case here. (-[IFDynamicScrollBarsView resetCursorRects]): Call discardCursorRects so the old rects won't keep accumulating. (-[IFDynamicScrollBarsView setAllowsScrolling:]): Always call updateScrollers, not just when turning scrolling off. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView initWithFrame:]): Remove unneeded NSWindowWillCloseNotification and isFlipped field. (-[IFHTMLView removeNotifications]): Moved here from NSWindowWillCloseNotification. (-[IFHTMLView viewWillMoveToWindow:]): Remove all the notifications when the view is removed from the window. (-[IFHTMLView setNeedsLayout:]): Call setNeedsDisplay in the YES case, so the callers don't all have to. (-[IFHTMLView isFlipped]): Just return YES. No need to store it. (-[IFHTMLView windowResized:]): Add a FIXME, since this is not the way we want to handle view resizing for the long run. * WebView.subproj/IFHTMLViewPrivate.h: Remove isFlipped. 2002-06-24 Darin Adler <darin@apple.com> Fix the last of the "leak the world" problems. The KHTMLView was leaking in IFHTMLView. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView dealloc]): Call _reset instead of _stopPlugins, so we get rid of the widget too. (-[IFHTMLView viewWillMoveToWindow:]): Use _reset now instead of the old _stopPlugins; also check that the window isn't already nil so we don't do a reset as part of our first install. (-[IFHTMLView provisionalDataSourceCommitted:]): Use the new widgetOwned flag to tell if the widget should be deleted instead of deciding based on whether the dataSource is the main document. * WebView.subproj/IFHTMLViewPrivate.h: Add a widgetOwned boolean and a private _takeOwnershipOfWidget method. Combine _resetWidget and _stopPlugins into a single _reset call. Remove _removeSubviews. * WebView.subproj/IFHTMLViewPrivate.mm: (-[IFHTMLView _reset]): New name for the combination of _resetWidget and _stopPlugins. Now it decides whether to delete the widget based on the widget owned flag, so it is safe to call even for non-main-document views. (-[IFHTMLView _takeOwnershipOfWidget]): Sets widgetOwned to NO. * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame reset]): Use _resetWidget under its new name _reset. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _transitionProvisionalToCommitted]): Don't bother doing explicit _stopPlugins and _removeSubviews. It's now the view's own responsibility to do this in viewWillMoveToWindow:. Call _takeOwnershipOfWidget after attaching the widget to the RenderPart. * WebView.subproj/IFImageView.m: (-[IFImageView viewWillMoveToWindow:]): Added. Break the reference cycle by stopping animated IFImageRenderer here instead of waiting for dealloc. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView setWindow]): Fix a warning by changing the printf format string to match the parameter type. * Misc.subproj/WebKitDebug.h: Re-add the __format__ attribute, now that Radar 2920557 is fixed. 2002-06-23 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer nextFrame:]): Use hasAlpha instead of isOpaque because the latter does not work (Radar 2966937). 2002-06-21 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer nextFrame:]): Add back the higher-speed case where we draw directly for opaque animated images. 2002-06-21 Darin Adler <darin@apple.com> Cache the patterns we make for tiled images for added speed. * WebCoreSupport.subproj/IFImageRenderer.h: Removed declarations of methods inherited from WebCoreImageRenderer. Added patternColor field. * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer dealloc]): Release patternColor. (-[IFImageRenderer beginAnimationInRect:fromRect:]): Get the view with [NSView focusView] rather than taking a parameter that's used only for the animating case. (-[IFImageRenderer tileInRect:fromPoint:]): New. Caches the pattern in the patternColor field. * WebView.subproj/IFImageView.m: (-[IFImageView drawRect:]): No need to pass view to image renderer any more. 2002-06-21 Darin Adler <darin@apple.com> Fix rendering of non-opaque animated images. * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer nextFrame:]): Use [NSView displayRect:] instead of drawing explicitly so that views behind us get a chance to draw too. This is less efficient than just drawing for opaque images, but NSImage doesn't offer a way to find out if the image is opaque. Also, this changes things a bit because beginAnimationInView gets called again, so we don't have to reschedule the timer. 2002-06-20 Richard Williamson <rjw@apple.com> * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer frameDuration]): Added minimum 1/60th second duration per frame. * WebView.subproj/IFDynamicScrollBarsView.m: (-[IFDynamicScrollBarsView updateScrollers]): Only display scrollview if scrollers changed. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _setState:]): Explicity turn on copiesOnScroll. This may cause problems w/ plugins. Need to verify once plugins are no longer crashing. 2002-06-20 Darin Adler <darin@apple.com> Fix for leak where sub-frame IFHTMLViews would not call _stopPlugins. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView viewWillMoveToWindow:]): * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView viewWillMoveToWindow:]): Use this viewWillMoveToWindow instead of removeFromSuperview; it's a more reliable way to handle cases where the view is removed from the view hierarchy. Fix for IFWebFrame -> IFWebDataSource -> LoadProgressMonitor -> IFWebFrame reference cycle. * WebView.subproj/IFLocationChangeHandler.h: Add dataSource parameters for the methods that don't have them so this can be "delegate" style. * WebView.subproj/IFWebController.h: Pass a dataSource instead of a frame when asking for a location change handler. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): Pass dataSource for locationChangeDone. * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _startLoading:]): Pass dataSource for locationChangeStarted. * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame setProvisionalDataSource:]): Pass a dataSource instead of a frame when asking for a location change handler. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _transitionProvisionalToCommitted]): Pass dataSource for locationChangeCommitted. (-[IFWebFrame _isLoadComplete]): Pass dataSource for locationChangeDone. * force-clean-timestamp: Give this mechanism a try. I'm not sure we really need a clean build right now. * WebView.subproj/IFWebDataSource.mm: Simplify. 2002-06-20 Kenneth Kocienda <kocienda@apple.com> A more complete fix for this bug: Radar 2942728 (Link to Yahoo! Finance stocks page fails, says URL is "not a valid location") I added a new +(NSURL)_IF_URLWithString: method to IFNSURLExtensions. This is now the suggested way to create a URL from a string. * History.subproj/IFURIEntry.m: (-[IFURIEntry initFromDictionaryRepresentation:]) * History.subproj/IFURLsWithTitles.m: (+[IFURLsWithTitles URLsFromPasteboard:]) * History.subproj/IFWebHistoryPrivate.m: (-[IFWebHistoryPrivate updateURL:title:displayTitle:forURL:]) * Plugins.subproj/IFNullPluginView.mm: (-[IFNullPluginView initWithFrame:mimeType:arguments:]) * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:]) (-[IFPluginView loadURL:inTarget:withNotifyData:andHandleAttributes:]) * WebCoreSupport.subproj/IFWebCoreViewFactory.m: (-[IFWebCoreViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]) * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _startLoading:]) * WebView.subproj/IFWebView.mm: (-[IFWebView performDragOperation:]) === Alexander-9 === 2002-06-19 Richard Williamson <rjw@apple.com> Break image renderer reference cycle. When a view is removed from the view hierarchy active image renderers are told to stop animating, which will, in turn, cause them to release their view. We leverage the existing _stopPlugins mechanism. * WebCoreSupport.subproj/IFImageRenderer.h: * WebCoreSupport.subproj/IFImageRenderer.m: (+[IFImageRenderer stopAnimationsInView:]): (-[IFImageRenderer beginAnimationInView:inRect:fromRect:]): (-[IFImageRenderer frameView]): (-[IFImageRenderer stopAnimation]): * WebView.subproj/IFHTMLViewPrivate.mm: (-[IFHTMLView _stopPlugins]): 2002-06-19 John Sullivan <sullivan@apple.com> - fixed 2960677 -- attempt to insert nil key; content policy set twice on particular page. The problem here was a bad URL not being propogated through the error-handling machinery correctly because the url handle was nil, but used to get its string. * WebCoreSupport.subproj/IFResourceURLHandleClient.m: (+[IFResourceURLHandleClient startLoadingResource:withURL:dataSource:]): * WebView.subproj/IFWebControllerPrivate.mm: Use IFError init method that takes failingURL. (-[IFWebController _receivedProgress:forResourceHandle:fromDataSource:complete:]): (-[IFWebController _receivedError:forResourceHandle:partialProgress:fromDataSource:]): Check [error failingURL] when resource handle is nil. 2002-06-19 Darin Adler <darin@apple.com> Fixed a storage leak and made some other changes to go along with corresponding WebCore changes. * WebCoreSupport.subproj/IFResourceURLHandleClient.m: (-[IFResourceURLHandleClient didStartLoadingWithURL:]): Added. (-[IFResourceURLHandleClient didStopLoading]): Added. (-[IFResourceURLHandleClient dealloc]): (-[IFResourceURLHandleClient IFURLHandleResourceDidBeginLoading:]): (-[IFResourceURLHandleClient IFURLHandleResourceDidCancelLoading:]): (-[IFResourceURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): (-[IFResourceURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): (-[IFResourceURLHandleClient IFURLHandle:didRedirectToURL:]): Use didStartLoadingWithURL and didStopLoading to cure problems where the handle would be left in the data sources list of loading handles. * WebView.subproj/IFDynamicScrollBarsView.h: Changed to conform to the WebCoreFrameView protocol. * Misc.subproj/WebKitDebug.h: Cloned improved assert code from WebFoundation. * WebView.subproj/IFDynamicScrollBarsView.m: Fixed comment. 2002-06-19 Chris Blumenberg <cblu@apple.com> Call setWindow in layout so that plug-in content is drawn without needing to resize. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView layout]): (-[IFPluginView viewHasMoved:]): 2002-06-19 Kenneth Kocienda <kocienda@apple.com> I just played alchemical voodoo games with the linker to make all our frameworks and Alexander prebound. * WebKit.pbproj/project.pbxproj 2002-06-18 Chris Blumenberg <cblu@apple.com> Fix for 2961733 - Progress of plug-in files not shown in activity window Plugin classed must call _IF_superviewWithName: not _IF_parentWebView * Plugins.subproj/IFNullPluginView.mm: (-[IFNullPluginView drawRect:]): * Plugins.subproj/IFPluginStream.mm: minor cleanup (-[IFPluginStream IFURLHandle:resourceDataDidBecomeAvailable:]): (-[IFPluginStream IFURLHandleResourceDidFinishLoading:data:]): (-[IFPluginStream IFURLHandleResourceDidCancelLoading:]): (-[IFPluginStream IFURLHandle:resourceDidFailLoadingWithResult:]): (-[IFPluginStream IFURLHandle:didRedirectToURL:]): * Plugins.subproj/IFPluginView.mm: (-[IFPluginView start]): (-[IFPluginView layout]): 2002-06-18 Chris Blumenberg <cblu@apple.com> Enabled the viewing of plug-in content inline (aka direct links to plugin media). Made IFPluginView a IFDocumentView and IFPluginStream a IFDocumentRespresentation. Renamed content policy API's to include the data source. * Plugins.subproj/IFPluginDatabase.h: * Plugins.subproj/IFPluginDatabase.m: (+[IFPluginDatabase installedPlugins]): registers plugins as IFDocument* * Plugins.subproj/IFPluginStream.h: * Plugins.subproj/IFPluginStream.mm: (-[IFPluginStream init]): added for IFDocumentRepresentation (-[IFPluginStream initWithURL:pluginPointer:notifyData:attributes:]): removed load initiliazatoin (-[IFPluginStream dealloc]): (-[IFPluginStream startLoad]): added (-[IFPluginStream stop]): (-[IFPluginStream receivedData:]): added as the base implementation (-[IFPluginStream receivedError]): added as the base implementation (-[IFPluginStream finishedLoadingWithData:]): added as the base implementation (-[IFPluginStream receivedData:withDataSource:]): added for IFDocumentRepresentation (-[IFPluginStream receivedError:withDataSource:]): added for IFDocumentRepresentation (-[IFPluginStream finishedLoadingWithDataSource:]): added for IFDocumentRepresentation (-[IFPluginStream IFURLHandleResourceDidBeginLoading:]): (-[IFPluginStream IFURLHandle:resourceDataDidBecomeAvailable:]): call receivedData (-[IFPluginStream IFURLHandleResourceDidFinishLoading:data:]): call finishedLoadingWithData (-[IFPluginStream IFURLHandleResourceDidCancelLoading:]): call receivedError (-[IFPluginStream IFURLHandle:resourceDidFailLoadingWithResult:]): call receivedError (-[IFPluginStream IFURLHandle:didRedirectToURL:]): * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:]): removed special-case code for NP_FULL mose (-[IFPluginView start]): (-[IFPluginView initWithFrame:]): added for IFDocumentView (-[IFPluginView provisionalDataSourceChanged:]): added for IFDocumentView (-[IFPluginView provisionalDataSourceCommitted:]): added for IFDocumentView (-[IFPluginView dataSourceUpdated:]): added for IFDocumentView (-[IFPluginView layout]): added for IFDocumentView (-[IFPluginView removeFromSuperview]): call stop (-[IFPluginView loadURL:inTarget:withNotifyData:andHandleAttributes:]): (-[IFPluginView pluginInstance]): added * WebCoreSupport.subproj/IFWebCoreViewFactory.m: (-[IFWebCoreViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]): call new init method (-[IFWebCoreViewFactory viewForJavaAppletWithArguments:]): call new init method * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFLocationChangeHandler.h: content policy method name changes * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): content policy method name changes * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebController.mm: (-[IFWebController haveContentPolicy:andPath:forDataSource:]): content policy method name changes * WebView.subproj/IFWebDataSourcePrivate.h: 2002-06-18 Kenneth Kocienda <kocienda@apple.com> Fix for this bug: Radar 2928483 (activity viewer does not show all the pieces of a web page when the page is cached) * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebCoreBridge objectLoadedFromCache:size:]): New method that sends the appropriate progress indication. 2002-06-17 Richard Williamson <rjw@apple.com> Fixed window.open regression. Partial fix to targeting frame of new name. * WebCoreSupport.subproj/IFWebCoreBridge.h: * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebCoreBridge openNewWindowWithURL:]): Return the newly created bridge. (-[IFWebCoreBridge receivedData:withDataSource:]): Use setDataSource: method (-[IFWebCoreBridge startLoadingResource:withURL:]): No change. (-[IFWebCoreBridge setDataSource:]): New method. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView mouseMovedNotification:]): Selection support. (-[IFHTMLView mouseDragged:]): Selection support. * WebView.subproj/IFWebController.mm: (-[IFWebController haveContentPolicy:andPath:forLocationChangeHandler:]): Only change representation if it hasn't been pre-bound, or if it's class changed. * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame initWithName:webView:provisionalDataSource:controller:]): More hackery to support window.open. 2002-06-17 Darin Adler <darin@apple.com> Fixed many of the reasons that we were leaking the world. But we still leak KHTMLPart objects, so there must be more problems. * WebCoreSupport.subproj/IFResourceURLHandleClient.m: (+[IFResourceURLHandleClient startLoadingResource:withURL:dataSource:]): Add missing autorelease. Without this, we leak the world. (-[IFResourceURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): Weaken assert. It was firing before. * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebCoreBridge receivedData:withDataSource:]): Don't retain the dataSource any more. Without this, we leak the world. * WebView.subproj/IFWebControllerPrivate.mm: (-[IFWebControllerPrivate dealloc]): Release the policy handler too. Without this, we leak the world. * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]): Release resourceData, representation, downloadPath, encoding, and contentType. Without this, we leak the world. * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame initWithName:webView:provisionalDataSource:controller:]): Release the dummy data source after setting it up so it doesn't leak. * WebView.subproj/IFHTMLViewPrivate.mm: (-[IFHTMLViewPrivate dealloc]): Don't release the controller, we didn't retain it. (-[IFHTMLView _resetWidget]): Delete the provisional widget too. * WebView.subproj/IFWebDataSourcePrivate.h: Remove unused "children" array. * WebCoreSupport.subproj/IFImageRenderer.m: Fix comment. * WebView.subproj/IFHTMLView.mm: Fix comments. 2002-06-17 Richard Williamson <rjw@apple.com> Fixed call to renamed progress method. * Plugins.subproj/IFPluginStream.mm: 2002-06-17 Chris Blumenberg <cblu@apple.com> * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource contentType]): no changes (-[IFWebDataSource fileType]): added. Returns extension based on MIME. 2002-06-17 Richard Williamson <rjw@apple.com> Added explicit complete check for resources, rather than depend on bytesSoFar == totalToLoad. * WebCoreSupport.subproj/IFResourceURLHandleClient.m: (-[IFResourceURLHandleClient receivedProgressWithHandle:complete:]): (-[IFResourceURLHandleClient IFURLHandleResourceDidBeginLoading:]): (-[IFResourceURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): (-[IFResourceURLHandleClient IFURLHandleResourceDidCancelLoading:]): (-[IFResourceURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): * WebView.subproj/IFWebControllerPrivate.h: * WebView.subproj/IFWebControllerPrivate.mm: (-[IFWebController _receivedProgress:forResourceHandle:fromDataSource:complete:]): 2002-06-17 Chris Blumenberg <cblu@apple.com> Fix for 2939881. No more overwritting of one's files. * Misc.subproj/IFDownloadHandler.mm: (-[IFDownloadHandler receivedData:]): (-[IFDownloadHandler finishedLoading]): 2002-06-17 Richard Williamson <rjw@apple.com> Fixed IFImageViews not drawing correctly. Changed compeletion to explicity use IFURLHandleResourceDidFinishLoading, rather than depend on bytesSoFar == totalToLoad. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): * WebView.subproj/IFWebControllerPrivate.h: * WebView.subproj/IFWebControllerPrivate.mm: (-[IFWebController _mainReceivedProgress:forResourceHandle:fromDataSource:complete:]): 2002-06-16 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFWebCoreFrame.m: (-[IFWebCoreFrame bridge]): Added. 2002-06-16 Darin Adler <darin@apple.com> Add a separate WebCoreFrame alongside WebCoreBridge to facilitate handling of frames with no HTML content in them. This probably fixes frames named "_blank". * WebCoreSupport.subproj/IFResourceURLHandleClient.m: * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebCoreBridge frame]): Added. (-[IFWebCoreBridge parent]): Changed name from parentFrame, to emphasize that this gives a WebCoreBridge. (-[IFWebCoreBridge childFrames]): Return IFWebCoreFrame objects. (-[IFWebCoreBridge childFrameNamed:]): Return IFWebCoreFrame object. (-[IFWebCoreBridge descendantFrameNamed:]): Return IFWebCoreFrame object. (-[IFWebCoreBridge createChildFrameNamed:withURL:renderPart:khtml::allowsScrolling:marginWidth:marginHeight:]): Use the loadURL operation in IFWebCoreFrame. (-[IFWebCoreBridge mainFrame]): Return IFWebCoreFrame object. (-[IFWebCoreBridge frameNamed:]): Return IFWebCoreFrame object. * WebCoreSupport.subproj/IFWebCoreFrame.h: Added. * WebCoreSupport.subproj/IFWebCoreFrame.m: Added. * WebKit.pbproj/project.pbxproj: Update for added files. * WebView.subproj/IFHTMLViewPrivate.h: Made this includable from plain Objective C. * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame initWithName:webView:provisionalDataSource:controller:]): Create the IFWebCoreFrame. * WebView.subproj/IFWebFramePrivate.h: Add _bridgeFrame method for getting IFWebCoreFrame. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFramePrivate dealloc]): Release the IFWebCoreFrame. (-[IFWebFrame _bridgeFrame]): Added. 2002-06-16 Darin Adler <darin@apple.com> Moved the IFURLHandleClient subclass here from WebCore, so it can some day be merged with the one for the frames themselves; this one is for resources. * WebCoreSupport.subproj/IFResourceURLHandleClient.h: Added. * WebCoreSupport.subproj/IFResourceURLHandleClient.m: Added. * WebKit.pbproj/project.pbxproj: Added IFResourceURLHandleClient.h and .m. * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebCoreBridge startLoadingResource:withURL:]): Added. Removed all the old methods, with their guts moved into IFResourceURLHandleClient. 2002-06-15 Darin Adler <darin@apple.com> Update for frame-related changes in WebCore. * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebFrame _bridge]): Look at provisional data source first. (-[IFWebCoreBridge dealloc]): Release the data source. (-[IFWebCoreBridge parentFrame]): Renamed. (-[IFWebCoreBridge childFrames]): Renamed. (-[IFWebCoreBridge childFrameNamed:]): Added. (-[IFWebCoreBridge descendantFrameNamed:]): Added. (-[IFWebCoreBridge didFinishLoadingWithHandle:]): Don't call _didStopLoading twice when we finish loading. Also changed controller getters to call [dataSource controller] and got rid of the [IFWebCoreBridge controller] method. 2002-06-15 Richard Williamson <rjw@apple.com> * Misc.subproj/IFNSViewExtras.h: * Misc.subproj/IFNSViewExtras.m: (-[NSView _IF_superviewWithName:]): (-[NSView _IF_parentWebView]): Replaced use of _IF_superviewWithName w/ safer _IF_parentWebView. * Plugins.subproj/IFNullPluginView.mm: (-[IFNullPluginView drawRect:]): Replaced use of _IF_superviewWithName w/ safer _IF_parentWebView. * Plugins.subproj/IFPluginStream.mm: (-[IFPluginStream IFURLHandle:resourceDataDidBecomeAvailable:]): (-[IFPluginStream IFURLHandleResourceDidFinishLoading:data:]): (-[IFPluginStream IFURLHandleResourceDidCancelLoading:]): (-[IFPluginStream IFURLHandle:resourceDidFailLoadingWithResult:]): Call _receiveProgress instead of directly calling handler. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView start]): Replaced use of _IF_superviewWithName w/ safer _IF_parentWebView. * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebCoreBridge loadURL:attributes:flags:inFrame:withParent:]): Handle changing top frame correctly. Parent may be nil. (-[IFWebCoreBridge didFinishLoadingWithHandle:]): Added non-terminal error case. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView provisionalDataSourceCommitted:]): Replaced use of _IF_superviewWithName w/ safer _IF_parentWebView. * WebView.subproj/IFMainURLHandleClient.mm: * WebView.subproj/IFWebControllerPrivate.mm: Comment changes. 2002-06-15 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFWebCoreBridge.mm: Added a lot of assertions that I had used while debugging. (-[IFWebCoreBridge didRedirectWithHandle:fromURL:]): Commented out the line of code that calls [serverRedirectTo:forDataSource:]. Our old code was sending this to the web controller (that was a bug). But if we send it to the location change handler, then we confuse Alexander. We may return to this later, uncomment it, and change the interface so the client can tell what is being redirected. We'll need to do that if we want the activity window to show redirected URLs at the time of the redirect. 2002-06-15 Richard Williamson <rjw@apple.com> Fixed _bridge not accounting for provisional data source, broke access to window.frames during load. * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebFrame _bridge]): (-[IFWebCoreBridge children]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): 2002-06-15 Darin Adler <darin@apple.com> * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView provisionalDataSourceChanged:]): Don't turn negative numbers into 0 for margins. This was a mistake. 2002-06-15 Darin Adler <darin@apple.com> - fixed 2942808 -- remove all calls to WebKit from WebCore Update to use the WebCore bridge for more things, reducing dependencies in both directions. Besides using the bridge for all the remaining WebCore to WebKit calls, almost no WebKit code deals with KHTMLPart directly any more, instead the other side of the bridge handles it. * Plugins.subproj/IFPluginStream.mm: (-[IFPluginStream IFURLHandleResourceDidBeginLoading:]): Remove unneeded casts. (-[IFPluginStream IFURLHandle:resourceDataDidBecomeAvailable:]): (-[IFPluginStream IFURLHandleResourceDidFinishLoading:data:]): (-[IFPluginStream IFURLHandleResourceDidCancelLoading:]): (-[IFPluginStream IFURLHandle:resourceDidFailLoadingWithResult:]): (-[IFPluginStream IFURLHandle:didRedirectToURL:]): Use the new IFProgress methods to simplify code. * WebCoreSupport.subproj/IFWebCoreBridge.h: Use the new WebCoreBridge protocol so we get a compiler error if we forget to implement anything. Add a method for IFWebDataSource that gets the WebCoreBridge if it has an IFHTMLRepresentation, and nil otherwise. * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebDataSource _bridge]): Add; does checking so that it returns nil if the representation is not an IFHTMLRepresentation. This is now used almost everywhere so we don't have to do so much type casting. (-[IFWebCoreBridge loadURL:attributes:flags:inFrame:withParent:]): Remove a stray use of [IFWebCoreBridge dataSource] so we can remove it. (-[IFWebCoreBridge receivedData:withDataSource:]): Use the new [WebCoreBridge openURL:] and [WebCoreBridge addData:] methods from the other side of the bridge so we don't have to deal with the KHTMLPart directly. (-[IFWebCoreBridge addHandle:]): Added. (-[IFWebCoreBridge removeHandle:]): Added. (-[IFWebCoreBridge didStartLoadingWithHandle:]): Added. (-[IFWebCoreBridge receivedProgressWithHandle:]): Added. (-[IFWebCoreBridge didFinishLoadingWithHandle:]): Added. (-[IFWebCoreBridge didCancelLoadingWithHandle:]): Added. (-[IFWebCoreBridge didFailBeforeLoadingWithError:]): Added. (-[IFWebCoreBridge didFailToLoadWithHandle:error:]): Added. (-[IFWebCoreBridge didRedirectWithHandle:fromURL:]): Added. * WebView.subproj/IFHTMLRepresentation.h: Remove unneeded declarations. * WebView.subproj/IFHTMLRepresentation.mm: Remove [IFHTMLRepresentation part]. * WebView.subproj/IFHTMLRepresentationPrivate.h: Remove [IFHTMLRepresentation part]. * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView provisionalDataSourceChanged:]): Use the bridge. * WebView.subproj/IFHTMLViewPrivate.mm: Remove a bunch of unused stuff that was there for the render and document tree viewers. I had removed it once before but it got re-added as a side effect of the reorganization process. * WebView.subproj/IFLoadProgress.h: Remove the unused IFLoadType -- we can add it back if we find that it's needed. It didn't do much good to have it here and only partly implemented, and I don't think it's needed. Added some convenient interfaces for creating IFLoadProgress objects. * WebView.subproj/IFLoadProgress.mm: Get rid of WCSetIFLoadProgressMakeFunc stuff. (-[IFLoadProgress init]): Added. (-[IFLoadProgress initWithBytesSoFar:totalToLoad:]): Remove type part. (-[IFLoadProgress initWithURLHandle:]): Added. (+[IFLoadProgress progress]): Added. (+[IFLoadProgress progressWithBytesSoFar:totalToLoad:]): Added. (+[IFLoadProgress progressWithURLHandle:]): Added. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient dealloc]): Add more workaround for 2954901. (-[IFMainURLHandleClient IFURLHandleResourceDidBeginLoading:]): (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): Remove unneeded type casts and simplify by using new IFLoadProgress methods. Also simplify access to _bridge by using [IFWebDataSource _bridge]. * WebView.subproj/IFWebControllerPrivate.mm: * WebView.subproj/IFWebFrame.mm: Remove unneeded include of KHTMLPart header. * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource documentTextFromDOM]): * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _stopLoading]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): Use bridge. 2002-06-15 Maciej Stachowiak <mjs@apple.com> Made Development build mode mean what Unoptimized used to mean. Removed Unoptimized build mode. Added a Mixed build mode which does what Deployment used to. All this to fix: Radar 2955367 - Change default build style to "Unoptimized" * WebKit.pbproj/project.pbxproj: 2002-06-15 Maciej Stachowiak <mjs@apple.com> Added temporary workardound for Radar 2954901 by making the assertion more lenient. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): 2002-06-14 Richard Williamson <rjw@apple.com> Removed redundant private _isDocumentHTML method. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _stopLoading]): (-[IFWebDataSource _addError:forResource:]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): 2002-06-14 Richard Williamson <rjw@apple.com> Added handlers to IFWebController. Should eventually be possible to use IFWebController w/o subclassing. Changed IFResourceProgressHandler to pass back resource handle instead of string description. This will address the needs descibed in 2954160. Fixed many incorrect references to datasource reps. * Plugins.subproj/IFNullPluginView.mm: (-[IFNullPluginView drawRect:]): * Plugins.subproj/IFPluginStream.mm: (-[IFPluginStream IFURLHandle:resourceDataDidBecomeAvailable:]): (-[IFPluginStream IFURLHandleResourceDidFinishLoading:data:]): (-[IFPluginStream IFURLHandleResourceDidCancelLoading:]): (-[IFPluginStream IFURLHandle:resourceDidFailLoadingWithResult:]): * WebCoreSupport.subproj/IFWebCoreBridge.mm: (-[IFWebDataSource _bridge]): (-[IFWebCoreBridge createNewFrameNamed:withURL:renderPart:khtml::allowsScrolling:marginWidth:marginHeight:]): * WebView.subproj/IFDocument.h: * WebView.subproj/IFHTMLRepresentation.h: * WebView.subproj/IFHTMLRepresentationPrivate.h: * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView provisionalDataSourceChanged:]): (-[IFHTMLView viewWillStartLiveResize]): (-[IFHTMLView viewDidEndLiveResize]): * WebView.subproj/IFImageView.m: * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebController.mm: (-[IFWebController createFrameNamed:for:inParent:allowsScrolling:]): (-[IFWebController setResourceProgressHandler:]): (-[IFWebController resourceProgressHandler]): (-[IFWebController setPolicyHandler:]): (-[IFWebController policyHandler]): (+[IFWebController defaultURLPolicyForURL:]): * WebView.subproj/IFWebControllerPrivate.h: * WebView.subproj/IFWebControllerPrivate.mm: (-[IFWebControllerPrivate dealloc]): (-[IFWebController _receivedProgress:forResourceHandle:fromDataSource:]): (-[IFWebController _mainReceivedProgress:forResourceHandle:fromDataSource:]): (-[IFWebController _receivedError:forResourceHandle:partialProgress:fromDataSource:]): (-[IFWebController _mainReceivedError:forResourceHandle:partialProgress:fromDataSource:]): * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource representation]): (-[IFWebDataSource isDocumentHTML]): (-[IFWebDataSource documentTextFromDOM]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]): (-[IFWebDataSource _setRepresentation:]): (-[IFWebDataSource _stopLoading]): (-[IFWebDataSource _isDocumentHTML]): * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame setProvisionalDataSource:]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): 2002-06-14 Darin Adler <darin@apple.com> * Panels.subproj/IFStandardPanels.m: Use the real PTHREAD_ONCE_INIT, remove the workaround for 2905545. * IFWebCoreBridge.h: Moved into WebCoreSupport.subproj. * IFWebCoreBridge.mm: Moved into WebCoreSupport.subproj. * WebCoreSupport.subproj/IFWebCoreBridge.h: Moved from top level. * WebCoreSupport.subproj/IFWebCoreBridge.mm: Moved from top level. * WebKit.pbproj/project.pbxproj: Update for new file locations. Also pass -no-c++filt so we get mangled names (more useful for .exp files), and remove PFE_FILE_C_DIALECTS. 2002-06-14 Chris Blumenberg <cblu@apple.com> * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): If content type is the default type and there is no extension, assume HTML. (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: Made isDocumentHTML public (-[IFWebDataSource isDocumentHTML]): (-[IFWebDataSource documentSource]): (-[IFWebDataSource documentTextFromDOM]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _stopLoading]): (-[IFWebDataSource _addError:forResource:]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): 2002-06-14 Darin Adler <darin@apple.com> * Panels.subproj/IFStandardPanels.m: Fix what I broke last time. 2002-06-14 Darin Adler <darin@apple.com> * Panels.subproj/IFStandardPanels.m: (-[IFStandardPanelsPrivate frontmostWindowLoadingURL:]): Change to call webView instead of view. Not sure why anyone was able to compile this. * Plugins.subproj/IFNullPluginView.mm: Remove include of obsolete WCPluginWidget.h. * WebView.subproj/IFHTMLRepresentation.mm: (-[IFHTMLRepresentation part]): Call part instead of KHTMLPart. Not sure why anyone was able to compile this. 2002-06-14 Darin Adler <darin@apple.com> Add the new bridge class that connects us to WebCore in a nicer way. Started to use it for some things. More to come. * WebKit.pbproj/project.pbxproj: * IFWebCoreBridge.h: Added. * IFWebCoreBridge.mm: Added. * Misc.subproj/IFDownloadHandler.mm: (-[IFDownloadHandler initWithDataSource:]): Call [super init]. (-[IFDownloadHandler dealloc]): Call [super dealloc]. * Plugins.subproj/IFPluginNullEventSender.m: (-[IFPluginNullEventSender initializeWithNPP:functionPointer:window:]): Call [super init]. (-[IFPluginNullEventSender dealloc]): Call [super dealloc]. * WebView.subproj/IFDOMNode.mm: (-[IFDOMNode dealloc]): Call [super dealloc]. * WebView.subproj/IFImageView.m: (-[IFImageView dealloc]): Call [super dealloc]. * WebView.subproj/IFRenderNode.mm: (-[IFRenderNode dealloc]): Call [super dealloc]. * WebView.subproj/IFHTMLRepresentation.h: Moved variables into a private structure so this class can be made public. * WebView.subproj/IFHTMLRepresentationPrivate.h: Added. Has _bridge method. * WebView.subproj/IFHTMLRepresentation.mm: (-[IFHTMLRepresentation init]): Call [super init]. Also use the new private structure, and allocate the IFWebCoreBridge. (-[IFHTMLRepresentation dealloc]): Release the private structure and the IFWebCoreBridge. Also, call [super dealloc]. (-[IFHTMLRepresentation _bridge]): Private method to get to the bridge. (-[IFHTMLRepresentation receivedData:withDataSource:]): Use IFWebCoreBridge. * WebView.subproj/IFWebViewPrivate.h: Add _setMarginWidth and _setMarginHeight. * WebView.subproj/IFWebDataSourcePrivate.h: Tweak. * WebView.subproj/IFWebDataSource.mm: Tweak. * History.subproj/IFWebHistoryPrivate.m: Tweak. 2002-06-14 Richard Williamson <rjw@apple.com> Lots of frame related cleanup. Added attempt to get nested scrollbars to work correctly with window's resize corner. Still not quite right. Name change [IFWebFrame view] -> [IFWebFrame webView]. * WebView.subproj/IFDynamicScrollBarsView.m: (-[IFDynamicScrollBarsView updateScrollers]): * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView provisionalDataSourceChanged:]): (-[IFHTMLView viewDidEndLiveResize]): * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebController.mm: (-[IFWebController initWithView:provisionalDataSource:]): (-[IFWebController createFrameNamed:for:inParent:inScrollView:]): (-[IFWebController _frameForView:fromFrame:]): (-[IFWebController frameForView:]): (-[IFWebController haveContentPolicy:andPath:forLocationChangeHandler:]): * WebView.subproj/IFWebControllerPrivate.mm: (-[IFWebControllerPrivate _clearControllerReferences:]): * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame init]): (-[IFWebFrame initWithName:webView:provisionalDataSource:controller:]): (-[IFWebFrame setWebView:]): (-[IFWebFrame webView]): (-[IFWebFrame setProvisionalDataSource:]): (-[IFWebFrame reset]): * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFramePrivate dealloc]): (-[IFWebFramePrivate setWebView:]): (-[IFWebFrame _timedLayout:]): (-[IFWebFrame _transitionProvisionalToCommitted]): (-[IFWebFrame _setState:]): (-[IFWebFrame _isLoadComplete]): 2002-06-14 Richard Williamson <rjw@apple.com> * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView initWithFrame:]): Added notification so we can intelligently add/remove mouse move observation when the window becomes/resigns main. Also added window close observation so we can clean up other observers. (-[IFHTMLView viewWillStartLiveResize]):\ Backed out removal of scroll bars during resize. (-[IFHTMLView viewDidEndLiveResize]): Backed out removal of scroll bars during resize. (-[IFHTMLView windowWillClose:]): Clean up observers. (-[IFHTMLView windowDidBecomeMain:]): Add mouse move observer. (-[IFHTMLView windowDidResignMain:]): Remove mouse move observer. (-[IFHTMLView mouseMovedNotification:]): Only pay attention to mouse moves for this window. * WebView.subproj/IFImageView.m: (-[IFImageView layout]): Removed unnecessary scroll view setDrawBackground calls. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _setState:]): Added calls to scroll view setDrawBackground when the view rect is valid. 2002-06-14 Chris Blumenberg <cblu@apple.com> Enabled displaying of text, images and RTF Fixed drag & drop 2002-06-13 John Sullivan <sullivan@apple.com> Various changes to better support the pasteboard. * Bookmarks.subproj/IFBookmark.h, * Bookmarks.subproj/IFBookmark.m: (+[IFBookmark bookmarkOfType:]): New method. * Bookmarks.subproj/IFBookmarkLeaf.m: (-[IFBookmarkLeaf init]): start out with a non-nil _entry (-[IFBookmarkLeaf setTitle:]): added assert (-[IFBookmarkLeaf setURLString:]): added assert * History.subproj/IFURLsWithTitles.h, * History.subproj/IFURLsWithTitles.m: (+[IFURLsWithTitles arrayWithIFURLsWithTitlesPboardType]), (+[IFURLsWithTitles writeURLs:andTitles:toPasteboard:]), (+[IFURLsWithTitles titlesFromPasteboard:]), (+[IFURLsWithTitles URLsFromPasteboard:]): New file with methods for reading/writing pasteboard entry representing a list of URLs with associated titles. Used by Bookmarks window and History window in Alexander. * History.subproj/IFWebHistoryPrivate.m: (-[IFWebHistoryPrivate removeEntryForURLString:]): refactored to turn a WEBKITDEBUG into a more-appropriate WEBKIT_ASSERT. * WebKit.pbproj/project.pbxproj: Updated for new files. 2002-06-13 Kenneth Kocienda <kocienda@apple.com> Fixed typo in ChangeLog comment. 2002-06-13 Kenneth Kocienda <kocienda@apple.com> Fixed uninitialized variable that broke the build. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]) 2002-06-13 Richard Williamson <rjw@apple.com> Lots of cleanup. Fixed most regressions. Added removal of scrollbars during resizing, not sure if it's the correct behavior, but it makes resizing much smoother. Let's see what people think. * WebView.subproj/IFDynamicScrollBarsView.h: * WebView.subproj/IFDynamicScrollBarsView.m: (-[IFDynamicScrollBarsView initWithFrame:]): (-[IFDynamicScrollBarsView reflectScrolledClipView:]): (-[IFDynamicScrollBarsView updateScrollers]): (-[IFDynamicScrollBarsView setCursor:]): (-[IFDynamicScrollBarsView setAllowsScrolling:]): (-[IFDynamicScrollBarsView allowsScrolling]): * WebView.subproj/IFHTMLView.mm: (-[IFHTMLView provisionalDataSourceChanged:]): (-[IFHTMLView provisionalDataSourceCommitted:]): (-[IFHTMLView viewWillStartLiveResize]): (-[IFHTMLView viewDidEndLiveResize]): * WebView.subproj/IFHTMLViewPrivate.h: * WebView.subproj/IFHTMLViewPrivate.mm: (-[IFHTMLViewPrivate dealloc]): (-[IFHTMLView _provisionalWidget]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _timedLayout:]): (-[IFWebFrame _isLoadComplete]): * WebView.subproj/IFWebView.h: * WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]): (-[IFWebView setAllowsScrolling:]): (-[IFWebView allowsScrolling]): (-[IFWebView frameScrollView]): (-[IFWebView documentView]): (+[IFWebView createViewForMIMEType:]): (-[IFWebView isOpaque]): (-[IFWebView drawRect:]): * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebViewPrivate dealloc]): (-[IFWebView _setDocumentView:]): 2002-06-13 Chris Blumenberg <cblu@apple.com> Removed MIME.subproj. Moved IFDownloadHandler to Misc. * MIME.subproj/IFDownloadHandler.h: Removed. * MIME.subproj/IFDownloadHandler.mm: Removed. * Misc.subproj/IFDownloadHandler.h: Added. * Misc.subproj/IFDownloadHandler.mm: Added. (-[IFDownloadHandler initWithDataSource:]): (-[IFDownloadHandler dealloc]): (-[IFDownloadHandler receivedData:isComplete:]): (-[IFDownloadHandler cancel]): * WebKit.pbproj/project.pbxproj: 2002-06-13 Chris Blumenberg <cblu@apple.com> Fixed downloads. Now write out download files as data comes in. Removed useless lproj's. * Dutch.lproj/InfoPlist.strings: Removed. * Dutch.lproj/Localizable.strings: Removed. * French.lproj/InfoPlist.strings: Removed. * French.lproj/Localizable.strings: Removed. * German.lproj/InfoPlist.strings: Removed. * German.lproj/Localizable.strings: Removed. * Italian.lproj/InfoPlist.strings: Removed. * Italian.lproj/Localizable.strings: Removed. * Japanese.lproj/InfoPlist.strings: Removed. * Japanese.lproj/Localizable.strings: Removed. * MIME.subproj/IFDownloadHandler.h: * MIME.subproj/IFDownloadHandler.mm: (-[IFDownloadHandler dealloc]): (-[IFDownloadHandler receivedData:isComplete:]): added (-[IFDownloadHandler cancel]): added * Spanish.lproj/InfoPlist.strings: Removed. * Spanish.lproj/Localizable.strings: Removed. * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFMainURLHandleClient.h: * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient initWithDataSource:]): removed unused BOOL (-[IFMainURLHandleClient dealloc]): (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): 2002-06-12 Chris Blumenberg <cblu@apple.com> Couldn't run ChangeLog because it hung with the massize diffs, so here's a hand-made one. Changes to support inline views. Modified Files: WebKit/ChangeLog WebKit/Plugins.subproj/IFNullPluginView.mm WebKit/Plugins.subproj/IFPluginDatabase.h WebKit/Plugins.subproj/IFPluginDatabase.m WebKit/Plugins.subproj/IFPluginView.mm WebKit/WebCoreSupport.subproj/IFImageRenderer.h WebKit/WebCoreSupport.subproj/IFWebCoreViewFactory.m WebKit/WebKit.pbproj/project.pbxproj WebKit/WebView.subproj/IFDOMNode.mm WebKit/WebView.subproj/IFDynamicScrollBarsView.m WebKit/WebView.subproj/IFMainURLHandleClient.h WebKit/WebView.subproj/IFMainURLHandleClient.mm WebKit/WebView.subproj/IFRenderNode.mm WebKit/WebView.subproj/IFWebController.h WebKit/WebView.subproj/IFWebController.mm WebKit/WebView.subproj/IFWebControllerPrivate.h WebKit/WebView.subproj/IFWebControllerPrivate.mm WebKit/WebView.subproj/IFWebDataSource.h WebKit/WebView.subproj/IFWebDataSource.mm WebKit/WebView.subproj/IFWebDataSourcePrivate.h WebKit/WebView.subproj/IFWebDataSourcePrivate.mm WebKit/WebView.subproj/IFWebFrame.mm WebKit/WebView.subproj/IFWebFramePrivate.h WebKit/WebView.subproj/IFWebFramePrivate.mm WebKit/WebView.subproj/IFWebView.h WebKit/WebView.subproj/IFWebView.mm WebKit/WebView.subproj/IFWebViewPrivate.h WebKit/WebView.subproj/IFWebViewPrivate.mm Added Files: WebKit/Misc.subproj/IFNSViewExtras.h WebKit/Misc.subproj/IFNSViewExtras.m WebKit/WebView.subproj/IFDocument.h WebKit/WebView.subproj/IFHTMLRepresentation.h WebKit/WebView.subproj/IFHTMLRepresentation.mm WebKit/WebView.subproj/IFHTMLView.h WebKit/WebView.subproj/IFHTMLView.mm WebKit/WebView.subproj/IFHTMLViewPrivate.h WebKit/WebView.subproj/IFHTMLViewPrivate.mm WebKit/WebView.subproj/IFImageRepresentation.h WebKit/WebView.subproj/IFImageRepresentation.m WebKit/WebView.subproj/IFImageView.h WebKit/WebView.subproj/IFImageView.m WebKit/WebView.subproj/IFTextRepresentation.h WebKit/WebView.subproj/IFTextRepresentation.m WebKit/WebView.subproj/IFTextView.h WebKit/WebView.subproj/IFTextView.m Removed Files: WebKit/MIME.subproj/IFContentHandler.h WebKit/MIME.subproj/IFContentHandler.m WebKit/MIME.subproj/IFMIMEHandler.h WebKit/MIME.subproj/IFMIMEHandler.m 2002-06-12 Kenneth Kocienda <kocienda@apple.com> * Misc.subproj/WebKitDebug.h: Made assertion failure console message bolder and easier to see. 2002-06-11 Darin Adler <darin@apple.com> * WebView.subproj/IFMainURLHandleClient.mm: Add lots of assertions that allowed me to find the "leak the world" bug that Ken fixed in WebFoundation. These are a good idea anyway. * Plugins.subproj/IFPluginStream.mm: (-[IFPluginStream initWithURL:pluginPointer:notifyData:attributes:]): Use cStringLength to get the length for the cString rather than assuming that length will be right. (-[IFPluginStream IFURLHandle:didRedirectToURL:]): Add a FIXME. 2002-06-11 John Sullivan <sullivan@apple.com> Made methods that convert bookmarks to and from property-list-compatible dictionaries public so they can be used in the Bookmarks window for cut/paste. * Bookmarks.subproj/IFBookmark.h: * Bookmarks.subproj/IFBookmark.m: (+[IFBookmark bookmarkFromDictionaryRepresentation:withGroup:]): New method (-[IFBookmark initFromDictionaryRepresentation:withGroup:]): (-[IFBookmark dictionaryRepresentation]): * Bookmarks.subproj/IFBookmarkGroup.m: (-[IFBookmarkGroup _loadBookmarkGroupGuts]): (-[IFBookmarkGroup _saveBookmarkGroupGuts]): * Bookmarks.subproj/IFBookmarkLeaf.m: (-[IFBookmarkLeaf initFromDictionaryRepresentation:withGroup:]): (-[IFBookmarkLeaf dictionaryRepresentation]): * Bookmarks.subproj/IFBookmarkList.m: (-[IFBookmarkList initFromDictionaryRepresentation:withGroup:]): (-[IFBookmarkList dictionaryRepresentation]): * Bookmarks.subproj/IFBookmarkSeparator.m: (-[IFBookmarkSeparator initFromDictionaryRepresentation:withGroup:]): (-[IFBookmarkSeparator dictionaryRepresentation]): * Bookmarks.subproj/IFBookmark_Private.h: Removed leading underscores from _initFromDictionaryRepresentation and _dictionaryRepresentation, and made them public. 2002-06-11 Darin Adler <darin@apple.com> * WebView.subproj/IFDOMNode.h: Added. * WebView.subproj/IFDOMNode.mm: Added. * WebView.subproj/IFRenderNode.h: Added. * WebView.subproj/IFRenderNode.mm: Added. These contain all the interesting bits of the code for the render and DOM tree viewers, mostly moved here from WebBrowser. * WebView.subproj/IFWebViewPrivate.mm: Remove the methods in here that aren't declared in the header and are only used for the render and DOM tree viewers. * WebKit.pbproj/project.pbxproj: Add new files. 2002-06-10 Darin Adler <darin@apple.com> * Makefile.am: Do a clean before building if the force-clean-timestamp file is newer than the previous-clean-timestamp. Edit force-clean-timestamp (doesn't matter what you change as long as you change it) to force a clean build in WebKit. * force-clean-timestamp: Added. * .cvsignore: Ignore previous-clean-timestamp. 2002-06-10 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFTextRenderer.h: Remove the flavor of floatWidthForCharacters without the applyRounding boolean. * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]): Remove logic about characters in the 0x7F-0xA0 range, since it's already handled by the time we get around to drawing. (-[IFTextRenderer floatWidthForCharacters:length:applyRounding:]): Pass in the applyRounding boolean when calling through to slowFloatWidthForCharacters. Move logic about characters in the 0x7F-0xA0 range from here into [extendCharacterToGlyphMapToInclude:]. (-[IFTextRenderer widthForCharacters:length:]): Call the version of floatWidthForCharacters that takes the applyRounding parameter; this was the only client of the flavor that didn't take the parameter. (-[IFTextRenderer extendCharacterToGlyphMapToInclude:]): Add the logic about characters in the 0x7F-0xA0 range into here. 2002-06-10 Richard Williamson <rjw@apple.com> Tweaks to rounding code. Added Cocoa-exact width measurement emulation flag to support IFStringTruncator. Remove code that was already conditionally excluded calls to support non-specified advance drawing (we now depend on tweaked advances). * Misc.subproj/IFStringTruncator.m: (+[IFStringTruncator centerTruncateString:toWidth:withFont:]): * WebCoreSupport.subproj/IFTextRenderer.h: * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer initWithFont:]): (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]): (-[IFTextRenderer slowFloatWidthForCharacters:length:applyRounding:]): (-[IFTextRenderer slowFloatWidthForCharacters:length:]): (-[IFTextRenderer floatWidthForCharacters:length:applyRounding:]): (-[IFTextRenderer floatWidthForCharacters:length:]): (-[IFTextRenderer extendCharacterToGlyphMapToInclude:]): 2002-06-10 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFCachedTextRenderer.m: Removed. 2002-06-10 John Sullivan <sullivan@apple.com> Fixed leaks in History mechanism, found by overriding release, retain, autorelease, and dealloc and watching the spam fly. * History.subproj/IFWebHistoryPrivate.m: (-[IFWebHistoryPrivate addEntry:]): Make autoreleased array for entries on a given date. (-[IFWebHistoryPrivate _loadHistoryGuts:]): autorelease entries as they are generated from data on disk. 2002-06-10 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]): Fix a typo where I left the S off of DRAW_WITHOUT_ADVANCES. 2002-06-10 Richard Williamson <rjw@apple.com> 90% solution to round-off problem. khtml breaks measures text on space boundaries during layout. It assumes integer measurement, CG uses float measurements. Some common fonts have non-integer space width. So, differences in between drawing advances and measurement of space characters can easily accumulate enough to be visually apparent. We may still accumulate differences across words, although it's much less visible than for spaces. As a next step we can fudge the advances of words to force integer widths, although I think, given how khtml work, just accounting for consistency in measuring and drawing spaces may be sufficient. Many sites that looked flaky before now render correctly. * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]): Force rounding of advance for space characters. (-[IFTextRenderer floatWidthForCharacters:length:]): Force rounding of measurement for space characters. 2002-06-09 John Sullivan <sullivan@apple.com> WebKit part of fix for 2949646 (Can't drag & drop bookmarks into auto-expanded folder). To get this to work right, I gave each bookmark a unique (per-session) identifier. While working on this, I found and fixed some leaks of bookmarks. * Bookmarks.subproj/IFBookmark.h: New -[identifier] method and _identifier ivar. * Bookmarks.subproj/IFBookmark.m: (+[IFBookmark _generateUniqueIdentifier]): (-[IFBookmark init]): (-[IFBookmark dealloc]): Remember unique identifier in each bookmark as it is created; delete when dealloc'd. (-[IFBookmark identifier]): Return unique identifier. (-[IFBookmark _setParent:]): Don't retain parent, to avoid circular ownership. (-[IFBookmark _setGroup:]): Tell coming and going group. * Bookmarks.subproj/IFBookmarkGroup.h: New +[bookmarkForIdentifier] method and _bookmarksByID ivar. * Bookmarks.subproj/IFBookmarkGroup_Private.h: Declarations of _removedBookmark: and _addedBookmark: * Bookmarks.subproj/IFBookmarkGroup.m: (-[IFBookmarkGroup initWithFile:]): alloc _bookmarksByID. (-[IFBookmarkGroup dealloc]): release _bookmarksByID. (-[IFBookmarkGroup _setTopBookmark:]): Don't bail out early; would now cause leak. (-[IFBookmarkGroup _removedBookmark:]): New method, removes bookmark from _bookmarksByID. (-[IFBookmarkGroup _addedBookmark:]): New method, adds bookmark to _bookmarksByID. (-[IFBookmarkGroup bookmarkForIdentifier:]): Looks up bookmark from _bookmarksByID dictionary. (-[IFBookmarkGroup _loadBookmarkGroupGuts]): autorelease newTopbookmark; this had been leaking. * Bookmarks.subproj/IFBookmarkList.m: (-[IFBookmarkList _initFromDictionaryRepresentation:withGroup:]): autorelease children before adding them to parent; this had been leaking. 2002-06-09 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]): Fixed a possible uninitialized variable problem that the compiler and Don caught. 2002-06-09 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]): Add code to handle drawing when are more than LOCAL_GLYPH_BUFFER_SIZE advances. I ran into this loading <http://jersey.apple.com/data/20020606-074404M0.html>. Also fix handling of advances for the obscure case where we hit a non-base character, slowPackGlyphsForCharacters fails, and substituteFontforCharacters returns nil. 2002-06-07 Darin Adler <darin@apple.com> * Makefile.am: Use new shared "embed.am" file so we don't need four copies of the embedding rules for WebFoundation, JavaScriptCore, WebCore, and WebKit. 2002-06-07 Darin Adler <darin@apple.com> * MIME.subproj/IFContentHandler.m: (-[IFContentHandler HTMLDocument]): Fix a warning that shows up with the new C++ compiler (not sure why it is not showing up with the old one). 2002-06-07 Chris Blumenberg <cblu@apple.com> Allow plug-ins to make a NPP_*URLNotify request when the target is _self, _top, _parent or _current. This goes against the plug-in documentation, but mimics IE. Need for iTools. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView loadURL:inTarget:withNotifyData:andHandleAttributes:]): 2002-06-07 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Don't use any warning flags for C that won't work for C++, because PFE uses the C warning flags on a C++ compile. 2002-06-07 Chris Blumenberg <cblu@apple.com> Made IFWebController a class. Fixed all places where IFWebController was referred to as a protocol. Renamed IFBaseWebController files to IFWebController. IFWebController.h replaces IFWebBaseController.h. Added support for IEPL plug-ins. * Panels.subproj/IFStandardPanels.m: (-[IFStandardPanels _didStartLoadingURL:inController:]): (-[IFStandardPanels _didStopLoadingURL:inController:]): * Panels.subproj/IFStandardPanelsPrivate.h: * Plugins.subproj/IFNullPluginView.mm: (-[IFNullPluginView drawRect:]): * Plugins.subproj/IFPlugin.h: * Plugins.subproj/IFPlugin.m: (-[IFPlugin _getPluginInfoForResourceFile:]): (-[IFPlugin initWithPath:]): (-[IFPlugin load]): (-[IFPlugin description]): * Plugins.subproj/IFPluginStream.mm: (-[IFPluginStream IFURLHandleResourceDidBeginLoading:]): (-[IFPluginStream IFURLHandleResourceDidFinishLoading:data:]): (-[IFPluginStream IFURLHandleResourceDidCancelLoading:]): (-[IFPluginStream IFURLHandle:resourceDidFailLoadingWithResult:]): (-[IFPluginStream IFURLHandle:didRedirectToURL:]): * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]): (-[IFPluginView webController]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFBaseWebController.h: Removed. * WebView.subproj/IFBaseWebController.mm: Removed. * WebView.subproj/IFBaseWebControllerPrivate.h: Removed. * WebView.subproj/IFBaseWebControllerPrivate.mm: Removed. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidBeginLoading:]): (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebController.mm: Added. (-[IFWebController init]): (-[IFWebController initWithView:provisionalDataSource:]): (-[IFWebController dealloc]): (-[IFWebController setDirectsAllLinksToSystemBrowser:]): (-[IFWebController directsAllLinksToSystemBrowser]): (-[IFWebController createFrameNamed:for:inParent:inScrollView:]): (-[IFWebController setStatusText:forDataSource:]): (-[IFWebController statusTextForDataSource:]): (-[IFWebController openNewWindowWithURL:]): (-[IFWebController receivedProgress:forResource:fromDataSource:]): (-[IFWebController receivedError:forResource:partialProgress:fromDataSource:]): (-[IFWebController provideLocationChangeHandlerForFrame:]): (-[IFWebController receivedPageTitle:forDataSource:]): (-[IFWebController serverRedirectTo:forDataSource:]): (-[IFWebController _frameForDataSource:fromFrame:]): (-[IFWebController frameForDataSource:]): (-[IFWebController _frameForView:fromFrame:]): (-[IFWebController frameForView:]): (-[IFWebController frameNamed:]): (-[IFWebController mainFrame]): (-[IFWebController pluginNotFoundForMIMEType:pluginPageURL:]): (-[IFWebController provideLocationChangeHandlerForFrame:andURL:]): (-[IFWebController URLPolicyForURL:]): (-[IFWebController unableToImplementURLPolicyForURL:error:]): (-[IFWebController haveContentPolicy:andPath:forLocationChangeHandler:]): (-[IFWebController stopAnimatedImages]): (-[IFWebController startAnimatedImages]): (-[IFWebController stopAnimatedImageLooping]): (-[IFWebController startAnimatedImageLooping]): * WebView.subproj/IFWebControllerPrivate.h: Added. * WebView.subproj/IFWebControllerPrivate.mm: Added. (-[IFWebControllerPrivate init]): (-[IFWebControllerPrivate _clearControllerReferences:]): (-[IFWebControllerPrivate dealloc]): (-[IFWebController _receivedProgress:forResource:fromDataSource:]): (-[IFWebController _mainReceivedProgress:forResource:fromDataSource:]): (-[IFWebController _receivedError:forResource:partialProgress:fromDataSource:]): (-[IFWebController _mainReceivedError:forResource:partialProgress:fromDataSource:]): (-[IFWebController _didStartLoading:]): (-[IFWebController _didStopLoading:]): * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource controller]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _setController:]): * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame initWithName:view:provisionalDataSource:controller:]): (-[IFWebFrame controller]): (-[IFWebFrame setController:]): (-[IFWebFrame frameNamed:]): * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFramePrivate setController:]): (-[IFWebFrame _setController:]): * WebView.subproj/IFWebView.h: * WebView.subproj/IFWebView.mm: (-[IFWebView controller]): * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _setController:]): === Alexander-8 === 2002-06-06 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Update warning flags for compatibility with new C++. * WebCoreSupport.subproj/IFTextRenderer.m: (FillStyleWithAttributes): Remove workaround we copied from AppKit, because it's a workaround for a bug that was fixed in Puma. 2002-06-06 Chris Blumenberg <cblu@apple.com> Added support for key codes and other encodings. Send activate to make Java happy. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView keyMessageForEvent:]): added (-[IFPluginView keyUp:]): use above. (-[IFPluginView keyDown:]): use above. (-[IFPluginView windowBecameKey:]): send activate. (-[IFPluginView windowResignedKey:]): send activate. 2002-06-06 John Sullivan <sullivan@apple.com> * Bookmarks.subproj/IFBookmarkList.m: (-[IFBookmarkList removeChild:]): (-[IFBookmarkList insertChild:atIndex:]): * ChangeLog: 2002-06-06 John Sullivan <sullivan@apple.com> * Bookmarks.subproj/IFBookmarkList.m: (-[IFBookmarkList removeChild:]): Added assert. (-[IFBookmarkList insertChild:atIndex:]): Set the group of the new child, and added assert. 2002-06-06 Darin Adler <darin@apple.com> * MIME.subproj/IFContentHandler.m: (-[IFContentHandler initWithURL:MIMEType:MIMEHandlerType:]): Add call to [super init]. (-[IFContentHandler useTemplate:withGlobal:]): New helper function. Also got rid of <title> from templates, since there's no need for us to provide a fake title if it's just the URL. (-[IFContentHandler HTMLDocument]): Reduce use of copied and pasted code. (-[IFContentHandler dealloc]): Add call to [super dealloc]. * Resources/image_document_template.html: Remove <title>. * Resources/plugin_document_template.html: Remove <title>. * Resources/text_document_template.html: Remove <title>. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient processData:isComplete:allDataReceived:]): Remove some unneeded type casts. 2002-06-05 Maciej Stachowiak <mjs@apple.com> Fixed Radar 2936155 - crash in IFAuthenticationPanel * Panels.subproj/IFAuthenticationPanel.m: (-[IFAuthenticationPanel runAsSheetOnWindow:withRequest:]): Add some assertions. (-[IFAuthenticationPanel sheetDidEnd:returnCode:contextInfo:]): Avoid referencing instance variables after performing a selector that might release this object. Also, add some assertions. * Panels.subproj/IFPanelAuthenticationHandler.m: (-[IFPanelAuthenticationHandler startAuthentication:]): Tweak whitespace. 2002-06-05 Richard Williamson <rjw@apple.com> Fixed snafu in recursion over frame tree. * WebView.subproj/IFWebFrame.mm: (+[IFWebFrame _frameNamed:fromFrame:]): (-[IFWebFrame frameNamed:]): 2002-06-05 Richard Williamson <rjw@apple.com> Normalized frame naming. (We still don't support cross window name lookups.) * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController frameNamed:]): * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame frameNamed:]): 2002-06-04 Chris Blumenberg <cblu@apple.com> * MIME.subproj/IFDownloadHandler.mm: Use public methods * WebView.subproj/IFWebDataSource.h: Made downloadPath public * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource downloadPath]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: 2002-06-04 Richard Williamson <rjw@apple.com> More exclusion for pre 6C48. * ChangeLog: * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer incrementalLoadWithBytes:length:complete:]): * WebCoreSupport.subproj/IFImageRendererFactory.m: (-[IFImageRendererFactory imageRenderer]): 2002-06-04 Richard Williamson <rjw@apple.com> Oops, excluded even more code for < 6C48. * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer incrementalLoadWithBytes:length:complete:]): 2002-06-04 Kenneth Kocienda <kocienda@apple.com> * Misc.subproj/WebKitDebug.h: Added a line of stderr output into the assertion failure code so that we have some idea of what happened. 2002-06-04 Richard Williamson <rjw@apple.com> Excluded call to new API until everyone has moved to >= 6C48. * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer incrementalLoadWithBytes:length:complete:]): 2002-06-04 Richard Williamson <rjw@apple.com> Changes to support progressive image loading. Currently disabled until 2945218 is fixed. * WebCoreSupport.subproj/IFImageRenderer.h: * WebCoreSupport.subproj/IFImageRenderer.m: * WebCoreSupport.subproj/IFImageRendererFactory.m: 2002-06-04 Darin Adler <darin@apple.com> - fixed 2932862 -- exception -[NSCFArray getObjects:range:]: index (137) beyond bounds (10) * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _stopPlugins]): (-[IFWebView _removeSubviews]): Make a copy of the subviews list so that changes to the list don't screw up the iterating logic. 2002-06-04 John Sullivan <sullivan@apple.com> Made changes here while working on Undo for removing history entries. * History.subproj/IFWebHistory.h: New methods addEntries: and removeEntries:, deleted method removeEntriesForDay: (use removeEntries: instead). * History.subproj/IFWebHistory.m: (-[IFWebHistory addEntries:]), (-[IFWebHistory removeEntries:]): New methods, each takes an array of entries. Useful for doing multiple things at a time to minimize notifications. (-[IFWebHistory removeEntriesForDay:]): deleted this now-unnecessary method. * History.subproj/IFWebHistoryPrivate.h: * History.subproj/IFWebHistoryPrivate.m: (-[IFWebHistoryPrivate removeEntries:]): (-[IFWebHistoryPrivate removeAllEntries]): (-[IFWebHistoryPrivate addEntries:]): Private implementations for the public changes. 2002-06-04 Darin Adler <darin@apple.com> - fixed 2943513 -- move StringTruncator into WebKit from WebBrowser so we don't need text measuring API exported * WebKit.pbproj/project.pbxproj: No longer export the text renderer headers as Private. 2002-06-04 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Exported IFStringTruncator.h as Private. 2002-06-04 Darin Adler <darin@apple.com> Moved the string truncator class here from WebBrowser so we don't have to export our text machinery. * WebKit.pbproj/project.pbxproj: * Misc.subproj/IFStringTruncator.h: Added. * Misc.subproj/IFStringTruncator.m: Added. 2002-06-03 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer beginAnimationInView:inRect:fromRect:]): Remove the "fix" for the nonexistent storage leak. Richard showed me the error of my ways. 2002-06-03 John Sullivan <sullivan@apple.com> Richard told me which line to change to fix 2944237 (Stop item in View menu enabled on startup if you have no home page.) * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource isLoading]): Don't return YES if !_private->loading. 2002-06-01 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFImageRenderer.m: (-[IFImageRenderer beginAnimationInView:inRect:fromRect:]): Remove an assert I added, since it is firing, and instead fixed the storage leak that inspired me to put the assert in. 2002-05-31 Darin Adler <darin@apple.com> * WebView.subproj/IFWebViewPrivate.mm: Add include to prepare for change to WebCore that will make it required. 2002-05-31 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFImageRenderer.h: Fixed the line endings (they were Macintosh CRs instead of Unix LFs). Also made all the methods be private for now since there's no need to have them be public. * WebCoreSupport.subproj/IFImageRenderer.m: Fixed the line endings (they were Macintosh CRs instead of Unix LFs). Some minor code tweaks too sharing a bit more code. * WebCoreSupport.subproj/IFImageRendererFactory.m: (-[IFImageRendererFactory imageRendererWithSize:]): Return an IFImageRenderer rather than just an NSImage, since an NSImage does not satisfy WebCoreImageRenderer. 2002-05-31 Darin Adler <darin@apple.com> * Misc.subproj/WebKitDebug.h: Use displayableString in DEBUG_OBJECT for nicer logging. * WebView.subproj/IFWebView.mm: (-[IFWebView keyDown:]): (-[IFWebView keyUp:]): Use DEBUG_OBJECT so we don't get exceptions when the key characters are not simple ASCII characters. 2002-05-30 Richard Williamson <rjw@apple.com> API and comment cleanup. * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame setProvisionalDataSource:]): 2002-05-30 Maciej Stachowiak <mjs@apple.com> WebKit parts of fixes for: Radar 2926169 - no support for window.open Radar 2890469 - Preference to prevent JavaScript from automatically opening new windows doesn't work Radar 2938569 - link cursor does not appear on some pages * WebView.subproj/IFWebController.h: Added openNewWindowWithURL: method for the benefit of JavaScript. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController openNewWindowWithURL:]): No-op default implementation. * WebView.subproj/IFDynamicScrollBarsView.h: * WebView.subproj/IFDynamicScrollBarsView.m: (-[IFDynamicScrollBarsView setCursor:]): Fix cursor handling. (-[IFDynamicScrollBarsView resetCursorRects]): Likewise. * WebView.subproj/IFWebView.mm: (-[IFWebView mouseMovedNotification:]): Likewise. (-[IFWebView setCursor:]): Likewise. * WebView.subproj/IFPreferences.h: * WebView.subproj/IFPreferences.mm: (-[IFPreferences javaScriptEnabled]): Renamed from jScriptEnabled. (-[IFPreferences setJavaScriptEnabled:]): Renamed from setJScriptEnabled. (-[IFPreferences javaScriptCanOpenWindowsAutomatically]): New method. (-[IFPreferences setJavaScriptCanOpenWindowsAutomatically:]): Likewise. * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame initWithName:view:provisionalDataSource:controller:]): Create a dummy provisional data source if none is provided, so we always have a part for the frame. 2002-05-30 Darin Adler <darin@apple.com> Use methods in KWQKHTMLPartImpl that were moved there from KHTMLPart. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): (-[IFMainURLHandleClient processData:isComplete:allDataReceived:]): * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource documentText]): * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _setController:]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): * WebView.subproj/IFWebView.mm: (-[IFWebView provisionalDataSourceChanged:]): 2002-05-30 Chris Blumenberg <cblu@apple.com> Use NSWorkspace methods instead of Launch Services and Finder functions. * MIME.subproj/IFDownloadHandler.h: * MIME.subproj/IFDownloadHandler.mm: * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame setProvisionalDataSource:]): 2002-05-30 Richard Williamson <rjw@apple.com> Added 'canDraw' check to ensure that we can render an image frame. * WebCoreSupport.subproj/IFImageRenderer.m: === Alexander-7 === 2002-05-29 Richard Williamson <rjw@apple.com> Changes to support animated image rendering. Moved image rendering into webkit. Still need to implement preferences stubs and start/stop stubs. * WebCoreSupport.subproj/IFImageRenderer.h: Added. * WebCoreSupport.subproj/IFImageRenderer.m: Added. * WebCoreSupport.subproj/IFImageRendererFactory.h: Added. * WebCoreSupport.subproj/IFImageRendererFactory.m: Added. (+[IFImageRendererFactory createSharedFactory]): (+[IFImageRendererFactory sharedFactory]): (-[IFImageRendererFactory imageRendererWithBytes:length:]): (-[IFImageRendererFactory imageRendererWithSize:]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController stopAnimatedImages]): (-[IFBaseWebController startAnimatedImages]): (-[IFBaseWebController stopAnimatedImageLooping]): (-[IFBaseWebController startAnimatedImageLooping]): * WebView.subproj/IFPreferences.h: * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]): (-[IFPreferences _resourceTimedLayoutEnabled]): (-[IFPreferences allowAnimatedImages]): (-[IFPreferences allowAnimatedImageLooping]): (-[IFPreferences setAllowAnimatedImageLooping:]): * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]): 2002-05-29 Richard Williamson <rjw@apple.com> API stubs for image animation. * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController stopAnimatedImages]): (-[IFBaseWebController startAnimatedImages]): (-[IFBaseWebController stopAnimatedImageLooping]): (-[IFBaseWebController startAnimatedImageLooping]): * WebView.subproj/IFPreferences.h: * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]): (-[IFPreferences _resourceTimedLayoutEnabled]): (-[IFPreferences allowAnimatedImages]): (-[IFPreferences allowAnimatedImageLooping]): (-[IFPreferences setAllowAnimatedImageLooping:]): * WebView.subproj/IFWebController.h: 2002-05-29 John Sullivan <sullivan@apple.com> Removed acceptsFirstMouse override, this fixes at least: 2930713 -- clicking on an empty part of window to bring it to front takes focus away from page address field 2938028 -- Link cursor doesn't appear when browser window not frontmost, but clicks activate links * WebView.subproj/IFWebView.mm: 2002-05-28 John Sullivan <sullivan@apple.com> Made -[IFBookmark group] and -[IFBookmark parent] public methods, and renamed them to not use leading underscores, as part of support for revealing a particular bookmark in the Bookmarks window. * Bookmarks.subproj/IFBookmark_Private.h: removed _group and _parent. * Bookmarks.subproj/IFBookmark.h: added group and parent. * Bookmarks.subproj/IFBookmark.m: (-[IFBookmark parent]): (-[IFBookmark group]): * Bookmarks.subproj/IFBookmarkGroup.m: (-[IFBookmarkGroup removeBookmark:]): (-[IFBookmarkGroup insertNewBookmarkAtIndex:ofBookmark:withTitle:image:URLString:type:]): * Bookmarks.subproj/IFBookmarkLeaf.m: (-[IFBookmarkLeaf copyWithZone:]): (-[IFBookmarkLeaf setTitle:]): (-[IFBookmarkLeaf setImage:]): (-[IFBookmarkLeaf setURLString:]): * Bookmarks.subproj/IFBookmarkList.m: (-[IFBookmarkList copyWithZone:]): (-[IFBookmarkList setTitle:]): (-[IFBookmarkList setImage:]): (-[IFBookmarkList removeChild:]): (-[IFBookmarkList insertChild:atIndex:]): (-[IFBookmarkList _setGroup:]): * Bookmarks.subproj/IFBookmarkSeparator.m: (-[IFBookmarkSeparator copyWithZone:]): Fixed up all references to _group and _parent to now refer to group and parent. 2002-05-28 Richard Williamson <rjw@apple.com> Backed out band-aid add to fixed malformed resources URLs. * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _addURLHandle:]): 2002-05-28 Chris Blumenberg <cblu@apple.com> Added support for creating a new window from a plug-in (2938004) * Plugins.subproj/IFPluginView.mm: (-[IFPluginView loadURL:inTarget:withNotifyData:andHandleAttributes:]): 2002-05-28 Chris Blumenberg <cblu@apple.com> * Plugins.subproj/IFPluginDatabase.h: * Plugins.subproj/IFPluginDatabase.m: (-[IFPluginDatabase pluginForMimeType:]): renamed (-[IFPluginDatabase pluginForExtension:]): renamed (-[IFPluginDatabase pluginForFilename:]): renamed (findPlugins): * WebCoreSupport.subproj/IFWebCoreViewFactory.m: support for above renamed (-[IFWebCoreViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]): (-[IFWebCoreViewFactory viewForJavaAppletWithArguments:]): * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _addURLHandle:]): fix for a nil handle being added to an array 2002-05-28 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFTextRenderer.m: (hasMissingGlyphs): Use recordSize instead of assuming records are sizeof(ATSLayoutRecord). (-[IFTextRenderer convertCharacters:length:toGlyphs:]): Free buffer after calling ATSUConvertCharToGlyphs; old code was using buffer after freeing it. (-[IFTextRenderer widthForString:]): Handle case where string is longer than LOCAL_GLYPH_BUFFER_SIZE. (-[IFTextRenderer slowPackGlyphsForCharacters:numCharacters:glyphBuffer:numGlyphs:]): (-[IFTextRenderer drawString:atPoint:withColor:]): Use recordSize instead of assuming records are sizeof(ATSLayoutRecord). (-[IFTextRenderer slowFloatWidthForCharacters:length:]): Use recordSize instead of assuming records are sizeof(ATSLayoutRecord). (-[IFTextRenderer floatWidthForCharacters:length:]): Remove extra rounding. The caller that converts the width to an integer already does the rounding. (-[IFTextRenderer extendCharacterToGlyphMapToInclude:]): Fix off by one error that caused us to include one extra character in each glyph map block. Also use recordSize instead of assuming records are sizeof(ATSLayoutRecord). 2002-05-27 John Sullivan <sullivan@apple.com> Part of fix for 2922772 -- page title & location field don't show redirected URLs. * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource wasRedirected]): Fixed this method, now that we have a client that relies on it. Its logic was backwards, and it didn't handle the null _finalURL case. 2002-05-26 Maciej Stachowiak <mjs@apple.com> Fixed Radar 936147 - debug output in console "keyUp: NSEvent: type=KeyUp" * WebView.subproj/IFWebView.mm: (-[IFWebView keyDown:]): Turned NSLog into WEBKITDEBUGLEVEL. (-[IFWebView keyUp:]): Likewise. 2002-05-26 Maciej Stachowiak <mjs@apple.com> WebKit part of fix for: Radar 2884085 - add support for changing cursor over links Also, fix handling of mouseMoved events. * WebView.subproj/IFWebView.mm: (-[IFWebView mouseMovedNotification:]): Clip mouseMoved events to the view rect, otherwise mouseover effects might happen for elements past the edge of the window. (-[IFWebView setCursor:]): Implement. (-[IFWebView resetCursorRects]): Implement. * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebViewPrivate dealloc]): Added NSCursor *cursor field. 2002-05-25 Maciej Stachowiak <mjs@apple.com> * WebKit.pbproj/project.pbxproj: Link against WebCore.framework, not libwebcore.dylib. === 0.3 === 2002-05-24 Shelley A Sheridan <sheridan@apple.com> * ChangeLog: === Alexander-6 === 2002-05-23 Maciej Stachowiak <mjs@apple.com> WebKit part of the fix for: Radar 2896391 - command-click should open link in new window * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController openNewWindowWithURL:]): Default implementation silently does nothing. * WebView.subproj/IFWebController.h: Add openNewWindowWithURL: method. * WebView.subproj/IFWebView.mm: (-[IFWebView _addModifiers:toState:]): Split out modifier key handling to here. Treat Command as Meta. (-[IFWebView mouseUp:]): Use new method to set key modifiers for mouse events. (-[IFWebView mouseDown:]): Use new method to set key modifiers for mouse events. (-[IFWebView keyDown:]): Use new shared code for key modifiers. (-[IFWebView keyUp:]): Use new shared code for key modifiers. 2002-05-23 Kenneth Kocienda <kocienda@apple.com> Fixes for these bugs: Radar 2883631 (need to implement support for META HTTP_EQUIV=REFRESH) Radar 2935472 (Non-standard html pages don't always get decoded) * WebView.subproj/IFMainURLHandleClient.h: * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient setContentPolicy:]): Updated method to use new processData interface. (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): Senses when all data has been received for a load. (-[IFMainURLHandleClient processData:isComplete:allDataReceived:]): Modified interface to add a flag for when all data for a load has been received. 2002-05-23 Shelley A Sheridan <sheridan@apple.com> * ChangeLog: === Alexander-5 === 2002-05-23 Maciej Stachowiak <mjs@apple.com> Move authentication panel to WebKit and make it a sheet, fixing: Radar 2876445 - Authentication panel should be a sheet Radar 2876449 - The Alexander authentication panel should be moved to WebKit for use as a standard one * Panels.subproj/English.lproj/IFAuthenticationPanel.nib: Added. * Panels.subproj/IFAuthenticationPanel.h: Added. * Panels.subproj/IFAuthenticationPanel.m: Added. * Panels.subproj/IFPanelAuthenticationHandler.h: Added. * Panels.subproj/IFPanelAuthenticationHandler.m: Added. * Panels.subproj/IFStandardPanels.h: Added. * Panels.subproj/IFStandardPanels.m: Added. * Panels.subproj/IFStandardPanelsPrivate.h: Added. * WebKit.pbproj/project.pbxproj: Add new files to build. * Plugins.subproj/IFPluginStream.mm: (-[IFPluginStream IFURLHandleResourceDidBeginLoading:]): Notify of load start. (-[IFPluginStream IFURLHandleResourceDidFinishLoading:data:]): Notify of load end. (-[IFPluginStream IFURLHandleResourceDidCancelLoading:]): Likewise. (-[IFPluginStream IFURLHandle:resourceDidFailLoadingWithResult:]): Likewise. (-[IFPluginStream IFURLHandle:didRedirectToURL:]): Notify that old URL is no longer loading, but new one is. * WebView.subproj/IFBaseWebControllerPrivate.h: * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _didStartLoading:]): New private method used to track what URLs are loading on behalf of this controller. (-[IFBaseWebController _didStopLoading:]): Likewise. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidBeginLoading:]): Notify of load start. (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): Notify of load end. (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): Likewise. (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): Likewise. (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): Likewise. (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): Notify of load end and start. 2002-05-22 Chris Blumenberg <cblu@apple.com> Fixed download data source leaks when downloads are cancelled. * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]): * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): 2002-05-22 Chris Blumenberg <cblu@apple.com> Removed activate events as this was causing problems for the QT plug-in. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView windowBecameKey:]): (-[IFPluginView windowResignedKey:]): 2002-05-22 Chris Blumenberg <cblu@apple.com> Fixed crasher caused by not retaining. Fixed targeting bug. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]): (-[IFPluginView getURLNotify:target:notifyData:]): (-[IFPluginView getURL:target:]): (-[IFPluginView postURLNotify:target:len:buf:file:notifyData:]): (-[IFPluginView postURL:target:len:buf:file:]): 2002-05-22 Richard J. Williamson <rjw@apple.com> Changed semantics of isLoading to only return YES if the datasource is loading resources related to the intial load. Other resources loaded later by JS will not be accounted for by isLoading. * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource isLoading]): 2002-05-22 Chris Blumenberg <cblu@apple.com> - Removed obsolete MIME/download related code. - Minor clean-ups. - Made WebKit support all text MIME types. - Now send NPP_URLNotify when pages requested by plug-ins are loaded. - Simplified NPP_Get/NPP_Post code. * MIME.subproj/IFContentHandler.h: * MIME.subproj/IFContentHandler.m: * MIME.subproj/IFDownloadHandler.mm: * MIME.subproj/IFMIMEDatabase.h: Removed. * MIME.subproj/IFMIMEDatabase.m: Removed. * MIME.subproj/IFMIMEHandler.h: * MIME.subproj/IFMIMEHandler.m: (+[IFMIMEHandler MIMEHandlerTypeForMIMEType:]): (+[IFMIMEHandler canShowMIMEType:]): * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]): (-[IFPluginView dealloc]): (-[IFPluginView frameStateChanged:]): (-[IFPluginView loadURL:inTarget:withNotifyData:andHandleAttributes:]): (-[IFPluginView getURLNotify:target:notifyData:]): (-[IFPluginView getURL:target:]): (-[IFPluginView postURLNotify:target:len:buf:file:notifyData:]): (-[IFPluginView postURL:target:len:buf:file:]): (-[IFPluginView invalidateRect:]): (-[IFPluginView invalidateRegion:]): (-[IFPluginView forceRedraw]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFMainURLHandleClient.h: * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient dealloc]): (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): (-[IFMainURLHandleClient processData:isComplete:]): * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _setState:]): 2002-05-21 Richard J. Williamson <rjw@apple.com> Fixed baseline regression. Obvious of sites that have tables w/ backgrounds, i.e. www.slashdot.org. * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]): (-[IFTextRenderer drawUnderlineForString:atPoint:withColor:]): 2002-05-21 Richard J. Williamson <rjw@apple.com> Changes to support additional DHTML events. * WebView.subproj/IFWebView.mm: (-[IFWebView keyDown:]): (-[IFWebView keyUp:]): * WebView.subproj/IFWebViewPrivate.mm: (+[IFWebView _nodeHTML:DOM::]): 2002-05-21 Chris Blumenberg <cblu@apple.com> Content policy can now be sent at a later time to avoid blocking. * WebView.subproj/IFMainURLHandleClient.h: * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient initWithDataSource:part:]): (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): 2002-05-21 Chris Blumenberg <cblu@apple.com> Move the tracking rect after the view has moved. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView viewHasMoved:]): Fixed logging. * Plugins.subproj/npapi.m: (NPN_UserAgent): (NPN_MemAlloc): (NPN_MemFree): (NPN_MemFlush): (NPN_ReloadPlugins): 2002-05-21 Kenneth Kocienda <kocienda@apple.com> Merged these four include files into the precompiled header. These are used for the enhanced assertion/debuggin support I added yesterday. <signal.h> <sys/types.h> <sys/time.h> <sys/resource.h> * WebKitPrefix.h 2002-05-20 Chris Blumenberg <cblu@apple.com> Added support for plug-ins to send URL requests to certain targets. Added frameNamed to IFWebFrame. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView getURLNotify:target:notifyData:]): (-[IFPluginView postURLNotify:target:len:buf:file:notifyData:]): * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame frameNamed:]): 2002-05-20 Kenneth Kocienda <kocienda@apple.com> * Misc.subproj/WebKitDebug.h: Now includes <sys/time.h> to prevent possible build breakage in the inclusion of <sys/resource.h> 2002-05-20 Kenneth Kocienda <kocienda@apple.com> Changed assertion failure code to send a SIGQUIT instead of raising an NSException. * Misc.subproj/WebKitDebug.h 2002-05-20 Chris Blumenberg <cblu@apple.com> A whole lot of plug-in clean-up. Moved the following functions from npapi to IFPlugin. * Plugins.subproj/IFPlugin.m: (functionPointerForTVector): (tVectorForFunctionPointer): Only supply mouse coords when active. * Plugins.subproj/IFPluginNullEventSender.h: * Plugins.subproj/IFPluginNullEventSender.m: (-[IFPluginNullEventSender initializeWithNPP:functionPointer:window:]): (-[IFPluginNullEventSender dealloc]): (-[IFPluginNullEventSender sendNullEvents]): Minor clean-ups * Plugins.subproj/IFPluginStream.mm: (-[IFPluginStream dealloc]): (-[IFPluginStream IFURLHandleResourceDidFinishLoading:data:]): (-[IFPluginStream IFURLHandleResourceDidCancelLoading:]): (-[IFPluginStream IFURLHandle:resourceDidFailLoadingWithResult:]): Removed the isMouseDown flag from the following functions as it was unnecessary. Cleaned up logging. * Plugins.subproj/IFPluginView.mm: (-[IFPluginView modifiersForEvent:]): (-[IFPluginView getCarbonEvent:withEvent:]): (-[IFPluginView sendUpdateEvent]): (-[IFPluginView becomeFirstResponder]): (-[IFPluginView resignFirstResponder]): (-[IFPluginView mouseDown:]): (-[IFPluginView mouseUp:]): (-[IFPluginView mouseExited:]): (-[IFPluginView setWindow]): (-[IFPluginView start]): (-[IFPluginView stop]): URLForString now uses _IF_looksLikeAbsoluteURL. (-[IFPluginView URLForString:]): Implemented the following: (-[IFPluginView invalidateRect:]): (-[IFPluginView invalidateRegion:]): (-[IFPluginView forceRedraw]): Put implementation of GetValue SetValue in npapi. * Plugins.subproj/npapi.h: * Plugins.subproj/npapi.m: (NPN_GetValue): (NPN_SetValue): Added drag & drop support. * WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]): (-[IFWebView setCanDragFrom:]): (-[IFWebView canDragFrom]): (-[IFWebView setCanDragTo:]): (-[IFWebView canDragTo]): (-[IFWebView draggingEntered:]): (-[IFWebView prepareForDragOperation:]): (-[IFWebView performDragOperation:]): * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebViewPrivate dealloc]): 2002-05-20 John Sullivan <sullivan@apple.com> Support for bookmark separators * Bookmarks.subproj/IFBookmark.h: Update comments and replace isLeaf with bookmarkType. * Bookmarks.subproj/IFBookmark.m: (-[IFBookmark bookmarkType]): New method, replaces isLeaf. (-[IFBookmark title]): (-[IFBookmark setTitle:]): (-[IFBookmark image]): (-[IFBookmark setImage:]): (-[IFBookmark setURLString:]): (-[IFBookmark children]): (-[IFBookmark numberOfChildren]): (-[IFBookmark _numberOfDescendants]): (-[IFBookmark insertChild:atIndex:]): (-[IFBookmark removeChild:]): Update callers of isLeaf, and don't require concrete implementations of some methods for some types. * Bookmarks.subproj/IFBookmarkLeaf.m: (-[IFBookmarkLeaf bookmarkType]): return IFBookmarkTypeLeaf (-[IFBookmarkLeaf _dictionaryRepresentation]): set value for bookmark type. * Bookmarks.subproj/IFBookmarkList.m: (-[IFBookmarkList _initFromDictionaryRepresentation:withGroup:]): Handle separator case. (-[IFBookmarkList _dictionaryRepresentation]): set value for bookmark type (-[IFBookmarkList bookmarkType]): return IFBookmarkTypeList * Bookmarks.subproj/IFBookmarkSeparator.h: Added. * Bookmarks.subproj/IFBookmarkSeparator.m: Added. (-[IFBookmarkSeparator initWithGroup:]): Simple init method. (-[IFBookmarkSeparator _initFromDictionaryRepresentation:withGroup:]): Just calls initWithGroup. (-[IFBookmarkSeparator _dictionaryRepresentation]): set value for bookmark type (-[IFBookmarkSeparator bookmarkType]): return IFBookmarkTypeSeparator (-[IFBookmarkSeparator copyWithZone:]): calls initWithGroup * Bookmarks.subproj/IFBookmark_Private.h: Added key/value #defines for dictionary representation. * Bookmarks.subproj/IFBookmarkGroup.h: * Bookmarks.subproj/IFBookmarkGroup.m: (-[IFBookmarkGroup _setTopBookmark:]): (-[IFBookmarkGroup _bookmarkChildrenDidChange:]): (-[IFBookmarkGroup addNewBookmarkToBookmark:withTitle:image:URLString:type:]): Update callers of isLeaf to use bookmarkType instead. (-[IFBookmarkGroup insertNewBookmarkAtIndex:ofBookmark:withTitle:image:URLString:type:]): if type is IFBookmarkTypeSeparator, instantiate an IFBookmarkSeparator * WebKit.pbproj/project.pbxproj: Updated for new files. 2002-05-17 Chris Blumenberg <cblu@apple.com> - Made IFPluginStream the URL handle client instead of IFPluginView. - Added support for NPP_PostURL and NPP_PostNotify. - Possible fix for 2928558. * Plugins.subproj/IFPluginStream.h: * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]):NSURL for url instead of NSString (-[IFPluginView dealloc]): (-[IFPluginView setWindow]): (-[IFPluginView start]): (-[IFPluginView stop]): (-[IFPluginView webDataSource]):Accessor for IFPluginStream. (-[IFPluginView webController]):Accessor for IFPluginStream. (-[IFPluginView URLForString:]): (-[IFPluginView getURLNotify:target:notifyData:]): (-[IFPluginView postURLNotify:target:len:buf:file:notifyData:]): (-[IFPluginView postURL:target:len:buf:file:]): (-[IFPluginView destroyStream:reason:]): (-[IFPluginView status:]): (-[IFPluginView NPP_NewStream]): Accessor for IFPluginStream. (-[IFPluginView NPP_WriteReady]):Accessor for IFPluginStream. (-[IFPluginView NPP_Write]): Accessor for IFPluginStream. (-[IFPluginView NPP_StreamAsFile]): Accessor for IFPluginStream. (-[IFPluginView NPP_DestroyStream]): Accessor for IFPluginStream. (-[IFPluginView NPP_URLNotify]): Accessor for IFPluginStream. * WebCoreSupport.subproj/IFWebCoreViewFactory.m: Use new IFPluginView init method (-[IFWebCoreViewFactory viewForPluginWithURL:serviceType:arguments:baseURL:]): * WebKit.pbproj/project.pbxproj: 2002-05-16 Richard J. Williamson <rjw@apple.com> Fixed 2925638. Don't send last progress message from resourceDataDidBecomeAvailable, it is sent from IFURLHandleResourceDidFinishLoading, avoiding duplication. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): 2002-05-16 Richard J. Williamson <rjw@apple.com> Fix to fix for 0x7f to 0xa0. I was being overly aggressive about finding substitute glyphs. * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]): (-[IFTextRenderer floatWidthForCharacters:length:]): 2002-05-16 Darin Adler <darin@apple.com> * Plugins.subproj/IFPluginView.mm: (-[IFPluginView IFURLHandleResourceDidFinishLoading:data:]): Use this new getCarbonPath function rather than hardcoding assumptions about "/tmp" being ":private:tmp". (getCarbonPath): New. 2002-05-16 Darin Adler <darin@apple.com> * Plugins.subproj/IFPluginView.mm: (-[IFPluginView mouseUp:]): Fixed log statement so development builds work again. 2002-05-16 Darin Adler <darin@apple.com> * Plugins.subproj/IFPluginView.mm: (-[IFPluginView mouseUp:]): Remove unused variable that breaks optimized builds. 2002-05-15 Darin Adler <darin@apple.com> Another quick events cleanup pass. * Plugins.subproj/IFPluginNullEventSender.m: (-[IFPluginNullEventSender sendNullEvents]): Use [IFPluginView getCarbonEvent:]. * Plugins.subproj/IFPluginView.h: Make almost all methods private. * Plugins.subproj/IFPluginView.mm: (+[IFPluginView getCarbonEvent:]): New. (-[IFPluginView getCarbonEvent:]): New, calls class method. (-[IFPluginView modifiersForEvent:isMouseDown:]): Reversed sense of btnState. This flag is set if the mouse is up, not if the mouse is down. (-[IFPluginView getCarbonEvent:withEvent:isMouseDown:]): New. (-[IFPluginView getCarbonEvent:withEvent:]): New. (-[IFPluginView sendActivateEvent:]): Now takes parameter for activate vs. deactivate and uses [getCarbonEvent:]. (-[IFPluginView sendUpdateEvent]): Uses [getCarbonEvent:]. (-[IFPluginView becomeFirstResponder]): Uses [getCarbonEvent:]. (-[IFPluginView resignFirstResponder]): Uses [getCarbonEvent:]. (-[IFPluginView mouseDown:]): Uses [getCarbonEvent:withEvent:isMouseDown:]. (-[IFPluginView mouseUp:]): Uses [getCarbonEvent:withEvent:isMouseDown:]. (-[IFPluginView mouseEntered:]): Uses [getCarbonEvent:withEvent:]. (-[IFPluginView mouseExited:]): Uses [getCarbonEvent:withEvent:]. (-[IFPluginView keyUp:]): Uses [getCarbonEvent:withEvent:]. (-[IFPluginView keyDown:]): Uses [getCarbonEvent:withEvent:]. (-[IFPluginView start]): Call [sendActivateEvent:YES]. (-[IFPluginView windowBecameKey:]): Call [sendActivateEvent:YES]. (-[IFPluginView windowResignedKey:]): Call [sendActivateEvent:NO]. 2002-05-15 Richard J. Williamson <rjw@apple.com> Fixed problem dealing w/ characters in range 0x7f - 0xa0. * WebCoreSupport.subproj/IFTextRenderer.m: (setGlyphForCharacter): (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]): (-[IFTextRenderer floatWidthForCharacters:length:]): 2002-05-15 Chris Blumenberg <cblu@apple.com> Fixed Flash mouse-down, mouse-over Flash bug. Added support for modifiers (control-click etc) (2884451). A lot of events clean-up. * Plugins.subproj/IFPluginNullEventSender.m: (-[IFPluginNullEventSender sendNullEvents]): * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: (newCString): (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]): (-[IFPluginView start]): (-[IFPluginView drawRect:]): (-[IFPluginView isFlipped]): (-[IFPluginView currentModifiers]): (-[IFPluginView modifiersForEvent:isMouseDown:]): (-[IFPluginView sendActivateEvent]): (-[IFPluginView sendUpdateEvent]): (-[IFPluginView becomeFirstResponder]): (-[IFPluginView resignFirstResponder]): (-[IFPluginView mouseDown:]): (-[IFPluginView mouseUp:]): (-[IFPluginView mouseEntered:]): (-[IFPluginView mouseExited:]): (-[IFPluginView keyUp:]): (-[IFPluginView keyDown:]): (-[IFPluginView windowBecameKey:]): (-[IFPluginView windowResignedKey:]): Case-sensitivity issue with an include. * WebView.subproj/IFWebView.mm: 2002-05-15 Darin Adler <darin@apple.com> * Makefile.am: Use all-am and clean-am instead of all and clean because it's better and to make "make check" at the top level work right. 2002-05-14 John Sullivan <sullivan@apple.com> Work to support copying bookmarks, needed for drag & drop in Bookmarks window. * Bookmarks.subproj/IFBookmark.h: Make IFBookmark conform to NSCopying. * Bookmarks.subproj/IFBookmark.m: (-[IFBookmark copyWithZone:]): insist that subclasses implement this. * Bookmarks.subproj/IFBookmarkGroup.h: * Bookmarks.subproj/IFBookmarkGroup.m: (-[IFBookmarkGroup insertBookmark:atIndex:ofBookmark:]): Removed this unnecessary method. * Bookmarks.subproj/IFBookmarkLeaf.m: (-[IFBookmarkLeaf copyWithZone:]): New method. * Bookmarks.subproj/IFBookmarkList.m: (-[IFBookmarkList copyWithZone:]): New method. 2002-05-14 Richard J. Williamson <rjw@apple.com> Fixed exception in log code. * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer floatWidthForCharacters:length:]): 2002-05-14 Richard J. Williamson <rjw@apple.com> Fixed 2926153, not getting correct messages after cancel. Fixed leak of mouse events (Darin wanted this ASAP). * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _receivedProgress:forResource:fromDataSource:]): (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]): * WebView.subproj/IFLocationChangeHandler.h: * WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]): (-[IFWebView layout]): (-[IFWebView mouseUp:]): (-[IFWebView mouseDown:]): (-[IFWebView mouseMovedNotification:]): 2002-05-14 Chris Blumenberg <cblu@apple.com> Removed retain of the URL handle. This was causing everything to leak. * WebView.subproj/IFMainURLHandleClient.h: * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient initWithDataSource:part:]): (-[IFMainURLHandleClient dealloc]): (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): (-[IFMainURLHandleClient processData:isComplete:]): 2002-05-14 Darin Adler <darin@apple.com> * WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]): Remove code that makes us the first responder. That's up to the higher levels, not the web view. 2002-05-14 John Sullivan <sullivan@apple.com> * History.subproj/IFURIEntry.h: Oops, deleted the prototype for setLastVisitedDate accidentally, which made Jersey sad. 2002-05-14 John Sullivan <sullivan@apple.com> Fixed 2919027 -- Need to remove unused code in WebKit/History.subproj * History.subproj/IFAttributedURL.h: Removed. * History.subproj/IFBackForwardList.h: Removed large #ifdef. * History.subproj/IFURIEntry.h, * History.subproj/IFURIEntry.m: Removed all mention of unused fields comment, creationDate, modificationDate * WebKit.pbproj/project.pbxproj: Updated for removed file. 2002-05-13 Chris Blumenberg <cblu@apple.com> Added support for setting the content policy on the location change handler and data source at any time instead of depending on an immediate response. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController haveContentPolicy:andPath:forLocationChangeHandler:]): * WebView.subproj/IFMainURLHandleClient.h: * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient initWithDataSource:part:]): (-[IFMainURLHandleClient dealloc]): (-[IFMainURLHandleClient setContentPolicy:]): (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): (-[IFMainURLHandleClient processData:isComplete:]): * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _setContentPolicy:]): * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame setProvisionalDataSource:]): 2002-05-13 Maciej Stachowiak <mjs@apple.com> * WebKitPrefix.h: Gratuitous change to make the prefix file rebuild. 2002-05-13 Chris Blumenberg <cblu@apple.com> * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController URLPolicyForURL:]): Use [IFURLHandle canInitWithURL] instead of hard-coded URL schemes. * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]): * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate init]): (-[IFWebDataSource _setDownloadPath:]): Removed _contentPolicy as contentPolicy is public. Initialize contentPolicy in [IFWebDataSourcePrivate init]. 2002-05-10 Richard J. Williamson <rjw@apple.com> Logging changes. * WebCoreSupport.subproj/IFTextRenderer.m: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource isLoading]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): 2002-05-10 Chris Blumenberg <cblu@apple.com> Added support for non-html non-file URL data sources. Added the init methods below. Removed initWithHandle. * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (IFWebDataSourceMake): (-[IFWebDataSource initWithURL:]): (-[IFWebDataSource initWithURL:attributes:]): (-[IFWebDataSource startLoading:]): 2002-05-10 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFTextRenderer.h: Moved most of the stuff from here into the .m file so this header can be included by clients. Also added floatWidthForCharacters:length:. * WebCoreSupport.subproj/IFTextRenderer.m: (freeWidthMap): Check for NULL. (freeGlyphMap): Check for NULL. (-[IFTextRenderer slowFloatWidthForCharacters:length:]): Renamed, and made it return the float. (-[IFTextRenderer floatWidthForCharacters:length:]): Renamed, and made it return the float. (-[IFTextRenderer widthForCharacters:length:]): Do rounding here. * WebCoreSupport.subproj/IFTextRendererFactory.h: * WebCoreSupport.subproj/IFTextRendererFactory.m: Make the interface slightly easier to use by using the specific types. * WebKit.pbproj/project.pbxproj: Exported the headers. 2002-05-10 Kenneth Kocienda <kocienda@apple.com> Fixed build breakage caused by my previous checkin. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]) 2002-05-10 John Sullivan <sullivan@apple.com> Fixed 2922756 (@ image in History window is a little too tall) Fixed 2923790 (bookmark folders need folder icons) * Resources/bookmark_folder.tiff: New image (small folder, copied from elsewhere) * Resources/url_icon.tiff: Shrunk this one a little bit. * Bookmarks.subproj/IFBookmarkList.m: (-[IFBookmarkList image]): Return the default image if no custom image is set. * History.subproj/IFURIEntry.m: (-[IFURIEntry image]): If the default image's file isn't found, don't try to create an NSImage, because it will come out horribly broken and evil if you do (I ran into this while adding the bookmark folder image; most of Alexander's menus did not appear at all because the bookmark folder image was using a bogus NSImage). * WebKit.pbproj/project.pbxproj: Updated for new files. 2002-05-10 Kenneth Kocienda <kocienda@apple.com> Reviewed by: Maciej Stachowiak This code was modified to use the new interface and features of IFError. These features and changes are described in these four bug reports: Radar 2923998 (Change IFError private data into a pointer to a private data object) Radar 2924002 (IFError should include an error domain) Radar 2924013 (IFError initialization is not threadsafe) Radar 2924280 (IFError should contain a new field which tells whether the error is terminal) * Plugins.subproj/IFPluginView.mm: (-[IFPluginView IFURLHandle:resourceDidFailLoadingWithResult:]): * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _receivedProgress:forResource:fromDataSource:]): (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]): * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): 2002-05-09 Richard J. Williamson <rjw@apple.com> Tuned implementation more. Cleaned up and factored code. * WebCoreSupport.subproj/IFTextRenderer.h: * WebCoreSupport.subproj/IFTextRenderer.m: (-[IFTextRenderer substituteFontForString:]): (-[IFTextRenderer substituteFontForCharacters:length:]): (-[IFTextRenderer initWithFont:]): (-[IFTextRenderer dealloc]): (-[IFTextRenderer slowPackGlyphsForCharacters:numCharacters:glyphBuffer:numGlyphs:]): (-[IFTextRenderer drawString:atPoint:withColor:]): (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]): (-[IFTextRenderer drawUnderlineForString:atPoint:withColor:]): (-[IFTextRenderer slowWidthForCharacters:length:]): (-[IFTextRenderer widthForCharacters:length:]): (-[IFTextRenderer extendGlyphToWidthMapToInclude:]): 2002-05-09 John Sullivan <sullivan@apple.com> * Bookmarks.subproj/IFBookmarkGroup.h: * Bookmarks.subproj/IFBookmarkGroup.m: (-[IFBookmarkGroup addNewBookmarkToBookmark:withTitle:image:URLString:isLeaf:]): (-[IFBookmarkGroup insertNewBookmarkAtIndex:ofBookmark:withTitle:image:URLString:isLeaf:]): Gave these two methods return values of the new bookmark created, to make callers' lives easier. === Alexander-3 === 2002-05-08 Richard J. Williamson <rjw@apple.com> Added optimizations for text rendering. * WebCoreSupport.subproj/IFTextRenderer.h: * WebCoreSupport.subproj/IFTextRenderer.m: (freeWidthMap): (freeGlyphMap): (glyphForCharacter): (widthForGlyph): (widthForCharacter): (-[IFTextRenderer substituteFontForCharacters:length:]): (-[IFTextRenderer convertCharacters:length:glyphs:]): (-[IFTextRenderer dealloc]): (-[IFTextRenderer drawString:atPoint:withColor:]): (-[IFTextRenderer drawUnderlineForString:atPoint:withColor:]): (-[IFTextRenderer widthForCharacters:length:]): (-[IFTextRenderer extendCharacterToGlyphMapToInclude:]): (-[IFTextRenderer extendGlyphToWidthMapToInclude:]): 2002-05-08 Darin Adler <darin@apple.com> * Misc.subproj/IFCache.h: Add more JavaScript object statistics. * Misc.subproj/IFCache.mm: (+[IFCache javaScriptInterpretersCount]): New. (+[IFCache javaScriptNoGCAllowedObjectsCount]): New. (+[IFCache javaScriptReferencedObjectsCount]): New. * WebKit.pbproj/project.pbxproj: Rearranged two files, dunno why. 2002-05-08 Chris Blumenberg <cblu@apple.com> Cleaned up mach-o plug-in support. Changed the init method in IFPlugin to initWithPath. * Plugins.subproj/IFPlugin.h: * Plugins.subproj/IFPlugin.m: (-[IFPlugin initWithPath:]): (-[IFPlugin load]): * Plugins.subproj/IFPluginDatabase.m: (findPlugins): 2002-05-08 Darin Adler <darin@apple.com> * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _setTitle:]): Use _IF_stringByTrimmingWhitespace. 2002-05-07 Richard J. Williamson <rjw@apple.com> First pass at font substitution. Find a substitute font to use when the specified font doesn't have glyphs for the characters that need to be drawn. Works correctly but hasn't been optimized yet, VERY slow. Will optimize this evening and tomorrow. Try www.yahoo.co.jp, it will take a long time to render be eventually will draw correctly. * WebCoreSupport.subproj/IFTextRenderer.h: * WebCoreSupport.subproj/IFTextRenderer.m: (hasMissingGlyphs): (+[IFTextRenderer initialize]): (-[IFTextRenderer convertCharacters:length:glyphs:]): (-[IFTextRenderer initializeCaches]): (-[IFTextRenderer drawString:atPoint:withColor:]): (-[IFTextRenderer drawUnderlineForString:atPoint:withColor:]): (-[IFTextRenderer widthForCharacters:length:]): 2002-05-07 Darin Adler <darin@apple.com> Oops. These files don't belong at the top level. * IFWebCoreViewFactory.h: Removed. * IFWebCoreViewFactory.m: Removed. * WebCoreSupport.subproj/IFWebCoreViewFactory.h: Added. * WebCoreSupport.subproj/IFWebCoreViewFactory.m: Added. * WebKit.pbproj/project.pbxproj: 2002-05-07 Darin Adler <darin@apple.com> Move more plugin code here from WebCore. * IFWebCoreViewFactory.h: Added. * IFWebCoreViewFactory.m: Added. * Plugins.subproj/IFPlugin.h: Moved from WebCore. * Plugins.subproj/IFPlugin.m: Moved from WebCore. * Plugins.subproj/IFPluginDatabase.h: Moved from WebCore. * Plugins.subproj/IFPluginDatabase.m: Moved from WebCore. * Plugins.subproj/npapi.h: Moved from WebCore. * Plugins.subproj/npapi.m: Moved from WebCore. * WebKit.pbproj/project.pbxproj: Source file names changed * MIME.subproj/IFMIMEDatabase.m: * MIME.subproj/IFMIMEHandler.m: * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: Updated for WC -> IF name change. * WebCoreSupport.subproj/IFCachedTextRenderer.h: Renamed to IFTextRenderer. * WebCoreSupport.subproj/IFCachedTextRenderer.m: Renamed to IFTextRenderer. * WebCoreSupport.subproj/IFCachedTextRendererFactory.h: Renamed to IFTextRendererFactory. * WebCoreSupport.subproj/IFCachedTextRendererFactory.m: Renamed to IFTextRendererFactory. * WebCoreSupport.subproj/IFTextRenderer.h: Renamed from IFCachedTextRenderer. * WebCoreSupport.subproj/IFTextRenderer.m: Renamed from IFCachedTextRenderer. * WebCoreSupport.subproj/IFTextRendererFactory.h: Renamed from IFCachedTextRendererFactory. * WebCoreSupport.subproj/IFTextRendererFactory.m: Renamed from IFCachedTextRendererFactory. Renamed to take "Cached" out of the name now that the simpler name is available. * WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]): Create shared IFWebCoreViewFactory. (-[IFWebView delayLayout:]): Use WEBKITDEBUG, not KWQDEBUG. (-[IFWebView notificationReceived:]): Use WEBKITDEBUG, not KWQDEBUG. 2002-05-07 Darin Adler <darin@apple.com> Use isEqualToString: instead of isEqual: more consistently. But only for strings. * WebCoreSupport.subproj/IFCachedTextRendererFactory.m: (-[IFFontCacheKey isEqual:]): * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController _frameNamed:fromFrame:]): 2002-05-06 John Sullivan <sullivan@apple.com> Some improvements to the bookmark changed notifications. * Bookmarks.subproj/IFBookmarkGroup.h: * Bookmarks.subproj/IFBookmarkGroup.m: (-[IFBookmarkGroup _sendChangeNotificationForBookmark:childrenChanged:]): (-[IFBookmarkGroup _setTopBookmark:]): (-[IFBookmarkGroup _bookmarkDidChange:]): (-[IFBookmarkGroup _bookmarkChildrenDidChange:]): Send bookmark that changed and whether its children changed as part of change notifications, so clients can choose to do less unnecessary work. * Bookmarks.subproj/IFBookmarkLeaf.m: (-[IFBookmarkLeaf setTitle:]): Check for the no-change case and bail out without sending notification when you find it. 2002-05-06 Darin Adler <darin@apple.com> * WebKitPrefix.h: Added. * WebKit.pbproj/project.pbxproj: Use PFE precompiling. Also switch from xNDEBUG to NDEBUG. * Misc.subproj/WebKitDebug.h: Get rid of format attribute because of bug 2920557. Switch from xNDEBUG to NDEBUG. * Misc.subproj/WebKitDebug.m: Add undef to work around PFE problem with inline functions, Radar 2920554. * Plugins.subproj/IFPluginView.mm: Changed how we work around the bug in the CGS defines. * WebCoreSupport.subproj/IFCachedTextRenderer.h: Change include of the private QD header to use the form that works with more-normal way of getting at the private bits of frameworks. * WebCoreSupport.subproj/IFCachedTextRenderer.m: Use the header <CoreGraphics/CoreGraphicsPrivate.h> instead of <CoreGraphics/CGFontPrivate.h>. * Misc.subproj/IFCache.mm: * WebView.subproj/IFLoadProgress.mm: * WebView.subproj/IFWebFrame.mm: * WebView.subproj/IFWebFramePrivate.mm: * WebView.subproj/IFWebView.mm: Changed includes to imports. 2002-05-06 Chris Blumenberg <cblu@apple.com> Made start and stop work cleaner. Now observe defaults changes so that plug-ins are disabled or enabled immediately (2871725). * Plugins.subproj/IFPluginNullEventSender.m: (-[IFPluginNullEventSender sendNullEvents]): * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]): (-[IFPluginView start]): (-[IFPluginView stop]): (-[IFPluginView drawRect:]): (-[IFPluginView windowWillClose:]): (-[IFPluginView defaultsHaveChanged:]): 2002-05-06 Richard J. Williamson <rjw@apple.com> Fixed width measurement regression. We lost the final ROUND_TO_INT in the width measurement funtion after the move from WebCore. * WebCoreSupport.subproj/IFCachedTextRenderer.m: (-[IFCachedTextRenderer widthForCharacters:length:]): 2002-05-06 Richard J. Williamson <rjw@apple.com> Changes to support dhtml. * WebView.subproj/IFWebView.mm: 2002-05-06 John Sullivan <sullivan@apple.com> * Resources/url_icon.tiff: New bookmarks/history icon, looks more like the springy @ sign as seen from above, less like text. 2002-05-03 John Sullivan <sullivan@apple.com> Along with small corresponding WebBrowser change, fixed 2919172 (Bookmarks aren't saved between sessions). * Bookmarks.subproj/IFBookmark_Private.h: Declarations for new private methods. * Bookmarks.subproj/IFBookmark.m: (-[IFBookmark _numberOfDescendants]): New private method, counts deep; used only for debugging messages at this time. (-[IFBookmark _initFromDictionaryRepresentation:withGroup:]): (-[IFBookmark _dictionaryRepresentation]): New private methods used to save/load bookmarks. Stub implementations; subclasses must implement. * Bookmarks.subproj/IFBookmarkLeaf.m: (-[IFBookmarkLeaf _initFromDictionaryRepresentation:withGroup:]): (-[IFBookmarkLeaf _dictionaryRepresentation]): New methods. * Bookmarks.subproj/IFBookmarkList.m: (-[IFBookmarkList _initFromDictionaryRepresentation:withGroup:]): (-[IFBookmarkList _dictionaryRepresentation]): (-[IFBookmarkList _numberOfDescendants]): New methods. (-[IFBookmarkList _setGroup:]): Recurse on children. * Bookmarks.subproj/IFBookmarkGroup.h: New _loading instance variable. * Bookmarks.subproj/IFBookmarkGroup.m: (-[IFBookmarkGroup _setTopBookmark:]): Renamed from _resetTopBookmark, now has potentially non-nil argument. (-[IFBookmarkGroup initWithFile:]), (-[IFBookmarkGroup removeBookmark:]): Updated for name change. (-[IFBookmarkGroup _sendBookmarkGroupChangedNotification]): Don't send notifications while loading bookmarks from disk. (-[IFBookmarkGroup _loadBookmarkGroupGuts]), (-[IFBookmarkGroup loadBookmarkGroup]), (-[IFBookmarkGroup _saveBookmarkGroupGuts]), (-[IFBookmarkGroup saveBookmarkGroup]): New methods, load/save bookmarks and report timings. * History.subproj/IFURIEntry.m: (-[IFURIEntry dictionaryRepresentation]), (-[IFURIEntry initFromDictionaryRepresentation:]): Handle nil URL case, which bookmarks run into. * WebKit.pbproj/project.pbxproj: version wars 2002-05-03 Darin Adler <darin@apple.com> * WebCoreSupport.subproj/IFCachedTextRenderer.m: Remove some of the unused code. I was going to wait and let Richard do it next week, but I was unable to control my urge to hack on it. 2002-05-03 Darin Adler <darin@apple.com> * Resources/url_icon.tiff: Improved icon. Could be better. 2002-05-03 Darin Adler <darin@apple.com> * Misc.subproj/WebKitDebug.h: Add WEBKIT_LOG_MEMUSAGE, WEBKIT_LOG_FONTCACHE, and WEBKIT_LOG_FONTCACHECHARMISS for font code moved here from WebCore. * Resources/url_icon.tiff: New URL icon? * WebCoreSupport.subproj/IFCachedTextRenderer.h: Added. * WebCoreSupport.subproj/IFCachedTextRenderer.m: Added. * WebCoreSupport.subproj/IFCachedTextRendererFactory.h: Added. * WebCoreSupport.subproj/IFCachedTextRendererFactory.m: Added. This has code moved here from WebCore. * WebKit.pbproj/project.pbxproj: Add the new source files. * Bookmarks.subproj/IFBookmarkLeaf.m: (-[IFBookmarkLeaf setURLString:]): Use copy instead of initWithString. * Bookmarks.subproj/IFBookmarkList.m: (-[IFBookmarkList initWithTitle:image:group:]): Use copy instead of stringWithString. (-[IFBookmarkList setTitle:]): Use copy instead of stringWithString. * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _setTitle:]): Use mutableCopy instead of stringWithString. * WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]): Use copy instead of stringWithString. 2002-05-02 John Sullivan <sullivan@apple.com> Changed API such that mutating methods can now be called on bookmark objects, which in turn tell their group that they have changed (so the group can send out notifications). * Bookmarks.subproj/IFBookmark.h: * Bookmarks.subproj/IFBookmark.m: (-[IFBookmark setTitle:]): (-[IFBookmark setImage:]): (-[IFBookmark setURLString:]): (-[IFBookmark insertChild:atIndex:]): (-[IFBookmark removeChild:]): (-[IFBookmark _parent]): (-[IFBookmark _group]): * Bookmarks.subproj/IFBookmarkGroup.h: * Bookmarks.subproj/IFBookmarkGroup.m: (-[IFBookmarkGroup _resetTopBookmark]): (-[IFBookmarkGroup _bookmarkDidChange:]): (-[IFBookmarkGroup _bookmarkChildrenDidChange:]): (-[IFBookmarkGroup removeBookmark:]): (-[IFBookmarkGroup insertNewBookmarkAtIndex:ofBookmark:withTitle:image:URLString:isLeaf:]): * Bookmarks.subproj/IFBookmarkLeaf.m: (-[IFBookmarkLeaf setTitle:]): (-[IFBookmarkLeaf setImage:]): (-[IFBookmarkLeaf setURLString:]): * Bookmarks.subproj/IFBookmarkList.m: (-[IFBookmarkList setTitle:]): (-[IFBookmarkList setImage:]): (-[IFBookmarkList removeChild:]): (-[IFBookmarkList insertChild:atIndex:]): * Bookmarks.subproj/IFBookmark_Private.h: Made _parent and _group private; made setTitle, setImage, setURLString, insertChild:atIndex:, and removeChild: public. * Bookmarks.subproj/IFBookmarkGroup_Private.h: Added. * WebKit.pbproj/project.pbxproj: Changed for new file. 2002-05-02 John Sullivan <sullivan@apple.com> Implemented removing the root node bookmark (i.e., removing all bookmarks with one call). * Bookmarks.subproj/IFBookmarkGroup.m: (-[IFBookmarkGroup _resetTopBookmark]): New method, releases old topBookmark and creates new one. (-[IFBookmarkGroup initWithFile:]): Call _resetTopBookmark. (-[IFBookmarkGroup removeBookmark:]): If the bookmark being removed is the top one, call _resetTopBookmark. 2002-05-02 John Sullivan <sullivan@apple.com> Some more implementation of bookmarks code, enough to support adding bookmarks to the Bookmarks menu (but not yet enough to support persistent bookmarks). * Bookmarks.subproj/IFBookmark_Private.h: * Bookmarks.subproj/IFBookmark.h: * Bookmarks.subproj/IFBookmark.m: (-[IFBookmark numberOfChildren]): New public method, stub implementation. (-[IFBookmark _removeChild:]): New private method, stub implementation. * Bookmarks.subproj/IFBookmarkGroup.h: * Bookmarks.subproj/IFBookmarkGroup.m: (-[IFBookmarkGroup _sendBookmarkGroupChangedNotification]): (-[IFBookmarkGroup removeBookmark:]): (-[IFBookmarkGroup addNewBookmarkToBookmark:withTitle:image:URLString:isLeaf:]): (-[IFBookmarkGroup insertNewBookmarkAtIndex:ofBookmark:withTitle:image:URLString:isLeaf:]): (-[IFBookmarkGroup updateBookmark:title:image:URLString:]): Changed "URL" to "URLString" in several places, added a "with" to some parameter names; added addNewBookmarkToBookmark public method; added notification that's sent when bookmarks are added or removed. * Bookmarks.subproj/IFBookmarkLeaf.h: * Bookmarks.subproj/IFBookmarkLeaf.m: (-[IFBookmarkLeaf initWithURLString:title:image:group:]): Added image parameter. * Bookmarks.subproj/IFBookmarkList.m: (-[IFBookmarkList numberOfChildren]): New method. (-[IFBookmarkList _removeChild:]): Implemented. 2002-04-30 John Sullivan <sullivan@apple.com> Added initial set of files/API and some of the code for bookmarks support. Nobody calls it yet, but it compiles. I wanted to get this in before I ran into project file merge conflicts. * Bookmarks.subproj/IFBookmark.h: Added. * Bookmarks.subproj/IFBookmark_Private.h: Added. * Bookmarks.subproj/IFBookmark.m: Added. (-[IFBookmark dealloc]): (-[IFBookmark title]): (-[IFBookmark _setTitle:]): (-[IFBookmark image]): (-[IFBookmark _setImage:]): (-[IFBookmark isLeaf]): (-[IFBookmark URLString]): (-[IFBookmark _setURLString:]): (-[IFBookmark children]): (-[IFBookmark _insertChild:atIndex:]): (-[IFBookmark parent]): (-[IFBookmark _setParent:]): (-[IFBookmark group]): (-[IFBookmark _setGroup:]): * Bookmarks.subproj/IFBookmarkGroup.h: Added. * Bookmarks.subproj/IFBookmarkGroup.m: Added. (+[IFBookmarkGroup bookmarkGroupWithFile:]): (-[IFBookmarkGroup initWithFile:]): (-[IFBookmarkGroup dealloc]): (-[IFBookmarkGroup topBookmark]): (-[IFBookmarkGroup insertBookmark:atIndex:ofBookmark:]): (-[IFBookmarkGroup removeBookmark:]): (-[IFBookmarkGroup insertNewBookmarkAtIndex:ofBookmark:title:image:URL:isLeaf:]): (-[IFBookmarkGroup updateBookmark:title:image:URL:]): (-[IFBookmarkGroup file]): (-[IFBookmarkGroup loadBookmarkGroup]): (-[IFBookmarkGroup saveBookmarkGroup]): * Bookmarks.subproj/IFBookmarkLeaf.h: Added. * Bookmarks.subproj/IFBookmarkLeaf.m: Added. (-[IFBookmarkLeaf dealloc]): (-[IFBookmarkLeaf title]): (-[IFBookmarkLeaf _setTitle:]): (-[IFBookmarkLeaf image]): (-[IFBookmarkLeaf _setImage:]): (-[IFBookmarkLeaf isLeaf]): (-[IFBookmarkLeaf URLString]): (-[IFBookmarkLeaf _setURLString:]): * Bookmarks.subproj/IFBookmarkList.h: Added. * Bookmarks.subproj/IFBookmarkList.m: Added. (-[IFBookmarkList initWithTitle:image:group:]): (-[IFBookmarkList dealloc]): (-[IFBookmarkList title]): (-[IFBookmarkList _setTitle:]): (-[IFBookmarkList image]): (-[IFBookmarkList _setImage:]): (-[IFBookmarkList isLeaf]): (-[IFBookmarkList children]): (-[IFBookmarkList _insertChild:atIndex:]): * WebKit.pbproj/project.pbxproj: Updated for new files. 2002-04-29 Richard Williamson <rjw@apple.com> Fix to 2915688. I wasn't checking if the main document error had an error, only the resource errors. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): 2002-04-29 Richard Williamson <rjw@apple.com> Restored file, line, and function to log messages. * Misc.subproj/WebKitDebug.m: (WebKitLog): 2002-04-25 Darin Adler <darin@apple.com> * History.subproj/IFWebHistoryPrivate.m: (-[IFWebHistoryPrivate _loadHistoryGuts:]): Use NSDictionary instead of NSObject to avoid a cast. * WebView.subproj/IFLocationChangeHandler.h: Add NSObject as a required protocol so we can retain and release. * WebView.subproj/IFWebController.h: Add NSObject as a required protocol so we can retain and release. * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]): (-[IFWebDataSource _setLoading:]): (-[IFWebDataSource _setController:]): (-[IFWebDataSource _setLocationChangeHandler:]): * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebViewPrivate dealloc]): Removed NSObject * casts that were used to work around the problem fixed above. 2002-04-25 Chris Blumenberg <set EMAIL_ADDRESS environment variable> * MIME.subproj/IFDownloadHandler.h: * MIME.subproj/IFDownloadHandler.mm: (+[IFDownloadHandler launchURL:]): Added the above method as a way to universally launch an URL within WebKit * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController URLPolicyForURL:]): We handle http, https and file URL's * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource initWithURL:]): (-[IFWebDataSource startLoading:]): The IFURLHandle is now lazilly allocated. * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame setProvisionalDataSource:]): We only load a data source if the URL policy is IFURLPolicyUseContentPolicy 2002-04-25 Richard Williamson <rjw@apple.com> Fixed problem with errors potentially being reported on wrong data source by moving collected errors from frame to datasource. Little changes in preparation for events. * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _receivedProgress:forResource:fromDataSource:]): (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]): (-[IFBaseWebController _receivedError:forResource:partialProgress:fromDataSource:]): (-[IFBaseWebController _mainReceivedError:forResource:partialProgress:fromDataSource:]): * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource errors]): (-[IFWebDataSource mainDocumentError]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]): (-[IFWebDataSource _startLoading:]): (-[IFWebDataSource _setMainDocumentError:]): (-[IFWebDataSource _clearErrors]): (-[IFWebDataSource _addError:forResource:]): * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame reload:]): (-[IFWebFrame reset]): * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFramePrivate dealloc]): (-[IFWebFrame _isLoadComplete]): (-[IFWebFrame _checkLoadComplete]): * WebView.subproj/IFWebView.mm: (-[IFWebView acceptsFirstResponder]): (-[IFWebView layout]): (-[IFWebView drawRect:]): 2002-04-25 Darin Adler <darin@apple.com> Rework plugin code to prepare to move more of here from WebCore. * Plugins.subproj/IFPluginView.mm: (IFPluginViewCreate): New. Does all the work of creating an NSView for a plug-in, including stuff previously done in WebCore. (IFJavaAppletViewCreate): Same as above, for Java applets. (+[IFPluginView load]): Set up the function pointers using the new improved WebCore API. * Plugins.subproj/IFNullPluginView.mm: (-[IFNullPluginView load]): Remove this setup because now there's no separate call to set up a null plug-in. 2002-04-25 John Sullivan <sullivan@apple.com> Fixed 2911915 (Exception in -[IFWebView mouseMoved]) * WebView.subproj/IFWebView.mm: (-[IFWebView mouseDown:]): Changed "mouseUp" to "mouseDown" in exception message. (-[IFWebView mouseMoved:]): Removed bogus event-type checking that caused this method to (always?) throw an exception when invoked. 2002-04-24 Chris Blumenberg <cblu@apple.com> Renamed [IFWebDataSource frame] to [IFWebDataSource webFrame] * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _receivedProgress:forResource:fromDataSource:]): (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]): (-[IFBaseWebController _receivedError:forResource:partialProgress:fromDataSource:]): (-[IFBaseWebController _mainReceivedError:forResource:partialProgress:fromDataSource:]): * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource webFrame]): (-[IFWebDataSource frameName]): (-[IFWebDataSource isLoading]): * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _startLoading:]): (-[IFWebDataSource _setTitle:]): 2002-04-24 Richard Williamson <rjw@apple.com> Changed ordering of messages so activity viewer doesn't get -1 bytesSoFar for cancelled messages. * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _receivedProgress:forResource:fromDataSource:]): (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]): === Alexander 0.3c2 (v1) === 2002-04-23 Chris Blumenberg <cblu@apple.com> * WebKit.pbproj/project.pbxproj: Took IFDownloadHandler.h out of the public headers. * WebView.subproj/IFLocationChangeHandler.h: Removed deprecated methods. * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame setProvisionalDataSource:]): Don't call locationChangeStarted anymore. 2002-04-23 Chris Blumenberg <cblu@apple.com> * MIME.subproj/IFDownloadHandler.h: * MIME.subproj/IFDownloadHandler.m: Removed. * MIME.subproj/IFDownloadHandler.mm: Added. (-[IFDownloadHandler initWithDataSource:]): (-[IFDownloadHandler dealloc]): * MIME.subproj/IFDownloadHandlerPrivate.h: Removed. * MIME.subproj/IFDownloadHandlerPrivate.m: Removed. Made IFDownloadHandler a private class that retains the data source and saves the data to disk. * WebKit.pbproj/project.pbxproj: Removed IFDownloadHandlerPrivate * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]): Only send locationChangeCommitted if its shown inline. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): Save data with IFDownloadHandler (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): If its a download, set the provisionalDataSource on the frame to nil. * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource webFrame]): (-[IFWebDataSource pageTitle]): (-[IFWebDataSource contentPolicy]): Added some accessor methods. Spelling fix pageTitle. 2002-04-23 Kenneth Kocienda <kocienda@apple.com> Reviewed by: Darin Adler Fix for Radar 2908403 (Fix names in WebFoundation extensions code) Extensions code in WebFoundation now is in its own namespace. Where we have added categories to existing Foundation and AppKit classes, the categories begin with the IF prefix. All method names begin with the _IF_ prefix. This file here was changed to use the new names. * History.subproj/IFWebHistoryPrivate.m: (-[IFWebHistoryPrivate findIndex:forDay:]): (-[IFWebHistoryPrivate arrayRepresentation]): (-[IFWebHistoryPrivate _loadHistoryGuts:]): 2002-04-22 Chris Blumenberg <cblu@apple.com> * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): Send an IFError when we're asked to show content we can't handle. * WebView.subproj/IFWebDataSourcePrivate.mm: Cleaning 2002-04-22 Chris Blumenberg <cblu@apple.com> * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController haveContentPolicy:andPath:forLocationChangeHandler:]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: Fixed frames which I broke in the previous commit. We now set the content policy on all child frames instead of just the main frame. 2002-04-22 Chris Blumenberg <cblu@apple.com> * MIME.subproj/IFMIMEHandler.h: * MIME.subproj/IFMIMEHandler.m: (+[IFMIMEHandler showableMIMETypes]): (+[IFMIMEHandler saveFileWithPath:andData:]): (+[IFMIMEHandler saveAndOpenFileWithPath:andData:]): Added the above factory methods. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController haveContentPolicy:andPath:forLocationChangeHandler:]): Save the content policy and download path on the datasource. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]): (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]): (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): Made IFMainURLHandleClient use our new content policy API rather than IFDownloadHandler. * WebView.subproj/IFWebController.h: Removed some deprecated methods. * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _downloadPath]): (-[IFWebDataSource _setDownloadPath:]): (-[IFWebDataSource _contentPolicy]): (-[IFWebDataSource _setContentPolicy:]): Added the above methods. 2002-04-22 Darin Adler <darin@apple.com> * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]): Fix the fix. It was bumping argsCount even when not putting an argument into the array. 2002-04-21 Maciej Stachowiak <mjs@apple.com> Fix a plugins memory trasher that was making Alexander crash on the abcnews.com test page in cvs-torture-test: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]): Use a new maxArguments variable to size the argument and value arrays - with the old code argsCount would end up twice the size it should be, and the arguments would all get written past the end of the argument array. 2002-04-19 Kenneth Kocienda <kocienda@apple.com> Changes to support submission of forms using HTTP POST. These changes move us over to using the new WebKit interface for creating WebDataSource instances, one that passes a handle rather than just a URL, enabling the specific request method to be communicated to WebFoundation. This fixes: Radar 2903602 (IFWebDataSource API must passes attributes and flags to IFURLHandle) * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (IFWebDataSourceMake), (-[IFWebDataSource initWithURL:]), (-[IFWebDataSource initWithHandle:]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _startLoading:]): 2002-04-19 Richard Williamson <rjw@apple.com> Updated comments to reflect new API. * WebView.subproj/IFLocationChangeHandler.h: 2002-04-19 Darin Adler <darin@apple.com> * Plugins.subproj/IFPluginView.h: Re-add the attributes and values arrays, since they need to live the life of the plugin. * Plugins.subproj/IFPluginView.mm: (newCString): New function to make a C++ new-allocated C string from an NSString. (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]): Move code to allocate the arrays back here. (-[IFPluginView dealloc]): Deallocate the arrays and their contents. (-[IFPluginView start]): Simplify now that it does no work. 2002-04-18 Chris Blumenberg <cblu@apple.com> Made stop and start to work better. Fixed a bug darin made. * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]), (-[IFPluginView setWindow]), (-[IFPluginView start]), (-[IFPluginView stop]): 2002-04-18 Richard Williamson <rjw@apple.com> Fixed typo. * WebView.subproj/IFBaseLocationChangeHandler.m: (-[IFBaseLocationChangeHandler requestContentPolicyForMIMEType:]): * WebView.subproj/IFLocationChangeHandler.h: 2002-04-18 Richard Williamson <rjw@apple.com> New API stubs for content policy. * WebView.subproj/IFBaseLocationChangeHandler.h: Added. * WebView.subproj/IFBaseLocationChangeHandler.m: Added. (+[IFBaseLocationChangeHandler setGlobalContentPolicy:forMIMEType:]), (+[IFBaseLocationChangeHandler globaContentPolicyForContentType:]), (+[IFBaseLocationChangeHandler globalContentPolicies]), (+[IFBaseLocationChangeHandler suggestedFileanemForURL:andContentType:]), (+[IFBaseLocationChangeHandler suggestedDirectoryForURL:andContentType:]), (+[IFBaseLocationChangeHandler extensionForURL:]), (-[IFBaseLocationChangeHandler extension]), (-[IFBaseLocationChangeHandler locationWillChangeTo:]), (-[IFBaseLocationChangeHandler locationChangeStarted]), (-[IFBaseLocationChangeHandler locationChangeCommitted]), (-[IFBaseLocationChangeHandler locationChangeDone:]), (-[IFBaseLocationChangeHandler receivedPageTitle:forDataSource:]), (-[IFBaseLocationChangeHandler serverRedirectTo:forDataSource:]), (-[IFBaseLocationChangeHandler downloadingWithHandler:]), (-[IFBaseLocationChangeHandler requestContentPolicyForContentMIMEType:]), (-[IFBaseLocationChangeHandler unableToImplementContentPolicy:]): * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController receivedError:forDownloadHandler:partialProgress:]), (-[IFBaseWebController provideLocationChangeHandlerForFrame:andURL:]), (-[IFBaseWebController URLPolicyForURL:]), (-[IFBaseWebController unableToImplementURLPolicyForURL:error:]), (-[IFBaseWebController haveContentPolicy:andPath:forLocationChangeHandler:]): * WebView.subproj/IFLocationChangeHandler.h: * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _setState:]): 2002-04-18 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Oops. Take out -Wstrict-prototypes, put back -Wmissing-prototypes. 2002-04-18 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Take out -Wmissing-prototypes because system headers are triggering it when we don't have precompiled headers on. 2002-04-18 Darin Adler <darin@apple.com> Fixes for compiling with gcc3 and more warnings. * WebKit.pbproj/project.pbxproj: Turn on gcc3 and the same set of warnings as in the rest of Labyrinth (see top level ChangeLog for details). * Plugins.subproj/IFPluginView.mm: Avoid warnings about malloc by not using it. (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]): Keep the arguments dictionary around instead of keeping the C format version of it around. Also don't bother keeping the C string form of the MIME type around, and simplify some other stuff in here. (-[IFPluginView dealloc]): Corresponding changes since we keep a different set of things. (-[IFPluginView newStream:mimeType:notifyData:]): Use [mimeType cString]. (-[IFPluginView start]): Build the lists of attributes and values in here. Do it using [NSString cString] for simplicity and don't keep the lists around after we're done with them. (-[IFPluginView IFURLHandleResourceDidFinishLoading:data:]): Use [filenameClassic cString]. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]), (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]), (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]), (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]), (-[IFWebDataSource _setLoading:]), (-[IFWebDataSource _setController:]), (-[IFWebDataSource _setLocationChangeHandler:]): * WebView.subproj/IFWebView.mm: (-[IFWebView provisionalDataSourceChanged:]), (-[IFWebView mouseUp:]), (-[IFWebView mouseDown:]): Add type casts required by pickier gcc3. * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebViewPrivate dealloc]): Add type cast required by pickier gcc3. (-[IFWebView _stopPlugins]): Use local variable to work around Radar 2905835. 2002-04-18 Chris Blumenberg <cblu@apple.com> Moved plugin instance creation to the start method in IFPluginView. * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]), (-[IFPluginView dealloc]), (-[IFPluginView newStream:mimeType:notifyData:]), (-[IFPluginView start]), (-[IFPluginView stop]), (-[IFPluginView drawRect:]), (-[IFPluginView windowBecameKey:]), (-[IFPluginView windowResignedKey:]), (-[IFPluginView IFURLHandle:resourceDataDidBecomeAvailable:]), (-[IFPluginView IFURLHandleResourceDidFinishLoading:data:]): 2002-04-17 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Update header search paths to find WebCore in the new location and eliminate WebCore/include. 2002-04-17 Chris Blumenberg <cblu@apple.com> Added a debug bit mask for plugins and downloads. * MIME.subproj/IFDownloadHandlerPrivate.m: (-[IFDownloadHandlerPrivate _openFile]), (-[IFDownloadHandlerPrivate _saveFile]), (-[IFDownloadHandler _initWithURLHandle:mimeHandler:]): * Misc.subproj/WebKitDebug.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]), (-[IFPluginView setWindow]), (-[IFPluginView newStream:mimeType:notifyData:]), (-[IFPluginView stop]), (-[IFPluginView sendUpdateEvent]), (-[IFPluginView becomeFirstResponder]), (-[IFPluginView resignFirstResponder]), (-[IFPluginView mouseDown:]), (-[IFPluginView mouseUp:]), (-[IFPluginView mouseEntered:]), (-[IFPluginView mouseExited:]), (-[IFPluginView keyUp:]), (-[IFPluginView keyDown:]), (-[IFPluginView IFURLHandle:resourceDataDidBecomeAvailable:]), (-[IFPluginView IFURLHandleResourceDidFinishLoading:data:]), (-[IFPluginView getURLNotify:target:notifyData:]), (-[IFPluginView getURL:target:]), (-[IFPluginView postURLNotify:target:len:buf:file:notifyData:]), (-[IFPluginView postURL:target:len:buf:file:]), (-[IFPluginView newStream:target:stream:]), (-[IFPluginView write:len:buffer:]), (-[IFPluginView destroyStream:reason:]), (-[IFPluginView status:]), (-[IFPluginView getValue:value:]), (-[IFPluginView setValue:value:]), (-[IFPluginView invalidateRect:]), (-[IFPluginView invalidateRegion:]), (-[IFPluginView forceRedraw]): * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): 2002-04-17 Darin Adler <darin@apple.com> * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]): Changed another Georgia that I missed to Times New Roman. 2002-04-16 Darin Adler <darin@apple.com> * WebView.subproj/IFWebDataSource.mm: * WebView.subproj/IFWebDataSourcePrivate.mm: Touch these files to try to make Jersey build again. 2002-04-16 Darin Adler <darin@apple.com> * WebView.subproj/IFBaseWebControllerPrivate.mm: Include khtml_part.h instead of KWQKHTMLPart.h. * WebView.subproj/IFWebFrame.mm: Include khtml_part.h instead of KWQKHTMLPart.h. * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource documentTextFromDOM]): Remove an unneeded cast and an extra retain/autorelease. 2002-04-16 Darin Adler <darin@apple.com> * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.mm: * WebView.subproj/IFWebFramePrivate.h: Change view/setView back to be id, rather than IFWebView. In the future, the view may be some other kind of object. 2002-04-16 John Sullivan <sullivan@apple.com> Fixed bug Chris noticed where Alexander wasn't putting up an error sheet on failed page visits. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): Don't set provisionalDataSource to nil until after sending it locationChangeDone. 2002-04-16 Darin Adler <darin@apple.com> * WebView.subproj/IFBaseWebController.mm: Remove special release handling because data sources now retain the controller as long as they are loading. * WebView.subproj/IFWebDataSource.mm: Remove special release handling because data sources now retain themselves as long as they are loading. * WebView.subproj/IFWebFrame.mm: Remove special release handling, because data sources now retain the controller as long as they are loading, and the controller retains the frame. * WebView.subproj/IFWebDataSourcePrivate.h: Add a "loading" boolean. * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _setLoading:]): Change the "loading" state, retaining or releasing this object and the controller as necessary. (-[IFWebDataSource _updateLoading]): Update the loading state; called when some part of loading is done to see if it's all done. (-[IFWebDataSource _setController:]): Retain the new controller and release the old controller when loading. (-[IFWebDataSource _setPrimaryLoadComplete:]): Call _updateLoading. (-[IFWebDataSource _startLoading:]): Call _setLoading:YES. (-[IFWebDataSource _addURLHandle:]): Call _setLoading:YES. (-[IFWebDataSource _removeURLHandle:]): Call _updateLoading. * WebView.subproj/IFWebFrame.h: Use the real type, IFWebView, for setView and view. * WebView.subproj/IFWebFramePrivate.h: Formatting tweak. * WebKit.pbproj/project.pbxproj: Version wars. 2002-04-16 John Sullivan <sullivan@apple.com> * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _setController:]): removed a mistaken retain/release pair here for Darin. 2002-04-16 Darin Adler <darin@apple.com> Change default font to "Times New Roman 11" rather than "Georgia 12" to be more like Macintosh Internet Explorer. * WebView.subproj/IFPreferences.mm: A little simplifying of private pointers. * MIME.subproj/IFDownloadHandler.h: * MIME.subproj/IFDownloadHandler.m: 2002-04-16 Darin Adler <darin@apple.com> A little simplifying of private pointers. * MIME.subproj/IFDownloadHandler.m: * MIME.subproj/IFDownloadHandlerPrivate.m: * WebView.subproj/IFBaseWebController.mm: * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: * WebView.subproj/IFWebDataSourcePrivate.mm: * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.mm: * WebView.subproj/IFWebFramePrivate.mm: * WebView.subproj/IFWebView.h: * WebView.subproj/IFWebView.mm: * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: 2002-04-16 Darin Adler <darin@apple.com> Change headers so they don't include so much. Also change IF_LOAD_TYPE to IFLoadType. * History.subproj/IFBackForwardList.h: * History.subproj/IFBackForwardList.m: * History.subproj/IFURIEntry.h: * History.subproj/IFURIList.h: * History.subproj/IFURIList.m: * History.subproj/IFWebHistory.h: * History.subproj/IFWebHistoryPrivate.h: * History.subproj/IFWebHistoryPrivate.m: * MIME.subproj/IFContentHandler.h: * MIME.subproj/IFDownloadHandler.h: * MIME.subproj/IFDownloadHandlerPrivate.h: * MIME.subproj/IFDownloadHandlerPrivate.m: * MIME.subproj/IFMIMEDatabase.h: * MIME.subproj/IFMIMEDatabase.m: * Misc.subproj/IFException.h: * Plugins.subproj/IFNullPluginView.mm: * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFBaseWebController.h: * WebView.subproj/IFBaseWebController.mm: * WebView.subproj/IFBaseWebControllerPrivate.h: * WebView.subproj/IFBaseWebControllerPrivate.mm: * WebView.subproj/IFLoadProgress.h: * WebView.subproj/IFLoadProgress.mm: * WebView.subproj/IFLocationChangeHandler.h: * WebView.subproj/IFMainURLHandleClient.h: * WebView.subproj/IFMainURLHandleClient.mm: * WebView.subproj/IFPreferences.h: * WebView.subproj/IFPreferencesPrivate.h: * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.mm: * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: * WebView.subproj/IFWebView.h: * WebView.subproj/IFWebView.mm: * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: 2002-04-16 Kenneth Kocienda <kocienda@apple.com> Moved IFError class from WebKit to WebFoundation. Updated includes due to this change. Updated URL handle client interface to pass an IFError in an error callback rather than a plain int. The URL client was modified due to this change. * Misc.subproj/IFError.h: Removed. * Misc.subproj/IFError.m: Removed. * Plugins.subproj/IFPluginView.mm: * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFBaseWebControllerPrivate.mm: * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): * WebView.subproj/IFWebFramePrivate.mm: 2002-04-15 Darin Adler <darin@apple.com> * WebView.subproj/IFPreferences.h: * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]): Remove the old WebKitFontSizes preference. (-[IFPreferences mediumFontSize]), (-[IFPreferences setMediumFontSize:]): New. * WebView.subproj/IFWebView.mm: (-[IFWebView reapplyStyles]): Call updateStyleSelector() instead of recalcStyle(). 2002-04-15 Darin Adler <darin@apple.com> Merged changes from previous merge branch. 2002-03-25 Darin Adler <darin@apple.com> * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]): Add WebKitMediumFontSizePreferenceKey. 2002-04-15 John Sullivan <sullivan@apple.com> * Plugins.subproj/IFNullPluginView.mm: (-[IFNullPluginView drawRect:]): Moved a line of code to prevent pluginNotFound message from being sent twice. 2002-04-15 Richard Williamson <rjw@apple.com> Changes to IFLocationChangeHandler. Experimental allocator code, not to be used, not thread safe.! * Misc.subproj/WebKitDebug.h: * Misc.subproj/WebKitDebug.m: (if_check_zone), (_debugAllocate), (_debugAllocatorInitialize), (printDebugMallocCounters), (if_cf_retain), (if_cf_release), (if_cf_alloc), (if_cf_realloc), (if_cf_dealloc), (if_cf_preferredSize), (setupDebugMalloc), (clearDebugMalloc), (resetDebugMallocCounters), (public_mALLOc), (public_fREe), (public_rEALLOc), (public_mEMALIGn), (public_vALLOc), (public_pVALLOc), (public_cALLOc), (public_iCALLOc), (public_iCOMALLOc), (public_cFREe), (public_mTRIm), (public_mUSABLe), (public_mSTATs), (public_mALLINFo), (public_mALLOPt), (do_check_malloc_state), (mALLINFo), (mSTATs), (if_size), (if_valloc), (if_malloc), (if_realloc), (if_calloc), (if_free): * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFBaseWebController.h: * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController provideLocationChangeHandlerForFrame:]): * WebView.subproj/IFLocationChangeHandler.h: Added. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]), (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebDataSource.mm: (+[IFWebDataSource load]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]), (-[IFWebDataSource _startLoading:]), (-[IFWebDataSource _setTitle:]), (-[IFWebDataSource _locationChangeHandler]), (-[IFWebDataSource _setLocationChangeHandler:]): * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame setProvisionalDataSource:]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _transitionProvisionalToCommitted]), (-[IFWebFrame _isLoadComplete]): 2002-04-15 Chris Blumenberg <set EMAIL_ADDRESS environment variable> * MIME.subproj/IFContentHandler.m: (-[IFContentHandler HTMLDocument]): Made sure I didn't unnecessarily allocate html document strings * MIME.subproj/IFDownloadHandler.h: * MIME.subproj/IFDownloadHandler.m: (-[IFDownloadHandler suggestedFilename]), (-[IFDownloadHandler openAfterDownload:]): Added the mentioned API's * MIME.subproj/IFDownloadHandlerPrivate.h: * MIME.subproj/IFDownloadHandlerPrivate.m: (-[IFDownloadHandlerPrivate init]), (-[IFDownloadHandlerPrivate dealloc]), (-[IFDownloadHandlerPrivate _suggestedFilename]), (-[IFDownloadHandlerPrivate _cancelDownload]), (-[IFDownloadHandlerPrivate _storeAtPath:]), (-[IFDownloadHandlerPrivate _finishedDownload]), (-[IFDownloadHandlerPrivate _openAfterDownload:]), (-[IFDownloadHandlerPrivate _openFile]), (-[IFDownloadHandlerPrivate _saveFile]), (-[IFDownloadHandler _initWithURLHandle:mimeHandler:]): Cleaned up and added a lot error checking code to IFDownloadHandlerPrivate * Plugins.subproj/IFNullPluginView.mm: (-[IFNullPluginView initWithFrame:mimeType:arguments:]), (-[IFNullPluginView drawRect:]): Made sure I didn't unnecessarily allocate images * Resources/plugin_document_template.html: Plugins now have 100% of the window 2002-04-12 Chris Blumenberg <cblu@apple.com> Fixed build failure. Forgot to make IFDownloadHandler.h a public header. * WebKit.pbproj/project.pbxproj: 2002-04-12 Chris Blumenberg <cblu@apple.com> First implementation of IFDownloadHandler and IFDownloadHandlerPrivate. 2002-04-11 Chris Blumenberg <cblu@apple.com> Added support for non-html content. Non-html content is embedded in a contrived HTML document. * English.lproj/IFError.strings: * MIME.subproj/IFContentHandler.h: Added. * MIME.subproj/IFContentHandler.m: Added. (-[IFContentHandler initWithMIMEHandler:URL:]), (-[IFContentHandler HTMLDocument]), (-[IFContentHandler dealloc]): * MIME.subproj/IFMIMEDatabase.h: * MIME.subproj/IFMIMEDatabase.m: (-[IFMIMEDatabase MIMEHandlerForMIMEType:]), (setMimeHandlers): * MIME.subproj/IFMIMEHandler.h: * MIME.subproj/IFMIMEHandler.m: (-[IFMIMEHandler initWithMIMEType:handlerType:handlerName:]), (-[IFMIMEHandler description]): * Misc.subproj/IFError.h: * Misc.subproj/IFError.m: (+[IFError initialize]): * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]), (-[IFPluginView dealloc]), (-[IFPluginView stop]): * Resources/plugin_document_template.html: Added. * Resources/text_document_template.html: Added. * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFMainURLHandleClient.h: * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient initWithDataSource:part:]), (-[IFMainURLHandleClient dealloc]), (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]), (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): 2002-04-10 Chris Blumenberg <cblu@apple.com> Cleaned up stream deallocations. * Plugins.subproj/IFPluginStream.h: * Plugins.subproj/IFPluginStream.m: (-[IFPluginStream initWithURL:mimeType:notifyData:]), (-[IFPluginStream incrementOffset:]), (-[IFPluginStream dealloc]): * Plugins.subproj/IFPluginView.mm: (-[IFPluginView newStream:mimeType:notifyData:]), (-[IFPluginView IFURLHandleResourceDidCancelLoading:]), (-[IFPluginView IFURLHandle:resourceDidFailLoadingWithResult:]): 2002-04-10 John Sullivan <sullivan@apple.com> Fixed 2891396 -- window fills with garbage if you resize or hide/show toolbar before loading first page * WebView.subproj/IFWebView.mm: (-[IFWebView drawRect:]): Made webview fill rect with white if there's no widget. 2002-04-09 Chris Blumenberg <cblu@apple.com> * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]), (-[IFPluginView setWindow]), (-[IFPluginView newStream:mimeType:notifyData:]), (-[IFPluginView start]), (-[IFPluginView stop]), (-[IFPluginView dealloc]), (-[IFPluginView findSuperview:]), (-[IFPluginView sendUpdateEvent]), (-[IFPluginView drawRect:]), (-[IFPluginView isFlipped]), (-[IFPluginView viewHasMoved:]), (-[IFPluginView windowBecameKey:]), (-[IFPluginView windowResignedKey:]), (-[IFPluginView windowWillClose:]), (-[IFPluginView IFURLHandleResourceDidBeginLoading:]), (-[IFPluginView IFURLHandle:resourceDataDidBecomeAvailable:]), (-[IFPluginView IFURLHandleResourceDidFinishLoading:data:]), (-[IFPluginView IFURLHandleResourceDidCancelLoading:]), (-[IFPluginView IFURLHandle:resourceDidFailLoadingWithResult:]), (-[IFPluginView IFURLHandle:didRedirectToURL:]), (-[IFPluginView forceRedraw]), (IFPluginMake), (+[IFPluginView load]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFLoadProgress.h: Cleaned up the IFPluginView code. Moved a lot of things around. Added support for plug-in file download progress. 2002-04-08 Chris Blumenberg <cblu@apple.com> * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]), (-[IFPluginView drawRect:]), (-[IFPluginView newStream:mimeType:notifyData:]), (-[IFPluginView getURLNotify:target:notifyData:]): Support new stream requests from plug-ins that are relative URL's. 2002-04-08 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Re-added -Wno-format-y2k. 2002-04-08 Richard Williamson <rjw@apple.com> Added logs for Shelley to note start and completion of document load. -WebKitLogLevel 0x1000. Also, as a bonus, note time to load. * Misc.subproj/WebKitDebug.h: * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame startLoading]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _setState:]): 2002-04-08 Chris Blumenberg <cblu@apple.com> * Plugins.subproj/IFNullPluginView.h: * Plugins.subproj/IFNullPluginView.mm: (-[IFNullPluginView initWithFrame:mimeType:arguments:]), (-[IFNullPluginView drawRect:]): * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController pluginNotFoundForMIMEType:pluginPageURL:]): * WebView.subproj/IFWebController.h: Added pluginNotFoundForMIMEType: pluginPageURL: to WebKit. This gets called by IFNullPluginView when a plug-in for a certain mime type is requested but not installed. 2002-04-08 Richard Williamson <rjw@apple.com> Added frameForView: Cleaned up out-of-date comments. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController _frameForView:fromFrame:]), (-[IFBaseWebController frameForView:]): * WebView.subproj/IFWebController.h: 2002-04-05 Chris Blumenberg <cblu@apple.com> * Plugins.subproj/IFNullPluginView.mm: (+[IFNullPluginView load]): Enabled the below. 2002-04-05 Chris Blumenberg <cblu@apple.com> * Plugins.subproj/IFNullPluginView.h: Added. * Plugins.subproj/IFNullPluginView.mm: Added. (-[IFNullPluginView initWithFrame:mimeType:arguments:]), (-[IFNullPluginView findSuperview:]), (-[IFNullPluginView drawRect:]): * Resources/nullplugin.tiff: Added. * WebKit.pbproj/project.pbxproj: An IFNullPluginView is now created when no plug-in for a requested mime type is found. IFNullPluginView displays a null plug-in icon and will eventually report this error to the WebController. 2002-04-05 Richard Williamson <rjw@apple.com> Back out some changes to lazily dealloc frame. * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame release]): 2002-04-05 Richard Williamson <rjw@apple.com> New method on controller to find a frame of a particular name anywhere in the frame hierarchy. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController initWithView:provisionalDataSource:]), (-[IFBaseWebController _frameNamed:fromFrame:]), (-[IFBaseWebController frameNamed:]): * WebView.subproj/IFWebController.h: 2002-04-05 Darin Adler <darin@apple.com> * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): Use contentLengthReceived rather than getting the length of availableResourceData to determine how much data has arrived. 2002-04-05 Richard Williamson <rjw@apple.com> Implemented the same lazily deallocation scheme on frame as in controller and data source. * WebView.subproj/IFWebFrame.mm: (-[_IFFrameHolder initWithObject:]), (-[_IFFrameHolder _checkReadyToDealloc:]), (-[IFWebFrame release]): 2002-04-04 Richard Williamson <rjw@apple.com> Clear controller references from data source and view, as well as frame. * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebControllerPrivate _clearControllerReferences:]): 2002-04-04 Richard Williamson <rjw@apple.com> Lazily dealloc controller and data source ONLY after all loads have completed. * WebView.subproj/IFBaseWebController.mm: (-[_IFControllerHolder initWithController:]), (-[_IFControllerHolder _checkReadyToDealloc:]), (-[IFBaseWebController dealloc]), (-[IFBaseWebController release]): * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebControllerPrivate _clearControllerReferences:]), (-[IFBaseWebControllerPrivate dealloc]): * WebView.subproj/IFWebDataSource.mm: (-[_IFDataSourceHolder initWithDataSource:]), (-[_IFDataSourceHolder _checkReadyToDealloc:]), (-[IFWebDataSource release]): 2002-04-04 Kenneth Kocienda <kocienda@apple.com> Hack to handle displaying image URLs. The trick is to sense when the main URL is an image type and wrap the URL in a small generated HTML document and hand that off to the engine to display. Works like a charm! :) There may be some longer-term issues, but for now, this lets us do something we could not before. It also lets us handle some iframes that contain only image URLs. * Resources/image_document_template.html: Added. * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFMainURLHandleClient.h: * WebView.subproj/IFMainURLHandleClient.mm: (loadImageDocumentTemplate), (-[IFMainURLHandleClient initWithDataSource:part:]), (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): 2002-04-04 Chris Blumenberg <cblu@apple.com> * English.lproj/IFError.strings: * Misc.subproj/IFError.h: * Misc.subproj/IFError.m: (+[IFError initialize]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): Added the IFNonHTMLContentNotSupportedError to IFError. 2002-04-04 Richard Williamson <rjw@apple.com> Tuned and re-enabled resource layouts. * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]): * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _scheduleLayout:]), (-[IFWebFrame _timedLayout:]): 2002-04-04 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Add an Unoptimized build style: exactly like Development except without the -O. 2002-04-03 Richard Williamson <rjw@apple.com> Changed name of finalURL to redirectedURL. Disabled layout after resource load. It appears to really slow us down. * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]): * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource redirectedURL]), (-[IFWebDataSource wasRedirected]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): 2002-04-03 Richard Williamson <rjw@apple.com> Added support for finalURL and wasRedirected to datasource. Added additional layouts on resource loads. Added more implementations of frame related methods in data source. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]), (-[IFPreferences _resourceTimedLayoutDelay]), (-[IFPreferences _resourceTimedLayoutEnabled]): * WebView.subproj/IFPreferencesPrivate.h: * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource frameNames]), (-[IFWebDataSource findDataSourceForFrameNamed:]), (-[IFWebDataSource frameExists:]), (-[IFWebDataSource finalURL]), (-[IFWebDataSource wasRedirected]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]), (-[IFWebDataSource _setTitle:]), (-[IFWebDataSource _setFinalURL:]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _scheduleLayout:]), (-[IFWebFrame _transitionProvisionalToLayoutAcceptable]), (-[IFWebFrame _isLoadComplete]): 2002-04-03 Kenneth Kocienda <kocienda@apple.com> Updated debugging log messages to use new varargs macros. * History.subproj/IFWebHistoryPrivate.m: (-[IFWebHistoryPrivate removeEntryForURLString:]), (-[IFWebHistoryPrivate _loadHistoryGuts:]), (-[IFWebHistoryPrivate loadHistory]), (-[IFWebHistoryPrivate _saveHistoryGuts:]), (-[IFWebHistoryPrivate saveHistory]): * Misc.subproj/WebKitDebug.h: * Misc.subproj/WebKitDebug.m: (timestamp), (WebKitLog): * Plugins.subproj/IFPluginView.mm: (-[IFPluginView initWithFrame:plugin:url:mime:arguments:mode:]), (-[IFPluginView setWindow]), (-[IFPluginView newStream:mimeType:notifyData:]), (-[IFPluginView IFURLHandle:resourceDataDidBecomeAvailable:]), (-[IFPluginView IFURLHandleResourceDidFinishLoading:data:]), (-[IFPluginView becomeFirstResponder]), (-[IFPluginView resignFirstResponder]), (-[IFPluginView sendUpdateEvent]), (-[IFPluginView mouseDown:]), (-[IFPluginView mouseUp:]), (-[IFPluginView mouseEntered:]), (-[IFPluginView mouseExited:]), (-[IFPluginView keyUp:]), (-[IFPluginView keyDown:]), (-[IFPluginView getURLNotify:target:notifyData:]), (-[IFPluginView getURL:target:]), (-[IFPluginView status:]), (-[IFPluginView stop]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]): * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidBeginLoading:]), (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]), (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]), (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]), (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]), (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource isLoading]): * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _stopLoading]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _transitionProvisionalToLayoutAcceptable]), (-[IFWebFrame _timedLayout:]), (-[IFWebFrame _setState:]), (-[IFWebFrame _isLoadComplete]): * WebView.subproj/IFWebView.mm: (-[IFWebView reapplyStyles]), (-[IFWebView layout]), (-[IFWebView setNeedsDisplay:]), (-[IFWebView setNeedsLayout:]), (-[IFWebView setNeedsToApplyStyles:]), (-[IFWebView drawRect:]): 2002-04-02 Darin Adler <darin@apple.com> * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _setTitle:]): Update title if the page is already in the committed state. 2002-04-02 Darin Adler <darin@apple.com> * WebKit.pbproj/project.pbxproj: Fix flags as I did in WebFoundation. * Misc.subproj/WebKitDebug.h: Turn off logging when xNDEBUG is defined. Remove unused stuff. Add checking for printf parameters. * Misc.subproj/WebKitDebug.m: Remove unused variants. * Plugins.subproj/IFPluginView.mm: Change to use WebKit logging, not WebCore logging. * WebView.subproj/IFMainURLHandleClient.mm: * WebView.subproj/IFWebView.mm: Fix types in log statements caught by the compiler. 2002-04-02 Chris Blumenberg <cblu@apple.com> * Plugins.subproj/IFPluginView.mm: (-[IFPluginView IFURLHandleResourceDidCancelLoading:]), (-[IFPluginView IFURLHandle:resourceDidFailLoadingWithResult:]), (-[IFPluginView IFURLHandle:didRedirectToURL:]): Added support for the above callbacks. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): Return an error if non-html is requested. 2002-04-02 Richard Williamson <rjw@apple.com> More relaxed about invalid states. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _transitionProvisionalToLayoutAcceptable]): 2002-04-02 Darin Adler <darin@apple.com> * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _setTitle:]): Fix a leak I introduced here by copying the string in a better way. 2002-04-01 Richard Williamson <rjw@apple.com> Cleaned up lots of potentially stale references to controller. * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebControllerPrivate dealloc]): * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient initWithDataSource:part:]), (-[IFMainURLHandleClient dealloc]): * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]), (-[IFWebDataSource _setPrimaryLoadComplete:]), (-[IFWebDataSource _setTitle:]): * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFramePrivate dealloc]), (-[IFWebFramePrivate setDataSource:]), (-[IFWebFramePrivate setProvisionalDataSource:]), (-[IFWebFrame _setController:]), (-[IFWebFrame _transitionProvisionalToCommitted]), (-[IFWebFrame _timedLayout:]), (-[IFWebFrame _setState:]): 2002-04-01 Richard Williamson <rjw@apple.com> Logging changes. Changes to support correct i/frame behavior. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController createFrameNamed:for:inParent:inScrollView:]): * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _timedLayout:]): * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebViewPrivate dealloc]), (-[IFWebView _setupScrollers]): 2002-04-01 John Sullivan <sullivan@apple.com> Added method for updating url, title, and/or displayTitle on existing entry. * History.subproj/IFWebHistory.h: * History.subproj/IFWebHistory.m: (-[IFWebHistory updateURL:title:displayTitle:forURL:]): Calls through to IFWebHistoryPrivate. * History.subproj/IFWebHistoryPrivate.h: * History.subproj/IFWebHistoryPrivate.m: (-[IFWebHistoryPrivate _entryForURLString:]): Broke this out from containsURL. (-[IFWebHistoryPrivate containsURL:]): Call broken-out method. (-[IFWebHistoryPrivate updateURL:title:displayTitle:forURL:]): Find existing entry (if any), change its attributes. 2002-04-01 Darin Adler <darin@apple.com> * Misc.subproj/IFError.h: Add the failing URL to IFError. * Misc.subproj/IFError.m: (-[IFError initWithErrorCode:]): Call through with nil for the URL. (-[IFError initWithErrorCode:failingURL:]): Retain the passed URL. (-[IFError dealloc]): Autorelease the URL. (-[IFError failingURL]): Return the URL. (-[IFError description]): Include the URL in the description. * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]): Put the URL into the IFError. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]): Put the URL into the IFError. 2002-04-01 Richard Williamson <rjw@apple.com> Added more logging to show time of layouts. * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _transitionProvisionalToLayoutAcceptable]), (-[IFWebFrame _timedLayout:]), (-[IFWebFrame _isLoadComplete]): * WebView.subproj/IFWebView.mm: (-[IFWebView reapplyStyles]), (-[IFWebView layout]): 2002-04-01 Darin Adler <darin@apple.com> Added operations for JavaScript objects. Not sure if this was the best place for them, but it should be OK for now. * Misc.subproj/IFCache.h: * Misc.subproj/IFCache.mm: (+[IFCache setDisabled:]), (+[IFCache javaScriptObjectsCount]), (+[IFCache garbageCollectJavaScriptObjects]): * WebKit.pbproj/project.pbxproj: 2002-03-30 Richard Williamson <rjw@apple.com> Corrected comments describing the new 'acceptable to layout' state transition. * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]): 2002-03-30 Darin Adler <darin@apple.com> * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController receivedPageTitle:forDataSource:]): Remove the exception from here. This is really a "do nothing, subclasses override me" method. * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource pageTitle]): Implement. * WebView.subproj/IFWebDataSourcePrivate.h: Add pageTitle and [IFWebDataSource _setTitle]. * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]): autorelease pageTitle. (-[IFWebDataSource _setTitle:]): Update the title, trimming whitespace and using nil, rather than empty string, to mean no title at all. Call [receivedPageTitle: forDataSource:] as necessary too. * WebView.subproj/IFMainURLHandleClient.mm: Did a gratuitious whitespace edit to force this file to recompile so everyone doesn't have to "make clean". 2002-03-30 Richard Williamson <rjw@apple.com> Added support for scrolling to anchor points. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): 2002-03-30 Maciej Stachowiak <mjs@apple.com> * WebKit.pbproj/project.pbxproj: Link against JavaScriptCore.framework instead of the defunct libJavaScriptCore.dylib. 2002-03-29 Richard Williamson <rjw@apple.com> Fixes for cancelling. Still need to think about a better solution than putting data sources in stopped mode. * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController _receivedError:forResource:partialProgress:fromDataSource:]), (-[IFBaseWebController _mainReceivedError:forResource:partialProgress:fromDataSource:]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _startLoading:]), (-[IFWebDataSource _isStopping]), (-[IFWebDataSource _stopLoading]): * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame setProvisionalDataSource:]): 2002-03-29 Richard Williamson <rjw@apple.com> Hooked up redirect. Now we see many more ads. :( Fixed cancel of main handle for document. Moved stop before start from frame to data source. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController locationChangeDone:forFrame:]), (-[IFBaseWebController serverRedirectTo:forDataSource:]): * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandleResourceDidCancelLoading:]), (-[IFMainURLHandleClient IFURLHandleResourceDidFinishLoading:data:]), (-[IFMainURLHandleClient IFURLHandle:resourceDidFailLoadingWithResult:]), (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]), (-[IFWebDataSource _startLoading:]), (-[IFWebDataSource _stopLoading]): * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame startLoading]): 2002-03-29 Richard Williamson <rjw@apple.com> Added stopLoading to startLoading to cancel any pending loads before new loads start. This doesn't work yet because of loader bugs, but will once those are fixed. Adding logging for redirects. * Misc.subproj/WebKitDebug.h: * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:didRedirectToURL:]): * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame startLoading]): 2002-03-29 Darin Adler <darin@apple.com> * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFramePrivate dealloc]): Deref the renderFramePart, and autorelease the provisionalDataSource. (-[IFWebFramePrivate setRenderFramePart:]): Ref renderFramePart while we hold it. 2002-03-28 Richard Williamson <rjw@apple.com> Increased size default for initial layout. * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]): 2002-03-28 Richard Williamson <rjw@apple.com> Fixed big leak of any document that had a frame or iframe. * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource retain]): * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]), (-[IFWebDataSource _setParent:]): 2002-03-28 Richard Williamson <rjw@apple.com> Modified the initial layout policy. * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]): * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]), (-[IFPreferences _initialTimedLayoutDelay]), (-[IFPreferences _initialTimedLayoutSize]): * WebView.subproj/IFPreferencesPrivate.h: * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _transitionProvisionalToLayoutAcceptable]), (-[IFWebFrame _transitionProvisionalToCommitted]), (-[IFWebFrame _initialLayout:]), (-[IFWebFrame _isLoadComplete]): 2002-03-28 Darin Adler <darin@apple.com> New private interface for getting at the cache. * Misc.subproj/IFCache.h: New. * Misc.subproj/IFCache.mm: New. * WebKit.pbproj/project.pbxproj: Added IFCache files. 2002-03-28 Darin Adler <darin@apple.com> * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController locationChangeDone:forFrame:]): Remove log of errors loading now that we have the activity viewer. 2002-03-28 Richard Williamson <rjw@apple.com> Modified the initial layout policy. We now try to layout as close as possible to WebKitInitialTimedLayoutDelay seconds after the load was started, not after the provisional-to-committed transition. If the time to the provisional-to-committed transition exceeds WebKitInitialTimedLayoutDelay we layout immediately. * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _startLoading:]), (-[IFWebDataSource _recursiveStopLoading]), (-[IFWebDataSource _loadingStartedTime]): * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _transitionProvisionalToCommitted]), (-[IFWebFrame _initialLayout:]): 2002-03-28 John Sullivan <sullivan@apple.com> * History.subproj/IFWebHistoryPrivate.m: (-[IFWebHistoryPrivate _loadHistoryGuts:]): Made this more robust about bad data from the disk file. I don't know how bad data could get into the disk file in normal use, but it seems to have happened to Richard. 2002-03-27 Richard Williamson <rjw@apple.com> Added initial-layout-after-delay-if-not-layed-out-yet feature. * Misc.subproj/WebKitDebug.h: * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]): * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]), (-[IFPreferences setPluginsEnabled:]), (-[IFPreferences _initialTimedLayoutDelay]), (-[IFPreferences _initialTimedLayoutEnabled]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _transitionProvisionalToCommitted]), (-[IFWebFrame _initialLayout:]), (-[IFWebFrame _state]): 2002-03-27 Kenneth Kocienda <kocienda@apple.com> Changed loadProgress->bytesSoFar to use [sender contentLengthReceived] instead of the size of the chunk that was delivered in the callback. This makes the activity window data more correct than it was. * WebView.subproj/IFMainURLHandleClient.mm: (-[IFMainURLHandleClient IFURLHandle:resourceDataDidBecomeAvailable:]): 2002-03-27 Chris Blumenberg <cblu@apple.com> Now setting the modifier bit for the activate and cursor events. * Plugins.subproj/IFPluginView.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView drawRect:]), (-[IFPluginView windowBecameKey:]), (-[IFPluginView windowResignedKey:]), (-[IFPluginView mouseEntered:]), (-[IFPluginView mouseExited:]): 2002-03-27 Darin Adler <darin@apple.com> * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]): Switch back to serif font, since using Luicida Grande was exposing some font bugs. 2002-03-26 Maciej Stachowiak <mjs@apple.com> * WebKit.pbproj/project.pbxproj: Fixed to build with standalone libJavaScriptCore.dylib. 2002-03-26 Kenneth Kocienda <kocienda@apple.com> Changes to help the transition to the new build system which unifies our development build setting with the settings we use to ship releases. * Makefile.am: * WebKit.pbproj/kocienda.pbxuser: * WebKit.pbproj/project.pbxproj: 2002-03-26 Richard Williamson <rjw@apple.com> Try to ensure that display needed bits are correctly set. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): 2002-03-26 Darin Adler <darin@apple.com> * Misc.subproj/IFError.m: (+[IFError initialize]): Fix a typo where we said "unvailable". * WebView.subproj/IFPreferences.mm: (+[IFPreferences load]): Change the default sans-serif font to "Lucida Grande" to match the OS X system font, and also make that the defalt standard font. 2002-03-26 John Sullivan <sullivan@apple.com> * WebKit.pbproj/project.pbxproj: Marked IFProgress.h Public. 2002-03-25 John Sullivan <sullivan@apple.com> Broke IFLoadProgress out into its own file, and added an init method and getters, without which this class is useless in Objective-C files (but strangely usable in Objective-C++ files, see radar 2887253). * WebView.subproj/IFWebController.h: * WebView.subproj/IFBaseWebController.mm: Took IFLoadProgress declaration and implementation out of here. * WebView.subproj/IFLoadProgress.h, * WebView.subproj/IFLoadProgress.mm: Moved IFLoadProgress declaration and implementation to here; added -[IFLoadProgress initWithBytesSoFar:totalToLoad:type:] and getters for each field. * WebKit.pbproj/project.pbxproj: Updated for new files 2002-03-25 Richard Williamson <rjw@apple.com> Tweaks to force layout of frames and iframes. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]): 2002-03-25 Maciej Stachowiak <mjs@apple.com> * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _startLoading:]): Just create an IFURLHandle, since it now creates the proper concrete subclass automagically. 2002-03-25 Chris Blumenberg <cblu@apple.com> * MIME.subproj/IFMIMEDatabase.m: (+[IFMIMEDatabase sharedMIMEDatabase]), (-[IFMIMEDatabase MIMEHandlerForMIMEType:]), (setMimeHandlers): * MIME.subproj/IFMIMEHandler.h: * MIME.subproj/IFMIMEHandler.m: (-[IFMIMEHandler initWithMIMEType:handlerType:handlerName:]), (-[IFMIMEHandler MIMEType]), (-[IFMIMEHandler MIMESupertype]), (-[IFMIMEHandler MIMESubtype]), (-[IFMIMEHandler handlerName]), (-[IFMIMEHandler handlerType]), (-[IFMIMEHandler description]): Initial implementations of the above. 2002-03-25 Richard Williamson <rjw@apple.com> Added private API to allow browser to access the DOM tree. * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView DOM::]), (+[IFWebView _nodeName:DOM::]), (+[IFWebView _nodeValue:DOM::]), (+[IFWebView _nodeHTML:DOM::]): 2002-03-25 Richard Williamson <rjw@apple.com> Added private API to allow browser to access the render tree. * WebView.subproj/IFWebViewPrivate.mm: 2002-03-24 Richard Williamson <rjw@apple.com> Changed data source to create IFURLHandle of the appropriate class. The prevented us from getting the response headers correctly. * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _startLoading:]): 2002-03-24 Richard Williamson <rjw@apple.com> Removed erroneous comments. * WebView.subproj/IFWebView.mm: (-[IFWebView dataSourceChanged:]), (-[IFWebView reapplyStyles]): 2002-03-22 Chris Blumenberg <cblu@apple.com> * MIME.subproj/IFMIMEDatabase.h: Added a list of mime type that WebKit will be capable of handling 2002-03-22 Chris Blumenberg <cblu@apple.com> * WebKit.pbproj/project.pbxproj: Added the MIME clases to WebKit. 2002-03-22 John Sullivan <sullivan@apple.com> * WebView.subproj/IFWebView.mm: (-[IFWebView reapplyStyles]): Removed stale FIXME. 2002-03-22 Richard Williamson <rjw@apple.com> Fixed reapplyStyles to use new KDE3 recalcStyle function. * WebView.subproj/IFWebView.mm: (-[IFWebView reapplyStyles]) 2002-03-21 John Sullivan <sullivan@apple.com> * WebView.subproj/IFWebView.mm: (-[IFWebView reapplyStyles]): Commented out call to applyChanges that no longer exists. This was breaking the build. Live font changes are temporarily broken again. 2002-03-21 Richard Williamson <rjw@apple.com> Added setNeedsToApplyStyles: and reapplyStyles. This is for dynamic preferences refresh support. * WebView.subproj/IFWebView.h: * WebView.subproj/IFWebView.mm: (-[IFWebView reapplyStyles]), (-[IFWebView layout]), (-[IFWebView setNeedsToApplyStyles:]), (-[IFWebView drawRect:]): * WebView.subproj/IFWebViewPrivate.h: 2002-03-21 John Sullivan <sullivan@apple.com> Cleaned up defaults registration and use. The class IFPreferences now registers the defaults at load time, early enough that Alexander doesn't have to register them separately as it had been. Also, all the defaults currently in use now have accessor cover methods, which Alexander will use exclusively. * WebView.subproj/IFPreferences.mm: New file, registers defaults and implements cover methods. * WebView.subproj/IFPreferences.h: This file existed but wasn't being used (contents #ifdeffed out). Now it declares the cover methods, but still has an #ifdeffed section for possible future stuff. * WebKit.pbproj/project.pbxproj: Updated for new file. * WebView.subproj/IFWebDataSource.mm: (+[IFWebDataSource initialize]): removed defaults-registration from here. 2002-03-20 Maciej Stachowiak <mjs@apple.com> Merged the following changes from LABYRINTH_KDE_3_MERGE branch: 2002-03-20 Maciej Stachowiak <mjs@apple.com> Merged accumlated changes from HEAD, up to MERGED_TO_KDE_3_MERGE_BRANCH tag. 2002-03-19 Maciej Stachowiak <mjs@apple.com> * WebView.subproj/IFWebView.mm: (-[IFWebView layout]): layout() no longer takes an argument. 2002-03-20 John Sullivan <sullivan@apple.com> Added displayTitle field to IFURIEntry. This is intended to hold the string used in menu items, window titles, etc. Alexander uses this to cache the center-truncated title for pages with very long titles. * History.subproj/IFURIEntry.h: * History.subproj/IFURIEntry.m: (-[IFURIEntry setDisplayTitle:]), (-[IFURIEntry dictionaryRepresentation]), (-[IFURIEntry initFromDictionaryRepresentation:]): 2002-03-19 Richard Williamson <rjw@apple.com> Fixed IFWebView leak. * WebView.subproj/IFWebView.mm: (-[IFWebView provisionalDataSourceChanged:]): 2002-03-18 John Sullivan <sullivan@apple.com> Imposed age limit on history items saved to/loaded from disk. Sped up history loading by reversing list before processing entries. * History.subproj/IFWebHistoryPrivate.m: (+[IFWebHistoryPrivate initialize]): Register default for age limit. (-[IFWebHistoryPrivate _ageLimitDate]): New convenience method, returns a date older than any history entry that should be stored/loaded. (-[IFWebHistoryPrivate arrayRepresentation]): skip too-old dates. (-[IFWebHistoryPrivate _loadHistoryGuts:]), (-[IFWebHistoryPrivate _saveHistoryGuts:]): Broke into separate methods to make timing wrapper less messy. Respect age limit. Report number of items saved/loaded in timing message. (-[IFWebHistoryPrivate loadHistory]), (-[IFWebHistoryPrivate saveHistory]): use broken-out _guts methods. * WebKit.pbproj/project.pbxproj: version wars 2002-03-16 Richard Williamson <rjw@apple.com> Fixed scroll bar flash. Add provisional view to go along with provisional widget. * WebView.subproj/IFWebView.mm: (-[IFWebView provisionalDataSourceChanged:]), (-[IFWebView dataSourceChanged:]): 2002-03-16 Richard Williamson <rjw@apple.com> Fixed error handling. Fixed most frame loading problems. Cleaned up frame state machine. Moved IFMainURLHandleClient from WebCore. * Misc.subproj/IFError.m: (-[IFError description]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController receivedError:forResource:partialProgress:fromDataSource:]), (-[IFBaseWebController locationChangeDone:forFrame:]): * WebView.subproj/IFBaseWebControllerPrivate.h: * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebController _receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController _mainReceivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController _receivedError:forResource:partialProgress:fromDataSource:]), (-[IFBaseWebController _mainReceivedError:forResource:partialProgress:fromDataSource:]): * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource startLoading:]), (-[IFWebDataSource isLoading]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate init]), (-[IFWebDataSourcePrivate dealloc]), (-[IFWebDataSource _setPrimaryLoadComplete:]), (-[IFWebDataSource _startLoading:]), (-[IFWebDataSource _stopLoading]): * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame setProvisionalDataSource:]), (-[IFWebFrame startLoading]), (-[IFWebFrame reload:]), (-[IFWebFrame errors]), (-[IFWebFrame mainDocumentError]): * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFramePrivate dealloc]), (-[IFWebFrame _transitionProvisionalToCommitted]), (-[IFWebFrame _setState:]), (-[IFWebFrame _addError:forResource:]), (-[IFWebFrame _isLoadComplete]), (+[IFWebFrame _recursiveCheckCompleteFromFrame:]), (-[IFWebFrame _checkLoadCompleteResource:error:isMainDocument:]), (-[IFWebFrame _setMainDocumentError:]), (-[IFWebFrame _clearErrors]): * WebView.subproj/IFWebView.mm: * WebView.subproj/IFMainURLHandleClient.h: added * WebView.subproj/IFMainURLHandleClient.mm: added 2002-03-15 John Sullivan <sullivan@apple.com> Impose default-based limit (1000 by default) on number of history items saved/loaded. Also instrumented timing for saving/loading history. * History.subproj/IFWebHistoryPrivate.m: (+[IFWebHistoryPrivate initialize]): register default for WebKitHistoryItemLimit. (-[IFWebHistoryPrivate arrayRepresentation]): respect limit (-[IFWebHistoryPrivate loadHistory]): respect limit, time the load. (-[IFWebHistoryPrivate saveHistory]): time the save. * WebKit.pbproj/project.pbxproj: version wars 2002-03-15 John Sullivan <sullivan@apple.com> Fixed bug where history entry images weren't showing up, except by historical accident in some cases. Made IFWebHistory no longer be a singleton class; made the file location be passed in at init time. * History.subproj/IFURIEntry.m: (-[IFURIEntry image]): Get the default image a way that works with frameworks; only get the default image once. * History.subproj/IFWebHistory.h: * History.subproj/IFWebHistory.m: (+[IFWebHistory webHistoryWithFile:]): New convenience constructor that returns a new IFWebHistory object with a particular disk file. (-[IFWebHistory initWithFile:]): New init method for specifying a disk file. (-[IFWebHistory file]): New accessor for file path. (-[IFWebHistory loadHistory]), (-[IFWebHistory saveHistory]): Use file accessor. Also removed the methods that were computing a file path to use. * History.subproj/IFWebHistoryPrivate.h: * History.subproj/IFWebHistoryPrivate.m: (-[IFWebHistoryPrivate initWithFile:]), (-[IFWebHistoryPrivate dealloc]), (-[IFWebHistoryPrivate file]), (-[IFWebHistoryPrivate loadHistory]), (-[IFWebHistoryPrivate saveHistory]): Guts of implementation for file-manipulation stuff. * Resources/url_icon.tiff: ran tiffUtil to premultiply the alpha channel. This was spewing error messages that I didn't notice before because they only happen on Puma and I was on Jaguar. * WebKit.pbproj/project.pbxproj: not sure what change I made, maybe version wars. 2002-03-14 John Sullivan <sullivan@apple.com> Made history store its data in ~/Library/Application Support/<app name>/History.plist * History.subproj/IFWebHistoryPrivate.m: (GetRefPath), (FindFolderPath): Functions copied from NSSavePanel.m for using FindFolder in a POSIX sort of way. Ken plans to put some version of this in IFNSFileManagerExtensions eventually, which I'll switch to later. (-[IFWebHistoryPrivate historyFilePath]): Construct the path using FindFolderPath and the file name. (-[IFWebHistoryPrivate loadHistory]), (-[IFWebHistoryPrivate saveHistory]): failure case debug messages are now more specific. 2002-03-13 Richard Williamson <rjw@apple.com> Added support to stop plugins in removeFromSuperview. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _checkLoadComplete:]): * WebView.subproj/IFWebView.mm: (-[IFWebView dealloc]), (-[IFWebView removeFromSuperview]), (-[IFWebView removeFromSuperviewWithoutNeedingDisplay]): 2002-03-13 Richard Williamson <rjw@apple.com> Fixed open window w/ no open windows crasher. * ChangeLog: * WebView.subproj/IFBaseWebController.mm: (-[IFObjectHolder dealloc]): * WebView.subproj/IFWebView.mm: (-[IFWebView dealloc]), (-[IFWebView layout]): 2002-03-13 Richard Williamson <rjw@apple.com> * ChangeLog: * WebView.subproj/IFBaseWebController.mm: (-[IFObjectHolder dealloc]): * WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]), (-[IFWebView dealloc]), (-[IFWebView provisionalDataSourceChanged:]), (-[IFWebView dataSourceChanged:]), (-[IFWebView layout]), (-[IFWebView isOpaque]), (-[IFWebView setNeedsDisplay:]), (-[IFWebView setNeedsLayout:]), (-[IFWebView drawRect:]), (-[IFWebView setFrame:]), (-[IFWebView windowResized:]), (-[IFWebView mouseDragged:]): 2002-03-12 Richard Williamson <rjw@apple.com> * WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]), (-[IFWebView provisionalDataSourceChanged:]), (-[IFWebView dataSourceChanged:]), (-[IFWebView layout]), (-[IFWebView isOpaque]), (-[IFWebView setNeedsDisplay:]), (-[IFWebView setNeedsLayout:]), (-[IFWebView drawRect:]), (-[IFWebView setFrame:]), (-[IFWebView windowResized:]), (-[IFWebView mouseDragged:]): 2002-03-12 John Sullivan <sullivan@apple.com> Added support for persistent history. Following in the grand footsteps of Ken, it currently stores data in /tmp/alexander.history * Resources/url_icon.tiff: default IFURIEntry image, moved here from WebBrowser. * WebKit.pbproj/project.pbxproj: Updated to add image file. * History.subproj/IFURIEntry.m: (-[IFURIEntry image]): If there's no explicit image, return the default one. (-[IFURIEntry dictionaryRepresentation]): return a representation suitable for saving to an xml file. (-[IFURIEntry initFromDictionaryRepresentation:]): init given the representation returned from dictionaryRepresentation. * History.subproj/IFWebHistory.h: * History.subproj/IFWebHistory.m: (-[IFWebHistory saveHistory]): Added saveHistory call. * History.subproj/IFWebHistoryPrivate.h: added saveHistory call. * History.subproj/IFWebHistoryPrivate.m: (-[IFWebHistoryPrivate arrayRepresentation]): return a representation suitable for saving to an xml file. (-[IFWebHistoryPrivate historyFilePath]): return location of history on disk. (-[IFWebHistoryPrivate loadHistory]): read history from disk. (-[IFWebHistoryPrivate saveHistory]): write history to disk. (-[IFWebHistoryPrivate init]): call loadHistory (-[IFWebHistoryPrivate removeEntryForURLString:]): changed NSLog to WEBKITDEBUG 2002-03-11 Richard Williamson <rjw@apple.com> Fixed call back ordering problems when an error occurs. More twiddling with scroll bars. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController createFrameNamed:for:inParent:]): * WebView.subproj/IFDynamicScrollBarsView.h: * WebView.subproj/IFDynamicScrollBarsView.m: (-[IFDynamicScrollBarsView reflectScrolledClipView:]): * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame startLoading]), (-[IFWebFrame reload:]), (-[IFWebFrame reset]), (-[IFWebFrame lastError]): * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFramePrivate dealloc]), (-[IFWebFrame _checkLoadComplete:]), (-[IFWebFrame _setLastError:]): 2002-03-08 Richard Williamson <rjw@apple.com> Fixed scroll bar recursion problems. Took a long time to find a stupid typo bug in [IFBaseWebController _frameForDataSource:fromFrame:] that overwrote an input parameter that should been a local variable. This caused a crash the second time a page that contained an iframe was loaded. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController createFrameNamed:for:inParent:]), (-[IFBaseWebController _frameForDataSource:fromFrame:]): * WebView.subproj/IFDynamicScrollBarsView.m: (-[IFDynamicScrollBarsView reflectScrolledClipView:]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _checkLoadComplete:]): * WebView.subproj/IFWebView.mm: (-[IFWebView layout]): * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _setFrameScrollView:]), (-[IFWebView _frameScrollView]), (-[IFWebView _setupScrollers]): 2002-03-07 John Sullivan <sullivan@apple.com> * Misc.subproj/IFError.m: (-[IFError errorDescription]): Removed a line of debugging spam. Oops! 2002-03-07 Richard Williamson <rjw@apple.com> Fixed occasional scroll bar problem in iframes. Fixed occasional problem removing scroll bar on main page. * WebView.subproj/IFDynamicScrollBarsView.m: (-[IFDynamicScrollBarsView reflectScrolledClipView:]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _checkLoadComplete:]): * WebView.subproj/IFWebView.mm: (-[IFWebView drawRect:]): 2002-03-07 John Sullivan <sullivan@apple.com> First pass at adding error strings to IFError. They are properly localized, but they don't include any parameters, and the strings haven't been made user-friendly. * Misc.subproj/IFError.m: (+[IFError initialize]): New method, set up a dictionary mapping error code to localized error string. (-[IFError errorDescription]): Read string from dictionary. * English.lproj/IFError.strings: New file, auto-generated by the genstrings tool. * WebKit.pbproj/project.pbxproj: Removed stray -F /symroots. This shouldn't have been in there since symroots location is no longer hardwired. 2002-03-07 John Sullivan <sullivan@apple.com> Defined more symbolic debug-level constants; specified ranges for use by different software levels (core/kit/client==browser) to enable easier isolation of debug messages. * Misc.subproj/WebKitDebug.h: #defined new debug levels for existing uses; renamed a couple. * Misc.subproj/WebKitDebug.m: (WebKitLog), (WebKitDebug): Updated for renamed debug levels. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController receivedProgress:forResource:fromDataSource:]): * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _stopLoading]): * WebView.subproj/IFWebView.mm: (-[IFWebView layout]), (-[IFWebView setNeedsDisplay:]), (-[IFWebView setNeedsLayout:]), (-[IFWebView drawRect:]), (-[IFWebView mouseDragged:]): * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _resetView]): Changed numeric debug levels to symbolic ones. * WebKit.pbproj/project.pbxproj: Jaguar/Puma version war. 2002-03-06 Richard Williamson <rjw@apple.com> Lots of little changes to improve drawing, and dynamic scroll bar layout. We now have NO flash between pages, however, I still need to add a transition timeout. As currently implemented the page will not transition until the document is read. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController locationChangeDone:forFrame:]): * WebView.subproj/IFDynamicScrollBarsView.m: (-[IFDynamicScrollBarsView reflectScrolledClipView:]): * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _transitionProvisionalToCommitted]), (-[IFWebFrame _checkLoadComplete:]): * WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]), (-[IFWebView dataSourceChanged:]), (-[IFWebView layout]), (-[IFWebView isOpaque]), (-[IFWebView setNeedsDisplay:]), (-[IFWebView setNeedsLayout:]), (-[IFWebView drawRect:]), (-[IFWebView setFrame:]): * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _stopPlugins]), (-[IFWebView _removeSubviews]): 2002-03-06 John Sullivan <sullivan@apple.com> * Misc.subproj/IFError.h: Removed stray but evil import. 2002-03-06 Maciej Stachowiak <mjs@apple.com> * WebKit.pbproj/project.pbxproj: Turn on -Werror. 2002-03-05 Richard Williamson <rjw@apple.com> Streamlined layout and drawing. We now do the minimum amount of drawing and layout. * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _checkLoadComplete:]): * WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]), (-[IFWebView layout]), (-[IFWebView setNeedsDisplay:]), (-[IFWebView setNeedsLayout:]), (-[IFWebView drawRect:]), (-[IFWebView setFrame:]), (-[IFWebView windowResized:]): 2002-03-05 John Sullivan <sullivan@apple.com> * WebView.subproj/IFWebDataSource.mm: (+[IFWebDataSource initialize]): Tweak default font sizes so they match what algorithm used in Alexander returns. 2002-03-05 Richard Williamson <rjw@apple.com> Pass errors correctly to browser. Removed old notification code. Added support for IFError. Lots of little cleanups. Improved IFWebFrame state handling. * Misc.subproj/IFError.h: * Misc.subproj/IFError.m: (IFErrorMake), (+[IFError load]), (-[IFError initWithErrorCode:]), (-[IFError errorCode]), (-[IFError errorDescription]): * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController receivedError:forResource:partialProgress:fromDataSource:]): * WebView.subproj/IFBaseWebControllerPrivate.h: * WebView.subproj/IFBaseWebControllerPrivate.mm: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource isLoading]): * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _startLoading:initiatedByUserEvent:]): * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame initWithName:view:provisionalDataSource:controller:]), (-[IFWebFrame setProvisionalDataSource:]): * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _transitionProvisionalToCommitted]), (-[IFWebFrame _state]), (-[IFWebFrame _setState:]), (-[IFWebFrame _checkLoadComplete:]): 2002-03-05 John Sullivan <sullivan@apple.com> * WebView.subproj/IFWebDataSource.mm: (+[IFWebDataSource initialize]): Changed default font sizes to match scheme used in Alexander. There are some serious wackinesses with KDE engine font size handling; if and when we address those we might revisit these default sizes. 2002-03-05 Maciej Stachowiak <mjs@apple.com> Removed references to IFAuthenticationHandler, since that protocol now lives in WebFoundation and it's no longer quite appropriate to include as part of a controller. * WebView.subproj/IFBaseWebController.mm: * WebView.subproj/IFWebController.h: 2002-03-04 Richard Williamson <rjw@apple.com> Changes to support 'provisional' data sources. API changes to IFBaseWebController, removed redundant methods. * Misc.subproj/WebKitDebug.h: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView getURLNotify:target:notifyData:]): * WebView.subproj/IFBaseWebController.h: * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController init]), (-[IFBaseWebController initWithView:provisionalDataSource:]), (-[IFBaseWebController createFrameNamed:for:inParent:]), (-[IFBaseWebController receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController receivedError:forResource:partialProgress:fromDataSource:]), (-[IFBaseWebController locationChangeCommittedForFrame:]), (-[IFBaseWebController _frameForDataSource:fromFrame:]), (-[IFBaseWebController mainFrame]): * WebView.subproj/IFBaseWebControllerPrivate.h: * WebView.subproj/IFBaseWebControllerPrivate.mm: * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebDataSource.mm: (IFWebDataSourceMake), (+[IFWebDataSource load]): * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _startLoading:initiatedByUserEvent:]): * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame init]), (-[IFWebFrame initWithName:view:provisionalDataSource:controller:]), (-[IFWebFrame setProvisionalDataSource:]), (-[IFWebFrame startLoading]), (-[IFWebFrame stopLoading]), (-[IFWebFrame reload:]): * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _setDataSource:]), (-[IFWebFrame _transitionProvisionalToCommitted]): * WebView.subproj/IFWebView.h: * WebView.subproj/IFWebView.mm: (-[IFWebView provisionalDataSourceChanged:]), (-[IFWebView dataSourceChanged:]): * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _provisionalWidget]): 2002-03-04 John Sullivan <sullivan@apple.com> Changed default fonts. * WebView.subproj/IFWebDataSource.mm: (+[IFWebDataSource initialize]): Changed default fonts to ones that actually exist (this was listing "Times-Roman" where it meant either "Times" or "Times New Roman"). I'm about to check in working font preferences, so it won't matter too much if you don't like the defaults (although we should of course make sure that the defaults are sensible, which I think they are). 2002-03-04 John Sullivan <sullivan@apple.com> * WebView.subproj/IFWebDataSource.mm: (+[IFWebDataSource initialize]): Reverted default fonts to what they were before I accidentally checked in some debugging changes. 2002-03-01 Richard Williamson <rjw@apple.com> Fixed a potentially large leak in frames. View associated w/ frame was not being released. Added scaffolding for correct frame by frame load complete check. Moved private IFWebBaseController method implementations to IFWebBaseControllerPrivate.mm. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController createFrameNamed:for:inParent:]), (-[IFBaseWebController receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController receivedError:forResource:partialProgress:fromDataSource:]): * WebView.subproj/IFBaseWebControllerPrivate.h: * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebControllerPrivate dealloc]), (-[IFBaseWebController _changeLocationTo:forFrame:parent:]), (-[IFBaseWebController _changeFrame:dataSource:]), (-[IFBaseWebController _checkLoadCompleteForDataSource:]): * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate init]): * WebView.subproj/IFWebView.mm: (-[IFWebView dataSourceChanged:]): 2002-02-27 Kenneth Kocienda <kocienda@apple.com> I have changed the way that WebCore is glued to WebFoundation and WebKit. If you used or relied upon any code in the following files, you should now use the IF* equivalents straight up. - Labyrinth/WebCore/include/WCBackForwardList.h - Labyrinth/WebCore/include/WCURICache.h - Labyrinth/WebCore/include/WCURICacheData.h - Labyrinth/WebCore/include/WCURIEntry.h - Labyrinth/WebCore/include/WCURIEntry.h All changes in this commit are related to making dependant code work with the new convention. * History.subproj/IFURIEntry.h: * History.subproj/IFURIEntry.m: * Plugins.subproj/IFPluginView.mm: (-[IFPluginView newStream:mimeType:notifyData:]), (-[IFPluginView IFURLHandle:resourceDataDidBecomeAvailable:]), (-[IFPluginView IFURLHandleResourceDidFinishLoading:data:]), (-[IFPluginView IFURLHandleResourceDidBeginLoading:]), (-[IFPluginView IFURLHandleResourceDidCancelLoading:]), (-[IFPluginView IFURLHandle:resourceDidFailLoadingWithResult:]): * WebKit.pbproj/kocienda.pbxuser: * WebKit.pbproj/project.pbxproj: 2002-02-26 John Sullivan <sullivan@apple.com> * History.subproj/IFURIEntry.m: (-[IFURIEntry dealloc]): Added missing dealloc method that 'leaks' found. * History.subproj/IFURIList.m: (-[IFURIList dealloc]): Added missing [super dealloc] call that 'leaks' found. 2002-02-22 Maciej Stachowiak <mjs@apple.com> Fix prebinding: * WebKit.pbproj/project.pbxproj: Set first segment address 0x4000000 to avoid colliding with apps or our other frameworks. Set up some hacks to avoid link-time dependency on WebKit. Prebinding is incompatible with - undefined suppress, so we can't have WebCore depend on symbols provided by WebKit any more: * Plugins.subproj/IFPluginView.mm: (IFPluginMake), (+[IFPluginView load]), (startupVolumeName): * WebView.subproj/IFBaseWebController.mm: (IFLoadProgressMake), (+[IFLoadProgress load]): 2002-02-22 John Sullivan <sullivan@apple.com> Updated for modified NSCalendarDate extensions API. * History.subproj/IFWebHistoryPrivate.m: (-[IFWebHistoryPrivate findIndex:forDay:]): use compareDate: instead of daysSinceDate:, which no longer exists. 2002-02-22 Richard Williamson <rjw@apple.com> Added data: to IFURLHandleResourceDidFinishLoading: * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource isLoading]): 2002-02-22 Richard Williamson <rjw@apple.com> Implemented missing getter for provisionalDataSource. * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame provisionalDataSource]): * WebView.subproj/IFWebFramePrivate.h: 2002-02-22 Richard Williamson <rjw@apple.com> Normalized code paths for setMainDataSource on controller and setDataSource on frame. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController setMainView:andMainDataSource:]), (-[IFBaseWebController createFrameNamed:for:inParent:]), (-[IFBaseWebController _changeFrame:dataSource:]): * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _setController:]): * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame init]), (-[IFWebFrame initWithName:view:dataSource:controller:]), (-[IFWebFrame setView:]), (-[IFWebFrame controller]), (-[IFWebFrame setController:]), (-[IFWebFrame setDataSource:]), (-[IFWebFrame reset]): * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFramePrivate setController:]), (-[IFWebFrame _setRenderFramePart:]), (-[IFWebFrame _renderFramePart]), (-[IFWebFrame _setDataSource:]): 2002-02-21 Richard Williamson <rjw@apple.com> Stop mostly working. * WebView.subproj/IFBaseWebController.h: * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController _frameForDataSource:fromFrame:]), (-[IFBaseWebController frameForDataSource:]): * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource frame]), (-[IFWebDataSource frameName]), (-[IFWebDataSource stopLoading]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]), (-[IFWebDataSource _addURLHandle:]), (-[IFWebDataSource _removeURLHandle:]), (-[IFWebDataSource _stopLoading]), (-[IFWebDataSource _recursiveStopLoadingfromDataSource:]): * WebView.subproj/IFWebFrame.mm: (-[IFWebFrame setDataSource:]): 2002-02-20 Richard Williamson <rjw@apple.com> Some groundwork to bring WebFoundation callbacks up to WebKit. * WebView.subproj/IFBaseWebController.mm: (-[IFLoadProgress init]), (-[IFBaseWebController receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController receivedError:forResource:partialProgress:fromDataSource:]), (-[IFBaseWebController _changeFrame:dataSource:]): * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource stopLoading]): * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFramePrivate.h: * WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFramePrivate setProvisionalDataSource:]): 2002-02-20 Maciej Stachowiak <mjs@apple.com> * WebView.subproj/IFWebController.h: Fix my WebController screw-up. 2002-02-19 John Sullivan <sullivan@apple.com> Finished first cut at IFWebHistory implementation. All methods are implemented except the string-matching ones. * History.subproj/IFURIEntry.h: * History.subproj/IFURIEntry.m: (-[IFURIEntry initWithURL:title:image:comment:]), (-[IFURIEntry lastVisitedDate]), (-[IFURIEntry setModificationDate:]), (-[IFURIEntry setLastVisitedDate:]): Changed all NSDates to be NSCalendarDates. * History.subproj/IFWebHistory.h: * History.subproj/IFWebHistory.m: (-[IFWebHistory init]), (-[IFWebHistory dealloc]), (-[IFWebHistory sendEntriesChangedNotification]), (-[IFWebHistory addEntry:]), (-[IFWebHistory removeEntry:]), (-[IFWebHistory removeEntriesForDay:]), (-[IFWebHistory removeAllEntries]), (-[IFWebHistory orderedLastVisitedDays]), (-[IFWebHistory orderedEntriesLastVisitedOnDay:]), (-[IFWebHistory entriesWithAddressContainingString:]), (-[IFWebHistory entriesWithTitleOrAddressContainingString:]), (-[IFWebHistory containsURL:]): Implemented all IFWebHistory methods by calling through to IFWebHistoryPrivate object. Send a change notification each time the actual data changes. Removed all canned-data mechanisms. * History.subproj/IFWebHistoryPrivate.h: * History.subproj/IFWebHistoryPrivate.m: (-[IFWebHistoryPrivate init]), (-[IFWebHistoryPrivate dealloc]), (-[IFWebHistoryPrivate findIndex:forDay:]), (-[IFWebHistoryPrivate insertEntry:atDateIndex:]), (-[IFWebHistoryPrivate removeEntryForURLString:]), (-[IFWebHistoryPrivate addEntry:]), (-[IFWebHistoryPrivate removeEntry:]), (-[IFWebHistoryPrivate removeEntriesForDay:]), (-[IFWebHistoryPrivate removeAllEntries]), (-[IFWebHistoryPrivate orderedLastVisitedDays]), (-[IFWebHistoryPrivate orderedEntriesLastVisitedOnDay:]), (-[IFWebHistoryPrivate entriesWithAddressContainingString:]), (-[IFWebHistoryPrivate entriesWithTitleOrAddressContainingString:]), (-[IFWebHistoryPrivate containsURL:]): Implemented guts of history mechanism using a dictionary for URL lookup and a sorted array of dates with entries and a sorted array of sorted arrays of entries per date. * WebKit.pbproj/project.pbxproj: Updated for new files 2002-02-18 John Sullivan <sullivan@apple.com> First piece of implementing IFWebHistory. None of the mutators do anything, and the accessors return canned data. But at least all the temporary hackery is hiding behind legitimate API. * History.subproj/IFWebHistory.h: * History.subproj/IFWebHistory.m: (+[IFWebHistory sharedWebHistory]): Implemented sensibly. (-[IFWebHistory createTestEntryWithURLString:title:date:]), (-[IFWebHistory testDataDates]), (-[IFWebHistory testData]), Private temporary hackery to return fake data. (-[IFWebHistory orderedLastVisitedDays]), (-[IFWebHistory orderedEntriesLastVisitedOnDay:]): Implemented using temporary hackery. (-[IFWebHistory addEntry:]), (-[IFWebHistory removeEntry:]), (-[IFWebHistory removeAllEntries]): Unimplemented mutator methods. (-[IFWebHistory entriesWithAddressContainingString:]), (-[IFWebHistory entriesWithTitleOrAddressContainingString:]), (-[IFWebHistory containsURL:]): Methods that we'll need eventually, currently unimplemented. We may flesh out the API a little more before we actually implement any of these. (-[NSCalendarDate daysSinceDate:]): Convenience method in category; will probably move to another file soon. * WebKit.pbproj/project.pbxproj: Updated for new files 2002-02-18 Kenneth Kocienda <kocienda@apple.com> Fixed breakge that came up when project file merged. * WebKit.pbproj/project.pbxproj: 2002-02-18 Kenneth Kocienda <kocienda@apple.com> Changes to support building standalone Alexander with Frameworks and libraries contained inside the app package. * Makefile.am: * WebKit.pbproj/kocienda.pbxuser: * WebKit.pbproj/project.pbxproj: 2002-02-18 Richard Williamson <rjw@apple.com> Performance measurement. * WebView.subproj/IFWebView.mm: (-[IFWebView layout]), (-[IFWebView drawRect:]): 2002-02-16 Richard Williamson <rjw@apple.com> * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource controller]): 2002-02-16 Richard Williamson <rjw@apple.com> Reminders to change frame<->datasource ownership cycle. * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource setFrame:]), (-[IFWebDataSource frame]): 2002-02-13 Richard Williamson <rjw@apple.com> Fixed cleanup. Should revisit ownership graph. Cycles may be avoidable. * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebControllerPrivate dealloc]): * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource setFrame:]): * WebView.subproj/IFWebFrame.m: (-[IFWebFrame reset]): * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _resetWidget]): 2002-02-12 Richard Williamson <rjw@apple.com> Made basic forms work. * WebView.subproj/IFBaseWebController.mm: * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebDataSource.mm: (+[IFWebDataSource initialize]), (-[IFWebDataSource startLoading:]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _startLoading:initiatedByUserEvent:]): 2002-02-11 John Sullivan <sullivan@apple.com> Fixed bug where clicking on empty browser page would crash. This could happen when the start page was empty, or failed to load. * WebView.subproj/IFWebView.mm: (-[IFWebView mouseUp:]), (-[IFWebView mouseDown:]): Checked for nil widget before dispatching mouse events. 2002-02-08 John Sullivan <sullivan@apple.com> Changed back & forward to goBack and goForward and made them not return a value (so signatures match those in WebBrowser). Added backEntry and forwardEntry that don't alter the list. These will be needed to ask to go to the URL at the back position without altering the back list until the change is committed. * History.subproj/IFBackForwardList.h: * History.subproj/IFBackForwardList.m: (-[IFBackForwardList goBack]), (-[IFBackForwardList backEntry]), (-[IFBackForwardList currentEntry]), (-[IFBackForwardList forwardEntry]), (-[IFBackForwardList goForward]): 2002-02-07 Richard Williamson <rjw@apple.com> More changes to IFLocationChangeHandler API. * WebView.subproj/IFBaseWebController.mm: * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource startLoading:]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _startLoading:initiatedByMouseEvent:]): * WebView.subproj/IFWebFramePrivate.h: 2002-02-07 Richard Williamson <rjw@apple.com> Update IFLocationChangeHandler API. Added factored code for URL loading. * ChangeLog: * WebView.subproj/IFBaseWebController.h: * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController setMainView:andMainDataSource:]), (-[IFBaseWebController _changeLocationTo:forFrame:parent:]), (-[IFBaseWebController _changeFrame:dataSource:]), (-[IFBaseWebController locationChangeCommittedForFrame:]): * WebView.subproj/IFBaseWebControllerPrivate.h: * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource startLoading:]): * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.m: (-[IFWebFrame reset]): 2002-02-06 Richard Williamson <rjw@apple.com> Fixed allocation problems. Implemented parent->child management for datasource correctly. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController changeLocationTo:forFrame:]): * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource addFrame:]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSource _setController:]), (-[IFWebDataSource _part]), (-[IFWebDataSource _setParent:]): * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.m: (-[IFWebFrame _setRenderFramePart:]), (-[IFWebFrame _renderFramePart]): * WebView.subproj/IFWebView.mm: (-[IFWebView dataSourceChanged:]): 2002-02-05 Richard Williamson <rjw@apple.com> Updated controller API to reflect frames. * WebView.subproj/IFBaseWebController.h: * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController initWithView:dataSource:]), (-[IFBaseWebController setMainView:andMainDataSource:]), (-[IFBaseWebController createFrameNamed:for:inParent:]), (-[IFBaseWebController mainFrame]), (-[IFBaseWebController mainView]), (-[IFBaseWebController mainDataSource]), (-[IFBaseWebController changeLocationTo:forFrame:]), (-[IFBaseWebController locationChangeStartedForFrame:]), (-[IFBaseWebController locationChangeInProgressForFrame:]), (-[IFBaseWebController locationChangeDone:forFrame:]): * WebView.subproj/IFBaseWebControllerPrivate.h: * WebView.subproj/IFBaseWebControllerPrivate.mm: (-[IFBaseWebControllerPrivate init]), (-[IFBaseWebControllerPrivate dealloc]): * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource initWithURL:]), (-[IFWebDataSource setFrame:]), (-[IFWebDataSource frame]), (-[IFWebDataSource frameName]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]), (-[IFWebDataSource _part]): * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.m: (-[IFWebFrame dealloc]), (-[IFWebFrame dataSource]), (-[IFWebFrame setDataSource:]): * WebView.subproj/IFWebView.h: * WebView.subproj/IFWebView.mm: (-[IFWebView dataSourceChanged:]): 2002-02-05 Maciej Stachowiak <mjs@apple.com> Remove old obsolete cache code from tree and build. * Cache.subproj/NSURICache.h: * Cache.subproj/NSURICache.m: * Cache.subproj/NSURICacheData.h: * Cache.subproj/NSURICacheData.m: * Cache.subproj/NSURILoad.h: * Cache.subproj/NSURILoad.m: * Cache.subproj/NSURILoadReallyPrivate.h: * Cache.subproj/_NSURICacheQueue.h: * Cache.subproj/_NSURICacheQueue.m: * Misc.subproj/WebKitReallyPrivate.h: * Misc.subproj/_NSMonitor.h: * Misc.subproj/_NSMonitor.m: * WebKit.pbproj/project.pbxproj: 2002-02-05 Richard Williamson <rjw@apple.com> Changes to support dynamic scroll bars in frames/iframes. * WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController createFrameNamed:for:inParent:]): * WebView.subproj/IFWebView.mm: (-[IFWebView dataSourceChanged]): * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebView _setFrameScrollView:]): 2002-02-04 Maciej Stachowiak <mjs@apple.com> Rename all classes from WK prefix to IF prefix. * Cache.subproj/IFLoadChunk.h: * Cache.subproj/IFWebCache.h: * Cache.subproj/IFWebCacheClient.h: * Cache.subproj/IFWebContentType.h: * History.subproj/IFAttributedURL.h: * History.subproj/IFBackForwardList.h: * History.subproj/IFBackForwardList.m: (-[IFBackForwardList init]), (-[IFBackForwardList addEntry:]), (-[IFBackForwardList back]), (-[IFBackForwardList currentEntry]), (-[IFBackForwardList forward]), (-[IFBackForwardList description]): * History.subproj/IFURIEntry.h: * History.subproj/IFURIEntry.m: (WCCreateURIEntry), (-[IFURIEntry isEqual:]), (-[IFURIEntry description]): * History.subproj/IFURIList.h: * History.subproj/IFURIList.m: (newURIListNode), (freeNode), (-[IFURIList dealloc]), (-[IFURIList addEntry:]), (-[IFURIList removeURL:]), (-[IFURIList removeEntry:]), (-[IFURIList entryForURL:]), (-[IFURIList entryAtIndex:]), (-[IFURIList removeEntryAtIndex:]), (-[IFURIList removeEntriesToIndex:]): * Misc.subproj/IFException.h: * Misc.subproj/IFException.m: * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFBaseWebController.h: * WebView.subproj/IFBaseWebController.mm: (+[IFObjectHolder holderWithObject:]), (-[IFBaseWebController init]), (-[IFBaseWebController initWithView:dataSource:]), (-[IFBaseWebController setDirectsAllLinksToSystemBrowser:]), (-[IFBaseWebController directsAllLinksToSystemBrowser]), (-[IFBaseWebController setView:andDataSource:]), (-[IFBaseWebController createFrameNamed:for:inParent:]), (-[IFBaseWebController viewForDataSource:]), (-[IFBaseWebController dataSourceForView:]), (-[IFBaseWebController mainView]), (-[IFBaseWebController mainDataSource]), (-[IFBaseWebController setStatusText:forDataSource:]), (-[IFBaseWebController statusTextForDataSource:]), (-[IFBaseWebController authenticate:]), (-[IFBaseWebController receivedProgress:forResource:fromDataSource:]), (-[IFBaseWebController receivedError:forResource:partialProgress:fromDataSource:]), (-[IFBaseWebController locationWillChangeTo:]), (-[IFBaseWebController locationChangeStartedForDataSource:]), (-[IFBaseWebController locationChangeInProgressForDataSource:]), (-[IFBaseWebController locationChangeDone:forDataSource:]), (-[IFBaseWebController receivedPageTitle:forDataSource:]), (-[IFBaseWebController serverRedirectTo:forDataSource:]): * WebView.subproj/IFBaseWebControllerPrivate.h: * WebView.subproj/IFBaseWebControllerPrivate.mm: * WebView.subproj/IFDynamicScrollBarsView.h: * WebView.subproj/IFDynamicScrollBarsView.m: * WebView.subproj/IFGrabBag.h: * WebView.subproj/IFPreferences.h: * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: (-[IFWebDataSource _commonInitialization]), (-[IFWebDataSource initWithURL:]), (-[IFWebDataSource frameName]), (-[IFWebDataSource isMainDocument]), (-[IFWebDataSource parent]), (-[IFWebDataSource children]), (-[IFWebDataSource addFrame:]), (-[IFWebDataSource frameNamed:]), (-[IFWebDataSource frameNames]), (-[IFWebDataSource findDataSourceForFrameNamed:]), (-[IFWebDataSource frameExists:]), (-[IFWebDataSource openURL:inFrameNamed:]), (-[IFWebDataSource openURL:inIFrame:]), (-[IFWebDataSource controller]), (-[IFWebDataSource inputURL]), (-[IFWebDataSource finalURL]), (-[IFWebDataSource wasRedirected]), (-[IFWebDataSource stopLoading]), (-[IFWebDataSource isLoading]), (-[IFWebDataSource base]), (-[IFWebDataSource baseTarget]), (-[IFWebDataSource encoding]), (-[IFWebDataSource setUserStyleSheetFromURL:]), (-[IFWebDataSource setUserStyleSheetFromString:]), (-[IFWebDataSource icon]), (-[IFWebDataSource isPageSecure]), (-[IFWebDataSource pageTitle]): * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: (-[IFWebDataSourcePrivate dealloc]), (-[IFWebDataSource _setController:]), (-[IFWebDataSource _part]), (-[IFWebDataSource _setFrameName:]): * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.m: (-[IFWebFrame initWithName:view:dataSource:]), (-[IFWebFrame dataSource]): * WebView.subproj/IFWebView.h: * WebView.subproj/IFWebView.mm: (-[IFWebView initWithFrame:]), (-[IFWebView controller]), (-[IFWebView dataSourceChanged]), (-[IFWebView layout]), (-[IFWebView stopAnimations]), (-[IFWebView setFontSizes:]), (-[IFWebView fontSizes]), (-[IFWebView resetFontSizes]), (-[IFWebView setStandardFont:]), (-[IFWebView standardFont]), (-[IFWebView setFixedFont:]), (-[IFWebView fixedFont]), (-[IFWebView setCanDragFrom:]), (-[IFWebView setCanDragTo:]), (-[IFWebView defaultContextMenuItemsForNode:]), (-[IFWebView setContextMenusEnabled:]), (-[IFWebView deselectText]), (-[IFWebView searchFor:direction:caseSensitive:]), (-[IFWebView selectedText]), (-[IFWebView setNeedsLayout:]), (-[IFWebView drawRect:]), (-[IFWebView setIsFlipped:]), (-[IFWebView isFlipped]), (-[IFWebView mouseUp:]), (-[IFWebView mouseDown:]): * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: (-[IFWebViewPrivate dealloc]), (-[IFWebView _setController:]), (-[IFWebView _widget]), (-[IFWebView _setFrameScrollView:]), (-[IFWebView _frameScrollView]): 2002-02-04 Maciej Stachowiak <mjs@apple.com> Rename all WK files to IF (classes not renamed yet). * Cache.subproj/IFLoadChunk.h: * Cache.subproj/IFWebCache.h: * Cache.subproj/IFWebCacheClient.h: * Cache.subproj/IFWebContentType.h: * Cache.subproj/WKLoadChunk.h: * Cache.subproj/WKWebCache.h: * Cache.subproj/WKWebCacheClient.h: * Cache.subproj/WKWebContentType.h: * History.subproj/IFAttributedURL.h: * History.subproj/IFBackForwardList.h: * History.subproj/IFBackForwardList.m: * History.subproj/IFURIEntry.h: * History.subproj/IFURIEntry.m: * History.subproj/IFURIList.h: * History.subproj/IFURIList.m: * History.subproj/WKAttributedURL.h: * History.subproj/WKBackForwardList.h: * History.subproj/WKBackForwardList.m: * History.subproj/WKURIEntry.h: * History.subproj/WKURIEntry.m: * History.subproj/WKURIList.h: * History.subproj/WKURIList.m: * Misc.subproj/WKException.h: * Misc.subproj/WKException.m: * WebKit.pbproj/project.pbxproj: * WebView.subproj/IFBaseWebController.h: * WebView.subproj/IFBaseWebController.mm: * WebView.subproj/IFBaseWebControllerPrivate.h: * WebView.subproj/IFBaseWebControllerPrivate.mm: * WebView.subproj/IFDefaultWebController.h: * WebView.subproj/IFDefaultWebController.mm: * WebView.subproj/IFDefaultWebControllerPrivate.h: * WebView.subproj/IFDefaultWebControllerPrivate.mm: * WebView.subproj/IFDynamicScrollBarsView.m: * WebView.subproj/IFGrabBag.h: * WebView.subproj/IFPreferences.h: * WebView.subproj/IFWebController.h: * WebView.subproj/IFWebDataSource.h: * WebView.subproj/IFWebDataSource.mm: * WebView.subproj/IFWebDataSourcePrivate.h: * WebView.subproj/IFWebDataSourcePrivate.mm: * WebView.subproj/IFWebFrame.h: * WebView.subproj/IFWebFrame.m: * WebView.subproj/IFWebView.h: * WebView.subproj/IFWebView.mm: * WebView.subproj/IFWebViewPrivate.h: * WebView.subproj/IFWebViewPrivate.mm: * WebView.subproj/WKDefaultWebController.h: * WebView.subproj/WKDefaultWebController.mm: * WebView.subproj/WKDefaultWebControllerPrivate.h: * WebView.subproj/WKDefaultWebControllerPrivate.mm: * WebView.subproj/WKDynamicScrollBarsView.h: * WebView.subproj/WKDynamicScrollBarsView.m: * WebView.subproj/WKGrabBag.h: * WebView.subproj/WKPreferences.h: * WebView.subproj/WKWebController.h: * WebView.subproj/WKWebDataSource.h: * WebView.subproj/WKWebDataSource.mm: * WebView.subproj/WKWebDataSourcePrivate.h: * WebView.subproj/WKWebDataSourcePrivate.mm: * WebView.subproj/WKWebFrame.h: * WebView.subproj/WKWebFrame.m: * WebView.subproj/WKWebView.h: * WebView.subproj/WKWebView.mm: * WebView.subproj/WKWebViewPrivate.h: * WebView.subproj/WKWebViewPrivate.mm: 2002-02-01 Richard Williamson <rjw@apple.com> Changes for dynamic scrolling frames. Added notification of complete load. * WebView.subproj/WKDefaultWebController.mm: (-[WKDefaultWebController createFrameNamed:for:inParent:]), (-[WKDefaultWebController locationChangeDone:forDataSource:]): * WebView.subproj/WKWebController.h: * WebView.subproj/WKWebView.mm: (-[WKWebView dataSourceChanged]): * WebView.subproj/WKWebViewPrivate.h: * WebView.subproj/WKWebViewPrivate.mm: (-[WKWebViewPrivate dealloc]), (-[WKWebView _widget]), (-[WKWebView _setFrameScrollView:]), (-[WKWebView _frameScrollView]): 2002-02-01 John Sullivan <sullivan@apple.com> Added call to examine the entry at the current index in the back/forward list without modifying the list. I needed this to save context data (in my case, scroll position) on the currently-viewed entry. * History.subproj/WKBackForwardList.h: * History.subproj/WKBackForwardList.m: (-[WKBackForwardList currentEntry]): Just returns the entry at the current index. 2002-01-31 John Sullivan <sullivan@apple.com> * History.subproj/WKURIList.m: (newURIListNode): retain entries before adding them to list. The node-freeing routine was releasing, but the node-adding routine wasn't retaining. Bad asymmetry, made up for by WebViewTest not autoreleasing. I fixed that too. 2002-01-31 John Sullivan <sullivan@apple.com> * WebKit.pbproj: Removed -O0, so it will now get all the same warnings as pbxbuild gets. 2002-01-31 Kenneth Kocienda <kocienda@apple.com> Removed dependency on WC versions of these files * History.subproj/WKBackForwardList.h: * History.subproj/WKBackForwardList.m: * History.subproj/WKURIEntry.h: * History.subproj/WKURIEntry.m: * WebKit.pbproj/project.pbxproj: 2002-01-31 John Sullivan <sullivan@apple.com> * WebKit.pbproj: Marked WKURIList.h as a public header 2002-01-30 Richard Williamson <rjw@apple.com> * WebView.subproj/WKDefaultWebController.mm: (-[WKDefaultWebController createFrameNamed:for:inParent:]): * WebView.subproj/WKWebDataSource.mm: (-[WKWebDataSource documentTextFromDOM]): 2002-01-30 Richard Williamson <rjw@apple.com> Cleaned up API w/ respect to frames. * WebView.subproj/WKDefaultWebController.h: * WebView.subproj/WKDefaultWebController.mm: (-[WKDefaultWebController setView:andDataSource:]), (-[WKDefaultWebController createFrameNamed:for:inParent:]): * WebView.subproj/WKWebController.h: * WebView.subproj/WKWebDataSource.h: 2002-01-30 Kenneth Kocienda <kocienda@apple.com> Added *.lo, *.la, Icon, and .libs to .cvsignore files * .cvsignore: 2002-01-29 Richard Williamson <rjw@apple.com> * ChangeLog: * WebView.subproj/WKDefaultWebController.h: * WebView.subproj/WKDefaultWebController.mm: (-[WKDefaultWebController setView:andDataSource:]), (-[WKDefaultWebController dataSourceForView:]): 2002-01-29 Richard Williamson <rjw@apple.com> * WebView.subproj/WKDefaultWebController.mm: (-[WKDefaultWebController setView:andDataSource:]): 2002-01-29 Richard Williamson <rjw@apple.com> First pass at frame code. Still needs lots of cleanup. * WebKit.pbproj/project.pbxproj: * WebView.subproj/WKDefaultWebController.h: * WebView.subproj/WKDefaultWebController.mm: (-[WKDefaultWebController init]): * WebView.subproj/WKWebDataSource.h: * WebView.subproj/WKWebDataSource.mm: (-[WKWebDataSource dealloc]), (-[WKWebDataSource frameName]), (-[WKWebDataSource parent]), (-[WKWebDataSource children]), (-[WKWebDataSource addFrame:]), (-[WKWebDataSource frameNamed:]): * WebView.subproj/WKWebDataSourcePrivate.h: * WebView.subproj/WKWebDataSourcePrivate.mm: (-[WKWebDataSourcePrivate init]), (-[WKWebDataSourcePrivate dealloc]), (-[WKWebDataSource _setController:]), (-[WKWebDataSource _setFrameName:]): * WebView.subproj/WKWebView.mm: (-[WKWebView mouseUp:]): * WebView.subproj/WKWebViewPrivate.h: * WebView.subproj/WKWebViewPrivate.mm: (-[WKWebViewPrivate dealloc]), (-[WKWebView _setController:]), (-[WKWebView _widget]): 2002-01-29 Kenneth Kocienda <kocienda@apple.com> WebKit now links with WebFoundation * WebKit.pbproj/kocienda.pbxuser: * WebKit.pbproj/project.pbxproj: 2002-01-23 Ken Kocienda <kocienda@apple.com> Took out @executable_path hack added for Alexander demo. This should clear up a class of crash-on-launch issues. * WebKit.pbproj/project.pbxproj: 2002-01-21 John Sullivan <sullivan@apple.com> * WebView.subproj/WKWebController.h: * WebView.subproj/WKWebView.h: Changed WKConcreteWebController to WKDefaultWebController in a couple of comments. 2002-01-18 Richard Williamson <rjw@apple.com> First pass at new view/datasource/controller API. * Misc.subproj/WKException.h: * Misc.subproj/WKException.m: * WebKit.pbproj/project.pbxproj: * WebView.subproj/WKDefaultWebController.h: * WebView.subproj/WKDefaultWebController.mm: (+[WKObjectHolder holderWithObject:]), (-[WKObjectHolder initWithObject:]), (-[WKObjectHolder dealloc]), (-[WKObjectHolder copyWithZone:]), (-[WKObjectHolder hash]), (-[WKObjectHolder object]), (-[WKObjectHolder isEqual:]), (-[WKDefaultWebController initWithView:dataSource:]), (-[WKDefaultWebController dealloc]), (-[WKDefaultWebController setDirectsAllLinksToSystemBrowser:]), (-[WKDefaultWebController directsAllLinksToSystemBrowser]), (-[WKDefaultWebController setView:andDataSource:]), (-[WKDefaultWebController viewForDataSource:]), (-[WKDefaultWebController dataSourceForView:]), (-[WKDefaultWebController mainView]), (-[WKDefaultWebController mainDataSource]), (-[WKDefaultWebController createViewForDataSource:inFrameNamed:]), (-[WKDefaultWebController createViewForDataSource:inIFrame:]), (-[WKDefaultWebController setStatusText:forDataSource:]), (-[WKDefaultWebController statusTextForDataSource:]), (-[WKDefaultWebController authenticate:]), (-[WKDefaultWebController receivedProgress:forResource:fromDataSource:]), (-[WKDefaultWebController receivedError:forResource:partialProgress:fromDataSource:]), (-[WKDefaultWebController locationWillChangeTo:]), (-[WKDefaultWebController locationChangeStartedForDataSource:]), (-[WKDefaultWebController locationChangeInProgressForDataSource:]), (-[WKDefaultWebController locationChangeDone:forDataSource:]), (-[WKDefaultWebController receivedPageTitle:forDataSource:]), (-[WKDefaultWebController serverRedirectTo:forDataSource:]): * WebView.subproj/WKDefaultWebControllerPrivate.h: * WebView.subproj/WKDefaultWebControllerPrivate.mm: (-[WKDefaultWebControllerPrivate init]), (-[WKDefaultWebControllerPrivate dealloc]): * WebView.subproj/WKWebController.h: * WebView.subproj/WKWebController.mm: * WebView.subproj/WKWebDataSource.h: * WebView.subproj/WKWebDataSource.mm: (-[WKWebDataSource _commonInitialization]), (-[WKWebDataSource initWithURL:]), (-[WKWebDataSource parent]), (-[WKWebDataSource isMainDocument]), (-[WKWebDataSource children]), (-[WKWebDataSource frameNames]), (-[WKWebDataSource findDataSourceForFrameNamed:]), (-[WKWebDataSource frameExists:]), (-[WKWebDataSource openURL:inFrameNamed:]), (-[WKWebDataSource openURL:inIFrame:]), (-[WKWebDataSource controller]), (-[WKWebDataSource inputURL]), (-[WKWebDataSource finalURL]), (-[WKWebDataSource wasRedirected]), (-[WKWebDataSource startLoading:]), (-[WKWebDataSource stopLoading]), (-[WKWebDataSource isLoading]), (-[WKWebDataSource documentText]), (-[WKWebDataSource base]), (-[WKWebDataSource baseTarget]), (-[WKWebDataSource encoding]), (-[WKWebDataSource setUserStyleSheetFromURL:]), (-[WKWebDataSource setUserStyleSheetFromString:]), (-[WKWebDataSource icon]), (-[WKWebDataSource isPageSecure]), (-[WKWebDataSource pageTitle]): * WebView.subproj/WKWebDataSourcePrivate.h: * WebView.subproj/WKWebDataSourcePrivate.mm: (-[WKWebDataSourcePrivate init]), (-[WKWebDataSourcePrivate dealloc]), (-[WKWebDataSource _setController:]), (-[WKWebDataSource _part]): * WebView.subproj/WKWebView.h: * WebView.subproj/WKWebView.mm: (-[WKWebView initWithFrame:]), (-[WKWebView dealloc]), (-[WKWebView controller]), (-[WKWebView dataSourceChanged]), (-[WKWebView layout]), (-[WKWebView stopAnimations]), (-[WKWebView setFontSizes:]), (-[WKWebView fontSizes]), (-[WKWebView resetFontSizes]), (-[WKWebView setStandardFont:]), (-[WKWebView standardFont]), (-[WKWebView setFixedFont:]), (-[WKWebView fixedFont]), (-[WKWebView setCanDragFrom:]), (-[WKWebView canDragFrom]), (-[WKWebView setCanDragTo:]), (-[WKWebView canDragTo]), (-[WKWebView defaultContextMenuItemsForNode:]), (-[WKWebView setContextMenusEnabled:]), (-[WKWebView deselectText]), (-[WKWebView searchFor:direction:caseSensitive:]), (-[WKWebView selectedText]), (-[WKWebView delayLayout:]), (-[WKWebView notificationReceived:]), (-[WKWebView setNeedsLayout:]), (-[WKWebView drawRect:]), (-[WKWebView setIsFlipped:]), (-[WKWebView isFlipped]), (-[WKWebView setFrame:]), (-[WKWebView mouseUp:]), (-[WKWebView mouseDown:]), (-[WKWebView mouseDragged:]): * WebView.subproj/WKWebViewPrivate.h: * WebView.subproj/WKWebViewPrivate.mm: (-[WKWebViewPrivate init]), (-[WKWebViewPrivate dealloc]), (-[WKWebView _resetView]), (-[WKWebView _setController:]): 2002-01-14 Maciej Stachowiak <mjs@apple.com> Convert build system to automake * Makefile.am: Add this * Makefile.in: Remove this (now autogenerated) * .cvsignore: Fix ignores * WebKit.pbproj/project.pbxproj: Twiddle link flags 2001-12-21 John Sullivan <sullivan@apple.com> * .cvsignore: * WebKit.pbproj/.cvsignore: Added files that were showing up on my machine to .cvsignores. 2001-12-18 Kenneth Kocienda <kocienda@apple.com> Deleted one little word * Documentation/WebKit-White-Paper/WebKit-White-Paper.html: 2001-12-18 Richard Williamson <rjw@apple.com> Restructing of headers in prepartion for implementation. Added new WK* headers to PB project description. * ChangeLog: * WebKit.pbproj/project.pbxproj: * WebView.subproj/NSWebPageDataSource.h: * WebView.subproj/NSWebPageDataSource.mm: * WebView.subproj/NSWebPageDataSourcePrivate.h: * WebView.subproj/NSWebPageView.h: * WebView.subproj/NSWebPageView.mm: * WebView.subproj/NSWebPageViewPrivate.h: * WebView.subproj/WKWebController.h: * WebView.subproj/WKWebController.mm: * WebView.subproj/WKWebDataSource.h: * WebView.subproj/WKWebDataSource.mm: (+[WKWebDataSource initialize]): * WebView.subproj/WKWebDataSourcePrivate.h: * WebView.subproj/WKWebView.h: * WebView.subproj/WKWebView.mm: * WebView.subproj/WKWebViewPrivate.h: 2001-12-18 Kenneth Kocienda <kocienda@apple.com> Updated the white paper text and graphics. * Documentation/WebKit-White-Paper/WebKit-White-Paper.html: * Documentation/WebKit-White-Paper/images/webkit-cache-loader.jpg: * Documentation/WebKit-White-Paper/images/webkit-classes.jpg: 2001-12-18 Kenneth Kocienda <kocienda@apple.com> Merged "Changes" information into individual files * Cache.subproj/WKLoadChunk.h: * Cache.subproj/WKWebCache.h: * Cache.subproj/WKWebCacheClient.h: * Cache.subproj/WKWebContentType.h: 2001-12-17 Kenneth Kocienda <kocienda@apple.com> Fixed small cpp glitch in WKWebCache. Added WKAttributedURL header. Updated WKBackForwardList with ifdef'ed out new design. * Cache.subproj/WKWebCache.h: * History.subproj/WKAttributedURL.h: * History.subproj/WKBackForwardList.h: 2001-12-17 Kenneth Kocienda <kocienda@apple.com> Added header files by chopping up the CacheAPI.h document I have been working on. * Cache.subproj/WKLoadChunk.h: * Cache.subproj/WKWebCache.h: * Cache.subproj/WKWebCacheClient.h: * Cache.subproj/WKWebContentType.h: 2001-12-17 Kenneth Kocienda <kocienda@apple.com> Did some verb tense cleanup. * Documentation/WebKit-White-Paper/WebKit-White-Paper.html: 2001-12-17 Kenneth Kocienda <kocienda@apple.com> Added the current draft of the WebKit white paper. * Documentation/WebKit-White-Paper/WebKit-White-Paper.html: * Documentation/WebKit-White-Paper/images/webkit-cache-loader.jpg: 2001-12-14 Richard Williamson <rjw@apple.com> Remove WKContextMenuHandler for want of a better way to describe the not-yet-existing WKDOMNode. We can't think of any initial clients that want to override the default behavior anyway. Put it in WKGrabBag.h for now. * WebView.subproj/WKWebController.h: 2001-12-14 Richard Williamson <rjw@apple.com> Remove explicit API to get/set the selection range. This will be postponed until we have a DOM API that allows us to express selection ranges correctly. Instead we have API that should support searching and getting a NSAttributedString that corresponds to the selected text. Added the following methods: - (void)searchFor: (NSString *)string direction: (BOOL)forward caseSensitive: (BOOL)case - deselectText; - (NSAttributedString *)selectedText; * WebView.subproj/WKWebView.h: Moved search API to WKWebView. Moved WKPreferences to a new file, WKPreferences.h. We are still discussing this item and it will not make it into the white paper. Minor naming changes. * WebView.subproj/WKDataSource.h: 2001-12-14 Maciej Stachowiak <mjs@apple.com> Simplified WKLocationChangeHandler and updated WKAuthenticationHandler. * WebView.subproj/WKWebController.h: (WKWebDataSource): Renamed methods to be forDataSource, not byDataSource. (-[WKWebDataSource locationChangeInProgressForDataSource:]): Added. (-[WKWebDataSource locationChangeDone:forDataSource:]): Added as a collapsed version of locationChangeCancelled:, locationChangeStopped: and locationChangeFinished:. (WKSimpleAuthenticationResult, WKSimpleAuthenticationRequest): made these interfaces instead of structs. 2001-12-14 Maciej Stachowiak <mjs@apple.com> Minor cleanups, mostly for naming consistency. * WebView.subproj/WKWebController.h: (WKSimpleAuthenticationRequest) name field `url', not `uri'. (-[WKWebDataSourceErrorHandler receivedError:forDataSource:]): renamed from `error:inDataSource:' so that it's a verb phrase. * WebView.subproj/WKWebDataSource.h: (-[WKWebDataSource initWithURL:]): Rename `inputUrl' argument to `inputURL'. (-[WKWebDataSource initWithLoader:]): Change argument type from `WKURILoader' to `WKLoader'. (-[WKWebDataSource wasRedirected]): Renamed from `isRedirected', the past tense seems more appropriate here. (-[WKWebDataSource setJavaEnabled:]): Add missing semicolon. (-[WKWebDataSource pluginsEnabled:]): renamed from `pluginEnabled' for consistency with `setPluginsEnabled:'. * WebView.subproj/WKWebView.h: (-[WKWebView fontSizes]): renamed from `fontSize' for sonsistency with `setFontSizes:'. (-[WKWebView setContextMenusEnabled]): renamed from 'setEnableContextMenus:' for consistency with `contextMenusenabled'. 2001-12-14 Maciej Stachowiak <mjs@apple.com> After discussion with Don, Removed all methods relating to resolved URLs, since browsers don't actually treat aliases specially. * WebView.subproj/WKWebController.h: removed inputURLresolvedTo: methods. * WebView.subproj/WKWebDataSource.h: remove resolvedURL method, and mentions of it in comments. 2001-12-13 Richard Williamson <rjw@apple.com> Removed WKFrameSetHandler, placed that functionality on WKWebDataSource. Changed WKLocationChangeHandler to add a parameter specifying the data source that sent the message. * WebView.subproj/WKWebController.h: 2001-12-13 Maciej Stachowiak <mjs@apple.com> Warning fixes and support to pass the http headers along with cache data items * Cache.subproj/NSURICacheData.h, Cache.subproj/NSURICacheData.m: (+[NSURICacheData dataWithURL:status:error:headers:data:size:notificationString:userData:], -[NSURICacheData initWithURL:status:error:headers:data:size:notificationString:userData:]), -[NSURICacheData dealloc], -[NSURICacheData error], -[NSURICacheData headers]: NSURICacheData now carries a copy of the response headers dictionary. * Cache.subproj/NSURICache.m: include "WCURICache.h" to fix warnings. (-[NSURICache requestWithURL:requestor:userData:]): Handle headers in CacheData. * Cache.subproj/NSURILoad.h, Cache.subproj/NSURILoad.m: (-[NSURILoad __NSURILoadReadStreamCallback:event:data:], -[NSURILoad headers], -[NSURILoad dealloc], -[NSURILoad done]): An NSURILoad object now carries the response headers associated with its connection, if any. * History.subproj/WKBackForwardList.m: include WCBackForwardList.h to fix warning. * History.subproj/WKURIEntry.m: include WCURIEntry.h to fix warning. * Misc.subproj/WebKitDebug.h: Use (void) for C prototypes, not (). * WebView.subproj/NSWebPageDataSource.mm: (+[NSWebPageDataSource initialize]): Remove unused variable to fix warning. * WebKit.pbproj/project.pbxproj: Enable many warning flags and -Werror 2001-12-13 Maciej Stachowiak <mjs@apple.com> * WebView.subproj/WKWebController.h: Defined initial version of WKAuthenticationHandler interface, and associated WKSimpleAuthenticationRequest and WKSimpleAuthenticationResult structs. 2001-12-13 Richard Williamson <rjw@apple.com> Remove setBase: and setBaseTarget: Changed return type of baseTarget to (NSString *) Added the following two methods: - (WKDataSource *)parent; - (NSArry *)children; - (BOOL)isMainDocument; Added the following methods: - (NSArray *)frameNames; - (WKWebDataSource) findDataSourceForFrameNamed: (NSString *)name; - (BOOL)frameExists: (NSString *)name; - (void)openURL: (NSURL *)url inFrameNamed: (NSString *)frameName; - (void)openURL: (NSURL *)url inIFrame: (id)iFrameIdentifier; * WebView.subproj/WKWebDataSource.h: 2001-12-12 Richard Williamson <rjw@apple.com> Changed WKConcreteWebController to WKDefaultWebController. Changed WKLocationChangedHandler naming, replace "loadingXXX" with "locationChangeXXX". Changed loadingStopped in WKLocationChangedHandler to locationChangeStopped:(WKError *). Changed loadingCancelled in WKLocationChangedHandler to locationChangeCancelled:(WKError *). Changed loadedPageTitle in WKLocationChangedHandler to receivedPageTitle:. Added inputURL:(NSURL *) resolvedTo: (NSURL *) to WKLocationChangedHandler. Added the following two methods to WKLocationChangedHandler: - (void)inputURL: (NSURL *)inputURL resolvedTo: (NSURL *)resolvedURL; - (void)serverRedirectTo: (NSURL *)url; Put locationWillChangeTo: back on WKLocationChangedHandler. Changed XXXforLocation in WKLoadHandler to XXXforResource. Changed timeoutForLocation: in WKLoadHandler to receivedError:forResource:partialProgress: Added the following two methods to WKDefaultWebController: - setDirectsAllLinksToSystemBrowser: (BOOL)flag - (BOOL)directsAllLinksToSystemBrowser; Removed WKError. This will be described in WKError.h. * WebView.subproj/WKWebController.h: 2001-12-12 Richard Williamson <rjw@apple.com> After group discussion we decided to classify API as : Tier 1: Needed by our browser (or Sherlock). Tier 2: Nedded by Apple internal clients (Mail, Help, PB, other TBD). Tier 3: Third party software vendors. Added finalURL and isRedirected. * WebView.subproj/WKWebDataSource.h: 2001-12-11 Chris Blumenberg <cblu@apple.com> * ChangeLog: * WebView.subproj/NSWebPageDataSource.mm: (+[NSWebPageDataSource initialize]): 2001-12-11 Chris Blumenberg <cblu@apple.com> * WebView.subproj/NSWebPageDataSource.mm: (+[NSWebPageDataSource initialize]): 2001-12-10 John Sullivan <sullivan@apple.com> * WebView.subproj/WKWebController.h: * WebView.subproj/WKWebDataSource.h: * WebView.subproj/WKWebView.h: Fixed some typos and misspellings. 2001-12-07 Richard Williamson <rjw@apple.com> * WebView.subproj/NSWebPageDataSource.h: * WebView.subproj/NSWebPageDataSourcePrivate.h: * WebView.subproj/NSWebPageView.h: First pass at API for WKWebView and WKWebDataSource. Note that we have to change names from NS to WK! The new API is conditionally excluded #ifdef READY_FOR_PRIMETIME Added these files: * WebView.subproj/WKWebDataSource.h: * WebView.subproj/WKWebView.h: * WebView.subproj/WKWebController.h: 2001-12-06 Maciej Stachowiak <mjs@apple.com> * Cache.subproj/NSURICacheData.m: (+[NSURICacheData dataWithURL:status:error:data:size:notificationString:userData:]), (-[NSURICacheData initWithURL:status:error:data:size:notificationString:userData:]): Remove redundant semicolons between the end of the prototype and the open brace, because they confuse the changelog script. ����������������������������������������������������������������������������������������������������������������������WebKit/mac/ChangeLog-2007-10-14���������������������������������������������������������������������0000644�0001750�0001750�00004000411�11214543140�013672� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=== Start merge of feature-branch 2007-10-12 === 2007-10-03 Andrew Wellington <proton@wiretapped.net> Reviewed by Mark Rowe. Mac build fix for issue introduced in r26027 * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2007-10-01 Eric Seidel <eric@webkit.org> Reviewed by Oliver Hunt. SVG Subresources will not be saved when creating WebArchives http://bugs.webkit.org/show_bug.cgi?id=15280 Implement _subresourceURLs methods for more SVGElement types more such methods will be needed as we add support for other external references (such as use, mpath, tref, etc.) * DOM/WebDOMOperations.mm: (-[DOMSVGScriptElement _subresourceURLs]): added. (-[DOMSVGCursorElement _subresourceURLs]): added. (-[DOMSVGFEImageElement _subresourceURLs]): added. 2007-10-01 Eric Seidel <eric@webkit.org> Reviewed by Oliver Hunt. WebArchives do not embed stylesheets referenced by xml-stylesheeet http://bugs.webkit.org/show_bug.cgi?id=15320 * DOM/WebDOMOperations.mm: (-[DOMProcessingInstruction _stylesheetURL]): needed to access [[self sheet] href] (-[DOMProcessingInstruction _subresourceURLs]): call and return _stylesheetURL 2007-10-01 Eric Seidel <eric@webkit.org> Reviewed by Oliver Hunt. * DOM/WebDOMOperations.mm: added DOMSVGElementImage _subresources implementation (-[DOMNode _URLsFromSelectors:]): now handles DOMSVGAnimatedString return values (-[DOMSVGImageElement _subresourceURLs]): added. * MigrateHeaders.make: copies DOMSVG* headers into WebKit/PrivateHeaders 2007-10-01 Oliver Hunt <oliver@apple.com> Reviewed by Mark. Enable Experimental SVG features by default when building from Xcode * Configurations/WebKit.xcconfig: === End merge of feature-branch 2007-10-12 === 2007-10-11 Mark Rowe <mrowe@apple.com> Reviewed by Tim Hatcher. Fix for <rdar://problem/5488678>. Disable debugging symbols in production builds for 10.4 PowerPC to prevent a huge STABS section from being generated. * Configurations/Base.xcconfig: 2007-10-10 Alice Liu <alice.liu@apple.com> Reviewed by Geoff Garen. Fixed <rdar://5464402> Crash when running fast/frames/onload-remove-iframe-crash.html in DRT createFrame() now returns a RefPtr instead of a raw Frame pointer. Making this change improves the way we handle frames on Windows WebKit. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createFrame): 2007-10-04 Beth Dakin <bdakin@apple.com> Reviewed by John Sullivan. Fix for <rdar://problem/5441823> REGRESSION (r25142, Tiger only): Vertical scroll bar not redrawn properly when going back in history (15033) This fix if-defs r25142 to be Leopard-only since it causes correctness issues on Tiger and does not seem to have any performance impact on Tiger either. * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView setScrollBarsSuppressed:repaintOnUnsuppress:]): (-[WebDynamicScrollBarsView reflectScrolledClipView:]): 2007-10-04 Mark Rowe <mrowe@apple.com> Reviewed by Oliver. Switch to default level of debugging symbols to resolve <rdar://problem/5488678>. The "full" level appears to offer no observable benefits even though the documentation suggests it be used for dead code stripping. This should also decrease link times. * Configurations/Base.xcconfig: 2007-10-04 Adele Peterson <adele@apple.com> Reviewed by Darin. WebKit part of fix for <rdar://problem/5369017> REGRESSION: Can't tab to webview that doesn't have editable content * WebView/WebHTMLView.mm: (-[WebHTMLView becomeFirstResponder]): Pass in the FocusDirection. 2007-10-04 Darin Adler <darin@apple.com> * WebView/WebHTMLView.mm: (-[WebHTMLView _updateActiveState]): Removed a bogus comment. 2007-10-02 Kevin Decker <kdecker@apple.com> Reviewed by Mark Rowe. Re-added _minimumRequiredSafariBuildNumber. It turns out older version of Safari still rely on this method, so we need to keep it around at least until the next major Safari release. * StringsNotToBeLocalized.txt: * WebView/WebView.mm: (+[WebView _minimumRequiredSafariBuildNumber]): * WebView/WebViewPrivate.h: 2007-10-02 Kevin Decker <kdecker@apple.com> Reviewed by John Sullivan. <rdar://problem/5517710> * WebView/WebView.mm: Removed -[WebView _minimumRequiredSafariBuildNumber] because newer versions of Safari no longer use this method. This won't break existing Safaris because they always use a respondsToSelector check before calling this. * WebView/WebViewPrivate.h: Ditto. 2007-09-27 John Sullivan <sullivan@apple.com> Reviewed by Ollie - fixed <rdar://problem/5408186> REGRESSION (5522-5523.9): Safari leaks every browser window The leak started occurring when we removed the code to clear the delegates and the host window from Safari as part of the fix for 5479443. But it turns out that Safari code was masking a bug here in WebView: setHostWindow:nil needs to be called before setting _private->closed to YES, or it will do nothing at all, causing a world leak due to a circular reference between the window and the WebView. I toyed with a more complex fix, but this is the simplest one that retains the fix for 5479443 while otherwise restoring the code order to be as close as possible to what it was before 5479443 was fixed. * WebView/WebView.mm: (-[WebView _close]): Moved the call that sets _private->closed to YES to be after the code that clears the delegates and the host window. Added a comment about this order. 2007-09-27 Kevin Decker <kdecker@apple.com> Rubber stamped by Darin. <rdar://problem/5493093> * WebKit.order: Added. * WebKit.xcodeproj/project.pbxproj: We're changing from using an order file built by another team to using one we actually check into our project repository. Linker settings for Symbol Ordering Flags have been updated accordingly. 2007-09-26 Geoffrey Garen <ggaren@apple.com> Reviewed by Adele Peterson. Fixed <rdar://problem/5507476> Promote cache model SPI to API Promoted cache model SPI to API. This was just a move, with some small edits to the documentation (changing 'application' to 'WebView' in some cases, since the interface is now per-WebView). * WebView/WebPreferences.h: * WebView/WebPreferences.m: (-[WebPreferences setCacheModel:]): (-[WebPreferences cacheModel]): * WebView/WebPreferencesPrivate.h: 2007-09-24 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/5498016> Photoshop CS3: Adobe Help Viewer 1.1 crashes in 9A553 WebKit started calling the mouseDidMoveOverElement delegate method with a nil dictionary in r14982. We originally intended to call this delegate method sometimes with a nil dictionary, but due to a bug dating back to WebKit 1.0 this delegate was never called with nil! Unfortunately we can't start calling this with nil since it will break Adobe Help Viewer, and possibly other clients. * WebView/WebView.mm: (-[WebView _mouseDidMoveOverElement:modifierFlags:]): 2007-09-21 Kevin Decker <kdecker@apple.com> * Plugins/WebBaseNetscapePluginView.mm: Build fix. The first argument of aglChoosePixelFormat() has changed from const AGLDevice *gdevs on Tiger to const void *gdevs on Leopard. 2007-09-20 Kevin Decker <kdecker@apple.com> Reviewed by Darin Adler. <rdar://problem/5493093> Reduced launch time by lazily linking both the AGL and OpenGL frameworks until they are really needed. * Plugins/WebBaseNetscapePluginView.mm: Soft link all AGL and OpenGL functions used by WebBaseNetscapePluginView. * WebKit.xcodeproj/project.pbxproj: Removed AGL and OpenGL from the project. 2007-09-20 John Sullivan <sullivan@apple.com> Build fix for stoooopid old PPC gcc compiler * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::checkSpellingOfString): replace perfectly valid ?: syntax with if/else 2007-09-19 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. - WebKit part of speculative fix for <rdar://problem/5490627>, about crashes constructing a String using the values filled in by checkSpellingOfString() * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::checkSpellingOfString): convert NSNotFound to -1, since WebCore code expects -1 for this purpose. We already do this in checkGrammarOfString. 2007-09-19 Kevin Decker <kdecker@apple.com> Reviewed by Darin Adler. <rdar://problem/5491066> soft link Accelerate.framework * Misc/WebGraphicsExtras.c: (WebConvertBGRAToARGB): Improve launch time performance and reduce vsize footprint by soft linking the Accelerate.framework. * WebKit.xcodeproj/project.pbxproj: Remove no longer needed frameworks. 2007-09-18 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler. Fixed <rdar://problem/5490204> In some cases, WebKit can make the Foundation disk cache way too big or way too small Use the actual location of the foundation disk cache, rather than the user's home directory, when determining how big to make it. * WebView/WebView.mm: (+[WebView _setCacheModel:]): 2007-09-17 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler. Fixed a hang due to an infinite script running in the window's unload event handler, which may be the cause of <rdar://problem/5479443> REGRESSION: Hang due to infinite JS recursion on close @ engadget.com (onunload-based ad) * WebView/WebUIDelegatePrivate.h: Added FIXME. * WebView/WebView.h: Clarified headerdoc ambiguity about when delegate methods stop firing. * WebView/WebView.mm: (-[WebView _close]): The fix: don't nil out our delegates until after detaching the FrameLoader, because the act of detaching the FrameLoader might fire important delegate methods, like webViewShouldInterruptJavaScript:. Don't do other tear-down either, because the unload event handler needs to run in a fully constructed page. This change is fairly low risk because niling out our delegates is a very recent, never-shipped feature in WebKit, so it's unlikely that any apps rely on it in a crazy way. 2007-09-15 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - fix <rdar://problem/5391540> REGRESSION: Can't drag images from Safari to applications in the dock (Tiger Preview, others in Leopard) * Misc/WebNSPasteboardExtras.mm: (-[NSPasteboard _web_declareAndWriteDragImageForElement:URL:title:archive:source:]): Re-implement code here that has been missing for the last couple of years since we did some image refactoring. Was pretty easy now that we can freely call C++ code in WebKit. 2007-09-14 Mark Rowe <mrowe@apple.com> Build fix for Tiger. * WebView/WebArchive.m: (-[WebArchive initWithCoder:]): Use @catch(id) rather than @catch(...). * WebView/WebPreferences.m: (-[WebPreferences initWithCoder:]): Ditto. * WebView/WebResource.mm: (-[WebResource initWithCoder:]): Ditto. (-[WebResource _initWithPropertyList:]): Ditto. 2007-09-14 Darin Adler <darin@apple.com> Reviewed by Geoff Garen and Tim Hatcher. - fixed <rdar://problem/5482745> initFromCoder: and initWithPropertyList: functions should guard against incorrect types * WebView/WebArchive.m: (isArrayOfClass): Added helper function. (-[WebArchive _initWithPropertyList:]): Tweaked function to remove the need for a type cast. (-[WebArchive initWithCoder:]): Added type checking for the main resource, subresources array, and subframe archives array. Also replaced NS_DURING with @try. * WebView/WebPreferences.m: (-[WebPreferences initWithCoder:]): Added type checking for the identifier and the values dictionary, including ensuring that it's a mutable dictionary. * WebView/WebResource.mm: (-[WebResource initWithCoder:]): Added type checking for all the fields. (-[WebResource _initWithPropertyList:]): Added type checking for the NSURLResponse. * WebKit.exp: Removed accidentally exported internal symbol; I checked and it's not used anywhere. 2007-09-13 Darin Adler <darin@apple.com> Reviewed by Oliver. - fix <rdar://problem/5470457> REGRESSION: Input method inline hole is mishandled in text <input> elements with maxlength limit * WebView/WebHTMLView.mm: (-[WebHTMLView _selectionChanged]): Tweaked code a bit. (-[WebHTMLView markedRange]): Simplified logic, since markedTextNSRange works when there's no composition range. (-[WebHTMLView hasMarkedText]): Call directly to Editor instead of bridge. (-[WebHTMLView unmarkText]): Call new confirmComposition to make it clear that this is confirming text, not just unmarking it to discard it. (extractUnderlines): Added. Converts directly from an NSAttributedString to the CompositionUnderline vector that's used by WebCore. (-[WebHTMLView setMarkedText:selectedRange:]): Changed to use the new setComposition. (-[WebHTMLView insertText:]): Changed to use confirmComposition when appropriate, instead of relying on special behavior of Editor::insertText. (-[WebHTMLView _updateSelectionForInputManager]): Rewrote to use getCompositionSelection and confirmCompositionWithoutDisturbingSelection. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: Removed obsolete markedTextAbandoned function. 2007-09-12 David Kilzer <ddkilzer@apple.com> Rubber-stamped by Darin and reviewed by Adam. Removed import of unused icon database headers. * WebCoreSupport/WebFrameBridge.mm: 2007-09-11 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Remove the unused class_getMethodImplementation function. * Misc/WebNSObjectExtras.h: 2007-09-11 Geoffrey Garen <ggaren@apple.com> Reviewed by Oliver Hunt. Fixed CFNetwork version check so it actually works. * Misc/WebKitVersionChecks.h: * WebView/WebView.mm: (+[WebView _setCacheModel:]): Don't use NSVersionOfLinkTimeLibrary because we don't link against CFNetwork directly, so it returns -1. Also, use the proper hex encoding instead of decimal numbers. 2007-09-11 Darin Adler <darin@apple.com> - redo fix for <rdar://problem/5472899> REGRESSION (TOT): Crash in FrameLoadDelegate loading stationery * WebView/WebView.mm: (getMethod): Added. (-[WebView _cacheResourceLoadDelegateImplementations]): Use getMethod. (-[WebView _cacheFrameLoadDelegateImplementations]): Ditto. 2007-09-11 Darin Adler <darin@apple.com> Rubber-stamped by Dave Harrison. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Removed wkCreateURLPasteboardFlavorTypeName and wkCreateURLNPasteboardFlavorTypeName. 2007-09-11 Darin Adler <darin@apple.com> Reviewed by Mark Rowe. - fix <rdar://problem/5472899> REGRESSION (TOT): Crash in FrameLoadDelegate loading stationery * Misc/WebNSObjectExtras.h: (class_getMethodImplementation): Added. (method_setImplementation): Added. * WebView/WebHTMLView.mm: (+[WebHTMLViewPrivate initialize]): * Carbon/HIViewAdapter.m: (+[HIViewAdapter bindHIViewToNSView:nsView:]): Remove old-ObjC code path, since WebNSObjectExtras.h now implements everything we need. * WebView/WebView.mm: (-[WebView _cacheResourceLoadDelegateImplementations]): Don't bother doing a separate respondsToSelector call, since class_getMethodImplementation will return 0 for selectors that we don't respond to. The bug fix is to actually set the cached pointer to 0. Also get rid of the unnecessary use of a macro; instead use the functions from WebNSObjectExtras.h on Tiger and the appropriate function directly on Leopard. (-[WebView _cacheFrameLoadDelegateImplementations]): Ditto. 2007-09-11 Darin Adler <darin@apple.com> Reviewed by Sam, Ollie. * WebView/WebView.mm: (+[WebView _setCacheModel:]): A slightly cleaner 64-bit fix for the NSURLCache capacity code in this file. 2007-09-11 Darin Adler <darin@apple.com> Rubber-stamped by Mark Rowe. * Misc/WebNSPasteboardExtras.mm: Fix incorrect strings in my last check-in. The strings I checked in were wrong and were breaking layout tests too. These new ones match what WebKitSystemInterface was returning. 2007-09-10 Geoffrey Garen <ggaren@apple.com> Fixed 64-bit build (I think). * WebView/WebView.mm: (max): Added. In 64-bit land, -diskCapacity magically starts returning unsigned long instead of unsigned, so we define a custom max() that's willing to compare unsigned to unsigned long. 2007-09-10 Darin Adler <darin@apple.com> Reviewed by Tim Hatcher. - <rdar://problem/5471082> Removing WebURLPboardType from headers broke SPI-using applications Rolled out my fix for bug 4582212 and fixed it in a much simpler way. * Misc/WebNSPasteboardExtras.h: * Misc/WebNSPasteboardExtras.mm: * WebCoreSupport/WebPasteboardHelper.mm: * WebKit.exp: * WebView/WebHTMLView.mm: * WebView/WebView.mm: Rolled out the new PasteboardType functions and changed the PboardType globals to be initialized with constant values. 2007-09-10 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Always animate when calling _scrollTo. * WebView/WebFrameView.mm: (-[WebFrameView _scrollVerticallyBy:]): (-[WebFrameView _scrollHorizontallyBy:]): 2007-09-08 Brady Eidson <beidson@apple.com> Reviewed by Darin <rdar://problem/5434431> - Asynchronous Icon Database WebKit side of things Mainly, there are Notifications WebKit has to listen for now that tell it when to either call back into WebCore for some purpose or to send the webView:didReceiveIcon: delegate call Many smaller tweaks as well. * Misc/WebIconDatabase.h: * Misc/WebIconDatabase.mm: (defaultClient): (-[WebIconDatabase init]): (+[WebIconDatabase delayDatabaseCleanup]): Accessor so clients can prevent the thread from cleaning up the database before they've done all their necessary retaining of icons. (+[WebIconDatabase allowDatabaseCleanup]): (-[WebIconDatabase removeAllIcons]): (-[WebIconDatabase _isEnabled]): (-[WebIconDatabase _sendNotificationForURL:]): (-[WebIconDatabase _sendDidRemoveAllIconsNotification]): (-[WebIconDatabase _databaseDirectory]): (-[ThreadEnabler threadEnablingSelector:]): Quick and dirty class to enabled Cocoa multithreading (+[ThreadEnabler enableThreading]): (importToWebCoreFormat): * Misc/WebIconDatabaseInternal.h: Expose the internal methods of WebIconDatabase that are required by WebIconDatabaseClient * Misc/WebNSNotificationCenterExtras.h: Added. - Great utility class whose design was borrowed from Colloquy that allows the posting of a Cocoa notification on the main thread from *any* thread * Misc/WebNSNotificationCenterExtras.m: Added. (-[NSNotificationCenter postNotificationOnMainThreadWithName:object:]): (-[NSNotificationCenter postNotificationOnMainThreadWithName:object:userInfo:]): (-[NSNotificationCenter postNotificationOnMainThreadWithName:object:userInfo:waitUntilDone:]): (+[NSNotificationCenter _postNotificationName:]): * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidReceiveIcon): Send the webView:didReceiveIcon: delegate call (WebFrameLoaderClient::registerForIconNotification): * WebCoreSupport/WebIconDatabaseClient.h: Added. * WebCoreSupport/WebIconDatabaseClient.mm: Added. (WebIconDatabaseClient::performImport): Perform the Safari 2 icon import (WebIconDatabaseClient::dispatchDidRemoveAllIcons): Send the NSNotification (WebIconDatabaseClient::dispatchDidAddIconForPageURL): Ditto * WebView/WebView.mm: (-[WebView _receivedIconChangedNotification:]): Check and see if this notification is for this WebView's current URL by calling back into the IconDatabase (-[WebView _registerForIconNotification:]): Support for WebIconDatabaseClient (-[WebView _dispatchDidReceiveIconFromWebFrame:]): Dispatch this delegate call as well as unregister for the notification * WebView/WebViewInternal.h: * WebKit.xcodeproj/project.pbxproj: 2007-09-07 Geoffrey Garen <ggaren@apple.com> Suggested by Maciej Stachowiak. Added wKiosk Browser to the browser list. Pretty sweet app. * WebView/WebPreferences.m: (cacheModelForMainBundle): 2007-09-07 Geoffrey Garen <ggaren@apple.com> Build fix. * WebView/WebView.mm: (+[WebView _setCacheModel:]): 2007-09-05 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler, Maciej Stachowiak, Mark Rowe, Tim Hatcher. Fixed <rdar://problem/5326009> Make non-browser WebKit clients have no memory cache, or a very tiny one High level explanation: - Added SPI for specifying a cache model on a per-WebView basis. (Hopefully, this will become API soon.) We balance competing cache models simply by using the largest one that pertains at a given time. - Added heuristic for guessing a default cache model in WebViews that don't specify one: 1) Default to DocumentViewer for apps linked on or after this WebKit. Default to DocumentBrowser otherwise. 2) Assign specific defaults to well-known clients based on bundle ID. 3) Grow the default to DocumentBrowser if a navigation takes place. - As a part of the DocumentBrowser & PrimaryWebBrowser settings: 1) Make the Foundation disk cache much much bigger than the default 20MB, if space allows. (This is a hedge against a small WebCore cache in DocumentBrowser mode, but also an all-around win for page load speed.) 2) Scaled the Foundation memory cache's capacity with physical RAM, just like we do with other caches. This is a small win on low memory systems. * Misc/WebKitSystemBits.h: * Misc/WebKitSystemBits.m: (WebMemorySize): Renamed from "WebSystemMainMemory." (WebHomeDirectoryFreeSize): Added function to measure the free space on the user's home directory. We use this as a factor in determining the disk cache's cacpacity. * Misc/WebKitVersionChecks.h: Support for linked on or after check. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::didPerformFirstNavigation): Implementation of heuristic rule #3. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.m: (cacheModelForMainBundle): Implementation of heuristic rule #2. (-[NSMutableDictionary _web_checkLastReferenceForIdentifier:]): Added notification for when a WebPreferences instance becomes inert. We use this to shrink the cache model back down if possible. Moved this code into a WebPreferences method, since it's not really a feature of NSDictionary. * WebView/WebPreferencesPrivate.h: SPI declarations. * WebView/WebView.mm: Replaced manual notification posts with calls to the _postPreferencesChangesNotification convenience method. (-[WebView _preferencesChangedNotification:]): Merged dispersed code for updating preferences-related settings into this one function. This was needed for an earlier version of the patch, even though the current version could probably do without it. (+[WebView _preferencesChangedNotification:]): Added a class-level listener for WebPreferences changes. This listener takes care of modifying the class-level global cache model setting if necessary. (+[WebPreferences standardPreferences]): Removed call to _postPreferencesChangesNotification because the notification already posts when you create the WebPreferences object. (I noticed this inefficiency because my new _preferencesChangedNotification: method was called excessively at startup.) Also Added explicit tracking of WebPreferences clients, so we know when a WebPreferences instance becomes inert: (-[WebPreferences didRemoveFromWebView]): (-[WebPreferences willAddToWebView]): (+[WebView _setCacheModel:]): Translates a cache model into actual settings in various APIs. Caches that have unbounded value grow linearly relative to available space. Caches that have bounded value grow inverse-squaredly relative to available space. 2007-09-05 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/5443883> Uncaught Objective-C exceptions in WebKit clients lead to hard-to-diagnose crashes Changed all the direct delegate calls to use helper functions that have direct access to WebView's delegate objects. These helper methods will catch any ObjC exceptions and call ReportDiscardedDelegateException to log the discarded exception. WebView's that have catchesDelegateExceptions set to NO will not pay the cost of a @try/@catch. The delegate forwarders also have the same behavior. * Misc/WebKitLogging.h: * Misc/WebKitLogging.m: (ReportDiscardedDelegateException): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView loadPluginRequest:]): * Plugins/WebNullPluginView.mm: (-[WebNullPluginView viewDidMoveToWindow]): * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::createWindow): (WebChromeClient::createModalDialog): (WebChromeClient::runModal): (WebChromeClient::toolbarsVisible): (WebChromeClient::statusbarVisible): (WebChromeClient::addMessageToConsole): (WebChromeClient::canRunBeforeUnloadConfirmPanel): (WebChromeClient::runBeforeUnloadConfirmPanel): (WebChromeClient::runJavaScriptAlert): (WebChromeClient::runJavaScriptConfirm): (WebChromeClient::runJavaScriptPrompt): (WebChromeClient::shouldInterruptJavaScript): (WebChromeClient::setStatusbarText): (WebChromeClient::print): * WebCoreSupport/WebContextMenuClient.mm: (WebContextMenuClient::getCustomMenuFromDefaultItems): (WebContextMenuClient::contextMenuItemSelected): * WebCoreSupport/WebDragClient.mm: (WebDragClient::startDrag): * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::textFieldDidBeginEditing): (WebEditorClient::textFieldDidEndEditing): (WebEditorClient::textDidChangeInTextField): (WebEditorClient::doTextFieldCommandFromEvent): (WebEditorClient::textWillBeDeletedInTextField): (WebEditorClient::textDidChangeInTextArea): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge viewForPluginWithFrame:URL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache): (WebFrameLoaderClient::assignIdentifierToInitialRequest): (WebFrameLoaderClient::dispatchWillSendRequest): (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidReceiveResponse): (WebFrameLoaderClient::willCacheResponse): (WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebFrameLoaderClient::dispatchDidFinishLoading): (WebFrameLoaderClient::dispatchDidFailLoading): (WebFrameLoaderClient::dispatchDidHandleOnloadEvents): (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebFrameLoaderClient::dispatchDidCancelClientRedirect): (WebFrameLoaderClient::dispatchWillPerformClientRedirect): (WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): (WebFrameLoaderClient::dispatchWillClose): (WebFrameLoaderClient::dispatchDidReceiveIcon): (WebFrameLoaderClient::dispatchDidStartProvisionalLoad): (WebFrameLoaderClient::dispatchDidReceiveTitle): (WebFrameLoaderClient::dispatchDidCommitLoad): (WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebFrameLoaderClient::dispatchDidFailLoad): (WebFrameLoaderClient::dispatchDidFinishDocumentLoad): (WebFrameLoaderClient::dispatchDidFinishLoad): (WebFrameLoaderClient::dispatchDidFirstLayout): (WebFrameLoaderClient::dispatchCreatePage): (WebFrameLoaderClient::dispatchUnableToImplementPolicy): (WebFrameLoaderClient::dispatchWillSubmitForm): (WebFrameLoaderClient::dispatchDidLoadMainResource): * WebView/WebHTMLView.mm: (-[WebHTMLView callDelegateDoCommandBySelectorIfNeeded:]): (-[WebHTMLView validateUserInterfaceItem:]): * WebView/WebPDFView.mm: (-[WebPDFView validateUserInterfaceItem:]): (-[WebPDFView PDFViewSavePDFToDownloadFolder:]): * WebView/WebView.mm: (-[WebView _openNewWindowWithRequest:]): (-[WebView _menuForElement:defaultItems:]): (-[WebView _mouseDidMoveOverElement:modifierFlags:]): (-[WebView _cacheResourceLoadDelegateImplementations]): (-[WebView _cacheFrameLoadDelegateImplementations]): (-[WebView _policyDelegateForwarder]): (-[WebView _UIDelegateForwarder]): (-[WebView _editingDelegateForwarder]): (-[WebView _scriptDebugDelegateForwarder]): (-[WebView _setCatchesDelegateExceptions:]): (-[WebView _catchesDelegateExceptions]): (-[_WebSafeForwarder initWithTarget:defaultTarget:]): (-[_WebSafeForwarder forwardInvocation:]): (-[_WebSafeForwarder methodSignatureForSelector:]): (-[WebView _commonInitializationWithFrameName:groupName:]): (-[WebView validateUserInterfaceItem:]): (-[WebView _headerHeight]): (-[WebView _footerHeight]): (-[WebView _drawHeaderInRect:]): (-[WebView _drawFooterInRect:]): (-[WebView _shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:]): (CallDelegate): (CallDelegateReturningFloat): (CallDelegateReturningBoolean): (CallUIDelegate): (CallUIDelegateReturningFloat): (CallUIDelegateReturningBoolean): (CallFrameLoadDelegate): (CallResourceLoadDelegate): (CallFormDelegate): (CallFormDelegateReturningBoolean): * WebView/WebViewInternal.h: * WebView/WebViewPrivate.h: 2007-09-04 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/5452908> NIBs saved in the Pre-10.2 format while Safari 3 installed do not work without Safari 3 This happened because we encoded a new field that the old WebKit does not know how to read. And NSCoder throws an exception if initWithCoder finishes while there is still unread data in the archive. The WebViewVersion is now 4 to distinguish that we do not encode/decode allowsUndo. * WebView/WebView.mm: (-[WebView initWithCoder:]): Only try to read allowsUndo if the version is 3. (-[WebView encodeWithCoder:]): No longer encode allowsUndo. 2007-09-04 David Hyatt <hyatt@apple.com> Fix for <rdar://problem/5271213>, resizing iChat window is slower than in Tiger. This patch implements a fast scaling mode that can be used by WebViews, e.g., during window resizing. Reviewed by John Sullivan * WebView/WebView.mm: (-[WebView _setUseFastImageScalingMode:]): (-[WebView _inFastImageScalingMode]): * WebView/WebViewPrivate.h: 2007-09-04 Darin Adler <darin@apple.com> Reviewed by Hyatt. * WebView/WebView.mm: (-[WebView _loadBackForwardListFromOtherView:]): Added missing null check. (-[WebView _setInitiatedDrag:]): Ditto. (-[WebView _clearUndoRedoOperations]): Ditto. (-[WebView encodeWithCoder:]): Ditto. (-[WebView backForwardList]): Ditto. (-[WebView setMaintainsBackForwardList:]): Ditto. 2007-09-04 Tristan O'Tierney <tristan@apple.com> Reviewed by John Sullivan. <rdar://problem/5454935> Can't reply to this message in Mail -- -[DOMRange webArchive] is throwing an exception * WebView/WebArchiver.mm: (+[WebArchiver _archiveWithMarkupString:fromFrame:nodes:]): Guard the creation of WebResource by ensuring that the passed in responseURL is never nil. 2007-09-03 Mark Rowe <mrowe@apple.com> Reviewed by Tim Hatcher. <rdar://problem/5452164> Production build with in symbols directory has no debug info Enable debug symbol generation on all build configurations. Production builds are stripped of symbols by Xcode during deployment post-processing. * Configurations/Base.xcconfig: * WebKit.xcodeproj/project.pbxproj: 2007-09-02 Brady Eidson <beidson@apple.com> Reviewed by John Sullivan and Mark Rowe Groundwork for support for monitoring IconDatabase in-memory statistics * Misc/WebCoreStatistics.h: * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics iconPageURLMappingCount]): (+[WebCoreStatistics iconRetainedPageURLCount]): (+[WebCoreStatistics iconRecordCount]): (+[WebCoreStatistics iconsWithDataCount]): 2007-09-01 Oliver Hunt <oliver@apple.com> Reviewed by Sam. <rdar://problem/5344848> IME is incorrectly used for key events when on non-editable regions EditorClient::setInputMethodState stub * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::setInputMethodState): 2007-08-30 Maciej Stachowiak <mjs@apple.com> Reviewed by Tim. <rdar://problem/5439953> REGRESSION: Cannot load feeds in widgets in Dashcode due to change in WebKit delegate methods * WebView/WebFrame.mm: (-[WebFrame _attachScriptDebugger]): Don't create the debugger object if the frame has not yet created its script interpreter, to avoid premature dispatch of windowScriptObjectAvailable/Cleared delegate methods. The script debugger will be created in any case when the window object does appear. 2007-08-29 Darin Adler <darin@apple.com> Reviewed by Tim Hatcher. - fix <rdar://problem/4582212> WebKit inappropriately adds +initialize to NSPasteboard via a category, prevents AppKit initialize http://bugs.webkit.org/show_bug.cgi?id=9417 * Misc/WebNSPasteboardExtras.h: Got rid of the global data objects and replaced them with global functions. * Misc/WebNSPasteboardExtras.mm: (initializePasteboardTypes): Changed the initialize method to be this function. (WebURLPasteboardType): Added, calls the initialize function and then returns the value of the global. (WebURLNamePasteboardType): Ditto. (+[NSPasteboard _web_writableTypesForURL]): Changed to call the new function instead of getting at the global directly. (+[NSPasteboard _web_dragTypesForURL]): Ditto. (-[NSPasteboard _web_writeURL:andTitle:types:]): Ditto. * WebCoreSupport/WebPasteboardHelper.mm: (WebPasteboardHelper::urlFromPasteboard): Ditto. * WebView/WebHTMLView.mm: (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]): Ditto. * WebView/WebView.mm: (+[WebView initialize]): Added a call to one of the functions to take advantage of the side effect that initializes the globals; this is to help out old versions of Safari. (+[WebView URLTitleFromPasteboard:]): Changed to call the new function instead of getting at the global directly. * WebKit.exp: Add exports of the new functions. 2007-08-29 Adele Peterson <adele@apple.com> Reviewed by Darin. Fix for http://bugs.webkit.org/show_bug.cgi?id=15098 <rdar://problem/5440319> REGRESSION (9A530-9A534): Double scroll bar on pdfs * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::makeDocumentView): Don't suppress scrollbars before the view creation if we're making the view for a non-html view * WebView/WebFrameViewInternal.h: Make _scrollView return a WebDynamicScrollBarsView since so many clients were relying on it being that type anyway. * WebView/WebFrameView.mm: (-[WebFrameView _setDocumentView:]): (-[WebFrameView _scrollView]): (-[WebFrameView setAllowsScrolling:]): (-[WebFrameView allowsScrolling]): * WebView/WebView.mm: (-[WebView setAlwaysShowVerticalScroller:]): (-[WebView alwaysShowVerticalScroller]): (-[WebView setAlwaysShowHorizontalScroller:]): (-[WebView alwaysShowHorizontalScroller]): 2007-08-29 David Hyatt <hyatt@apple.com> The method that was swizzled to fix 5441281 does not exist on Tiger. Tiger has to do a double swizzle instead (of resetCursorRects and NSCursor's set method) in order to roughly achieve the same effect. Reviewed by darin * WebView/WebHTMLView.mm: (resetCursorRects): (setCursor): (+[WebHTMLViewPrivate initialize]): 2007-08-29 Anders Carlsson <andersca@apple.com> Fix 64-bit build. * WebCoreSupport/WebFrameBridge.mm: 2007-08-29 David Hyatt <hyatt@apple.com> Fix for 5441281, remove our dependency on cursor rects and drag margins in AppKit for a large performance boost on the PLT and iBench. Reviewed by darin * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView sendNullEvent]): (-[WebBaseNetscapePluginView mouseEntered:]): (-[WebBaseNetscapePluginView mouseExited:]): (-[WebBaseNetscapePluginView stop]): Clean up cursor setting from Netscape plugins. Don't unconditionally mutate the cursor when a plugin stops. * WebView/WebFrameView.mm: (-[WebFrameView _setDocumentView:]): Suppress the resetting of drag margins while the new document view is being added to the view hierarchy. * WebView/WebHTMLView.mm: (-[NSWindow _web_borderView]): Expose the border view of the NSWindow so that it can be hit tested. (setCursorForMouseLocation): Apply a method swizzle to override the private AppKit method, _setCursorForMouseLocation. We have to do this to suppress the cursor rect invalidation handling from resetting the cursor for no reason. The swizzle will do a hit test and allow the cursor set to occur if the mouse ends up being over a plugin or over a view other than a WebHTMLView. (+[WebHTMLViewPrivate initialize]): The swizzle for setCursorForMouseLocation is set up here. (-[WebHTMLView _frameOrBoundsChanged]): Add a 100ms delay to the fake mouse moved event that fires when the view moves under the mouse (without the mouse moving). This happens on iBench when the pages get scrolled. By adding a delay we ensure that even with the mouse inside the window, we don't experience cursor thrashing when pages are updating and scrolling rapidly. 2007-08-28 Anders Carlsson <andersca@apple.com> Reviewed by Darin. <rdar://problem/5424866> Bottom portion of any Web Clip widget appears transparent * WebCoreSupport/WebFrameBridge.mm: Use the enum from FrameLoaderTypes.h. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::objectContentType): Return ObjectContentNetscapePlugin and ObjectContentOtherPlugin depending on the plug-in type. 2007-08-28 Mark Rowe <mrowe@apple.com> Reviewed by Maciej Stachowiak. Fix fallout from the fix for <rdar://problem/5437983> (Loading history containing 100,000 entries adds 20s to Safari's startup) in r25275. The array of entries for each day was being maintained in the reverse of the order that was expected. * History/WebHistory.mm: (-[WebHistoryPrivate insertItem:forDateKey:]): Maintain the array of entries in descending order. 2007-08-28 Mark Rowe <mrowe@apple.com> Fix the buildbot build. * History/WebHistory.mm: (timeIntervalForBeginningOfDay): Explicitly cast to silence compiler warning. 2007-08-28 Mark Rowe <mrowe@apple.com> Reviewed by Darin Adler. <rdar://problem/5437983> Loading history containing 100,000 entries adds 20s to Safari's startup Move WebHistoryItemPrivate from using a sorted array of NSCalendarDate's that map to a sorted array of arrays of WebHistoryItem's over to using a HashMap of NSTimeIntervals and arrays of WebHistoryItems. NSTimeInterval uses less memory and is substantially cheaper during comparisons than NSCalendarDate. The use of the HashMap avoids the needs to repeatedly search within an array to locate the array that corresponds to the given days history items. The result of these changes is that loading 100,000 history items drops from around 25s to 1.6s. Loading 100 items drops from 0.003s to 0.002s. * History/WebHistory.mm: (-[WebHistoryPrivate init]): (-[WebHistoryPrivate dealloc]): (timeIntervalForBeginningOfDay): Return the NSTimeInterval representing the beginning of the specified day. (-[WebHistoryPrivate findKey:forDay:]): (-[WebHistoryPrivate insertItem:forDateKey:]): Perform a binary search within the day's history items rather than a linear search. (-[WebHistoryPrivate _removeItemFromDateCaches:]): (-[WebHistoryPrivate _addItemToDateCaches:]): (-[WebHistoryPrivate removeAllItems]): (-[WebHistoryPrivate orderedLastVisitedDays]): Generate and cache the sorted NSArray of NSCalendarDate's exposed in the API. This cache is invalidated by _removeItemFromDateCaches: and _addItemToDateCaches: when needed. (-[WebHistoryPrivate orderedItemsLastVisitedOnDay:]): (-[WebHistoryPrivate arrayRepresentation]): (-[WebHistoryPrivate _loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]): Use an autorelease pool to keep the number of live autoreleased objects generated to a reasonable level. * History/WebHistoryItem.mm: (-[WebHistoryItem initWithURLString:title:displayTitle:lastVisitedTimeInterval:]): (-[WebHistoryItem initFromDictionaryRepresentation:]): Use the new HistoryItem constructor that accepts the alternate title rather than setting it after construction. This prevents a modification notification from being sent for each WebHistoryItem that is loaded. * History/WebHistoryItemInternal.h: * History/WebHistoryPrivate.h: * Misc/WebNSCalendarDateExtras.h: Removed as _webkit_compareDay: is no longer used. * Misc/WebNSCalendarDateExtras.m: Removed. * WebKit.xcodeproj/project.pbxproj: 2007-08-28 Anders Carlsson <andersca@apple.com> Reviewed by Darin. <rdar://problem/5298296> XMLHttpRequest readyState 3 & responseText buffer issues Expose WKSetNSURLRequestShouldContentSniff to WebCore. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2007-08-24 Kevin McCullough <kmccullough@apple.com> Reviewed by Darin. <rdar://problem/5437038> 1 credential object leaked for each call to credentialWithUser:password:persistence - Use initWithUser instead of credentialWithUser because credentialWithUser leaks. * Panels/WebAuthenticationPanel.m: (-[WebAuthenticationPanel runAsModalDialogWithChallenge:]): (-[WebAuthenticationPanel sheetDidEnd:returnCode:contextInfo:]): 2007-08-24 Adele Peterson <adele@apple.com> Fix by Darin, reviewed by Adele. Fix for <rdar://problem/5433422> Upon quitting, WebKit loads the WebPlugin shared database and immediately closes it * Plugins/WebPluginDatabase.h: Added closeSharedDatabase, which won't create a new database if we're just trying to close it. * Plugins/WebPluginDatabase.m: (+[WebPluginDatabase closeSharedDatabase]): Added. * WebView/WebView.mm: (-[WebView _close]): Call closeSharedDatabase. (+[WebView _applicationWillTerminate]): Call closeSharedDatabase. 2007-08-24 Timothy Hatcher <timothy@apple.com> Reviewed by John Sullivan. <rdar://problem/5410937> HIWebView in SimpleCarbonWeb doesn't seem to be getting adequate invalidation when window is resized This is a more localized fix for yesterday's change. Now explicitly call _web_layoutIfNeededRecursive inside the HIWebView Draw() function. Adds a FIXME to explain that we need to do layout before Carbon has decided what regions to draw. Doing layout in Draw() will potentially cause drawing to happen in two passes, but this has always been a problem in Carbon. * Carbon/HIWebView.m: (Draw): Call _web_layoutIfNeededRecursive on the main WebHTMLView. (SetFocusPart): Fix to work in ObjC++ (now that HIWebView.m is treated as a ObjC++ file.) * WebView/WebView.mm: Removes the 4 displayIfNeeded methods from yesterday's change. * WebKit.xcodeproj/project.pbxproj: Force the file type of HIWebView.m to ObjC++ so WebHTMLViewInternal.h can be included. 2007-08-23 Timothy Hatcher <timothy@apple.com> Reviewed by Dave Hyatt. <rdar://problem/5410937> HIWebView in SimpleCarbonWeb doesn't seem to be getting adequate invalidation when window is resized The Carbon HIWebView was relying on layout happening when displayIfNeededInRect: was called on the WebView. This would happen on Tiger because _recursiveDisplayRectIfNeededIgnoringOpacity: would always do a layout if needed. Doing a layout in _recursiveDisplayRectIfNeededIgnoringOpacity was removed in Leopard in favor of viewWillDraw, and the fact that adding new dirty rects inside _recursiveDisplayRectIfNeededIgnoringOpacity on Leopard will not cause a drawRect in the same display loop. So any client on Leopard calling displayIfNeeded* on the WebView would get a layout and any new dirty rects. So _web_layoutIfNeededRecursive needs to be called on the main frame's WebHTMLView to make sure we layout and display anything that is really needed. * WebView/WebHTMLView.mm: (-[WebHTMLView _layoutIfNeeded]): (-[WebHTMLView _web_layoutIfNeededRecursive]): * WebView/WebHTMLViewInternal.h: * WebView/WebView.mm: (-[WebView displayIfNeeded]): Call _web_layoutIfNeededRecursive on the main WebHTMLView. (-[WebView displayIfNeededIgnoringOpacity]): Ditto. (-[WebView displayIfNeededInRect:]): Ditto. (-[WebView displayIfNeededInRectIgnoringOpacity:]): Ditto. 2007-08-22 Timothy Hatcher <timothy@apple.com> Rolling out r25102 for <rdar://problem/5410937> until <rdar://problem/5429920> is resolved. * Carbon/CarbonUtils.m: (WebInitForCarbon): (PoolCleaner): * Carbon/CarbonWindowAdapter.h: * Carbon/CarbonWindowAdapter.m: * Carbon/CarbonWindowContentView.h: * Carbon/CarbonWindowContentView.m: * Carbon/CarbonWindowFrame.h: * Carbon/CarbonWindowFrame.m: * Carbon/HIViewAdapter.h: * Carbon/HIViewAdapter.m: * Carbon/HIWebView.h: * Carbon/HIWebView.m: 2007-08-20 John Sullivan <sullivan@apple.com> Reviewed by Adam Roben WebKit part of fix for: <rdar://problem/5417777> WebKit focus ring color no longer matches system focus rings * Misc/WebNSAttributedStringExtras.mm: now includes <WebCore/ColorMac.h> to account for moved declaration * WebView/WebFrame.mm: ditto * WebView/WebViewPrivate.h: * WebView/WebView.mm: (+[WebView _setUsesTestModeFocusRingColor:]): new SPI, calls through to new WebCore function. This is used by DumpRenderTree to make sure the focus ring color is always the same when performing layout tests, regardless of OS X version. (+[WebView _usesTestModeFocusRingColor]): new SPI, calls through to new WebCore function 2007-08-20 Antti Koivisto <antti@apple.com> Reviewed by John. Fix <rdar://problem/5378390> Crash at Range::startContainer() when creating multiple ToDos on the same line Null check range. No layout test, this only happens with ObjC API. * WebView/WebHTMLView.mm: (-[WebHTMLView _expandSelectionToGranularity:]): 2007-08-20 Maciej Stachowiak <mjs@apple.com> Not reviewed, fix for crash on launch bug in last patch. * WebView/WebHTMLView.mm: (-[WebHTMLView setDataSource:]): Remove an assertion, fix code to work right in the face of that condition. 2007-08-18 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - fixed <rdar://problem/5198272> REGRESSION: PLT 1.5% slower due to r21367 (change to start frames with empty documents) There were three main cuases of extra time due to creating the initial empty document: 1) Creating an extra WebHTMLView and swapping it for a new one for each frame created. 2) Parsing the minimal markup for the initial document's contents. 3) Clearing the Window object an extra time and dispatching the corresponding delegate method. The WebKit part of the fixes addresses 1. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::makeDocumentView): When switching from the initial empty document to the first real document, reuse the WebHTMLView. It might actually be a significant performance improvement to always reuse the WebHTMLView, but that is a much riskier change and not needed to fix the regression right now. 2007-08-17 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - WebKit part of fix to scrollbar suppression hack for Leopard * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView reflectScrolledClipView:]): Don't call the superclass method when scrollbars are suppressed. (-[WebDynamicScrollBarsView setScrollBarsSuppressed:repaintOnUnsuppress:]): Instead call it here, when unsuppressing. 2007-08-17 Darin Adler <darin@apple.com> Reviewed by Maciej. - fix <rdar://problem/5414518> Use root URL as origin URL when quarantining downloads * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::setOriginalURLForDownload): Extract only the scheme and host name and make the originating URL from that. * WebKit/StringsNotToBeLocalized.txt: Updated for recent changes. 2007-08-17 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/5398301> Xcode threw mutation exception while enumerating subviews (GC only) I was never able to reproduce this exception. But there can be cases where layout will trigger JavaScript or plugin code that can modify the WebView view hierarchy during a recursive enumeration of all the subviews. This patch does two things: 1) Adds a check in debug builds that will LOG when any view is added or removed during layout. Noting that added views will not recieve layout this round and might paint without first recieving layout. 2) Recursivly builds up an array of descendant WebHTMLViews before calling layout on them. This matches the behavior of makeObjectsPerformSelector: in the non-GC case (making a copy before enumerating.) * WebView/WebHTMLView.mm: (-[WebHTMLView _web_setPrintingModeRecursive]): Use _web_addDescendantWebHTMLViewsToArray to build up an array of WebHTMLViews to enumerate. (-[WebHTMLView _web_clearPrintingModeRecursive]): Ditto. (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): Ditto. (-[WebHTMLView _web_layoutIfNeededRecursive]): Ditto. (-[WebHTMLView _layoutIfNeeded]): Moved to WebHTMLViewFileInternal category. (-[WebHTMLView didAddSubview:]): LOG in debug builds. (-[WebHTMLView willRemoveSubview:]): Ditto. (-[NSView _web_addDescendantWebHTMLViewsToArray:]): Recursivly build an array of descendant WebHTMLViews. * WebView/WebHTMLViewInternal.h: Added a BOOL in WebHTMLViewPrivate to track subview changes (debug only.) 2007-08-17 Anders Carlsson <andersca@apple.com> Reviewed by Dave Hyatt. <rdar://problem/5379040> REGRESSION (Tiger-Leopard): ADOBE: Safari calls NPP_SetWindow with bad values sometimes Pass the right size when creating the views. * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge viewForPluginWithFrame:URL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]): * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createPlugin): 2007-08-13 Geoffrey Garen <ggaren@apple.com> Reviewed by Dave Hyatt. WebKit changes to support new cache eviction model in WebCore. * WebView/WebPreferences.m: (+[WebPreferences initialize]): Modified to reflect new API in WebCore. * WebView/WebView.mm: (+[WebView _initializeCacheSizesIfNecessary]): Slightly increased cache size on low memory systems to avoid affecting the PLT for now. 2007-08-15 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/5410937> HIWebView in SimpleCarbonWeb doesn't seem to be getting adequate invalidation when window is resized HIWebViewCreate now just returns a HIViewRef created with HICocoaViewCreate. This eliminates lots of old code and makes HIWebView a better citizen starting with Leopard. The old code paths are still needed for Tiger, so now most of the files in the WebKit/Carbon directory are #ifdef BUILDING_ON_TIGER. The Tiger code is unchanged and dosen't exhibit the invalidation problem when the window resizes. * Carbon/CarbonUtils.m: (WebInitForCarbon): #ifdef BUILDING_ON_TIGER portions of this code that is not needed on Leopard. * Carbon/CarbonWindowAdapter.h: #ifdef BUILDING_ON_TIGER * Carbon/CarbonWindowAdapter.m: Ditto. * Carbon/CarbonWindowContentView.h: Ditto. * Carbon/CarbonWindowContentView.m: Ditto. * Carbon/CarbonWindowFrame.h: Ditto. * Carbon/CarbonWindowFrame.m: Ditto. * Carbon/HIViewAdapter.h: Ditto. * Carbon/HIViewAdapter.m: Ditto. * Carbon/HIWebView.h: Consolidate two #ifdef __OBJC__ blocks into one. * Carbon/HIWebView.m: Implement Leopard specific HIWebViewCreate, HIWebViewCreateWithClass and HIWebViewGetWebView. (HIWebViewCreate): Call HIWebViewCreateWithClass passing [WebView class]. (HIWebViewCreateWithClass): Call HICocoaViewCreate with an instance of the class passed in. (HIWebViewGetWebView): Call HICocoaViewGetView. 2007-08-14 Brady Eidson <beidson@apple.com> Reviewed by Darin, John, Maciej, Oliver, and Tim <rdar://problem/5394708> - Crash on launch with corrupt icon database Expose some new SPI to help recover from this case should it happen again * Misc/WebIconDatabase.mm: (-[WebIconDatabase init]): Use the new _databaseDirectory to determine where to open the database on disk (+[WebIconDatabase _checkIntegrityBeforeOpening]): Tell the icon database to check integrity when it opens (-[WebIconDatabase _databaseDirectory]): Moved the database-directory-determining logic here as it's now used in two places * Misc/WebIconDatabasePrivate.h: Added _checkIntegrityBeforeOpening SPI for clients to give hints about when the integrity check should run 2007-08-12 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=4648 Shockwave unable to load GZip'd text resources when server sends Content-Length header * Plugins/WebBaseNetscapePluginStream.mm: (-[WebBaseNetscapePluginStream startStreamWithResponse:]): Don't trust -[NSURLResponse expectedContentLength] if Content-Encoding is not identity. 2007-08-10 Timothy Hatcher <timothy@apple.com> Reviewed by Mark Rowe. <rdar://problem/5403302> HIWebView.h should be #ifdefed out for 64-bit * Carbon/HIWebView.h: #ifdef out the header in 64-bit. Adds a comment about 32-bit only. * Carbon/CarbonUtils.h: Ditto. 2007-08-10 Timothy Hatcher <timothy@apple.com> Reviewed by Adam. <rdar://problem/5394449> Stop using some Carbon UI APIs for 64 bit Disable NPObject use in 64-bit on Mac OS X. Also generate the 64-bit export file. * Configurations/WebKit.xcconfig: Point to the generated 64-bit export file. * Plugins/WebBasePluginPackage.h: * Plugins/npfunctions.h: #ifdef out this header in 64-bit on Mac OS X. * WebKit.LP64.exp: Removed. * WebKit.xcodeproj/project.pbxproj: Generate the the 64-bit export file. * WebKitPrefix.h: Define WTF_USE_NPOBJECT. 2007-08-10 Anders Carlsson <andersca@apple.com> Reviewed by Geoff. <rdar://problem/5390568> REGRESSION: -[WebFrame loadHTMLString:baseURL:] leaks the data source If the identifier is not in the map, just bail out instead of asserting. This is a better fix for <rdar://problem/5133420> because WebCore shouldn't have to worry about the lifetime of WebKit objects. * WebView/WebDocumentLoaderMac.mm: (WebDocumentLoaderMac::decreaseLoadCount): 2007-08-10 Oliver Hunt <oliver@apple.com> Reviewed by Darin. Fixed <rdar://problem/5000470> REGRESSION: ATOK IM: reconvert returns incorrect symbol due to inconsistent range domains in TSM by working around <rdar://problem/5400551> [NSAttributedString(WebKitExtras) _web_attributedStringFromRange:] adds whitespace to the requested range We truncate the returned string to the expected length. * WebView/WebHTMLView.mm: (-[WebHTMLView attributedSubstringFromRange:]): 2007-08-09 Mark Rowe <mrowe@apple.com> Reviewed by Antti. <rdar://problem/5400709> Versioning in debug and release builds should include minor and tiny version before + * Configurations/Version.xcconfig: * WebKit.xcodeproj/project.pbxproj: Add a shell script phase to make to dependency between Version.xcconfig and Info.plist explicit to Xcode. 2007-08-08 Kevin Decker <kdecker@apple.com> Reviewed by Anders Carlsson. Fixed: <rdar://problem/5394449> Stop using some Carbon UI APIs for 64 bit #ifdef'd out Netscape style plug-ins on 64-bit because Mac OS X doesn't support 64-bit Carbon UI. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (+[WebBaseNetscapePluginView getCarbonEvent:]): (TSMEventHandler): * Plugins/WebBaseNetscapePluginViewInternal.h: * Plugins/WebBaseNetscapePluginViewPrivate.h: * Plugins/WebBasePluginPackage.m: (+[WebBasePluginPackage pluginWithPath:]): * Plugins/WebNetscapePluginEmbeddedView.h: * Plugins/WebNetscapePluginEmbeddedView.mm: * Plugins/WebNetscapePluginPackage.h: * Plugins/WebNetscapePluginPackage.m: * Plugins/WebNetscapePluginStream.h: * Plugins/WebNetscapePluginStream.mm: * Plugins/WebPluginDatabase.m: (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): * Plugins/npapi.m: * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]): * WebView/WebFrame.mm: * WebView/WebFramePrivate.h: * WebView/WebHTMLView.mm: (-[NSArray _web_makePluginViewsPerformSelector:withObject:]): * WebView/WebHTMLViewInternal.h: 2007-08-07 David Hyatt <hyatt@apple.com> Fix a botched backout of the Quicktime plugin clipping fix that broke Java. The plugin view should not be set to autosize with the parent view. Also, cleanup of script objects was removed accidentally as well. Reviewed by olliej * Plugins/WebPluginController.mm: (-[WebPluginController destroyPlugin:]): (-[WebPluginController destroyAllPlugins]): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:DOMElement:loadManually:]): 2007-08-03 Brady Eidson <beidson@apple.com> Reviewed by Oliver Fix for http://bugs.webkit.org/show_bug.cgi?id=14824 and <rdar://problem/5372989> When unregistering a MIMEType, remove it from the WebCore registry unconditionally When registrying a MIMEType whose view class is WebHTMLView, add it to the WebCore registry * WebView/WebView.mm: (+[WebView _unregisterViewClassAndRepresentationClassForMIMEType:]): (+[WebView _registerViewClass:representationClass:forURLScheme:]): (+[WebView registerViewClass:representationClass:forMIMEType:]): 2007-08-03 Timothy Hatcher <timothy@apple.com> Reviewed by Mark Rowe. Correct the bundle version check to work in Debug and Release builds too. * WebKit.xcodeproj/project.pbxproj: 2007-08-02 Brady Eidson <beidson@apple.com> Reviewed by Tim <rdar://problem/5381463> - setMIMETypesShownAsHTML mutates while enumerating * WebView/WebView.mm: (+[WebView setMIMETypesShownAsHTML:]): Copy the dictionary before we work with it. 2007-08-02 Alice Liu <alice.liu@apple.com> Reviewed by Kevin McCullough. fixed <rdar://problem/5310312> REGRESSION: javascript is mis-escaped at http://labs.zarate.org/passwd causing bookmarklet to break * Misc/WebNSURLExtras.mm: (+[NSURL _web_URLWithUserTypedString:relativeToURL:]): (-[NSURL _web_userVisibleString]): (-[NSURL _web_URLWithLowercasedScheme]): (-[NSURL _web_dataForURLComponentType:]): These 4 changes are just casting changes. (-[NSString _webkit_stringByReplacingValidPercentEscapes]): This change replaces the call to an NSURL method with a webcore one that doesn't abort the escaping effort once an illegal character is encountered. 2007-08-01 Anders Carlsson <andersca@apple.com> Fix build. * Misc/WebNSURLExtras.mm: (+[NSURL _web_URLWithUserTypedString:relativeToURL:]): (-[NSURL _web_userVisibleString]): (-[NSURL _web_URLWithLowercasedScheme]): (-[NSURL _web_dataForURLComponentType:]): 2007-08-01 Alice Liu <alice.liu@apple.com> Reviewed by . Making WebNSURLExtras objc++ * Misc/WebNSURLExtras.m: Removed. * Misc/WebNSURLExtras.mm: Copied from WebKit/Misc/WebNSURLExtras.m. * WebKit.xcodeproj/project.pbxproj: 2007-08-01 Darin Adler <darin@apple.com> Reviewed by Anders Carlsson and Kevin Decker. - fix <rdar://problem/5377432> Removal of MakeDataExecutable from 64-bit breaks WebKit build The trick was to ifdef out more of the code that's only needed to support CFM, which exists only for 32-bit PowerPC. * Plugins/WebNetscapePluginPackage.h: Define a SUPPORT_CFM symbol in this internal header when we support CFM. We support it only on 32-bit PowerPC. Only define the isBundle, isCFM, and connID fields when SUPPORT_CFM is on. Also use ResFileRefNum instead of SInt16. * Plugins/WebNetscapePluginPackage.m: Only compile the function pointer and transition vector functions when SUPPORT_CFM is on. (-[WebNetscapePluginPackage openResourceFile]): Put the non-bundle case inside a SUPPORT_CFM ifdef, since all non-CFM plug-ins are bundles. (-[WebNetscapePluginPackage closeResourceFile:]): Ditto. (-[WebNetscapePluginPackage _initWithPath:]): Use SUPPORT_CFM to compile out the code for non-bundle and bundle-based CFM plug-ins, and code that sets isBundle and isCFM. (-[WebNetscapePluginPackage executableType]): Put the CFM case inside SUPPORT_CFM. (-[WebNetscapePluginPackage load]): Put the non-bundle and CFM cases inside SUPPORT_CFM. There was a bit of dead code here. (-[WebNetscapePluginPackage _unloadWithShutdown:]): Put the non-bundle case inside SUPPORT_CFM. 2007-07-31 Timothy Hatcher <timothy@apple.com> Reviewed by Oliver and Beth. <rdar://problem/5211271> ADOBE Leopard 9A410: At the first Launching InDesign after deactivate, EULA page gets blanked. Check for more Adobe applications that need the frame reload quirk. Also cache the answer so the version check dosen't happen more than once. * WebView/WebView.mm: (-[WebView _needsAdobeFrameReloadingQuirk]): (-[WebView _updateWebCoreSettingsFromPreferences:]): 2007-07-30 Adele Peterson <adele@apple.com> Reviewed by Oliver. Fix for <rdar://problem/5308020> REGRESSION: Command-N with Dvorak-Qwerty keyboard layout stopped working inside web page text fields * WebView/WebHTMLView.mm: (-[WebHTMLView _handleStyleKeyEquivalent:]): The input method may have modified the character we get, so don't use charactersIgnoringModifiers to interpret the character we get. 2007-07-30 John Sullivan <sullivan@apple.com> Reviewed by Darin - fixed <rdar://problem/5216176> Need WebKit SPI to allow clients using embedded WebViews to avoid clipping ends of some printed pages This provides Mail, and other clients that print views that embed WebViews, a way to ensure that the HTML is laid out for printing before pagination occurs. * WebView/WebHTMLViewPrivate.h: new SPI method -_layoutForPrinting * WebView/WebHTMLView.mm: (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): new method, just like existing _web_setPrintingModeRecursive except passes YES for adjustViewSize (-[WebHTMLView _layoutForPrinting]): new SPI method, sets printing mode temporarily to adjust the view size for printing (-[NSView _web_setPrintingModeRecursiveAndAdjustViewSize]): new helper method to do the recursion 2007-07-30 Adele Peterson <adele@apple.com> Reviewed by Darin. Fix for <rdar://problem/5367919> A crash occurs at WebCore::Frame::isFrameSet() when attempting to print a iframe before it loads at http://www.monster.com/ * WebView/WebHTMLView.mm: (-[WebHTMLView knowsPageRange:]): Nil check for frame. 2007-07-30 Anders Carlsson <andersca@apple.com> Reviewed by Darin. <rdar://problem/5370710> REGRESSION: After switching from Bookmark view, the Find Banner won't appear while displaying a PDF file Implement hasHTMLView. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::hasHTMLView): 2007-07-30 Justin Garcia <justin.garcia@apple.com> Reviewed by Tristan. <rdar://problem/5098931> Attachments are lost when they are moved into a ToDo after a delete Mail needs to be asked if it is OK to do the content movement that happens after a deleting in a situation like this one: <div contenteditable="plaintext-only">foo</div><div>^bar</div> so that they can prevent the move or so that they can save content that will be stripped by the move. This could have been done with shouldInsertNode and a new WebViewInsertAction for "moves", but WebKit clients like Mail and DashCode think that a shouldInsert* means that the user pasted something and perform actions only appropriate for pastes. This change is less risky because it won't require those clients to change their code. * DefaultDelegates/WebDefaultEditingDelegate.m: (-[WebDefaultEditingDelegate webView:shouldMoveRangeAfterDelete:replacingRange:]): * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::shouldMoveRangeAfterDelete): * WebView/WebEditingDelegatePrivate.h: 2007-07-29 Adele Peterson <adele@apple.com> Reviewed by John. WebKit part of fix for <rdar://problem/5102522> REGRESSION: Can't tab to webview that doesn't have editable content * WebView/WebHTMLView.mm: (-[WebHTMLView becomeFirstResponder]): Call new setInitialFocus method instead of advanceFocus. 2007-07-27 Darin Adler <darin@apple.com> - fix build * WebKitPrefix.h: Removed the USING_WEBCORE_XXX definitions. * WebView/WebHTMLView.mm: (-[WebHTMLView delete:]): Fixed this to use WebCore again; I accidentally revived a dead code path that didn't work in the last patch! (-[WebHTMLView deleteToMark:]): Ditto. (-[WebHTMLView copy:]): Removed the unused side of the ifdef. (-[WebHTMLView cut:]): Ditto. (-[WebHTMLView paste:]): Ditto. 2007-07-27 Darin Adler <darin@apple.com> Reviewed by Tim Hatcher and Oliver Hunt. - fix <rdar://problem/5355815> webView:doCommandBySelector: isn't getting called for copy: Added code so that webView:doCommandBySelector: is called for every command. * WebView/WebHTMLView.mm: Made 44 of the commands use the WEBCORE_COMMAND macro instead of being handwritten. For all the others, added invocation of COMMAND_PROLOGUE macro at the start of the command. (-[WebHTMLView callDelegateDoCommandBySelectorIfNeeded:]): Added. (-[WebHTMLView callWebCoreCommand:]): Added. (-[WebHTMLView delete:]): Removed unused code path -- easy to bring back some day, but we don't need it compiled in. (-[WebHTMLView deleteBackwardByDecomposingPreviousCharacter:]): Changed so this doesn't call deleteBackward: any more so we don't call the delegate two times. (-[WebHTMLView deleteToMark:]): Changed so this doesn't call delete: any more so we don't call the delegate two times. (-[WebHTMLView selectToMark:]): Changed so this doesn't call setMark: any more so we don't call the delegate two times. (-[WebHTMLView doCommandBySelector:]): Added code to set the private variable selectorForDoCommandBySelector. This allows callDelegateDoCommandBySelectorIfNeeded to detect that we've already called the delegate and avoids calling it twice. * WebView/WebHTMLViewInternal.h: Added the selectorForDoCommandBySelector field. 2007-07-26 Alexey Proskuryakov <ap@webkit.org> Reviewed by Oliver. http://bugs.webkit.org/show_bug.cgi?id=14733 Add a logging channel for text input <rdar://problem/5364667> * Misc/WebKitLogging.h: * Misc/WebKitLogging.m: (WebKitInitializeLoggingChannelsIfNecessary): * WebView/WebHTMLView.mm: (-[WebHTMLView validAttributesForMarkedText]): (-[WebHTMLView textStorage]): (-[WebHTMLView characterIndexForPoint:]): (-[WebHTMLView firstRectForCharacterRange:]): (-[WebHTMLView selectedRange]): (-[WebHTMLView markedRange]): (-[WebHTMLView attributedSubstringFromRange:]): (-[WebHTMLView hasMarkedText]): (-[WebHTMLView unmarkText]): (-[WebHTMLView setMarkedText:selectedRange:]): (-[WebHTMLView doCommandBySelector:]): (-[WebHTMLView insertText:]): 2007-07-26 Darin Adler <darin@apple.com> - fix Tiger build * Misc/WebTypesInternal.h: For use inside the library, use NSInteger and NSUInteger, just like on Leopard. WebNSInteger and WebNSUInteger are still present, but they are used in public and private headers only. * Carbon/CarbonWindowAdapter.m: * Carbon/CarbonWindowFrame.m: * DefaultDelegates/WebScriptDebugServer.m: * History/WebBackForwardList.mm: * Misc/WebDownload.m: * Misc/WebSearchableTextView.m: * Plugins/WebBaseNetscapePluginView.mm: * WebCoreSupport/WebFrameLoaderClient.mm: * WebView/WebHTMLView.mm: * WebView/WebPDFView.mm: * WebView/WebView.mm: * WebView/WebViewInternal.h: Update all implementation files and internal headers to use NSInteger and NSUInteger rather than WebNSInteger and WebNSUInteger. 2007-07-26 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker - fixed <rdar://problem/5362989> Searching a pdf in some modes shows hilights for all instances of the word, even those not on the current page It turns out that there were three different issues here, all contributing to incorrect display of multiple matches for PDF pages in certain display modes. (1) in non-continuous display modes, we weren't updating the match rects when the displayed page is changed with page up/down (e.g.); (2) the mechanism to update the match rects on scrolling was busted except for the first scroll away from 0,0; (3) the PDFKit API returns selection bounds for non-displayed pages in non-continuous modes just as if they were the displayed pages. This patch fixes all three issues. * WebView/WebPDFView.h: made ivar name even longer * WebView/WebPDFView.mm: (-[WebPDFView setPDFDocument:]): updated for ivar name change (-[WebPDFView viewDidMoveToWindow]): observe page-change notifications as well as the others; this is necessary because in the non-continuous modes the view can be completely updated without any scrolling involved (problem 1) (-[WebPDFView viewWillMoveToWindow:]): stop observing page-change notifications (-[WebPDFView rectsForTextMatches]): skip any pages that aren't visible; this avoids treating matches on non-displayed non-continous modes as if they were on the displayed page (problem 3) (-[WebPDFView _PDFDocumentViewMightHaveScrolled:]): after checking whether scroll position has changed since we last checked it, remember the new one (d'oh!) (problem 2) (-[WebPDFView _scaleOrDisplayModeOrPageChanged:]): renamed to include page changes (-[WebPDFView _visiblePDFPages]): new method, returns the set of pages that are at least partly visible 2007-07-24 Oliver Hunt <oliver@apple.com> Reviewed by Adam and Justin. <rdar://problem/5141779> WebView editableDOMRangeForPoint: & moveDragCaretToPoint: returns last position in DOMText range editableDOMRangeForPoint:, moveDragCaretToPoint:, and removeDragCaret now call directly into WebCore without relying on bridge look up through the now removed _bridgeAtPoint:. * WebKit.xcodeproj/project.pbxproj: * WebView/WebView.mm: (-[WebView moveDragCaretToPoint:]): (-[WebView removeDragCaret]): (-[WebView editableDOMRangeForPoint:]): 2007-07-24 Kevin Decker <kdecker@apple.com> Reviewed by Anders. <rdar://problem/4699455> REGRESSION (Safari 2->Safari 3): Adobe Reader 7.0.8 plug-in doesn't work * Plugins/WebNetscapePluginEmbeddedView.h: Added a #define that renames this class to "WebNetscapePluginDocumentView" This is necessary because the Adobe 7.x Acrobat plug-in has a hard coded check for a view named "WebNetscapePluginDocumentView" and will not function correctly if it doesn't find a view in the hierarchy without the old class name. 2007-07-24 Mark Rowe <mrowe@apple.com> Reviewed by Antti. <rdar://problem/5356666> NSMenuItem's seen leaking on buildbot * WebCoreSupport/WebContextMenuClient.mm: (WebContextMenuClient::contextMenuItemSelected): Release platformItem as we were transferred its ownership by releasePlatformDescription. 2007-07-23 Oliver Hunt <oliver@apple.com> Reviewed by Darin. We have to be able to support insertText: followed by doCommandBySelector: in order to support the 2- and 3-Set Korean and RuSwitcher IMs at least. * WebView/WebHTMLView.mm: (-[WebHTMLView insertText:]): 2007-07-23 Alice Liu <alice.liu@apple.com> Reverting change 24535 now that a solution has been found that doesn't involve exposing an interface unnecessarily. * WebView/WebHTMLView.mm: * WebView/WebHTMLViewPrivate.h: 2007-07-23 Alice Liu <alice.liu@apple.com> Reviewed by Oliver Hunt. Expose [WebHTMLView hasMarkedText] to fix <rdar://problem/4830074> autocomplete breaks Japanese typing * WebView/WebHTMLView.mm: * WebView/WebHTMLViewPrivate.h: 2007-07-22 Darin Adler <darin@apple.com> * StringsNotToBeLocalized.txt: Updated for recent changes. 2007-07-21 Adam Roben <aroben@apple.com> Fix REGRESSION: Right-click/control-click broken http://bugs.webkit.org/show_bug.cgi?id=14658 <rdar://problem/5346830> Reviewed by Mitz. * WebCoreSupport/WebContextMenuClient.mm: (fixMenusToSendToOldClients): Update defaultItemsCount after removing items from the defaultItems array. 2007-07-20 Oliver Hunt <oliver@apple.com> Reviewed by Adele. <rdar://problem/5319438> REGRESSION: Cannot paste into an active inline input area (14522) http://bugs.webkit.org/show_bug.cgi?id=14522 AppKit sends noop: to -[WebHTMLView doCommandBySelector:] when an IM does not handle event, we now check this as it is necessary to work around some IMs that do send messages (such as insertText: rather than unmarkText: to confirm a composition) * WebView/WebHTMLView.mm: (-[WebHTMLView _interceptEditingKeyEvent:shouldSaveCommand:]): (-[WebHTMLView doCommandBySelector:]): * WebView/WebHTMLViewInternal.h: 2007-07-20 Brady Eidson <beidson@apple.com> Reviewed by Adele and Andersca <rdar://problem/5336105> - WebBackForwardList created from scratch is unusable (always leads to crash) * History/WebBackForwardList.mm: (-[WebBackForwardList init]): Have a default initializer that uses an empty BackFowardList not associated with a page. * WebView/WebFrame.mm: (kit): For clarity's sake, this should return nil, not 0 2007-07-20 Justin Garcia <justin.garcia@apple.com> Reviewed by Darin. <rdar://problem/5109817> Ctrl-click on word in non-editable text doesn't select it * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: Removed the method for enabling/disabling word selection on right click. * WebView/WebView.mm: Ditto. * WebView/WebViewPrivate.h: Removed the getter/setter entirely, it was in a private Category for Mail, but wasn't used by Mail on Tiger or Leopard, they apparently implement word selection on their own. 2007-07-20 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/5199812> WebView needs to adopt viewWillDraw (moving off of _propagateDirtyRectsToOpaqueAncestors) <rdar://problem/5017301> REGRESSION: Scroller in Widget Manager splits down the middle while scrolling On Leopard _propagateDirtyRectsToOpaqueAncestors is no longer called by AppKit. Also marking new dirty rects underneath _recursiveDisplayRectIfNeededIgnoringOpacity will wait until the next runloop to draw them, causing rendering to happen in two steps instead of one as WebCore expected. * WebView/WebHTMLView.mm: (-[WebHTMLView _topHTMLView]): Move to the file internal category so we can use it in viewWillDraw. (-[WebHTMLView _isTopHTMLView]): Ditto. (-[WebHTMLView _propagateDirtyRectsToOpaqueAncestors]): #ifdef for Tiger only. (-[WebHTMLView viewWillDraw]): Do a recursive layout if this is the top WebHTMLView. (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]): Don't do layout here on Leopard since viewWillDraw handled it. (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): Ditto. 2007-07-20 Beth Dakin <bdakin@apple.com> Reviewed by Tim and Geoff. Fix for <rdar://problem/5346855> Mail crashes at WebCore::RenderTableSection:paint + 846 when attempting to display a HTML based message After reapplying styles, the RenderView needs layout. However, layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize used to return early if the WebHTMLView itself does not need layout. Because the WebHTMLView is not necessarily in synch with the RenderTree, returning early here can get us into a bad situation where we paint before laying out the Render Tree. This patch checks both the WebHTMLView and the bridge (which checks the RenderView, etc), so that we do not return early without laying out the Render Tree. Some day, we should phase out WebHTMLView keeping track of needsLayout at all. But that is a bit beyond the scope of this fix. * WebView/WebHTMLView.mm: (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): 2007-07-20 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler and David Harrison - fixed <rdar://problem/5307075> REGRESSION: Bottom of some printed pages are truncated The "avoid orphan" code I added a year ago was causing the page to be imaged to a larger height (good), but not shrinking everything to compensate (bad). Bad one-year-ago me! * WebView/WebHTMLViewInternal.h: added avoidingPrintOrphan boolean * WebView/WebHTMLView.mm: (-[WebHTMLView _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]): clear _private->avoidingPrintOrphan when clearing _private->printing (-[WebHTMLView _scaleFactorForPrintOperation:]): take _private->avoidingPrintOrphan into account when computing the scale factor (-[WebHTMLView knowsPageRange:]): set _private->avoidingPrintOrphan when we're shrinking to avoid an orphan 2007-07-19 Adam Roben <aroben@apple.com> Fix <rdar://problem/5344972> REGRESSION: A error dialog occurs when attempting to ctrl-click in a iChat message window (webview) Reviewed by Oliver. * WebCoreSupport/WebContextMenuClient.mm: (fixMenusToSendToOldClients): Don't check for the Inspect Element item if we have fewer than 2 items. 2007-07-18 Geoffrey Garen <ggaren@apple.com> Reviewed by Dave Hyatt. <rdar://problem/5345099> Reduced default WebCore cache size from 32 MB to 23 MB on systems below 512 MB RAM. This improves RPRVT usage in the Safari pageout test by ~10% on a system with 384 MB RAM. At 23 MB, no extra resources are evicted from the cache during a PLT run, so this is a safe change PLT-wise. 23 MB is also seems to be a generous number in real world usage. * WebView/WebPreferences.m: (+[WebPreferences initialize]): 2007-07-18 Anders Carlsson <andersca@apple.com> Reviewed by Geoff. <rdar://problem/5341133> REGRESSION (Safari 2->Safari 3): DjVu plug-in doesn't load in Safari 3 The DjVu plug-in uses the size of the passed in NPNetscapeFuncs struct to copy it over to a NPNetscapeFuncs struct whose size was determined when DjVu was compiled. This means that when we add extra functions to the vtable, DjVu will segfault copying it into the (too small) destination struct. Fix this by special-casing the DjVu plug-in and setting the NPNetscapeFuncs size to be the same size as what DjVu expects. * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage _applyDjVuWorkaround]): (-[WebNetscapePluginPackage load]): 2007-07-18 Timothy Hatcher <timothy@apple.com> Reviewed by Adam. <rdar://problem/5343767> Should have a way to disable the Web Inspector Adds a new DisableWebKitDeveloperExtras default that will force the Web Inspector to be disabled. This overrides the WebKitDeveloperExtras and IncludeDebugMenu default. It also disables the Web Inspector in Debug builds. * WebView/WebView.mm: (+[WebView _developerExtrasEnabled]): Check for the DisableWebKitDeveloperExtras default. (-[WebView _commonInitializationWithFrameName:groupName:]): Make a new WebInspectorClient when making the Page. 2007-07-18 Anders Carlsson <andersca@apple.com> Build fix. * Misc/WebNSAttributedStringExtras.mm: 2007-07-18 Sam Weinig <sam@webkit.org> Rubber-stamped by Adam Roben. Update after renaming MimeTypeRegistry to MIMETypeRegistry. * Misc/WebNSPasteboardExtras.mm: (-[NSPasteboard _web_writePromisedRTFDFromArchive:containsImage:]): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge determineObjectFromMIMEType:URL:]): * WebView/WebDataSource.mm: (-[WebDataSource _documentFragmentWithArchive:]): * WebView/WebHTMLRepresentation.mm: (+[WebHTMLRepresentation supportedNonImageMIMETypes]): (+[WebHTMLRepresentation supportedImageMIMETypes]): * WebView/WebHTMLView.mm: (-[WebHTMLView _imageExistsAtPaths:]): 2007-07-18 Tristan O'Tierney <tristan@apple.com> Reviewed by Maciej Stachowiak. <rdar://problem/5341334> Alt-clicking a link in Safari does not register original URL info with gatekeeper <rdar://problem/5342570> REGRESSION: A hang occurs when attempting to open a attached file from a .Mac web mail message * WebCoreSupport/WebFrameLoaderClient.h: Added a new method, setOriginalURLForDownload, for both download() and startDownload() to share. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::download): Moved all the gatekeeper code into setOriginalURLForDownload. (WebFrameLoaderClient::setOriginalURLForDownload): Same code that was in download() but moved into a single place for both startDownload and download to use. Also returned the boolean logic for detecting _wasUserGesture back to it's previous state, since my prior change was incorrect. Additionally I found a loop index bug with backListCount and fixed it. (WebFrameLoaderClient::startDownload): Calls out to setOriginalURLForDownload after a download is created. * WebView/WebView.mm: (-[WebView _downloadURL:]): Changed to return the WebDownload object created inside _downloadURL * WebView/WebViewInternal.h: Changed _downloadURL to return the WebDownload it creates. 2007-07-17 Timothy Hatcher <timothy@apple.com> Reviewed by Geoff. <rdar://problem/5336267> loadData:MIMEType:textEncodingName:baseURL: doesn't like relative URLs Get the absoluteURL from any user supplied NSURL before we pass it down to WebCore. * WebView/WebFrame.mm: (-[WebFrame _loadURL:referrer:intoChild:]): (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): * WebView/WebView.mm: (-[WebView userAgentForURL:]): 2007-07-17 Adam Roben <aroben@apple.com> Fix Bug 14324: Cannot remove/customize the "Inspect Element" contextual menu item http://bugs.webkit.org/show_bug.cgi?id=14324 Only clients linking against new versions of WebKit will see the item. I've maintained our behavior for old clients of not including the Inspect Element item in the menu items passed to the UI delegate. Reviewed by Tim. * Misc/WebKitVersionChecks.h: Added a new constant. * WebCoreSupport/WebContextMenuClient.mm: (isPreInspectElementTagClient): Added. (fixMenusToSendToOldClients): Return an array of items that should be appended to the menu received from the delegate. (fixMenusReceivedFromOldClients): Append the saved items to the array. (WebContextMenuClient::getCustomMenuFromDefaultItems): Retain/release the saved items. 2007-07-17 Adam Roben <aroben@apple.com> Remove WebContextMenuClient::shouldIncludeInspectElementItem Reviewed by Tim. * WebCoreSupport/WebContextMenuClient.h: * WebCoreSupport/WebContextMenuClient.mm: 2007-07-17 Adam Roben <aroben@apple.com> Initialize Settings::developerExtrasEnabled Reviewed by Tim. * WebView/WebView.mm: (-[WebView _updateWebCoreSettingsFromPreferences:]): 2007-07-17 Geoffrey Garen <ggaren@apple.com> Build fix. * WebView/WebFrame.mm: (-[WebFrame _loadURL:referrer:intoChild:]): * WebView/WebFramePrivate.h: 2007-07-17 Tristan O'Tierney <tristan@apple.com> Reviewed by Maciej Stachowiak. <rdar://problem/5294691> Source of file is misrepresented if downloaded by typing in URL in Safari address bar * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::download): Revised code to check the initial request's referrer before assuming it has a history to check. 2007-07-16 Brady Eidson <beidson@apple.com> Reviewed by Adam Begin the arduous task of localizing FTP directory listings while removing a global initializer! * English.lproj/Localizable.strings: * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory unknownFileSizeText]): 2007-07-16 Adam Roben <aroben@apple.com> Move printing from WebFrameBridge to WebChromeClient Reviewed by Darin. * WebCoreSupport/WebChromeClient.h: Updated for ChromeClient changes. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::print): Moved code from WebFrameBridge. * WebCoreSupport/WebFrameBridge.mm: Removed -print. 2007-07-16 Darin Adler <darin@apple.com> * StringsNotToBeLocalized.txt: Update for recent changes. 2007-07-16 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker and Darin Adler - fixed <rdar://problem/5337529> Holes in Find banner overlay on PDF pages are left in wrong place after changing scale * WebView/WebPDFView.mm: (-[WebPDFView _scaleOrDisplayModeChanged:]): tell UI delegate that the entire PDF view has been redrawn 2007-07-14 Brady Eidson <beidson@apple.com> 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:]): 2007-07-13 Anders Carlsson <andersca@apple.com> Reviewed by Maciej. <rdar://problem/5290103> Assert failure when loading page with multipart resource Don't try to call the delegate method if the resource object doesn't exist in the identifier map. When a multipart resource has finished loading one part, it is removed from the web view identifier map. This is not an ideal fix, a better fix would be to special-case multipart resources and not remove them when the first part has finished loading. I've filed <rdar://problem/5335034> to track doing that. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidReceiveResponse): (WebFrameLoaderClient::willCacheResponse): (WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebFrameLoaderClient::dispatchDidFinishLoading): (WebFrameLoaderClient::dispatchDidFailLoading): 2007-07-13 Timothy Hatcher <timothy@apple.com> Reviewed by Oliver Hunt. <rdar://problem/5333766> Can't include WebEditingDelegatePrivate.h * WebView/WebEditingDelegatePrivate.h: Changed the include to be a framework include, so other projects can use this header. 2007-07-12 Anders Carlsson <andersca@apple.com> Reviewed by Darin and Maciej. <rdar://problem/5271096> panic after Safari stress test, caused by port leak Replace uses of -[NSObject performSelector:withObject:afterDelay:] with CFRunLoopTimer. performSelector causes the target (the WebHTMLView in this case) to be retained until the timer fires. Furthermore, when running the PLT or iBench, the timers will not fire until the main loop is entered (usually after running all tests). This means that the timers and ports will not be released until after the test has finished running. * WebView/WebHTMLView.mm: (-[WebHTMLViewPrivate dealloc]): (-[WebHTMLView _cancelUpdateMouseoverTimer]): (-[WebHTMLView _updateMouseoverWithFakeEvent]): (-[WebHTMLView _updateMouseoverTimerCallback:]): (-[WebHTMLView _frameOrBoundsChanged]): (-[WebHTMLView _updateActiveState]): (-[WebHTMLView _updateActiveStateTimerCallback:]): (-[WebHTMLView viewWillMoveToWindow:]): (-[WebHTMLView viewDidMoveToWindow]): (-[WebHTMLView mouseDown:]): (-[WebTextCompleteController dealloc]): * WebView/WebHTMLViewInternal.h: 2007-07-13 Mark Rowe <mrowe@apple.com> Reviewed by Mitz. Build fix. Stub out WebChromeClient::print. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::print): 2007-07-11 Timothy Hatcher <timothy@apple.com> Reviewed by Oliver. <rdar://problem/5108789> WEBVIEW: Drawing artifacts when dragging in IB Interface Builder 3 is relying on KVO notifications for frameOrigin and frameSize, among other standard NSView keys. Change automaticallyNotifiesObserversForKey to return NO only for keys WebView manually fires notifications for. * WebView/WebView.mm: (+[WebView automaticallyNotifiesObserversForKey:]): Selectivly return NO for keys we manually fire. (-[WebView _declaredKeys]): Code clean up. 2007-07-10 Antti Koivisto <antti@apple.com> Reviewed by John. Fix <rdar://problem/4570550> Hang in layout/layoutBlock/layoutBlockChildren preparing to print certain Mail messages When printing from Mail, WebHTMLView is a subview of the view that is actually printed and does not receive calls that would set it to printing mode. Method adjustPageHeightNew is called repeatedly (for each page) during printing and it enables printing mode temporarily for each call. This triggers two full style recalcs and layouts each time making printing at least O(n^2). Instead of enabling printing mode and resetting it back immediatly do the resetting asynchronously, after all adjustPageHeightNew calls are done. Normal Safari printing is not affected as adjustPageHeightNew is only called in case WebHTMLView is embedded in the view that is being printed. No automatic test possible, requires printing and non-Safari client. * WebView/WebHTMLView.mm: (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): 2007-07-10 Geoffrey Garen <ggaren@apple.com> Reviewed by Maciej Stachowiak. - Fixed <rdar://problem/5049509> REGRESSION(10.4.9-9A377a): REAP Suite installer shows empty modal alert window (hangs) if user cancels during "installing shared components" phase Added Adobe installers to the family of apps that need a data load loading quirk. Added a linked-on-or-after check because this code is no longer Tiger-only. I tested this code on Tiger and Leopard. * Misc/WebKitVersionChecks.h: * WebKit.xcodeproj/project.pbxproj: * WebView/WebDocumentLoaderMac.mm: (needsDataLoadWorkaround): (WebDocumentLoaderMac::setDataSource): 2007-07-10 Darin Adler <darin@apple.com> - fix build * WebView/WebHTMLView.mm: Add include of ContextMenu.h. 2007-07-10 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - <rdar://problem/5321953> remove workaround for fixed AppKit mouse moved bug * WebView/WebHTMLView.mm: Put the workaround for bug 3429631 inside an ifdef BUILDING_ON_TIGER. 2007-07-09 Anders Carlsson <andersca@apple.com> Reviewed by Oliver. <rdar://problem/4954319> Acrobat 7 / Safari crash: CrashTracer: 99 crashes in Safari at com.apple.WebCore: WebCore::NetscapePlugInStreamLoader::isDone const + 0 Add a new initWithFrameLoader: method to WebNetscapePluginStream which is to be used when the stream is a "fake" stream for full frame plug-ins. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView pluginView:receivedResponse:]): * Plugins/WebNetscapePluginStream.h: * Plugins/WebNetscapePluginStream.mm: (-[WebNetscapePluginStream initWithFrameLoader:]): (-[WebNetscapePluginStream initWithRequest:plugin:notifyData:sendNotification:]): (-[WebNetscapePluginStream start]): (-[WebNetscapePluginStream cancelLoadWithError:]): (-[WebNetscapePluginStream stop]): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createFrame): 2007-07-09 John Sullivan <sullivan@apple.com> Reviewed by Darin - fixed <rdar://problem/5320208> WebKit should prevent Time Machine from backing up WebKit clients' icon databases * Misc/WebIconDatabase.mm: (-[WebIconDatabase init]): Re-added the code to exclude the icon database from backups. We now do this at the same time we (try to) import the old icon database format, which happens only once per icon database's lifetime. (-[WebIconDatabase _importToWebCoreFormat]): Assert that we haven't imported yet rather than bailing out. It's now the caller's responsibility to check whether we've imported yet. 2007-07-08 John Sullivan <sullivan@apple.com> * Misc/WebIconDatabase.mm: (-[WebIconDatabase init]): Removed the code to exclude the icon database from backups. We still want to do this, but in a way that only runs once ever, instead of once per launch, due to performance concerns. 2007-07-07 Darin Adler <darin@apple.com> Reviewed by Maciej. - fix <rdar://problem/5124665> WebCore secondary-thread assertion should use linked-on-or-after check instead of building on Tiger check * Misc/WebKitVersionChecks.h: Added WEBKIT_FIRST_VERSION_WITH_MAIN_THREAD_EXCEPTIONS. * WebView/WebFrameView.mm: (-[WebFrameView initWithFrame:]): In first-time initialization block, check for binaries linked against older versions of WebKit, and set the default thread violation behavior to LogOnFirstThreadViolation. * WebView/WebView.mm: (+[WebView initialize]): Improved comments. 2007-07-06 Oliver Hunt <oliver@apple.com> Reviewed by Maciej. <rdar://problem/5318756> Need to refactor IM/Marked text code to share logic with windows. Moved a number of methods from WebHTMLView into WebCore. Replaced bridge methods with calls directly into WebCore objects. * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLView.mm: (-[WebHTMLView setMarkedText:selectedRange:]): Now calls WebCore object methods directly, rather than calling via the bridge. 2007-07-06 John Sullivan <sullivan@apple.com> Reviewed by Brady - WebKit part of fix for: <rdar://problem/5310739> Time Machine shouldn't back up WebKit's icon database files * Misc/WebIconDatabase.mm: (-[WebIconDatabase init]): Use CSBackupSetItemExcluded to tell Time Machine not to back up the icon database file 2007-07-07 Mark Rowe <mrowe@apple.com> Build fix. Update WebDynamicScrollBarsView.h to include methods added and used in r24060. * WebView/WebDynamicScrollBarsView.h: 2007-07-05 Timothy Hatcher <timothy@apple.com> Reviewed by John. <rdar://problem/5236277> REGRESSION-9A458: SPI for setting scroll bar behavior doesn't work Calling setHorizontalScrollingMode: calls updateScrollers before returning, this will cause WebCore to reset the scrolling mode based on the CSS overflow rules. So the setAlwaysShowHorizontalScroller: and setAlwaysShowVerticalScroller: methods needed a way to lock the scrolling mode before calling updateScrollers. * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): (-[WebDynamicScrollBarsView setHorizontalScrollingMode:]): (-[WebDynamicScrollBarsView setHorizontalScrollingMode:andLock:]): (-[WebDynamicScrollBarsView setVerticalScrollingMode:]): (-[WebDynamicScrollBarsView setVerticalScrollingMode:andLock:]): (-[WebDynamicScrollBarsView setScrollingMode:]): (-[WebDynamicScrollBarsView setScrollingMode:andLock:]): * WebView/WebView.mm: (-[WebView setAlwaysShowVerticalScroller:]): (-[WebView setAlwaysShowHorizontalScroller:]): 2007-07-06 Mitz Pettel <mitz@webkit.org> Reviewed by Maciej. - fix http://bugs.webkit.org/show_bug.cgi?id=10267 Can't scroll page downwards with scroll wheel, when pointer is on top of non-scrolling iframe * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView scrollWheel:]): Override the superclass implementation to forward the wheel event to the next responder if this view does not allow scrolling in the event's direction. 2007-07-05 John Sullivan <sullivan@apple.com> Reviewed by Adam - WebKit part of fix for <rdar://problem/5315033> * WebView/WebDocumentPrivate.h: new selectionImageForcingBlackText: method. selectionImageForcingWhiteText: is no longer used and was never in an official release of WebKit, so it could be removed, except that doing so would cause trouble for people using nightly WebKit with Safari 3.0 beta. So I left it in, but made it just force black text instead of white text, which will look different for those nightly WebKit/Safari 3.0 beta people but not break anything. * Misc/WebSearchableTextView.m: (-[WebSearchableTextView selectionImageForcingBlackText:]): new unimplemented protocol method for this obsolete class * WebView/WebHTMLView.mm: (-[WebHTMLView selectionImageForcingBlackText:]): calls through to WebCore the way selectionImageForcingWhiteText: used to (-[WebHTMLView selectionImageForcingWhiteText:]): now just calls selectionImageForcingBlackText:, thus not working as you would expect from the name * WebView/WebPDFView.mm: (-[WebPDFView selectionImageForcingBlackText:]): guts of old selectionImageForcingWhiteText:, but with black substituted for white (-[WebPDFView selectionImageForcingWhiteText:]): now just calls selectionImageForcingBlackText:, thus not working as you would expect from the name 2007-07-05 Timothy Hatcher <timothy@apple.com> Reviewed by John. <rdar://problem/5314993> Shiira 2.1 throws an exception open a new window: -[WebInspector window]: unrecognized selector Add an empty implementation of this method to prevent Shiira from throwing an exception. Also log that this method is obsolete and the class will be removed. * WebInspector/WebInspector.mm: (-[WebInspector window]): 2007-07-04 Adam Roben <aroben@apple.com> Move tooltip logic down into WebCore so that it can be shared cross-platform Reviewed by Sam. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::setToolTip): Added. * WebView/WebHTMLView.mm: Removed _resetCachedWebPreferences. (-[WebHTMLView _updateMouseoverWithEvent:]): Removed tooltip code. (-[WebHTMLView initWithFrame:]): Removed call to _resetCachedWebPreferences. (-[WebHTMLView setDataSource:]): Ditto. * WebView/WebHTMLViewInternal.h: Removed showsURLsInToolTips ivar. * WebView/WebHTMLViewPrivate.h: Added declaration for _setTooltip so that WebChromeClient can call it. 2007-07-04 Adam Roben <aroben@apple.com> Initialize Settings::showsURLsInToolTips Reviewed by Sam. * WebView/WebView.mm: (-[WebView _updateWebCoreSettingsFromPreferences:]): 2007-07-04 Adam Roben <aroben@apple.com> Removed call to mouseDidMoveOverElement now that WebCore handles it Reviewed by Sam. * WebView/WebHTMLView.mm: (-[WebHTMLView _updateMouseoverWithEvent:]): 2007-07-04 Adam Roben <aroben@apple.com> Add WebChromeClient::mouseDidMoveOverElement This is not called yet. Reviewed by Sam. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: 2007-07-03 Darin Adler <darin@apple.com> * StringsNotToBeLocalized.txt: Updated for recent changes. 2007-07-03 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Remove HIWebView in 64-bit. Also disable a few calls that are now gone in 64-bit and filed these bugs: <rdar://problem/5311653> WebKit needs to adopt HIGetMousePosition where we used GetGlobalMouse before <rdar://problem/5311648> WebKit needs to move off of CopyEvent in WebBaseNetscapePluginView <rdar://problem/5311640> WebKit needs a new solution for HISearchWindowShow on 64-bit * Carbon/CarbonUtils.m: * Carbon/CarbonWindowAdapter.m: * Carbon/CarbonWindowContentView.m: * Carbon/CarbonWindowFrame.m: * Carbon/HIViewAdapter.m: (SetViewNeedsDisplay): * Carbon/HIWebView.m: (Draw): (SyncFrame): * Configurations/WebKit.xcconfig: * Plugins/WebBaseNetscapePluginView.mm: (+[WebBaseNetscapePluginView getCarbonEvent:]): (TSMEventHandler): * WebKit.LP64.exp: Added. * WebView/WebView.mm: (-[WebView _searchWithSpotlightFromMenu:]): 2007-07-03 Adam Roben <aroben@apple.com> Merge the Windows and Mac localized strings and exceptions files Reviewed by Darin and Anders. * English.lproj/Localizable.strings: Added Windows strings. * StringsNotToBeLocalized.txt: Renamed from WebKit/English.lproj/StringsNotToBeLocalized.txt. 2007-07-03 Adele Peterson <adele@apple.com> Removed printf I accidently left in. * Misc/WebNSURLExtras.m: (mapHostNames): 2007-07-03 Adele Peterson <adele@apple.com> Reviewed by Darin. Fix for: <rdar://problem/5292988> domain names shouldn't contain ignorable characters * Misc/WebNSURLExtras.m: (isLookalikeCharacter): Renamed. Also excludes any non-printable character, any character considered as whitespace that isn't already converted to a space by ICU, any ignorable character, and any character excluded in Mozilla's blacklist: http://kb.mozillazine.org/Network.IDN.blacklist_chars (allCharactersInIDNScriptWhiteList): 2007-07-03 Darin Adler <darin@apple.com> Reviewed by Maciej. - fix <rdar://problem/5310848> WebDataSource lifetime problem -- may be cause of the leaks seen on the buildbot * WebView/WebDataSource.mm: (-[WebDataSourcePrivate dealloc]): Added a call to the new detachDataSource function. (-[WebDataSourcePrivate finalize]): Ditto. * WebView/WebDocumentLoaderMac.h: Added detachDataSource function to be used when the WebDataSource is deallocated. Added retain/releaseDataSource helper functions to be used to retain and release the data source object. Replaced the m_hasEverBeenDetached boolean with a more primitive and hence easier to understand m_isDataSourceRetained boolean. * WebView/WebDocumentLoaderMac.mm: (WebDocumentLoaderMac::WebDocumentLoaderMac): Initialize m_isDataSourceRetained to false. (WebDocumentLoaderMac::setDataSource): Call retainDataSource instead of calling HardRetain on the dataSource parameter. Also updated a comment. (WebDocumentLoaderMac::attachToFrame): Call retainDataSource unconditionally rather than trying to use m_hasEverBeenDetached to decide if a retain is needed. Also got rid of an assertion that m_loadingResources is empty -- not important any more. (WebDocumentLoaderMac::detachFromFrame): Call releaseDataSource instead of using HardRelease, but only if m_loadingResources is empty. If it's non-empty, then we'll do the releaseDataSource later in decreaseLoadCount. (WebDocumentLoaderMac::increaseLoadCount): Call retainDataSource unconditionally rather than calling HardRetain only if the old set of resources was empty. (WebDocumentLoaderMac::decreaseLoadCount): Call releaseDataSource if m_loadingResources is empty and we're not attached to a frame. If we are attached to a frame, then we'll do the releaseDataSource later in detachFromFrame. (WebDocumentLoaderMac::retainDataSource): Added. Calls CFRetain, but only if the data source is not already retained (according to the boolean). (WebDocumentLoaderMac::releaseDataSource): Added. Calls CFRelease, but only if the data source is currently retained (according to the boolean). (WebDocumentLoaderMac::detachDataSource): Added. Sets m_dataSource to nil. Since this is only called from WebDataSource's dealloc and finalize methods, it won't ever be called when the m_isDataSourceRetained boolean is true. 2007-07-03 Darin Adler <darin@apple.com> - forgot to check in one file in the fix for <rdar://problem/5307880> some classes need finalize methods because of non-trivial work done in dealloc methods * WebView/WebView.mm: (-[WebViewPrivate finalize]): Delete identifierMap so it doesn't leak. 2007-07-03 Anders Carlsson <andersca@apple.com> Reviewed by Darin. * WebView/WebView.mm: (-[WebView stringByEvaluatingJavaScriptFromString:]): ASSERT that the value returned isn't nil. It can't be nil when invoked on the main frame. 2007-07-04 Mark Rowe <mrowe@apple.com> Unreviewed 64-bit build fixes. * WebCoreSupport/WebInspectorClient.mm: Let the compiler know that WebFrameView is a subclass of NSView. * WebView/WebDocumentInternal.h: Remove our preprocessor macro once we're done with it. * WebView/WebHTMLView.mm: (-[WebHTMLView markAllMatchesForText:caseSensitive:limit:]): Fix argument types. 2007-07-02 Darin Adler <darin@apple.com> Reviewed by Kevin Decker and Tim Hatcher. - fix <rdar://problem/5307880> some classes need finalize methods because of non-trivial work done in dealloc methods * DefaultDelegates/WebScriptDebugServer.m: (-[WebScriptDebugServer dealloc]): Added a comment about how this probably won't work under GC. * WebInspector/WebNodeHighlight.m: (-[WebNodeHighlight dealloc]): Ditto. * WebView/WebDataSource.mm: (+[WebDataSourcePrivate initialize]): Added. Makes finalize run on main thread. (-[WebDataSourcePrivate finalize]): Added. Calls deref on the document loader. * WebView/WebHTMLView.mm: (+[WebHTMLViewPrivate initialize]): Added. Makes finalize run on main thread. (-[WebHTMLViewPrivate finalize]): Added. Calls deref on promisedDragTIFFDataSource. * WebKit.xcodeproj/project.pbxproj: Let Xcode be Xcode. 2007-07-02 Oliver Hunt <oliver@apple.com> Reviewed by Justin. Fix for <rdar://problem/5290113> WebKit does not correctly handle replacement ranges from the IM in -[WebHTMLView insertText:] http://bugs.webkit.org/show_bug.cgi?id=13664 We replicate the logic of -[WebHTMLView setMarkedText:selectedRange:] to handle the Input Method feeding us a replacement string through insertText: so we can handle IMs that use insertText to replace text. * WebView/WebHTMLView.mm: (-[WebHTMLView insertText:]): 2007-07-01 Oliver Hunt <oliver@apple.com> Reviewed by Alexey. Fix for <rdar://problem/5306210> Some events are still passed to WebCore despite being handled by the IM http://bugs.webkit.org/show_bug.cgi?id=14457 We have to assume that the IM will consume all events, so we remove the dependency on -[WebHTMLView hasMarkedText]. * WebView/WebHTMLView.mm: (-[WebHTMLView _interceptEditingKeyEvent:shouldSaveCommand:]): 2007-06-29 John Sullivan <sullivan@apple.com> Reviewed by Oliver Hunt. - WebKit support for accessing the set of rectangles that encompass the selected text * WebView/WebDocumentPrivate.h: added -selectionTextRects to WebDocumentSelection protocol; tweaked comments * WebView/WebHTMLView.mm: (-[WebHTMLView _selectionDraggingRect]): use selectionRect instead of selectionImageRect since they're the same and maybe we can get rid of selectionImageRect someday (-[WebHTMLView selectionTextRects]): added implementation of new protocol method, which calls through to WebCore * WebView/WebPDFView.mm: (-[WebPDFView selectionTextRects]): added simple implementation of new protocol method, which just returns the single selection rect. PDFKit doesn't support obtaining multiple rects to describe a multi-line selection. (-[WebPDFView selectionImageForcingWhiteText:]): use selectionRect instead of selectionImageRect since they're the same and maybe we can get rid of selectionImageRect someday * Misc/WebSearchableTextView.m: (-[WebSearchableTextView selectionTextRects]): added no-op implementation of new protocol method to this obsolete class 2007-06-28 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/5287569> WEBVIEW: Creating a webview in IB 3.0 (v2.0) NIB later crashes Interface Builder 2.5.4 on Tiger Prevent encoding any of the WebView subviews. The subviews are ignored by -[WebView initWithCoder:] and will be recreated. The Tiger 2.0 code crashed when the WebView released the subviews in initWithCoder:, so now there are no subviews to release. This never happened before because the Tiger 2.0 code and IB wouldn't encode a WebView that has a WebHTMLView. * WebView/WebView.mm: (-[WebView encodeWithCoder:]): 2007-06-26 John Sullivan <sullivan@apple.com> Reviewed by Darin - WebKit support for displaying multiple text matches in PDF views (<rdar://problem/4601967>) * WebView/WebPDFView.h: new ivars textMatches and lastScrollPosition; now conforms to WebMultipleTextMatches protocol * WebView/WebPDFView.mm: (-[WebPDFView dealloc]): release textMatches (-[WebPDFView viewDidMoveToWindow]): start observing bounds changes in the PDF document's enclosing clip view, so we can notice when scrolling takes place (-[WebPDFView viewWillMoveToWindow:]): stop observing bounds changes in the PDF document's enclosing clip view (-[WebPDFView searchFor:direction:caseSensitive:wrap:startInSelection:]): most of the code here has been moved into the new method _nextMatchFor::::, which this now calls (-[WebPDFView setMarkedTextMatchesAreHighlighted:]): implementation of WebMultipleTextMatches protocol method, does nothing useful here because we don't support inline highlighting of matches in PDF documents (-[WebPDFView markedTextMatchesAreHighlighted]): implementation of WebMultipleTextMatches protocol method (-[WebPDFView markAllMatchesForText:caseSensitive:limit:]): implementation of WebMultipleTextMatches protocol method; calls _nextMatchFor:::: in a loop until entire document is searched or limit is hit; records results by saving PDFSelections in textMatches ivar (-[WebPDFView unmarkAllTextMatches]): implementation of WebMultipleTextMatches protocol method; clears saved textMatches (-[WebPDFView rectsForTextMatches]): implementation of WebMultipleTextMatches protocol method; converts saved PDFSelections into NSValue objects that represent NSRects (-[WebPDFView _clipViewForPDFDocumentView]): new helper method to find the clip view whose bounds determine the current scroll position (-[WebPDFView _nextMatchFor:direction:caseSensitive:wrap:fromSelection:startInSelection:]): new helper method, extracted from searchFor::::: (-[WebPDFView _PDFDocumentViewMightHaveScrolled:]): new notification callback; tells webView's delegate when document has scrolled (-[WebPDFView _setTextMatches:]): new helper method, stores value in ivar 2007-06-26 Oliver Hunt <oliver@apple.com> Reviewed by Maciej. Hopefully fix remainder of the IME issues on Mac. We now assume that the IME silently consumes any event given to it during text composition, and only override this assumption if the NSTextInput or NSResponder callbacks are made. This prevents us from treating those events that the IME has consumed internally (eg. candidate window navigation) as unhandled events that should be bubbled. This fixes: <rdar://problem/5107538> Major problems handling key press event with non-english Input Methods <rdar://problem/4196249> REGRESSION: Mail: Inputting space (U+0020) with IM deletes subsequent line breaks on Mail.app <rdar://problem/5015544> REGRESSION: Reverse conversion keyboard command does not work in Safari. <rdar://problem/5045121> REGRESSION: Inline is confirmed after press left/right arrow keys, happens in Mail but not in TextEdit. <rdar://problem/5076807> REGRESSION: Can't undo conversion of inline text (by hitting ESC) <rdar://problem/5085781> REGRESSION: Active input area lost "selected" highlight <rdar://problem/5094200> space key pressed to close the associated words candidate window gets inserted as text <rdar://problem/5228294> Candidate item for character matrix is sometimes skipped * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLView.mm: (-[WebHTMLView launchKeyEvent:]): (-[WebHTMLView keyDown:]): (-[WebHTMLView keyUp:]): (-[WebHTMLView _interceptEditingKeyEvent:shouldSaveCommand:]): (-[WebHTMLView unmarkText]): (-[WebHTMLView setMarkedText:selectedRange:]): (-[WebHTMLView doCommandBySelector:]): (-[WebHTMLView insertText:]): 2007-06-26 Jim Correia <jim.correia@pobox.com> Reviewed by Darin. Fix http://bugs.webkit.org/show_bug.cgi?id=14411 Bug 14411: WebNetscapePluginPackage overagressively sets CurApRefNum, which affects shipping versions of BBEdit. <rdar://problem/5297268> * Plugins/WebNetscapePluginPackage.m: (+[WebNetscapePluginPackage initialize]): Force the Resource Manager to lazy initialize, and only set CurApRefNum to the system file if CurApRefNum is still -1 after that forced lazy initialization. 2007-06-25 Kevin Decker <kdecker@apple.com> Reviewed by Darin. <rdar://problem/5294036> -[WebView customTextEncodingName] API may return empty string instead of nil * WebView/WebView.mm: (-[WebView _mainFrameOverrideEncoding]): Addded the nsStringNilIfEmpty() inline to the data being returned because our API says "The custom text encoding name or nil if no custom text encoding name has been set." I also verified the standing Tiger WebKit behavior for this method and it does indeed return nil if a custom encoding wasn't set. 2007-06-25 John Sullivan <sullivan@apple.com> Reviewed by Darin - WebKit part of <rdar://problem/5293820>, needed to support multiple matches in PDFs * WebView/WebDocumentInternal.h: Added WebMultipleTextMatches protocol, containing five methods that were formerly implemented in WebHTMLView * WebView/WebHTMLViewPrivate.h: Removed declarations for the methods that are now in WebMultipleTextMatches protocol * WebView/WebHTMLView.mm: (-[WebHTMLView markAllMatchesForText:caseSensitive:limit:]): moved this method into the WebDocumentInternalProtocols portion of the file (-[WebHTMLView setMarkedTextMatchesAreHighlighted:]): ditto (-[WebHTMLView markedTextMatchesAreHighlighted]): ditto (-[WebHTMLView unmarkAllTextMatches]): ditto (-[WebHTMLView rectsForTextMatches]): ditto * WebView/WebView.mm: (-[WebView canMarkAllTextMatches]): new method, returns YES only if the documentView of every frame implements WebMultipleTextMatches (-[WebView markAllMatchesForText:caseSensitive:highlight:limit:]): check for WebMultipleTextMatches protocol instead of checking for WebHTMLView class (-[WebView unmarkAllTextMatches]): ditto (-[WebView rectsForTextMatches]): ditto * WebView/WebViewPrivate.h: declared new method canMarkAllTextMatches 2007-06-25 John Sullivan <sullivan@apple.com> Reviewed by Darin Fixed <rdar://problem/5292259> Find on Page doesn't work (throws exception) on page that includes PDF in a subframe * WebView/WebView.mm: (-[WebView markAllMatchesForText:caseSensitive:highlight:limit:]): We were testing whether the view was an HTMLView, but then running code that assumed it was an HTMLView outside of that test. That's a bad idea. 2007-06-22 Adele Peterson <adele@apple.com> Reviewed by Geoff and Darin. Fix for: <rdar://problem/5239236> Other slash characters should not be permitted as part of a domain name * Misc/WebNSURLExtras.m: (isSlashOrPeriodLookalike): (allCharactersInIDNScriptWhiteList): 2007-06-21 Sam Weinig <sam@webkit.org> Reviewed by Antti. Remove empty directories * WebInspector/webInspector: directory removed. * WebInspector/webInspector/Images: directory removed 2007-06-21 Justin Garcia <justin.garcia@apple.com> Reviewed by Tim. <rdar://problem/5237524> REGRESSION: Keyboard commands don't work in a message window until you click inside the message When you open a message in its own window, Mail creates an empty WebView, makes that WebView firstResponder and then sets off a load inside that WebView. When we're asked to create the empty WebView, we put an empty WebHTMLView inside it (in r21367 we began creating a document for empty frames). When Mail makes the WebView first responder we make that empty WebHTMLView firstResponder. Then when the load finishes we create a new WebHTMLView and set it as the document view. Inside _setDocumentView, if the old document view or one of its descendants was the first responder, we'd makeFirstResponder:nil so that the window wouldn't be left with a firstResponder that was no longer inside of it. This change fixes the bug by instead transferring firstResponder status to the new document view. We could also fix this by not allowing the WebHTMLView to become firstResponder when it's in the provisional state mentioned above. * WebView/WebFrameView.mm: (-[WebFrameView _setDocumentView:]): 2007-06-21 John Sullivan <sullivan@apple.com> Reviewed by Adele - fixed <rdar://problem/5268673> REGRESSION: Context menu missing for PDF in frame when there's no selection This was surprisingly interesting. It turns out that at least for Safari, the method [WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:] is only exercised from WebPDFView these days. It mimics some of the code that was moved to WebCore as part of the Great Context Menu Refactoring of 2006, but is independent of that code. And it was partly broken/incomplete, probably as a result of said refactoring. * DefaultDelegates/WebDefaultContextMenuDelegate.mm: (localizedMenuTitleFromAppKit()): deleted this function since I removed all callers (-[WebDefaultUIDelegate menuItemWithTag:target:representedObject:]): Handle WebMenuItemTagOpenFrameInNewWindow tag, since code later in this file was relying on it. Added ASSERT_NOT_REACHED to the default case, since returning nil from this method is bad. Also, use WebKit versions of menu title strings rather than AppKit versions. We added these strings to WebKit a while back so we don't need to sneakily find them in AppKit anymore. (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): make the WebView be the target of the Open Frame in New Window item; previously it was self, but that was just silly (probably a leftover from some code shuffling when context menus were reimplemented) * WebView/WebView.mm: (-[WebView _openFrameInNewWindowFromMenu:]): new method, used by Open Frame in New Window menu item. * WebView/WebViewInternal.h: Declare new method used by menu item. This isn't necessary for compilation, but could prevent the accidental deletion of the method implementation. 2007-06-20 Mark Rowe <mrowe@apple.com> Reviewed by Adam. Fix http://bugs.webkit.org/show_bug.cgi?id=14255. Bug 14255: Reproducible crash opening web inspector from debug menu Reinstate the WebInspector class so WebKit clients that currently depend on it will build and run correctly. * WebInspector/WebInspector.h: Added. * WebInspector/WebInspector.mm: Added. (+[WebInspector webInspector]): (-[WebInspector dealloc]): (-[WebInspector setWebFrame:]): (-[WebInspector showWindow:]): * WebKit.exp: * WebKit.xcodeproj/project.pbxproj: 2007-06-20 Adam Roben <aroben@apple.com> Land the new Inspector. Co-written with Tim Hatcher. Reviewed by Anders, Adele, Hyatt, and Sam. Implement the InspectorClient interface. * WebCoreSupport/WebInspectorClient.h: Added. * WebCoreSupport/WebInspectorClient.mm: Added. (WebInspectorClient::WebInspectorClient): (WebInspectorClient::inspectorDestroyed): (WebInspectorClient::createPage): (WebInspectorClient::showWindow): (WebInspectorClient::closeWindow): (WebInspectorClient::attachWindow): (WebInspectorClient::detachWindow): (WebInspectorClient::highlight): (WebInspectorClient::hideHighlight): (WebInspectorClient::inspectedURLChanged): (WebInspectorClient::updateWindowTitle): (-[WebInspectorWindowController init]): (-[WebInspectorWindowController initWithInspectedWebView:]): (-[WebInspectorWindowController dealloc]): (-[WebInspectorWindowController inspectorVisible]): (-[WebInspectorWindowController webView]): (-[WebInspectorWindowController window]): (-[WebInspectorWindowController windowShouldClose:]): (-[WebInspectorWindowController close]): (-[WebInspectorWindowController showWindow:]): (-[WebInspectorWindowController attach]): (-[WebInspectorWindowController detach]): (-[WebInspectorWindowController highlightAndScrollToNode:]): (-[WebInspectorWindowController highlightNode:]): (-[WebInspectorWindowController hideHighlight]): (-[WebInspectorWindowController animationDidEnd:]): Add an easier-to-see highlight. * Misc/WebNSViewExtras.h: * Misc/WebNSViewExtras.m: (-[NSView _web_convertRect:toView:]): * WebInspector/WebNodeHighlight.h: * WebInspector/WebNodeHighlight.m: (-[WebNodeHighlightFadeInAnimation setCurrentProgress:]): (-[WebNodeHighlight initWithTargetView:]): (-[WebNodeHighlight setHighlightedNode:]): (-[WebNodeHighlight highlightedNode]): (-[WebNodeHighlight dealloc]): (-[WebNodeHighlight attachHighlight]): (-[WebNodeHighlight delegate]): (-[WebNodeHighlight detachHighlight]): (-[WebNodeHighlight show]): (-[WebNodeHighlight hide]): (-[WebNodeHighlight animationDidEnd:]): (-[WebNodeHighlight ignoresMouseEvents]): (-[WebNodeHighlight highlightView]): (-[WebNodeHighlight setDelegate:]): (-[WebNodeHighlight setHolesNeedUpdateInTargetViewRect:]): (-[WebNodeHighlight setIgnoresMouseEvents:]): (-[WebNodeHighlight targetView]): (-[WebNodeHighlight _computeHighlightWindowFrame]): (-[WebNodeHighlight _repositionHighlightWindow]): * WebInspector/WebNodeHighlightView.h: * WebInspector/WebNodeHighlightView.m: (-[WebNodeHighlightView initWithWebNodeHighlight:]): (-[WebNodeHighlightView dealloc]): (-[WebNodeHighlightView detachFromWebNodeHighlight]): (-[WebNodeHighlightView drawRect:]): (-[WebNodeHighlightView webNodeHighlight]): (-[WebNodeHighlightView fractionFadedIn]): (-[WebNodeHighlightView setFractionFadedIn:]): (-[WebNodeHighlightView setHolesNeedUpdateInRect:]): (-[WebNodeHighlightView _holes]): WebView changes needed for the new Inspector. * WebView/WebView.mm: Remove the old _inspectElement method now that this is handled by WebCore. (-[WebView _isClosed]): Added. (-[WebView initWithFrame]): Give each Page an InspectorClient to enable the Inspector. * WebView/WebViewPrivate.h: Updates needed for WebCore changes. * WebCoreSupport/WebContextMenuClient.h: * WebCoreSupport/WebContextMenuClient.mm: * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory contextMenuItemTagInspectElement]): * WebView/WebUIDelegatePrivate.h: Remove old Inspector code. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache): (WebFrameLoaderClient::assignIdentifierToInitialRequest): (WebFrameLoaderClient::dispatchDidFinishLoading): * WebInspector/WebInspector.m: Removed. * WebInspector/WebInspectorPanel.h: Removed. * WebInspector/WebInspectorPanel.m: Removed. * WebInspector/webInspector/Images/button.png: Removed. * WebInspector/webInspector/Images/buttonDivider.png: Removed. * WebInspector/webInspector/Images/buttonPressed.png: Removed. * WebInspector/webInspector/Images/close.png: Removed. * WebInspector/webInspector/Images/closePressed.png: Removed. * WebInspector/webInspector/Images/downTriangle.png: Removed. * WebInspector/webInspector/Images/menu.png: Removed. * WebInspector/webInspector/Images/menuPressed.png: Removed. * WebInspector/webInspector/Images/popup.png: Removed. * WebInspector/webInspector/Images/popupPressed.png: Removed. * WebInspector/webInspector/Images/resize.png: Removed. * WebInspector/webInspector/Images/rightTriangle.png: Removed. * WebInspector/webInspector/Images/scrollThumbBottom.png: Removed. * WebInspector/webInspector/Images/scrollThumbMiddle.png: Removed. * WebInspector/webInspector/Images/scrollTrackBottom.png: Removed. * WebInspector/webInspector/Images/upTriangle.png: Removed. * WebInspector/webInspector/inspector.css: Removed. * WebInspector/webInspector/inspector.html: Removed. * WebInspector/webInspector/inspector.js: Removed. * WebInspector/webInspector/scrollarea.js: Removed. * WebInspector/webInspector/scrollbar.js: Removed. * WebInspector/webInspector/utilities.js: Removed. * WebView/WebFrame.mm: (-[WebFramePrivate dealloc]): * WebView/WebFrameInternal.h: * WebView/WebHTMLView.mm: (-[WebHTMLView menuForEvent:]): Build-fu: * WebKit.exp: * WebKit.xcodeproj/project.pbxproj: 2007-06-20 Justin Garcia <justin.garcia@apple.com> Reviewed by Darin. <rdar://problem/5263541> REGRESSION (Safari 3 Beta 1): Pressing Delete doesn't delete an HTML message in Mail Mail wasn't receiving the keyDown event because WebFrameView was blocking it. It blocks the event and moves back/forward on Delete/Shift+Delete if the back/forward list is enabled. * WebView/WebFrameView.mm: (-[WebFrameView keyDown:]): Check to see if the BackForwardList is enabled. It always exists. 2007-06-19 Anders Carlsson <andersca@apple.com> Reviewed by Kevin Decker. <rdar://problem/5266289> REGRESSION (Safari 3 Beta 1): Incoming iChat messages are delayed * WebView/WebDocumentLoaderMac.mm: (needsAppKitWorkaround): New function which checks if the frame load delegate belongs to AppKit. (WebDocumentLoaderMac::setDataSource): If the frame load delegate belongs to AppKit, set m_deferMainResourceDataLoad to false. 2007-06-19 John Sullivan <sullivan@apple.com> Reviewed by Tim Hatcher - fixed <rdar://problem/5272011> Hole for find-on-page match in subframe isn't clipped by frame bounds * WebView/WebView.mm: (-[WebView rectsForTextMatches]): intersect the HTMLView's computed rect with the visible rect for that view 2007-06-19 Jim Correia <jim.correia@pobox.com> Reviewed by Kevin Decker * Carbon/HIWebView.m: (WindowHandler): HIObjectIsOfClass requires non-NULL input on Tiger. Reworked Kevin Decker's patch to remove the conditional compilation for Tiger, yet still avoid crashing BBEdit. 2007-06-18 Sam Weinig <sam@webkit.org> Reviewed by Beth. Build fix. * WebCoreSupport/WebChromeClient.mm: 2007-06-18 Kevin Decker <kdecker@apple.com> * Carbon/HIWebView.m: (WindowHandler): Fixed the Tiger build; ControlKind wasn't defined. 2007-06-18 Kevin Decker <kdecker@apple.com> Reviewed by Tim Hatcher. Fixed: <rdar://problem/5276135> With Safari 3 Tiger Beta installed, a crash occurs in BBEdit while mousing down and dragging outside of HTML preview window * Carbon/HIWebView.m: (WindowHandler): Because the fix for 5051616 causes Tiger to crash in HIToolbox (but not on Leopard), I reverted back to using GetControlKind on Tiger only, instead of HIObjectIsOfClass. 2007-06-16 David Hyatt <hyatt@apple.com> Back out fix for 13972. Quicktime will no longer clip correctly. :( Too many regressions in Mail caused by inserting an extra view into the hierarchy. Can revisit later. Reviewed by olliej * Plugins/WebPluginController.mm: (-[WebPluginController destroyPlugin:]): (-[WebPluginController destroyAllPlugins]): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:DOMElement:loadManually:]): * WebView/WebHTMLView.mm: (-[WebHTMLView addSubview:]): (-[WebHTMLView willRemoveSubview:]): 2007-06-15 Sam Weinig <sam@webkit.org> Reviewed by Darin. Patch for http://bugs.webkit.org/show_bug.cgi?id=14053 Autogenerate JS binding for Rect - Fix conflicts by using ::Rect instead of Rect. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebBaseNetscapePluginView sendEvent:]): (-[WebBaseNetscapePluginView tellQuickTimeToChill]): (-[WebBaseNetscapePluginView invalidateRegion:]): (-[WebBaseNetscapePluginView _printedPluginBitmap]): 2007-06-15 Anders Carlsson <andersca@apple.com> Reviewed by Kevin. A better fix for <rdar://problem/5271774>. Only try to access the element if the view has an associated window. This also works with GC. (Fix suggested by Kevin.) * Plugins/WebKitPluginContainerView.mm: (-[WebKitPluginContainerView dealloc]): (-[WebKitPluginContainerView visibleRect]): 2007-06-15 Anders Carlsson <andersca@apple.com> Reviewed by Kevin. <rdar://problem/5271774> REGRESSION: A crash occurs when closing a window that contains a QT movie In some cases, calling [super dealloc] might end up calling visibleRect, so make sure to set _element to 0 so we won't send a message to a freed object and crash. * Plugins/WebKitPluginContainerView.mm: (-[WebKitPluginContainerView dealloc]): (-[WebKitPluginContainerView visibleRect]): 2007-06-14 Anders Carlsson <andersca@apple.com> Reviewed by Geoff. Call cleanupScriptObjectsForPlugin on the frame after destroying the plug-in. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView _destroyPlugin]): * Plugins/WebPluginController.mm: (-[WebPluginController destroyPlugin:]): (-[WebPluginController destroyAllPlugins]): 2007-06-13 John Sullivan <sullivan@apple.com> Reviewed by Adele Peterson - fixed <rdar://problem/5267607> Clicking the "Save to Downloads" button in PDF overlay too soon results in corrupt file * WebView/WebPDFView.mm: (-[WebPDFView PDFViewSavePDFToDownloadFolder:]): Just beep if the document isn't available yet, since trying to save it as a file really isn't a good idea. 2007-06-12 Oliver Hunt <oliver@apple.com> Reviewed by Darin. Use correct size for BITMAPINFOHEADER -- whoops. * win/WebIconDatabase.cpp: (createDIB): (WebIconDatabase::getOrCreateDefaultIconBitmap): 2007-06-10 David Hyatt <hyatt@apple.com> Fix for bug 14037, make sure respondsToSelector does the write thing when invoked on a WebKit plugin's container view. Reviewed by Mark Rowe * Plugins/WebKitPluginContainerView.mm: (-[WebKitPluginContainerView respondsToSelector:]): 2007-06-08 John Sullivan <sullivan@apple.com> * WebView/WebViewPrivate.h: Added a FIXME 2007-06-07 Justin Garcia <justin.garcia@apple.com> Reviewed by Tristan. <rdar://problem/5250997> A crash occurs when selecting Undo Typing for a page that has been closed in tab * WebView/WebView.mm: (-[WebView _clearUndoRedoOperations]): Added. * WebView/WebViewPrivate.h: 2007-06-07 Oliver Hunt <oliver@apple.com> Reviewed by Sam "The Intern" Weinig. Don't be overzealous with the input checks, firstRectForCharacterRange can be determined even when there is not an active editable region. This unbreaks editing/input/range-for-empty-document which was broken by aforementioned overzealousness. * WebView/WebHTMLView.mm: (-[WebHTMLView firstRectForCharacterRange:]): 2007-06-07 Oliver Hunt <oliver@apple.com> Reviewed by Justin. Add checks to make sure we don't try to create, use or return invalid ranges to TSM when it calls us despite not currently being in an editable region. * WebView/WebHTMLView.mm: (isTextInput): (-[WebHTMLView textStorage]): (-[WebHTMLView firstRectForCharacterRange:]): (-[WebHTMLView selectedRange]): (-[WebHTMLView attributedSubstringFromRange:]): 2007-06-06 David Hyatt <hyatt@apple.com> Make sure to hand back a script object for webkit plugins (the container view forwards to its plugin child). Reviewed by sullivan * Plugins/WebKitPluginContainerView.h: * Plugins/WebKitPluginContainerView.mm: (-[WebKitPluginContainerView objectForWebScript]): 2007-06-06 David Hyatt <hyatt@apple.com> Fix for bug 13972, quicktime doesn't respect CSS clip and overflow properties. Make sure that calls to [NSView visibleRect] will do the right thing for both Netscape plugins and WebKit plugins. Reviewed by olliej * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView visibleRect]): (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebBaseNetscapePluginView isOpaque]): * Plugins/WebKitPluginContainerView.h: Added. * Plugins/WebKitPluginContainerView.mm: Added. (-[WebKitPluginContainerView initWithFrame:DOMElement:]): (-[WebKitPluginContainerView dealloc]): (-[WebKitPluginContainerView visibleRect]): * Plugins/WebPluginController.mm: (-[WebPluginController destroyAllPlugins]): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:DOMElement:loadManually:]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLView.mm: (-[WebHTMLView addSubview:]): (-[WebHTMLView willRemoveSubview:]): 2007-06-04 Oliver Hunt <oliver@apple.com> Reviewed by Geoff and Justin. Fix for <rdar://problem/5246941> Clicking URL field on Safari causes halt for a minute when using input methods. and <rdar://problem/5245964> Safari hangs for several seconds when trying to select text using mouse This is a by product of the textStorage hack used to fix rdar://problem/5000470 -- TSM calls textStorage repeatedly when changing focus, on certain mouse events, etc. If there is no selection/editable region we repeatedly create an NSAttributedString from the full document. If the document is sufficiently long this starts consuming an inordinate amount of time. This check should really have been present in the original patch. * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLView.mm: (-[WebHTMLView textStorage]): 2007-05-31 David Hyatt <hyatt@apple.com> Fix for 11768, Flash plugin does not respect clips set by CSS. Reviewed by olliej * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): 2007-05-30 Mark Rowe <mrowe@apple.com> Build fixes after r21889. * ForwardingHeaders/kjs/function.h: Added. 2007-05-29 Mark Rowe <mrowe@apple.com> Reviewed by Geoff. 64-bit build fix. Ensure that use of WebNSUInteger in headers is matched by WebNSUInteger in implementations. * DefaultDelegates/WebScriptDebugServer.h: * DefaultDelegates/WebScriptDebugServer.m: (-[WebScriptDebugServer webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:]): (-[WebScriptDebugServer webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:]): * DefaultDelegates/WebScriptDebugServerPrivate.h: * History/WebBackForwardList.mm: (-[WebBackForwardList setPageCacheSize:]): (-[WebBackForwardList pageCacheSize]): * WebView/WebView.mm: (-[WebView markAllMatchesForText:caseSensitive:highlight:limit:]): 2007-05-26 Darin Adler <darin@apple.com> Reviewed by Tim Hatcher. * MigrateHeaders.make: Added dependency on this makefile itself, which is useful when you change the sed command or other aspect of this file. My build failed until I made this fix. 2007-05-25 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler. Fixed <rdar://problem/5055182> The page cache has no global cap. The main WebKit changes are: 1. Changed -[WebBackForwardList setPageCacheSize] and -[WebBackForwardList pageCacheSize] to accomodate the new global page cache model, updating their documentation. 2. Added -[WebPreferences setShouldUsePageCache] and -[WebPreferences shouldUsePageCache] as pending public API. 3. Centralized calculation of object cache and page cache sizes inside WebPreferences. Cchanged our old behavior of reading a preference and applying a fudge factor with a new behavior of just using the preference directly. The old behavior was confusing and often inappropriate. (For example, if you set a page cache size of 100, a 256MB machine would somewhat arbitrarily reduce that number to 98. ???) * WebView/WebView.mm: Added support for two flags to determine whether to use the page cache. If either -[WebBackForwardList setPageCacheSize:0] or -[WebPreferences setShouldUsePageCache:NO] is called, we don't use the page cache. 2007-05-25 Timothy Hatcher <timothy@apple.com> Reviewed by Kevin Decker. <rdar://problem/5219089> Changes for migration of DictionaryServices * WebView/WebHTMLView.mm: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): look for the HIDictionaryWindowShow symbol in HIToolbox 2007-05-25 Geoffrey Garen <ggaren@apple.com> Reviewed by Oliver Hunt. Fixed global initializer (like you fix a dog). I'm not sure how our script missed this. I tested, and it generally doesn't seem to work very well. * WebView/WebHTMLView.mm: Allocate lazily to avoid the performance hit of a global initializer. (promisedDataClient): (-[WebHTMLViewPrivate dealloc]): (-[WebHTMLViewPrivate clear]): (-[WebHTMLView setPromisedDragTIFFDataSource:WebCore::]): 2007-05-25 Brady Eidson <beidson@apple.com> Reviewed by Darin <rdar://problem/5228371> - REGRESSION - Certain mail message bodies display as empty This is due to http://trac.webkit.org/projects/webkit/changeset/21480 which unintentionally made applewebdata urls result in check.call(false) instead of check.call(true) Best place for a fix is to have the FrameLoaderClient::canHandleRequest() call return true, which really is rooted in WebView <rdar://problem/5229587> tracks adding a layout test * WebView/WebView.mm: (+[WebView _canHandleRequest:]): Return true for applewebdata URLs 2007-05-25 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler, Tim Hatcher. "unsigned" => "WebNSUInteger" in public API. * History/WebBackForwardList.h: * WebView/WebScriptDebugDelegate.h: * WebView/WebUIDelegate.h: * WebView/WebViewPrivate.h: 2007-05-25 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler. Moved JavaScriptCore-related pending public API to public API. * MigrateHeaders.make: Hack to prevent <JavaScriptCore/JSBase.h> from automatically converting to <WebKit/JSBase.h> Moved -windowObject and -globalContext * WebView/WebFramePrivate.h: from here * WebView/WebFrame.h: to here * WebView/WebFrame.mm: and out of its temporary category Moved -didClearWindowObject:forFrame: * WebView/WebViewPrivate.h: from here * WebView/WebFrameLoadDelegate.h: to here 2007-05-25 John Sullivan <sullivan@apple.com> Reviewed by Anders and Tim - fixed <rdar://problem/5226000> REGRESSION: In Gmail and Mail, a hang occurs when attempting to grammar/spellcheck a word in a reply * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::checkGrammarOfString): Fixed recently-introduced false assumption that NSNotFound == -1 2007-05-24 dethbakin <bdakin@apple.com> Reviewed by Geoff. Fix for <rdar://problem/5023545> QuickBooks Pro 2007:hang/crash after closing QuickBooks Tutorial Center with Leopard9A377 We can hit a race condition where drawRect will be called after the WebView has closed. Quickbooks does not properly close the WebView and set the UIDelegate to nil, so the UIDelegate is stale and we crash. This is a regression because the code that uses the UIDelegate in the drawRect code path was only added recently. The method that the UIDelegate calls into is new -- it does not exist on Tiger -- so there is no harm in not running this code for applications linked against older WebKits. Other applications may run into this same bug so I am not doing a bundle check...particularly because, as I mentioned, the new UIDelegate call would not be implemented by older clients anyway. * Misc/WebKitVersionChecks.h: * WebView/WebHTMLView.mm: (-[WebHTMLView drawSingleRect:]): 2007-05-24 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2007-05-24 Oliver Hunt <oliver@apple.com> Reviewed by Adam, Darin, and Geoff. Fix for <rdar://problem/5000470> REGRESSION: The IM reconvert function returns incorrect symbol due to inconsistent range domains in TSM Text Services Management uses ranges provided by the NSTextInput API to index into the string return by -[WebHTMLView string]. As a result some input methods incorrectly get their candidate text from the beginning of the document instead of from the input element. TSM prefers to query -textStorage over -string so as a workaround we provide an implementation of -textStorage that returns the content of the current text input. TSM only ever queries the result of textStorage as an NSAttributedString so we do not need to implement a fake NSTextStorage class This should not cause harm to anything else as textStorage is actually a method on NSTextView, which we clearly are not. TSM only queries the method because it uses respondsToSelector to control behaviour. * WebView/WebHTMLView.mm: (-[WebHTMLView textStorage]): 2007-05-24 David Harrison <harrison@apple.com> Reviewed by Tim Hatcher. <rdar://problem/5225343> REGRESSION: With View Source window opened, navigating to a different URL in the browser window results in a crash at WebCore::FrameLoader::frameHasLoaded() _private->loader->frameLoader() was not being nil checked. * WebView/WebDataSource.mm: (-[WebDataSource request]): Add nil check for _private->loader->frameLoader() 2007-05-23 Anders Carlsson <andersca@apple.com> Reviewed by Geoff. <rdar://problem/3663808> Resize large images to fit in the browser window Add new WebPreferences SPI. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.m: (+[WebPreferences initialize]): (-[WebPreferences enableAutomaticImageResizing]): (-[WebPreferences setEnableAutomaticImageResizing:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _updateWebCoreSettingsFromPreferences:]): 2007-05-23 Sam Weinig <sam@webkit.org> Reviewed by Darin. Patch for http://bugs.webkit.org/show_bug.cgi?id=13830 Auto-generate JS DOM bindings for HTMLDocument and most of the rest of HTMLElement * MigrateHeaders.make: add DOMHTMLDocumentPrivate.h * WebKit.xcodeproj/project.pbxproj: 2007-05-23 Oliver Hunt <oliver@apple.com> Reviewed by Geoff. Fix for <rdar://problem/5223782> REGRESSION: Can't drag and drop a standalone image The main resource for a standalone image webarchive has the same mimetype as the underlying image. * Misc/WebNSPasteboardExtras.mm: (-[NSPasteboard _web_writePromisedRTFDFromArchive:containsImage:]): 2007-05-22 Sam Weinig <sam@webkit.org> Reviewed by Adam. Patch for http://bugs.webkit.org/show_bug.cgi?id=13833 Add ObjC DOM binding for HTMLMarqeeElement - Also adds missing DOMHTMLFramePrivate. * MigrateHeaders.make: 2007-05-22 Darin Adler <darin@apple.com> Reviewed by Geoff. * WebInspector/webInspector/treeoutline.js: Use ownerDocument instead of non-standard document property. 2007-05-22 Adele Peterson <adele@apple.com> Reviewed by Darin. Adding some asserts to help detect other cases of <rdar://problem/5171145> * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge makeFirstResponder:]): 2007-05-22 Brady Eidson <beidson@apple.com> Reviewed by Kevin (Sarge) <rdar://problem/5219885> - Crash after closing a inline popup ad at http://news.yahoo.com/ This regressed in http://trac.webkit.org/projects/webkit/changeset/21618 * WebView/WebFrame.mm: (-[WebFrame dataSource]): Null check the frameloader 2007-05-21 Adele Peterson <adele@apple.com> Fix by Darin, reviewed by me. Fix for <rdar://problem/5171145> Safari crashed closing tab in NSInputContext updateInputContexts * WebView/WebFrameView.mm: (-[WebFrameView _setDocumentView:]): If the old view is the first responder, then set the window's first responder to nil so we don't leave the window pointing to a view that's no longer in it. 2007-05-21 Brady Eidson <beidson@apple.com> Making the importance of my last change more clear * WebView/WebViewPrivate.h: "Leave for Dashboard, people!" 2007-05-21 Brady Eidson <beidson@apple.com> Reviewed by Kevin (Sarge) <rdar://problem/5217124> - Re-add mistakenly removed SPI * WebView/WebView.mm: (-[WebView handleAuthenticationForResource:challenge:fromDataSource:]): * WebView/WebViewPrivate.h: 2007-05-21 Anders Carlsson <andersca@apple.com> Reviewed by Ada. <rdar://problem/5200816> REGRESSION: With Shiira 1.2.2 , I can't open embedded link in flash object by clicking (http:/www.adobe.com ) Null check the request. * WebView/WebView.mm: (+[WebView _canHandleRequest:]): 2007-05-19 Maciej Stachowiak <mjs@apple.com> Reviewed by Geoff. <rdar://problem/5205358> REGRESSION (r21367): All messages appear entirely blank when running Mail off of tip of tree WebKit The fix is to return nil from [WebFrame dataSource] when it has not loaded anything but the fake empty initial document. However, WebKit still needs the real data source internally, so I also added a [WebFrame _dataSource] method that skips this check, and made WebKit use it throughout. * Misc/WebNSAttributedStringExtras.mm: (fileWrapperForElement): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView dataSource]): * Plugins/WebNullPluginView.mm: (-[WebNullPluginView viewDidMoveToWindow]): * Plugins/WebPluginController.mm: (-[WebPluginController URLPolicyCheckReferrer]): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge dataSource]): (-[WebFrameBridge redirectDataToPlugin:]): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::makeDocumentView): (WebFrameLoaderClient::forceLayoutForNonHTML): (WebFrameLoaderClient::prepareForDataSourceReplacement): (WebFrameLoaderClient::canCachePage): * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory bridgeForView:]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebArchiver.mm: (+[WebArchiver archiveFrame:]): (+[WebArchiver archiveMainResourceForFrame:]): (+[WebArchiver _archiveWithMarkupString:fromFrame:nodes:]): (+[WebArchiver archiveSelectionInFrame:]): * WebView/WebFrame.mm: (-[WebFrame _loadURL:referrer:intoChild:]): (-[WebFrame _addChild:]): (-[WebFrame _dataSource]): (-[WebFrame DOMDocument]): (-[WebFrame dataSource]): * WebView/WebFrameInternal.h: * WebView/WebHTMLView.mm: (-[WebHTMLView _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]): * WebView/WebRenderNode.mm: (-[WebRenderNode initWithWebFrameView:]): * WebView/WebView.mm: (-[WebView _mainFrameOverrideEncoding]): (-[WebView mainFrameURL]): (-[WebView mainFrameTitle]): (-[WebView mainFrameIcon]): (-[WebView validateUserInterfaceItemWithoutDelegate:]): (-[WebView replaceSelectionWithArchive:]): (-[WebView _isLoading]): (-[WebView _performTextSizingSelector:withObject:onTrackingDocs:selForNonTrackingDocs:newScaleFactor:]): (-[WebView _notifyTextSizeMultiplierChanged]): 2007-05-18 Oliver Hunt <oliver@apple.com> Reviewed by Sam. Fix for http://bugs.webkit.org/show_bug.cgi?id=13782 REGRESSION (r21528-r21533): Failing editing/selection/drag-in-iframe in pixel mode r21533 made used a DOMElement as the source for promise data, this meant it had to clear the dragging pasteboard following the drag. In DRT a drag is non-blocking so this resulted in us prematurely clearing the pasteboard. This patch avoids this problem by referencing the source CachedImage rather than the DOMElement, so we don't need to worry about retaining an entire document forever, so we don't need to clear the dragging pasteboard following the drag. * Misc/WebNSPasteboardExtras.mm: (imageFromElement): Extract the underlying CachedImage from a DOMElement (-[NSPasteboard _web_writeImage:element:URL:title:archive:types:source:]): Use a CachedImage instead of a DOMElement * WebCoreSupport/WebDragClient.mm: (WebDragClient::startDrag): * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLView.mm: (-[WebHTMLViewPrivate dealloc]): (-[WebHTMLViewPrivate clear]): (-[WebHTMLView pasteboardChangedOwner:]): (-[WebHTMLView pasteboard:provideDataForType:]): (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): (-[WebHTMLView WebCore::]): (-[WebHTMLView setPromisedDragTIFFDataSource:WebCore::]): Use CachedImage rather than DOMElement as promised data source * WebView/WebHTMLViewInternal.h: * WebView/WebHTMLViewPrivate.h: 2007-05-18 Tristan O'Tierney <tristan@apple.com> Reviewed by Brady E. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::download): asked the webframeloaderclient for its webview's history and injected the originated url into the created WebDownload 2007-05-18 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker Improvement to WebKit part of fix for 5201499 based on more modern understanding. (That is, a couple of hours more modern.) * WebView/WebUIDelegatePrivate.h: add showPanel: parameter to just-introduced delegate method webView:saveFrameView: * WebView/WebPDFView.mm: (-[WebPDFView PDFViewSavePDFToDownloadFolder:]): pass NO for new showPanel: parameter, and update comment 2007-05-18 Maciej Stachowiak <mjs@apple.com> Reviewed by John. <rdar://problem/5204792> REGRESSION (r21367): System widgets are drawn with vertical/horizontal scroll bars No test because the bug requires calling setAllowsScrolling: to reproduce. * WebView/WebFrameView.mm: (-[WebFrameView setAllowsScrolling:]): Update the FrameView's scroll state as well as the one on WebDynamicScrollBarsView, otherwise this setting won't stick if the frame has already loaded a document. 2007-05-18 Geoffrey Garen <ggaren@apple.com> Fixed spelling error. * WebView/WebViewPrivate.h: 2007-05-18 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker WebKit part of fix for 5201499 (support for PDFKit UI for saving PDFs to disk) Also, the PDFKit mechanism for notifying clients about "Open File Externally" was changed from a notification to a delegate method. The notification was new to Leopard, so removing it doesn't affect clients in the field. * WebView/WebUIDelegatePrivate.h: Declared new UI delegate method webView:saveFrameView:, analogous to the existing webView:printFrameView: * WebView/WebPDFView.mm: removed declaration of _webkit_PDFKitLaunchNotification (-[WebPDFView viewDidMoveToWindow]): don't observe _webkit_PDFKitLaunchNotification (-[WebPDFView viewWillMoveToWindow:]): ditto (-[WebPDFView PDFViewOpenPDFInNativeApplication:]): new PDFKit delegate method, replaces our use of _webkit_PDFKitLaunchNotification (-[WebPDFView PDFViewSavePDFToDownloadFolder:]): new PDFKit delegate method, calls through to new WebKit UI delegate method 2007-05-17 Oliver Hunt <oliver@apple.com> Reviewed by Justin. Fix for <rdar://problem/4244861> Safari fails to create image file after releasing dragged image that has changed on source page This patch fixes this bug by manually creating an NSFileWrapper from the TIFF promise data for a drag if it is available. This bypasses the problem of the required resource no longer being held due to page loads or other constraints. We need to leave the old path in place to allow for the case where the promised data is not available. * WebCoreSupport/WebDragClient.mm: (WebDragClient::declareAndWriteDragImage): Always use the top WebHTMLView as the pasteboard owner, this is safe as we only use the owner for resolving promised types. * WebView/WebHTMLView.mm: (-[WebHTMLView _writeSelectionToPasteboard:]): (-[WebHTMLView writeSelectionToPasteboard:types:]): Always use the top WebHTMLView as the pasteboard owner. (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Add path to create NSFileWrapper from promise data. 2007-05-17 Oliver Hunt <oliver@apple.com> Reviewed by Adam. Fix for <rdar://problem/4343832> Trying to drag a large 6.2MB jpeg image out of Safari is unexpectedly slow (4 copies of image plus RTF document on pasteboard) This patch causes the construction of the RTF and TIFF data to be delayed until requested. We delay TIFF construction from a DOMElement as this may require generating TIFF data from the CachedImage, which is slow. To allow the TIFF data to be created later the it's necessary to add a reference to the source DOMElement to the view. * Misc/WebNSPasteboardExtras.h: * Misc/WebNSPasteboardExtras.mm: (-[NSPasteboard _web_writePromisedRTFDFromArchive:containsImage:]): Implements the delayed write of RTF data (-[NSPasteboard _web_writeImage:element:URL:title:archive:types:source:]): Set up the pasteboard to allow the data writing to be delayed (-[NSPasteboard _web_declareAndWriteDragImageForElement:URL:title:archive:source:]): Now we need to pass the WebHTMLView on to _web_writeImage:element:URL:title:archive:types:source: * WebCoreSupport/WebDragClient.mm: (WebDragClient::startDrag): Clear the dragging pasteboard once the drag has ended to ensure we don't hold references to anything longer than we need to. (WebDragClient::declareAndWriteDragImage): * WebView/WebHTMLView.mm: (-[WebHTMLViewPrivate dealloc]): (-[WebHTMLViewPrivate clear]): (-[WebHTMLView pasteboardChangedOwner:]): Make sure we clear out the DOMElement reference once it is no longer needed (-[WebHTMLView pasteboard:provideDataForType:]): Provide delayed data (-[WebHTMLView _writeSelectionToPasteboard:]): Make sure we set pasteboard ownership correctly (-[WebHTMLView promisedDragTIFFDataSource]): (-[WebHTMLView setPromisedDragTIFFDataSource:]): (-[WebHTMLView writeSelectionToPasteboard:types:]): * WebView/WebHTMLViewInternal.h: * WebView/WebHTMLViewPrivate.h: * WebView/WebView.mm: (-[WebView _writeImageForElement:withPasteboardTypes:toPasteboard:]): 2007-05-16 Anders Carlsson <andersca@apple.com> Reviewed by Darin. <rdar://problem/5207156> Hamachi test tool causes assertion in FormCompletionController in Safari Update for WebCore changes. * WebView/WebFrame.mm: (-[WebFrame _loadURL:referrer:intoChild:]): 2007-05-15 Oliver Hunt <oliver@apple.com> Reviewed by Sam and Geoff. Removing dead code left behind from drag and drop refactoring. * WebCoreSupport/WebFrameBridge.mm: * WebView/WebHTMLView.mm: * WebView/WebHTMLViewPrivate.h: 2007-05-15 Bruce Q Hammond <bruceq@apple.com> Reviewed by Darin. Correction of previous patch for http://bugs.webkit.org/show_bug.cgi?id=13578 This corrects the sign of the Y-Axis origin adjustment. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): 2007-05-15 Geoffrey Garen <ggaren@apple.com> Reviewed by Maciej Stachowiak. Patch: fixed <rdar://problem/5198890> .5% performance regression caused by r21307 The only code r21307 added that runs during the PLT is a frame load delegate -respondsToSelector: call inside windowObjectCleared(), so it seems like our message dispatch overhead for the frame load delegate is significant. This patch is a straight port of Maciej's fix for the same problem in the resource load delegate. The solution is simple enough: don't use Objective-C. Instead, use a special structure that caches which methods the delegate implements, along with pointers to those methods. I verified each frame load delegate callback in the debugger, except for -webView:didFailLoadWithError:forFrame:, which is not implemented by Safari or DumpRenderTree. * WebKit/DefaultDelegates/WebDefaultFrameLoadDelegate.h: Removed. * WebKit/DefaultDelegates/WebDefaultFrameLoadDelegate.m: Removed. * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge windowObjectCleared]): I also removed a misleading comment here. The JS debugger caches the windowScriptObject, so you do need to re-create the debugger every time you invalidate the old WebScriptObject wrapper for the window object and create a new one, or the debugger will stop working. We could fix this in a number of ways, but <rdar://problem/4608404> is not the key issue. 2007-05-15 Maciej Stachowiak <mjs@apple.com> Reviewed by Hyatt and Lars. - fixed <rdar://problem/5201758> REGRESSION: Stop button enabled and other problems caused by [WebView currentURL] returning non-nil for empty window * WebView/WebDataSource.mm: (-[WebDataSource request]): Return nil when we are still showing the initial empty doc 2007-05-14 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler. Updated for WebCore move to PageCache singleton. Also removed some WebCore:: prefixes and replaced them with 'using namespace WebCore'. * History/WebHistoryItem.mm: (+[WebHistoryItem _releaseAllPendingPageCaches]): (-[WebWindowWatcher windowWillClose:]): 2007-05-13 Darin Adler <darin@apple.com> - one more retain/release for a tiny bit more robustness * WebView/WebPDFView.mm: (-[WebPDFView _updatePreferences:]): [prefs release] (-[WebPDFView _updatePreferencesSoon]): [prefs retain] 2007-05-13 Darin Adler <darin@apple.com> Reviewed by Geoff. - fix <rdar://problem/5188400> Webkit crashes going back from PDF at perl.org site * WebView/WebPDFView.h: Replace _updatePreferencesTimer with _willUpdatePreferencesSoon BOOL. Also remove unneeded @public that gives other classes access to our dataSource member. * WebView/WebPDFView.mm: Rearrange top of file a bit, remove forward declaration of the _cancelUpdatePreferencesTimer method. (-[WebPDFView dealloc]): Removed call to _cancelUpdatePreferencesTimer. (-[WebPDFView _updatePreferencesNow:]): Added WebPreferences parameter. This sidesteps problems where the dataSource is no longer present by not looking at the dataSource field at all. Also removed the call to _cancelUpdatePreferencesTimer, added code to set _willUpdatePreferencesSoon to NO and added a release to balance a retain I did in _updatePreferencesSoon. (-[WebPDFView _updatePreferencesSoon]): Changed to use performSelectorAfterDelay instead of an NSTimer. Pass in the preferences object as a parameter, since we might not be able to get to the dataSource when the timer fires. 2007-05-10 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler. "IconDatabase::sharedIconDatabase()" => "iconDatabase()" for terseness. 2007-05-10 Adele Peterson <adele@apple.com> Reviewed by Hyatt. WebKit part of fix for <rdar://problem/4100616> Doing a "find" in RSS doesn't scroll to result Updated to use selectionRect instead of visibleSelectionRect. selectionRect() now returns the visible rect by default. * WebView/WebHTMLView.mm: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): (-[WebHTMLView selectionImageRect]): 2007-05-10 dethbakin <bdakin@apple.com> Reviewed by Darin. Fix for <rdar://problem/5191941> Leopard: Adobe Acrobat 8: Distiller 8 needs same check fix as 4992521 * WebView/WebView.mm: (-[WebView _updateWebCoreSettingsFromPreferences:]): Adobe Distiller needs the same quirk. 2007-05-10 Maciej Stachowiak <mjs@apple.com> Reviewed by Oliver. - WebKit part of fix for: <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load) <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465) The basic approach is to have Frames start out containing an empty document instead of absolutely nothing, so there is no need to initialize them on demand. Various side effects of that cause both of these bugs. However, this caused many regressions so I had to fix the fallout. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::takeFocus): Avoid focus cycle problems (can happen in DumpRenderTree with initial empty document now). * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge finishInitializingWithPage:frameName:frameView:ownerElement:]): init the frame. (-[WebFrameBridge determineObjectFromMIMEType:URL:]): return image type when appropriate * WebView/WebFrame.mm: (-[WebFrame stopLoading]): use stopForUserCancel(). * WebView/WebFrameView.mm: (-[WebFrameView _makeDocumentViewForDataSource:]): assume html when no mime type available. * WebView/WebView.mm: (-[WebView becomeFirstResponder]): Track whether we are becoming first responder from outside the view. (-[WebView _becomingFirstResponderFromOutside]): Return this value. * WebView/WebViewInternal.h: 2007-05-09 Oliver Hunt <oliver@apple.com> rs=Adele. The previous patch (r21346) broke editing, rolling out * WebView/WebHTMLView.mm: (-[WebHTMLView _interceptEditingKeyEvent:shouldSaveCommand:]): (-[WebHTMLView doCommandBySelector:]): 2007-05-09 Adele Peterson <adele@apple.com> Reviewed by Oliver. Re-applying fix for <rdar://problem/5107538> REGRESSION: Page scroll when selecting characters from inline input candidate window by arrow buttons http://bugs.webkit.org/show_bug.cgi?id=13263 We don't need to call interpretKeyEvents for cmd-key events as they events will be interpreted by performKeyEquivalent. * WebView/WebHTMLView.mm: (-[WebHTMLView _interceptEditingKeyEvent:shouldSaveCommand:]): (-[WebHTMLView doCommandBySelector:]): 2007-05-09 Mark Rowe <mrowe@apple.com> Build fix to keep the buildbot happy. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): 2007-05-08 Bruce Q Hammond <bruceq@apple.com> Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=13578 Bug 13578: When QD plugins draw to an offscreen bitmap the origin is not correct Now we have correct handling of the origin when QD plugins draw to offscreen bitmaps. Also the clipping code for this path was doing unnecessary work which caused incorrect results; it has been removed. This change should not affect Safari and in general will only affect plugins (e.g. Flash) drawing to a CGBitmapContext. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): 2007-05-08 Steve Falkenburg <sfalken@apple.com> Reviewed by Darin. Implemented spelling/grammar related WebEditorClient methods. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::ignoreWordInSpellDocument): Added. Call through to NSSpellChecker. (WebEditorClient::learnWord): Added. Call through to NSSpellChecker. (WebEditorClient::checkSpellingOfString): Added. Call through to NSSpellChecker. (WebEditorClient::checkGrammarOfString): Added. Call through to NSSpellChecker. (WebEditorClient::updateSpellingUIWithGrammarString): Added. Call through to NSSpellChecker. (WebEditorClient::updateSpellingUIWithMisspelledWord): Added. Call through to NSSpellChecker. (WebEditorClient::showSpellingUI): Added. Call through to NSSpellChecker. (WebEditorClient::spellingUIIsShowing): Added. Call through to NSSpellChecker. (WebEditorClient::getGuessesForWord): Added. Call through to NSSpellChecker. 2007-05-08 Steve Falkenburg <sfalken@apple.com> Reviewed by Ada. Slight modification to last editor method fix. * WebCoreSupport/WebEditorClient.h: (WebEditorClient::updateSpellingUIWithGrammarString): 2007-05-07 Geoffrey Garen <ggaren@apple.com> Reviewed by Maciej Stachowiak. Fixed <rdar://problem/5140447> API for fetching JSGlobalContextRef from WebView or WebFrame Added -[WebFrame windowObject] and -[WebFrame globalContext], along with a new frame load delegate method, - (void)webView:(WebView *)webView didClearWindowObject:(WebScriptObject *)windowObject forFrame:(WebFrame *)frame. This is all to support briding between the WebScriptObject and JavaScriptCore APIs. Also fixed more of <rdar://problem/4395622> API: WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript returns NO by default, and generally cleaned up the WebScriptObject headerdoc. * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge windowObjectCleared]): * WebView/WebFrame.mm: (-[WebFrame windowObject]): (-[WebFrame globalContext]): * WebView/WebFramePrivate.h: * WebView/WebViewPrivate.h: 2007-05-07 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/5180384> webView:validateUserInterfaceItem:defaultValidation: does not get called on WebUIDelegates Call the delegate when the one of our views gets a validateUserInterfaceItem: call. * WebView/WebHTMLView.mm: (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): Validate without the delegate. (-[WebHTMLView validateUserInterfaceItem:]): Call the delegate with the result of validateUserInterfaceItemWithoutDelegate:. * WebView/WebPDFView.mm: (-[WebPDFView validateUserInterfaceItemWithoutDelegate:]): Validate without the delegate. (-[WebPDFView validateUserInterfaceItem:]): Call the delegate with the result of validateUserInterfaceItemWithoutDelegate:. * WebView/WebView.mm: (-[WebView _responderValidateUserInterfaceItem:]): Call validateUserInterfaceItemWithoutDelegate: to prevent asking the delegate twice. (-[WebView validateUserInterfaceItemWithoutDelegate:]): Validate without the delegate. (-[WebView validateUserInterfaceItem:]): Call the delegate with the result of validateUserInterfaceItemWithoutDelegate:. 2007-05-07 Brady Eidson <beidson@apple.com> Actually finish the code move from my last checkin * History/WebHistoryItem.mm: (-[WebHistoryItem _transientPropertyForKey:]): (-[WebHistoryItem _setTransientProperty:forKey:]): 2007-05-07 Brady Eidson <beidson@apple.com> Rubberstamped by Kevin (Sarge) Make _transientPropertyForKey: and _setTransientProperty:forKey: SPI * History/WebHistoryItemInternal.h: * History/WebHistoryItemPrivate.h: 2007-05-04 Geoffrey Garen <ggaren@apple.com> Reviewed by Tim Hatcher. First step in fixing <rdar://problem/5055182> The back cache has no global cap Stop giving SnapBack infinite cache-ability. Instead, make SnapBack rely on the underlying back cache. I left -setAlwaysAttemptToUsePageCache: as an empty stub because we don't want to break Safari 2.0, but I removed its header declaration so nobody else starts using it. * History/WebHistoryItem.mm: (-[WebHistoryItem setAlwaysAttemptToUsePageCache:]): * History/WebHistoryItemPrivate.h: 2007-05-04 Geoffrey Garen <ggaren@apple.com> Reviewed by Brady Eidson. Some cleanup in preparation for fixing <rdar://problem/5055182> The back/forward cache has no global cap Unified naming of WebKit/WebCore b/f lists -- instead of the potpourri of webBackForwardList, backForwardList, list, kitList, coreList, listWrapper, and webCoreBackForwardList, we use webBackForwardList for WebKit and backForwardList for WebCore, matching their respective class names. Removed "private" versions of kit() and core() -- kit() and core() are canonically used for converting between WebKit API objects and WebCore API objects. I think it's clearer to have only one way to do this. Removed COMPUTE_DEFAULT_PAGE_CACHE_SIZE, since it was unused. Removed _clearPageCache, since it was unused and it duplicated -setPageCacheSize:0. Removed _usesPageCache, since it was unused and it duplicated -pageCacheSize. 2007-05-04 Brady Eidson <beidson@apple.com> Reviewed by Mark Rowe Added main thread assertion to WebHTMLView to help make sure 3rd party clients aren't trying to draw on secondary threads * WebView/WebHTMLView.mm: (-[WebHTMLView drawRect:]): Added ASSERT_MAIN_THREAD() 2007-05-04 Anders Carlsson <andersca@apple.com> Reviewed by Antti. <rdar://problem/5179977> Use the correct URLs when dispatching delegate methods for data loads. * WebView/WebFrame.mm: (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): If the base URL is nil, set it to "about:blank", and set the response URL to a generated applewebdata URL. * WebView/WebView.mm: (+[WebView _canHandleRequest:]): No need to special-case applewebdata URLs here anymore, they're only used in responses. 2007-05-03 Steve Falkenburg <sfalken@apple.com> Reviewed by Oliver. Add missing user description parameter to spelling-related editor client method. * WebCoreSupport/WebEditorClient.h: (WebEditorClient::updateSpellingUIWithGrammarString): 2007-05-03 TImothy Hatcher <timothy@apple.com> Reviewed by Kevin. <rdar://problem/4975212> REGRESSION: With NetNewsWire 2.1.1, the contextual menu shows extra menu items when focus is placed in input or textarea field The NetNewsWire UI delegate isn't expecting calls for form controls, so we need to do a linked-on-or-after check. If the application was linked against Tiger or earlier and the element is a text form control, just return the default menu items and bypass the delegate call completely. * WebCoreSupport/WebContextMenuClient.mm: (isPreVersion3Client): Cache the result of the WebKitLinkedOnOrAfter call (fixMenusToSendToOldClients): Call the new isPreVersion3Client() (fixMenusReceivedFromOldClients): Ditto. (WebContextMenuClient::getCustomMenuFromDefaultItems): Return the default menu items if the element is a text form control. 2007-05-03 Mark Rowe <mrowe@apple.com> Reviewed by Geoff and Kevin. <rdar://problem/5141290> WebAssertions.h is still needed by some internal clients Second shot at fixing this error. Stub out the macros rather than forwarding to JavaScriptCore, which would leave clients using this header trying to resolve JavaScriptCore symbols against WebKit when linking. This should only happen in production builds when assertions should be disabled anyway as anyone building a development configuration should be in a position to move away from using this header. * Misc/WebAssertions.h: 2007-05-03 Timothy Hatcher <timothy@apple.com> Reviewed by Kevin. <rdar://problem/5067707> REGRESSION: "Open Link" contextual menu item appears twice in Mail Remove the check for Mail in fixMenusToSendToOldClients and fixMenusReceivedFromOldClients when linked on or after Leopard. The isAppleMail() function is still used for Tiger Mail fixups. * WebCoreSupport/WebContextMenuClient.mm: (fixMenusToSendToOldClients): (fixMenusReceivedFromOldClients): 2007-05-02 Anders Carlsson <andersca@apple.com> Reviewed by Brady. <rdar://problem/5151113> Assertion firing in [FrameProgressEntry addChild:forDataSource:] when navigating cnn.com The assertion fired because a plug-in was trying to load a subresource when a new load had started but not yet committed. The check that would have prevented this was removed in order to fix <rdar://problem/5085897>. This puts back the check but changes it to allow loads where the target is the same frame as the plugin's parent frame. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): 2007-04-27 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. There were only a couple calls to ResourceLoadDelegate forwarder left, this removes the calls and adds a new cached method for didFailLoad. * WebKit/DefaultDelegates/WebDefaultResourceLoadDelegate.h: Removed. * WebKit/DefaultDelegates/WebDefaultResourceLoadDelegate.m: Removed. * WebKit/Plugins/WebNullPluginView.mm: Call the resource load delegate directly. * WebKit/WebCoreSupport/WebFrameLoaderClient.mm: Call the cached didFailLoad delegate function. * WebKit/WebKit.xcodeproj/project.pbxproj: Remove WebDefaultResourceLoadDelegate. * WebKit/WebView/WebDataSource.mm: Remove the #import for WebDefaultResourceLoadDelegate.h * WebKit/WebView/WebView.mm: Remove the ResourceLoadDelegate forwarder, and remove a method that isn't used. * WebKit/WebView/WebViewInternal.h: Ditto. * WebKit/WebView/WebViewPrivate.h: Remove a method that is no longer used. 2007-04-27 David Harrison <harrison@apple.com> Reviewed by Darin. <rdar://problem/5160627> Export JS list creation support as ObjC SPI for Mail * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLView.mm: (-[WebHTMLView _selectedRange]): (-[WebHTMLView _shouldDeleteRange:]): (-[WebHTMLView _canEdit]): (-[WebHTMLView _canEditRichly]): (-[WebHTMLView _hasSelection]): (-[WebHTMLView _hasSelectionOrInsertionPoint]): (-[WebHTMLView _hasInsertionPoint]): (-[WebHTMLView _isEditable]): Condense the check for nil [self frame]. Remove canEditRichly checks and rely on the editor to do the check instead. (-[WebHTMLView _insertOrderedList]): (-[WebHTMLView _insertUnorderedList]): New. (-[WebHTMLView _canIncreaseSelectionListLevel]): (-[WebHTMLView _canDecreaseSelectionListLevel]): (-[WebHTMLView _increaseSelectionListLevel]): (-[WebHTMLView _increaseSelectionListLevelOrdered]): (-[WebHTMLView _increaseSelectionListLevelUnordered]): (-[WebHTMLView _decreaseSelectionListLevel]): Moved from bridge to frame editor. * WebView/WebHTMLViewPrivate.h: Add _insertOrderedList and _insertUnorderedList to WebHTMLView(WebPrivate) 2007-04-27 Brady Eidson <beidson@apple.com> Rubberstamped by Mark Remove default implementation of UIDelegate method that was removed I have also been instructed to give Tim a hard time about this one - apparently it was his job to clean it out and he failed... failed miserably. :) * DefaultDelegates/WebDefaultUIDelegate.m: Removed webViewPrint: 2007-04-27 Maciej Stachowiak <mjs@apple.com> Reviewed by Mark. <rdar://problem/5154113> Repro ASSERT (would be crash) in KJS::GCLock::GCLock (13462) http://bugs.webkit.org/show_bug.cgi?id=13462 * WebInspector/WebInspector.m: (-[WebInspectorPrivate dealloc]): Delay release of WebView to avoid GC re-entrancy. 2007-04-27 Anders Carlsson <andersca@apple.com> Reviewed by Mitz. <rdar://problem/5165755> View Source is broken; empty window is shown Return YES for applewebdata URLs. * WebView/WebView.mm: (+[WebView _canHandleRequest:]): 2007-04-26 Oliver Hunt <oliver@apple.com> Reviewed by Adam. Fix <rdar://problem/5061252> REGRESSION: In Gmail, image fails to be inserted into message field after dragging Don't try to create <img> tags for local image files as it results in the potential to submit forms that look like they have an image, when in reality they don't. * WebView/WebHTMLView.mm: (-[WebHTMLView _documentFragmentWithPaths:]): 2007-04-26 Anders Carlsson <andersca@apple.com> Reviewed by Maciej. <rdar://problem/5049099> documents no longer have a default base URL If the base URL is nil, then create a unique applewebdata URL to match what Tiger WebKit does. * WebView/WebFrame.mm: (createUniqueWebDataURL): (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): 2007-04-25 Oliver Hunt <oliver@apple.com> Rubber stamped by Adele. Roll out WebKit changes from from r21052 to fix regression noted in <rdar://problem/5159556> REGRESSION: In Mail, pressing option-command- ' doesn't decrease block quote in selection * WebView/WebHTMLView.mm: (-[WebHTMLView _interceptEditingKeyEvent:shouldSaveCommand:]): (-[WebHTMLView doCommandBySelector:]): 2007-04-25 Steve Falkenburg <sfalken@apple.com> Reviewed by Adam. Mac callbacks for new spelling methods in WebEditorClient. Not used yet. * WebCoreSupport/WebEditorClient.h: (WebEditorClient::ignoreWordInSpellDocument): (WebEditorClient::learnWord): (WebEditorClient::checkSpellingOfString): (WebEditorClient::checkGrammarOfString): (WebEditorClient::updateSpellingUIWithGrammarString): (WebEditorClient::updateSpellingUIWithMisspelledWord): (WebEditorClient::showSpellingUI): (WebEditorClient::spellingUIIsShowing): (WebEditorClient::getGuessesForWord): 2007-04-24 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler, Tim Hatcher. Fixed a few NSAutoreleasePool issues I noticed while reviewing Brady's patch. * Carbon/CarbonUtils.m: (PoolCleaner): Call -drain instead of -release, since -release is a no-op in a GC world. * Misc/WebKitErrors.m: (registerErrors): Condensed onto one line. * Plugins/WebPluginDatabase.m: (-[WebPluginDatabase refresh]): Call -drain instead of -release, since -release is a no-op in a GC world. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::setStatusbarText): * WebInspector/WebNodeHighlightView.m: (-[WebNodeHighlightView initWithHighlight:andRects:forView:]): Don't drain and then release because drain deallocates the receiver, so the release is an over-release. * WebView/WebView.mm: (-[WebView rectsForTextMatches]): Re-allocate the pool after draining it, because drain deallocates the receiver, so the drain would leave you without any autorelease pool, causing a leak and then an over-release at the bottom of the loop. 2007-04-24 Brady Eidson <beidson@apple.com> Reviewed by Beth, Hyatt, Ada, and Darin <rdar://problem/5011477> and <rdar://problem/5011514> Provide support for the icon.db to be moved to a different directory from the old WebKit-style icons, and remove the old directory if that is the case * Misc/WebIconDatabase.mm: (-[WebIconDatabase init]): (-[WebIconDatabase _importToWebCoreFormat]): Check "imported()" to determine if a conversion is needed - Look for WebIconDatabaseImportDirectoryDefaultsKey for the source location for the conversion - Set "imported" to true in the Icons.db - If the new Icons.db isn't in the same patch as the old icons, delete the entire directory when finished - Move old icon.db to Icons.db to reflect rename * Misc/WebIconDatabasePrivate.h: Add WebIconDatabaseImportDirectoryDefaultsKey so a WebKit client can tell WebKit where to look for the old icons if their location is different from the icon.db * WebKit.exp: 2007-04-24 Mitz Pettel <mitz@webkit.org> Reviewed by Oliver Hunt. Changed an apostrophe (') into a right single quotation mark (U+2019). * WebInspector/webInspector/inspector.js: 2007-04-24 Mitz Pettel <mitz@webkit.org> Reviewed by Timothy Hatcher. - fix http://bugs.webkit.org/show_bug.cgi?id=13459 The "mapped style" link next to an attribute doesn't work * WebInspector/webInspector/inspector.js: Added a check that the rule is mapped from an attribute. 2007-04-23 Adele Peterson <adele@apple.com> Fixed and reviewed by Darin, Adele, and Oliver. WebKit part of fix for <rdar://problem/5107538> REGRESSION: Page scroll when selecting characters from inline input candidate window by arrow buttons http://bugs.webkit.org/show_bug.cgi?id=13263 * WebView/WebHTMLView.mm: (-[WebHTMLView _interceptEditingKeyEvent:shouldSaveCommand:]): If we have no command after calling interpretKeyEvents, we assume the input method handled the key. (-[WebHTMLView doCommandBySelector:]): Add noop: to the command vector, but then when actually performing actions, ignore it. 2007-04-23 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/5124364> IB3 crashes when loading a nib containing a WebView that has a WebHTMLView encoded inside Since WebView's initWithCoder throws away all the decoded subviews, the WebHTMLView gets dealoced while it has a nil _private pointer. Checking for a nil _private in WehHTMLView's close fixes this crash. No need to implement a full initWithCoder for WebHTMLView since it will be thrown away by the WebView anyway. * WebView/WebHTMLView.mm: (-[WebHTMLView close]): Return earily if _priviate is nil. (-[WebHTMLView initWithFrame:]): Unrelated change that removes an AppKit version check that predates Tiger. 2007-04-23 Timothy Hatcher <timothy@apple.com> Reviewed by Mark Rowe. Remove the "No Selection" message after leaving search mode. This was a regression caused by the inspector refresh. * WebInspector/webInspector/inspector.js: 2007-04-23 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Bug 6658: World leak when closing inspected window http://bugs.webkit.org/show_bug.cgi?id=6658 and <rdar://problem/4411863> Removes over-retains of the inspector WebView, WebInspector and WebInspectorPanel. * WebInspector/WebInspector.m: (+[WebInspector sharedWebInspector]): Return the global sharedWebInspector variable. (-[WebInspector window]): Release the window after calling setWindow:. (-[WebInspector windowWillClose:]): Set the JavaScript Inspector variable to null and expire the current highlight. Also clear the global sharedWebInspector variable and release it if self equals sharedWebInspector. (-[WebInspector showWindow:]): Set the JavaScript Inspector variable back to self. * WebInspector/WebInspectorInternal.h: Remove the isSharedInspector member variable. * WebView/WebView.mm: (-[WebView windowScriptObject]): Return nil if core([self mainFrame]) is NULL. 2007-04-23 Darin Adler <darin@apple.com> Reviewed by Hyatt. - rename box-sizing to -webkit-box-sizing * WebInspector/webInspector/inspector.css: Here. * WebInspector/webInspector/inspector.js: And here, in the expected default CSS values list. 2007-04-22 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. The fix for <rdar://problem/4976681> ASSERTION failure on quit @ talkcrunch.com in _NPN_ReleaseObject was #ifdefed out in Production builds. * WebView/WebView.mm: (+[WebView initialize]): Move the #ifdef REMOVE_SAFARI_DOM_TREE_DEBUG_ITEM inside initialize around the specific code (+[WebView _applicationWillTerminate]): Moved outside the #ifdef REMOVE_SAFARI_DOM_TREE_DEBUG_ITEM block 2007-04-22 Timothy Hatcher <timothy@apple.com> Reviewed by Mitz. Bug 13436: Make Option-clicking a disclosure triangle expand the entire subtree http://bugs.webkit.org/show_bug.cgi?id=13436 Makes option-click recursively expand and collapse the sub-tree. Pressing option-left and -right also recursively expands and collapses the sub-tree. * WebInspector/webInspector/treeoutline.js: 2007-04-22 Timothy Hatcher <timothy@apple.com> Reviewed by Mitz. Bug 13437: Inspector does not update when navigating to a different page http://bugs.webkit.org/show_bug.cgi?id=13437 * WebInspector/webInspector/inspector.js: Correctly update to a new root node if the new focus node and the old focus node don't have a common ancestor. 2007-04-22 Darin Adler <darin@apple.com> Reviewed by Adele. - fix for <rdar://problem/5100240> REGRESSION: Control-O broken * WebView/WebHTMLView.mm: (-[WebHTMLView _interceptEditingKeyEvent:shouldSaveCommand:]): Update to handle a vector of command names instead of a single command. (-[WebHTMLView doCommandBySelector:]): Change logic so that we add the command to a vector and also so that the interpretKeyEvents parameters are still intact for a second call to doCommandBySelector:, since the key bindings mechanism can do more than one. (-[WebHTMLView insertText:]): Added comment. 2007-04-21 Darin Adler <darin@apple.com> Reviewed by Oliver. - fix some problems I ran into using the inspector * WebInspector/webInspector/inspector.js: Add some null checks. 2007-04-20 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Merge over the WebInspectorRefresh branch. This change removes the NSOutlineView and is replaced with a HTML/JavaScript tree. Most of the inspector logic is now in the JavaScript. A few bugs are fixed by these changes: Bug 6615: Parent node drop-down list is upside-down http://bugs.webkit.org/show_bug.cgi?id=6615 Bug 6643: REGRESSION: Tree view repaints lines without erasing them first http://bugs.webkit.org/show_bug.cgi?id=6643 Bug 6650: Web Inspector HTML Hierarchy can't be scrolled with scrollwheel http://bugs.webkit.org/show_bug.cgi?id=6650 Bug 6677: Can't drag inspector when tree view has focus http://bugs.webkit.org/show_bug.cgi?id=6677 Bug 7326: Web Inspector tree scrollbar always shows up when resizing the top pane down http://bugs.webkit.org/show_bug.cgi?id=7326 * WebInspector/WebInspector.h: Removed the searchQuery methods. * WebInspector/WebInspector.m: Removed the DOMNode category and code for the old outline view. * WebInspector/WebInspectorOutlineView.h: Removed. * WebInspector/WebInspectorOutlineView.m: Removed. * WebInspector/WebInspectorInternal.h: Remove some methods and instance variables. * WebInspector/webInspector/Images/resize.png: Added. * WebInspector/webInspector/inspector.css: * WebInspector/webInspector/inspector.html: Include the new classes and remove the plugin. * WebInspector/webInspector/inspector.js: Changes to use the new tree outline and other fixes. * WebInspector/webInspector/scrollarea.js: Copied from the Dashboard widget resources. * WebInspector/webInspector/scrollbar.js: Ditto. * WebInspector/webInspector/treeoutline.js: New tree outline class. * WebInspector/webInspector/utilities.js: DOM and String prototype additions. * WebKit.xcodeproj/project.pbxproj: Remove WebInspectorOutlineView. 2007-04-20 Brady Eidson <beidson@apple.com> Reviewed by Oliver (Black Sheep) <rdar://problem/3559794> [WebView setMaintainsBackForwardList:] doesn't actually flush out the current page caches * WebView/WebView.mm: Remove _private->useBackForwardList (-[WebView _setInitiatedDrag:]): Use _private->page instead of [self page] (-[WebView initWithCoder:]): Manipulate the flag that is now in WebCore::BackForwardList (-[WebView encodeWithCoder:]): Ditto (-[WebView backForwardList]): Use _private->page instead of [self page] (-[WebView setMaintainsBackForwardList:]): Manipulate the flag that is now in WebCore::BackForwardList 2007-04-20 Anders Carlsson <andersca@apple.com> Reviewed by Maciej. <rdar://problem/5085897> REGRESSION: Some Flash links at www.jumpskyhigh.com just reload the page Get rid of the check that would prevent plugin requests from being loaded if a new page load was underway. www.jumpskyhigh.com had a flash movie that was embedded inside an <a> tag and clicking on the plug-in would cause the URL pointed to by the <a> tag to start loading and thus preventing the plug-in from loading the real URL. This check was added by Maciej and we should be able to remove it with the loader changes that have happened now, (mainly the fact that resource loaders are handled by the document loader instead of the frame loader). * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): 2007-04-19 Oliver Hunt <oliver@apple.com> Reviewed by Adam. Fix for <rdar://problem/4960912> -- REGRESSION: Content-Disposition: filename is ignored for drag-and-drop. * WebView/WebResource.mm: (-[WebResource _fileWrapperRepresentation]): When creating the NSFileWrapper check the response for a preferred filename, rather than just blindly hoping for the best. 2007-04-19 Anders Carlsson <andersca@apple.com> Reviewed by John. <rdar://problem/5137002> REGRESSION (r20812): [WebFrame DOMDocument] is returning non-nil value in bookmarks view, causing trouble in Safari Put back the MIME type check as a workaround. * WebView/WebFrame.mm: (-[WebFrame DOMDocument]): 2007-04-19 Mark Rowe <mrowe@apple.com> Reviewed by Oliver and Adam. <rdar://problem/5141290> WebAssertions.h is still needed by some internal clients. * Misc/WebAssertions.h: Added. * WebKit.xcodeproj/project.pbxproj: 2007-04-17 Brady Eidson <beidson@apple.com> Reviewed by Tim <rdar://problem/5008925> Expose the NSURLConnection delegate willCacheResponse API to WebResourceLoadDelegate * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::willCacheResponse): Call [WebResourceLoadDelegate webView:resource:willCacheResponse:fromDataSource:]; * WebView/WebView.mm: (-[WebView _cacheResourceLoadDelegateImplementations]): Pull out the willCacheResponse impl * WebView/WebViewPrivate.h: Add WebResourceLoadDelegatePrivate category for this new SPI 2007-04-18 John Sullivan <sullivan@apple.com> Reviewed by Adam - fixed <rdar://problem/5103009> REGRESSION: Activity window shows blank name for untitled pages * WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation title]): return nil for empty string, to match old behavior 2007-04-17 John Sullivan <sullivan@apple.com> Reviewed by Tim Hatcher - fixed <rdar://problem/5138492> Safari doesn't remember some changes to the PDF scale and display mode Some of the user interactions that could change the PDF scale and display mode were not going through the proxy mechanism in WebPDFView that updates preferences. Now we also listen to PDFKit notifications in order to catch the other cases. * WebView/WebPDFView.h: new _ignoreScaleAndDisplayModeNotifications and _updatePreferencesTimer ivars * WebView/WebPDFView.mm: (-[WebPDFView setPDFDocument:]): ignore scale and display mode notifications while we're setting up a fresh document (-[WebPDFView dealloc]): cancel the new timer (which releases it) (-[WebPDFView viewDidMoveToWindow]): listen for two PDFKit notifications (-[WebPDFView viewWillMoveToWindow:]): stop listening to the two PDFKit notifications (-[WebPDFView _applyPDFDefaults]): white space change (-[WebPDFView _cancelUpdatePreferencesTimer]): invalidate, release, and nil out the timer (-[WebPDFView _scaleOrDisplayModeChanged:]): update preferences soon, unless deliberately ignoring these notifications (-[WebPDFView _updatePreferencesNow]): cancel timer, then save data to preferences (code for saving the data was extracted from -[PDFPrefUpdatingProxy forwardInvocation:]) (-[WebPDFView _updatePreferencesSoon]): use timer to consolidate multiple calls into one action; formerly we were setting preferences multiple times for some atomic user actions (-[PDFPrefUpdatingProxy forwardInvocation:]): call _updatePreferencesSoon where we used to immediately set preferences 2007-04-17 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker - fixed <rdar://problem/4184640> "Look Up in Dictionary" item is always disabled for PDF pages * WebView/WebPDFView.mm: (-[WebPDFView validateUserInterfaceItem:]): enable "Look Up in Dictionary" only if we're using a version of PDFKit that knows how to do so (-[WebPDFView _canLookUpInDictionary]): use respondsToSelector to test whether the current version of PDFKit supports this non-API feature (-[WebPDFView _lookUpInDictionaryFromMenu:]): implement this method, which WebKit includes in the context menu when there's selected text (-[WebPDFView _menuItemsFromPDFKitForEvent:]): updated comment for this change 2007-04-16 Darin Adler <darin@apple.com> Rubber stamped by Tim Hatcher. * WebKit.xcodeproj/project.pbxproj: Added Radar bug number to the error message for the "version number ending in 4" check so folks from Apple can find the original bug that motivated for this. To summarize what's in that bug, it says that <http://my.fedex.com> was failing, that it was because of the OpenCube DHTML Menu, and that some other affected sites were not using OpenCube (so the error is presumably more widespread). 2007-04-16 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - fix http://bugs.webkit.org/show_bug.cgi?id=13303 <rdar://problem/5126341> REGRESSION: controls in a background Safari window maintain active appearance if the address bar has focus (13303) * WebView/WebHTMLView.mm: (-[WebHTMLView _windowChangedKeyState]): Added. Calls FrameView::updateControlTints. 2007-04-13 Oliver Hunt <oliver@apple.com> Reviewed by Adam. Due to rdar://problem/5133910 -- WebArchives should not be constructed using resource from the cache -- We may try to create a potentially incorrect WebArchive when dragging an image multiple times. This patch retains the assertion for invalid behaviour, but adds a branch to make sure we don't try to do anything with the WebArchive in release builds. * Misc/WebNSPasteboardExtras.mm: (-[NSPasteboard _web_writeImage:element:URL:title:archive:types:]): 2007-04-13 Timothy Hatcher <timothy@apple.com> Reviewed by Dave Harrison. <rdar://problem/5132727> Soho Mail build fails because of renamed SPI * WebView/WebUIDelegatePrivate.h: define WebMenuItemTagSearchInGoogle as OldWebMenuItemTagSearchWeb 2007-04-13 Mark Rowe <mrowe@apple.com> Reviewed by Oliver. <rdar://problem/5130686> Using WebPreferencesPrivate.h requires modifying framework search path * WebView/WebPreferencesPrivate.h: Remove unneeded #ifdef. 2007-04-12 Deneb Meketa <dmeketa@adobe.com> Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=13029 rdar://problem/4994849 Bug 13029: Permit NPAPI plug-ins to see HTTP response headers. * Plugins/WebBaseNetscapePluginStream.h: declarations. * Plugins/WebBaseNetscapePluginStream.mm: main implementation. (-[WebBaseNetscapePluginStream dealloc]): cleanup. (-[WebBaseNetscapePluginStream finalize]): cleanup. (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:headers:]): Pass headers along. (-[WebBaseNetscapePluginStream startStreamWithResponse:]): Main work is here. Extract headers from NSHTTPURLResponse object into a byte sequence. See comments here about how it would be nice to have low-level access to the HTTP response. (-[WebBaseNetscapePluginStream _destroyStream]): cleanup. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): Conform to new startStream params. Not applicable here, pass nil. 2007-04-12 Brady Eidson <beidson@apple.com> Build fix for case sensitive file systems * Misc/WebNSPasteboardExtras.mm: * WebCoreSupport/WebPasteboardHelper.mm: 2007-04-11 John Sullivan <sullivan@apple.com> Reviewed by Anders - WebKit part of fix for: <rdar://problem/5128697> REGRESSION: At least one PDF context menu item isn't appearing on Leopard * Misc/WebNSArrayExtras.h: Added. * Misc/WebNSArrayExtras.m: Added. (-[NSMutableArray _webkit_removeUselessMenuItemSeparators]): New file, includes this method to strip leading, trailing, and duplicate separators from arrays of NSMenuItems (copied from Safari) * WebView/WebUIDelegatePrivate.h: new MenuItemTag enum values for new PDFKit context menu items * WebKit.xcodeproj/project.pbxproj: updated for new files * WebView/WebPDFView.mm: (-[WebPDFView _anyPDFTagsFoundInMenu:]): check for new PDFKit context menu items (-[WebPDFView _menuItemsFromPDFKitForEvent:]): associate new PDFKit context menu item selectors with the new tags; skip certain selectors that correspond to menu items that WebKit already includes; remove useless menu item separators when we're done, since we might have removed arbitrarily-placed menu items 2007-04-11 Oliver Hunt <oliver@apple.com> Reviewed by Maciej. Adding RetainPtr to the many global obj-c pointers we use in C/C++ methods. This is necessary to prevent GC from collecting globals we want to keep around. We use RetainPtr in obj-c++ and c++ files, and CFRetain/Release in pure obj-c. This fixes <rdar://problem/5058731> -- Crash in WebCore::DragData::containsCompatibleContent due to early release of types array * Misc/WebLocalizableStrings.m: (WebLocalizedString): * Misc/WebNSPasteboardExtras.mm: (+[NSPasteboard _web_writableTypesForURL]): (_writableTypesForImageWithoutArchive): (_writableTypesForImageWithArchive): * Misc/WebNSURLExtras.m: (applyHostNameFunctionToMailToURLString): (applyHostNameFunctionToURLString): * Misc/WebStringTruncator.m: (defaultMenuFont): (fontFromNSFont): * WebCoreSupport/WebPasteboardHelper.mm: (WebPasteboardHelper::insertablePasteboardTypes): 2007-04-11 MorganL <morganl.webkit@yahoo.com> Reviewed by Maciej. Add a Frame pointer to ChromeClient methods: http://bugs.webkit.org/show_bug.cgi?id=13127 * COM/ChromeClientWin.cpp: (ChromeClientWin::createWindow): (ChromeClientWin::createModalDialog): * COM/ChromeClientWin.h: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::createWindow): (WebChromeClient::createModalDialog): 2007-04-10 Brady Eidson <beidson@apple.com> Reviewed by Darin <rdar://problem/4887095> - PageCache and PageState should be combined WebKit side of the change to reflect the new object name of CachedPage and new Client method names * History/WebHistoryItem.mm: (-[WebHistoryItem setAlwaysAttemptToUsePageCache:]): (+[WebHistoryItem _releaseAllPendingPageCaches]): (-[WebWindowWatcher windowWillClose:]): * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::setDocumentViewFromCachedPage): (WebFrameLoaderClient::loadedFromCachedPage): (WebFrameLoaderClient::saveDocumentViewToCachedPage): 2007-04-09 Geoffrey Garen <ggaren@apple.com> Reviewed by Maciej Stachowiak. Support for fixing fast/forms/textarea-paste-newline.html. Added SPI for specifying whether a WebView should allow pasting through the DOM API. * ChangeLog: * WebKit.xcodeproj/project.pbxproj: * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.m: (+[WebPreferences standardPreferences]): (-[WebPreferences isDOMPasteAllowed]): (-[WebPreferences setDOMPasteAllowed:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _updateWebCoreSettingsFromPreferences:]): 2007-04-09 Anders Carlsson <andersca@apple.com> Reviewed by John. <rdar://problem/5081860> REGRESSION: Select All for standalone image has no visible effect but does change state <rdar://problem/5081840> REGRESSION: context menu in white space beyond standalone image is different after Select All Have validateUserInterface emulate the old behavior for full-frame images and plugins, which is: - For full-frame plugins, always return false. - For images, only return true if the selector is copy: and the image has finished loading. * WebView/WebHTMLView.mm: (-[WebHTMLView validateUserInterfaceItem:]): 2007-04-09 Anders Carlsson <andersca@apple.com> Reviewed by Darin. <rdar://problem/5026893> REGRESSION: "Mail Contents of this Page" for standalone image in Safari results in a broken image in Mail * WebView/WebFrame.mm: (-[WebFrame DOMDocument]): We can't check for _isHTMLDocument here since image and plugin documents inherit from HTMLDocument. Instead, check for those two document types explicitly. 2007-04-09 Anders Carlsson <andersca@apple.com> Reviewed by Geoff, Ada and John. <rdar://problem/4600978> Would like a way to test whether a WebView is displaying a standalone image * WebView/WebFrame.mm: (-[WebFrame _isDisplayingStandaloneImage]): * WebView/WebFramePrivate.h: Add _isDisplayingStandaloneImage SPI. 2007-04-06 Timothy Hatcher <timothy@apple.com> Reviewed by Mark Rowe. Adds a build phase script that ensures WebKit's version dosen't end in a 4. If our version ends in 4, some sites might think we are Netscape 4 in their user agent checks. * Configurations/Version.xcconfig: * WebKit.xcodeproj/project.pbxproj: 2007-04-05 Anders Carlsson <andersca@apple.com> Reviewed by Adam. <rdar://problem/5083023> REGRESSION: In Real Player (10.1.0), video continues to play after closing window This broke in revision 18422 because now the plugin isn't stopped when the window is closed. Since the window is retained by the plugin view for as long as it is running (so that removeTrackingRect works even though the window has been closed), we would end up with a reference cycle (NSWindow -> WebView -> PluginView -> NSWindow) and stopping the plug-in when the window was closed would break that cycle. Applications that call -[WebView close] when closing aren't affected, but RealPlayer doesn't do this. The bug that 18422 was supposed to fix was fixed by 19275, which is why it's safe to add back the check. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView addWindowObservers]): (-[WebBaseNetscapePluginView removeWindowObservers]): (-[WebBaseNetscapePluginView windowWillClose:]): 2007-04-05 Kevin McCullough <kmccullough@apple.com> Reviewed by Darin. - Moved registerURLSchemeAsLocal to the public API. * WebView/WebView.h: * WebView/WebView.mm: (+[WebView registerURLSchemeAsLocal:]): * WebView/WebViewPrivate.h: === Safari-5522.6 === 2007-04-04 Anders Carlsson <andersca@apple.com> Reviewed by John. <rdar://problem/5107536> http://bugs.webkit.org/show_bug.cgi?id=13264 REGRESSION: Crash when canceling about:blank in Activity viewer * WebView/WebFrame.mm: (-[WebFrame stopLoading]): Add a null check for the frame loader - it can be null when the frame has been disconnected from the web page. 2007-04-03 Anders Carlsson <andersca@apple.com> Reviewed by Darin. <rdar://problem/5028178> Crash occurs at WebCore::FrameLoader::activeDocumentLoader() after loading Froggster widget * Plugins/WebNetscapePluginStream.mm: (-[WebNetscapePluginStream start]): If load returns no the plugin loader has already been removed by the didFail callback. 2007-04-02 Anders Carlsson <andersca@apple.com> Reviewed by Geoff. Fix crash when running plugins/destroy-stream-twice.html under GuardMalloc * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.mm: (+[WebBaseNetscapePluginStream ownerForStream:]): (-[WebBaseNetscapePluginStream initWithRequestURL:plugin:notifyData:sendNotification:]): (-[WebBaseNetscapePluginStream dealloc]): (-[WebBaseNetscapePluginStream finalize]): Change the streams hash map to contain an NPStream*, and change ownerForStream to take an NPStream*. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView destroyStream:reason:]): Check that the NPStream pointer is valid before accessing stream->ndata. 2007-04-02 Darin Adler <darin@apple.com> Reviewed by Geoff. - fix http://bugs.webkit.org/show_bug.cgi?id=13026 <rdar://problem/5061026> incomplete render of menu (assertion failing in -[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]) - fix http://bugs.webkit.org/show_bug.cgi?id=13120 <rdar://problem/5080339> Plug-ins that draw through the QuickDraw interface may crash by hanging onto old GWorlds. - set clip path for CoreGraphics plug-ins in the same way we do for QuickDraw plug-ins this is a better fix for <rdar://problem/4939511> WebKit should set the the CG clip path for plug-ins that draw using Core Graphics Incorporates changes from a patch by Mark Ambachtsheer. Here are the changes: 1) Don't try to use the offscreen code path if GGBitmapContextGetData returns 0. 2) Handle kCGBitmapByteOrderDefault when computing the QD pixel format, even though we don't have any evidence that this happens in practice. 3) Keep the GWorld around until we create a new one or the plug-in is destroyed. 4) Use the GWorld pointer itself as a flag to indicate whether we are using an offscreen GWorld. 5) Set up clipping for CoreGraphics in the same way we do for QuickDraw; remove an earlier attempt that handled CoreGraphics differently. * Plugins/WebBaseNetscapePluginView.h: Added a field named offscreenGWorld to hold the GWorld until it's needed. * Plugins/WebBaseNetscapePluginView.mm: (getQDPixelFormatForBitmapContext): Replaced QDPixelFormatFromCGBitmapInfo. Used the "get" prefix so we don't intrude on the QD namespace. Added code to handle the kCGBitmapByteOrderDefault case, although I'm not sure it will really come up in practice -- it wasn't really coming up in the buggy case. (getNPRect): Added helper functions. Used to make the code below clearer. (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): Use getNPRect to streamline code. Use GetGWorld to save the port since we use SetGWorld to restore it later. Store the GWorld we create in the offscreenGWorld field and dispose the existing one. Don't treat the CGBitmapContext as an offscreen bitmap if it has a data pointer of 0. Set up the clip based on the result of -[NSView getRectsBeingDrawn:count] when setting up the port for CoreGraphics (after saving the port state). (-[WebBaseNetscapePluginView restorePortState:]): Remove now-unneeded code to destroy the offscreen GWorld, and simplified the code that restores the port so we don't need a separate case for offscreen. (-[WebBaseNetscapePluginView fini]): Renamed from freeAttributeKeysAndValues, since this method now does more than just the attributes. This is the shared method that does things needed in both dealloc and finalize. Added a call to DisposeGWorld here. (-[WebBaseNetscapePluginView dealloc]): Updated for name change. (-[WebBaseNetscapePluginView finalize]): Ditto. (-[WebBaseNetscapePluginView drawRect:]): Removed code to set clip. This is done in the saveAndSetNewPortStateForUpdate: method instead. 2007-03-30 Adele Peterson <adele@apple.com> Reviewed by Darin. Call execCommand for deleteWordForward and deleteWordBackward instead of calling deleteWithDirection directly. * WebView/WebHTMLView.mm: (-[WebHTMLView deleteWordForward:]): (-[WebHTMLView deleteWordBackward:]): 2007-03-30 Anders Carlsson <andersca@apple.com> Reviewed by Geoff. * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): Initialize pushpopupsenabledstate, poppopupsenabledstate and enumerate. * Plugins/npapi.m: (NPN_PushPopupsEnabledState): (NPN_PopPopupsEnabledState): Add stubs for these functions. * Plugins/npfunctions.h: Add new methods to NPNetscapeFuncs. 2007-03-29 Geoffrey Garen <ggaren@apple.com> Reviewed by Beth Dakin, reviewed by Maciej Stachowiak. Layout test for <rdar://problem/5091330> REGRESSION: Repro crash in -[WebBaseNetscapePluginView(WebNPPCallbacks) destroyStream:reason:] navigating away from page with DivX movie plug-in (13203) Changed LOG_ERROR to LOG so the layout test doesn't produce console spew every time you run it. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView destroyStream:reason:]): 2007-03-29 Beth Dakin <bdakin@apple.com> Reviewed by Brady. Fix for <rdar://problem/4674537> REGRESSION: Adobe Acrobat 8 - Text blinks when mouse is moved, and is invisible otherwise -and- <rdar://problem/4992521> Please adjust WebKit's Acrobat-workaround methodology The fix for the first bug is to compare against the bundle identifiers for Adobe Reader and the non-Pro Adobe Acrobat in addition to Adobe Acrobat Pro. The fix for the second bug is to check the version number of Acrobat/Reader through WebKitSystemInterface instead of checking which version of WebKit it has been linked against. * English.lproj/StringsNotToBeLocalized.txt: Two new bundle identifiers. * Misc/WebKitVersionChecks.h: Remove Acrobat quirk constant. * WebView/WebView.mm: (-[WebView _updateWebCoreSettingsFromPreferences:]): 2007-03-29 Geoffrey Garen <ggaren@apple.com> Rubber stamped by Beth Dakin. WebBaseNetscapePluginStream.m => WebBaseNetscapePluginStream.mm, since it's ObjC++ now. * Plugins/WebBaseNetscapePluginStream.m: Removed. * WebKit.xcodeproj/project.pbxproj: 2007-03-27 Geoffrey Garen <ggaren@apple.com> Reluctantly tolerated by Darin Adler. Fixed <rdar://problem/5091330> REGRESSION: Repro crash in -[WebBaseNetscapePluginView(WebNPPCallbacks) destroyStream:reason:] navigating away from page with DivX movie plug-in (13203) The problem was that the DivX plug-in would ask us to destroy an NPStream that had already been destroyed, causing us to wander off into freed memory. (I believe the reason this was a regression was that we never used to destroy plug-in streams, period.) The solution here is to track the NPStreams belonging to a plug-in, and guard against plug-ins making calls with NPStreams that don't belong to them. (It turns out that NPN_DestroyStream is the only stream-based plug-in call we support.) (CarbonPathFromPOSIXPath): Fixed up a cast to be C++ compatible. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView destroyStream:reason:]): The actual fix. Use helper method to guard against a plug-in using an NPStream that doesn't belong to it. * WebKit.xcodeproj/project.pbxproj: Made WebBaseNetscapePluginView ObjC++ so I could use HashMap. 2007-03-28 Adele Peterson <adele@apple.com> Reviewed by Brady. Update to last fix. * Misc/WebKitVersionChecks.h: Added WEBKIT_FIRST_VERSION_WITHOUT_VITALSOURCE_QUIRK. * WebView/WebView.mm: (-[WebView stringByEvaluatingJavaScriptFromString:]): Added check to only use the VitalSource workaround if the app is not linked on or after the defined WEBKIT_FIRST_VERSION_WITHOUT_VITALSOURCE_QUIRK version number. 2007-03-28 Adele Peterson <adele@apple.com> Reviewed by Kevin M. WebKit part of fix for <rdar://problem/5095515> VitalSource Bookshelf should not pass return statements into stringByEvaluatingJavaScriptFromString Added an app specific workaround for VitalSource Bookshelf that strips "return" from the beginning of their script strings. We used to allow this but now we throw a JavaScript exception for return statements that aren't in functions. Filed this evangelism bug so we can notify VitalSource of the problem: <rdar://problem/5095515> VitalSource Bookshelf should not pass return statements into stringByEvaluatingJavaScriptFromString * WebView/WebView.mm: (-[WebView stringByEvaluatingJavaScriptFromString:]): 2007-03-27 John Sullivan <sullivan@apple.com> Reviewed by Tim - fixed <rdar://problem/5092556> Default UA spoofing is always off until explicitly toggled * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): initialize the cached value of _private->useSiteSpecificSpoofing here; formerly it would not be initialized correctly in the common case of WebViews that use [WebPreferences standardPreferences] 2007-03-27 Mark Rowe <mrowe@apple.com> Reviewed by Dave Harrison. * Configurations/WebKit.xcconfig: Include UMBRELLA_FRAMEWORKS_DIR in framework search path. 2007-03-26 Antti Koivisto <antti@apple.com> Reviewed by Darin. On Mac, support fine grained wheel events generated by trackpad and Mighty Mouse. http://bugs.webkit.org/show_bug.cgi?id=13134 <rdar://problem/5076249> * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Expose GetWheelEventDeltas() 2007-03-26 John Sullivan <sullivan@apple.com> Reviewed by Dave Harrison - fixed <rdar://problem/4769772> Problem with Find on certain PDF page * WebView/WebPDFView.mm: (-[WebPDFView _scaledAttributedString:]): We were hitting an exception trying to set the font attribute to nil, which was happening because the result of -[PDFSelection attributedString] had no attributes. That PDFSelection bug is now filed separately, but this works around the exception. 2007-03-24 David Hyatt <hyatt@apple.com> Amend the statistics reporting for the WebCore cache to include XSL and to report live/decoded sizes. * Misc/WebCache.mm: (+[WebCache statistics]): 2007-03-24 Brady Eidson <beidson@apple.com> Reviewed by Adam RetainPtr is no longer in the WebCore namespace * History/WebBackForwardList.mm: * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebFrameLoaderClient.h: * WebView/WebDocumentLoaderMac.h: 2007-03-24 Brady Eidson <beidson@apple.com> Reviewed by Adam <rdar://problem/5086210> - Move RetainPtr to WTF * ForwardingHeaders/wtf/RetainPtr.h: Added. * History/WebBackForwardList.mm: Changed #import to <wtf/RetainPtr.h> * WebCoreSupport/WebEditorClient.h: Ditto * WebCoreSupport/WebFrameLoaderClient.h: Ditto * WebView/WebDocumentLoaderMac.h: Ditto 2007-03-24 John Sullivan <sullivan@apple.com> Reviewed by Adele - fixed <rdar://problem/5084872> Need to add flickr to spoof list in WebKit - only do site-specific spoofing if a preference is set * WebView/WebPreferenceKeysPrivate.h: added WebKitUseSiteSpecificSpoofingPreferenceKey * WebView/WebPreferences.m: (+[WebPreferences initialize]): initialize WebKitUseSiteSpecificSpoofingPreferenceKey to false (-[WebPreferences _useSiteSpecificSpoofing]): get value of WebKitUseSiteSpecificSpoofingPreferenceKey (-[WebPreferences _setUseSiteSpecificSpoofing:]): set value of WebKitUseSiteSpecificSpoofingPreferenceKey * WebView/WebPreferencesPrivate.h: declare _useSiteSpecificSpoofing and _setUseSiteSpecificSpoofing * WebView/WebView.mm: cache the value of WebKitUseSiteSpecificSpoofingPreferenceKey in a bool in _private (-[WebView _preferencesChangedNotification:]): update the cached value (-[WebView setPreferences:]): ditto (-[WebView WebCore::_userAgentForURL:WebCore::]): Only spoof here if the new site-specific spoofing preference is enabled. If it is, pass Safari 2.0.4's user agent string for flickr.com. We can remove this case when 5081617 is addressed. 2007-03-24 Mark Rowe <mrowe@apple.com> Rubber-stamped by Darin. * Configurations/WebKit.xcconfig: Remove unnecessary INFOPLIST_PREPROCESS. 2007-03-23 Mark Rowe <mrowe@apple.com> Build fix for when BUILDING_ON_TIGER is not defined. * Misc/WebTypesInternal.h: * WebView/WebHTMLView.mm: 2007-03-22 David Kilzer <ddkilzer@apple.com> Reviewed by Darin. Use BUILDING_ON_TIGER from WebKitPrefix.h instead of local MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 tests. * Misc/WebTypesInternal.h: * WebView/WebHTMLView.mm: 2007-03-22 Darin Adler <darin@apple.com> Reviewed by Adele. - fix <rdar://problem/5074630> detachChildren call should move from WebKit to WebCore * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::prepareForDataSourceReplacement): Remove call to detachChildren. This should be a WebCore responsibility. 2007-03-19 Anders Carlsson <acarlsson@apple.com> Reviewed by Dave Hyatt. <rdar://problem/5067983> iSale: Crash occurs at WebFrameLoaderClient::dispatchDecidePolicyForMIMEType() when attempting to load a HTML template Restore old behavior (broke in r14533) where the resource load and download delegates are retained for as long as the data source is loading. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createDocumentLoader): * WebView/WebDocumentLoaderMac.h: * WebView/WebDocumentLoaderMac.mm: (WebDocumentLoaderMac::setDataSource): (WebDocumentLoaderMac::decreaseLoadCount): 2007-03-19 Geoffrey Garen <ggaren@apple.com> Speculative fix for why ASSERT_MAIN_THREAD didn't work for me. (The documentation says "non-zero," not "1." * Misc/WebKitLogging.m: (WebKitRunningOnMainThread): 2007-03-19 Andrew Wellington <proton@wiretapped.net> Reviewed by Maciej. Really set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html) * WebKit.xcodeproj/project.pbxproj: 2007-03-19 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Update for recent changes. 2007-03-19 John Sullivan <sullivan@apple.com> Reviewed by Justin - fixed <rdar://problem/5071238> REGRESSION: opt-cmd-B to show Bookmarks view does nothing when form field has focus * WebView/WebHTMLView.mm: (-[WebHTMLView _handleStyleKeyEquivalent:]): we were counting any set of modifiers plus 'b' as the standard key equivalent for toggling Bold; now we only accept command+'b' 2007-03-19 Adam Roben <aroben@apple.com> Reviewed by Hyatt and Maciej. Updated WebCoreStatistics for the conversion of WebCoreJavaScript to C++. * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptObjectsCount]): (+[WebCoreStatistics javaScriptInterpretersCount]): (+[WebCoreStatistics javaScriptProtectedObjectsCount]): (+[WebCoreStatistics javaScriptRootObjectTypeCounts]): Moved conversion to NSCountedSet here from WebCore. (+[WebCoreStatistics garbageCollectJavaScriptObjects]): (+[WebCoreStatistics garbageCollectJavaScriptObjectsOnAlternateThread:]): (+[WebCoreStatistics shouldPrintExceptions]): (+[WebCoreStatistics setShouldPrintExceptions:]): (+[WebCoreStatistics javaScriptReferencedObjectsCount]): (+[WebCoreStatistics javaScriptRootObjectClasses]): 2007-03-18 Andrew Wellington <proton@wiretapped.net> Reviewed by Mark Rowe Set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html) * WebKit.xcodeproj/project.pbxproj: 2007-03-19 Mark Rowe <mrowe@apple.com> Rubber-stamped by Brady. Update references to bugzilla.opendarwin.org with bugs.webkit.org. * WebInspector/webInspector/inspector.css: * WebView/WebHTMLView.mm: (-[WebHTMLView firstRectForCharacterRange:]): * WebView/WebView.mm: (-[WebView initWithFrame:frameName:groupName:]): 2007-03-18 David Hyatt <hyatt@apple.com> Move frame borders out of WebKit and into WebCore. Reviewed by aroben, olliej * WebCoreSupport/WebFrameBridge.mm: * WebKit.xcodeproj/project.pbxproj: * WebView/WebFrameView.mm: (-[WebFrameView drawRect:]): (-[WebFrameView setFrameSize:]): * WebView/WebFrameViewInternal.h: 2007-03-17 John Sullivan <sullivan@apple.com> Reviewed by Tim Hatcher Discovered while working on <rdar://problem/5070334> that many WebView calls will crash if called after -[WebView close] has executed because _private->page is deferenced after it's been set to 0. It might be silly/wrong to call these methods after -close, but obviously it shouldn't crash. Made each use of _private->page robust against nil-dereferencing. * WebView/WebView.mm: (-[WebView _loadBackForwardListFromOtherView:]): (-[WebView _updateWebCoreSettingsFromPreferences:]): (-[WebView _setDashboardBehavior:to:]): (-[WebView _dashboardBehavior:]): (-[WebView goBack]): (-[WebView goForward]): (-[WebView goToBackForwardItem:]): (-[WebView canGoBack]): (-[WebView canGoForward]): (-[WebView setTabKeyCyclesThroughElements:]): (-[WebView tabKeyCyclesThroughElements]): (-[WebView setEditable:]): 2007-03-17 Timothy Hatcher <timothy@apple.com> Reviewed by Mark Rowe. Made Version.xcconfig smarter when building for different configurations. Now uses the 522+ OpenSource version for Debug and Release, while using the full 522.4 version for Production builds. The system prefix is also computed based on the current system, so 4522.4 on Tiger and 5522.4 on Leopard. * Configurations/Version.xcconfig: * Configurations/WebKit.xcconfig: 2007-03-16 Oliver Hunt <oliver@apple.com> Reviewed by Hyatt. The old canSaveAsWebArchive call was necessary as stand alone images used to be rendered by ImageDocument. Fixes rdar://problem/5061252 * WebCoreSupport/WebDragClient.h: * WebCoreSupport/WebDragClient.mm: (WebDragClient::declareAndWriteDragImage): * WebKit.xcodeproj/project.pbxproj: 2007-03-15 Brady Eidson <beidson@apple.com> Reviewed by Maciej <rdar://problem/4429701> Implements a port blocking black list that matches Firefox's * English.lproj/Localizable.strings: Added localizable string for port blocked error code * Misc/WebKitErrors.h: * Misc/WebKitErrors.m: (registerErrors): Add new port blocked error code to WebKitErrorDomain * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::cancelledError): Fixed coding style (WebFrameLoaderClient::blockedError): Return a ResourceError with the new custom error code 2007-03-15 Timothy Hatcher <timothy@apple.com> Reviewed by John. * Fixes: <rdar://problem/4927747> WebKit's Current Library Version number should match the Info.plist Version * Factored out most of our common build settings into .xcconfig files. Anything that was common in each build configuration was factored out into the shared .xcconfig file. * Adds a Version.xcconfig file to define the current framework version, to be used in other places. * Use the new $(BUNDLE_VERSION) (defined in Version.xcconfig) in the preprocessed Info.plist. * Use the versions defined in Version.xcconfig to set $(DYLIB_CURRENT_VERSION). * Make WebKit use the same warning flags as the other projects. This required two casts to be added to fix new warnings. * Configurations/Base.xcconfig: Added. * Configurations/DebugRelease.xcconfig: Added. * Configurations/Version.xcconfig: Added. * Configurations/WebKit.xcconfig: Added. * Info.plist: * Misc/WebKitVersionChecks.h: * Plugins/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:]): * WebKit.xcodeproj/project.pbxproj: 2007-03-15 Kevin Decker <kdecker@apple.com> Reviewed by Anders. Fixed: <rdar://problem/5001428> stationery background images do not display Change 19244 fixed the method -[WebResource _shouldIgnoreWhenUnarchiving], but also broke Mail stationery. The problem was that with archivedResourceForURL now fixed, the engine will try to decode the images. These images wouldn't decode because Mail re-encodes and directly manipulates the image data in such a way that prevented WebKit from decoding the image. Because Mail was giving us bad data, the images wouldn't render. This was never an issue before because archivedResourceForURL (broken) always returned nil, thus the engine would never attempt to decode the resource, therefore the responsibility was delegated to Mail's protocol handler, which would do the right thing and load the image. Since Mail is relying on the fact it can store arbitrary data in WebArchives, I've introduced SPI that acts as a hint for us to ignore certain subresources while unarchiving. This SPI is -[WebResource _shouldIgnoreWhenUnarchiving]. * WebView/WebResource.mm: Addd private ivar shouldIgnoreWhenUnarchiving. (-[WebResource _ignoreWhenUnarchiving]): Added. (-[WebResource _shouldIgnoreWhenUnarchiving]): Added. * WebView/WebResourcePrivate.h: Added two methods to private header. * WebView/WebUnarchivingState.m: (-[WebUnarchivingState archivedResourceForURL:]): Check if we should ignore the resource. 2007-03-15 Mark Rowe <mrowe@apple.com> Reviewed by Antti. Fix for <rdar://problem/5065060> ASSERTION FAILURE: newUsername && newPassword when submitting an authentication form without password. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchWillSubmitForm): Don't omit form fields with empty values from the dictionary passed to the delegate. 2007-03-14 Anders Carlsson <acarlsson@apple.com> Reviewed by Dave Hyatt. Don't add the data twice, it's also done by didReceiveData. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::deliverArchivedResources): 2007-03-14 Anders Carlsson <acarlsson@apple.com> Fix segmentation fault when running layout tests. Remove bogus check that that I added on purpose to see how good Geoff is at spotting mistakes when reviewing code. (Turns out he's not that good!) * WebView/WebDocumentLoaderMac.mm: (WebDocumentLoaderMac::increaseLoadCount): 2007-03-14 Anders Carlsson <acarlsson@apple.com> Reviewed by Geoff. http://bugs.webkit.org/show_bug.cgi?id=13076 REGRESSION: Multiple loading tabs cause assertion in WebDocumentLoaderMac::decreaseLoadCount(unsigned long) Store the identifier set in the document loader since identifiers are per-webview and not global. * WebView/WebDocumentLoaderMac.h: * WebView/WebDocumentLoaderMac.mm: (WebDocumentLoaderMac::WebDocumentLoaderMac): (WebDocumentLoaderMac::attachToFrame): (WebDocumentLoaderMac::increaseLoadCount): (WebDocumentLoaderMac::decreaseLoadCount): 2007-03-14 David Harrison <harrison@apple.com> Reviewed by Maciej. <rdar://problem/5009625> REGRESSION: Aperture 1.5: Can't select entire line of text after correcting a misspelled word * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::respondToChangedSelection): * WebCoreSupport/WebFrameBridge.mm: Provide compatibility by not sending WebViewDidChangeSelectionNotification if the app is Aperture and is linked against WebKit 2.0. === Safari-5522.4 === 2007-03-14 Anders Carlsson <acarlsson@apple.com> Reviewed by Geoff. <rdar://problem/5058714> http://bugs.webkit.org/show_bug.cgi?id=13050 World leaks seen on Leopard after opening then closing tab (13050) Add a hash set to prevent the load count to be increased twice for the same resource. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchWillSendRequest): (WebFrameLoaderClient::dispatchDidFinishLoading): (WebFrameLoaderClient::dispatchDidFailLoading): * WebView/WebDocumentLoaderMac.h: * WebView/WebDocumentLoaderMac.mm: (loadingResources): (WebDocumentLoaderMac::increaseLoadCount): (WebDocumentLoaderMac::decreaseLoadCount): 2007-03-14 Adele Peterson <adele@apple.com> Reviewed by Darin. Removed _insertTextWithEvent, _insertNewlineWithEvent, and _insertTextWithEvent. Instead, use execCommand and insertText methods on the Editor. * WebView/WebHTMLView.mm: (-[WebHTMLView insertTab:]): (-[WebHTMLView insertBacktab:]): (-[WebHTMLView insertNewline:]): (-[WebHTMLView insertLineBreak:]): (-[WebHTMLView insertParagraphSeparator:]): (-[WebHTMLView insertNewlineIgnoringFieldEditor:]): (-[WebHTMLView insertTabIgnoringFieldEditor:]): (-[WebHTMLView yank:]): (-[WebHTMLView yankAndSelect:]): (-[WebHTMLView doCommandBySelector:]): (-[WebHTMLView insertText:]): 2007-03-14 David Hyatt <hyatt@apple.com> Fixes to ensure that the resource loader's shared buffer can always be used. Reviewed by olliej, mjs * Misc/WebIconDatabase.mm: (-[WebIconDatabase _convertToWebCoreFormat]): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::deliverArchivedResources): 2007-03-13 Oliver Hunt <oliver@apple.com> Reviewed by Brady. Modify subresourceForURL to take NSString argument so we can avoid [NSURL absoluteString] * WebView/WebDataSource.mm: (-[WebDataSource subresourceForURL:]): 2007-03-13 Brady Eidson <beidson@apple.com> Rubberstamped by Alice Meant to be part of my previous checkin... pruning unused code from WebKit * WebView/WebFrame.mm: Removed _canCachePage * WebView/WebFrameInternal.h: Ditto 2007-03-13 Beth Dakin <bdakin@apple.com> Reviewed by Maciej. Fix for <rdar://problem/4277074> 8F32: Help Viewer crashed on clicking link - KHTMLView::viewportMouseReleaseEvent (12647) Re-set the DocumentLoader's frame when loading it from the page cache before setting the document view. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::setDocumentViewFromPageCache): 2007-03-13 Timothy Hatcher <timothy@apple.com> Reviewed by Geoff. <rdar://problem/5057117> Spoof user agent on Yahoo.com with Safari and WebKit as version 4xx * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView userAgent]): Stop using the deprecated lossyCString method. * WebCoreSupport/WebFrameBridge.mm: Removed dead code, userAgentForURL: wasn't used. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::userAgent): Call WebView's _userAgentForURL:. * WebView/WebView.mm: (-[WebView _cachedResponseForURL:]): Call userAgentForURL: instead of _userAgent. (-[WebView userAgentForURL:]): Call _userAgentForURL:. (-[WebView _userAgentWithApplicationName:andWebKitVersion:]): New method to construct a UA. (-[WebView _computeUserAgent]): Ractored out into _userAgentWithApplicationName:andWebKitVersion: (-[WebView _userAgentForURL:]): Tail compare for Yahoo.com, and return a UA with an older WebKit version. * WebView/WebViewInternal.h: Declare _userAgentForURL:. 2007-03-12 David Harrison <harrison@apple.com> Reviewed by Darin. <rdar://problem/4743256> ctrl-y key binding (yank) should do nothing when kill ring is empty Test updated: * editing/pasteboard/emacs-cntl-y-001.html: * WebView/WebHTMLView.mm: (-[WebHTMLView yank:]): (-[WebHTMLView yankAndSelect:]): Do nothing if the killring is empty. 2007-03-12 Darin Adler <darin@apple.com> Reviewed by Tim Hatcher. - update for the new naming scheme for the Objective-C wrapper-creation functions: _wrapElement: instead of _elementWith:, etc. * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::textFieldDidBeginEditing): (WebEditorClient::textFieldDidEndEditing): (WebEditorClient::textDidChangeInTextField): (WebEditorClient::doTextFieldCommandFromEvent): (WebEditorClient::textWillBeDeletedInTextField): (WebEditorClient::textDidChangeInTextArea): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createPlugin): (WebFrameLoaderClient::createJavaAppletWidget): * WebView/WebFrame.mm: (kit): Use the _wrapElement-style functions. 2007-03-12 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. <rdar://problem/5057575> REGRESSION: Repro Crash in FrameLoader::frame loading about:blank in PLT Always get the web view from the current web frame, since the document loader's frame can have been zeroed out (for example when detaching the document loader). * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache): (WebFrameLoaderClient::assignIdentifierToInitialRequest): (WebFrameLoaderClient::dispatchWillSendRequest): (WebFrameLoaderClient::dispatchDidReceiveResponse): (WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebFrameLoaderClient::dispatchDidFinishLoading): 2007-03-11 Oliver Hunt <oliver@apple.com> Reviewed by Adele. Moved respondToChangedSelection from FrameBridge to EditorClient * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::respondToChangedSelection): * WebCoreSupport/WebFrameBridge.mm: Removed respondToChangedSelection from bridge 2007-03-11 Darin Adler <darin@apple.com> Reviewed by Adele. - fix http://bugs.webkit.org/show_bug.cgi?id=12964 <rdar://problem/5045717> REGRESSION: crash in -[WebBaseNetscapePluginStream _deliverData] at simpsonsmovie.com (12964) * Plugins/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:]): At every place we call the plug-in, since it could destroy the stream, get pluginView into a local variable; it will be set to nil if the stream is destroyed. (-[WebBaseNetscapePluginStream _destroyStream]): Added calls to retain/release to handle the case where one of the calls to the plug-in destroys the stream. Added a call to cancelPreviousPerformRequestsWithTarget in case _deliverData has been scheduled but not yet delivered. Also get pluginView into a local variable as mentioned above, and check at strategic points and exit if the stream was already destroyed to avoid multiple calls to NPP_DestroyStream or NPP_URLNotify. (-[WebBaseNetscapePluginStream _deliverData]): Ditto. 2007-03-10 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler. Fixed <rdar://problem/4587763> PAC file: lock inversion between QT and JSCore causes a hang @ www.panoramas.dk See JavaScriptCore ChangeLog for details. Drop the JSLock before making calls through the plug-in API from functions that may have been called by JavaScript. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView sendEvent:]): (-[WebBaseNetscapePluginView setWindowIfNecessary]): (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): (-[WebBaseNetscapePluginView createPluginScriptableObject]): (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]): (-[WebBaseNetscapePluginView loadPluginRequest:]): (-[WebBaseNetscapePluginView _printedPluginBitmap]): * Plugins/WebPluginController.mm: (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]): (-[WebPluginController startAllPlugins]): (-[WebPluginController stopAllPlugins]): (-[WebPluginController addPlugin:]): (-[WebPluginController destroyPlugin:]): (-[WebPluginController destroyAllPlugins]): 2007-03-10 David Kilzer <ddkilzer@webkit.org> Reviewed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=9609 REGRESSION: Missing image icon needs to be moved back to WebKit * WebView/WebHTMLView.mm: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): Use WebCore::Image::loadPlatformResource(const char*) to load the missingImage image. 2007-03-10 Mark Rowe <mrowe@apple.com> Reviewed by John. <rdar://problem/5051827> HIWebView handling of kEventControlGetData is broken in 64-bit On Leopard the kEventParamControlDataBufferSize event parameter is of type typeByteCount. The 32-bit implementation of GetEventParameter will coerce between integer types and typeByteCount while the 64-bit version will return a failure. As typeByteCount is new in Leopard we must continue using typeSInt32 when building for Tiger. * Carbon/HIWebView.m: (HIWebViewEventHandler): 2007-03-09 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/4976254> Please get off _NSSoftLinkingGetFrameworkFuncPtr Use dlopen and dlsym to access the DCSShowDictionaryServiceWindow function. * WebView/WebHTMLView.mm: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): 2007-03-09 Darin Adler <darin@apple.com> Reviewed by Justin. - fix http://bugs.webkit.org/show_bug.cgi?id=8928 <rdar://problem/5045708> REPRODUCIBLE ASSERT: Cannot paste HTML into a contenteditable region in an XHTML document (8928) * WebView/WebHTMLView.mm: (-[WebHTMLView _hasHTMLDocument]): Added. (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]): Don't call AppKit's conversion from the DOM to an attributed string if the document is not an HTML document, to work around an AppKit limitation (Radar 5052390). 2007-03-09 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2007-03-08 Mark Rowe <mrowe@apple.com> Reviewed by Tim Hatcher. <rdar://problem/5051616> Mouse clicks and movement are ignored in HIWebView on 64-bit Mouse events are not being handled correctly as GetControlKind is returning an error on 64-bit. The more modern HIObjectIsOfClass behaves correctly for this use. * Carbon/HIWebView.m: (HIWebViewDestructor): (WindowHandler): Use HIObjectIsOfClass in place of GetControlKind. (HIWebViewEventHandler): Don't leak the NSEvent. 2007-03-08 Bruce Q Hammond <bruceq@apple.com> Reviewed by Darin. Fix for http://bugs.webkit.org/show_bug.cgi?id=13009 Console spews "CGContextGetType: invalid context" non-stop on web site * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebBaseNetscapePluginView restorePortState:]): 2007-03-08 Mark Rowe <mrowe@apple.com> Reviewed by Tim Hatcher. <rdar://problem/4561772> HIWebView does not exist for 64-bit Update HIWebView and friends to work without QuickDraw. Changes are gleaned from the 64-bit support inside HICocoaView. The main fact of interest are that all Carbon windows must have compositing enabled so the code paths that aren't accessible are #ifdef'd out. Conveniently these are the exact code paths that make use of QuickDraw. There are currently minor event-handling and invalidation issues running as 64-bit that are not present in 32-bit. * Carbon/CarbonUtils.m: * Carbon/CarbonWindowAdapter.m: * Carbon/CarbonWindowFrame.m: * Carbon/HIViewAdapter.m: (SetViewNeedsDisplay): * Carbon/HIWebView.m: (Draw): (Click): (SyncFrame): (StartUpdateObserver): (StopUpdateObserver): (UpdateObserver): * WebKit.LP64.exp: Removed. * WebKit.xcodeproj/project.pbxproj: Always use WebKit.exp. 2007-03-08 Timothy Hatcher <timothy@apple.com> Reviewed by John. <rdar://problem/4664697> highlighter SPI needs a node parameter to give more context Added new methods to the WebHTMLHighlighter protocol that include the DOMNode being painted. * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge customHighlightRect:forLine:representedNode:WebCore::]): (-[WebFrameBridge paintCustomHighlight:forBox:onLine:behindText:entireLine:representedNode:WebCore::]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLViewPrivate.h: 2007-03-08 Anders Carlsson <acarlsson@apple.com> Try fixing the buildbot build. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): 2007-03-07 Anders Carlsson <acarlsson@apple.com> Leopard build fix. * Plugins/WebBaseNetscapePluginView.mm: 2007-03-07 Bruce Q Hammond <bruceq@apple.com> Reviewed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=12515 Plug-ins that draw through the Quickdraw interface fail in a CGBitmapContex. <rdar://problem/4975122> This fixes a problem with Netscape-style Plug-ins which draw through the Quickdraw APIs being unable to render into offscreen bitmap contexts. This patches both saveAndSetNewPortStateForUpdate: and restorePortState: These methods now check the current context and see if appropriate setup/cleanup needs to be done for offscreen rendering. * Plugins/WebBaseNetscapePluginView.mm: (QDPixelFormatFromCGBitmapInfo): (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebBaseNetscapePluginView restorePortState:]): 2007-03-07 Anders Carlsson <acarlsson@apple.com> Reviewed by Darin. Use HardRetain/HardRelease. * WebView/WebDocumentLoaderMac.mm: (WebDocumentLoaderMac::setDataSource): (WebDocumentLoaderMac::attachToFrame): (WebDocumentLoaderMac::detachFromFrame): (WebDocumentLoaderMac::increaseLoadCount): (WebDocumentLoaderMac::decreaseLoadCount): 2007-03-07 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. <rdar://problem/4961259> REGRESSION: Bumper Car 2.1.1 - Crash at WebCore::FrameLoader::receivedMainResourceError when encountering a invalid URL address (The crash was already fixed, this actually makes Bumper Car load the error page correctly.) This adds a "load counter" to the document loader and keeps the data source retained for as long as something is loading. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchWillSendRequest): Increase the load counter. (WebFrameLoaderClient::dispatchDidFinishLoading): (WebFrameLoaderClient::dispatchDidFailLoading): Decrease the load counter, * WebView/WebDocumentLoaderMac.h: * WebView/WebDocumentLoaderMac.mm: (WebDocumentLoaderMac::WebDocumentLoaderMac): (WebDocumentLoaderMac::attachToFrame): If the document loader has been detached, make sure to retain its data source here. (WebDocumentLoaderMac::detachFromFrame): Release the data source. (WebDocumentLoaderMac::increaseLoadCount): Retain the data source if load count was 0. (WebDocumentLoaderMac::decreaseLoadCount): Release the data source if load count becomes 0 2007-03-07 Adele Peterson <adele@apple.com> Reviewed by Darin. WebKit part of fix for: http://bugs.webkit.org/show_bug.cgi?id=10871 http://bugs.webkit.org/show_bug.cgi?id=12677 <rdar://problem/4823129> REGRESSION: IME key events different in nightly <rdar://problem/4759563> REGRESSION: Return key is always sent when you confirm a clause in kotoeri * WebView/WebHTMLView.mm: (-[WebHTMLView _interceptEditingKeyEvent: shouldSaveCommand:]): Added shouldSaveCommand field to WebHTMLViewInterpretKeyEventsParameters. When shouldSaveCommand is true, we call interpretKeyEvents and in doCommandBySelector and insertText, we just save the information without performing any action. When shouldSaveCommand is false, we used the saved information and call doCommandBySelector and insertText directly. If there's no saved command data in the KeyboardEvent, call interpretKeyEvents, and honor the shouldSaveCommand argument. This allows repeating keypress events to function normally. (-[WebHTMLView doCommandBySelector:]): If the WebHTMLViewInterpretKeyEventsParameters shouldSaveCommand field is set, then just save the selector information in the KeyboardEvent, and don't perform the action. (-[WebHTMLView insertText:]): ditto. insertText can be called from an input method or from normal key event processing If its from an input method, then we should go ahead and insert the text now. The only way we know if its from an input method is to check hasMarkedText. There might be a better way to do this. * WebView/WebHTMLViewInternal.h: Added shouldSaveCommand argument. * WebView/WebViewInternal.h: ditto. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::handleKeypress): Changed handleKeyPress to handleKeypress. Call _interceptEditingKeyEvent with shouldSaveCommand:NO. (WebEditorClient::handleInputMethodKeypress): Call _interceptEditingKeyEvent with shouldSaveCommand:YES. 2007-03-07 Anders Carlsson <acarlsson@apple.com> Reviewed by Brady. Update to match WebCore. * Plugins/WebNetscapePluginStream.mm: (-[WebNetscapePluginStream start]): 2007-03-07 Jim Correia <jim.correia@pobox.com> Reviewed by Darin. - WebCore part of fix for http://bugs.webkit.org/show_bug.cgi?id=12463 WebArchiver - attempt to insert nil exception when archive empty iframe When dealing with an iframe element with no src attribute, the element contains a src attribute in the DOM with a URL of "about:blank" and some HTML to implement the blank page. In the original page source, however, the iframe element does not include a src attribute, which caused a nil archive to be returned for the childFrameArchive and thus caused the bug. The fix is a simple nil check. Test: webarchive/archive-empty-frame-source.html * WebView/WebArchiver.mm: (+ (NSArray *)_subframeArchivesForFrame:(WebFrame *)frame): Don't add childFrameArchive to the subframeArchives array if it is nil. 2007-03-06 John Sullivan <sullivan@apple.com> Reviewed by Darin Made WebAuthenticationHandler.h SPI so Safari can call it directly. * WebKit.exp: added .objc_class_name_WebPanelAuthenticationHandler * WebKit.xcodeproj/project.pbxproj: changed status of WebAuthenticationHandler.h from "project" to "private" 2007-03-06 Kevin McCullough <kmccullough@apple.com> Reviewed by Darin. - Rename a function to clarify its purpose. * WebView/WebView.mm: (+[WebView registerURLSchemeAsLocal:]): * WebView/WebViewPrivate.h: 2007-03-06 Anders Carlsson <acarlsson@apple.com> Reviewed by Adam. Update for WebCore changes. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::userAgent): 2007-03-05 Anders Carlsson <acarlsson@apple.com> Reviewed by Adam, Darin. <rdar://problem/5025212> In Mail, a crash occurs at WebCore::Frame::tree() when clicking on embedded flash object * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView loadPluginRequest:]): Handle the case where the web view returned from the delegate method is null. Also, send out an error notification in that case so we can catch it. 2007-03-05 John Sullivan <sullivan@apple.com> Reviewed by Darin and Kevin D - fixed <rdar://problem/5038087> Header and footer on printed page are too large after certain steps * WebView/WebView.mm: (-[WebView _adjustPrintingMarginsForHeaderAndFooter]): This method was modifying the margins in the NSPrintInfo object without any sort of check whether this had already been done. In some cases this can be called multiple times with the same NSPrintInfo, so now we stash information in the NSPrintInfo's dictionary such that we always start with a fresh copy of the original margins. 2007-03-02 Kevin McCullough <kmccullough@apple.com> Reviewed by Geoff. - rdar://problem/4922454 - This fixes a security issue by making remote referrers not able to access local resources, unless they register their schemes to be treated as local. The result is that those schemes can access local resources and cannot be accessed by remote referrers. Because this behavior is new a link-on-or-after check is made to determine if the app should use the older, less safe, behavior. * Misc/WebKitVersionChecks.h: added linked-on-or-after check * Misc/WebNSAttributedStringExtras.mm: Moved functionalit into the base class. (fileWrapperForElement): * Plugins/WebNetscapePluginStream.mm: uses new canLoad functions * Plugins/WebPluginContainerCheck.mm: uses new canLoad functions (-[WebPluginContainerCheck _isForbiddenFileLoad]): * WebView/WebView.mm: make linked-on-or-after check and cache value, exposes SPI for registering a scheme as local. (-[WebView _commonInitializationWithFrameName:groupName:]): (+[WebView registerSchemeAsLocal:]): * WebView/WebViewPrivate.h: exposes SPI for registering a scheme as local. 2007-03-01 Justin Garcia <justin.garcia@apple.com> Reviewed by harrison <rdar://problem/4838199> Integrate Mail and WebKit paste operations Provide subresources used to create the fragment as a convenience. * WebView/WebHTMLView.mm: (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]): Update the calls to the changed method. (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]): Give the caller the subresources in the WebArchive and RTF cases. * WebView/WebHTMLViewPrivate.h: 2007-02-28 Oliver Hunt <oliver@apple.com> Reviewed by Maciej. Fixes <rdar://problem/5012009> When looking for a requested resource we should also check the set of manually added subresources if WebCore can't find it. * WebView/WebDataSource.mm: (-[WebDataSource subresourceForURL:]): 2007-02-28 Brady Eidson <beidson@apple.com> Reviewed by Beth Start using the Thread Safety Check implemented in WebCore for the DOM bindings in the rest of the WebKit API instead of the ASSERT_MAIN_THREAD() hack * History/WebBackForwardList.mm: (-[WebBackForwardList initWithWebCoreBackForwardList:]): (-[WebBackForwardList init]): (-[WebBackForwardList dealloc]): (-[WebBackForwardList finalize]): * History/WebHistoryItem.mm: (-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]): (-[WebHistoryItem dealloc]): (-[WebHistoryItem finalize]): (-[WebHistoryItem copyWithZone:]): (-[WebHistoryItem initWithWebCoreHistoryItem:]): * Misc/WebIconDatabase.mm: (-[WebIconDatabase init]): 2007-02-28 Adele Peterson <adele@apple.com> Reviewed by Beth. Fix for <rdar://problem/4887423> REGRESSION: search results popup menu strings are not localized and <rdar://problem/3517227> accessibility-related strings in WebCore are not localized * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory searchMenuNoRecentSearchesText]): (-[WebViewFactory searchMenuRecentSearchesText]): (-[WebViewFactory searchMenuClearRecentSearchesText]): (-[WebViewFactory AXWebAreaText]): (-[WebViewFactory AXLinkText]): (-[WebViewFactory AXListMarkerText]): (-[WebViewFactory AXImageMapText]): (-[WebViewFactory AXHeadingText]): 2007-02-28 Mark Rowe <mrowe@apple.com> Reviewed by Maciej. <rdar://problem/5028473> WebKit allocates a huge number of NSCalendarDates while loading history file * History/WebHistory.mm: (-[WebHistoryPrivate insertItem:atDateIndex:]): Use lastVisitedTimeInterval rather than _lastVisitedDate to avoid allocating NSCalendarDates. 2007-02-28 Mark Rowe <mrowe@apple.com> Reviewed by Tim Hatcher. <rdar://problem/4985524> Problem with Blot and ToT WebKit (decoding WebCoreScrollView) References to WebCoreScrollView as a subview of a WebHTMLView may be present in some NIB files, so NSUnarchiver must be still able to look up the WebCoreScrollView class. * WebKit.exp: Export WebCoreScrollView symbol. * WebView/WebHTMLView.mm: Add empty WebCoreScrollView class. 2007-02-27 Adam Roben <aroben@apple.com> Reviewed by Beth. Fix <rdar://problem/5011905> REGRESSION: "Open Link" contextual menu item appears twice * WebCoreSupport/WebContextMenuClient.mm: (fixMenusToSendToOldClients): Remove the "Open Link" item from the default menu items array before sending it off to Tiger Mail. (WebContextMenuClient::getCustomMenuFromDefaultItems): Set the representedObject on every NSMenuItem to match our old (correct) API behavior. 2007-02-27 Mitz Pettel <mitz@webkit.org> Reviewed by Darin. - http://bugs.webkit.org/show_bug.cgi?id=12906 REGRESSION: Canvas is pixelated when the page is opened in a background tab * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::scaleFactor): If the view is not in a window, use the main screen's scale factor as a best guess. 2007-02-26 John Sullivan <sullivan@apple.com> Reviewed by Darin and Geoff * WebView/WebHTMLView.mm: (coreGraphicsScreenPointForAppKitScreenPoint): This method was copied from WebBrowser, and it was wrong. Fixed it. This only affects the Dictionary pop-up panel. 2007-02-26 David Hyatt <hyatt@apple.com> Update web inspector to account for border-fit. Reviewed by darin * WebInspector/webInspector/inspector.js: 2007-02-26 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler. Re-arranged things to put deprecated methods at the bottom. * Misc/WebCoreStatistics.h: * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptNoGCAllowedObjectsCount]): (+[WebCoreStatistics javaScriptReferencedObjectsCount]): (+[WebCoreStatistics javaScriptRootObjectClasses]): * WebKit.xcodeproj/project.pbxproj: 2007-02-26 Maciej Stachowiak <mjs@apple.com> Rubber stamped by Mitz. - fix layout tests by fixing discrepancy in feature macros. * WebInspector/WebInspector.m: (-[WebInspector _highlightNode:]): * WebKit.xcodeproj/project.pbxproj: 2007-02-23 Mitz Pettel <mitz@webkit.org> Reviewed by Maciej. - fix http://bugs.webkit.org/show_bug.cgi?id=11573 REGRESSION: pressing option-left arrow while in suggestion popup moves the insertion point to the left * WebView/WebHTMLView.mm: (-[WebTextCompleteController endRevertingChange:moveLeft:]): 2007-02-23 Timothy Hatcher <timothy@apple.com> Reviewed by Brady. <rdar://problem/5016395> _recursive_pauseNullEventsForAllNetscapePlugins still gone * WebView/WebFrameInternal.h: Remove _recursive_pauseNullEventsForAllNetscapePlugins * WebView/WebFramePrivate.h: Add _recursive_pauseNullEventsForAllNetscapePlugins * WebView/WebFrame.mm: More _recursive_pauseNullEventsForAllNetscapePlugins 2007-02-22 Adele Peterson <adele@apple.com> Reviewed by John. Updating this image to match the one in WebCore. * WebKit.vcproj/textAreaResizeCorner.png: 2007-02-22 Beth Dakin <bdakin@apple.com> Reviewed by Adam. Fix for http://bugs.webkit.org/show_bug.cgi?id=12399 REGRESSION: Unable to prevent default context menu from appearing. <rdar:// problem/5017416> * WebView/WebHTMLView.mm: (-[WebHTMLView menuForEvent:]): Clear the controller's context menu before propagating a new context menu event through the DOM. 2007-02-22 John Sullivan <sullivan@apple.com> Reviewed by Darin Removed some unused keyView-related code that I happened to run across. Replacement code is now in WebChromeClient. * WebCoreSupport/WebFrameBridge.h: * WebCoreSupport/WebFrameBridge.mm: removed unused stuff 2007-02-22 Mitz Pettel <mitz@webkit.org> Reviewed by Maciej. - fix http://bugs.webkit.org/show_bug.cgi?id=12804 REGRESSION (r19043-r19063): suggestion popup doesn't work after pressing Option+Esc This patch also fixes a bug where using the arrow keys while the suggestion popup is open moves the caret instead of changing the selection in the popup (for up/down) or accepting the selection and closing the popup (for left/right). * WebView/WebHTMLView.mm: (-[WebHTMLView keyDown:]): Changed to close the popup only if it was open before the current event, so that the Option-Esc that opens the popup will not close it immediately. (-[WebHTMLView _interceptEditingKeyEvent:]): Give the completion popup a chance to intercept keydown events. (-[WebTextCompleteController popupWindowIsOpen]): Added. Returns whether the suggestion popup is open. 2007-02-22 Mitz Pettel <mitz@webkit.org> Reviewed by Mark (age 21). - fix http://bugs.webkit.org/show_bug.cgi?id=12805 REGRESSION: suggestion popup has a disabled scroll bar * WebView/WebHTMLView.mm: (-[WebTextCompleteController _buildUI]): Uncommented the call to the NSWindow SPI that forces the scroll bar to look active. Also replaced a call to the deprecated NSTableView method setAutoresizesAllColumnsToFit: with the new method setColumnAutoresizingStyle: to eliminate console spew. 2007-02-20 Beth Dakin <bdakin@apple.com> Reviewed by Maciej. WebKit changes needed to implement writeImage() in WebCore's Pasteboard class. * Misc/WebKitNSStringExtras.m: Call into WebCore for these implementations. (-[NSString _webkit_hasCaseInsensitiveSuffix:]): (-[NSString _webkit_hasCaseInsensitiveSubstring:]): (-[NSString _webkit_filenameByFixingIllegalCharacters]): * Misc/WebNSURLExtras.m: Same. (-[NSURL _webkit_suggestedFilenameWithMIMEType:]): * WebCoreSupport/WebContextMenuClient.h: Remove copyImageToClipboard() * WebCoreSupport/WebContextMenuClient.mm: * WebCoreSupport/WebSystemInterface.m: Expose GetExtensionsForMIMEType and GetPreferredExtensionForMIMEType to WebCore. (InitWebCoreSystemInterface): * WebCoreSupport/WebViewFactory.mm: New localized string for WebCore. (-[WebViewFactory copyImageUnknownFileLabel]): 2007-02-20 Adam Roben <aroben@apple.com> Reviewed by Darin and Anders. Update WebKit for WebCore fix for <rdar://problem/4736215> Make WebCoreStringTruncator use WebCore types. * Misc/WebStringTruncator.m: (defaultMenuFont): Moved from WebCoreStringTruncator.mm. (core): Added. (+[WebStringTruncator centerTruncateString:toWidth:]): (+[WebStringTruncator centerTruncateString:toWidth:withFont:]): (+[WebStringTruncator rightTruncateString:toWidth:withFont:]): (+[WebStringTruncator widthOfString:font:]): * WebKit.xcodeproj/project.pbxproj: Changed WebStringTruncator to ObjC++. 2007-02-20 Timothy Hatcher <timothy@apple.com> Reviewed by John. Fixes the version number returned when using a CFBundleVersion of "420+". * WebView/WebView.mm: (-[WebView _userVisibleBundleVersionFromFullVersion:]): Check the length up to the first non-decimal digit, so this works with versions that have "." and "+". 2007-02-20 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker - fixed <rdar://problem/4989344> REGRESSION: After clicking on page, Find won't find anything if all hits are before the clicked point This was caused by a mismatch between WebCore's search code's notion of "selection" and WebView's search code's notion of "selection". WebCore's search code was starting just before or just after the "selection", which included collapsed, zero-length selections. WebKit's search code was only considering non-zero-length selections, and would not search all of the content when there was a zero-length selection. The fix was to make WebKit ignore the selection. This has a side effect of increasing the amount of redundantly-searched content in the case where no matches are found. To compensate for that, I special-cased the most common case of WebViews with a single frame, to avoid ever searching redundantly in those. * WebView/WebView.mm: (-[WebView searchFor:direction:caseSensitive:wrap:startInSelection:]): remove startHasSelection ivar; special-case WebViews with only one frame; clarify the code that leads to redundant searching with comments. 2007-02-20 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/4900579> WebKit -finalize methods are not thread-safe; design change needed Call WebCoreObjCFinalizeOnMainThread from the initialize method of all the classes that have a finalizer that needs called on the main thread. Assert in finalize that we are on the main thread. * Carbon/CarbonWindowAdapter.m: (+[CarbonWindowAdapter initialize]): (-[CarbonWindowAdapter finalize]): * History/WebBackForwardList.mm: (+[WebBackForwardList initialize]): (-[WebBackForwardList finalize]): * History/WebHistoryItem.mm: (+[WebHistoryItem initialize]): * Misc/WebElementDictionary.mm: (+[WebElementDictionary initialize]): (-[WebElementDictionary finalize]): * Plugins/WebBaseNetscapePluginStream.m: (+[WebBaseNetscapePluginStream initialize]): (-[WebBaseNetscapePluginStream finalize]): * Plugins/WebBaseNetscapePluginView.mm: (+[WebBaseNetscapePluginView initialize]): (-[WebBaseNetscapePluginView finalize]): * Plugins/WebBasePluginPackage.m: (+[WebBasePluginPackage initialize]): (-[WebBasePluginPackage finalize]): * Plugins/WebNetscapePluginStream.mm: (-[WebNetscapePluginStream finalize]): * WebCoreSupport/WebEditorClient.mm: (+[WebEditCommand initialize]): (-[WebEditCommand finalize]): * WebCoreSupport/WebFrameBridge.mm: (+[WebFrameBridge initialize]): (-[WebFrameBridge finalize]): * WebCoreSupport/WebFrameLoaderClient.mm: (+[WebFramePolicyListener initialize]): (-[WebFramePolicyListener finalize]): * WebView/WebHTMLView.mm: (+[WebHTMLView initialize]): (-[WebHTMLView finalize]): * WebView/WebView.mm: (+[WebViewPrivate initialize]): (-[WebViewPrivate finalize]): 2007-02-20 Justin Garcia <justin.garcia@apple.com> Reviewed by darin <rdar://problem/4838199> Integrate Mail and WebKit paste operations Mail overrides paste: because it has different preferred pasteboard types, but it should use our fragment creation code. * WebView/WebHTMLView.mm: (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]): Moved fragment creation code into a new method. (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:]): Moved fragment creation code here. * WebView/WebHTMLViewPrivate.h: Exposed _documentFragmentFromPasteboard:forType:inContext: as SPI. 2007-02-20 John Sullivan <sullivan@apple.com> Reviewed by Tim Hatcher * Misc/WebKitNSStringExtras.h: * Misc/WebKitNSStringExtras.m: removed _webkit_userVisibleBundleVersionFromFullVersion; we decided to do this without adding SPI for it. * WebView/WebView.mm: (-[WebView _userVisibleBundleVersionFromFullVersion:]): new method, moved here from WebKitNSStringExtras, and is now a WebView method rather than an NSString method (-[WebView _computeUserAgent]): updated for method signature change 2007-02-20 Timothy Hatcher <timothy@apple.com> Reviewed by John. * Misc/WebKitNSStringExtras.h: Added _webkit_userVisibleBundleVersionFromFullVersion. * Misc/WebKitNSStringExtras.m: (-[NSString _webkit_userVisibleBundleVersionFromFullVersion]): If the version is 4 digits long or longer, then the first digit represents the version of the OS. Our user agent string should not include this first digit, so strip it off and report the rest as the version. * WebView/WebView.mm: (-[WebView _computeUserAgent]): Call _webkit_userVisibleBundleVersionFromFullVersion on the CFBundleVersion. 2007-02-20 Darin Adler <darin@apple.com> Reviewed by Anders. * Plugins/WebPluginController.mm: (-[WebPluginController pluginView:receivedResponse:]): Call cancelMainResourceLoad on the document loader instead of the frame loader. 2007-02-20 Anders Carlsson <acarlsson@apple.com> Reviewed by Mitz. <rdar://problem/5009627> REGRESSION: Repro overrelease of WebView in failed load, seen in DumpRenderTree * WebView/WebView.mm: (-[WebView _removeObjectForIdentifier:]): Return early if the identifier can't be found in the map. 2007-02-19 Timothy Hatcher <timothy@apple.com> Reviewed by Darin Adler. <rdar://problem/4841078> Remove the Mail.app editable link clicking behavior workaround when it is no longer needed * WebKit.xcodeproj/project.pbxproj: * WebView/WebView.mm: (-[WebView setPreferences:]): 2007-02-19 Anders Carlsson <acarlsson@apple.com> Reviewed by Adam. <rdar://problem/4868242> http://bugs.webkit.org/show_bug.cgi?id=12670 REGRESSION: Many 3rd Party Apps crash in WebCore::DocumentLoader::frameLoader() (12670) Bring back the semantic we had that a web view should be retained for as long as something is loading. Use the identifier to object hash map for this. * WebView/WebView.mm: (-[WebView _addObject:forIdentifier:]): (-[WebView _removeObjectForIdentifier:]): 2007-02-18 Brady Eidson <beidson@apple.com> Reviewed by Oliver <rdar://problem/4985321> - Can't edit templates for Web Gallery/Web Page Export in Aperture * Misc/WebKitVersionChecks.h: Add a #define for this APERTURE quirk * WebView/WebView.mm: (-[WebView _shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:]): If the current app is Aperture and it was linked against Tiger WebKit, always allow selection change 2007-02-17 Lars Knoll <lars@trolltech.com> Reviewed by Maciej. Additional coding by Maciej, additional review by Oliver. Added implementations for the new callbacks in EditorClient and ChromeClient (basically moved from WebFrameBridge). Cleaned up some code paths that are not called anymore and done fully inside WebCore now. * DefaultDelegates/WebDefaultContextMenuDelegate.mm: * Misc/WebElementDictionary.mm: * Misc/WebNSAttributedStringExtras.mm: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView getVariable:value:]): * Plugins/WebNetscapePluginEmbeddedView.mm: * Plugins/WebNetscapePluginStream.mm: * Plugins/WebPluginContainerCheck.mm: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::shouldInterruptJavaScript): * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::shouldChangeSelectedRange): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge finishInitializingWithPage:frameName:frameView:ownerElement:]): (-[WebFrameBridge fini]): * WebCoreSupport/WebFrameLoaderClient.mm: * WebView/WebArchiver.mm: * WebView/WebFrame.mm: (core): (kit): (-[WebFrame _updateBackground]): * WebView/WebFrameInternal.h: * WebView/WebFrameView.mm: * WebView/WebHTMLRepresentation.mm: * WebView/WebHTMLView.mm: (-[WebHTMLView _updateMouseoverWithEvent:]): (-[WebHTMLView _isEditable]): (-[WebHTMLView validateUserInterfaceItem:]): (-[WebHTMLView maintainsInactiveSelection]): (-[WebHTMLView scrollWheel:]): (-[WebHTMLView acceptsFirstMouse:]): (-[WebHTMLView shouldDelayWindowOrderingForEvent:]): (-[WebHTMLView cut:]): (-[WebHTMLView paste:]): (-[WebHTMLView selectedAttributedString]): * WebView/WebScriptDebugDelegate.mm: * WebView/WebView.mm: (-[WebView _dashboardRegions]): (-[WebView setProhibitsMainFrameScrolling:]): (-[WebView _setInViewSourceMode:]): (-[WebView _inViewSourceMode]): (-[WebView shouldClose]): (-[WebView setEditable:]): 2007-02-18 Oliver Hunt <oliver@apple.com> Reviewed by Adam. Moving the drag initiation logic to WebCore. The redundant code in webkit will be moved out in a later patch. * WebCoreSupport/WebDragClient.h: * WebCoreSupport/WebDragClient.mm: (getTopHTMLView): Helper function (WebDragClient::willPerformDragSourceAction): (WebDragClient::startDrag): (WebDragClient::createDragImageForLink): Implemented new DragClient methods (WebDragClient::declareAndWriteDragImage): Helper function for the Mac to allow new drag and drop code to match behaviour * WebView/WebHTMLView.mm: (-[WebHTMLView _dragImageForURL:withLabel:]): (-[WebHTMLView _dragImageForLinkElement:]): Refactoring old _dragImageForLinkElement function so that the link drag image can be created with just a URL and label, rather than requiring the original element (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): Removed logic that is no longer necessary (-[WebHTMLView _mouseDownEvent]): The WebDragClient may need the original mouseDownEvent of a drag when initiating a drag * WebView/WebHTMLViewInternal.h: Declaring _mouseDownEvent * WebView/WebHTMLViewPrivate.h: Declaring _dragImageForURL 2007-02-16 John Sullivan <sullivan@apple.com> Reviewed by Tim Hatcher - fixed <rdar://problem/4811446> "Check Grammar" checkbox in Spelling+Grammar window doesn't live update with menu change in WebKit * WebView/WebView.mm: (-[WebView setGrammarCheckingEnabled:]): Use sekrit AppKit knowledge to tell NSSpellChecker about the change, since there's no API for this yet. Also restructured a little to avoid extra work when the value hasn't changed. 2007-02-15 Brady Eidson <beidson@apple.com> Reviewed by Adam Save scroll state for back/forward navigation in FrameLoader, not the client * WebCoreSupport/WebFrameLoaderClient.h: Renamed the save/restore methods * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::saveViewStateToItem): Save viewstate only (WebFrameLoaderClient::restoreViewState): Restore viewstate only 2007-02-14 Alexey Proskuryakov <ap@webkit.org> Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=12643 NPN_Status is using latin-1 encoding for the message instead of UTF-8 * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView status:]): Check for possible conversion failure. 2007-02-13 Oliver Hunt <oliver@apple.com> Reviewed by John. Modify entry point ASSERTs for dragging functions to allow for the case where a load has occurred mid-drag. The load may detach the HTMLView from the WebView so it is no longer possible to check _isTopHTMLView. The assertion changes match that of revision 14897 which fixed the more common case ([WebHTMLView draggedImage:endedAt:operation:]) It's also necessary to check for a null Page now prior to accessing the DragController, which is necessary in all of these methods. See rdar://problem/4994870 * WebView/WebHTMLView.mm: (-[WebHTMLView draggingSourceOperationMaskForLocal:]): (-[WebHTMLView draggedImage:movedTo:]): (-[WebHTMLView draggedImage:endedAt:operation:]): (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): 2007-02-13 Alexey Proskuryakov <ap@webkit.org> Reviewed by Maciej. http://bugs.webkit.org/show_bug.cgi?id=12643 NPN_Status is using latin-1 encoding for the message instead of UTF-8 * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView status:]): Use kCFStringEncodingUTF8. 2007-02-13 Mark Rowe <mrowe@apple.com> Reviewed by Timothy Hatcher. Fix http://bugs.webkit.org/show_bug.cgi?id=12745 Bug 12745: REGRESSION: Webkit will not load a plugin that Safari can load (symbol missing _objc_msgSend_fpret) Treat libobjc as a sub-library of WebKit in Debug/Release so that plugins and applications linked against an umbrella framework version of WebKit that expect to find libobjc symbols in WebKit can do so. * WebKit.xcodeproj/project.pbxproj: 2007-02-12 Kevin McCullough <kmccullough@apple.com> Reviewed by . - reverting change to not cause regressions and performance problems. * Misc/WebNSAttributedStringExtras.mm: (fileWrapperForElement): 2007-02-12 Darin Adler <darin@apple.com> Reviewed by Oliver. - fix http://bugs.webkit.org/show_bug.cgi?id=12677 <rdar://problem/4759563> REGRESSION: Return key is always sent when you confirm a clause in kotoeri (12677) - fix http://bugs.webkit.org/show_bug.cgi?id=12596 <rdar://problem/4794346> REGRESSION: Tab key shifts form field focus instead of navigating prediction window (12596) - fix http://bugs.webkit.org/show_bug.cgi?id=10010 <rdar://problem/4822935> REGRESSION: Pressing Return with unconfirmed text in Hangul inserts carriage return (10010) - fix http://bugs.webkit.org/show_bug.cgi?id=12531 <rdar://problem/4975126> REGRESSION: Inline text input types repeated keys in latest nightly (r19336) (12531) - fix http://bugs.webkit.org/show_bug.cgi?id=12539 <rdar://problem/4975130> REGRESSION: Pressing Backspace while in inline input area moves to the previous page in history (12539) * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::markedTextAbandoned): Added. * WebView/WebHTMLView.mm: (-[WebHTMLView menuForEvent:]): Added explicit constructor needed now that the function takes a const&. (-[WebHTMLView becomeFirstResponder]): Removed fake event code, no longer needed since advanceFocus now works fine with 0 for a DOM event. (-[WebHTMLView _expandSelectionToGranularity:]): Changed to use the normal selection controller function instead of selectRange. (-[WebHTMLView insertTab:]): Changed to call bottleneck that receives the DOM event. (-[WebHTMLView insertBacktab:]): Ditto. (-[WebHTMLView insertNewline:]): Ditto. (-[WebHTMLView insertLineBreak:]): Ditto. (-[WebHTMLView insertParagraphSeparator:]): Ditto. (-[WebHTMLView insertNewlineIgnoringFieldEditor:]): Ditto. (-[WebHTMLView insertTabIgnoringFieldEditor:]): Ditto. (-[WebHTMLView yank:]): Updated to call Editor directly since the insertText code now works via a text input event which is not what we want for paste-like things such as yank. (-[WebHTMLView yankAndSelect:]): Ditto. (-[WebHTMLView selectToMark:]): Changed to use the normal selection controller function instead of selectRange, which also allows us to remove the ObjC exception handling code. (-[WebHTMLView swapWithMark:]): Ditto. (-[WebHTMLView transpose:]): Ditto. (-[WebHTMLView unmarkText]): Since this is one of the calls back from the input manager, added code to set the "event was handled" flag. Moved the actual work into the Editor class in WebCore and just call that from here. (-[WebHTMLView _selectRangeInMarkedText:]): Changed to use the normal selection controller function instead of selectRange. (-[WebHTMLView setMarkedText:selectedRange:]): Since this is one of the calls back from the input manager, added code to set the "event was handled" flag. Also changed the ignoreMarkedTextSelectionChange to use the flag over on the WebCore side, since we moved it there and to call selectMarkedText over on the WebCore side too. (-[WebHTMLView doCommandBySelector:]): Added special cases for newline and tab selectors so that the event is passed along. These selectors are special because they are ones that turn into text input events. (-[WebHTMLView _discardMarkedText]): Moved the body of this function into the Editor class in WebCore and just call that from here. (-[WebHTMLView insertText:]): Added code to send a text input event instead of calling the editor to do text insertion. The insertion is then done in the default handler for the text input event. (-[WebHTMLView _insertNewlineWithEvent:isLineBreak:]): Added. Sends a text input event. (-[WebHTMLView _insertTabWithEvent:isBackTab:]): Ditto. (-[WebHTMLView _updateSelectionForInputManager]): Changed to use the ignoreMarkedTextSelectionChange flag in Editor now that the one here is gone. * WebView/WebHTMLViewInternal.h: Remove ignoreMarkedTextSelectionChange field. * WebView/WebView.mm: (-[WebView setSelectedDOMRange:affinity:]): Changed to use the normal selection controller function instead of selectRange. 2007-02-11 Sam Weinig <sam@webkit.org> Reviewed by Mark. Switch the initial value of box-sizing property from "border-box" to "content-box". * WebInspector/webInspector/inspector.js: 2007-02-10 Mitz Pettel <mitz@webkit.org> Reviewed by Maciej. - fix http://bugs.webkit.org/show_bug.cgi?id=11847 REGRESSION (SearchField): Dragging to select in the Web Inspector's search fields drags the inspector window * WebInspector/webInspector/inspector.css: Added the search field to the undraggable dashboard-region. 2007-02-09 Kevin Decker <kdecker@apple.com> Reviewed by Darin & Maciej. Fixed: <rdar://problem/4930688> REGRESSION: missing images when reloading webarchives (11962) * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::canUseArchivedResource): The bug here is that because a reload sets a cache policy of NSURLRequestReloadIgnoringCacheData (rightfully so), this method was refusing to load subresources in WebArchives. It's OK to use archive subresources for the NSURLRequestReloadIgnoringCacheData cache policy because we're not worried about the actual contents of a WebArchive changing on disk. 2007-02-09 Justin Garcia <justin.garcia@apple.com> Reviewed by darin <rdar://problem/4975120> REGRESSION: double-cursor after switching window away/back (11770) <http://bugs.webkit.org/show_bug.cgi?id=11328> Gmail Editor: Caret can simultaneously appear in both the TO: and message body fields * WebCoreSupport/WebFrameBridge.mm: Removed unused methods. * WebView/WebHTMLView.mm: Ditto. (-[WebHTMLView _web_firstResponderCausesFocusDisplay]): Don't appear focused if a descendant view is firstResponder. (-[WebHTMLView _updateActiveState]): Removed the check for a BOOL that was always false. * WebView/WebHTMLViewInternal.h: Removed a BOOL that's always false. 2007-02-09 Beth Dakin <bdakin@apple.com> Reviewed by Darin. Fix for <rdar://problem/4674537> REGRESSION: Adobe Acrobat 8 - Text blinks when mouse is moved, and is invisible otherwise Allow quirk if the Application was linked before 3.0 and if the application is Adobe Acrobat. * Misc/WebKitVersionChecks.h: * WebView/WebView.mm: (-[WebView _updateWebCoreSettingsFromPreferences:]): 2007-02-09 Timothy Hatcher <timothy@apple.com> Reviewed by Brady. * WebKit.exp: Add WebBaseNetscapePluginView to the export list. 2007-02-09 John Sullivan <sullivan@apple.com> Reviewed by Beth - WebKit part of fix for radar 4939636, problems with context menu items and binaries linked against WebKit 2.0. * WebKit.xcodeproj/project.pbxproj: Changed DYLIB_CURRENT_VERSION to 2 (was 1) * Misc/WebKitVersionChecks.h: Added constant WEBKIT_FIRST_VERSION_WITH_3_0_CONTEXT_MENU_TAGS, which is 2 but in the weird format that these version checks use. * WebView/WebUIDelegatePrivate.h: Tweaked comments; included the old values for three tags for context menu items that changed from SPI to API in 3.0; renamed WEBMENUITEMTAG_SPI_START to WEBMENUITEMTAG_WEBKIT_3_0_SPI_START for clarity, and bumped its value to avoid conflict with the three old values * WebCoreSupport/WebContextMenuClient.mm: (isAppleMail): new helper function that checks the bundle identifier (fixMenusToSendToOldClients): Removed return value for clarity; now checks linked-on version and also makes special case for Mail; now replaces three API tags with their old SPI values for clients that linked against old WebKit version, in addition to replacing new API with WebMenuItemTagOther for items that had no specific tag before. (fixMenusReceivedFromOldClients): Removed return value for clarity; removed defaultMenuItems parameter because it's no longer necessary; removed code that tried to recognize menus that got confused by the SPI -> API change (we now pass the old SPI values to these clients to avoid confusing them); now restores the tags for the items whose tags were replaced in fixMenusToSendToOldClients (this used to restore the tags of the default items rather than the new items, which was incorrect but happened to work since the clients we tested were using the objects from the default items array in their new items array) (WebContextMenuClient::getCustomMenuFromDefaultItems): Updated to account for the removed return values for the two fix-up methods; moved the autorelease of newItems here, which is clearer and was the source of a leak before. 2007-02-08 Kevin McCullough <KMcCullough@apple.com> Reviewed by - fixing a build breakage. * Misc/WebNSAttributedStringExtras.mm: (fileWrapperForElement): 2007-02-07 Charles Ying <charles_ying@yahoo.com> Reviewed by Adam. Code suggestion by aroben Fix http://bugs.webkit.org/show_bug.cgi?id=12688 REGRESSION (r19469): ASSERT when right clicking on hyperlinks! in TOT webkit * WebCoreSupport/WebContextMenuClient.mm: (fixMenusReceivedFromOldClients): - fixMenusReceivedFromOldClients was hitting an ASSERT incorrectly because it could not match [item title] to any of the contentMenuItemTags using pointer comparison ==. Instead, it needs to do a string comparison between [item title] and the various contentMenuItemTags using isEqualToString instead of ==. You would encounter this whenever the context menu was activated, e.g., from a hyperlink right click (or control click). 2007-02-07 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. Move shouldInterruptJavaScript to the Chrome. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::shouldInterruptJavaScript): * WebCoreSupport/WebFrameBridge.mm: 2007-02-07 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker - fixed all places in WebKit where _web_userVisibleString was used where _web_originalDataAsString should have been used instead. * History/WebURLsWithTitles.m: (+[WebURLsWithTitles writeURLs:andTitles:toPasteboard:]): use _web_originalDataAsString when writing since these aren't displayed to the user (+[WebURLsWithTitles URLsFromPasteboard:]): use _web_URLWithDataAsString when reading, to match what we used when writing * Misc/WebNSPasteboardExtras.mm: (-[NSPasteboard _web_writeURL:andTitle:types:]): use _web_originalDataAsString when writing the NSURL type; continue using _web_userVisibleString when writing the plain text type * WebView/WebHTMLView.mm: (-[WebHTMLView _documentFragmentWithPaths:]): added comment about why _web_userVisibleString is appropriate here (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]): use _web_originalDataAsString when setting the href attribute of an anchor tag 2007-02-07 David Harrison <harrison@apple.com> Reviewed by Adam. <rdar://problem/4943650> REGRESSION: insertion point blink redraws entire web page, making everything slow Problem is that AppKit recently changed NSControl to trigger a full redraw if the control has a focus ring. WebHTMLView is a subclass of NSControl, but the focus ring type was the default value, though we actually draw no focus ring. Fix is to formally set our focus ring type. * WebView/WebHTMLView.mm: (-[WebHTMLView initWithFrame:]): Send [self setFocusRingType:NSFocusRingTypeNone]. 2007-02-07 John Sullivan <sullivan@apple.com> Undid changes that I hadn't intended to check in * WebView/WebHTMLView.mm: (-[WebHTMLView _documentFragmentWithPaths:]): (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]): 2007-02-07 John Sullivan <sullivan@apple.com> Reviewed by Ollie and Geoff - fixed <rdar://problem/4982345> KURL::createCFURL leak inside -[WebFrameBridge startDraggingImage...] reported by buildbot (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): don't retain the imageURL we pass to the drag controller -- it's just automagically converted to a KURL anyway 2007-02-07 John Sullivan <sullivan@apple.com> Reviewed by Darin - fixed <rdar://problem/4974420> REGRESSION: Dragging a saved image into the browser window displays a error (No File exists at the address "null") (12662) * WebCoreSupport/WebPasteboardHelper.mm: (WebPasteboardHelper::urlFromPasteboard): use _web_originalDataAsString instead of _web_userVisibleString, since _web_userVisibleString can return a string with non-ASCII characters -- suitable for display but not for code 2007-02-07 John Sullivan <sullivan@apple.com> Reviewed by Darin - added some clarity to some menu-handling shenanigans * WebCoreSupport/WebContextMenuClient.mm: (fixMenusToSendToOldClients): renamed from fixMenusForOldClients; added comments, FIXME, and assertion (fixMenusReceivedFromOldClients): renamed from fixMenusFromOldClients; added comments, FIXME, and assertion (WebContextMenuClient::getCustomMenuFromDefaultItems): updated for name changes 2007-02-06 Kevin Decker <kdecker@apple.com> Fixed: <rdar://problem/4976681> ASSERTION failure on quit @ talkcrunch.com in _NPN_ReleaseObject Reviewed by Anders. * Plugins/WebPluginDatabase.m: (+[WebPluginDatabase sharedDatabase]): Removed NSApplicationWillTerminateNotification observer and thus also removed code that would unload the entire plug-in database when receiving that notification. The bug here was that this notification callback would happen first before anything else thus unloading plug-ins and releasing plug-in memory. That was crash prone because the JavaScriptCore collector would at a later time attempt to release its CInstance references (references that point to plug-in memory) without knowing WebKit already unloaded the plug-in out from underneath it. The WebPluginDatabase simply does not have enough context to make this decision. * WebView/WebView.mm: Added two statics: applicationIsTerminating, pluginDatabaseClientCount. (+[WebView initialize]): Added NSApplicationWillTerminateNotification observer. (+[WebView _applicationWillTerminate]): Added. (-[WebView _close]): WebKit has both a global plug-in database and a separate, per WebView plug-in database. We need to release both sets of plug-ins because Netscape plug-ins have "destructor functions" that should be called when the browser unloads the plug-in. These functions can do important things, such as closing/deleting files so it is important to ensure that they are properly called when the application terminates. The new change is that on app shutdown, we unload WebKit's global plug-in database if and only if the last WebView was closed. To do so otherwise would unload plug-ins out from underneath other WebViews. 2007-02-06 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - fix http://bugs.webkit.org/show_bug.cgi?id=11080 <rdar://problem/4826648> REGRESSION: Incorrect vertical positioning of Safari status bar text containing @ character (11080) * Misc/WebKitNSStringExtras.m: (canUseFastRenderer): Fix code that mistakenly used the slow renderer for strings that have a direction of "other neutral", which includes the "@" character. (-[NSString _web_drawAtPoint:font:textColor:]): Add code to make the baseline of the text in the status bar right. AppKit's rule for rounding is complicated enough that this is obviously not perfectly correct, but it does make both code paths use the same baseline in all the places this is currently used in AppKit. 2007-02-06 Darin Adler <darin@apple.com> Spotted by Steve F. * Misc/WebNSURLExtras.m: (-[NSString _web_mapHostNameWithRange:encode:makeString:]): Fix obvious logic mistake I introduced back in revision 8255. I can't see how to exercise this code path, but I also can't bear to leave this obviously-broken code as-is. 2007-02-05 David Kilzer <ddkilzer@webkit.org> Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=7266 Webarchive format saves duplicate WebSubresources to .webarchive file Tests: webarchive/test-duplicate-resources.html webarchive/test-frameset.html * WebView/WebArchiver.mm: (+[WebArchiver _archiveWithMarkupString:fromFrame:nodes:]): Use an NSMutableSet to prevent duplicate subresources from being added to the webarchive. 2007-02-06 Mark Rowe <mrowe@apple.com> Roll out incomplete support for font-stretch (r19350) at Dave Hyatt's request. See http://bugs.webkit.org/show_bug.cgi?id=12530#c9 for more info. * WebInspector/webInspector/inspector.js: * WebView/WebHTMLView.mm: (-[WebHTMLView _addToStyle:fontA:fontB:]): 2007-02-05 Beth Dakin <bdakin@apple.com> Reviewed by Adam. Fix for <rdar://problem/4975161> REGRESSION: With BumperCar 2.1.1, the contextual menu fails to appear when I ctrl-click on page * WebCoreSupport/WebContextMenuClient.mm: (WebContextMenuClient::getCustomMenuFromDefaultItems): If the delegate does not respond to contextMenuItemsForElement, return the default menu instead of nil. 2007-02-01 Geoffrey Garen <ggaren@apple.com> Reviewed by Maciej Stachowiak. Added support for selectively ignoring WebCore::Node leaks during layout tests, so that we can ignore known leaks in other components. * Misc/WebCoreStatistics.h: * Misc/WebCoreStatistics.mm: (+[WebCoreStatistics startIgnoringWebCoreNodeLeaks]): (+[WebCoreStatistics stopIgnoringWebCoreNodeLeaks]): 2007-02-01 Nicholas Shanks <webkit@nickshanks.com> Reviewed by Mark. Add support for CSS2 font-stretch property. * WebInspector/webInspector/inspector.js: * WebView/WebHTMLView.mm: (-[WebHTMLView _addToStyle:fontA:fontB:]): 2007-02-01 Maciej Stachowiak <mjs@apple.com> Reviewed by Adam. <rdar://problem/4730469> REGRESSION: Assertion failure in -[WebDataSource(WebInternal) _bridge] when forwarding message * WebView/WebDataSource.mm: (-[WebDataSource subresources]): Check for being uncommitted and return emtpy result. (-[WebDataSource subresourceForURL:]): ditto 2007-01-31 Oliver Hunt <oliver@apple.com> Reviewed by Adam. Migrating methods to WebCore * WebCoreSupport/WebFrameBridge.mm: * WebView/WebHTMLView.mm: * WebView/WebHTMLViewPrivate.h: 2007-01-31 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. <rdar://problem/4886776> REGRESSION: After opening a web archive, location shows the actual URL, not the webarchive file "Revert" the change done in 13734. * WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation loadArchive]): Don't do a new load here, as this would cancel the current load and call the resource load delegate's didFailLoadingWithError: method. Instead, call continueLoadWithData. 2007-02-01 Nikolas Zimmermann <zimmermann@kde.org> Reviewed by Maciej. Fix run-pageloadtest to actually work again. * Misc/WebNSWindowExtras.m: (+[NSWindow _webkit_displayThrottledWindows]): 2007-01-31 Adele Peterson <adele@apple.com> Reviewed by Darin. WebKit part of fix for <rdar://problem/4521461> REGRESSION: when keyPress event changes form focus, inserted key goes to wrong control * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::handleKeyPress): Instead of using the selected frame, use the frame for the target of the keyboard event. Also, don't do the canEdit check here, since the target's frame might not have a selection at this point. Do the canEdit check within Editor::insertText, where we determine which selection to use for inserting text. * WebView/WebEditingDelegatePrivate.h: Added forward declaration of DOMHTMLElement. This is needed after reordering includes in WebEditorClient.mm. 2007-01-31 Alice Liu <alice.liu@apple.com> Reviewed by Tim Hatcher. Turning an accidental API change to an SPI change * WebView/WebEditingDelegate.h: * WebView/WebEditingDelegatePrivate.h: move some declarations into private header. 2007-01-31 Darin Adler <darin@apple.com> - fix build * ForwardingHeaders/wtf/ListHashSet.h: Added. 2007-01-31 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - related fix for <rdar://problem/4964407> REGRESSION: Mail hangs when replying, forwarding , or creating a new message * WebView/WebFrame.mm: (-[WebFrame loadArchive:]): This method also needs to add the lame WebDataRequest property or other things, like Mail Contents of Page, break. 2007-01-31 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. - add back no-op version of silly method so that shipping Safari can still run the PLT * Misc/WebNSWindowExtras.m: (-[NSWindow _webkit_displayThrottledWindows]): 2007-01-31 Mark Rowe <mrowe@apple.com> More build fixing. * Misc/WebKitLogging.h: Use !defined() rather than !. * Plugins/WebNetscapePluginStream.h: Remove #if __cplusplus as this file is only included from Obj-C++ files. * WebView/WebHTMLView.mm: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): Use #ifdef rather than #if. * WebView/WebView.mm: (-[WebView isGrammarCheckingEnabled]): Ditto. 2007-01-31 Mark Rowe <mrowe@apple.com> Build fix. * WebView/WebView.mm: (-[WebView initWithFrame:frameName:groupName:]): 2007-01-31 Mark Rowe <mrowe@apple.com> Reviewed by Oliver. Enable -Wundef in WebKit, and change misuses of #if to #ifdef or #ifndef as appropriate. * Misc/WebKitLogging.h: * WebKit.xcodeproj/project.pbxproj: * WebView/WebFrame.mm: * WebView/WebFrameInternal.h: * WebView/WebHTMLView.mm: (-[WebHTMLView validateUserInterfaceItem:]): (-[WebHTMLView delete:]): (-[WebHTMLView showGuessPanel:]): (-[WebHTMLView copy:]): (-[WebHTMLView cut:]): (-[WebHTMLView paste:]): * WebView/WebHTMLViewInternal.h: * WebView/WebView.mm: (-[WebViewPrivate init]): (-[WebView validateUserInterfaceItem:]): * WebView/WebViewPrivate.h: 2007-01-30 Brady Eidson <beidson@apple.com> Reviewed by Oliver This is a corollary to <rdar://problem/4944887> where certain things happened on an alternate thread. To help catch such behavior in the future, add ASSERT_MAIN_THREAD() to key WebKit API points * History/WebHistoryItem.mm: Added ASSERT_MAIN_THREAD() to suspected API entry points (-[WebHistoryItem dealloc]): (-[WebHistoryItem finalize]): (-[WebHistoryItem copyWithZone:]): (-[WebHistoryItem URLString]): (-[WebHistoryItem originalURLString]): (-[WebHistoryItem title]): (-[WebHistoryItem lastVisitedTimeInterval]): (-[WebHistoryItem isEqual:]): (-[WebHistoryItem description]): (-[WebHistoryItem initWithWebCoreHistoryItem:]): (-[WebHistoryItem initFromDictionaryRepresentation:]): (-[WebHistoryItem scrollPoint]): (-[WebHistoryItem dictionaryRepresentation]): (-[WebHistoryItem target]): (-[WebHistoryItem visitCount]): (-[WebHistoryItem children]): (-[WebHistoryItem URL]): (-[WebHistoryItem _lastVisitedDate]): (-[WebHistoryItem targetItem]): * Misc/WebIconDatabase.mm: Added ASSERT_MAIN_THREAD() to suspected API entry points (-[WebIconDatabase iconForURL:withSize:cache:]): (-[WebIconDatabase iconURLForURL:]): (-[WebIconDatabase defaultIconWithSize:]): (-[WebIconDatabase retainIconForURL:]): (-[WebIconDatabase releaseIconForURL:]): (-[WebIconDatabase removeAllIcons]): (-[WebIconDatabase _iconForFileURL:withSize:]): (webGetNSImage): * Misc/WebKitLogging.h: Added ASSERT_MAIN_THREAD() * Misc/WebKitLogging.m: (WebKitRunningOnMainThread): Added * WebKit.xcodeproj/project.pbxproj: Define DISABLE_THREAD_CHECK until it is safe to run with ASSERT_MAIN_THREAD() active 2007-01-30 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/4961953> Stop using NSString deprecated methods like initWithCString: * Misc/WebNSImageExtras.m: (-[NSImage _web_saveAndOpen]): * WebKit.xcodeproj/project.pbxproj: 2007-01-30 Mitz Pettel <mitz@webkit.org> Reviewed by Geoff. - fix http://bugs.webkit.org/show_bug.cgi?id=12050 REGRESSION: Assertion failure in -[WebBaseNetscapePluginView willCallPlugInFunction] (plugin) Test: plugins/createScriptableObject-before-start.html * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView createPluginScriptableObject]): Return NULL if the plugin is not started. 2007-01-30 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. <rdar://problem/4964407> REGRESSION: Mail hangs when replying, forwarding , or creating a new message * WebView/WebFrame.mm: (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): Set WebDataRequest property on data load requests since Mail specifically checks for this. 2007-01-30 Graham Dennis <graham.dennis@gmail.com> Reviewed by Maciej. Part of fix for http://bugs.webkit.org/show_bug.cgi?id=10725 Image data in from RTFD clipboard data thrown away The URLs for images in RTFD data must not be loaded until the resources have been added to the WebUnarchivingState. This can't happen until after the RTFD data has been parsed, so we must delay loading while this RTFD data is being parsed to a document fragment. * WebView/WebHTMLView.mm: (uniqueURLWithRelativePart): (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]): defer loading the resources while RTFD data is being parsed. (+[NSURL _web_uniqueWebDataURL]): Added this back because AppKit uses it. * WebView/WebUnarchivingState.m: (-[WebUnarchivingState archivedResourceForURL:]): orkaround for workaround for rdar://problem/4699166 so that other people can use archivedResourceForURL: too. 2007-01-29 Jim Correia <jim.correia@pobox.com> Reviewed by Mark. Added support for -allowsUndo/-setAllowsUndo: to allow editable WebView clients to completely disable undo registration. This is functionally equivalent to the methods with the same names on NSTextView. * WebView/WebView.mm: (-[WebViewPrivate init]): (-[WebView initWithCoder:]): (-[WebView encodeWithCoder:]): (-[WebView allowsUndo]): (-[WebView setAllowsUndo:]): (-[WebView undoManager]): * WebView/WebViewPrivate.h: 2007-01-29 Ada Chan <adachan@apple.com> Reviewed by Brady. Moved the update of the title of the current entry in the backforward list to WebCore. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::setTitle): 2007-01-29 Adele Peterson <adele@apple.com> Reviewed by Darin. More preparation for event handling fixes. * WebCoreSupport/WebEditorClient.h: Removed EventTargetNode parameter, since you can just get this from the KeyboardEvent. * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::handleKeyPress): ditto. * WebView/WebHTMLViewInternal.h: Added interpretKeyEventsParameters struct. * WebView/WebViewInternal.h: Changed parameter from NSEvent to WebCoreKeyboardEvent in _interceptEditingKeyEvent. * WebView/WebHTMLView.mm: (-[WebHTMLView yankAndSelect:]): Updated for new triggeringEvent parameter. (-[WebHTMLView _interceptEditingKeyEvent:]): Set the WebHTMLViewInterpretKeyEventsParameters. (-[WebHTMLView doCommandBySelector:]): Access WebHTMLViewInterpretKeyEventsParameters. (-[WebHTMLView insertText:]): ditto. (-[WebHTMLView _insertText:selectInsertedText:triggeringEvent:]): Added parameter for triggeringEvent. 2007-01-29 Oliver Hunt <oliver@apple.com> build fix * WebView/WebHTMLView.mm: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): 2007-01-25 Oliver Hunt <oliver@apple.com> Reviewed by Adam. Migrated drag state and logic to WebCore, removed superfluous methods * ChangeLog: * WebCoreSupport/WebDragClient.h: * WebCoreSupport/WebDragClient.mm: (WebDragClient::dragSourceActionMaskForPoint): * WebCoreSupport/WebFrameBridge.mm: allowDHTMLDrag move to WebCore::EventHandler * WebView/WebHTMLView.mm: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): (-[WebHTMLView draggedImage:movedTo:]): (-[WebHTMLView draggedImage:endedAt:operation:]): dragOffset and dragSourecAction is now stored in WebCore::DragController migrated _delegateDragSourceActionMask to WebCore::DragController * WebView/WebHTMLViewInternal.h: Removed dragOffset declaration, migrated to WebCore::DragController * WebView/WebView.mm: removed unnecessary method, _loadingDragOperationForDraggingInfo 2007-01-29 Maciej Stachowiak <mjs@apple.com> Reviewed by Mark. - updated for cross-platform data loading support * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::createDocumentLoader): * WebView/WebDataSource.mm: (-[WebDataSource initWithRequest:]): * WebView/WebDocumentLoaderMac.h: * WebView/WebDocumentLoaderMac.mm: (WebDocumentLoaderMac::WebDocumentLoaderMac): * WebView/WebFrame.mm: (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): (-[WebFrame loadData:MIMEType:textEncodingName:baseURL:]): (-[WebFrame _loadHTMLString:baseURL:unreachableURL:]): (-[WebFrame loadArchive:]): * WebView/WebFrameInternal.h: * WebView/WebHTMLView.mm: (uniqueURLWithRelativePart): (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]): 2007-01-27 David Kilzer <ddkilzer@webkit.org> Reviewed by Adam. - fix http://bugs.webkit.org/show_bug.cgi?id=12260 Windows platform build is not maintained * COM/ChromeClientWin.cpp: (ChromeClientWin::canTakeFocus): (ChromeClientWin::takeFocus): * COM/ChromeClientWin.h: * COM/ContextMenuClientWin.cpp: (ContextMenuClientWin::getCustomMenuFromDefaultItems): (ContextMenuClientWin::searchWithGoogle): * COM/ContextMenuClientWin.h: * COM/WebFrameLoaderClient.cpp: (WebFrameLoaderClient::assignIdentifierToInitialRequest): (WebFrameLoaderClient::dispatchWillSendRequest): (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidReceiveResponse): (WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebFrameLoaderClient::dispatchDidFinishLoading): (WebFrameLoaderClient::dispatchDidFailLoading): (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache): (WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebFrameLoaderClient::dispatchDidFailLoad): (WebFrameLoaderClient::dispatchCreatePage): (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType): (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): (WebFrameLoaderClient::dispatchUnableToImplementPolicy): (WebFrameLoaderClient::setMainDocumentError): (WebFrameLoaderClient::incrementProgress): (WebFrameLoaderClient::completeProgress): (WebFrameLoaderClient::startDownload): (WebFrameLoaderClient::committedLoad): (WebFrameLoaderClient::cancelledError): (WebFrameLoaderClient::cannotShowURLError): (WebFrameLoaderClient::interruptForPolicyChangeError): (WebFrameLoaderClient::cannotShowMIMETypeError): (WebFrameLoaderClient::fileDoesNotExistError): (WebFrameLoaderClient::shouldFallBack): (WebFrameLoaderClient::willUseArchive): (WebFrameLoaderClient::createDocumentLoader): (WebFrameLoaderClient::download): * COM/WebFrameLoaderClient.h: 2007-01-27 David Harrison <harrison@apple.com> Reviewed by Kevin. <rdar://problem/4958902> REGRESSION: Dashboard widgets fail to load This was caused by the WebView preferences rework in r18417. Specifically, in _updateWebCoreSettingsFromPreferences when calling setUserStyleSheetLocation, [NSURL URLWithString:] is now messaged directly with the result of [[preferences userStyleSheetLocation] _web_originalDataAsString]], which will be nil if the userStyleSheetLocation has not been set yet. [NSURL URLWithString:] throws an exception when the string is nil. DashboardClient.app calls setUserStyleSheetEnabled *before* calling setUserStyleSheetLocation. * WebView/WebView.mm: (-[WebView _updateWebCoreSettingsFromPreferences:]): Pass empty string instead of nil string to [NSURL URLWithString:]. 2007-01-26 Darin Adler <darin@apple.com> Reviewed by Timothy. Fixes crash drawing avatar on mail.yahoo.com. * Plugins/WebBaseNetscapePluginStream.m: Retain the object since destroyStreamWithError: might release the last reference to it. 2007-01-26 Darin Adler <darin@apple.com> Reviewed by Beth. * WebInspector/webInspector/inspector.js: Updated for new computed style properties. 2007-01-26 Kevin Decker <kdecker@apple.com> Reviewed by andersca. Fixed: <rdar://problem/4946922> WebBaseNetscapePluginView leaks memory http://bugs.webkit.org/show_bug.cgi?id=11523 * Plugins/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setPlugin:]): Calls -[WebBaseNetscapePluginView disconnectStream:] * Plugins/WebBaseNetscapePluginView.h: Added disconnectStream: to header. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView stop]): Make a copy of the streams collection prior to calling stop all streams. This is necessary because calling stop has the side effect of removing the stream from this same collection. (-[WebBaseNetscapePluginView disconnectStream:]): Added. Removes the stream from the streams collection. 2007-01-25 Kevin Decker <kdecker@apple.com> Backed out my last patch because it crashes espn.com. Stay tuned for a newer version.. * Plugins/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setPlugin:]): Removed call to streamIsDead. * Plugins/WebBaseNetscapePluginView.h: Removed streamIsDead. * Plugins/WebBaseNetscapePluginView.mm: Ditto. 2007-01-25 Darin Adler <darin@apple.com> Reviewed by Beth. - fix <rdar://problem/4952766> Safari has a top secret color picker that can be used to... uhh... I don't know * Panels/English.lproj/WebAuthenticationPanel.nib/info.nib: Let Interface Builder have its way. * Panels/English.lproj/WebAuthenticationPanel.nib/objects.nib: Remove the NSColorWell that was in here (for no good reason). 2007-01-25 Kevin Decker <kdecker@apple.com> Reviewed by andersca. A few tweaks with of a fix done by Steve Gehrman. Fixed: <rdar://problem/4946922> WebBaseNetscapePluginView leaks memory http://bugs.webkit.org/show_bug.cgi?id=11523 * Plugins/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream setPlugin:]): Calls -[WebBaseNetscapePluginView streamIsDead:] * Plugins/WebBaseNetscapePluginView.h: Added streamIsDead to header. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView streamIsDead:]): Added. Removes the stream from the streams collection. 2007-01-25 John Sullivan <sullivan@apple.com> Reviewed by Kevin, Geoff, Brady, and Darin - fixed <rdar://problem/4918446> Safari's temp files (PDF's) should be in a sub-folder when calling Preview * WebView/WebPDFView.mm: (-[WebPDFView _path]): use _temporaryPDFDirectoryPath method instead of #defines for hardwiring strings; stop bad practice of modifying the const char* returned by fileSystemRepresentation (-[WebPDFView _temporaryPDFDirectoryPath]): new method, lazily creates and returns a secure temporary directory created with NSTemporaryDirectory() and mkdtemp * English.lproj/StringsNotToBeLocalized.txt: Updated for these and other recent changes 2007-01-24 Oliver Hunt <oliver@apple.com> Build fix * WebView/WebHTMLView.mm: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): 2007-01-24 Oliver Hunt <ioliver@apple.com> Reviewed by Maciej. Migrating more drag state information to WebCore * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLView.mm: (-[WebHTMLViewPrivate dealloc]): (-[WebHTMLViewPrivate clear]): (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): (-[WebHTMLView _mayStartDragAtEventLocation:]): (-[WebHTMLView close]): (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): (-[WebHTMLView _delegateDragSourceActionMask]): * WebView/WebHTMLViewInternal.h: 2007-01-24 Adele Peterson <adele@apple.com> Reviewed by Darin. Small improvement to my last checkin to prevent the keyEventWasInterpreted bool from being overwritten by reentrancy. * WebView/WebHTMLView.mm: (-[WebHTMLView _interceptEditingKeyEvent:]): Point keyEventWasInterpreted pointer to local variable. (-[WebHTMLView doCommandBySelector:]): (-[WebHTMLView insertText:]): * WebView/WebHTMLViewInternal.h: Added BOOL pointer that will point to the local variable on the stack in _interceptEditingKeyEvent 2007-01-24 Adele Peterson <adele@apple.com> Reviewed by Darin. - Fix for <rdar://problem/4950527> REGRESSION: Can't use arrow keys (left/right) to navigate caret in input (type=text) or textarea fields Keep track of whether interpretKeyEvents handles the key event based on whether or not we get called in insertText or doCommandBySelector. Test: fast/events/arrow-navigation.html * WebView/WebHTMLView.mm: (-[WebHTMLView performKeyEquivalent:]): (-[WebHTMLView _interceptEditingKeyEvent:]): (-[WebHTMLView doCommandBySelector:]): (-[WebHTMLView insertText:]): * WebView/WebHTMLViewInternal.h: 2007-01-25 Mark Rowe <mrowe@apple.com> Reviewed by Maciej. * Info.plist: Update copyright string. 2007-01-24 Darin Adler <darin@apple.com> Reviewed by Mark Rowe. * WebKit.xcodeproj/project.pbxproj: Changed to /usr/sbin/sysctl so we don't rely on people's paths. 2007-01-24 Darin Adler <darin@apple.com> Reviewed by Adele. - fix small regression and GC problems noticed by code inspection * WebView/WebHTMLView.mm: Move global declarations to the start of the file. (+[WebHTMLView _excludedElementsForAttributedStringConversion]): Add a CFRetain here for GC compatibility. (+[WebHTMLView _insertablePasteboardTypes]): Ditto. (-[WebHTMLView performKeyEquivalent:]): Fix small logic mistake that prevents super from being called if EventHandler::keyEvent returns false. Reformatted the code a bit and added a local variable for the frame. (-[WebHTMLView _interceptEditingKeyEvent:]): Added some comments. (-[WebHTMLView validAttributesForMarkedText]): Add a CFRetain here for GC compatibility. 2007-01-23 Adele Peterson <adele@apple.com> Reviewed by Adam. Fixed 2 layout tests that I broke with my last checkin. * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::handleKeyPress): Use the selected frame to get the WebHTMLView. * WebView/WebHTMLView.mm: (-[WebHTMLView performKeyEquivalent:]): Added global to keep track of NSEvent used here. (-[WebHTMLView _interceptEditingKeyEvent:]): Check NSEvent against the event used in performKeyEquivalent. We don't want to intercept these events. 2007-01-23 Adele Peterson <adele@apple.com> Reviewed by Darin. WebKit part of fix for <rdar://problem/4946753>REGRESSION: Inserting tabs is broken in Mail In addition to this fix, I also reorganized some event handling code for keyPress events to prepare for another fix. * WebCoreSupport/WebEditorClient.h: Added handleKeyPress method. * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::handleKeyPress): Added. Code moved from WebHTMLView keyDown method. This is called from the defaultEventHandler so that in the future, we can make the right decision about which selection the keyPress should apply to. * WebView/WebHTMLView.mm: (-[WebHTMLView keyDown:]): Moved _interceptEditingKeyEvent call to handleKeyPress. (-[WebHTMLView _interceptEditingKeyEvent:]): Prevents intercepting keys for cmd-modified events. Removed tabCycling checks since this is now handled in WebCore. * WebView/WebHTMLViewInternal.h: Made _interceptEditingKeyEvent SPI. * WebView/WebView.mm: Use new tabKeyCyclesThroughElements methods on the page. (-[WebViewPrivate init]): ditto. (-[WebView setTabKeyCyclesThroughElements:]): ditto. (-[WebView tabKeyCyclesThroughElements]): ditto. (-[WebView setEditable:]): ditto 2007-01-23 Lars Knoll <lars@trolltech.com> Reviewed by Maciej Make the last remaining pieces of the FrameLoader platform independent. Move most of the code over to WebFrameLoaderClient. Some smaller cleanups in the WebFrameBridge, and moved some platform independent functionality over to the shared code in WebCore. * Webcoresupport/WebFrameBridge.mm: (-[WebFrameBridge finishInitializingWithPage:frameName:frameView:ownerElement:]): (-[WebFrameBridge createChildFrameNamed:withURL:referrer:ownerElement:allowsScrolling:marginWidth:marginHeight:]): (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]): * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::setTitle): (WebFrameLoaderClient::createFrame): (WebFrameLoaderClient::objectContentType): (nsArray): (WebFrameLoaderClient::createPlugin): (WebFrameLoaderClient::redirectDataToPlugin): (nsMutableArray): (WebFrameLoaderClient::createJavaAppletWidget): (WebFrameLoaderClient::overrideMediaType): (WebFrameLoaderClient::windowObjectCleared): 2007-01-23 Oliver Hunt <oliver@apple.com> Reviewed by Adam. Drop logic bindings for WebKit * WebCoreSupport/WebDragClient.h: Added. * WebCoreSupport/WebDragClient.mm: Added. (WebDragClient::WebDragClient): (WebDragClient::actionMaskForDrag): (WebDragClient::willPerformDragDestinationAction): Standard client impl * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): Updated to use DragController to track drag state * WebCoreSupport/WebPasteboardHelper.h: Added. (WebPasteboardHelper::WebPasteboardHelper): A *temporary* Helper class to access NSPasteboard access and manipulation functions present in WebKit * WebCoreSupport/WebPasteboardHelper.mm: Added. (WebPasteboardHelper::urlFromPasteboard): (WebPasteboardHelper::plainTextFromPasteboard): (WebPasteboardHelper::fragmentFromPasteboard): (WebPasteboardHelper::insertablePasteboardTypes): See header comment * WebKit.xcodeproj/project.pbxproj: * WebView/WebDocumentInternal.h: Remove unnecessary protocol * WebView/WebFrameView.mm: (-[WebFrameView _setDocumentView:]): Updating to use DragController to track drag state * WebView/WebHTMLView.mm: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): ditto (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): ditto (-[WebHTMLView draggingSourceOperationMaskForLocal:]): ditto (-[WebHTMLView draggedImage:endedAt:operation:]): ditto (-[WebHTMLView _documentFragmentForPasteboard:]): Helper method to generate DocumentFragment from NSPasteboard without regressing (-[WebHTMLView _canProcessDragWithDraggingInfo:]): Updating to use DragController to track drag state (-[WebHTMLView _isMoveDrag:]): (-[WebHTMLView _isNSColorDrag:]): * WebView/WebHTMLViewInternal.h: Removing unnecessary fields and methods * WebView/WebView.mm: (-[WebViewPrivate dealloc]): Remove obsolete ASSERT (-[WebView _setInitiatedDrag:]): Now passes directly through to DragController (-[WebView _commonInitializationWithFrameName:groupName:]): (-[WebView _loadingDragOperationForDraggingInfo:]): Removed (-[WebView draggingEntered:]): Updated to use DragController (-[WebView draggingUpdated:]): ditto (-[WebView draggingExited:]): ditto (-[WebView performDragOperation:]): ditto (-[WebView _hitTest:dragTypes:]): * WebView/WebViewInternal.h: remove unnecessary method def 2007-01-22 John Sullivan <sullivan@apple.com> * WebView/WebHTMLView.mm: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): Tiger build fix: remove unused variable for return value of dictionaryServiceWindowShow 2007-01-22 John Sullivan <sullivan@apple.com> Reviewed by Adam and Darin - fixed <rdar://problem/4794320> "Look Up in Dictionary" does nothing in WebKit (need to adopt new API) * Misc/WebNSURLExtras.m: (-[NSString _web_isUserVisibleURL]): random typo correction in comment * English.lproj/StringsNotToBeLocalized.txt: updated for these changes * WebView/WebHTMLView.mm: (coreGraphicsScreenPointForAppKitScreenPoint): new function to convert an AppKit screen point to a CG screen point (-[WebHTMLView _lookUpInDictionaryFromMenu:]): on Leopard now uses new API. There's something of an impedance mismatch between this API and WebKit, but that was true for the SPI we were using in Tiger also. Bug 4945808 covers the ways in which this is not perfect. 2007-01-21 Darin Adler <darin@apple.com> Reviewed by Tim H. * WebInspector/webInspector/inspector.css: Use row-resize for the splitter cursor instead of move. It's a horizontal splitter resizer. 2007-01-19 Adam Roben <aroben@apple.com> Reviewed by Beth. Fix <rdar://problem/4942294> REGRESSION: "Spelling and Grammar", "Font", "Speech", and "Writing Direction" are missing from contextual menu * WebCoreSupport/WebContextMenuClient.mm: (fixMenusForOldClients): Change our new SPI tags to WebMenuItemTagOther because old clients aren't expecting the new tags. (fixMenusFromOldClients): Use each menu item's title to figure out its correct tag again. (WebContextMenuClient::getCustomMenuFromDefaultItems): Call fixMenusForOldClients before calling up to the delegate. * WebView/WebUIDelegatePrivate.h: Define WEBMENUITEMTAG_SPI_START so that we can use it in WebContextMenuClient. 2007-01-19 John Sullivan <sullivan@apple.com> Reviewed by Darin - WebKit part of fix for: <rdar://problem/4451715> REGRESSION: On some sites, have to type a character before username/password autofill kicks in Added new webView:didFinishDocumentLoadForFrame: SPI and wired it up * WebView/WebViewPrivate.h: declare new delegate method * WebCoreSupport/WebFrameLoaderClient.h: declare dispatchDidFinishDocumentLoad() * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidFinishDocumentLoad): new method, calls new delegate method * DefaultDelegates/WebDefaultFrameLoadDelegate.m: (-[WebDefaultFrameLoadDelegate webView:didFinishDocumentLoadForFrame:]): empty default implementation of new delegate method 2007-01-19 Anders Carlsson <acarlsson@apple.com> Reviewed by John Sullivan. http://bugs.webkit.org/show_bug.cgi?id=12308 REGRESSION(r18910): Crash in WebBaseNetscapePluginStream cancelLoadAndDestroyStreamWithError * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): Move code from initWithFrame in here. 2007-01-19 Anders Carlsson <acarlsson@apple.com> Yet another build fix. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::setStatusbarText): 2007-01-18 Anders Carlsson <acarlsson@apple.com> Reviewed by Adam. Move functions from the bridge to the chrome client. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::runJavaScriptAlert): (WebChromeClient::runJavaScriptConfirm): (WebChromeClient::runJavaScriptPrompt): (WebChromeClient::setStatusBarText): * WebCoreSupport/WebFrameBridge.mm: 2007-01-18 Adam Roben <aroben@apple.com> Reviewed by Beth. Fix <rdar://problem/4939672> REGRESSION: With text selected that is not a link, the "Remove Link" contextual menu item remains active * WebView/WebHTMLView.mm: (-[WebHTMLView menuForEvent:]): Leave autoenabling of menu items on so that clients can implement validateMenuItem:. 2007-01-18 Brady Eidson <beidson@apple.com> Reviewed by Adele <rdar://problem/4917290> - Null deref in WebFrameLoaderClient::restoreScrollPositionAndViewState() after regaining network connection * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::restoreScrollPositionAndViewState): Bail early with a null currentItem, preventing a crash in release builds. Leave the ASSERT to help find other cases where this might happen in debug builds. 2007-01-18 Kevin Decker <kdecker@apple.com> Reviewed by John. <rdar://problem/4939511> WebKit should set the CG clip path for plug-ins that draw using CoreGraphics * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView drawRect:]): Set the CG clip path to the plug-in dirty rect. This allows plug-ins to obtain their dirty rect using functions like CGContextGetClipBoundingBox(). 2007-01-17 Alice Liu <alice.liu@apple.com> Reviewed by Harrison. Fix for <rdar://problem/4894155> REGRESSION: Extra line break is pasted with content into message body after choosing File - Paste Migration of some editing code from WebHTMView to WebCore::Editor resulted in not calling pasteboardTypesForSelection, which Mail was overriding for the special purpose of adding a type to the pasteboard after WebKit did. This patch adds 2 separate code paths for Tiger and Leopard. On Tiger we give in and call the WebView's pasteboardTypesForSelection. On Leopard we call a delegate after the pasteboard types are set. * DefaultDelegates/WebDefaultEditingDelegate.m: (-[WebDefaultEditingDelegate webView:didSetSelectionTypesForPasteboard:]): * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::didSetSelectionTypesForPasteboard): (WebEditorClient::pasteboardTypesForSelection): * WebView/WebEditingDelegate.h: 2007-01-17 John Sullivan <sullivan@apple.com> Reviewed by Darin - WebKit part of fix for <rdar://problem/4462420> REGRESSION: Mail hangs during Replace All if the replacement string contains the search string * Misc/WebKitVersionChecks.h: Added extern "C" so this can be used from .mm files. I don't need this change anymore for this fix, but it's still worth fixing now so it doesn't bite anyone later. * WebView/WebDocumentPrivate.h: Invented new private protocol WebDocumentIncrementalSearching, that has one method. The one method is just like the one WebDocumentSearching method, but with an additional parameter. We hope to eliminate this dependence on protocols someday, but adding another one as SPI seems like it won't make anything worse. * WebView/WebHTMLView.mm: (-[WebHTMLView searchFor:direction:caseSensitive:wrap:]): now calls through to new method that has one additional parameter, passing NO to match old behavior (-[WebHTMLView searchFor:direction:caseSensitive:wrap:startInSelection:]): pass new parameter to bridge * WebView/WebPDFView.h: Declare conformance to WebDocumentIncrementalSearching protocol * WebView/WebPDFView.mm: (-[WebPDFView searchFor:direction:caseSensitive:wrap:]): now calls through to new method that has one additional parameter, passing NO to match old behavior (-[WebPDFView searchFor:direction:caseSensitive:wrap:startInSelection:]): new method, former guts of searchFor:direction:caseSensitive:wrap: but now handles startInSelection parameter * WebView/WebViewPrivate.h: Declare new searchFor:direction:caseSensitive:wrap:startInSelection: method, just like existing method but with one additional parameter * WebView/WebView.mm: (-[WebView searchFor:direction:caseSensitive:wrap:]): now calls through to new method that has one additional parameter, passing NO to match old behavior (-[WebView searchFor:direction:caseSensitive:wrap:startInSelection:]): new method, former guts of searchFor:direction:caseSensitive:wrap: but now handles startInSelection parameter 2007-01-17 Brady Eidson <beidson@apple.com> Reviewed by Deth Bakin and Brian Dash Drop Panther Support (?!?) and change the comment explaining some SPI forward decls * Misc/WebDownload.m: 2007-01-17 Darin Adler <darin@apple.com> Reviewed by Maciej. - fix http://bugs.webkit.org/show_bug.cgi?id=12278 <rdar://problem/4928705> REGRESSION(r13070): Dragged image size includes padding (12278) * Misc/WebElementDictionary.mm: (-[WebElementDictionary _imageRect]): Call HitTestResult::imageRect, not HitTestResult::boundingBox. 2007-01-17 Anders Carlsson <acarlsson@apple.com> Reviewed by John Sullivan. Move all code in WebNetscapePluginEmbeddedView down to WebBaseNetscapePluginView. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): (-[WebBaseNetscapePluginView didStart]): (-[WebBaseNetscapePluginView dataSource]): (-[WebBaseNetscapePluginView dealloc]): (-[WebBaseNetscapePluginView pluginView:receivedResponse:]): (-[WebBaseNetscapePluginView pluginView:receivedData:]): (-[WebBaseNetscapePluginView pluginView:receivedError:]): (-[WebBaseNetscapePluginView pluginViewFinishedLoading:]): (-[WebBaseNetscapePluginView _redeliverStream]): * Plugins/WebNetscapePluginEmbeddedView.h: * Plugins/WebNetscapePluginEmbeddedView.mm: 2007-01-17 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. <rdar://problem/4887781> Seed: Repro Safari crash in -[WebHTMLRepresentation receivedData:withDataSource:] (music.aol.com) * WebView/WebDataSource.mm: (-[WebDataSource _receivedData:]): Protect self against destruction partway through this method. 2007-01-16 Alice Liu <alice.liu@apple.com> Reviewed by harrison. Fixed <rdar://problem/4921134> WebKit needs extensible cut/copy to allow additional types to be written to pasteboard * DefaultDelegates/WebDefaultEditingDelegate.m: (-[WebDefaultEditingDelegate webView:didWriteSelectionToPasteboard:]): * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::didWriteSelectionToPasteboard): * WebKit.xcodeproj/project.pbxproj: * WebView/WebEditingDelegate.h: 2007-01-15 Justin Garcia <justin.garcia@apple.com> Reviewed by mjs <rdar://problem/4810960> Gmail Editor: window.focus() called on keyDown (9640) The window's keydown event handler was being called instead of the editable subframe's if there was a key binding for the key event. * WebView/WebHTMLView.mm: (-[WebHTMLView performKeyEquivalent:]): Don't send the event to WebCore unless this WebHTMLView is the firstResponder. 2007-01-15 Anders Carlsson <acarlsson@apple.com> Reviewed by Darin. Update to match WebCore. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::willChangeEstimatedProgress): (WebFrameLoaderClient::didChangeEstimatedProgress): (WebFrameLoaderClient::postProgressStartedNotification): (WebFrameLoaderClient::postProgressEstimateChangedNotification): (WebFrameLoaderClient::postProgressFinishedNotification): Post the correct notifications. * WebView/WebView.mm: (-[WebViewPrivate init]): (-[WebViewPrivate dealloc]): Get rid of all progress tracking code. (-[WebView estimatedProgress]): Call ProgressTracker::estimatedProgress() 2007-01-15 Adam Roben <aroben@apple.com> Reviewed by Darin. Fix: http://bugs.webkit.org/show_bug.cgi?id=12134 REGRESSION: Assertion failure and crash when right clicking selection in forms * WebCoreSupport/WebContextMenuClient.mm: (fixMenusFromOldApps): Static helper to fix up menus from applications compiled against Tiger WebKit. (WebContextMenuClient::getCustomMenuFromDefaultItems): Call helper to fix menus. * WebView/WebUIDelegatePrivate.h: Fixed typo. 2007-01-14 David Kilzer <ddkilzer@kilzer.net> Reviewed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=12251 REGRESSION (r18822-r18823): Assertion failure opening document with non-existent resources (dom/xhtml/level2/html/HTMLIFrameElement11.xhtml) * WebView/WebView.mm: (-[WebView _objectForIdentifier:]): Removed assertion. (-[WebView _removeObjectForIdentifier:]): Removed assertion. 2007-01-12 Anders Carlsson <acarlsson@apple.com> Reviewed by Darin. Add a HashMap between unsigned longs and Objective-C objects and use it for the resource load delegate. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::assignIdentifierToInitialRequest): (WebFrameLoaderClient::dispatchIdentifierForInitialRequest): (WebFrameLoaderClient::dispatchWillSendRequest): (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidReceiveResponse): (WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebFrameLoaderClient::dispatchDidFinishLoading): (WebFrameLoaderClient::dispatchDidFailLoading): (WebFrameLoaderClient::incrementProgress): (WebFrameLoaderClient::completeProgress): * WebView/WebView.mm: (-[WebViewPrivate init]): (-[WebViewPrivate dealloc]): (-[WebView _addObject:forIdentifier:]): (-[WebView _objectForIdentifier:]): (-[WebView _removeObjectForIdentifier:]): * WebView/WebViewInternal.h: 2007-01-11 Brady Eidson <beidson@apple.com> Reviewed by Anders Rewrites HTTP Authentication setting up a more platform-independent structure * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge): * WebKit.xcodeproj/project.pbxproj: 2007-01-11 Darin Adler <darin@apple.com> Reviewed by Mitz. - fix http://bugs.webkit.org/show_bug.cgi?id=12180 REGRESSION: Double-clicking on JS exception in JS log crashes in -[SharedBufferData initWithSharedBuffer:] * WebView/WebDataSource.mm: (-[WebDataSource data]): Added null check. 2007-01-11 Darin Adler <darin@apple.com> Reviewed by Hyatt. - moved code from a couple WebCore bridging classes here instead * Misc/WebNSPasteboardExtras.mm: (-[NSPasteboard _web_writeImage:element:URL:title:archive:types:]): Use MimeTypeRegistry instead of WebMimeTypeRegistryBridge. * WebView/WebHTMLRepresentation.mm: (stringArray): Added. Helper to convert a HashSet to an NSArray. (concatenateArrays): Added. Helper to concatenate two NSArray objects. (+[WebHTMLRepresentation supportedMIMETypes]): Use MimeTypeRegistry instead of WebMimeTypeRegistryBridge. Also fix a potential GC problem by using a RetainPtr instead of a [retain] on a global variable. (+[WebHTMLRepresentation supportedNonImageMIMETypes]): Ditto. (+[WebHTMLRepresentation supportedImageMIMETypes]): Ditto. * WebView/WebHTMLView.mm: (-[WebHTMLView _imageExistsAtPaths:]): Use MimeTypeRegistry instead of WebMimeTypeRegistryBridge. (-[WebHTMLView _documentFragmentWithPaths:]): Ditto. * WebView/WebView.mm: (+[WebView _decodeData:]): Moved code here from the old WebCoreEncodings class. * WebKit.xcodeproj/project.pbxproj: Let Xcode have its way with this file. Moved WebRenderNode into the appropriate group. 2007-01-10 Mitz Pettel <mitz@webkit.org> Reviewed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=11775 'Show URLs in Tool Tips' preference is ignored * WebView/WebHTMLView.mm: (-[WebHTMLView _resetCachedWebPreferences:]): (-[WebHTMLView setDataSource:]): Added a call to _resetCachedWebPreferences:. Added an assertion that the view is not closed, instead of reopening it. Reopening should not occur, now that <http://bugs.webkit.org/show_bug.cgi?id=12087> is fixed. 2007-01-10 Beth Dakin <bdakin@apple.com> Reviewed by John. Fix for <rdar://problem/4914258> REGRESSION: Search in Google now operates on the current WebView instead of invoking Safari's service * WebCoreSupport/WebContextMenuClient.h: * WebCoreSupport/WebContextMenuClient.mm: (WebContextMenuClient::searchWithGoogle): Call into WebView to search in Google. * WebView/WebViewInternal.h: Make _searchWithGoogleFromMenu available. 2007-01-09 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Rename the now ObjC++ files to be .mm and remove the explicit file types. * DOM/WebDOMOperations.m: Removed. * DefaultDelegates/WebDefaultContextMenuDelegate.m: Removed. * English.lproj/StringsNotToBeLocalized.txt: * Misc/WebCoreStatistics.m: Removed. * Misc/WebElementDictionary.m: Removed. * Misc/WebIconDatabase.m: Removed. * Misc/WebNSAttributedStringExtras.m: Removed. * Misc/WebNSPasteboardExtras.m: Removed. * Plugins/WebNetscapePluginEmbeddedView.m: Removed. * Plugins/WebNullPluginView.m: Removed. * Plugins/WebPluginContainerCheck.m: Removed. * WebCoreSupport/WebViewFactory.m: Removed. * WebKit.xcodeproj/project.pbxproj: * WebView/WebArchiver.m: Removed. * WebView/WebHTMLRepresentation.m: Removed. * WebView/WebHTMLView.m: Removed. * WebView/WebRenderNode.m: Removed. * WebView/WebResource.m: Removed. * WebView/WebScriptDebugDelegate.m: Removed. 2007-01-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - remove window display throttling code; no longer used * Misc/WebNSWindowExtras.h: * Misc/WebNSWindowExtras.m: * WebView/WebFrameView.mm: (-[WebFrameView initWithFrame:]): * WebView/WebPreferenceKeysPrivate.h: 2007-01-08 Anders Carlsson <acarlsson@apple.com> Reviewed by Brady. Remove bridge functions that are implemented directly in FrameLoader now. * WebCoreSupport/WebFrameBridge.mm: 2007-01-08 Sam Weinig <sam@webkit.org> Reviewed by Mark. Adds default value for outline-color and fixes default values of the recently fixed *-color properties. * WebInspector/webInspector/inspector.js: 2007-01-08 Beth Dakin <bdakin@apple.com> Reviewed by Adam. Fix for http://bugs.webkit.org/show_bug.cgi?id=12161 REGRESSION: Crash when control-clicking on an image for contextual menu * WebView/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): We need to nil-check coreMenu since it will be nil if the DOM popped up a menu instead. I cleaned up the function to make all the nil checks early returns instead of nesting all of the content. Also moved the autorelease to be with the creation of the menu instead of at the return. 2007-01-08 Sam Weinig <sam@webkit.org> Reviewed by Tim H. Adds default value for -webkit-box-shadow and fixes default value of -webkit-column-count to be "auto". Also sorts the list of defaults. * WebInspector/webInspector/inspector.js: 2007-01-08 Andrew Wellington <proton@wiretapped.net> Reviewed by Mark. * WebInspector/webInspector/inspector.js: Hide default values of -webkit-column styles in WebInspector. 2007-01-05 Darin Adler <darin@apple.com> Reviewed by Hyatt. * Misc/WebNSAttributedStringExtras.m: (+[NSAttributedString _web_attributedStringFromRange:]): Updated to use new list marker text API that is String rather than DeprecatedString. Also removed code to do text form of non-text list markers since the list marker class now deals with that. 2007-01-05 Anders Carlsson <acarlsson@apple.com> Reviewed by Darin. Fix build. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchCreatePage): 2007-01-05 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. The data returned is now a SharedBuffer so wrap it in an NSData object. * WebView/WebDataSource.mm: (-[WebDataSource data]): 2007-01-04 Adam Roben <aroben@apple.com> Reviewed by Geoff, cheered by others. Dead code elimination. * WebView/WebHTMLView.m: 2007-01-04 Adam Roben <aroben@apple.com> Boo on me for undoing Beth's hard work. * WebView/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): Undo a mistaken roll out of r18597. 2007-01-04 David Kilzer <ddkilzer@webkit.org> Reviewed by Brady. - fix http://bugs.webkit.org/show_bug.cgi?id=12111 Uninitialized variable in -[WebDefaultPolicyDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:] * DefaultDelegates/WebDefaultPolicyDelegate.m: Initialize isDirectory. 2007-01-04 Adam Roben <aroben@apple.com> Reviewed by Geoff. Remove WebKit/AppKit from handling tabbing between subframes. * WebCoreSupport/WebChromeClient.h: Added new ChromeClient methods for moving focus out of the WebView. * WebCoreSupport/WebChromeClient.mm: Ditto. (WebChromeClient::canTakeFocus): (WebChromeClient::takeFocus): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge webView]): Added null-check of m_frame. * WebView/WebHTMLView.m: Removed -[WebHTMLView nextValidKeyView]. (-[WebHTMLView _updateActiveState]): Changed to focus the frame if WebCore believes it to be the focused frame. (-[WebHTMLView becomeFirstResponder]): Rewrote to call into FocusController to place focus correctly within the WebView. 2007-01-04 Anders Carlsson <acarlsson@apple.com> Reviewed by Brady. FrameLoaderClient changed yet again. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache): (WebFrameLoaderClient::dispatchWillSendRequest): 2007-01-04 Anders Carlsson <acarlsson@apple.com> Reviewed by Adam. FrameLoaderClient changed again. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::download): (WebFrameLoaderClient::willUseArchive): 2007-01-04 Beth Dakin <bdakin@apple.com> Reviewed by Adam. No need to hit test twice. * WebView/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): 2007-01-04 Beth Dakin <bdakin@apple.com> Reviewed by Adam. Turn on WebCore context menus. Delete a bunch of WebKit context menu code that is no longer needed. * DefaultDelegates/WebDefaultContextMenuDelegate.m: Removed a lot of code from this class. This class only still needs to exist for PDF context menus, so we only need to deal with the menu items that might possibly be added to a PDF context menu. (-[WebDefaultUIDelegate menuItemWithTag:target:representedObject:]): Same. (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): Same. * WebCoreSupport/WebContextMenuClient.h: Name change and have the former getCustomMenuFromDefaultItems function return the PlatformMenuDescription since it feels funny to have the client set the new platform description. * WebCoreSupport/WebContextMenuClient.mm: Same. (WebContextMenuClient::getCustomMenuFromDefaultItems): Same. Also move in some code that used to be in _menuForElement. * WebView/WebHTMLView.m: Deleted a bunch of un-used functions (-[WebHTMLView menuForEvent:]): Turn on menus, and append the Inspect Element item. * WebView/WebHTMLViewPrivate.h: Deleted a bunch of un-used functions. * WebView/WebView.mm: (-[WebView _menuForElement:defaultItems:]): Removed a lot of code from _menuForElement that now makes more sense elsewhere. Only PDF context menus use this function now. Hopefully we can just get rid of it soon, too. 2007-01-04 Anders Carlsson <acarlsson@apple.com> Reviewed by Brady. Update for WebCore changes. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::download): (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache): (WebFrameLoaderClient::dispatchWillSendRequest): (WebFrameLoaderClient::dispatchDidReceiveResponse): (WebFrameLoaderClient::incrementProgress): 2007-01-04 Peter Kasting <pkasting@google.com> Reviewed by Alexey. http://bugs.webkit.org/show_bug.cgi?id=11900: Windows build bustage * COM/ChromeClientWin.cpp: (ChromeClientWin::addMessageToConsole): (ChromeClientWin::runBeforeUnloadConfirmPanel): * COM/ChromeClientWin.h: * COM/ContextMenuClientWin.cpp: (ContextMenuClientWin::contextMenuItemSelected): * COM/ContextMenuClientWin.h: * COM/WebFrameLoaderClient.cpp: (WebFrameLoaderClient::setDocumentViewFromPageCache): (WebFrameLoaderClient::forceLayout): (WebFrameLoaderClient::forceLayoutForNonHTML): (WebFrameLoaderClient::updateGlobalHistoryForStandardLoad): (WebFrameLoaderClient::updateGlobalHistoryForReload): (WebFrameLoaderClient::shouldGoToHistoryItem): (WebFrameLoaderClient::saveScrollPositionAndViewStateToItem): (WebFrameLoaderClient::restoreScrollPositionAndViewState): (WebFrameLoaderClient::provisionalLoadStarted): (WebFrameLoaderClient::saveDocumentViewToPageCache): (WebFrameLoaderClient::canCachePage): * COM/WebFrameLoaderClient.h: * WebKit.vcproj/WebKit.vcproj: 2007-01-03 John Sullivan <sullivan@apple.com> * WebView/WebPDFView.mm: (-[WebPDFView _openWithFinder:]): Tiger build fix: use [NSNumber initWithInt:] rather than the new [NSNumber initWithInteger:] 2007-01-03 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker - fixed <rdar://problem/4145714> WebKit's PDFView's "Open in Preview" puts the PDF in /tmp, both group and world-readable * WebView/WebPDFView.mm: (-[WebPDFView _openWithFinder:]): Make the file only readable by the current user 2007-01-03 Beth Dakin <bdakin@apple.com> Reviewed by John. Make localized strings for all of the context menu item titles that are accessible to WebCore. * English.lproj/Localizable.strings: * WebCoreSupport/WebViewFactory.m: (-[WebViewFactory contextMenuItemTagOpenLinkInNewWindow]): (-[WebViewFactory contextMenuItemTagDownloadLinkToDisk]): (-[WebViewFactory contextMenuItemTagCopyLinkToClipboard]): (-[WebViewFactory contextMenuItemTagOpenImageInNewWindow]): (-[WebViewFactory contextMenuItemTagDownloadImageToDisk]): (-[WebViewFactory contextMenuItemTagCopyImageToClipboard]): (-[WebViewFactory contextMenuItemTagOpenFrameInNewWindow]): (-[WebViewFactory contextMenuItemTagCopy]): (-[WebViewFactory contextMenuItemTagGoBack]): (-[WebViewFactory contextMenuItemTagGoForward]): (-[WebViewFactory contextMenuItemTagStop]): (-[WebViewFactory contextMenuItemTagReload]): (-[WebViewFactory contextMenuItemTagCut]): (-[WebViewFactory contextMenuItemTagPaste]): (-[WebViewFactory contextMenuItemTagNoGuessesFound]): (-[WebViewFactory contextMenuItemTagIgnoreSpelling]): (-[WebViewFactory contextMenuItemTagLearnSpelling]): (-[WebViewFactory contextMenuItemTagSearchInSpotlight]): (-[WebViewFactory contextMenuItemTagSearchWeb]): (-[WebViewFactory contextMenuItemTagLookUpInDictionary]): (-[WebViewFactory contextMenuItemTagOpenLink]): (-[WebViewFactory contextMenuItemTagIgnoreGrammar]): (-[WebViewFactory contextMenuItemTagSpellingMenu]): (-[WebViewFactory contextMenuItemTagShowSpellingPanel:]): (-[WebViewFactory contextMenuItemTagCheckSpelling]): (-[WebViewFactory contextMenuItemTagCheckSpellingWhileTyping]): (-[WebViewFactory contextMenuItemTagCheckGrammarWithSpelling]): (-[WebViewFactory contextMenuItemTagFontMenu]): (-[WebViewFactory contextMenuItemTagShowFonts]): (-[WebViewFactory contextMenuItemTagBold]): (-[WebViewFactory contextMenuItemTagItalic]): (-[WebViewFactory contextMenuItemTagUnderline]): (-[WebViewFactory contextMenuItemTagOutline]): (-[WebViewFactory contextMenuItemTagStyles]): (-[WebViewFactory contextMenuItemTagShowColors]): (-[WebViewFactory contextMenuItemTagSpeechMenu]): (-[WebViewFactory contextMenuItemTagStartSpeaking]): (-[WebViewFactory contextMenuItemTagStopSpeaking]): (-[WebViewFactory contextMenuItemTagWritingDirectionMenu]): (-[WebViewFactory contextMenuItemTagDefaultDirection]): (-[WebViewFactory contextMenuItemTagLeftToRight]): (-[WebViewFactory contextMenuItemTagRightToLeft]): 2007-01-03 Brady Eidson <beidson@apple.com> Reviewed by John Sullivan In the Bookmarks View/History View, favicon may be the incorrect size * History/WebHistoryItem.mm: (-[WebHistoryItem icon]): Call to the WebIconDatabase until a WebCore issue is resolved 2007-01-03 Adele Peterson <adele@apple.com> Reviewed by Darin. - Fix for <rdar://problem/4455147> Safari allows division slash character in URLs, which looks like slash character (not fixed by IDNScriptWhiteList.txt) * Misc/WebNSURLExtras.m: (allCharactersInIDNScriptWhiteList): Always disallow the division slash character. 2007-01-02 Brady Eidson <beidson@apple.com> Controversially reviewed by Tim H. and Maciej Fixes http://bugs.webkit.org/show_bug.cgi?id=12086, http://bugs.webkit.org/show_bug.cgi?id=12088, possibly http://bugs.webkit.org/show_bug.cgi?id=12087, and probably a slew of others WebHistoryItems returned from the WebBackForwardList accessors were being release/retained out-of-order by the Safari app. This bug never surfaced before because the WebBackForwardList had a retain on the item, preventing deallocation. Since the items are now just temporary wrappers, the list is no longer actually retaining them. This solution is to simulate the ownership with a [[id retain] autorelease] - gross, but maybe the only solution for now... =/ We can possibly consider reverting this fix at a later date - that task is marked by <rdar://problem/4905705> * History/WebBackForwardList.mm: (-[WebBackForwardList backItem]): (-[WebBackForwardList currentItem]): (-[WebBackForwardList forwardItem]): (-[WebBackForwardList itemAtIndex:]): 2007-01-02 Beth Dakin <bdakin@apple.com> Reviewed by Geoff. Remove un-used function. * WebCoreSupport/WebContextMenuClient.h: * WebCoreSupport/WebContextMenuClient.mm: 2007-01-02 Brady Eidson <beidson@apple.com> Reviewed extensively and repeatedly by Darin <rdar://problem/4887137> - WebCore Back/Forward Cache Most things not specifically commented on in the ChangeLog can be summed up as "Do things exactly the same way as we used to, but just stick in WebCore-land as much as possible" * History/WebBackForwardList.mm: (kitPrivate): Convenience functions to help with subbing "WebBackForwardListPrivate" for WebCore::BackForwardList (core): (backForwardListWrappers): A HashMap pattern used to map WebCore objects to their WebKit counterpart (kit): (+[WebBackForwardList setDefaultPageCacheSizeIfNecessary]): (-[WebBackForwardList initWithWebCoreBackForwardList:]): (-[WebBackForwardList init]): (-[WebBackForwardList dealloc]): (-[WebBackForwardList finalize]): (-[WebBackForwardList _close]): (-[WebBackForwardList addItem:]): (-[WebBackForwardList removeItem:]): (-[WebBackForwardList containsItem:]): (-[WebBackForwardList goBack]): (-[WebBackForwardList goForward]): (-[WebBackForwardList goToItem:]): (-[WebBackForwardList backItem]): (-[WebBackForwardList currentItem]): (-[WebBackForwardList forwardItem]): (vectorToNSArray): (-[WebBackForwardList backListWithLimit:]): (-[WebBackForwardList forwardListWithLimit:]): (-[WebBackForwardList capacity]): (-[WebBackForwardList setCapacity:]): (-[WebBackForwardList description]): (-[WebBackForwardList _clearPageCache]): (-[WebBackForwardList setPageCacheSize:]): (-[WebBackForwardList pageCacheSize]): (-[WebBackForwardList _usesPageCache]): (-[WebBackForwardList backListCount]): (-[WebBackForwardList forwardListCount]): (-[WebBackForwardList itemAtIndex:]): * History/WebBackForwardListInternal.h: Added. * History/WebHistory.m: Removed. * History/WebHistory.mm: Added - Needed to be .mm to accept C++ header style (-[_WebCoreHistoryProvider containsItemForURLLatin1:length:]): (-[_WebCoreHistoryProvider containsItemForURLUnicode:length:]): * History/WebHistoryItem.mm: (kitPrivate): Same pattern as WebBackForwardList (core): (historyItemWrappers): (WKNotifyHistoryItemChanged): (-[WebHistoryItem init]): (-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]): (-[WebHistoryItem dealloc]): (-[WebHistoryItem finalize]): (-[WebHistoryItem copyWithZone:]): (-[WebHistoryItem URLString]): (-[WebHistoryItem originalURLString]): (-[WebHistoryItem title]): (-[WebHistoryItem setAlternateTitle:]): (-[WebHistoryItem alternateTitle]): (-[WebHistoryItem icon]): (-[WebHistoryItem lastVisitedTimeInterval]): (-[WebHistoryItem hash]): (-[WebHistoryItem isEqual:]): (-[WebHistoryItem description]): (kit): (+[WebHistoryItem entryWithURL:]): (+[WebHistoryItem initWindowWatcherIfNecessary]): (-[WebHistoryItem initWithURL:target:parent:title:]): (-[WebHistoryItem initWithWebCoreHistoryItem:]): (-[WebHistoryItem setTitle:]): (-[WebHistoryItem setVisitCount:]): (-[WebHistoryItem setViewState:]): (-[WebHistoryItem _mergeAutoCompleteHints:]): (-[WebHistoryItem initFromDictionaryRepresentation:]): (-[WebHistoryItem scrollPoint]): (-[WebHistoryItem _transientPropertyForKey:]): (-[WebHistoryItem _setTransientProperty:forKey:]): (-[WebHistoryItem dictionaryRepresentation]): (-[WebHistoryItem target]): (-[WebHistoryItem isTargetItem]): (-[WebHistoryItem visitCount]): (-[WebHistoryItem RSSFeedReferrer]): (-[WebHistoryItem setRSSFeedReferrer:]): (-[WebHistoryItem children]): (-[WebHistoryItem setAlwaysAttemptToUsePageCache:]): (-[WebHistoryItem URL]): (-[WebHistoryItem _setLastVisitedTimeInterval:]): (-[WebHistoryItem _lastVisitedDate]): (-[WebHistoryItem targetItem]): (+[WebHistoryItem _releaseAllPendingPageCaches]): (-[WebWindowWatcher windowWillClose:]): * History/WebHistoryItemInternal.h: * History/WebHistoryItemPrivate.h: * WebCoreSupport/WebFrameBridge.mm: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::setDocumentViewFromPageCache): (WebFrameLoaderClient::detachedFromParent1): (WebFrameLoaderClient::loadedFromPageCache): (WebFrameLoaderClient::updateGlobalHistoryForStandardLoad): (WebFrameLoaderClient::updateGlobalHistoryForReload): (WebFrameLoaderClient::shouldGoToHistoryItem): (WebFrameLoaderClient::frameLoadCompleted): (WebFrameLoaderClient::saveScrollPositionAndViewStateToItem): (WebFrameLoaderClient::restoreScrollPositionAndViewState): (WebFrameLoaderClient::provisionalLoadStarted): (WebFrameLoaderClient::setTitle): (WebFrameLoaderClient::saveDocumentViewToPageCache): (WebFrameLoaderClient::canCachePage): * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.mm: * WebView/WebDataSourceInternal.h: * WebView/WebFrame.mm: (-[WebFramePrivate dealloc]): (-[WebFrame _canCachePage]): (-[WebFrame _loadURL:referrer:intoChild:]): * WebView/WebFrameInternal.h: * WebView/WebFrameView.mm: (-[WebFrameView initWithFrame:]): (-[WebFrameView keyDown:]): * WebView/WebHTMLView.m: (-[WebHTMLView closeIfNotCurrentView]): Added for a dirty hack in WebCore that is marked with a FIXME Radar * WebView/WebHTMLViewInternal.h: * WebView/WebView.mm: (-[WebViewPrivate init]): (-[WebViewPrivate dealloc]): (-[WebView _close]): (-[WebView _loadBackForwardListFromOtherView:]): (-[WebView _commonInitializationWithFrameName:groupName:]): (-[WebView initWithCoder:]): (-[WebView backForwardList]): (-[WebView goBack]): (-[WebView goForward]): (-[WebView goToBackForwardItem:]): (-[WebView canGoBack]): (-[WebView canGoForward]): 2007-01-02 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker - fixed <rdar://problem/4892525> Cannot open PDF in Preview if you attempted to open it in Preview while PDF was loading * WebView/WebPDFView.mm: (-[WebPDFView menuForEvent:]): added comment (-[WebPDFView validateUserInterfaceItem:]): disable this menu item when there's no document yet (-[WebPDFView _openWithFinder:]): If this is invoked when there is no document yet (e.g. via the PDFKit delegate method), just beep and return. I should make a nice error message here, but I'll do that separately. 2007-01-03 Nikolas Zimmermann <zimmermann@kde.org> Reviewed by Timothy. Fix inspection of RenderSVGInlineText objects (#text nodes in SVG documents). * WebInspector/WebInspector.m: (-[WebInspector _highlightNode:]): 2007-01-02 Beth Dakin <bdakin@apple.com> Reviewed by Darin. Fix bug with WebCore context menu item "Copy Image." * WebCoreSupport/WebContextMenuClient.mm: (WebContextMenuClient::copyImageToClipboard): We must call declareTypes on the pasteboard. 2006-12-27 Mitz Pettel <mitz@webkit.org> Reviewed by Geoff. - fix http://bugs.webkit.org/show_bug.cgi?id=9403 Red outline from Web Inspector appears above all other OS X windows Made the window containing the highlight a child window of the window containing the view. * WebInspector/WebNodeHighlight.m: (-[WebNodeHighlight initWithBounds:andRects:forView:]): (-[WebNodeHighlight dealloc]): (-[WebNodeHighlight expire]): 2006-12-27 Matt Lilek <pewtermoose@gmail.com> Reviewed by Tim H. Bug 11993: REGRESSION(r18320): Web Inspector scroll bars not drawn http://bugs.webkit.org/show_bug.cgi?id=11993 AppleVerticalScrollbar tries to set a NaN value as the scroll height which causes DOM Exceptions after r18320. This overrides the _setObjectLength method and checks for NaN until a system update can fix this. See rdar://4901491 * WebInspector/webInspector/inspector.html: * WebInspector/webInspector/inspector.js: 2006-12-27 Geoffrey Garen <ggaren@apple.com> Reviewed by Oliver Hunt. Fixed <rdar://problem/4901629> Crash occurs at WebCore::Frame::page() after closing window containing flash content No testcase because we can't open and close windows in DRT. I can't reproduce this crash, but from the backtrace it's clear that it occured because of a NULL frame object. Since it's valid for a frame to be NULL, I've added NULL checks. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView sendEvent:]): (-[WebBaseNetscapePluginView requestWithURLCString:]): (-[WebBaseNetscapePluginView getVariable:value:]): 2006-12-27 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler. Updated <rdar://problem/4871518> fix based on Darin's comments. Instead of searching the frame tree to retrieve the new frame, put it in a RefPtr, and then explicitly check for its removal. This option is slightly more efficient, and it avoids problems that can occur due to frame name collision. * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge createChildFrameNamed:withURL:referrer:ownerElement:allowsScrolling:marginWidth:marginHeight:]): 2006-12-26 Geoffrey Garen <ggaren@apple.com> Reviewed by Eric Seidel. Fixed <rdar://problem/4740328> Safari crash on quit in _NPN_ReleaseObject from KJS::Bindings::CInstance::~CInstance The essence of this change is that WebKit shouldn't meddle in plug-in lifetime, since WebCore already manages it. The rest is details. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView removeTrackingRect]): Autorelease our window instead of releasing it, since we might hold the last reference to our window, and releasing it immediately would crash AppKit. (-[WebBaseNetscapePluginView resetTrackingRect]): * Plugins/WebNetscapePluginEmbeddedView.h: * Plugins/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView dataSource]): Use our DOMElement to access our WebFrame, since we don't keep around a direct pointer to our WebFrame anymore. * Plugins/WebNullPluginView.h: * Plugins/WebNullPluginView.m: (-[WebNullPluginView initWithFrame:error:DOMElement:]): (-[WebNullPluginView dealloc]): (-[WebNullPluginView viewDidMoveToWindow]): Use our DOMElement to access our WebFrame, as above. * WebCoreSupport/WebFrameBridge.mm: Don't call _addPlugInView because it doesn't exist anymore. Do pass a DOMElement to WebNullPluginView's initializer, so it can access its frame like WebNetscapePluginEmbeddedView does. (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]): (-[WebFrameBridge viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:DOMElement:]): * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: Removed didCloseDocument. It had two purposes -- one unnecessary, one harmful: (1) NULL out plug-ins' weak references to their frames. Unnecessary. Having plug-ins access their frames through their DOM elements solves this problem. (2) Unload plug-ins. Harmful. If a plug-in unloads before WebCore is done with it, WebCore will access unmapped memory. Also unnecessary. WebCore Widgets take care of calling -removeFromSuperview on their NSViews, which is sufficient for stopping plug-ins. * WebKit.xcodeproj/project.pbxproj: Made WebNullPluginView.m ObjC++. * WebView/WebFrame.mm: Removed _addPlugInView, since it was only used to call -setWebFrame, which is gone. (-[WebFramePrivate dealloc]): * WebView/WebFrameInternal.h: Removed plugInViews, since it was only used by _addPlugInView, which is gone. 2006-12-26 Geoffrey Garen <ggaren@apple.com> Reviewed by Eric Seidel. Some cleanup in preparation for fixing <rdar://problem/4740328> Safari crash on quit in _NPN_ReleaseObject from KJS::Bindings::CInstance::~CInstance Renamed "installedPlugins" to "sharedDatabase." This better follows the Cocoa naming scheme, and calls out the key attribute that produced this crash -- namely, that the database is shared throughout the process. -installedPlugins is actually a part of SPI, but a global search showed that it had no users. * Plugins/WebPluginDatabase.h: * Plugins/WebPluginDatabase.m: (+[WebPluginDatabase sharedDatabase]): (-[WebPluginDatabase refresh]): (-[WebPluginDatabase _plugInPaths]): (-[WebPluginDatabase _removePlugin:]): * WebCoreSupport/WebViewFactory.m: (-[WebViewFactory pluginsInfo]): (-[WebViewFactory refreshPlugins:]): (-[WebViewFactory pluginSupportsMIMEType:]): * WebView/WebView.mm: (+[WebView _supportedMIMETypes]): (+[WebView _viewClass:andRepresentationClass:forMIMEType:]): (-[WebView _close]): (-[WebView _pluginForMIMEType:]): (-[WebView _pluginForExtension:]): (-[WebView _isMIMETypeRegisteredAsPlugin:]): 2006-12-25 Geoffrey Garen <ggaren@apple.com> Reviewed by Adam Roben. Fixed <rdar://problem/4778898> REGRESSION: crash in getInstanceForView() when quitting from kcbs.com No testcase because we can't open and close windows in DRT. The crash was caused by deallocating plug-ins that were later referenced in the unload event handler. * Plugins/WebBaseNetscapePluginView.mm: Don't call stop on ourselves because we may destroy our plugin before the unload handler fires. Also, we don't need to, since didCloseDocument will do it for us. (-[WebBaseNetscapePluginView addWindowObservers]): We don't need to listen for windowWillClose anymore, since we don't want to call -stop on ourselves. (-[WebBaseNetscapePluginView removeWindowObservers]): ditto. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::didCloseDocument): Renamed from "willCloseDocument." 2006-12-25 Geoffrey Garen <ggaren@apple.com> More "plugin" => "pluginPackage" renaming that I forgot to check in. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView setPluginPackage:]): * Plugins/WebNetscapePluginEmbeddedView.h: * Plugins/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]): (-[WebFrameBridge viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:DOMElement:]): 2006-12-25 Geoffrey Garen <ggaren@apple.com> Reviewed by Eric Seidel. Fixed crash when opening view source window. * WebView/WebView.mm: (-[WebView initWithCoder:]): Don't use the WebView until calling _commonInitialization... 2006-12-25 Geoffrey Garen <ggaren@apple.com> Reviewed by Oliver Hunt. Removed WebCoreSettings, cleaned up WebCore::Settings. * WebView/WebFrame.mm: Added helper functions for converting between WebKitEditableLinkBehavior and WebCore::EditableLinkBehavior. I'm not sure that this is the best place for these functions, but it's where all the other functions like them reside. (core): (kit): * WebView/WebFrameInternal.h: * WebView/WebView.mm: Removed uses of WebCoreSettings. Replaced with direct use of underlying page's settings. 2006-12-25 Geoffrey Garen <ggaren@apple.com> Reviewed by Oliver Hunt. Some refactoring in preparation for fixing <rdar://problem/4778898> REGRESSION: crash in getInstanceForView() when quitting from kcbs.com Two renames: - "plugin" => "pluginPackage" (since the type is WebNetscapePluginPackage *) - "instance" and/or "pluginPointer" => plugin (since NPP is an opaque handle to a plug-in) Removed braces around single-line 'if' statements. Made plugin a pointer instead of an inline ivar. This allows us to NULL it out once we call NPP_Destroy on it. Added helper functions for creating and destroying plugin. The destroy function NULLs out plugin, which helps with debugging. (-[WebBaseNetscapePluginView willCallPlugInFunction]): Added an ASSERT to catch attempts to call functions on destroyed plug-ins. (-[WebBaseNetscapePluginView _createPlugin]): New helper function. (-[WebBaseNetscapePluginView _destroyPlugin]): New helper function. 2006-12-24 David Kilzer <ddkilzer@webkit.org> Removed empty directory. * WebKit/Loader: Removed. 2006-12-22 Geoffrey Garen <ggaren@apple.com> Reviewed by Brady Eidson. Fixed <rdar://problem/4871518> Leopard9A321: Crash visiting www.audible.com (WebCore::FrameLoader::loadSubframe) * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge createChildFrameNamed:withURL:referrer:ownerElement:allowsScrolling:marginWidth:marginHeight:]): - The fix: Changed to re-fetch the child frame we're trying to load before returning it, since its onload handler may have removed it from the document. This allows us to treat a removed frame like a frame that never loaded. - Plus some cleanup: - Changed to return a WebCore::Frame* instead of a WebFrameBridge *, to simplify some code. - Grouped ObjC objects by usage, and moved calls to -release so that they immediately follow the calls that retain. 2006-12-21 John Sullivan <sullivan@apple.com> Reviewed by Geoff Garen - improved concept and implementation of my previous checkin after discussing with Darin * WebView/WebViewPrivate.h: * WebView/WebView.mm: (-[WebView setHoverFeedbackSuspended:]): renamed from setIgnoresMouseMovedEvents, and now tells the main WebHTMLView (if any) that this state has changed. Telling just the main WebHTMLView is a bit of an implementation hack. Hopefully someday we can rework the document architecture and make this kind of thing less hacky (but this is following existing customs, so I don't feel too bad) (-[WebView isHoverFeedbackSuspended]): renamed from ignoresMouseMovedEvents * WebView/WebHTMLViewInternal.h: declare _hoverFeedbackSuspendedChanged * WebView/WebHTMLView.m: (-[WebHTMLView _updateMouseoverWithEvent:]): test the webView's state of the hit-tested WebHTMLView rather than self (-[WebHTMLView _hoverFeedbackSuspendedChanged]): generate a fake mouse-moved event, which simulates the mouse moving away from the current element or back over it 2006-12-21 Darin Adler <darin@apple.com> Reviewed by Oliver. * WebInspector/webInspector/inspector.js: Added default values for the new CSS properties so they don't appear in the inspector when their values are uninteresting. 2006-12-21 John Sullivan <sullivan@apple.com> Reviewed by Geoff Garen - added WebKit support for making a web page temporarily ignore mouse movements * WebView/WebViewPrivate.h: declare ignoresMouseMovedEvents and setIgnoresMouseMovedEvents: * WebView/WebView.mm: added ignoresMouseMovedEvents boolean field to _private data structure (-[WebView setIgnoresMouseMovedEvents:]): set new boolean field (-[WebView ignoresMouseMovedEvents]): return new boolean field * WebView/WebHTMLView.m: (-[WebHTMLView _updateMouseoverWithEvent:]): bail out right away if [[self _webView] ignoresMouseMovedEvents] 2006-12-21 Mark Rowe <bdash@webkit.org> Reviewed by Geoff. http://bugs.webkit.org/show_bug.cgi?id=11888 Bug 11888: REGRESSION (r18320): Web Inspector panes broken * WebInspector/webInspector/inspector.js: Use removeProperty to reset a style property to its initial value. Bail out early from updateNodePane if Inspector has not yet been set. 2006-12-19 John Sullivan <sullivan@apple.com> Reviewed by Darin - fix for unrepro infinite recursion bug: <rdar://problem/4448181> CrashTracer: 154 crashes in Safari at com.apple.AppKit: -[NSView isDescendantOf:] + 24; infinite recursion in makeFirstResponder logic * WebView/WebView.mm: added becomingFirstResponder BOOL to private struct (-[WebView becomeFirstResponder]): use _private->becomingFirstResponder to guard against infinite recursion; complain on debug builds if we run into this problem 2006-12-19 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/4891774> Local WebCore/WebBrowser builds fail in 9A328 due to warning about ObjC-2.0 language features * WebKit.xcodeproj/project.pbxproj: 2006-12-18 Ada Chan <adachan@apple.com> Reviewed by Adam. Moved canRunBeforeUnloadConfirmPanel, runBeforeUnloadConfirmPanel, and closeWindowSoon from WebCoreFrameBridge to Chrome. * COM/ChromeClientWin.cpp: (ChromeClientWin::canRunBeforeUnloadConfirmPanel): (ChromeClientWin::runBeforeUnloadConfirmPanel): (ChromeClientWin::closeWindowSoon): * COM/ChromeClientWin.h: * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::canRunBeforeUnloadConfirmPanel): (WebChromeClient::runBeforeUnloadConfirmPanel): (WebChromeClient::closeWindowSoon): * WebCoreSupport/WebFrameBridge.mm: 2006-12-18 Alice Liu <alice.liu@apple.com> Reviewed by Adam. Have the Editor handle deletion instead of WebHTMLView * WebKitPrefix.h: Turned on WebCore deletion * WebView/WebHTMLViewInternal.h: Moved ownership of startNewKillRingSequence to the WebCore::Editor * WebView/WebHTMLView.m: (-[NSArray becomeFirstResponder]): Use the Editor's startNewKillRingSequence flag (-[NSArray deleteForward:]): (-[NSArray deleteBackward:]): (-[NSArray deleteWordForward:]): (-[NSArray deleteWordBackward:]): (-[NSArray deleteToBeginningOfLine:]): (-[NSArray deleteToEndOfLine:]): (-[NSArray deleteToBeginningOfParagraph:]): (-[NSArray deleteToEndOfParagraph:]): (-[NSArray deleteToMark:]): use Editor::deleteWithDirection instead of WebHTMLView's 2006-12-16 Adele Peterson <adele@apple.com> Reviewed by Adam. WebKit part of fix for: <rdar://problem/4463829> Switch to use new search field implementation for <input type="search"> * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Initialize WKDrawTextFieldCellFocusRing. * WebInspector/webInspector/inspector.css: Set -webkit-user-select:text and text-shadow:none on the search field. These are both properties that we didn't honor in the old control, and the inherited values didn't work or look right. 2006-12-16 Beth Dakin <bdakin@apple.com> Reviewed by Adam. WebKit side of making WebCore context menus support state and enabled/disabled. * WebCoreSupport/WebContextMenuClient.h: contextMenuItemSelected takes a pointer to the parentMenu now since menu items no longer hold onto it. * WebCoreSupport/WebContextMenuClient.mm: Same. (WebContextMenuClient::contextMenuItemSelected): Same. * WebView/WebHTMLView.m: Must call setAutoenablesItems:NO on our menu. (-[NSArray menuForEvent:]): * WebView/WebUIDelegatePrivate.h: No need for if-def. 2006-12-15 Anders Carlsson <acarlsson@apple.com> Reviewed by Geoff. Update for WebCore changes. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchIdentifierForInitialRequest): * WebView/WebDataSource.mm: (-[WebDataSource response]): 2006-12-15 Anders Carlsson <acarlsson@apple.com> Reviewed by Darin. Update for WebCore changes. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::willUseArchive): * WebView/WebDataSource.mm: (-[WebDataSource _URLForHistory]): 2006-12-15 Marvin Decker <marv.decker@gmail.com> Reviewed by Darin and Alexey. Fix the Windows build, move various Client implementations out of WebCore and into WebKit. * COM/ChromeClientWin.cpp: Added. (ChromeClientWin::~ChromeClientWin): (ChromeClientWin::chromeDestroyed): (ChromeClientWin::setWindowRect): (ChromeClientWin::windowRect): (ChromeClientWin::pageRect): (ChromeClientWin::scaleFactor): (ChromeClientWin::focus): (ChromeClientWin::unfocus): (ChromeClientWin::createWindow): (ChromeClientWin::createModalDialog): (ChromeClientWin::show): (ChromeClientWin::canRunModal): (ChromeClientWin::runModal): (ChromeClientWin::setToolbarsVisible): (ChromeClientWin::toolbarsVisible): (ChromeClientWin::setStatusbarVisible): (ChromeClientWin::statusbarVisible): (ChromeClientWin::setScrollbarsVisible): (ChromeClientWin::scrollbarsVisible): (ChromeClientWin::setMenubarVisible): (ChromeClientWin::menubarVisible): (ChromeClientWin::setResizable): (ChromeClientWin::addMessageToConsole): * COM/ChromeClientWin.h: Added. * COM/ContextMenuClientWin.cpp: Added. (ContextMenuClientWin::~ContextMenuClientWin): (ContextMenuClientWin::contextMenuDestroyed): (ContextMenuClientWin::addCustomContextMenuItems): (ContextMenuClientWin::contextMenuItemSelected): (ContextMenuClientWin::copyLinkToClipboard): (ContextMenuClientWin::downloadURL): (ContextMenuClientWin::copyImageToClipboard): (ContextMenuClientWin::lookUpInDictionary): (ContextMenuClientWin::speak): (ContextMenuClientWin::stopSpeaking): * COM/ContextMenuClientWin.h: Added. * COM/EditorClientWin.cpp: Added. (EditorClientWin::~EditorClientWin): (EditorClientWin::pageDestroyed): (EditorClientWin::shouldDeleteRange): (EditorClientWin::shouldShowDeleteInterface): (EditorClientWin::smartInsertDeleteEnabled): (EditorClientWin::isContinuousSpellCheckingEnabled): (EditorClientWin::toggleContinuousSpellChecking): (EditorClientWin::isGrammarCheckingEnabled): (EditorClientWin::toggleGrammarChecking): (EditorClientWin::spellCheckerDocumentTag): (EditorClientWin::selectWordBeforeMenuEvent): (EditorClientWin::isEditable): (EditorClientWin::shouldBeginEditing): (EditorClientWin::shouldEndEditing): (EditorClientWin::shouldInsertNode): (EditorClientWin::shouldInsertText): (EditorClientWin::shouldApplyStyle): (EditorClientWin::didBeginEditing): (EditorClientWin::respondToChangedContents): (EditorClientWin::didEndEditing): (EditorClientWin::registerCommandForUndo): (EditorClientWin::registerCommandForRedo): (EditorClientWin::clearUndoRedoOperations): (EditorClientWin::canUndo): (EditorClientWin::canRedo): (EditorClientWin::undo): (EditorClientWin::redo): * COM/EditorClientWin.h: Added. * COM/WebFrame.cpp: (WebFrame::WebFrame): (WebFrame::initWithName): * COM/WebFrame.h: * COM/WebFrameLoaderClient.cpp: Added. (WebFrameLoaderClient::WebFrameLoaderClient): (WebFrameLoaderClient::~WebFrameLoaderClient): (WebFrameLoaderClient::frameLoaderDestroyed): (WebFrameLoaderClient::hasWebView): (WebFrameLoaderClient::hasFrameView): (WebFrameLoaderClient::hasBackForwardList): (WebFrameLoaderClient::resetBackForwardList): (WebFrameLoaderClient::provisionalItemIsTarget): (WebFrameLoaderClient::loadProvisionalItemFromPageCache): (WebFrameLoaderClient::invalidateCurrentItemPageCache): (WebFrameLoaderClient::privateBrowsingEnabled): (WebFrameLoaderClient::makeDocumentView): (WebFrameLoaderClient::makeRepresentation): (WebFrameLoaderClient::forceLayout): (WebFrameLoaderClient::forceLayoutForNonHTML): (WebFrameLoaderClient::updateHistoryForCommit): (WebFrameLoaderClient::updateHistoryForBackForwardNavigation): (WebFrameLoaderClient::updateHistoryForReload): (WebFrameLoaderClient::updateHistoryForStandardLoad): (WebFrameLoaderClient::updateHistoryForInternalLoad): (WebFrameLoaderClient::updateHistoryAfterClientRedirect): (WebFrameLoaderClient::setCopiesOnScroll): (WebFrameLoaderClient::tokenForLoadErrorReset): (WebFrameLoaderClient::resetAfterLoadError): (WebFrameLoaderClient::doNotResetAfterLoadError): (WebFrameLoaderClient::willCloseDocument): (WebFrameLoaderClient::detachedFromParent1): (WebFrameLoaderClient::detachedFromParent2): (WebFrameLoaderClient::detachedFromParent3): (WebFrameLoaderClient::detachedFromParent4): (WebFrameLoaderClient::loadedFromPageCache): (WebFrameLoaderClient::dispatchDidHandleOnloadEvents): (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebFrameLoaderClient::dispatchDidCancelClientRedirect): (WebFrameLoaderClient::dispatchWillPerformClientRedirect): (WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): (WebFrameLoaderClient::dispatchWillClose): (WebFrameLoaderClient::dispatchDidReceiveIcon): (WebFrameLoaderClient::dispatchDidStartProvisionalLoad): (WebFrameLoaderClient::dispatchDidReceiveTitle): (WebFrameLoaderClient::dispatchDidCommitLoad): (WebFrameLoaderClient::dispatchDidFinishLoad): (WebFrameLoaderClient::dispatchDidFirstLayout): (WebFrameLoaderClient::dispatchShow): (WebFrameLoaderClient::cancelPolicyCheck): (WebFrameLoaderClient::dispatchWillSubmitForm): (WebFrameLoaderClient::dispatchDidLoadMainResource): (WebFrameLoaderClient::clearLoadingFromPageCache): (WebFrameLoaderClient::isLoadingFromPageCache): (WebFrameLoaderClient::revertToProvisionalState): (WebFrameLoaderClient::clearUnarchivingState): (WebFrameLoaderClient::progressStarted): (WebFrameLoaderClient::progressCompleted): (WebFrameLoaderClient::setMainFrameDocumentReady): (WebFrameLoaderClient::willChangeTitle): (WebFrameLoaderClient::didChangeTitle): (WebFrameLoaderClient::finishedLoading): (WebFrameLoaderClient::finalSetupForReplace): (WebFrameLoaderClient::setDefersLoading): (WebFrameLoaderClient::isArchiveLoadPending): (WebFrameLoaderClient::cancelPendingArchiveLoad): (WebFrameLoaderClient::clearArchivedResources): (WebFrameLoaderClient::canHandleRequest): (WebFrameLoaderClient::canShowMIMEType): (WebFrameLoaderClient::representationExistsForURLScheme): (WebFrameLoaderClient::generatedMIMETypeForURLScheme): (WebFrameLoaderClient::frameLoadCompleted): (WebFrameLoaderClient::restoreScrollPositionAndViewState): (WebFrameLoaderClient::provisionalLoadStarted): (WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent): (WebFrameLoaderClient::addHistoryItemForFragmentScroll): (WebFrameLoaderClient::didFinishLoad): (WebFrameLoaderClient::prepareForDataSourceReplacement): (WebFrameLoaderClient::setTitle): (WebFrameLoaderClient::userAgent): * COM/WebFrameLoaderClient.h: Added. * COM/WebKitDLL.h: * WebKit.vcproj/WebKit.vcproj: 2006-12-15 Anders Carlsson <acarlsson@apple.com> Reviewed by Darin. Include ResourceError.h. * Plugins/WebNetscapePluginStream.mm: * WebKit.xcodeproj/project.pbxproj: 2006-12-14 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. Update for WebCore changes. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::incrementProgress): (WebFrameLoaderClient::committedLoad): (WebFrameLoaderClient::deliverArchivedResources): * WebView/WebView.mm: (-[WebView _incrementProgressForIdentifier:length:]): * WebView/WebViewInternal.h: 2006-12-14 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/4827549> need NSRange-based selection support exposed. * WebView/WebFrame.mm: (-[WebFrame _selectedNSRange]): (-[WebFrame _selectNSRange:]): * WebView/WebFramePrivate.h: 2006-12-14 Anders Carlsson <acarlsson@apple.com> Reviewed by John. Update for WebCore changes. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidFailLoading): (WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebFrameLoaderClient::dispatchDidFailLoad): (WebFrameLoaderClient::dispatchUnableToImplementPolicy): (WebFrameLoaderClient::setMainDocumentError): (WebFrameLoaderClient::cancelledError): (WebFrameLoaderClient::cannotShowURLError): (WebFrameLoaderClient::interruptForPolicyChangeError): (WebFrameLoaderClient::cannotShowMIMETypeError): (WebFrameLoaderClient::fileDoesNotExistError): (WebFrameLoaderClient::shouldFallBack): 2006-12-13 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - adjusted for changes from NSURLRequest to ResourceRequest * Plugins/WebPluginController.mm: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::updateHistoryForReload): (WebFrameLoaderClient::dispatchIdentifierForInitialRequest): (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType): (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): (WebFrameLoaderClient::startDownload): (WebFrameLoaderClient::cannotShowURLError): (WebFrameLoaderClient::createDocumentLoader): * WebView/WebDataSource.mm: (-[WebDataSource _initWithDocumentLoader:]): (-[WebDataSource initialRequest]): (-[WebDataSource request]): * WebView/WebDocumentLoaderMac.h: * WebView/WebDocumentLoaderMac.mm: (WebDocumentLoaderMac::WebDocumentLoaderMac): * WebView/WebFrame.mm: (-[WebFrame _createItem:]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame loadArchive:]): 2006-12-12 Anders Carlsson <acarlsson@apple.com> Reviewed by Darin. * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::download): Get the handle and proxy from the ResourceHandle now that they aren't passed to us. 2006-12-11 Darin Adler <darin@apple.com> Reviewed by Brady. - did some of the Mac-specific file moves mentioned in my recent mail to the WebKit list * WebCoreSupport/WebFrameBridge.h: Updated for change to WebCoreKeyboardAccess. * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge _retrieveKeyboardUIModeFromPreferences:]): Ditto. (-[WebFrameBridge keyboardUIMode]): Ditto. 2006-12-11 Beth Dakin <bdakin@apple.com> Reviewed by Adam. WebKit support for editing sub-menu actions. * WebCoreSupport/WebContextMenuClient.h: New functions for the speech sub-menu. * WebCoreSupport/WebContextMenuClient.mm: (WebContextMenuClient::speak): (WebContextMenuClient::stopSpeaking): * WebCoreSupport/WebEditorClient.h: New functions to toggle spelling/grammar checking. * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::toggleContinuousSpellChecking): (WebEditorClient::toggleGrammarChecking): * WebView/WebUIDelegatePrivate.h: Re-named some of the spelling sub-menu tags. 2006-12-11 Alice Liu <alice.liu@apple.com> Reviewed by Geoff, Adam. switch to use the Editor for copying URLs * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate copyLinkToClipboard:]): Call down to the editor for this. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Add some calls necessary for Pasteboard::writeURL to work 2006-12-11 Darin Adler <darin@apple.com> Reviewed by Brady. - http://bugs.webkit.org/show_bug.cgi?id=11794 fix lifetime problems affecting Frame's ownerElement pointer * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge finishInitializingWithPage:WebCore::frameName:frameView:ownerElement:]): (-[WebFrameBridge initSubframeWithOwnerElement:frameName:frameView:]): (-[WebFrameBridge createChildFrameNamed:withURL:referrer:ownerElement:allowsScrolling:marginWidth:marginHeight:]): Use HTMLFrameOwnerElement. * WebCoreSupport/WebFrameLoaderClient.mm: Include the relevant headers for the HTMLFormElement class. * WebKit.xcodeproj/project.pbxproj: Let Xcode have its way. * WebView/WebFrame.mm: (-[WebFrame frameElement]): Update includes and types for the change in return type of ownerElement. 2006-12-11 David Harrison <harrison@apple.com> Fix previous checkin where I committed the wrong file. <rdar://problem/4863611> Xyle Scope crashes at launch due to WebCore-521.29.3 * WebView/WebFrame.mm: (-[WebFrame frameElement]): Add nil check. * WebView/WebPreferences.m: (-[WebPreferences editableLinkBehavior]): Reverted to previous. 2006-12-08 David Hyatt <hyatt@apple.com> Land new ICU abstraction layer. Patch by Lars. Reviewed by me * ForwardingHeaders/wtf/icu/UnicodeIcu.h: Added. * ForwardingHeaders/wtf/unicode/Unicode.h: Added. * WebKit.xcodeproj/project.pbxproj: === Safari-521.32 === 2006-12-08 Timothy Hatcher <timothy@apple.com> Rolling out a change that broke Mail stationary. <rdar://problem/4699166> REGRESSION: Background images in Mail stationery do not load * WebView/WebUnarchivingState.m: (-[WebUnarchivingState archivedResourceForURL:]): 2006-12-08 Peter Kasting <pkasting@google.com> Reviewed and landed by Alexey. http://bugs.webkit.org/show_bug.cgi?id=11759: Windows build bustage * COM/WebFrame.cpp: (WebFrame::loadDataSource): * COM/WebFrame.h: 2006-12-08 David Harrison <harrison@apple.com> Reviewed by Brady. <rdar://problem/4863611> Xyle Scope crashes at launch due to WebCore-521.29.3 * WebView/WebPreferences.m: (-[WebPreferences editableLinkBehavior]): Add nil check. 2006-12-07 Beth Dakin <bdakin@apple.com> Reviewed by Brady. Build fix for WebCore ContextMenus. It got broken by r18046. * WebView/WebHTMLView.m: (-[NSArray menuForEvent:]): 2006-12-07 Beth Dakin <bdakin@apple.com> Reviewed by Brady. Make some parameters const and const references. * WebCoreSupport/WebContextMenuClient.h: * WebCoreSupport/WebContextMenuClient.mm: (WebContextMenuClient::contextMenuItemSelected): (WebContextMenuClient::copyLinkToClipboard): (WebContextMenuClient::downloadURL): (WebContextMenuClient::copyImageToClipboard): 2006-12-06 Brady Eidson <beidson@apple.com> Reviewed by John Sullivan Fixes http://bugs.webkit.org/show_bug.cgi?id=11675 and <rdar://4857669> Now we need to explicitly set the data source when loading from a page cache * History/WebHistoryItem.mm: (-[WebHistoryItem _scheduleRelease]): Enhanced a logging message (+[WebHistoryItem _releasePageCache:]): Ditto (+[WebHistoryItem _releaseAllPendingPageCaches]): Ditto * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::setDocumentViewFromPageCache): Reset the View's DataSource from the cache, effectively reopening it * WebView/WebHTMLView.m: (-[NSArray setDataSource:]): Properly Handle resetting the DataSource and "reopening" the view 2006-12-06 Brady Eidson <beidson@apple.com> Reviewed by Adam and Oliver While working on http://bugs.webkit.org/show_bug.cgi?id=11675 I decided to fix much of the null-deref problems that creeped in via the loader refactoring. This isn't changing behavior, just reintroducing the free nil checking we used to have with pure ObjC * WebView/WebHTMLView.m: (-[NSArray menuForEvent:]): Explicitly check for null frames (-[NSArray mouseDown:]): Ditto (-[NSArray mouseDragged:]): Ditto (-[NSArray mouseUp:]): Ditto (-[NSArray performKeyEquivalent:]): Ditto (-[WebHTMLView elementAtPoint:allowShadowContent:]): Ditto 2006-12-05 John Sullivan <sullivan@apple.com> Reviewed by Beth Updated to match Frame -> Editor changes in WebCore * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate editingContextMenuItemsForElement:defaultMenuItems:]): guessesForUngrammaticalSelection() is now in Editor * WebView/WebHTMLView.m: (-[WebHTMLView _isSelectionUngrammatical]): isSelectionUngrammatical() is now in Editor (-[WebHTMLView _isSelectionMisspelled]): isSelectionMisspelled() is now in Editor (-[WebHTMLView checkSpelling:]): advanceToNextMisspelling() is now in Editor (-[WebHTMLView showGuessPanel:]): ditto 2006-12-05 John Sullivan <sullivan@apple.com> Reviewed by Adam Old context-menu mechanism fix for: <rdar://problem/4864351> Should leave out "No Guesses Found" from context menu for bad grammar * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate editingContextMenuItemsForElement:defaultMenuItems:]): Leave out "No Guesses Found" and separator for grammar-checking case. 2006-12-05 John Sullivan <sullivan@apple.com> build fix * WebView/WebViewPrivate.h: * WebView/WebView.mm: (-[WebView isGrammarCheckingEnabled]): define isGrammarCheckingEnabled whether on Tiger or not (just return NO on Tiger) 2006-12-04 John Sullivan <sullivan@apple.com> Reviewed by Darin WebKit part of fix for: <rdar://problem/4817188> Context menu for bad grammar should include suggestions and "Ignore Grammar" The context menu mechanism is currently in flux; the old mechanism is still in place, but an up-and-coming new mechanism is waiting in the wings. I updated both of them, but couldn't test the new mechanism because it doesn't work well enough yet. Most of this WebKit code can be deleted when the new mechanism is in place. * WebView/WebUIDelegatePrivate.h: added WebMenuItemTagIgnoreGrammar * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate menuItemWithTag:target:representedObject:]): added case for WebMenuItemTagIgnoreGrammar (-[WebDefaultUIDelegate editingContextMenuItemsForElement:defaultMenuItems:]): now considers adding grammar-related items as well as spelling-related items * WebView/WebHTMLViewPrivate.h: declared _isSelectionUngrammatical * WebView/WebHTMLView.m: (-[WebHTMLView _isSelectionUngrammatical]): new method, calls through to WebCore (-[WebHTMLView _ignoreGrammarFromMenu:]): new method, calls _ignoreSpellingFromMenu: since NSSpellChecker has one method for both * English.lproj/Localizable.strings: updated for "Ignore Grammar" menu item title 2006-12-04 Darin Adler <darin@apple.com> Reviewed by Adele. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::actionDictionary): Changed to use the new findEventWithKeyState function in WebCore instead of a local function in this file. 2006-12-04 Geoffrey Garen <ggaren@apple.com> Rolled out the WebDashboardBehaviorUseBackwardCompatibilityModeEnabled part of my last checkin. We have to turn on support for backward compatibility mode to avoid Dashboard regressions in the short term. * WebView/WebView.mm: (-[WebView _setDashboardBehavior:to:]): 2006-12-02 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin Adler. Added SPI for enabling Dashboard backward compatibility mode. For now, we enable it unconditionally for Dashboard and Dashcode. Once they implement specific support for the backward compatibility mode behavior, we can change that. Set the default WebDashboardBehaviorUseBackwardCompatibilityModeEnabled to YES in order to turn this code on. * WebView/WebView.mm: (-[WebView _setDashboardBehavior:to:]): (-[WebView _dashboardBehavior:]): * WebView/WebViewPrivate.h: 2006-12-04 Darin Adler <darin@apple.com> Reviewed by Alice. * WebCoreSupport/WebEditorClient.h: Removed "_web_" prefix from C++ userVisibleString member function. * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::userVisibleString): Ditto. * WebView/WebView.mm: (-[WebView selectedFrame]): Removed extra return statement. 2006-12-04 Peter Kasting <pkasting@google.com> Reviewed and landed by Alexey. http://bugs.webkit.org/show_bug.cgi?id=11738: Make link clicking work again on Windows. The WebKit changes are to ignore WM_MOUSEMOVED messages when the mouse hasn't actually moved, which were preventing clicks from actually getting dispatched in many cases. It's a peculiarity of Windows mouse handling that we receive these at all. * COM/WebView.cpp: (WebView::WebView): (WebView::mouseMoved): * COM/WebView.h: 2006-12-04 John Sullivan <sullivan@apple.com> Reviewed by Anders - fixed <rdar://problem/4857833> REGRESSION: When ctrl-clicking on a misspelled word, "Ignore Spelling" and "Learn Spelling" menu items not displayed in the contextual menu * WebView/WebHTMLView.m: (-[WebHTMLView _isSelectionMisspelled]): We were computing isSelectionMisspelled by calling WebCore, but then ignoring the result and always returning NO. D'oh! 2006-12-01 Beth Dakin <bdakin@apple.com> Reviewed by Adam. Changes to support sub-menus in WebCore ContextMenus. * WebCoreSupport/WebContextMenuClient.mm: (WebContextMenuClient::contextMenuItemSelected): ContextMenuItem::menu() is now called parentMenu() * WebView/WebUIDelegatePrivate.h: New not-yet-API tags. 2006-12-01 Darin Adler <darin@apple.com> Reviewed by Mitz. - fix http://bugs.webkit.org/show_bug.cgi?id=11628 REGRESSION (r17597): Command-return in native text fields doesn't open a new tab or window * WebCoreSupport/WebFrameLoaderClient.mm: (findKeyStateEvent): Added. Helper that finds the mouse or keyboard event in a chain of events and their underlying events. (findMouseEvent): Added. Same, but specifically for mouse events. (WebFrameLoaderClient::actionDictionary): Rewrote to use the above functions. This means we use the modifiers from the underlying events rather than just the one from the event itself. So if the event is a DOM activate event, we can still see the modifiers from the original keyboard event that triggered it. Has no effect if the event is already the right type or if there is no underlying event. * WebView/WebFrame.mm: Added a newly-needed include. * WebKit.xcodeproj/project.pbxproj: Xcode wants what it wants. 2006-12-01 Peter Kasting <pkasting@google.com> Reviewed by Mitz. http://bugs.webkit.org/show_bug.cgi?id=11732: Windows build bustage. * COM/WebFrame.cpp: (WebFrame::initWithName): 2006-12-01 Timothy Hatcher <timothy@apple.com> Reviewed by Adam. <rdar://problem/4841432> 9A312: iWeb crashes on launch; _WebReportError missing from WebKit Added back WebReportAssertionFailure and WebReportError for apps that still need these symbols. * Misc/OldWebAssertions.c: Added. (WebReportAssertionFailure): (WebReportError): * WebKit.LP64.exp: added the new symbols, and sorted the file * WebKit.exp: added the new symbols, and sorted the file * WebKit.xcodeproj/project.pbxproj: 2006-11-30 Geoffrey Garen <ggaren@apple.com> Rubber Stamped by Anders Carlsson. Global rename of Document::focusNode to Document::focusedNode. 'focusNode' suggested a command, and conflicted with a different meaning for 'focusNode' in the Mozilla selection API. * WebView/WebHTMLView.m: (-[NSArray clearFocus]): 2006-11-30 Matt Lilek <pewtermoose@gmail.com> Reviewed by Mitz. Bug 10698: Scroll wheel causes inspector to shift up http://bugs.webkit.org/show_bug.cgi?id=10698 Remove size attribute from the tree popup as a workaround for http://bugs.webkit.org/show_bug.cgi?id=11362 Bug 11362: Native popup with size="1" wraps options * WebInspector/webInspector/inspector.css: * WebInspector/webInspector/inspector.html: 2006-11-30 Matt Lilek <pewtermoose@gmail.com> Reviewed by Tim H. Move web inspector style markup to javascript to fix http://bugs.webkit.org/show_bug.cgi?id=6724 Bug 6724: Text copied from Web Inspector is different from actual text * WebInspector/webInspector/inspector.css: * WebInspector/webInspector/inspector.js: 2006-11-30 Adam Roben <aroben@apple.com> Reviewed by Beth. Put code in place to use WebCore context menus when they are turned on. * WebView/WebHTMLView.m: (-[NSArray menuForEvent:]): 2006-11-29 Timothy Hatcher <timothy@apple.com> Reviewed by Oliver. Keep preferences separate from the rest of the client, making sure we are using expected preference values. This lets the inspector work when plugins are disabled for the WebView. * WebInspector/WebInspector.m: (-[NSWindow window]): 2006-11-29 Anders Carlsson <acarlsson@apple.com> Reviewed by Tim. Add back methods in WebCoreStatistics that are still used by Tiger Safari. * Misc/WebCoreStatistics.h: * Misc/WebCoreStatistics.m: (+[WebCoreStatistics emptyCache]): (+[WebCoreStatistics setCacheDisabled:]): 2006-11-28 Alice Liu <alice.liu@apple.com> Reviewed by Maciej. A fix for a couple failing layout tests involving copy/cut in iframes. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::dataForArchivedSelection): Use the frame parameter instead of using the webview's selectedFrame. 2006-11-28 Beth Dakin <bdakin@apple.com> Reviewed by Geoffff. Fix for http://bugs.webkit.org/show_bug.cgi?id=11691 REGRESSION (r17399, r17511): WebElementDictionary no longer returns nil NSStrings String's NSString* operator converts null Strings to empty NSStrings for compatibility with AppKit. We need to work around that here. * Misc/WebElementDictionary.m: (NSStringOrNil): (-[WebElementDictionary _altDisplayString]): (-[WebElementDictionary _spellingToolTip]): (-[WebElementDictionary _title]): (-[WebElementDictionary _titleDisplayString]): (-[WebElementDictionary _textContent]): 2006-11-28 Geoffrey Garen <ggaren@apple.com> Reviewed by Beth Dakin. Fixed <rdar://problem/4844855> Should clarify when to create clients in the WebCore client API All clients must now be supplied as constructor arguments. This clarifies when you need to create clients, and also guarantees that objects can't (for the most part) be in a clientless state. Layout tests pass. No leaks reported. * WebCoreSupport/WebFrameBridge.mm: Shuffled around initialization and changed some arguments to resolve ciruclar dependencies at init time. (-[WebFrame _initWithWebFrameView:webView:bridge:]): We no longer call setClient here, because the client is set up at construction time. 2006-11-28 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. Update for changes to ResourceRequest. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::createWindow): (WebChromeClient::createModalDialog): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::canHandleRequest): 2006-11-28 Adam Roben <aroben@apple.com> Reviewed by Beth. More WebCore context menu work. * DefaultDelegates/WebDefaultUIDelegate.m: New stub delegate method implementation. (-[NSApplication webView:contextMenuItemSelected:forElement:]): * WebCoreSupport/WebContextMenuClient.h: Updated to match ContextMenuClient.h changes. * WebCoreSupport/WebContextMenuClient.mm: (WebContextMenuClient::addCustomContextMenuItems): Updated for method name changes. (WebContextMenuClient::contextMenuItemSelected): Added new client method. * WebView/WebUIDelegatePrivate.h: New private delegate method declaration. 2006-11-28 Alice Liu <alice.liu@apple.com> Reviewed by Justin and Adam. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: added the following (WebEditorClient::smartInsertDeleteEnabled): (WebEditorClient::dataForArchivedSelectionInFrame): (WebEditorClient::_web_userVisibleString): (WebEditorClient::shouldInsertNode): * WebKitPrefix.h: Added flags to control whether WebCore cut/copy/paste is enabled. Turned on Cut and Copy, left Paste and Delete off * WebView/WebHTMLViewPrivate.h: * WebView/WebHTMLView.m: removed _can[Cut|Copy|Paste|Delete] (-[NSArray validateUserInterfaceItem:]): call the editor for canDHTML[C|C|P|D] and _can[C|C|P|D] instead (-[NSArray delete:]): added code to call the editor's delete instead (not turned on) (-[WebHTMLView copy:]): added code to call the editor's copy (turned on) (-[WebHTMLView cut:]): added code to call the editor's cut (turned on) (-[WebHTMLView paste:]): added code to call the editor's paste (not turned on) 2006-11-28 Geoffrey Garen <ggaren@apple.com> Reviewed by Adam. Fixed <rdar://problem/4844848> REGRESSION: extra cross-library ref/deref calls cause .5% PLT regression. Changed ref/deref calls to a single 'xxxDestroyed' call. Moved EditorClient from the Frame to the Page, since it's only responsible for Webview-level delegate calls. I don't really love this design, but it fixes the regression and allows a single WebKit object to implement multiple client interfaces. Layout tests pass. 2006-11-27 Beth Dakin <bdakin@apple.com> Reviewed by Adam. WebKit half of getting rid of the FixMes in ContextMenu.cpp * WebCoreSupport/WebFrameLoaderClient.h: canHandleRequest takes a ResourceRequest now. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::canHandleRequest): Same. * WebView/WebHTMLView.m: (-[WebHTMLView _isSelectionMisspelled]): Call into WebCore. 2006-11-27 Ada Chan <adachan@apple.com> Reviewed by Adam. Part of the change to move WebCoreCache into WebKit: Added WebCache which handles emptying and enable/disabling the cache. emptyCache and setCacheDisabled have been removed from WebCoreStatistics. * Misc/WebCache.h: Added. * Misc/WebCache.mm: Added. * Misc/WebCoreStatistics.h: * Misc/WebCoreStatistics.m: (+[WebCoreStatistics statistics]): * WebKit.exp: * WebKit.xcodeproj/project.pbxproj: 2006-11-27 Anders Carlsson <acarlsson@apple.com> Reviewed by Adam. Move addMessageToConsole to Chrome. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::addMessageToConsole): * WebCoreSupport/WebFrameBridge.mm: 2006-11-27 Brady Eidson <beidson@apple.com> Reviewed by Anders Moved unused Private SPI to Internal and pruned other unused code * Misc/WebIconDatabase.m: * Misc/WebIconDatabasePrivate.h: 2006-11-21 Darin Adler <darin@apple.com> Reviewed by Maciej. - make the close method do a more-complete job to prevent world leaks seen when running some of the layout tests * WebView/WebHTMLViewInternal.h: Added declaration of -[WebHTMLViewPrivate clear]. * WebView/WebHTMLView.m: (-[WebHTMLViewPrivate clear]): Added method to drop references to other objects. We want to do this at "close" time, rather than waiting for deallocation time. This is especially important for the data source, which indirectly keeps a number of objects alive. (-[WebHTMLView close]): Added an explicit call to clear out the data source on the plug-in controller. Without this, we'd see the plug-in controller making calls to a deallocated data source during the layout tests. Added a call to the new clear method on the private object so that we release the objects at close time instead of waiting for deallocation time. * WebKit.xcodeproj/project.pbxproj: Let Xcode have its way with the project file, because I can't fight the power. 2006-11-20 Samuel Weinig <sam@webkit.org> Reviewed by Alexey. Fix for http://bugs.webkit.org/show_bug.cgi?id=11656 Fix Windows build * WebKit.vcproj/WebKit.vcproj: don't include directories that no longer exist. 2006-11-19 Beth Dakin <bdakin@apple.com> Reviewed by Adam. WebKit side of new context menu actions. * WebCoreSupport/WebContextMenuClient.h: These are for the currently-WebKit-dependent menu actions. * WebCoreSupport/WebContextMenuClient.mm: (WebContextMenuClient::copyLinkToClipboard): (WebContextMenuClient::downloadURL): (WebContextMenuClient::copyImageToClipboard): (WebContextMenuClient::searchWithSpotlight): (WebContextMenuClient::lookUpInDictionary): * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (core): These are to convert between WebViewInsertAction and EditorInsertAction. (kit): (WebEditorClient::shouldInsertText): Added implementation for shouldInsertText. * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLView.m: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): Moved _lookUpInDictionary to be within the implementation of WebHTMLView internal. * WebView/WebHTMLViewInternal.h: Add _lookUpInDictionaryFromMenu * WebView/WebViewInternal.h: Add _searchWithSpotlightFromMenu 2006-11-18 Peter Kasting <pkasting@google.com> Reviewed by Sam Weinig. http://bugs.webkit.org/show_bug.cgi?id=11634: Fix segfault on startup for Windows build. Also fix segfault when typing in a URL. * COM/WebFrame.cpp: (WebFrame::initWithName): === Safari-521.31 === 2006-11-17 Timothy Hatcher <timothy@apple.com> Reviewed by Geoff. <rdar://problem/4841044> Temporarily default Mail.app editable link clicking behavior, until they do it themselves * WebKit.xcodeproj/project.pbxproj: * WebView/WebView.mm: (+[WebView initialize]): (-[WebView setPreferences:]): 2006-11-16 Peter Kasting <pkasting@google.com> Reviewed and landed by ap. http://bugs.webkit.org/show_bug.cgi?id=11509: Windows build bustage. * COM/WebFrame.cpp: (WebFrame::initWithName): (WebFrame::loadHTMLString): (WebFrame::stopLoading): (WebFrame::reload): (WebFrame::loadDataSource): (WebFrame::didReceiveData): (WebFrame::receivedResponse): (WebFrame::receivedAllData): * COM/WebFrame.h: * COM/WebView.cpp: (WebView::mouseMoved): (WebView::mouseDown): (WebView::mouseUp): (WebView::mouseDoubleClick): * WebKit.vcproj/WebKit.vcproj: 2006-11-16 Anders Carlsson <acarlsson@apple.com> Reviewed by Tim. <rdar://problem/4841123> REGRESSION: Crash in WebCore::Range::boundaryPointsValid when replying to a mail Message * Misc/WebNSAttributedStringExtras.m: (+[NSAttributedString _web_attributedStringFromRange:]): If the range passed in is null, return null. When this function was in the bridge, it would never get called with a null range when nothing was selected. Instead, the range would just have invalid boundary points. 2006-11-15 Adam Roben <aroben@apple.com> Reviewed by Anders. Added new WebContextMenuClient class to act as WebCore's ChromeClient, and moved context menu-related code there from WebChromeClient. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: * WebCoreSupport/WebContextMenuClient.h: Added. (WebContextMenuClient::webView): * WebCoreSupport/WebContextMenuClient.mm: Added. (WebContextMenuClient::create): (WebContextMenuClient::WebContextMenuClient): (WebContextMenuClient::ref): (WebContextMenuClient::deref): (WebContextMenuClient::addCustomContextMenuItems): * WebKit.xcodeproj/project.pbxproj: Added new files. * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): 2006-11-15 Beth Dakin <bdakin@apple.com> & Adam Roben <aroben@apple.com> Reviewed by Adam & Beth. WebKit side of first cut at engine context menus. Use the client to call into the UIDelegate. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::addCustomContextMenuItems): * WebKit.xcodeproj/project.pbxproj: 2006-11-15 Brady Eidson <beidson@apple.com> Reviewed by Maciej Quick change of files to ObjC++ for BF cache re-write * History/WebBackForwardList.m: Removed. * History/WebBackForwardList.mm: Added. * History/WebHistoryItem.m: Removed. * History/WebHistoryItem.mm: Added. * WebKit.xcodeproj/project.pbxproj: 2006-11-15 Brady Eidson <beidson@apple.com> Reviewed by Sarge SPI addition * WebView/WebFrame.mm: (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]): * WebView/WebFrameInternal.h: * WebView/WebFramePrivate.h: 2006-11-15 Brady Eidson <beidson@apple.com> Reviewed by Adele <rdar://problem/4838729> - Replace mistakenly removed SPI * WebView/WebHTMLView.m: (-[WebHTMLView _handleAutoscrollForMouseDragged:]): * WebView/WebHTMLViewPrivate.h: 2006-11-15 Anders Carlsson <acarlsson@apple.com> Reviewed by Adele. isTargetItem is used by DRT, so make it private instead of internal. * History/WebHistoryItem.m: (-[WebHistoryItem isTargetItem]): * History/WebHistoryItemInternal.h: * History/WebHistoryItemPrivate.h: * WebCoreSupport/WebFrameLoaderClient.mm: 2006-11-15 Brady Eidson <beidson@apple.com> Reviewed by Maciej Split much of unused WebHistoryItemPrivate.h SPI into WebHistoryItemInternal.h * History/WebBackForwardList.m: * History/WebHistory.m: * History/WebHistoryItem.m: (-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]): (-[WebHistoryItem initWithURL:title:]): (-[WebHistoryItem visitCount]): (-[WebHistoryItem RSSFeedReferrer]): (-[WebHistoryItem setRSSFeedReferrer:]): (-[WebHistoryItem children]): (-[WebHistoryItem dictionaryRepresentation]): (-[WebHistoryItem setAlwaysAttemptToUsePageCache:]): (+[WebHistoryItem _releaseAllPendingPageCaches]): (-[WebHistoryItem URL]): (-[WebHistoryItem target]): (-[WebHistoryItem _setLastVisitedTimeInterval:]): (-[WebHistoryItem _lastVisitedDate]): (-[WebHistoryItem targetItem]): * History/WebHistoryItemInternal.h: Added. * History/WebHistoryItemPrivate.h: * WebCoreSupport/WebFrameBridge.mm: * WebCoreSupport/WebFrameLoaderClient.mm: * WebKit.xcodeproj/project.pbxproj: * WebView/WebFrame.mm: * WebView/WebView.mm: 2006-11-14 Beth Dakin <bdakin@apple.com> Reviewed by Geoff. Moving things off the bridge and onto clients. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::selectWordBeforeMenuEvent): (WebEditorClient::isEditable): * WebCoreSupport/WebFrameBridge.mm: * WebKit.xcodeproj/project.pbxproj: 2006-11-14 Timothy Hatcher <timothy@apple.com> Reviewed by Harrison. <rdar://problem/4766635> Safari should never follow links in editable areas (add a WebKitEditableLinkNeverLive option) Adds an Open Link, Open Link in New Window and Copy Link to the editing context menu. Adds a new WebKitEditableLinkNeverLive preference value that maps to WebCore's EditableLinkNeverLive. * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate menuItemWithTag:target:representedObject:]): (-[WebDefaultUIDelegate contextMenuItemsForElement:defaultMenuItems:]): (-[WebDefaultUIDelegate editingContextMenuItemsForElement:defaultMenuItems:]): (-[WebDefaultUIDelegate requestWithURL:includingReferrerFromFrame:]): (-[WebDefaultUIDelegate openNewWindowWithURL:element:]): (-[WebDefaultUIDelegate openLink:]): * English.lproj/Localizable.strings: * WebKit.exp: * WebView/WebPreferences.m: (-[WebPreferences editableLinkBehavior]): * WebView/WebPreferencesPrivate.h: * WebView/WebUIDelegatePrivate.h: 2006-11-14 Anders Carlsson <acarlsson@apple.com> Turns out I wasn't forcing DWARF on the world at all, it's now the default! * WebKit.xcodeproj/project.pbxproj: 2006-11-14 Anders Carlsson <acarlsson@apple.com> I must stop trying to force DWARF on the world. * WebKit.xcodeproj/project.pbxproj: 2006-11-14 Darin Adler <darin@apple.com> Reviewed by Anders. - update for creation of EventHandler * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::actionDictionary): * WebView/WebHTMLView.m: (-[WebHTMLView _updateMouseoverWithEvent:]): (-[NSArray menuForEvent:]): (-[NSArray scrollWheel:]): (-[NSArray acceptsFirstMouse:]): (-[NSArray shouldDelayWindowOrderingForEvent:]): (-[NSArray mouseDown:]): (-[NSArray mouseDragged:]): (-[NSArray mouseUp:]): (-[NSArray keyDown:]): (-[NSArray keyUp:]): (-[NSArray performKeyEquivalent:]): (-[WebHTMLView elementAtPoint:allowShadowContent:]): 2006-11-14 Anders Carlsson <acarlsson@apple.com> Fix build for real this time. * WebCoreSupport/WebEditorClient.mm: (-[WebEditCommand initWithEditCommand:WebCore::]): (-[WebEditCommand dealloc]): (-[WebEditCommand finalize]): (+[WebEditCommand commandWithEditCommand:]): (-[WebEditCommand command]): 2006-11-14 Anders Carlsson <acarlsson@apple.com> Try fixing the build. * WebCoreSupport/WebEditorClient.mm: (-[WebEditorUndoTarget undoEditing:]): (-[WebEditorUndoTarget redoEditing:]): 2006-11-14 Anders Carlsson <acarlsson@apple.com> Reviewed by Darin. Move undo/redo handling into WebEditorClient. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::WebEditorClient): (WebEditorClient::~WebEditorClient): (-[WebEditCommand initWithEditCommand:WebCore::]): (-[WebEditCommand dealloc]): (-[WebEditCommand finalize]): (+[WebEditCommand commandWithEditCommand:]): (-[WebEditCommand command]): (-[WebEditorUndoTarget undoEditing:]): (-[WebEditorUndoTarget redoEditing:]): (undoNameForEditAction): (WebEditorClient::registerCommandForUndoOrRedo): (WebEditorClient::registerCommandForUndo): (WebEditorClient::registerCommandForRedo): (WebEditorClient::clearUndoRedoOperations): (WebEditorClient::canUndo): (WebEditorClient::canRedo): (WebEditorClient::undo): (WebEditorClient::redo): * WebCoreSupport/WebFrameBridge.mm: * WebKit.xcodeproj/project.pbxproj: 2006-11-14 Alexey Proskuryakov <ap@webkit.org> Reviewed by Tim H. http://bugs.webkit.org/show_bug.cgi?id=3387 Redundant keydown, keypress, keyup events sent for arrow keys Added another layer of ugly hacks around AppKit event dispatching. 1. For arrow keys, keyDown: is invoked after performKeyEquivalent:, so had to store _private->keyDownEvent in both methods, and make it persist after leaving them. 2. For Esc, AppKit calls performKeyEquivalent: with a fake event of some kind, use [NSApp currentEvent] to check for this to prevent it from being passed to WebCore. Test: manual-tests/arrow-key-events.html * WebView/WebHTMLView.m: (-[NSMutableDictionary dealloc]): (-[NSArray keyDown:]): (-[NSArray keyUp:]): (-[NSArray performKeyEquivalent:]): * WebView/WebHTMLViewInternal.h: 2006-11-12 Brady Eidson <beidson@apple.com> Rubberstamped by Anders Changed some #includes from <WebKit/foo.h> to "foo.h" * History/WebBackForwardList.m: * History/WebHistory.m: 2006-11-11 Geoffrey Garen <ggaren@apple.com> Reviewed by Maciej Stachowiak. - Fixed loader crash by clarifying ownership of WebKit client objects. WebCore objects own their WebKit clients, and ref and deref through virtual methods, leaving WebKit free to use whatever client / reference-counting implementation it likes. WebKit on Mac just uses the same refcounting class that WebCore uses (Shared), but other platforms may choose to do other things. * WebCoreSupport/WebChromeClient.h: (WebChromeClient::ref): (WebChromeClient::deref): (WebChromeClient::refCount): * WebCoreSupport/WebEditorClient.h: Nixed commented-out function prototypes. The ones in WebCore make clear what remains to be implemented. Replaced constructor with factory function to avoid leaks. * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::create): (WebEditorClient::WebEditorClient): (WebEditorClient::setWebFrame): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge initMainFrameWithPage:WebCore::frameName:view:webView:]): (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]): * WebCoreSupport/WebFrameLoaderClient.h: Replaced constructor with factory function to avoid leaks. (WebFrameLoaderClient::ref): (WebFrameLoaderClient::deref): (WebFrameLoaderClient::refCount): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::create): * WebView/WebFrame.mm: (-[WebFrame _initWithWebFrameView:webView:coreFrame:]): === Safari-521.30 === 2006-11-10 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - remove some unnecessary uses of WebDataProtocol * WebView/WebDataSource.mm: Remove the unneeded include. * WebView/WebView.mm: (+[WebView _canHandleRequest:]): Don't bother to check for unreachable URL here. Any request that has one will be an applewebdata: request, which will pass the check anyway. 2006-11-10 Anders Carlsson <acarlsson@apple.com> Reviewed by Geoff. Update for changes to WebCore * WebView/WebHTMLView.m: (-[NSArray _applyStyleToSelection:withUndoAction:]): (-[NSArray _applyParagraphStyleToSelection:withUndoAction:]): (-[NSArray _toggleBold]): (-[NSArray _toggleItalic]): 2006-11-09 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej, Geoff. Call execCommand directly here instead of going through the bridge. * WebView/WebHTMLView.m: (-[NSArray moveBackward:]): (-[NSArray moveBackwardAndModifySelection:]): (-[NSArray moveDown:]): (-[NSArray moveDownAndModifySelection:]): (-[NSArray moveForward:]): (-[NSArray moveForwardAndModifySelection:]): (-[NSArray moveLeft:]): (-[NSArray moveLeftAndModifySelection:]): (-[NSArray moveRight:]): (-[NSArray moveRightAndModifySelection:]): (-[NSArray moveToBeginningOfDocument:]): (-[NSArray moveToBeginningOfDocumentAndModifySelection:]): (-[NSArray moveToBeginningOfSentence:]): (-[NSArray moveToBeginningOfSentenceAndModifySelection:]): (-[NSArray moveToBeginningOfLine:]): (-[NSArray moveToBeginningOfLineAndModifySelection:]): (-[NSArray moveToBeginningOfParagraph:]): (-[NSArray moveToBeginningOfParagraphAndModifySelection:]): (-[NSArray moveToEndOfDocument:]): (-[NSArray moveToEndOfDocumentAndModifySelection:]): (-[NSArray moveToEndOfSentence:]): (-[NSArray moveToEndOfSentenceAndModifySelection:]): (-[NSArray moveToEndOfLine:]): (-[NSArray moveToEndOfLineAndModifySelection:]): (-[NSArray moveToEndOfParagraph:]): (-[NSArray moveToEndOfParagraphAndModifySelection:]): (-[NSArray moveParagraphBackwardAndModifySelection:]): (-[NSArray moveParagraphForwardAndModifySelection:]): (-[NSArray moveUp:]): (-[NSArray moveUpAndModifySelection:]): (-[NSArray moveWordBackward:]): (-[NSArray moveWordBackwardAndModifySelection:]): (-[NSArray moveWordForward:]): (-[NSArray moveWordForwardAndModifySelection:]): (-[NSArray moveWordLeft:]): (-[NSArray moveWordLeftAndModifySelection:]): (-[NSArray moveWordRight:]): (-[NSArray moveWordRightAndModifySelection:]): 2006-11-10 Brady Eidson <beidson@apple.com> Reviewed by Darin Took out WebIconDatabaseBridge and made WebKit call IconDatabase directly * Misc/WebIconDatabase.m: (-[WebIconDatabase init]): (-[WebIconDatabase iconForURL:withSize:cache:]): (-[WebIconDatabase iconURLForURL:]): (-[WebIconDatabase defaultIconWithSize:]): (-[WebIconDatabase defaultIconForURL:withSize:]): (-[WebIconDatabase retainIconForURL:]): (-[WebIconDatabase releaseIconForURL:]): (-[WebIconDatabase setDelegate:]): (-[WebIconDatabase removeAllIcons]): (-[WebIconDatabase isIconExpiredForIconURL:]): (-[WebIconDatabase _isEnabled]): (-[WebIconDatabase _setIconData:forIconURL:]): (-[WebIconDatabase _setHaveNoIconForIconURL:]): (-[WebIconDatabase _setIconURL:forURL:]): (-[WebIconDatabase _hasEntryForIconURL:]): (-[WebIconDatabase _applicationWillTerminate:]): (-[WebIconDatabase _resetCachedWebPreferences:]): (-[WebIconDatabase _convertToWebCoreFormat]): (webGetNSImage): * Misc/WebIconDatabaseInternal.h: Added. * Misc/WebIconDatabasePrivate.h: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidReceiveIcon): * WebCoreSupport/WebIconDatabaseBridge.h: Removed. * WebCoreSupport/WebIconDatabaseBridge.m: Removed. * WebKit.xcodeproj/project.pbxproj: 2006-11-09 Oliver Hunt <oliver@apple.com> Reviewed by Brady. Updated to make use of MimeTypeRegistry/bridge * Misc/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeImage:element:URL:title:archive:types:]): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge determineObjectFromMIMEType:URL:]): * WebView/WebDataSource.mm: (-[WebDataSource _documentFragmentWithArchive:]): * WebView/WebHTMLRepresentation.m: (+[WebHTMLRepresentation supportedNonImageMIMETypes]): (+[WebHTMLRepresentation supportedImageMIMETypes]): * WebView/WebHTMLView.m: (-[WebHTMLView _imageExistsAtPaths:]): (-[WebHTMLView _documentFragmentWithPaths:]): 2006-11-09 Brady Eidson <beidson@apple.com> Reviewed by Darin <rdar://problem/4829080> More loader re-factoring cleanup - WebFramePolicyListener was over-released * WebCoreSupport/WebFrameLoaderClient.h: Changed vanilla ptr to a RetainPtr<> * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType): Ditto (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto (WebFrameLoaderClient::dispatchWillSubmitForm): Ditto (WebFrameLoaderClient::setUpPolicyListener): Ditto (-[WebFramePolicyListener receivedPolicyDecision:]): Ditto 2006-11-08 Anders Carlsson <acarlsson@apple.com> Reviewed by Adam, Oliver. Update for changes to WebCore. Pass a specific WebFrame to WebEditorClient instead of just passing the WebView. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::WebEditorClient): (WebEditorClient::setWebFrame): (WebEditorClient::isContinuousSpellCheckingEnabled): (WebEditorClient::spellCheckerDocumentTag): (WebEditorClient::shouldDeleteRange): (WebEditorClient::shouldShowDeleteInterface): (WebEditorClient::shouldApplyStyle): (WebEditorClient::shouldBeginEditing): (WebEditorClient::shouldEndEditing): (WebEditorClient::didBeginEditing): (WebEditorClient::respondToChangedContents): (WebEditorClient::didEndEditing): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge initMainFrameWithPage:WebCore::frameName:view:webView:]): (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]): 2006-11-08 Anders Carlsson <acarlsson@apple.com> Reviewed by Adam. Move more code into editor. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::shouldBeginEditing): (WebEditorClient::shouldEndEditing): (WebEditorClient::didBeginEditing): (WebEditorClient::didEndEditing): * WebCoreSupport/WebFrameBridge.mm: * WebView/WebHTMLView.m: (-[NSArray indent:]): (-[NSArray outdent:]): * WebView/WebView.mm: * WebView/WebViewInternal.h: 2006-11-08 Beth Dakin <bdakin@apple.com> Reviewed by Adam. Add WebElementIsContentEditableKey to the WebElementDictionary, and use it! * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): Use new WebElementIsContentEditableKey. * Misc/WebElementDictionary.m: (+[WebElementDictionary initializeLookupTable]): (-[WebElementDictionary _isContentEditable]): Call into HitTestResult::isContentEditable() * WebView/WebView.mm: Add new key. * WebView/WebViewPrivate.h: Add new key. 2006-11-08 Anders Carlsson <acarlsson@apple.com> Reviewed by Oliver. Call into the WebCore editor object directly. * MigrateHeaders.make: * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::shouldDeleteRange): (WebEditorClient::shouldShowDeleteInterface): (WebEditorClient::shouldApplyStyle): * WebView/WebFrame.mm: (core): (kit): * WebView/WebFrameInternal.h: * WebView/WebHTMLView.m: (-[NSArray _applyStyleToSelection:withUndoAction:]): (-[NSArray _applyParagraphStyleToSelection:withUndoAction:]): (-[NSArray _toggleBold]): (-[NSArray _toggleItalic]): (-[NSArray _changeCSSColorUsingSelector:inRange:]): (-[NSArray underline:]): (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): * WebView/WebView.mm: (-[WebView applyStyle:]): 2006-11-08 Anders Carlsson <acarlsson@apple.com> Reviewed by Oliver. <rdar://problem/4825370> REGRESSION: Selecting "Look Up In Dictionary" from contextual menu fails to open the Dictionary app * WebView/WebHTMLView.m: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): Initialize the framework pointer to 0. 2006-11-07 Darin Adler <darin@apple.com> Reviewed by Geoff. - udpated for changes to move from Frame/FrameMac to FrameLoader * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate openNewWindowWithURL:element:]): * Misc/WebNSAttributedStringExtras.m: (+[NSAttributedString _web_attributedStringFromRange:]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView requestWithURLCString:]): * Plugins/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView didStart]): * Plugins/WebNetscapePluginStream.mm: * Plugins/WebPluginController.mm: (-[WebPluginController pluginView:receivedResponse:]): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::provisionalLoadStarted): * WebView/WebFrame.mm: (-[WebFrame _canCachePage]): (+[WebFrame _timeOfLastCompletedLoad]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _reloadForPluginChanges]): (-[WebFrame stopLoading]): 2006-11-07 Anders Carlsson <acarlsson@apple.com> Reviewed by Geoff. Use the WebCore editing enums. * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge undoNameForEditAction:]): * WebView/WebHTMLView.m: (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:deletionAction:granularity:]): (-[WebHTMLView _deleteSelection]): (-[WebHTMLView moveBackward:]): (-[WebHTMLView moveBackwardAndModifySelection:]): (-[WebHTMLView moveDown:]): (-[WebHTMLView moveDownAndModifySelection:]): (-[WebHTMLView moveForward:]): (-[WebHTMLView moveForwardAndModifySelection:]): (-[WebHTMLView moveLeft:]): (-[WebHTMLView moveLeftAndModifySelection:]): (-[WebHTMLView moveRight:]): (-[WebHTMLView moveRightAndModifySelection:]): (-[WebHTMLView moveToBeginningOfDocument:]): (-[WebHTMLView moveToBeginningOfDocumentAndModifySelection:]): (-[WebHTMLView moveToBeginningOfSentence:]): (-[WebHTMLView moveToBeginningOfSentenceAndModifySelection:]): (-[WebHTMLView moveToBeginningOfLine:]): (-[WebHTMLView moveToBeginningOfLineAndModifySelection:]): (-[WebHTMLView moveToBeginningOfParagraph:]): (-[WebHTMLView moveToBeginningOfParagraphAndModifySelection:]): (-[WebHTMLView moveToEndOfDocument:]): (-[WebHTMLView moveToEndOfDocumentAndModifySelection:]): (-[WebHTMLView moveToEndOfSentence:]): (-[WebHTMLView moveToEndOfSentenceAndModifySelection:]): (-[WebHTMLView moveToEndOfLine:]): (-[WebHTMLView moveToEndOfLineAndModifySelection:]): (-[WebHTMLView moveToEndOfParagraph:]): (-[WebHTMLView moveToEndOfParagraphAndModifySelection:]): (-[WebHTMLView moveParagraphBackwardAndModifySelection:]): (-[WebHTMLView moveParagraphForwardAndModifySelection:]): (-[WebHTMLView moveUp:]): (-[WebHTMLView moveUpAndModifySelection:]): (-[WebHTMLView moveWordBackward:]): (-[WebHTMLView moveWordBackwardAndModifySelection:]): (-[WebHTMLView moveWordForward:]): (-[WebHTMLView moveWordForwardAndModifySelection:]): (-[WebHTMLView moveWordLeft:]): (-[WebHTMLView moveWordLeftAndModifySelection:]): (-[WebHTMLView moveWordRight:]): (-[WebHTMLView moveWordRightAndModifySelection:]): (-[WebHTMLView pageUp:]): (-[WebHTMLView pageDown:]): (-[WebHTMLView pageUpAndModifySelection:]): (-[WebHTMLView pageDownAndModifySelection:]): (-[WebHTMLView _expandSelectionToGranularity:]): (-[WebHTMLView selectParagraph:]): (-[WebHTMLView selectLine:]): (-[WebHTMLView selectSentence:]): (-[WebHTMLView selectWord:]): (-[WebHTMLView _applyStyleToSelection:withUndoAction:]): (-[WebHTMLView _applyParagraphStyleToSelection:withUndoAction:]): (-[WebHTMLView _toggleBold]): (-[WebHTMLView _toggleItalic]): (-[WebHTMLView pasteFont:]): (-[WebHTMLView changeFont:]): (-[WebHTMLView changeAttributes:]): (-[WebHTMLView _undoActionFromColorPanelWithSelector:]): (-[WebHTMLView changeColor:]): (-[WebHTMLView _alignSelectionUsingCSSValue:withUndoAction:]): (-[WebHTMLView alignCenter:]): (-[WebHTMLView alignJustified:]): (-[WebHTMLView alignLeft:]): (-[WebHTMLView alignRight:]): (-[WebHTMLView _deleteWithDirection:SelectionController::granularity:killRing:isTypingAction:]): (-[WebHTMLView deleteForward:]): (-[WebHTMLView deleteBackward:]): (-[WebHTMLView deleteWordForward:]): (-[WebHTMLView deleteWordBackward:]): (-[WebHTMLView deleteToBeginningOfLine:]): (-[WebHTMLView deleteToEndOfLine:]): (-[WebHTMLView deleteToBeginningOfParagraph:]): (-[WebHTMLView deleteToEndOfParagraph:]): (-[WebHTMLView subscript:]): (-[WebHTMLView superscript:]): (-[WebHTMLView unscript:]): (-[WebHTMLView underline:]): (-[WebHTMLView deleteToMark:]): (-[WebHTMLView toggleBaseWritingDirection:]): (-[WebHTMLView changeBaseWritingDirection:]): (-[WebHTMLView _canSmartCopyOrDelete]): (-[WebTextCompleteController doCompletion]): (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): * WebView/WebView.mm: (-[WebView setTypingStyle:]): (-[WebView applyStyle:]): 2006-11-06 Geoffrey Garen <ggaren@apple.com> Reviewed by Tim Hatcher. Removed ScreenClient. It was highly unpopular, risking my midterm re-election. None of Screen's responsibilities require up-calls to WebKit or delegates, so WebCore can handle it all. * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::setWindowRect): (WebChromeClient::windowRect): * WebCoreSupport/WebScreenClient.h: Removed. * WebCoreSupport/WebScreenClient.mm: Removed. * WebKit.xcodeproj/project.pbxproj: * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): 2006-11-06 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin. Accidentally rolled out this change when removing the WebPageBridge. Now putting it back. * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): 2006-11-05 Geoffrey Garen <ggaren@apple.com> Reviewed by Maciej, Darin, Anders. Removed the Page bridge. Beefed up Chrome. Added Screen and ScreenClient. (WebChromeClient::pageRect): It may seem weird for the page to ask the Chrome/ChromeClient about its own dimensions. The idea here is that we're asking the Chrome how much space it has devoted to the page. We have API for this (-webViewContentRect), but it was documented incorrectly (even Safari used it wrong), so we don't use it anymore. Once we fix our API/documentation, we can return to making a delegate callback to ask for the page's size. (WebChromeClient::createWindow): Changed to take a FrameLoadRequest with an appropriate referrer, instead of making up its own. (WebChromeClient::createModalDialog): Changed to take a FrameLoadRequest with an appropriate referrer, instead of broken out parcels. * WebCoreSupport/WebPageBridge.h: Removed. Dead Code. * WebCoreSupport/WebPageBridge.mm: Removed. Dead Code. * WebCoreSupport/WebScreenClient.h: Added. * WebCoreSupport/WebScreenClient.mm: Added. * WebView/WebView.mm: Added NULL checks for new _private->page, since it's not NULL-safe like the bridge was, and it gets cleared before dealloc. 2006-11-06 Graham Dennis <graham.dennis@gmail.com> Reviewed by Tim Hatcher. Part of patch for http://bugs.webkit.org/show_bug.cgi?id=11323 Link dragging behaviour does not obey WebKitEditableLinkBehavior WebPref * DefaultDelegates/WebDefaultUIDelegate.m: (-[NSApplication webView:dragSourceActionMaskForPoint:]): Logic moved to WebHTMLView's _mayStartDragAtEventLocation * Misc/WebElementDictionary.m: added isLiveLink (+[WebElementDictionary initializeLookupTable]): (-[WebElementDictionary _isLiveLink]): * WebView/WebHTMLView.m: (-[WebHTMLView _mayStartDragAtEventLocation:]): Editable links should only be followed if isLiveLink is true (-[WebHTMLView _isMoveDrag:]): A drag of a live editable link is not a move (-[WebHTMLView draggingUpdatedWithDraggingInfo:actionMask:]): (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): * WebView/WebView.mm: added WebElementLinkIsLiveKey * WebView/WebViewPrivate.h: ditto 2006-11-04 Maciej Stachowiak <mjs@apple.com> Reviewed by Oliver. - removed unneeded (and obsolete) header includes * WebCoreSupport/WebFrameBridge.mm: * WebView/WebFrame.mm: 2006-11-05 Darin Adler <darin@apple.com> - WebKit part of Frame.h check-in (forgot to land it) * WebCoreSupport/WebFrameBridge.h: * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge textViewWasFirstResponderAtMouseDownTime:]): (-[WebFrameBridge shouldInterruptJavaScript]): (-[WebFrameBridge saveDocumentState:]): (-[WebFrameBridge previousKeyViewOutsideWebFrameViews]): (-[WebFrameBridge valueForKey:keys:values:]): (-[WebFrameBridge getObjectCacheSize]): (-[WebFrameBridge startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): (-[WebFrameBridge mayStartDragAtEventLocation:]): (-[WebFrameBridge canGoBackOrForward:]): (-[WebFrameBridge goBackOrForward:]): (-[WebFrameBridge print]): (-[WebFrameBridge getAppletInView:]): (-[WebFrameBridge pollForAppletInView:]): (-[WebFrameBridge respondToChangedContents]): (-[WebFrameBridge respondToChangedSelection]): (-[WebFrameBridge setIsSelected:forView:]): 2006-11-04 Darin Adler <darin@apple.com> Reviewed by Maciej. - converted more of the loader machinery to work with cross-platform data structures instead of Macintosh-specific ones store the computed user agent string as a WebCore::String instead of an NSString to avoid overhead converting it every time we get it * COM/WebFrame.cpp: (WebFrame::initWithName): * ChangeLog: * Misc/WebElementDictionary.m: (-[WebElementDictionary _image]): (-[WebElementDictionary _targetWebFrame]): * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchWillPerformClientRedirect): (WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent): (WebFrameLoaderClient::setTitle): (WebFrameLoaderClient::userAgent): (WebFrameLoaderClient::actionDictionary): * WebCoreSupport/WebPageBridge.mm: (WebCore::if): * WebView/WebDataSource.mm: (-[WebDataSource _URL]): (-[WebDataSource _URLForHistory]): (-[WebDataSource unreachableURL]): * WebView/WebHTMLView.m: (-[WebHTMLView elementAtPoint:allowShadowContent:]): * WebView/WebPDFView.mm: (-[WebPDFView PDFViewWillClickOnLink:withURL:]): (-[WebPDFView _path]): * WebView/WebView.mm: (-[WebViewPrivate init]): (-[WebViewPrivate dealloc]): (-[WebViewPrivate finalize]): (-[WebView _preferencesChangedNotification:]): (-[WebView _cachedResponseForURL:]): (-[WebView setApplicationNameForUserAgent:]): (-[WebView setCustomUserAgent:]): (-[WebView customUserAgent]): (-[WebView userAgentForURL:]): (-[WebView _computeUserAgent]): (-[WebView WebCore::]): * WebView/WebViewInternal.h: 2006-11-04 Bertrand Guiheneuf <guiheneuf@gmail.com> Reviewed by Maciej, tweaked and landed by Alexey (using a patch by Don Gibson). http://bugs.webkit.org/show_bug.cgi?id=11433 Fixes to get WebKit to run on Windows; implemented AffineTransformCairo. * COM/WebFrame.cpp: (WebFrame::initWithName): (WebFrame::loadDataSource): (WebFrame::receivedRedirect): (WebFrame::receivedResponse): (WebFrame::didReceiveData): (WebFrame::receivedAllData): Use resource handles now. Do not start doc loader by hand anymore. Handle didReceiveData() callback instead of receivedData() which is deprecated in implementation of ResourceHandleClient * COM/WebFrame.h: * COM/WebView.cpp: Applied ResourceLoader --> ResourceHandle renaming * WebKit.vcproj/WebKit.rc: Got rid of MFC dependencies (build fix for VCExpress). * WebKit.vcproj/WebKit.vcproj: Added platform/graphics platform/network and platform/network/win to headers search paths 2006-11-03 Geoffrey Garen <ggaren@apple.com> Forgot to add these two files. Oops. * WebCoreSupport/WebChromeClient.h: Added. * WebCoreSupport/WebChromeClient.mm: Added. 2006-11-02 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin, Beth. First cut at factoring Page's UIDelegate-related functions into Chrome and ChromeClient. Layout tests pass. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebPageBridge.mm: * WebKit.xcodeproj/project.pbxproj: 2006-11-02 Timothy Hatcher <timothy@apple.com> Reviewed by Brady. Adding outdent to the WebView responder forwarding list. Also add outdent to WebHTMLView.h and WebViewPrivate.h. * WebView/WebHTMLView.h: * WebView/WebViewPrivate.h: * WebView/WebView.mm: 2006-11-01 John Sullivan <sullivan@apple.com> Reviewed by Adam Roben - fixed <rdar://problem/4801351> Crash reloading PDF file in new Safari (or closing a window containing a PDF file) * WebView/WebPDFView.mm: (-[WebPDFView initWithFrame:]): Retain the PDFSubview in the code path where we just obtain it by asking the PDFPreviewView for it. We were unconditionally releasing it in dealloc, but only retaining it in one of the two code paths. 2006-10-31 Mark Rowe <bdash@webkit.org> Reviewed by Maciej. Fix null pointer dereference while running editing/pasteboard/drag-drop-modifies-page.html * Misc/WebElementDictionary.m: (-[WebElementDictionary _image]): Add null check. 2006-10-31 Beth Dakin <bdakin@apple.com> Reviewed by Maciej. This creates local functions for the remaining WebElementDictionary members that calls into HitTestResult instead of doing magical things with the Objective-C DOM classes. * ChangeLog: * Misc/WebElementDictionary.m: (addLookupKey): The values of the dictionary are now just selectors. They used to be WebElementMethods which were WebElementTargetObjects associated with selectors, but none of that is needed any more. (+[WebElementDictionary initializeLookupTable]): All selectors are now local functions, no more WebElementTargetObjects. (-[WebElementDictionary objectForKey:]): No more target objects! (-[WebElementDictionary _domNode]): Call into HitTestResult member variable. (-[WebElementDictionary _altDisplayString]): Same. (-[WebElementDictionary _image]): Same. (-[WebElementDictionary _absoluteImageURL]): Same. (-[WebElementDictionary _title]): Same. (-[WebElementDictionary _absoluteLinkURL]): Same. (-[WebElementDictionary _targetWebFrame]): Same. (-[WebElementDictionary _titleDisplayString]): Same. (-[WebElementDictionary _textContent]): Same. 2006-10-31 Geoffrey Garen <ggaren@apple.com> Reviewed by Alice. Moved some Editing code from WebKit, the bridge, and WebCore::Frame down to WebCore::Editor. * WebCoreSupport/WebFrameBridge.mm: * WebView/WebHTMLView.m: (-[WebHTMLView _shouldDeleteRange:]): (-[WebHTMLView _canCopy]): (-[WebHTMLView _canCut]): (-[WebHTMLView _canDelete]): (-[WebHTMLView _canPaste]): (-[WebHTMLView _canEdit]): (-[WebHTMLView _canEditRichly]): (-[WebHTMLView _isEditable]): (-[WebHTMLView _isSelectionInPasswordField]): (-[NSArray validateUserInterfaceItem:]): (-[NSArray _expandSelectionToGranularity:]): 2006-10-31 John Sullivan <sullivan@apple.com> Reviewed by Beth and Adam Display a tooltip when hovering over marked bad grammar. * Misc/WebElementDictionary.m: (+[WebElementDictionary initializeLookupTable]): support spelling tool tip (-[WebElementDictionary _spellingToolTip]): new method, calls through to HitTestResult * WebView/WebHTMLView.m: (-[WebHTMLView _updateMouseoverWithEvent:]): Check for a spelling tool tip; if found, prefer it over the other possible tool tips. Check for empty strings instead of just nil strings being, since values from WebElementDictionary are empty strings. * WebView/WebViewPrivate.h: declare new string constant WebElementSpellingToolTipKey * WebView/WebView.mm: define new string constant WebElementSpellingToolTipKey 2006-10-31 Beth Dakin <bdakin@apple.com> Reviewed by Maciej. Small tweaks to WebKit because of http://bugs.webkit.org/ show_bug.cgi?id=11461 HitTestResult should be split into HitTestRequest and HitTestResult * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLView.m: (-[WebHTMLView elementAtPoint:allowShadowContent:]): The HitTestResult initializer now just takes a point. 2006-10-31 Darin Adler <darin@apple.com> Reviewed by Brady. - got "action dictionary" code out of FrameLoader, replacing with a class called NavigationAction * WebCoreSupport/WebFrameLoaderClient.h: Changed parameter types to NavigationAction. Made elementForEvent non-virtual. Added actionDictionary function. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Changed parameter type, and used actionDictionary to make the action dictionary. (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto. (WebFrameLoaderClient::actionDictionary): Added. Code that was originally in WebCore that creates the action dictionary (from a NavigationAction). * WebView/WebFrame.mm: (-[WebFrame _loadItem:withLoadType:]): Use NavigationAction instead of a dictionary for the action parameters. 2006-10-31 Marvin Decker <marv.decker@gmail.com> Reviewed by Maciej. - fixed "Stop and reload don't work on the WebView" http://bugs.webkit.org/show_bug.cgi?id=11285 * COM/WebFrame.cpp: (WebFrame::stopLoading): Implement. * COM/WebView.cpp: (WebView::stopLoading): ditto (WebView::reload): ditto 2006-10-30 Darin Adler <darin@apple.com> * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): Fix comment. 2006-10-30 John Sullivan <sullivan@apple.com> Reviewed by Geoff Garen * WebView/WebHTMLView.m: (-[NSArray checkSpelling:]): removed code to update spelling panel; WebCore handles that now (-[NSArray showGuessPanel:]): ditto 2006-10-30 John Sullivan <sullivan@apple.com> * English.lproj/WebViewEditingContextMenu.nib/info.nib: * English.lproj/WebViewEditingContextMenu.nib/objects.nib: Another wording change to match framework, post-Tiger: "Check Spelling" -> "Check Document Now" 2006-10-30 John Sullivan <sullivan@apple.com> Reviewed by Geoff Garen. Moved spelling-related methods from bridge to EditorClient. Added one not-yet-used grammar-related method. * WebCoreSupport/WebEditorClient.h: declare overrides of isContinuousSpellCheckingEnabled(), spellCheckerDocumentTag(), and new isGrammarCheckingEnabled() * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::isContinuousSpellCheckingEnabled): implement by calling through to WebView (WebEditorClient::isGrammarCheckingEnabled): ditto (WebEditorClient::spellCheckerDocumentTag): ditto * WebCoreSupport/WebFrameBridge.mm: removed bridge equivalents of these methods 2006-10-30 Geoffrey Garen <ggaren@apple.com> Reviewed by Beth. Fixed nil-deref crash that I saw while using TOT (not sure how to repro, but the debugger confirmed the cause). * WebView/WebFrame.mm: (core): Added check for NULL bridge. 2006-10-30 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin. Removed a number of editing and selection methods from the bridge. I moved cross-platform editing and selection code into WebCore::Editor and WebCore::SelectionController, respecitvely. All of the seemingly new code here is just code grabbed from WebCore or merged from WebCoreFrameBridge. I changed one piece of internal API: we now pass around Ranges in places where we used to pass around broken out components of Ranges. I also added WebCore XPATH_SUPPORT AND SVG_SUPPORT #defines to the project. Since we now include WebCore headers that depend on these #defines, we need to keep in sync with them, to avoid binary incompatibility. 2006-10-30 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - work toward removing Objective-C data types from FrameLoader.h: removed NSDate, NSString, WebCorePageState, WebCoreResourceLoader, and WebCoreResourceHandle - moved bodyBackgroundColor function here from Frame * History/WebHistoryItem.m: (+[WebHistoryItem _closeObjectsInPendingPageCaches]): Updated for change in WebCorePageState. * WebCoreSupport/WebFrameBridge.mm: Removed saveDocumentToPageCache method. * WebCoreSupport/WebFrameLoaderClient.h: Changed NSDate to double. * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::invalidateCurrentItemPageCache): Moved the code that was formerly in invalidatePageCache: on the bridge here. (WebFrameLoaderClient::dispatchWillPerformClientRedirect): Added code to make the NSDate here. (WebFrameLoaderClient::createPageCache): Restructured code to create the WebCorePageState object directly instead of calling saveDocumentToPageCache on the bridge. * WebView/WebFrame.mm: (-[WebFrame _bodyBackgroundColor]): Rewrote this to work directly with the DOM and renderers rather than using a function on Frame. 2006-10-29 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - added ResourceResponse class and didReceiveResponse delegate call * WebCoreSupport/WebFrameBridge.mm: Removed no longer needed expiresTimeForResponse: method. 2006-10-29 Darin Adler <darin@apple.com> - update for the WebCore rename * WebCoreSupport/WebFrameLoaderClient.mm: * WebView/WebFrame.mm: 2006-10-29 Darin Adler <darin@apple.com> - update for the WebCore renames * Plugins/WebNetscapePluginStream.mm: * Plugins/WebPluginController.mm: * WebCoreSupport/WebFrameBridge.mm: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::willUseArchive): (WebFrameLoaderClient::isArchiveLoadPending): (WebFrameLoaderClient::cancelPendingArchiveLoad): (WebFrameLoaderClient::deliverArchivedResources): * WebCoreSupport/WebPageBridge.mm: (-[WebPageBridge canRunModalNow]): * WebView/WebDocumentLoaderMac.h: * WebView/WebFrame.mm: * WebView/WebHTMLRepresentation.m: * WebView/WebView.mm: 2006-10-29 Darin Adler <darin@apple.com> Rubber stamped by Adam Roben. - renamed WebCore's WebFrameLoaderClient to match the class name inside it * WebCoreSupport/WebFrameBridge.mm: Update include. * WebCoreSupport/WebFrameLoaderClient.h: Ditto. 2006-10-29 Darin Adler <darin@apple.com> Reviewed by Maciej. - eliminate use of NSArray to carry form data around (the code in this framework was actually using the NSArray to hold a single NSData anyway, so I just went back to an NSData for now) - also fixed http://bugs.webkit.org/show_bug.cgi?id=11444 REGRESSION (r17378): Exception (-[NSCFDictionary setObject:forKey:]: attempt to insert nil value) when submitting a form with an empty uninitialized field * History/WebHistoryItem.m: (-[WebHistoryItem _setFormInfoFromRequest:]): (-[WebHistoryItem formData]): * History/WebHistoryItemPrivate.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchWillSubmitForm): * WebView/WebFrame.mm: (-[WebFrame _loadItem:withLoadType:]): 2006-10-28 Darin Adler <darin@apple.com> Reviewed by Maciej. - eliminated the use of Objective-C for the policy decider machinery, obviating the need for WebPolicyDeciderMac - moved the defersLoading flag from WebView to WebCore::Page - removed unused copies of four methods that in the frame bridge; the actually-used copies are in the page bridge - updated for rename of PassRefPtr::release to releaseRef * WebView/WebPolicyDeciderMac.h: Removed. * WebView/WebPolicyDeciderMac.m: Removed. * WebKit.xcodeproj/project.pbxproj: Updated for removal. * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView sendEvent:]): * Plugins/WebNetscapePluginStream.mm: * WebCoreSupport/WebFrameBridge.mm: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (getWebView): (WebFrameLoaderClient::WebFrameLoaderClient): (WebFrameLoaderClient::willCloseDocument): (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType): (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): (WebFrameLoaderClient::cancelPolicyCheck): (WebFrameLoaderClient::dispatchWillSubmitForm): (WebFrameLoaderClient::setDefersLoading): (WebFrameLoaderClient::setTitle): (WebFrameLoaderClient::deliverArchivedResourcesAfterDelay): (WebFrameLoaderClient::deliverArchivedResources): (WebFrameLoaderClient::setUpPolicyListener): (WebFrameLoaderClient::receivedPolicyDecison): (WebFrameLoaderClient::userAgent): (-[WebFramePolicyListener initWithWebCoreFrame:]): (-[WebFramePolicyListener invalidate]): (-[WebFramePolicyListener dealloc]): (-[WebFramePolicyListener finalize]): (-[WebFramePolicyListener receivedPolicyDecision:]): (-[WebFramePolicyListener ignore]): (-[WebFramePolicyListener download]): (-[WebFramePolicyListener use]): (-[WebFramePolicyListener continue]): * WebCoreSupport/WebPageBridge.mm: (-[WebPageBridge runModal]): * WebView/WebArchiver.m: (+[WebArchiver archiveSelectionInFrame:]): * WebView/WebFormDelegate.h: * WebView/WebFormDelegate.m: (+[WebFormDelegate _sharedWebFormDelegate]): (-[WebFormDelegate textFieldDidBeginEditing:inFrame:]): (-[WebFormDelegate textFieldDidEndEditing:inFrame:]): (-[WebFormDelegate textDidChangeInTextField:inFrame:]): (-[WebFormDelegate textDidChangeInTextArea:inFrame:]): (-[WebFormDelegate frame:sourceFrame:willSubmitForm:withValues:submissionListener:]): * WebView/WebFrame.mm: (-[WebFrame _loadURL:referrer:intoChild:]): (-[WebFrame _isFrameSet]): * WebView/WebFrameInternal.h: * WebView/WebFrameView.mm: (-[WebFrameView _shouldDrawBorder]): * WebView/WebHTMLView.m: (-[NSArray knowsPageRange:]): * WebView/WebView.mm: (-[WebView _formDelegate]): * WebView/WebViewInternal.h: * WebView/WebViewPrivate.h: 2006-10-28 Adam Roben <aroben@apple.com> Reviewed by Maciej. Fix layout tests that broke after r17399. Mitz discovered that the failures were caused by HitTestResult::m_point being uninitialized much of the time. HitTestResults are now always constructed with a point. * WebView/WebHTMLView.m: (-[WebHTMLView elementAtPoint:allowShadowContent:]): Pass point to HitTestResult constructor. 2006-10-28 Beth Dakin <bdakin@apple.com> Reviewed by Darin. This is the WebKit half of pushing the guts of elementAtPoint and WebElementDictionary into WebCore. Among other things, this patch makes WebElementDictionary.m and WebHTMLView.m Objective-C++ * MigrateHeaders.make: Add DOMElementInternal.h to the list of headers to migrate. * Misc/WebElementDictionary.h: Replaced DOMNode, DOMElement, and NSPoint member variables with a HitTestResult member variable. * Misc/WebElementDictionary.m: (addLookupKey): Formatting. (-[WebElementDictionary initWithHitTestResult:]): Constructor just takes a HitTestResult now and sets the member variable. (-[WebElementDictionary dealloc]): delete HitTestResult. (-[WebElementDictionary finalize]): Address HitTestResult. (-[WebElementDictionary _domNode]): Use HitTestResult and call into WebCore. (-[WebElementDictionary objectForKey:]): Same. (-[WebElementDictionary _webFrame]): Same. (-[WebElementDictionary _targetWebFrame]): Same. (-[WebElementDictionary _title]): Same. (-[WebElementDictionary _imageRect]): Same. (-[WebElementDictionary _isSelected]): Same. * WebKit.xcodeproj/project.pbxproj: * WebView/WebFrame.mm: (core): Convert from DOMNode* to Node* (kit): Convert from Node* to DOMNode* * WebView/WebFrameInternal.h: Support for the above. * WebView/WebHTMLView.m: (-[WebHTMLView elementAtPoint:allowShadowContent:]): Call directly into Frame.cpp to get HitTestResult. 2006-10-27 Maciej Stachowiak <mjs@apple.com> Reviewed by John & Adam. - various performance improvements for resource delegate dispatch. - avoid any ObjC messaging when fetching the WebView - avoid ObjC calls to WebView to get resource load delegate and impl cache - cache actual method pointers, not just the fact that the method is present - added a new SPI resource load delegate method which allows clients to get just one message in case of synchronously loading from memory cache; if this is implemented you don't get the normal delegate calls in that case. - various other minor tweaks * WebCoreSupport/WebFrameBridge.h: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (getWebView): (WebFrameLoaderClient::hasBackForwardList): (WebFrameLoaderClient::resetBackForwardList): (WebFrameLoaderClient::privateBrowsingEnabled): (WebFrameLoaderClient::updateHistoryForStandardLoad): (WebFrameLoaderClient::resetAfterLoadError): (WebFrameLoaderClient::download): (WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache): (WebFrameLoaderClient::dispatchIdentifierForInitialRequest): (WebFrameLoaderClient::dispatchWillSendRequest): (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidReceiveResponse): (WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebFrameLoaderClient::dispatchDidFinishLoading): (WebFrameLoaderClient::dispatchDidFailLoading): (WebFrameLoaderClient::dispatchDidHandleOnloadEvents): (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebFrameLoaderClient::dispatchDidCancelClientRedirect): (WebFrameLoaderClient::dispatchWillPerformClientRedirect): (WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): (WebFrameLoaderClient::dispatchWillClose): (WebFrameLoaderClient::dispatchDidReceiveIcon): (WebFrameLoaderClient::dispatchDidStartProvisionalLoad): (WebFrameLoaderClient::dispatchDidReceiveTitle): (WebFrameLoaderClient::dispatchDidCommitLoad): (WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebFrameLoaderClient::dispatchDidFailLoad): (WebFrameLoaderClient::dispatchDidFinishLoad): (WebFrameLoaderClient::dispatchDidFirstLayout): (WebFrameLoaderClient::dispatchCreatePage): (WebFrameLoaderClient::dispatchShow): (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType): (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): (WebFrameLoaderClient::dispatchUnableToImplementPolicy): (WebFrameLoaderClient::dispatchWillSubmitForm): (WebFrameLoaderClient::dispatchDidLoadMainResource): (WebFrameLoaderClient::progressStarted): (WebFrameLoaderClient::progressCompleted): (WebFrameLoaderClient::incrementProgress): (WebFrameLoaderClient::completeProgress): (WebFrameLoaderClient::setMainFrameDocumentReady): (WebFrameLoaderClient::startDownload): (WebFrameLoaderClient::willChangeTitle): (WebFrameLoaderClient::didChangeTitle): (WebFrameLoaderClient::mainFrameURL): (WebFrameLoaderClient::frameLoadCompleted): * WebCoreSupport/WebPageBridge.h: * WebKit.xcodeproj/project.pbxproj: * WebView/WebFrame.mm: (frame): (core): (kit): (getWebView): (-[WebFrame _addBackForwardItemClippedAtTarget:]): (-[WebFrame _canCachePage]): (-[WebFrame _purgePageCache]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _goToItem:withLoadType:]): (-[WebFrame _updateBackground]): (-[WebFrame _clearSelectionInOtherFrames]): (-[WebFrame _isMainFrame]): (-[WebFrame webView]): * WebView/WebResourceLoadDelegatePrivate.h: Added. * WebView/WebView.mm: (-[WebView _cacheResourceLoadDelegateImplementations]): (WebViewGetResourceLoadDelegate): (WebViewGetResourceLoadDelegateImplementations): * WebView/WebViewInternal.h: * WebView/WebViewPrivate.h: 2006-10-27 Geoffrey Garen <ggaren@apple.com> Reviewed by Maciej. Moved some WebCoreFrameBridge functions into FrameLoader. * WebView/WebFrame.mm: (-[WebFrame _numPendingOrLoadingRequests:]): 2006-10-27 Timothy Hatcher <timothy@apple.com> Reviewed by Beth. Make a DerivedSource/Webkit directory to store migrated internal headers from WebCore. * MigrateHeaders.make: * WebKit.xcodeproj/project.pbxproj: * WebView/WebFrame.mm: import the new migrated DOM*Internal.h headers 2006-10-27 John Sullivan <sullivan@apple.com> Reviewed by Anders - fixed http://bugs.webkit.org/show_bug.cgi?id=11439 REGRESSION: Another page loading crash * WebView/WebFrame.mm: (-[WebFrame _createItem:]): Handle nil documentLoader the way we did before ObjC->C++ changes 2006-10-27 John Sullivan <sullivan@apple.com> Reviewed by Anders * WebView/WebHTMLView.m: (-[NSArray checkSpelling:]): call advanceToNextMisspelling directly on FrameMac, bypassing bridge (-[NSArray showGuessPanel:]): ditto 2006-10-27 Darin Adler <darin@apple.com> - build fix * WebCoreSupport/WebFrameLoaderClient.mm: Corrected header file name. 2006-10-27 Darin Adler <darin@apple.com> Reviewed by Maciej. - moved methods that are there just to be called by the frame loader client into the client in an attempt to get back some of the speed we lost yesterday * DefaultDelegates/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate webView:resource:didReceiveAuthenticationChallenge:fromDataSource:]): (-[WebDefaultResourceLoadDelegate webView:resource:didCancelAuthenticationChallenge:fromDataSource:]): * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (dataSource): (decisionListener): (WebFrameLoaderClient::WebFrameLoaderClient): (WebFrameLoaderClient::hasWebView): (WebFrameLoaderClient::hasFrameView): (WebFrameLoaderClient::hasBackForwardList): (WebFrameLoaderClient::resetBackForwardList): (WebFrameLoaderClient::provisionalItemIsTarget): (WebFrameLoaderClient::loadProvisionalItemFromPageCache): (WebFrameLoaderClient::invalidateCurrentItemPageCache): (WebFrameLoaderClient::privateBrowsingEnabled): (WebFrameLoaderClient::makeDocumentView): (WebFrameLoaderClient::makeRepresentation): (WebFrameLoaderClient::setDocumentViewFromPageCache): (WebFrameLoaderClient::forceLayout): (WebFrameLoaderClient::forceLayoutForNonHTML): (WebFrameLoaderClient::updateHistoryForCommit): (WebFrameLoaderClient::updateHistoryForBackForwardNavigation): (WebFrameLoaderClient::updateHistoryForReload): (WebFrameLoaderClient::updateHistoryForStandardLoad): (WebFrameLoaderClient::updateHistoryForInternalLoad): (WebFrameLoaderClient::updateHistoryAfterClientRedirect): (WebFrameLoaderClient::setCopiesOnScroll): (WebFrameLoaderClient::tokenForLoadErrorReset): (WebFrameLoaderClient::resetAfterLoadError): (WebFrameLoaderClient::doNotResetAfterLoadError): (WebFrameLoaderClient::detachedFromParent1): (WebFrameLoaderClient::detachedFromParent2): (WebFrameLoaderClient::detachedFromParent3): (WebFrameLoaderClient::detachedFromParent4): (WebFrameLoaderClient::loadedFromPageCache): (WebFrameLoaderClient::download): (WebFrameLoaderClient::dispatchIdentifierForInitialRequest): (WebFrameLoaderClient::dispatchWillSendRequest): (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidReceiveResponse): (WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebFrameLoaderClient::dispatchDidFinishLoading): (WebFrameLoaderClient::dispatchDidFailLoading): (WebFrameLoaderClient::dispatchDidHandleOnloadEvents): (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebFrameLoaderClient::dispatchDidCancelClientRedirect): (WebFrameLoaderClient::dispatchWillPerformClientRedirect): (WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): (WebFrameLoaderClient::dispatchWillClose): (WebFrameLoaderClient::dispatchDidReceiveIcon): (WebFrameLoaderClient::dispatchDidStartProvisionalLoad): (WebFrameLoaderClient::dispatchDidReceiveTitle): (WebFrameLoaderClient::dispatchDidCommitLoad): (WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebFrameLoaderClient::dispatchDidFailLoad): (WebFrameLoaderClient::dispatchDidFinishLoad): (WebFrameLoaderClient::dispatchDidFirstLayout): (WebFrameLoaderClient::dispatchCreatePage): (WebFrameLoaderClient::dispatchShow): (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType): (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): (WebFrameLoaderClient::dispatchUnableToImplementPolicy): (WebFrameLoaderClient::dispatchWillSubmitForm): (WebFrameLoaderClient::dispatchDidLoadMainResource): (WebFrameLoaderClient::clearLoadingFromPageCache): (WebFrameLoaderClient::isLoadingFromPageCache): (WebFrameLoaderClient::revertToProvisionalState): (WebFrameLoaderClient::setMainDocumentError): (WebFrameLoaderClient::clearUnarchivingState): (WebFrameLoaderClient::progressStarted): (WebFrameLoaderClient::progressCompleted): (WebFrameLoaderClient::incrementProgress): (WebFrameLoaderClient::completeProgress): (WebFrameLoaderClient::setMainFrameDocumentReady): (WebFrameLoaderClient::startDownload): (WebFrameLoaderClient::willChangeTitle): (WebFrameLoaderClient::didChangeTitle): (WebFrameLoaderClient::committedLoad): (WebFrameLoaderClient::finishedLoading): (WebFrameLoaderClient::finalSetupForReplace): (WebFrameLoaderClient::cancelledError): (WebFrameLoaderClient::cannotShowURLError): (WebFrameLoaderClient::interruptForPolicyChangeError): (WebFrameLoaderClient::cannotShowMIMETypeError): (WebFrameLoaderClient::fileDoesNotExistError): (WebFrameLoaderClient::shouldFallBack): (WebFrameLoaderClient::mainFrameURL): (WebFrameLoaderClient::setDefersCallbacks): (WebFrameLoaderClient::willUseArchive): (WebFrameLoaderClient::isArchiveLoadPending): (WebFrameLoaderClient::cancelPendingArchiveLoad): (WebFrameLoaderClient::clearArchivedResources): (WebFrameLoaderClient::canHandleRequest): (WebFrameLoaderClient::canShowMIMEType): (WebFrameLoaderClient::representationExistsForURLScheme): (WebFrameLoaderClient::generatedMIMETypeForURLScheme): (WebFrameLoaderClient::elementForEvent): (WebFrameLoaderClient::createPolicyDecider): (WebFrameLoaderClient::frameLoadCompleted): (WebFrameLoaderClient::restoreScrollPositionAndViewState): (WebFrameLoaderClient::provisionalLoadStarted): (WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent): (WebFrameLoaderClient::addHistoryItemForFragmentScroll): (WebFrameLoaderClient::didFinishLoad): (WebFrameLoaderClient::prepareForDataSourceReplacement): (WebFrameLoaderClient::createDocumentLoader): (WebFrameLoaderClient::setTitle): (WebFrameLoaderClient::canUseArchivedResource): (WebFrameLoaderClient::deliverArchivedResourcesAfterDelay): (WebFrameLoaderClient::deliverArchivedResources): (WebFrameLoaderClient::createPageCache): * WebView/WebFrame.mm: (-[NSView setWebFrame:]): (-[WebFrame _createItem:]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _recursiveGoToItem:fromItem:withLoadType:]): (-[WebFrame _loadURL:referrer:intoChild:]): (-[WebFrame _saveScrollPositionAndViewStateToItem:]): (-[WebFrame _hasSelection]): (-[WebFrame _clearSelection]): (-[WebFrame _setProvisionalItem:]): (-[WebFrame _setPreviousItem:]): (-[WebFrame _setCurrentItem:]): (-[WebFrame loadArchive:]): * WebView/WebFrameInternal.h: * WebView/WebHTMLView.m: (-[WebHTMLView _topHTMLView]): * WebView/WebHTMLViewPrivate.h: 2006-10-26 Geoffrey Garen <ggaren@apple.com> Reviewed by Darin, Maciej. Removed many uses of NSString * from WebCore. Changed a few files to ObjC++ for compatiblity with new WebCore methods taking WebCore::Strings as arguments. Added a static_cast to make the c++ compiler happy. 2006-10-26 John Sullivan <sullivan@apple.com> Reviewed by Anders * WebView/WebFrame.mm: now includes <WebCore/Document.h> and <WebCore/DocumentMarker.h> (-[WebFrame _unmarkAllBadGrammar]): filled in guts (-[WebFrame _unmarkAllMisspellings]): rewrote to call Document directly, bypassing bridge 2006-10-26 John Sullivan <sullivan@apple.com> * English.lproj/WebViewEditingContextMenu.nib/info.nib: * English.lproj/WebViewEditingContextMenu.nib/objects.nib: Changed "Spelling" to "Spelling and Grammar" in context menu for post-Tiger. === Safari-521.29 === 2006-10-26 John Sullivan <sullivan@apple.com> No review, just two localized string changes. * WebView/WebHTMLView.m: (-[NSArray validateUserInterfaceItem:]): changed "Show/Hide Spelling" to "Show/Hide Spelling and Grammar" post-Tiger to match framework change * English.lproj/Localizable.strings: updated for these changes 2006-10-25 Darin Adler <darin@apple.com> Reviewed by Anders. - removed 55 methods from WebCoreFrameBridge - changed callers to use Frame directly instead - put FrameLoaderTypes.h types into the WebCore namespace - first steps to get FrameLoader.h ready for cross-platform duty * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate openNewWindowWithURL:element:]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView requestWithURLCString:]): (-[WebBaseNetscapePluginView loadPluginRequest:]): (-[WebBaseNetscapePluginView getVariable:value:]): * Plugins/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView didStart]): * Plugins/WebNetscapePluginStream.mm: * Plugins/WebPluginContainerCheck.m: (-[WebPluginContainerCheck _continueWithPolicy:]): (-[WebPluginContainerCheck _isForbiddenFileLoad]): * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::shouldDeleteRange): (WebEditorClient::shouldShowDeleteInterface): * WebCoreSupport/WebFrameBridge.mm: (-[WebFrameBridge webView]): (-[WebFrameBridge finishInitializingWithFrameName:view:]): (-[WebFrameBridge createWindowWithURL:]): (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]): (-[WebFrameBridge windowObjectCleared]): (-[WebFrameBridge createModalDialogWithURL:]): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchCreatePage): (WebFrameLoaderClient::dispatchWillSubmitForm): * WebKit.xcodeproj/project.pbxproj: * WebView/WebArchiver.m: (+[WebArchiver archiveSelectionInFrame:]): * WebView/WebDataSource.mm: (-[WebDataSource _documentFragmentWithImageResource:]): (-[WebDataSource _imageElementWithImageResource:]): * WebView/WebEditingDelegatePrivate.h: * WebView/WebFrame.mm: (core): (kit): (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]): (-[WebFrame _canCachePage]): (-[WebFrame _childFramesMatchItem:]): (-[WebFrame _URLsMatchItem:]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _recursiveGoToItem:fromItem:withLoadType:]): (-[WebFrame _viewWillMoveToHostWindow:]): (-[WebFrame _viewDidMoveToHostWindow]): (-[WebFrame _addChild:]): (-[WebFrame _saveDocumentAndScrollState]): (-[WebFrame _numPendingOrLoadingRequests:]): (-[WebFrame _reloadForPluginChanges]): (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]): (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]): (-[WebFrame _initWithWebFrameView:webView:coreFrame:]): (-[WebFrame _documentViews]): (-[WebFrame _updateBackground]): (-[WebFrame _unmarkAllMisspellings]): (-[WebFrame _hasSelection]): (-[WebFrame _atMostOneFrameHasSelection]): (-[WebFrame _findFrameWithSelection]): (-[WebFrame _frameLoader]): (-[WebFrame _isDescendantOfFrame:]): (-[WebFrame _setShouldCreateRenderers:]): (-[WebFrame _bodyBackgroundColor]): (-[WebFrame init]): (-[WebFrame initWithName:webFrameView:webView:]): (-[WebFrame dealloc]): (-[WebFrame finalize]): (-[WebFrame name]): (-[WebFrame webView]): (-[WebFrame DOMDocument]): (-[WebFrame frameElement]): (-[WebFrame findFrameNamed:]): (-[WebFrame parentFrame]): (-[WebFrame childFrames]): (-[WebFrame _invalidateCurrentItemPageCache]): (-[WebFrame _dispatchCreateWebViewWithRequest:]): (-[WebFrame _dispatchSourceFrame:willSubmitForm:withValues:submissionDecider:]): (-[WebFrame _prepareForDataSourceReplacement]): (-[WebFrame _provisionalLoadStarted]): * WebView/WebFrameInternal.h: * WebView/WebHTMLRepresentation.m: (-[WebHTMLRepresentation DOMDocument]): (-[WebHTMLRepresentation attributedText]): * WebView/WebHTMLView.m: (-[WebHTMLView _documentRange]): (-[WebHTMLView _documentFragmentWithPaths:]): (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]): (-[WebHTMLView _selectedRange]): (-[WebHTMLView _updateMouseoverWithEvent:]): (-[WebHTMLView _canEditRichly]): (-[WebHTMLView _hasSelection]): (-[WebHTMLView _hasSelectionOrInsertionPoint]): (-[WebHTMLView _hasInsertionPoint]): (-[WebHTMLView _isEditable]): (-[WebHTMLView _isSelectionInPasswordField]): (-[WebHTMLView _lookUpInDictionaryFromMenu:]): (-[WebHTMLView _selectionDraggingImage]): (-[WebHTMLView _canIncreaseSelectionListLevel]): (-[WebHTMLView _canDecreaseSelectionListLevel]): (-[WebHTMLView _updateActiveState]): (-[NSArray readSelectionFromPasteboard:]): (-[NSArray validateUserInterfaceItem:]): (-[NSArray maintainsInactiveSelection]): (-[NSArray menuForEvent:]): (-[NSArray scrollWheel:]): (-[NSArray acceptsFirstMouse:]): (-[NSArray shouldDelayWindowOrderingForEvent:]): (-[NSArray mouseDown:]): (-[NSArray mouseDragged:]): (-[NSArray mouseUp:]): (-[NSArray keyDown:]): (-[NSArray keyUp:]): (-[NSArray centerSelectionInVisibleArea:]): (-[NSArray _selectionStartFontAttributesAsRTF]): (-[NSArray _emptyStyle]): (-[NSArray performKeyEquivalent:]): (-[NSArray indent:]): (-[NSArray outdent:]): (-[WebHTMLView cut:]): (-[WebHTMLView paste:]): (-[WebHTMLView _selectRangeInMarkedText:]): (-[WebTextCompleteController doCompletion]): (-[WebHTMLView selectionRect]): (-[WebHTMLView selectionImageForcingWhiteText:]): (-[WebHTMLView selectionImageRect]): (-[WebHTMLView attributedString]): (-[WebHTMLView _isMoveDrag]): (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): * WebView/WebPolicyDelegate.mm: (-[WebPolicyDecisionListener _usePolicy:]): (-[WebPolicyDecisionListener use]): (-[WebPolicyDecisionListener ignore]): (-[WebPolicyDecisionListener download]): (-[WebPolicyDecisionListener continue]): * WebView/WebScriptDebugDelegate.m: (-[WebScriptCallFrame _initWithFrame:initWithWebFrame:]): (-[WebScriptCallFrame globalObject]): * WebView/WebView.mm: (-[WebView _attachScriptDebuggerToAllFrames]): (-[WebView _detachScriptDebuggerFromAllFrames]): (-[WebView windowScriptObject]): (incrementFrame): (-[WebView searchFor:direction:caseSensitive:wrap:]): (-[WebView writeSelectionWithPasteboardTypes:toPasteboard:]): (-[WebView removeDragCaret]): (-[WebView setScriptDebugDelegate:]): (-[WebView scriptDebugDelegate]): (-[WebView shouldClose]): (-[WebView selectedDOMRange]): (-[WebView styleDeclarationWithText:]): 2006-10-25 Geoffrey Garen <ggaren@apple.com> Reviewed by Adam. Renamed WebFrameLoader to FrameLoader, to match class name. * Plugins/WebBaseNetscapePluginView.mm: * Plugins/WebNetscapePluginStream.mm: * Plugins/WebPluginController.mm: * WebCoreSupport/WebFrameBridge.mm: * WebView/WebDataSource.mm: * WebView/WebFrame.mm: * WebView/WebPDFView.mm: * WebView/WebPolicyDelegate.mm: * WebView/WebView.mm: 2006-10-25 Mark Rowe <bdash@webkit.org> Reviewed by Anders. Build fix for the Buildbot. * WebView/WebHTMLView.m: (-[NSArray _addToStyle:fontA:fontB:]): Explicit cast. 2006-10-25 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. <rdar://problem/4785575> REGRESSION: form resubmission warning occurs twice, then Safari crashes in autorelease pool <rdar://problem/4799383> REGRESSION: Crash occurs when dismissing the "Would you like to save this password" sheet * WebView/WebPolicyDeciderMac.m: (-[WebPolicyDeciderMac dealloc]): release the listener, don't dealloc it 2006-10-24 Anders Carlsson <acarlsson@apple.com> Reviewed by Darin. * WebKitPrefix.h: Include FastMalloc.h from C++ code. 2006-10-24 Darin Adler <darin@apple.com> Reviewed by Anders. - converted WebFrameLoaderClient to C++ - renamed frame->frameLoader() function to frame->loader() - renamed [bridge impl] to [bridge _frame] - removed some bridge methods * Plugins/WebNetscapePluginStream.mm: * WebCoreSupport/WebEditorClient.mm: * WebCoreSupport/WebFrameLoaderClient.h: Added. (WebFrameLoaderClient::webFrame): * WebCoreSupport/WebFrameLoaderClient.mm: Added. (WebFrameLoaderClient::detachFrameLoader): (WebFrameLoaderClient::hasWebView): (WebFrameLoaderClient::hasFrameView): (WebFrameLoaderClient::hasBackForwardList): (WebFrameLoaderClient::resetBackForwardList): (WebFrameLoaderClient::provisionalItemIsTarget): (WebFrameLoaderClient::loadProvisionalItemFromPageCache): (WebFrameLoaderClient::invalidateCurrentItemPageCache): (WebFrameLoaderClient::privateBrowsingEnabled): (WebFrameLoaderClient::makeDocumentView): (WebFrameLoaderClient::makeRepresentation): (WebFrameLoaderClient::setDocumentViewFromPageCache): (WebFrameLoaderClient::forceLayout): (WebFrameLoaderClient::forceLayoutForNonHTML): (WebFrameLoaderClient::updateHistoryForCommit): (WebFrameLoaderClient::updateHistoryForBackForwardNavigation): (WebFrameLoaderClient::updateHistoryForReload): (WebFrameLoaderClient::updateHistoryForStandardLoad): (WebFrameLoaderClient::updateHistoryForInternalLoad): (WebFrameLoaderClient::updateHistoryAfterClientRedirect): (WebFrameLoaderClient::setCopiesOnScroll): (WebFrameLoaderClient::tokenForLoadErrorReset): (WebFrameLoaderClient::resetAfterLoadError): (WebFrameLoaderClient::doNotResetAfterLoadError): (WebFrameLoaderClient::detachedFromParent1): (WebFrameLoaderClient::detachedFromParent2): (WebFrameLoaderClient::detachedFromParent3): (WebFrameLoaderClient::detachedFromParent4): (WebFrameLoaderClient::loadedFromPageCache): (WebFrameLoaderClient::download): (WebFrameLoaderClient::dispatchIdentifierForInitialRequest): (WebFrameLoaderClient::dispatchWillSendRequest): (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge): (WebFrameLoaderClient::dispatchDidReceiveResponse): (WebFrameLoaderClient::dispatchDidReceiveContentLength): (WebFrameLoaderClient::dispatchDidFinishLoading): (WebFrameLoaderClient::dispatchDidFailLoading): (WebFrameLoaderClient::dispatchDidHandleOnloadEvents): (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebFrameLoaderClient::dispatchDidCancelClientRedirect): (WebFrameLoaderClient::dispatchWillPerformClientRedirect): (WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): (WebFrameLoaderClient::dispatchWillClose): (WebFrameLoaderClient::dispatchDidReceiveIcon): (WebFrameLoaderClient::dispatchDidStartProvisionalLoad): (WebFrameLoaderClient::dispatchDidReceiveTitle): (WebFrameLoaderClient::dispatchDidCommitLoad): (WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebFrameLoaderClient::dispatchDidFailLoad): (WebFrameLoaderClient::dispatchDidFinishLoad): (WebFrameLoaderClient::dispatchDidFirstLayout): (WebFrameLoaderClient::dispatchCreatePage): (WebFrameLoaderClient::dispatchShow): (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType): (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): (WebFrameLoaderClient::dispatchUnableToImplementPolicy): (WebFrameLoaderClient::dispatchWillSubmitForm): (WebFrameLoaderClient::dispatchDidLoadMainResource): (WebFrameLoaderClient::clearLoadingFromPageCache): (WebFrameLoaderClient::isLoadingFromPageCache): (WebFrameLoaderClient::revertToProvisionalState): (WebFrameLoaderClient::setMainDocumentError): (WebFrameLoaderClient::clearUnarchivingState): (WebFrameLoaderClient::progressStarted): (WebFrameLoaderClient::progressCompleted): (WebFrameLoaderClient::incrementProgress): (WebFrameLoaderClient::completeProgress): (WebFrameLoaderClient::setMainFrameDocumentReady): (WebFrameLoaderClient::startDownload): (WebFrameLoaderClient::willChangeTitle): (WebFrameLoaderClient::didChangeTitle): (WebFrameLoaderClient::committedLoad): (WebFrameLoaderClient::finishedLoading): (WebFrameLoaderClient::finalSetupForReplace): (WebFrameLoaderClient::cancelledError): (WebFrameLoaderClient::cannotShowURLError): (WebFrameLoaderClient::interruptForPolicyChangeError): (WebFrameLoaderClient::cannotShowMIMETypeError): (WebFrameLoaderClient::fileDoesNotExistError): (WebFrameLoaderClient::shouldFallBack): (WebFrameLoaderClient::mainFrameURL): (WebFrameLoaderClient::setDefersCallbacks): (WebFrameLoaderClient::willUseArchive): (WebFrameLoaderClient::isArchiveLoadPending): (WebFrameLoaderClient::cancelPendingArchiveLoad): (WebFrameLoaderClient::clearArchivedResources): (WebFrameLoaderClient::canHandleRequest): (WebFrameLoaderClient::canShowMIMEType): (WebFrameLoaderClient::representationExistsForURLScheme): (WebFrameLoaderClient::generatedMIMETypeForURLScheme): (WebFrameLoaderClient::elementForEvent): (WebFrameLoaderClient::createPolicyDecider): (WebFrameLoaderClient::frameLoadCompleted): (WebFrameLoaderClient::restoreScrollPositionAndViewState): (WebFrameLoaderClient::provisionalLoadStarted): (WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent): (WebFrameLoaderClient::addHistoryItemForFragmentScroll): (WebFrameLoaderClient::didFinishLoad): (WebFrameLoaderClient::prepareForDataSourceReplacement): (WebFrameLoaderClient::createDocumentLoader): (WebFrameLoaderClient::setTitle): * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.mm: (-[WebDataSource webFrame]): * WebView/WebFrame.mm: (frame): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _reloadForPluginChanges]): (-[WebFrame _initWithWebFrameView:webView:bridge:]): (-[WebFrame _frameLoader]): (-[WebFrame provisionalDataSource]): (-[WebFrame dataSource]): (-[WebFrame parentFrame]): (-[WebFrame _provisionalLoadStarted]): * WebView/WebFrameInternal.h: * WebView/WebHTMLRepresentation.m: (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): * WebView/WebHTMLView.m: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): (-[NSArray validateUserInterfaceItem:]): (-[NSArray scrollWheel:]): (-[NSArray acceptsFirstMouse:]): (-[NSArray shouldDelayWindowOrderingForEvent:]): (-[NSArray _selectionStartFontAttributesAsRTF]): (-[NSArray changeBaseWritingDirection:]): (-[NSArray indent:]): (-[NSArray outdent:]): (-[WebHTMLView copy:]): (-[WebHTMLView cut:]): (-[WebHTMLView paste:]): * WebView/WebView.mm: (-[WebView _dashboardRegions]): (-[WebView setProhibitsMainFrameScrolling:]): (-[WebView _setInViewSourceMode:]): (-[WebView _inViewSourceMode]): (-[WebView setEditable:]): 2006-10-24 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker - fixed <rdar://problem/4801331> "Spelling..." menu item should be "Show/Hide Spelling" post-Tiger, to match AppKit * WebView/WebHTMLView.m: (-[NSArray validateUserInterfaceItem:]): post-Tiger, update the menu item text to "Show Spelling"/"Hide Spelling" based on whether the spelling panel is already showing. Also, removed else's after returns, and removed braces around one-line if clauses. (-[NSArray showGuessPanel:]): post-Tiger, make this item hide the spelling panel if it's already showing * English.lproj/Localizable.strings: updated for this change 2006-10-24 Timothy Hatcher <timothy@apple.com> Reviewed by Anders. <rdar://problem/4588878> 'WebHTMLView' may not respond to '-_webView' * Misc/WebNSViewExtras.h: * Misc/WebNSViewExtras.m: (-[NSView _webView]): 2006-10-24 Brady Eidson <beidson@apple.com> Reviewed by Anders http://bugs.webkit.org/show_bug.cgi?id=11406 - Crash in [WebFrame dataSource] In the transition to ObjC++ we lost alot of our free nil checking that we must now do manually to prevent null dereferencing. * WebView/WebFrame.mm: (-[WebFrame provisionalDataSource]): (-[WebFrame dataSource]): 2006-10-24 John Sullivan <sullivan@apple.com> Reviewed by Darin Initial plumbing for grammar checking. No actual grammar are checked at this time. * English.lproj/WebViewEditingContextMenu.nib/classes.nib: * English.lproj/WebViewEditingContextMenu.nib/info.nib: * English.lproj/WebViewEditingContextMenu.nib/objects.nib: Added grammar-checking item, reworded to match changes in framework. This will be used post-Tiger. * English.lproj/WebViewEditingContextMenuOld.nib/classes.nib: Added. * English.lproj/WebViewEditingContextMenuOld.nib/info.nib: Added. * English.lproj/WebViewEditingContextMenuOld.nib/objects.nib: Added. Copy of WebViewEditingContextMenu.nib, unchanged. This will be used on Tiger. * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate editingContextMenuItemsForElement:defaultMenuItems:]): Choose the right context menu based on BUILDING_ON_TIGER. * WebView/WebPreferenceKeysPrivate.h: declare grammar-related NSUserDefault value * WebView/WebViewPrivate.h: declare grammar-related methods * WebView/WebView.mm: declare static BOOL grammarCheckingEnabled (-[WebViewPrivate init]): initialize grammarCheckingEnabled to NSUserDefaults value (-[WebView validateUserInterfaceItem:]): validate toggleGrammarChecking: menu item (-[WebView isGrammarCheckingEnabled]): return value of grammarCheckingEnabled (-[WebView setGrammarCheckingEnabled:]): set value of grammarCheckingEnabled, call frame to remove existing bad grammar markers (-[WebView toggleGrammarChecking:]): flip the value * WebView/WebFrameInternal.h: * WebView/WebFrame.mm: (-[WebFrame _unmarkAllBadGrammar]): new placeholder method, does nothing yet * WebView/WebHTMLViewInternal.h: declare grammar-related methods * WebView/WebHTMLView.m: (-[NSArray validateUserInterfaceItem:]): validate toggleGrammarChecking: menu item (-[WebHTMLView isGrammarCheckingEnabled]): new method, calls through to WebView (-[WebHTMLView setGrammarCheckingEnabled:]): ditto (-[WebHTMLView toggleGrammarChecking:]): ditto * English.lproj/StringsNotToBeLocalized.txt: Updated for these changes * WebKit.xcodeproj/project.pbxproj: updated for new files 2006-10-23 Darin Adler <darin@apple.com> Reviewed by Geoff. - converted WebDocumentLoader to C++ * Plugins/WebPluginController.mm: (-[WebPluginController pluginView:receivedResponse:]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.mm: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _mainDocumentError]): (-[WebDataSource _URL]): (-[WebDataSource _loadFromPageCache:]): (-[WebDataSource _bridge]): (-[WebDataSource _URLForHistory]): (-[WebDataSource _documentLoader]): (-[WebDataSource _initWithDocumentLoader:]): (-[WebDataSource initWithRequest:]): (-[WebDataSource data]): (-[WebDataSource webFrame]): (-[WebDataSource initialRequest]): (-[WebDataSource request]): (-[WebDataSource response]): (-[WebDataSource textEncodingName]): (-[WebDataSource isLoading]): (-[WebDataSource unreachableURL]): (-[WebDataSource webArchive]): * WebView/WebDataSourceInternal.h: * WebView/WebDocumentLoaderMac.h: * WebView/WebDocumentLoaderMac.mm: (WebDocumentLoaderMac::WebDocumentLoaderMac): (WebDocumentLoaderMac::setDataSource): (WebDocumentLoaderMac::dataSource): (WebDocumentLoaderMac::attachToFrame): (WebDocumentLoaderMac::detachFromFrame): * WebView/WebFrame.mm: (-[WebFrame _createItem:]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _addChild:]): (dataSource): (-[WebFrame _dataSourceForDocumentLoader:]): (-[WebFrame _addDocumentLoader:toUnarchiveState:]): (-[WebFrame loadArchive:]): (-[WebFrame _updateHistoryForReload]): (-[WebFrame _updateHistoryForStandardLoad]): (-[WebFrame _updateHistoryForInternalLoad]): (-[WebFrame _dispatchIdentifierForInitialRequest:fromDocumentLoader:]): (-[WebFrame _dispatchResource:willSendRequest:redirectResponse:fromDocumentLoader:]): (-[WebFrame _dispatchDidReceiveAuthenticationChallenge:forResource:fromDocumentLoader:]): (-[WebFrame _dispatchDidCancelAuthenticationChallenge:forResource:fromDocumentLoader:]): (-[WebFrame _dispatchResource:didReceiveResponse:fromDocumentLoader:]): (-[WebFrame _dispatchResource:didReceiveContentLength:fromDocumentLoader:]): (-[WebFrame _dispatchResource:didFinishLoadingFromDocumentLoader:]): (-[WebFrame _dispatchResource:didFailLoadingWithError:fromDocumentLoader:]): (-[WebFrame _dispatchDidLoadMainResourceForDocumentLoader:]): (-[WebFrame _clearLoadingFromPageCacheForDocumentLoader:]): (-[WebFrame _isDocumentLoaderLoadingFromPageCache:]): (-[WebFrame _makeRepresentationForDocumentLoader:]): (-[WebFrame _revertToProvisionalStateForDocumentLoader:]): (-[WebFrame _setMainDocumentError:forDocumentLoader:]): (-[WebFrame _clearUnarchivingStateForLoader:]): (-[WebFrame _willChangeTitleForDocument:]): (-[WebFrame _didChangeTitleForDocument:]): (-[WebFrame _finishedLoadingDocument:]): (-[WebFrame _committedLoadWithDocumentLoader:data:]): (-[WebFrame _documentLoader:setMainDocumentError:]): (-[WebFrame _finalSetupForReplaceWithDocumentLoader:]): (-[WebFrame _createDocumentLoaderWithRequest:]): (-[WebFrame _provisionalLoadStarted]): * WebView/WebFrameInternal.h: * WebView/WebHTMLRepresentation.m: (-[WebHTMLRepresentation title]): * WebView/WebView.mm: (-[WebView _mainFrameOverrideEncoding]): 2006-10-23 Geoffrey Garen <ggaren@apple.com> RS by Maciej. Gave ObjC++ files .mm extension instead of .m. * WebCoreSupport/WebPageBridge.m: Removed. * WebKit.xcodeproj/project.pbxproj: * WebView/WebDocumentLoaderMac.m: Removed. 2006-10-23 Darin Adler <darin@apple.com> Reviewed by Maciej. - converted WebFrameLoader to C++ * History/WebHistoryItem.m: (+[WebHistoryItem _closeObjectsInPendingPageCaches]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): * Plugins/WebNetscapePluginStream.mm: (-[WebNetscapePluginStream start]): (-[WebNetscapePluginStream stop]): * Plugins/WebPluginController.mm: (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]): (-[WebPluginController pluginView:receivedResponse:]): * WebCoreSupport/WebFrameBridge.h: * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.mm: (-[WebDataSource _loadFromPageCache:]): (-[WebDataSource _webView]): (-[WebDataSource webFrame]): * WebView/WebDocumentLoaderMac.h: * WebView/WebDocumentLoaderMac.m: (-[WebDocumentLoaderMac dealloc]): (-[WebDocumentLoaderMac attachToFrame]): (-[WebDocumentLoaderMac detachFromFrame]): * WebView/WebFrame.mm: (+[WebFrame _timeOfLastCompletedLoad]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _loadURL:referrer:intoChild:]): (-[WebFrame _currentBackForwardListItemToResetTo]): (-[WebFrame _itemForRestoringDocState]): (-[WebFrame _frameLoader]): (-[WebFrame _firstLayoutDone]): (-[WebFrame _loadType]): (-[WebFrame provisionalDataSource]): (-[WebFrame dataSource]): (-[WebFrame loadRequest:]): (-[WebFrame loadArchive:]): (-[WebFrame stopLoading]): (-[WebFrame reload]): (-[WebFrame _updateHistoryForCommit]): (-[WebFrame _updateHistoryForReload]): (-[WebFrame _updateHistoryForInternalLoad]): (-[WebFrame _deliverArchivedResourcesAfterDelay]): (-[WebFrame _willUseArchiveForRequest:originalURL:loader:]): (-[WebFrame _deliverArchivedResources]): (-[WebFrame _prepareForDataSourceReplacement]): (-[WebFrame _provisionalLoadStarted]): * WebView/WebFrameInternal.h: * WebView/WebHTMLView.m: (-[WebHTMLView _clearLastHitViewIfSelf]): (-[WebHTMLView _updateMouseoverWithEvent:]): (-[NSArray removeMouseMovedObserverUnconditionally]): (-[NSArray removeMouseMovedObserver]): (-[NSArray viewWillMoveToWindow:]): (-[NSArray viewDidMoveToWindow]): (-[WebHTMLView _canMakeTextSmaller]): (-[WebHTMLView _canMakeTextLarger]): (-[WebHTMLView _canMakeTextStandardSize]): * WebView/WebPDFView.mm: (-[WebPDFView PDFViewWillClickOnLink:withURL:]): * WebView/WebView.mm: (-[WebView _close]): (-[WebView setDefersCallbacks:]): (-[WebView setCustomTextEncodingName:]): 2006-10-23 Geoffrey Garen <ggaren@apple.com> Reviewed by Bradee. Moved some page-level operations from WebFrameBridge to WebPageBridge. * WebCoreSupport/WebFrameBridge.m: * WebCoreSupport/WebPageBridge.m: (-[WebPageBridge createModalDialogWithURL:referrer:]): (-[WebPageBridge canRunModal]): (-[WebPageBridge canRunModalNow]): (-[WebPageBridge runModal]): * WebKit.xcodeproj/project.pbxproj: Made WebPageBridge.m ObjC++ to support WebCore #includes. 2006-10-23 John Sullivan <sullivan@apple.com> * WebKitPrefix.h: Removed redundant definition of BUILDING_ON_TIGER that I just added. It turns out this had already been added between the last time I updated in this tree and when I needed it locally. 2006-10-23 John Sullivan <sullivan@apple.com> Reviewed by Anders * WebKit.xcodeproj/project.pbxproj: Move WebKitPrefix.h from Misc group to top level, to match WebCore * WebKitPrefix.h: defined BUILDING_ON_TIGER a la WebCore, in preparation for future use of post-Tiger API 2006-10-23 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Rename the now ObjC++ files to be .mm and remove the explicit file types. * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate editingContextMenuItemsForElement:defaultMenuItems:]): * English.lproj/StringsNotToBeLocalized.txt: * Plugins/WebBaseNetscapePluginView.m: Removed. * Plugins/WebNetscapePluginStream.m: Removed. * Plugins/WebPluginController.m: Removed. * WebCoreSupport/WebFrameBridge.m: Removed. * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.m: Removed. * WebView/WebFrame.m: Removed. * WebView/WebFrameView.m: Removed. * WebView/WebPDFView.m: Removed. * WebView/WebPolicyDelegate.m: Removed. * WebView/WebView.m: Removed. 2006-10-23 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Move the undef try/catch to WebKitPrefix.h and include algorithm so we get exception_defines.h and so the undef of try/catch works. Break off the BGRA to ARGB code into WebGraphicsExtras.c, this lets WebBaseNetscapePluginView.m safely compile as ObjC++ and not cause the Accelerate framework to complain about C++ exceptions being disabled. * Misc/WebGraphicsExtras.c: Added. (WebConvertBGRAToARGB): * Misc/WebGraphicsExtras.h: Added. * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView _aglOffscreenImageForDrawingInRect:]): * WebKit.xcodeproj/project.pbxproj: * WebKitPrefix.h: * WebView/WebView.m: 2006-10-22 Sam Weinig <sam.weinig@gmail.com> Reviewed by Tim H. - Add DOMHTMLFormElementPrivate.h to the project. * MigrateHeaders.make: 2006-10-21 Darin Adler <darin@apple.com> Reviewed by Adele. - convert WebLoader and its 3 subclasses to C++ * Plugins/WebNetscapePluginStream.h: * Plugins/WebNetscapePluginStream.m: (-[WebNetscapePluginStream dealloc]): (-[WebNetscapePluginStream finalize]): (-[WebNetscapePluginStream start]): (-[WebNetscapePluginStream cancelLoadWithError:]): (-[WebNetscapePluginStream stop]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge canRunModalNow]): * WebView/WebFrame.m: (-[WebFramePrivate dealloc]): (-[WebFramePrivate finalize]): (frame): Changed from uppercase to lowercase so that it won't conflict with the WebCore class named Frame. (-[WebFrame _firstChildFrame]): (-[WebFrame _lastChildFrame]): (-[WebFrame _previousSiblingFrame]): (-[WebFrame _nextSiblingFrame]): (-[WebFrame _traverseNextFrameStayWithin:]): (-[WebFrame _immediateChildFrameNamed:]): (-[WebFrame _nextFrameWithWrap:]): (-[WebFrame _previousFrameWithWrap:]): (-[WebFrame findFrameNamed:]): (-[WebFrame parentFrame]): (-[WebFrame _dispatchSourceFrame:willSubmitForm:withValues:submissionDecider:]): (-[WebFrame _deliverArchivedResourcesAfterDelay]): (-[WebFrame _willUseArchiveForRequest:originalURL:loader:]): (-[WebFrame _archiveLoadPendingForLoader:]): (-[WebFrame _cancelPendingArchiveLoadForLoader:]): (-[WebFrame _clearArchivedResources]): (-[WebFrame _deliverArchivedResources]): 2006-10-21 Darin Adler <darin@apple.com> Reviewed by Anders. - fix http://bugs.webkit.org/show_bug.cgi?id=10328 REGRESSION: frame leak reported by buildbot * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::WebEditorClient): Don't retain the web view. (WebEditorClient::~WebEditorClient): Don't release the web view. (WebEditorClient::setWebView): Ditto. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge finishInitializingWithFrameName:view:]): Added. Common code for use by both init methods below. (-[WebFrameBridge initMainFrameWithPage:frameName:view:]): Changed to use new method. Also added comment pointing out design flaw -- we attach the client to the web view here, but we need to be sure to detach in case the web view is deallocated first. (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]): Ditto. 2006-10-21 Darin Adler <darin@apple.com> Reviewed by Adam. - http://bugs.webkit.org/show_bug.cgi?id=11376 build scripts should invoke make with "-j" option for multiple processors * WebKit.xcodeproj/project.pbxproj: Pass -j `sysctl -n hw.ncpu` to make. 2006-10-21 Timothy Hatcher <timothy@apple.com> Reviewed by Geoff. <rdar://problem/4478625> HTML Editing: Basic table editing and culling Initial implementaltion of table deletion user interface: * Adds a new editing delegate method, webView:shouldShowDeleteInterfaceForElement:. * The new delegate method is called from the new shouldShowDeleteInterface EditorClient function. * DefaultDelegates/WebDefaultEditingDelegate.m: (-[WebDefaultEditingDelegate webView:shouldShowDeleteInterfaceForElement:]): * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::WebEditorClient): (WebEditorClient::shouldDeleteRange): (WebEditorClient::shouldShowDeleteInterface): * WebKit.xcodeproj/project.pbxproj: * WebView/WebEditingDelegatePrivate.h: Added. 2006-10-21 Alice Liu <alice.liu@apple.com> Reviewed by Maciej. fix leaks. * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::setWebView): only change webview if its different * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]): actually use the client allocated in the line above instead of allocation again, duh. 2006-10-21 Alice Liu <alice.liu@apple.com> Build fix. * WebCoreSupport/WebEditorClient.h: * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::setWebView): 2006-10-20 Alice Liu <alice.liu@apple.com> Reviewed by Tim Hatcher. Fixed a problem where the webview passed to the EditorClient wasn't valid yet. * WebCoreSupport/WebEditorClient.h: (WebEditorClient::setWebView): added webview setter * WebCoreSupport/WebEditorClient.mm: (WebEditorClient::WebEditorClient): add default constructor * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge initMainFrameWithPage:frameName:view:]): use [page webView] since _webview isn't valid yet (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]): use webview setter on editorclient 2006-10-20 David Hyatt <hyatt@apple.com> Tweak cache sizes so that they are back to the way they were, except for < 512, which will stay doubled. Reviewed by Tim H. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge getObjectCacheSize]): 2006-10-20 Alice Liu <alice.liu@apple.com> Reviewed by Maciej. Adding knowledge of EditorClient to WebKit * WebCoreSupport/WebEditorClient.h: Added. * WebCoreSupport/WebEditorClient.mm: Added. (WebEditorClient::WebEditorClient): (WebEditorClient::~WebEditorClient): (WebEditorClient::shouldDeleteRange): Implementation of mac EditorClient * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge initMainFrameWithPage:frameName:view:]): (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]): create an editor client to pass down the chain of constructors * WebKit.xcodeproj/project.pbxproj: Added related EditorClient files * WebKitPrefix.h: Added tiger build flag in order to make certain private headers from webcore compile successfully 2006-10-20 Darin Adler <darin@apple.com> - rolled out my loader change; caused world leak and possibly a plug-in crash 2006-10-20 Darin Adler <darin@apple.com> Reviewed by Adele. - convert WebLoader and its 3 subclasses to C++ * Plugins/WebNetscapePluginStream.h: * Plugins/WebNetscapePluginStream.m: (-[WebNetscapePluginStream dealloc]): (-[WebNetscapePluginStream finalize]): (-[WebNetscapePluginStream start]): (-[WebNetscapePluginStream cancelLoadWithError:]): (-[WebNetscapePluginStream stop]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge canRunModalNow]): * WebView/WebFrame.m: (-[WebFramePrivate dealloc]): (-[WebFramePrivate finalize]): (frame): Changed from uppercase to lowercase so that it won't conflict with the WebCore class named Frame. (-[WebFrame _firstChildFrame]): (-[WebFrame _lastChildFrame]): (-[WebFrame _previousSiblingFrame]): (-[WebFrame _nextSiblingFrame]): (-[WebFrame _traverseNextFrameStayWithin:]): (-[WebFrame _immediateChildFrameNamed:]): (-[WebFrame _nextFrameWithWrap:]): (-[WebFrame _previousFrameWithWrap:]): (-[WebFrame findFrameNamed:]): (-[WebFrame parentFrame]): (-[WebFrame _dispatchSourceFrame:willSubmitForm:withValues:submissionDecider:]): (-[WebFrame _deliverArchivedResourcesAfterDelay]): (-[WebFrame _willUseArchiveForRequest:originalURL:loader:]): (-[WebFrame _archiveLoadPendingForLoader:]): (-[WebFrame _cancelPendingArchiveLoadForLoader:]): (-[WebFrame _clearArchivedResources]): (-[WebFrame _deliverArchivedResources]): 2006-10-20 John Sullivan <sullivan@apple.com> Reviewed by Darin - fixed <rdar://problem/4794935> setAcceptsMouseMovedEvents: is called for every layout, taking ~1% on the PLT test * WebView/WebHTMLView.m: (-[NSArray layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): Don't call setAcceptsMouseMovedEvents: and WKSetNSWindowShouldPostEventNotifications() here because this is called too often. * WebView/WebView.m: (-[WebView viewWillMoveToWindow:]): Do call them here, because this is guaranteed to be called at least once for each window containing a webview, but isn't called too often. Also restructured this method a little. 2006-10-19 Timothy Hatcher <timothy@apple.com> Reviewed by Anders. Bug 11366: Web Inspector should show user agent style rules http://bugs.webkit.org/show_bug.cgi?id=11366 * WebInspector/WebInspector.m: (-[WebInspector init]): (-[WebInspector showOptionsMenu]): (-[WebInspector _toggleShowUserAgentStyles:]): * WebInspector/WebInspectorInternal.h: * WebInspector/webInspector/inspector.js: 2006-10-19 Brady Eidson <beidson@apple.com> Build fix - 2gig is on that pesky signed/unsigned limit... * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge getObjectCacheSize]): 2006-10-19 Brady Eidson <beidson@apple.com> Reviewed by Hyatt. Death to 16777216. Long live 33554432. (Cache size changed needs to be reflected in localization file) * English.lproj/StringsNotToBeLocalized.txt: 2006-10-19 Brady Eidson <beidson@apple.com> Reviewed by Hyatt Added an larger in-memory level of cache for machines with 2+gb ram * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge getObjectCacheSize]): 2006-10-19 Brady Eidson <beidson@apple.com> Reviewed by Hyatt Double the default memory cache size * WebView/WebPreferences.m: (+[WebPreferences initialize]): 2006-10-19 John Sullivan <sullivan@apple.com> Reviewed by Kevin D and Geoff * WebKit.xcodeproj/project.pbxproj: version wars Cleaned up this file, as follows: - renamed all file-internal methods to start with underscores - moved all file-internal methods into a FileInternal category block, and alphabetized them - grouped all other methods by where/how they were defined (delegate methods, protocol methods, overrides, etc.) - removed unstylish braces around one-line clauses * WebView/WebPDFView.m: (_applicationInfoForMIMEType): (_PDFSelectionsAreEqual): (+[WebPDFView supportedMIMETypes]): (-[WebPDFView setPDFDocument:]): (-[WebPDFView dealloc]): (-[WebPDFView centerSelectionInVisibleArea:]): (-[WebPDFView scrollPageDown:]): (-[WebPDFView scrollPageUp:]): (-[WebPDFView scrollLineDown:]): (-[WebPDFView scrollLineUp:]): (-[WebPDFView scrollToBeginningOfDocument:]): (-[WebPDFView scrollToEndOfDocument:]): (-[WebPDFView jumpToSelection:]): (-[WebPDFView acceptsFirstResponder]): (-[WebPDFView becomeFirstResponder]): (-[WebPDFView hitTest:]): (-[WebPDFView initWithFrame:]): (-[WebPDFView menuForEvent:]): (-[WebPDFView setNextKeyView:]): (-[WebPDFView viewDidMoveToWindow]): (-[WebPDFView viewWillMoveToWindow:]): (-[WebPDFView validateUserInterfaceItem:]): (-[WebPDFView copy:]): (-[WebPDFView takeFindStringFromSelection:]): (-[WebPDFView canPrintHeadersAndFooters]): (-[WebPDFView printOperationWithPrintInfo:]): (-[WebPDFView viewWillMoveToHostWindow:]): (-[WebPDFView viewDidMoveToHostWindow]): (-[WebPDFView elementAtPoint:]): (-[WebPDFView elementAtPoint:allowShadowContent:]): (-[WebPDFView searchFor:direction:caseSensitive:wrap:]): (-[WebPDFView viewState]): (-[WebPDFView setViewState:]): (-[WebPDFView writeSelectionWithPasteboardTypes:toPasteboard:]): (-[WebPDFView PDFViewWillClickOnLink:withURL:]): (+[WebPDFView _PDFPreviewViewClass]): (+[WebPDFView _PDFViewClass]): (-[WebPDFView _anyPDFTagsFoundInMenu:]): (-[WebPDFView _applyPDFDefaults]): (-[WebPDFView _fakeKeyEventWithFunctionKey:]): (-[WebPDFView _menuItemsFromPDFKitForEvent:]): (-[WebPDFView _openWithFinder:]): (-[WebPDFView _path]): (-[WebPDFView _PDFSubview]): (-[WebPDFView _pointIsInSelection:]): (-[WebPDFView _receivedPDFKitLaunchNotification:]): (-[WebPDFView _scaledAttributedString:]): (-[WebPDFView _trackFirstResponder]): (-[PDFPrefUpdatingProxy forwardInvocation:]): (-[PDFPrefUpdatingProxy methodSignatureForSelector:]): 2006-10-19 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker - fixed <rdar://problem/4792761> Safari should use fancier embedded PDFKit stuff when it's available * WebKit.xcodeproj/project.pbxproj: version wars * WebView/WebFrameView.m: (-[WebFrameView _makeDocumentViewForDataSource:]): initialize document view with frame view's rect instead of empty rect. This avoids some problems when constructing view hierarchies from nibs * WebView/WebPreferencesPrivate.h: declare new _usePDFPreviewView and _setUsePDFPreviewView:, used for debugging * WebView/WebPreferenceKeysPrivate.h: declare new preference key string * WebView/WebPreferences.m: (+[WebPreferences initialize]): initialize new preference to true (we will by default use the new view if it's available) (-[WebPreferences _usePDFPreviewView]): new accessor for new pref (-[WebPreferences _setUsePDFPreviewView:]): ditto * WebView/WebPDFView.h: new previewView ivar * WebView/WebPDFView.m: (+[WebPDFView PDFPreviewViewClass]): new method, returns class to use for fancier embedded PDFKit stuff, or nil if fancy stuff isn't available (-[WebPDFView initWithFrame:]): now tries to use fancier embedded PDFKit stuff if it's available and the pref is set to use it; falls back to old behavior otherwise (-[WebPDFView dealloc]): release new previewView ivar (retained in initWithFrame:) (-[WebPDFView viewWillMoveToWindow:]): stop observing PDFKit notification when we're removed from window (-[WebPDFView viewDidMoveToWindow]): start observing PDFKit notification when we're added to window (-[WebPDFView _receivedPDFKitLaunchNotification:]): respond to this new PDFKit notification by opening the document via NSWorkspace * English.lproj/StringsNotToBeLocalized.txt: updated for lots of recent changes 2006-10-19 Sam Weinig <sam.weinig@gmail.com> Reviewed by ap. Win32 build fix. * COM/WebFrame.cpp: (WebFrame::initWithName): (WebFrame::createNewWindow): 2006-10-19 Mitz Pettel <mitz@webkit.org> Reviewed and landed by ap. - fixed the inspector's tree popup * WebInspector/webInspector/inspector.html: 2006-10-18 Sam Weinig <sam.weinig@gmail.com> Reviewed by Maciej. Win32 build fix. * COM/WebFrame.cpp: (WebFrame::createNewWindow): * COM/WebFrame.h: 2006-10-18 Anders Carlsson <acarlsson@apple.com> Reviewed by Adam. http://bugs.webkit.org/show_bug.cgi?id=11000 REGRESSION (r16101): css2.1/t0801-c412-hz-box-00-b-a is failing because the QuickTime plugin is taking over but not rendering the png * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge determineObjectFromMIMEType:URL:]): Return ObjectElementFrame if the MIME type is one of the image ones we support. 2006-10-17 Justin Garcia <justin.garcia@apple.com> Reviewed by harrison <rdar://problem/4765600> REGRESSION: Mail.app: smart deletion of words does not work Regressed when we pushed selecion expansion down into WebCore. It's OK to try a smart delete from _deleteWithDirection:, which is called by deleteFoward: and deleteBackward: if the current selection is a range. * WebView/WebHTMLView.m: (-[NSArray _deleteWithDirection:granularity:killRing:isTypingAction:]): 2006-10-13 Justin Garcia <justin.garcia@apple.com> Reviewed by harrison <rdar://problem/3655385> Editing: -indent: method unimplemented * WebView/WebHTMLView.m: (-[NSArray validateUserInterfaceItem:]): Only allow indent:/outdent: in richly editable areas. (-[NSArray indent:]): (-[NSArray outdent:]): 2006-10-13 Maciej Stachowiak <mjs@apple.com> Not reviewed, build fix. * icu/unicode/putil.h: Added - needed for build if you don't have apple internal headers. 2006-10-13 Maciej Stachowiak <mjs@apple.com> Not reviewed, build fix. * icu/unicode/ustring.h: Added - needed for build if you don't have apple internal headers. 2006-10-13 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - add a bunch of casts to get this compiling with older Xcode versions (I used static_cast so it will be easier to find and remove these once we have completely moved on to a new enough compiler version.) * Plugins/WebBaseNetscapePluginView.m: (+[WebBaseNetscapePluginView getCarbonEvent:]): (-[WebBaseNetscapePluginView getCarbonEvent:withEvent:]): (-[WebBaseNetscapePluginView fixWindowPort]): (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebBaseNetscapePluginView _createWindowlessAGLContext]): (-[WebBaseNetscapePluginView _reshapeAGLWindow]): (-[WebBaseNetscapePluginView _aglOffscreenImageForDrawingInRect:]): * WebKit.xcodeproj/project.pbxproj: 2006-10-13 Kevin McCullough <KMcCullough@apple.com> Changed by Darin, reviewed by me. * Plugins/WebNetscapePluginStream.m: Fixed case of import so we can compile on case-sensitive file system. 2006-10-13 Darin Adler <darin@apple.com> Reviewed by Adele. - converted WebFormState from Objective-C to C++ * ForwardingHeaders: Added an entire copy of WebCore's forwarding headers here. We should eventually come up with a more-elegant solution. * WebKit.xcodeproj/project.pbxproj: Added ForwardingHeaders to the include paths. Converted many files from Objective-C to Objective-C++. In a later check-in, I'll rename them to .mm instead of .m. Removed C-only warning options for now. In a later check-in I will add these back in a way that omits them for C++. * Plugins/WebPluginContainerCheck.m: Updated for header changes. * WebView/WebFrameInternal.h: Updated for header changes. Removed WebFrameLoaderClient category so this file can still be used by Objective-C code (not just Objective-C++). * WebView/WebFrame.m: Put WebFrameLoaderClient category in here. (-[WebFrame _loadItem:withLoadType:]): Changed to use 0 instead of nil for FormState and fixed enum code for C++ compatibility. (-[WebFrame _initWithWebFrameView:webView:bridge:]): Added call to setFrameLoaderClient: here. (-[WebFrame _updateHistoryForCommit]): Fixed enum code for C++ compatibility. (-[WebFrame _updateHistoryForReload]): Ditto. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge initMainFrameWithPage:frameName:view:]): Removed call to setFrameLoaderClient:. (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]): Ditto. (-[WebFrameBridge _retrieveKeyboardUIModeFromPreferences:]): Fixed enum code for C++ compatibility. (-[WebFrameBridge runModal]): Changed code to not use "namespace" as a local variable name. * WebView/WebPDFView.m: Added extern "C" so this can compile as Objective-C++. 2006-10-12 Maciej Stachowiak <mjs@apple.com> Reviewed by Oliver. - liberate more WebKit code down to WebCore * WebCoreSupport/WebFrameBridge.h: * WebCoreSupport/WebFrameBridge.m: 2006-10-12 Adele Peterson <adele@apple.com> Reviewed by Maciej. WebKit part of fix for <rdar://problem/4450613> need a means to attach user data to any menu that is popuped up in HTML Added private delegate method for clients that want access to a PopupMenu's NSMenu. * DefaultDelegates/WebDefaultUIDelegate.m: (-[NSApplication webView:willPopupMenu:]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge willPopupMenu:]): * WebView/WebUIDelegatePrivate.h: 2006-10-12 MorganL <morganl.webkit@yahoo.com> Reviewed/landed by Adam. Fixes http://bugs.webkit.org/show_bug.cgi?id=11264 Windows build busted * COM/WebFrame.cpp: (WebFrame::receivedResponse): 2006-10-11 Darin Adler <darin@apple.com> Reviewed by Adele. - preparations for making more code C++ * WebKitPrefix.h: Fixed ifdef so that C++ files get all the precompiled stuff that non-C++ files get. * Misc/WebKitLogging.h: * Misc/WebKitSystemBits.h: * Misc/WebLocalizableStrings.h: * WebCoreSupport/WebSystemInterface.h: Added extern "C". * Misc/WebNSViewExtras.h: * WebView/WebDataSource.m: (addTypesFromClass): * WebView/WebFrameView.m: (addTypesFromClass): Eliminated use of the identifier "class". * WebView/WebView.m: (-[WebView _goToItem:withLoadType:]): Added a type cast. * Plugins/WebBaseNetscapePluginView.m: Added lots of type casts. 2006-10-10 Brady Eidson <beidson@apple.com> Reviewed by Maciej. Moved WebFrameLoader into WebCoreFrameBridge * WebCoreSupport/WebFrameBridge.h: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge initMainFrameWithPage:frameName:view:]): (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]): (-[WebFrameBridge dealloc]): (-[WebFrameBridge setTitle:]): (-[WebFrameBridge receivedData:textEncodingName:]): (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:]): (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:postData:]): (-[WebFrameBridge objectLoadedFromCacheWithURL:response:data:]): (-[WebFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): (-[WebFrameBridge reportClientRedirectToURL:delay:fireDate:lockHistory:isJavaScriptFormAction:]): (-[WebFrameBridge reportClientRedirectCancelled:]): (-[WebFrameBridge close]): (-[WebFrameBridge loadURL:referrer:reload:userGesture:target:triggeringEvent:form:formValues:]): (-[WebFrameBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrameBridge tokenizerProcessedData]): (-[WebFrameBridge frameDetached]): (-[WebFrameBridge didFirstLayout]): (-[WebFrameBridge notifyIconChanged:]): (-[WebFrameBridge originalRequestURL]): (-[WebFrameBridge isLoadTypeReload]): 2006-10-10 Adele Peterson <adele@apple.com> Reviewed by Beth. Removed handleAutoscrollForMouseDragged. Except for autoscroll caused by drag and drop, all other autoscrolling should be done in WebCore instead of in AppKit. * WebCoreSupport/WebFrameBridge.m: * WebView/WebHTMLView.m: * WebView/WebHTMLViewPrivate.h: 2006-10-10 Darin Adler <darin@apple.com> - corrected an archive regression caused by loader refactoring (pointed out by Graham Dennis) * WebView/WebFrame.m: (-[WebFrame _deliverArchivedResourcesAfterDelay]): Fix selector name. 2006-10-10 Maciej Stachowiak <mjs@apple.com> Rubber stamped by Eric. - moved a whole bunch of stuff over to WebCore - updated includes appropriately * Loader/LoaderNSURLExtras.h: Removed. * Loader/LoaderNSURLExtras.m: Removed. * Loader/WebDataProtocol.h: Removed. * Loader/WebDataProtocol.m: Removed. * Loader/WebDocumentLoader.h: Removed. * Loader/WebDocumentLoader.m: Removed. * Loader/WebFormDataStream.h: Removed. * Loader/WebFormDataStream.m: Removed. * Loader/WebFormState.h: Removed. * Loader/WebFormState.m: Removed. * Loader/WebFrameLoader.h: Removed. * Loader/WebFrameLoader.m: Removed. * Loader/WebFrameLoaderClient.h: Removed. * Loader/WebLoader.h: Removed. * Loader/WebLoader.m: Removed. * Loader/WebMainResourceLoader.h: Removed. * Loader/WebMainResourceLoader.m: Removed. * Loader/WebNetscapePlugInStreamLoader.h: Removed. * Loader/WebNetscapePlugInStreamLoader.m: Removed. * Loader/WebPlugInStreamLoaderDelegate.h: Removed. * Loader/WebPolicyDecider.h: Removed. * Loader/WebPolicyDecider.m: Removed. * Loader/WebSubresourceLoader.h: Removed. * Loader/WebSubresourceLoader.m: Removed. * Misc/WebNSURLExtras.m: * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginView.m: * Plugins/WebNetscapePluginStream.m: * Plugins/WebPluginContainerCheck.m: * Plugins/WebPluginController.m: * WebCoreSupport/WebFrameBridge.m: * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.m: * WebView/WebDocumentLoaderMac.h: * WebView/WebFrame.m: * WebView/WebFrameInternal.h: * WebView/WebHTMLView.m: * WebView/WebPolicyDeciderMac.h: * WebView/WebPolicyDelegate.m: * WebView/WebView.m: 2006-10-10 Mark Rowe <bdash@webkit.org> Reviewed by Maciej. Fix crash on launch in nightly builds after r16965. Safari will sometimes call through to -[NSURL _webkit_canonicalize] before creating a WebView. If this happens, InitWebCoreSystemInterface has not yet been called so the call to wkNSURLProtocolClassForReqest is via a garbage pointer. * Misc/WebNSURLExtras.m: (-[NSURL _webkit_canonicalize]): Ensure InitWebCoreSystemInterface is called prior to canonicalURL. 2006-10-10 Maciej Stachowiak <mjs@apple.com> Reviewed by Oliver. - split out some NSURL extras to be moved to WebCore * Loader/LoaderNSURLExtras.h: Added. * Loader/LoaderNSURLExtras.m: Added. (urlByRemovingComponent): (urlByRemovingFragment): (urlOriginalDataAsString): (urlOriginalData): (urlWithData): (WebCFAutorelease): (urlWithDataRelativeToURL): (urlByRemovingResourceSpecifier): (urlIsFileURL): (stringIsFileURL): (urlIsEmpty): (canonicalURL): * Loader/WebFrameLoader.m: (-[WebFrameLoader shouldReloadForCurrent:andDestination:]): (setHTTPReferrer): (-[WebFrameLoader commitProvisionalLoad:]): (-[WebFrameLoader _notifyIconChanged:]): (-[WebFrameLoader didChangeTitleForDocument:]): (-[WebFrameLoader checkNavigationPolicyForRequest:documentLoader:formState:andCall:withSelector:]): (-[WebFrameLoader safeLoadURL:]): * Misc/WebNSURLExtras.m: (+[NSURL _web_URLWithData:]): (+[NSURL _web_URLWithData:relativeToURL:]): (-[NSURL _web_originalData]): (-[NSURL _web_originalDataAsString]): (-[NSURL _web_isEmpty]): (-[NSURL _webkit_canonicalize]): (-[NSURL _webkit_URLByRemovingComponent:]): (-[NSURL _webkit_URLByRemovingFragment]): (-[NSURL _webkit_URLByRemovingResourceSpecifier]): (-[NSURL _webkit_isFileURL]): (-[NSString _webkit_isFileURL]): * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): * WebKit.xcodeproj/project.pbxproj: 2006-10-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - sever final WebFrame dependencies * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader initWithFrame:client:]): (-[WebFrameLoader defersCallbacksChanged]): (-[WebFrameLoader subframeIsLoading]): (-[WebFrameLoader transitionToCommitted:]): (-[WebFrameLoader detachChildren]): (-[WebFrameLoader checkLoadComplete]): 2006-10-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Brady. - convert more WebFrameLoader stuff to be independent of WebFrame * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader stopLoadingSubframes]): (-[WebFrameLoader _receivedMainResourceError:complete:]): (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrameLoader closeOldDataSources]): (-[WebFrameLoader isHostedByObjectElement]): (-[WebFrameLoader isLoadingMainFrame]): (-[WebFrameLoader loadDocumentLoader:withLoadType:formState:]): (-[WebFrameLoader transitionToCommitted:]): (-[WebFrameLoader checkLoadCompleteForThisFrame]): (-[WebFrameLoader continueLoadRequestAfterNewWindowPolicy:frameName:formState:]): (-[WebFrameLoader loadRequest:inFrameNamed:]): (-[WebFrameLoader postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrameLoader actionInformationForNavigationType:event:originalURL:]): (-[WebFrameLoader client]): * Loader/WebFrameLoaderClient.h: * WebView/WebDataSource.m: (-[WebDataSource _webView]): (-[WebDataSource webFrame]): * WebView/WebFrame.m: (-[WebFrame _dispatchCreateWebViewWithRequest:]): 2006-10-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders and Oliver. - move a bunch of WebFrame methods from the Internal category to the WebFrameLoader protocol * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader loadRequest:]): (-[WebFrameLoader loadRequest:inFrameNamed:]): * Loader/WebFrameLoaderClient.h: * WebView/WebFrame.m: (-[WebFrame loadRequest:]): (-[WebFrame _dispatchDidCommitLoadForFrame]): (-[WebFrame _hasFrameView]): (-[WebFrame _frameLoadCompleted]): (-[WebFrame _restoreScrollPositionAndViewState]): (-[WebFrame _setTitle:forURL:]): (-[WebFrame _createDocumentLoaderWithRequest:]): (-[WebFrame _prepareForDataSourceReplacement]): (-[WebFrame _didFinishLoad]): (-[WebFrame _addHistoryItemForFragmentScroll]): (-[WebFrame _shouldTreatURLAsSameAsCurrent:]): (-[WebFrame _provisionalLoadStarted]): * WebView/WebFrameInternal.h: 2006-10-09 Maciej Stachowiak <mjs@apple.com> Not reviewed, build fix. - added forgotten files * Loader/WebPolicyDecider.h: Added. * Loader/WebPolicyDecider.m: Added. (-[WebPolicyDecider invalidate]): 2006-10-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Brady. - add wrapper for WebPolicyDecisionListener so we can remove the dependency from WebFrameLoader. * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader _checkContentPolicyForMIMEType:andCall:withSelector:]): (-[WebFrameLoader cancelContentPolicy]): (-[WebFrameLoader invalidatePendingPolicyDecisionCallingDefaultAction:]): (-[WebFrameLoader checkNewWindowPolicyForRequest:action:frameName:formState:andCall:withSelector:]): (-[WebFrameLoader checkNavigationPolicyForRequest:documentLoader:formState:andCall:withSelector:]): (-[WebFrameLoader continueAfterWillSubmitForm:]): (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]): * Loader/WebFrameLoaderClient.h: * WebKit.xcodeproj/project.pbxproj: * WebView/WebFrame.m: (-[WebFrame _createPolicyDeciderWithTarget:action:]): (decisionListener): (-[WebFrame _dispatchDecidePolicyForMIMEType:request:decider:]): (-[WebFrame _dispatchDecidePolicyForNewWindowAction:request:newFrameName:decider:]): (-[WebFrame _dispatchDecidePolicyForNavigationAction:request:decider:]): (-[WebFrame _dispatchSourceFrame:willSubmitForm:withValues:submissionDecider:]): * WebView/WebPolicyDeciderMac.h: Added. * WebView/WebPolicyDeciderMac.m: Added. (-[WebPolicyDeciderMac initWithTarget:action:]): (-[WebPolicyDeciderMac dealloc]): (-[WebPolicyDeciderMac decisionListener]): (-[WebPolicyDeciderMac invalidate]): 2006-10-09 Brady Eidson <beidson@apple.com> Reviewed by John http://bugs.webkit.org/show_bug.cgi?id=11195 Added the WebIconDatabaseDelegate. This allows the ability to allow customization of IconDatabase behavior in the future, starting now with the ability to override the default icon fairly flexibly * Misc/WebIconDatabase.h: Added setIconDatabaseDelegate: * Misc/WebIconDatabase.m: (-[WebIconDatabase iconForURL:withSize:cache:]): Call the delegate for the default icon if delegate is set (-[WebIconDatabase defaultIconForURL:withSize:]): Get the default icon through the delegate if available, built-in if not (-[WebIconDatabase setDelegate:]): (-[WebIconDatabase delegate]): * Misc/WebIconDatabaseDelegate.h: Added. * Misc/WebIconDatabasePrivate.h: Added the delegate, nuked an unused class definition * WebKit.xcodeproj/project.pbxproj: 2006-10-09 Darin Adler <darin@apple.com> Reviewed by Maciej. - eliminated uses of WebResource and WebView from WebFrameLoader * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader setDefersCallbacks:]): (-[WebFrameLoader stopLoading]): (-[WebFrameLoader willUseArchiveForRequest:originalURL:loader:]): (-[WebFrameLoader archiveLoadPendingForLoader:]): (-[WebFrameLoader cancelPendingArchiveLoadForLoader:]): (-[WebFrameLoader _canShowMIMEType:]): (-[WebFrameLoader _representationExistsForURLScheme:]): (-[WebFrameLoader _generatedMIMETypeForURLScheme:]): (-[WebFrameLoader loadDocumentLoader:]): (-[WebFrameLoader continueAfterNavigationPolicy:]): (-[WebFrameLoader sendRemainingDelegateMessagesWithIdentifier:response:length:error:]): (-[WebFrameLoader actionInformationForNavigationType:event:originalURL:]): * Loader/WebFrameLoaderClient.h: * Loader/WebMainResourceLoader.m: (-[WebMainResourceLoader continueAfterContentPolicy:response:]): (-[WebMainResourceLoader loadWithRequestNow:]): * WebView/WebFrame.m: (-[WebFramePrivate dealloc]): (-[WebFrame loadRequest:]): (-[WebFrame loadArchive:]): (-[WebFrame _canUseResourceForRequest:]): (-[WebFrame _canUseResourceWithResponse:]): (-[WebFrame _deliverArchivedResourcesAfterDelay]): (-[WebFrame _willUseArchiveForRequest:originalURL:loader:]): (-[WebFrame _archiveLoadPendingForLoader:]): (-[WebFrame _cancelPendingArchiveLoadForLoader:]): (-[WebFrame _clearArchivedResources]): (-[WebFrame _deliverArchivedResources]): (-[WebFrame _setDefersCallbacks:]): (-[WebFrame _canHandleRequest:]): (-[WebFrame _canShowMIMEType:]): (-[WebFrame _representationExistsForURLScheme:]): (-[WebFrame _generatedMIMETypeForURLScheme:]): (-[WebFrame _elementForEvent:]): 2006-10-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - do all the stuff that setting the referrer should * Loader/WebFrameLoader.m: (setHTTPReferrer): (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrameLoader postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): * WebKit.xcodeproj/project.pbxproj: 2006-10-09 Brady Eidson <beidson@apple.com> Reviewed by Maciej Fix to elminate WebIconDatabaseBridge.h from WebFrameLoader * Loader/WebFrameLoader.m: (-[WebFrameLoader _notifyIconChanged:]): * WebCoreSupport/WebIconDatabaseBridge.m: (+[WebIconDatabaseBridge createInstance]): 2006-10-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. (Was reviewed as part of a larger patch but it looks like Darin already did the rest of it) - avoid a needless use of WebFrame * Loader/WebFrameLoader.m: (-[WebFrameLoader loadDocumentLoader:withLoadType:formState:]): 2006-10-09 Brady Eidson <beidson@apple.com> A *real* fake fix for the layouttest problem until the real fix * Loader/WebFrameLoader.m: (-[WebFrameLoader _notifyIconChanged:]): 2006-10-09 Brady Eidson <beidson@apple.com> Quick layouttest fix until I make the real fix * Loader/WebFrameLoader.m: 2006-10-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - wean WebFrameLoader from WebDataSource private stuff (actually just tweaks tot he above to make merging my future patches easier since Darin did a lot of the same stuff) * Loader/WebDocumentLoader.h: * Loader/WebDocumentLoader.m: (-[WebDocumentLoader URLForHistory]): * Loader/WebFrameLoader.m: (-[WebFrameLoader _loadRequest:archive:]): (-[WebFrameLoader revertToProvisionalWithDocumentLoader:]): (-[WebFrameLoader documentLoader:setMainDocumentError:]): (-[WebFrameLoader finalSetupForReplaceWithDocumentLoader:]): (-[WebFrameLoader didChangeTitleForDocument:]): (-[WebFrameLoader loadDocumentLoader:withLoadType:formState:]): * Loader/WebFrameLoaderClient.h: * WebView/WebDataSource.m: (-[WebDataSource _URLForHistory]): * WebView/WebFrame.m: (-[WebFrame _addDocumentLoader:toUnarchiveState:]): (-[WebFrame _revertToProvisionalStateForDocumentLoader:]): (-[WebFrame _setMainDocumentError:forDocumentLoader:]): (-[WebFrame _clearUnarchivingStateForLoader:]): 2006-10-09 Darin Adler <darin@apple.com> Reviewed by Brady. - eliminated WebFrameLoader dependency on WebDataSourceInternal.h, WebIconDatabasePrivate.h, and WebKitErrorsPrivate.h, along with most but not all references to WebView * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader removePlugInStreamLoader:]): (-[WebFrameLoader _receivedMainResourceError:complete:]): (-[WebFrameLoader _notifyIconChanged:]): (-[WebFrameLoader cancelledErrorWithRequest:]): (-[WebFrameLoader fileDoesNotExistErrorWithResponse:]): (-[WebFrameLoader handleUnimplementablePolicyWithError:]): (-[WebFrameLoader cannotShowMIMETypeWithResponse:]): (-[WebFrameLoader interruptForPolicyChangeErrorWithRequest:]): (-[WebFrameLoader _loadRequest:archive:]): (-[WebFrameLoader finishedLoadingDocument:]): (-[WebFrameLoader committedLoadWithDocumentLoader:data:]): (-[WebFrameLoader revertToProvisionalWithDocumentLoader:]): (-[WebFrameLoader documentLoader:setMainDocumentError:]): (-[WebFrameLoader finalSetupForReplaceWithDocumentLoader:]): (-[WebFrameLoader didChangeTitleForDocument:]): (-[WebFrameLoader continueAfterNavigationPolicy:]): (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrameLoader loadDocumentLoader:withLoadType:formState:]): (-[WebFrameLoader transitionToCommitted:]): (-[WebFrameLoader checkLoadCompleteForThisFrame]): (-[WebFrameLoader requestFromDelegateForRequest:identifier:error:]): (-[WebFrameLoader addExtraFieldsToRequest:mainResource:alwaysFromRequest:]): (-[WebFrameLoader checkLoadComplete]): * Loader/WebFrameLoaderClient.h: * Loader/WebMainResourceLoader.m: (-[WebMainResourceLoader continueAfterContentPolicy:response:]): * WebView/WebFrame.m: (-[WebFrame _addDocumentLoader:toUnarchiveState:]): (-[WebFrame _formDelegate]): (-[WebFrame _finishedLoadingDocument:]): (-[WebFrame _committedLoadWithDocumentLoader:data:]): (-[WebFrame _revertToProvisionalWithDocumentLoader:]): (-[WebFrame _documentLoader:setMainDocumentError:]): (-[WebFrame _finalSetupForReplaceWithDocumentLoader:]): (-[WebFrame _URLForHistoryForDocumentLoader:]): (-[WebFrame _cancelledErrorWithRequest:]): (-[WebFrame _cannotShowURLErrorWithRequest:]): (-[WebFrame _interruptForPolicyChangeErrorWithRequest:]): (-[WebFrame _cannotShowMIMETypeErrorWithResponse:]): (-[WebFrame _fileDoesNotExistErrorWithResponse:]): (-[WebFrame _shouldFallBackForError:]): (-[WebFrame _hasWebView]): (-[WebFrame _mainFrameURL]): * WebView/WebFrameInternal.h: 2006-10-09 Maciej Stachowiak <mjs@apple.com> Reviewed, landed, tweaked a bit by Darin. - removed most uses of WebFrameBridge from WebFrameLoader (WebCoreFrameBridge use is OK) * Loader/WebDocumentLoader.m: (-[WebDocumentLoader bridge]): * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader initWithFrame:client:]): (-[WebFrameLoader defersCallbacksChanged]): (-[WebFrameLoader defersCallbacks]): (-[WebFrameLoader provisionalLoadStarted]): (-[WebFrameLoader stopLoadingSubframes]): (-[WebFrameLoader _willSendRequest:forResource:redirectResponse:]): (-[WebFrameLoader _receivedMainResourceError:complete:]): (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrameLoader continueFragmentScrollAfterNavigationPolicy:formState:]): (-[WebFrameLoader closeOldDataSources]): (-[WebFrameLoader commitProvisionalLoad:]): (-[WebFrameLoader bridge]): (-[WebFrameLoader _handleFallbackContent]): (-[WebFrameLoader _finishedLoading]): (-[WebFrameLoader reload]): (-[WebFrameLoader checkNavigationPolicyForRequest:documentLoader:formState:andCall:withSelector:]): (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrameLoader transitionToCommitted:]): (-[WebFrameLoader continueLoadRequestAfterNewWindowPolicy:frameName:formState:]): (-[WebFrameLoader loadRequest:inFrameNamed:]): (-[WebFrameLoader postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrameLoader detachFromParent]): (-[WebFrameLoader addExtraFieldsToRequest:mainResource:alwaysFromRequest:]): (-[WebFrameLoader safeLoadURL:]): (-[WebFrameLoader actionInformationForLoadType:isFormSubmission:event:originalURL:]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge initMainFrameWithPage:frameName:view:]): (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]): * WebView/WebFrame.m: (-[WebFrame _atMostOneFrameHasSelection]): * WebView/WebFrameInternal.h: 2006-10-09 Darin Adler <darin@apple.com> Reviewed by Brady. - removed almost all direct use of WebView from WebFrameLoader * Loader/WebFrameLoader.m: (-[WebFrameLoader defersCallbacksChanged]): (-[WebFrameLoader defersCallbacks]): (-[WebFrameLoader clearProvisionalLoad]): (-[WebFrameLoader _willSendRequest:forResource:redirectResponse:]): (-[WebFrameLoader _didReceiveResponse:forResource:]): (-[WebFrameLoader _didReceiveData:contentLength:forResource:]): (-[WebFrameLoader _didFinishLoadingForResource:]): (-[WebFrameLoader _didFailLoadingWithError:forResource:]): (-[WebFrameLoader closeOldDataSources]): (-[WebFrameLoader _notifyIconChanged:]): (-[WebFrameLoader prepareForLoadStart]): (-[WebFrameLoader willChangeTitleForDocument:]): (-[WebFrameLoader didChangeTitleForDocument:]): (-[WebFrameLoader continueAfterNewWindowPolicy:]): (-[WebFrameLoader continueAfterNavigationPolicy:]): (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrameLoader didFirstLayout]): (-[WebFrameLoader transitionToCommitted:]): (-[WebFrameLoader checkLoadCompleteForThisFrame]): (-[WebFrameLoader addExtraFieldsToRequest:mainResource:alwaysFromRequest:]): * Loader/WebFrameLoaderClient.h: * WebKit.xcodeproj/project.pbxproj: * WebView/WebFrame.m: (-[WebFrame _currentBackForwardListItemToResetTo]): (-[WebFrame _hasBackForwardList]): (-[WebFrame _resetBackForwardList]): (-[WebFrame _dispatchDidReceiveIcon:]): (-[WebFrame _dispatchDidStartProvisionalLoadForFrame]): (-[WebFrame _dispatchDidCommitLoadForFrame]): (-[WebFrame _dispatchDidFailProvisionalLoadWithError:]): (-[WebFrame _dispatchDidFailLoadWithError:]): (-[WebFrame _dispatchDidFinishLoadForFrame]): (-[WebFrame _progressStarted]): (-[WebFrame _progressCompleted]): (-[WebFrame _incrementProgressForIdentifier:response:]): (-[WebFrame _incrementProgressForIdentifier:data:]): (-[WebFrame _completeProgressForIdentifier:]): (-[WebFrame _setMainFrameDocumentReady:]): (-[WebFrame _willChangeTitleForDocument:]): (-[WebFrame _didChangeTitleForDocument:]): (-[WebFrame _startDownloadWithRequest:]): 2006-10-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Alice. - moved WebFormState into Loader directory and tweaked to avoid WebKit dependencies * Loader/WebDocumentLoader.h: * Loader/WebFormState.h: Added. * Loader/WebFormState.m: Added. (-[WebFormState initWithForm:values:sourceFrame:]): (-[WebFormState dealloc]): (-[WebFormState form]): (-[WebFormState values]): (-[WebFormState sourceFrame]): * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrameLoader postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebFrame.m: * WebView/WebFrameInternal.h: 2006-10-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Oliver. - remove dependency on WebNSURLRequestExtras.h * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrameLoader postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrameLoader addExtraFieldsToRequest:mainResource:alwaysFromRequest:]): 2006-10-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Oliver. - removed unneeded logging code so I can take WebKitLogging.h out and remove a WebKit dependency * Loader/WebFrameLoader.m: (-[WebFrameLoader setState:]): (-[WebFrameLoader clientRedirectCancelledOrFinished:]): (-[WebFrameLoader clientRedirectedTo:delay:fireDate:lockHistory:isJavaScriptFormAction:]): (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrameLoader continueFragmentScrollAfterNavigationPolicy:formState:]): (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrameLoader checkLoadCompleteForThisFrame]): 2006-10-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Oliver. - remove WebDataSource from the WebFrameLoader interface (and thereby from a lot of internal use) * Loader/WebDocumentLoader.h: * Loader/WebDocumentLoader.m: (-[WebDocumentLoader dealloc]): (-[WebDocumentLoader initialRequest]): (-[WebDocumentLoader URL]): (-[WebDocumentLoader unreachableURL]): * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader setState:]): (-[WebFrameLoader startLoading]): (-[WebFrameLoader startProvisionalLoad:]): (-[WebFrameLoader clientRedirectedTo:delay:fireDate:lockHistory:isJavaScriptFormAction:]): (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrameLoader opened]): (-[WebFrameLoader commitProvisionalLoad:]): (-[WebFrameLoader initialRequest]): (-[WebFrameLoader _finishedLoading]): (-[WebFrameLoader _notifyIconChanged:]): (-[WebFrameLoader _URL]): (-[WebFrameLoader willUseArchiveForRequest:originalURL:loader:]): (-[WebFrameLoader _checkNavigationPolicyForRequest:andCall:withSelector:]): (-[WebFrameLoader shouldReloadToHandleUnreachableURLFromRequest:]): (-[WebFrameLoader _loadRequest:archive:]): (-[WebFrameLoader _loadRequest:triggeringAction:loadType:formState:]): (-[WebFrameLoader _reloadAllowingStaleDataWithOverrideEncoding:]): (-[WebFrameLoader reload]): (-[WebFrameLoader checkNavigationPolicyForRequest:documentLoader:formState:andCall:withSelector:]): (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrameLoader loadDocumentLoader:withLoadType:formState:]): (-[WebFrameLoader frameLoadCompleted]): (-[WebFrameLoader transitionToCommitted:]): (-[WebFrameLoader checkLoadCompleteForThisFrame]): (-[WebFrameLoader safeLoadURL:]): * Loader/WebFrameLoaderClient.h: * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge originalRequestURL]): * WebView/WebDataSource.m: (-[WebDataSource _URL]): (-[WebDataSource dealloc]): (-[WebDataSource initialRequest]): (-[WebDataSource unreachableURL]): * WebView/WebFrame.m: (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _prepareForDataSourceReplacement]): (-[WebFrame provisionalDataSource]): (-[WebFrame dataSource]): (-[WebFrame _makeDocumentView]): (-[WebFrame _updateHistoryForReload]): (-[WebFrame _updateHistoryForStandardLoad]): (-[WebFrame _updateHistoryForInternalLoad]): (-[WebFrame _forceLayoutForNonHTML]): (-[WebFrame _clearLoadingFromPageCacheForDocumentLoader:]): (-[WebFrame _isDocumentLoaderLoadingFromPageCache:]): (-[WebFrame _archivedSubresourceForURL:fromDocumentLoader:]): (-[WebFrame _makeRepresentationForDocumentLoader:]): 2006-10-09 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - removed need for WebFrameLoader to now about WebDocumentLoaderMac * Loader/WebFrameLoader.m: (-[WebFrameLoader loadDataSource:withLoadType:formState:]): * WebView/WebDocumentLoaderMac.h: * WebView/WebDocumentLoaderMac.m: (-[WebDocumentLoaderMac setFrameLoader:]): (-[WebDocumentLoaderMac detachFromFrameLoader]): 2006-10-09 Darin Adler <darin@apple.com> Reviewed by Maciej. - passed calls that require WebScriptDebugServer across the client interface * Loader/WebFrameLoader.m: (-[WebFrameLoader _finishedLoading]): (-[WebFrameLoader documentLoader:mainReceivedCompleteError:]): * Loader/WebFrameLoaderClient.h: * WebView/WebFrame.m: (-[WebFrame _dispatchDidLoadMainResourceForDocumentLoader:]): 2006-10-08 Darin Adler <darin@apple.com> Reviewed by Maciej. - passed calls that require WebHTMLView or WebFrameView calls across the client interface * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (isCaseInsensitiveEqual): (isBackForwardLoadType): (-[WebFrameLoader opened]): (-[WebFrameLoader cancelledErrorWithRequest:]): (-[WebFrameLoader fileDoesNotExistErrorWithResponse:]): (-[WebFrameLoader reload]): (-[WebFrameLoader transitionToCommitted:]): * Loader/WebFrameLoaderClient.h: * WebView/WebFrame.m: (-[WebFrame _forceLayout]): (-[WebFrame _setDocumentViewFromPageCache:]): (-[WebFrame _setCopiesOnScroll]): 2006-10-08 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - pass remaining delegate methods across client interface * Loader/WebFrameLoader.m: (-[WebFrameLoader _checkContentPolicyForMIMEType:andCall:withSelector:]): (-[WebFrameLoader checkNewWindowPolicyForRequest:action:frameName:formState:andCall:withSelector:]): (-[WebFrameLoader checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): (-[WebFrameLoader handleUnimplementablePolicyWithErrorCode:forURL:]): (-[WebFrameLoader didFirstLayout]): (-[WebFrameLoader continueLoadRequestAfterNewWindowPolicy:frameName:formState:]): * Loader/WebFrameLoaderClient.h: * WebView/WebFrame.m: (-[WebFrame _dispatchDidFirstLayoutInFrame]): (-[WebFrame _dispatchCreateWebViewWithRequest:]): (-[WebFrame _dispatchShow]): (-[WebFrame _dispatchDecidePolicyForMIMEType:request:decisionListener:]): (-[WebFrame _dispatchDecidePolicyForNewWindowAction:request:newFrameName:decisionListener:]): (-[WebFrame _dispatchDecidePolicyForNavigationAction:request:decisionListener:]): (-[WebFrame _dispatchUnableToImplementPolicyWithError:]): 2006-10-08 Darin Adler <darin@apple.com> Reviewed by Maciej. - use WebCoreSystemInterface instead of WebSystemInterface in Loader directory * Loader/WebFrameLoader.m: Update includes. (-[WebFrameLoader commitProvisionalLoad:]): Use wk calls istead of WK. (-[WebFrameLoader _canUseResourceWithResponse:]): Ditto. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Added the three new symbols, and resorted the list. * Loader/WebDataProtocol.m: * Loader/WebLoader.m: * Loader/WebMainResourceLoader.h: * Loader/WebMainResourceLoader.m: * Loader/WebNetscapePlugInStreamLoader.h: * Loader/WebNetscapePlugInStreamLoader.m: * Loader/WebSubresourceLoader.h: * Loader/WebSubresourceLoader.m: Changed import statements to consistently use the "" format. 2006-10-08 Maciej Stachowiak <mjs@apple.com> Not reviewed. - fix accidental build break due to editing while committing * Loader/WebFrameLoader.m: 2006-10-08 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - move all WebFrameLoadDelegate methods across client interface * Loader/WebFrameLoader.m: (-[WebFrameLoader clientRedirectCancelledOrFinished:]): (-[WebFrameLoader clientRedirectedTo:delay:fireDate:lockHistory:isJavaScriptFormAction:]): (-[WebFrameLoader continueFragmentScrollAfterNavigationPolicy:formState:]): (-[WebFrameLoader closeOldDataSources]): (-[WebFrameLoader _notifyIconChanged:]): (-[WebFrameLoader prepareForLoadStart]): (-[WebFrameLoader didChangeTitleForDocument:]): (-[WebFrameLoader transitionToCommitted:]): (-[WebFrameLoader checkLoadCompleteForThisFrame]): * Loader/WebFrameLoaderClient.h: * WebView/WebFrame.m: (-[WebFrame _dispatchDidCancelClientRedirectForFrame]): (-[WebFrame _dispatchWillPerformClientRedirectToURL:delay:fireDate:]): (-[WebFrame _dispatchDidChangeLocationWithinPageForFrame]): (-[WebFrame _dispatchWillCloseFrame]): (-[WebFrame _dispatchDidReceiveIcon:]): (-[WebFrame _dispatchDidStartProvisionalLoadForFrame]): (-[WebFrame _dispatchDidReceiveTitle:]): (-[WebFrame _dispatchDidCommitLoadForFrame]): (-[WebFrame _dispatchDidFailProvisionalLoadWithError:]): (-[WebFrame _dispatchDidFailLoadWithError:]): (-[WebFrame _dispatchDidFinishLoadForFrame]): 2006-10-08 Darin Adler <darin@apple.com> Reviewed by Maciej. - removed some of the WebKit dependencies in WebFrameLoader * Loader/WebFrameLoader.m: (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrameLoader _downloadWithLoadingConnection:request:response:proxy:]): (-[WebFrameLoader reload]): (-[WebFrameLoader didChangeTitleForDocument:]): * Loader/WebFrameLoaderClient.h: * WebView/WebFrame.m: (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _loadURL:referrer:intoChild:]): (-[WebFrame _setTitle:forURL:]): (-[WebFrame _downloadWithLoadingConnection:request:response:proxy:]): * WebView/WebFrameInternal.h: - some other tweaks * Misc/WebNSURLRequestExtras.m: (-[NSMutableURLRequest _web_setHTTPReferrer:]): (-[NSMutableURLRequest _web_setHTTPUserAgent:]): 2006-10-08 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - pass all WebResourceLoadDelegate methods across client, removing need to include related headers * Loader/WebFrameLoader.m: (-[WebFrameLoader _willSendRequest:forResource:redirectResponse:]): (-[WebFrameLoader _didReceiveAuthenticationChallenge:forResource:]): (-[WebFrameLoader _didCancelAuthenticationChallenge:forResource:]): (-[WebFrameLoader _didReceiveResponse:forResource:]): (-[WebFrameLoader _didReceiveData:contentLength:forResource:]): (-[WebFrameLoader _didFinishLoadingForResource:]): (-[WebFrameLoader _didFailLoadingWithError:forResource:]): (-[WebFrameLoader sendRemainingDelegateMessagesWithIdentifier:response:length:error:]): (-[WebFrameLoader requestFromDelegateForRequest:identifier:error:]): * Loader/WebFrameLoaderClient.h: * WebView/WebFrame.m: (-[WebFrame _dispatchDidHandleOnloadEventsForFrame]): (-[WebFrame _dispatchDidReceiveServerRedirectForProvisionalLoadForFrame]): (-[WebFrame _dispatchIdentifierForInitialRequest:fromDocumentLoader:]): (-[WebFrame _dispatchResource:willSendRequest:redirectResponse:fromDocumentLoader:]): (-[WebFrame _dispatchDidReceiveAuthenticationChallenge:forResource:fromDocumentLoader:]): (-[WebFrame _dispatchDidCancelAuthenticationChallenge:forResource:fromDocumentLoader:]): (-[WebFrame _dispatchResource:didReceiveResponse:fromDocumentLoader:]): (-[WebFrame _dispatchResource:didReceiveContentLength:fromDocumentLoader:]): (-[WebFrame _dispatchResource:didFinishLoadingFromDocumentLoader:]): (-[WebFrame _dispatchResource:didFailLoadingWithError:fromDocumentLoader:]): 2006-10-08 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - started adding some _dispatch methods to WebFrameLoaderClient for delegate dispatch * Loader/WebFrameLoader.m: (-[WebFrameLoader startLoading]): (-[WebFrameLoader didReceiveServerRedirectForProvisionalLoadForFrame]): * Loader/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge handledOnloadEvents]): * WebView/WebFrame.m: (dataSource): (-[WebFrame _dataSourceForDocumentLoader:]): (-[WebFrame _dispatchDidHandleOnloadEventsForFrame]): (-[WebFrame _dispatchDidReceiveServerRedirectForProvisionalLoadForFrame]): (-[WebFrame _dispatchIdentifierForInitialRequest:fromDocumentLoader:]): * WebView/WebFrameInternal.h: 2006-10-08 Darin Adler <darin@apple.com> Reviewed by Maciej. - moved more methods to WebFrameLoader from WebFrame * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader defersCallbacksChanged]): (-[WebFrameLoader startLoadingMainResourceWithRequest:identifier:]): (-[WebFrameLoader setState:]): (-[WebFrameLoader clearProvisionalLoad]): (-[WebFrameLoader markLoadComplete]): (-[WebFrameLoader commitProvisionalLoad]): (-[WebFrameLoader stopLoading]): (-[WebFrameLoader startProvisionalLoad:]): (-[WebFrameLoader setupForReplace]): (-[WebFrameLoader _identifierForInitialRequest:]): (-[WebFrameLoader _finishedLoadingResource]): (-[WebFrameLoader _receivedError:]): (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrameLoader continueFragmentScrollAfterNavigationPolicy:formState:]): (-[WebFrameLoader opened]): (-[WebFrameLoader commitProvisionalLoad:]): (-[WebFrameLoader _finishedLoading]): (-[WebFrameLoader willUseArchiveForRequest:originalURL:loader:]): (-[WebFrameLoader _loadRequest:archive:]): (-[WebFrameLoader reload]): (-[WebFrameLoader documentLoader:mainReceivedCompleteError:]): (-[WebFrameLoader subframeIsLoading]): (-[WebFrameLoader checkNewWindowPolicyForRequest:action:frameName:formState:andCall:withSelector:]): (-[WebFrameLoader continueAfterNewWindowPolicy:]): (-[WebFrameLoader checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): (-[WebFrameLoader sendRemainingDelegateMessagesWithIdentifier:response:length:error:]): (-[WebFrameLoader loadRequest:inFrameNamed:]): (-[WebFrameLoader postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrameLoader detachChildren]): (-[WebFrameLoader detachFromParent]): (-[WebFrameLoader addExtraFieldsToRequest:mainResource:alwaysFromRequest:]): (-[WebFrameLoader safeLoadURL:]): (-[WebFrameLoader actionInformationForLoadType:isFormSubmission:event:originalURL:]): (-[WebFrameLoader actionInformationForNavigationType:event:originalURL:]): (-[WebFrameLoader checkLoadComplete]): * Loader/WebFrameLoaderClient.h: * Loader/WebSubresourceLoader.m: (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forFrameLoader:]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge close]): (-[WebFrameBridge tokenizerProcessedData]): (-[WebFrameBridge frameDetached]): * WebView/WebDataSourceInternal.h: * WebView/WebFrame.m: (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _prepareForDataSourceReplacement]): (-[WebFrame _detachedFromParent1]): (-[WebFrame _detachedFromParent2]): (-[WebFrame _detachedFromParent3]): (-[WebFrame _detachedFromParent4]): (-[WebFrame _updateHistoryAfterClientRedirect]): (-[WebFrame _loadedFromPageCache]): * WebView/WebFrameInternal.h: * WebView/WebPDFView.m: (-[WebPDFView PDFViewWillClickOnLink:withURL:]): * WebView/WebView.m: (-[WebView _close]): (-[WebView setDefersCallbacks:]): 2006-10-08 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - avoid need for WebKitSystemInterface in loader code, via WebCore cover for wkSupportsMultipartXMixedReplace * Loader/WebDocumentLoader.m: (-[WebDocumentLoader initWithRequest:]): * Loader/WebMainResourceLoader.m: * Loader/WebSubresourceLoader.m: (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forFrameLoader:]): * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): * WebView/WebDataSource.m: (-[WebDataSource _initWithDocumentLoader:]): 2006-10-08 Darin Adler <darin@apple.com> - build fix (also a fix for a crasher I forgot to commit before) * Loader/WebFrameLoader.m: Added some missing includes. (-[WebFrameLoader checkLoadCompleteForThisFrame]): Added a needed retain/release. 2006-10-08 Darin Adler <darin@apple.com> Reviewed by Anders. - quick fix to loader problem causing layout test failures * Loader/WebFrameLoader.m: (-[WebFrameLoader _finishedLoading]): Use a local variable for the bridge that we retain/release. (-[WebFrameLoader continueLoadRequestAfterNewWindowPolicy:frameName:formState:]): Same here. 2006-10-08 Maciej Stachowiak <mjs@apple.com> Reviewed by Adam. - removed a few includes from WebFrameLoader, fixed up as appropriate - segregated header includes into ones that need to go away to move the code and ones that don't * Loader/WebFrameLoader.m: (-[WebFrameLoader _privateBrowsingEnabled]): (-[WebFrameLoader willUseArchiveForRequest:originalURL:loader:]): * Loader/WebFrameLoaderClient.h: * WebView/WebFrame.m: (-[WebFrame _privateBrowsingEnabled]): 2006-10-08 Darin Adler <darin@apple.com> Reviewed by Maciej. - moved a few methods from WebFrame to WebFrameLoader * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader _setState:]): (-[WebFrameLoader stopLoadingSubframes]): (-[WebFrameLoader _receivedMainResourceError:complete:]): (-[WebFrameLoader closeOldDataSources]): (-[WebFrameLoader commitProvisionalLoad:]): (-[WebFrameLoader _finishedLoading]): (isBackForwardLoadType): (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrameLoader didFirstLayout]): (-[WebFrameLoader frameLoadCompleted]): (-[WebFrameLoader transitionToCommitted:]): (-[WebFrameLoader checkLoadCompleteForThisFrame]): (-[WebFrameLoader continueLoadRequestAfterNewWindowPolicy:frameName:formState:]): (-[WebFrameLoader sendRemainingDelegateMessagesWithIdentifier:response:length:error:]): (-[WebFrameLoader requestFromDelegateForRequest:identifier:error:]): (-[WebFrameLoader loadRequest:inFrameNamed:]): (-[WebFrameLoader postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): * Loader/WebFrameLoaderClient.h: * Plugins/WebPluginController.m: (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]): * WebCoreSupport/WebFrameBridge.h: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge initMainFrameWithPage:frameName:view:]): (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]): (-[WebFrameBridge dealloc]): (-[WebFrameBridge frameLoader]): (-[WebFrameBridge setTitle:]): (-[WebFrameBridge receivedData:textEncodingName:]): (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:]): (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:postData:]): (-[WebFrameBridge objectLoadedFromCacheWithURL:response:data:]): (-[WebFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): (-[WebFrameBridge reportClientRedirectToURL:delay:fireDate:lockHistory:isJavaScriptFormAction:]): (-[WebFrameBridge reportClientRedirectCancelled:]): (-[WebFrameBridge loadURL:referrer:reload:userGesture:target:triggeringEvent:form:formValues:]): (-[WebFrameBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrameBridge didFirstLayout]): (-[WebFrameBridge notifyIconChanged:]): (-[WebFrameBridge originalRequestURL]): (-[WebFrameBridge isLoadTypeReload]): * WebView/WebFrame.m: (-[WebFrame _opened]): (-[WebFrame _checkLoadComplete]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _actionInformationForLoadType:isFormSubmission:event:originalURL:]): (-[WebFrame _loadURL:referrer:intoChild:]): (-[WebFrame _currentBackForwardListItemToResetTo]): (-[WebFrame _updateBackground]): (-[WebFrame _frameLoader]): (-[WebFrame _frameLoadCompleted]): (-[WebFrame _makeDocumentView]): (-[WebFrame _updateHistoryForCommit]): (-[WebFrame _updateHistoryForReload]): (-[WebFrame _updateHistoryForStandardLoad]): (-[WebFrame _updateHistoryForBackForwardNavigation]): (-[WebFrame _updateHistoryForInternalLoad]): (-[WebFrame _tokenForLoadErrorReset]): (-[WebFrame _resetAfterLoadError:]): (-[WebFrame _doNotResetAfterLoadError:]): * WebView/WebFrameInternal.h: 2006-10-09 Mark Rowe <bdash@webkit.org> Rubber-stamped by Darin. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge imageTitleForFilename:size:]): Revert accidental change to a UI_STRING that is triggering an assertion failure. 2006-10-08 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - remove unneeded non-Loader header includes from WebFrameLoader.h (split WebFrameLoadType into two coincidentally matching enums) * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrameLoader commitProvisionalLoad:]): (isBackForwardLoadType): (-[WebFrameLoader _loadRequest:archive:]): (-[WebFrameLoader _loadRequest:triggeringAction:loadType:formState:]): (-[WebFrameLoader _reloadAllowingStaleDataWithOverrideEncoding:]): (-[WebFrameLoader reload]): (-[WebFrameLoader isReplacing]): (-[WebFrameLoader setReplacing]): (-[WebFrameLoader loadType]): (-[WebFrameLoader setLoadType:]): (-[WebFrameLoader checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrameLoader loadDataSource:withLoadType:formState:]): (-[WebFrameLoader didFirstLayout]): * WebCoreSupport/WebFrameBridge.m: * WebView/WebFrame.m: (-[WebFrame _transitionToCommitted:]): (-[WebFrame _provisionalLoadStarted]): (-[WebFrame _opened]): (-[WebFrame _checkLoadCompleteForThisFrame]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _recursiveGoToItem:fromItem:withLoadType:]): (-[WebFrame _goToItem:withLoadType:]): (-[WebFrame _actionInformationForLoadType:isFormSubmission:event:originalURL:]): (-[WebFrame _continueLoadRequestAfterNewWindowPolicy:frameName:formState:]): (-[WebFrame _loadURL:referrer:intoChild:]): (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrame _currentBackForwardListItemToResetTo]): (-[WebFrame _itemForRestoringDocState]): (-[WebFrame _addExtraFieldsToRequest:mainResource:alwaysFromRequest:]): (-[WebFrame _loadType]): (-[WebFrame loadRequest:]): * WebView/WebFrameInternal.h: * WebView/WebView.m: 2006-10-08 Darin Adler <darin@apple.com> Reviewed by Maciej. - move WebFrameLoader creation and ownership from WebFrame to WebFrameBridge * Loader/WebFrameLoader.m: (-[WebFrameLoader stopLoadingSubframes]): (-[WebFrameLoader closeOldDataSources]): * WebCoreSupport/WebFrameBridge.h: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge initMainFrameWithPage:frameName:view:]): (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]): (-[WebFrameBridge dealloc]): (-[WebFrameBridge loader]): (-[WebFrameBridge setTitle:]): (-[WebFrameBridge receivedData:textEncodingName:]): (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:]): (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:postData:]): (-[WebFrameBridge reportClientRedirectToURL:delay:fireDate:lockHistory:isJavaScriptFormAction:]): (-[WebFrameBridge reportClientRedirectCancelled:]): (-[WebFrameBridge loadURL:referrer:reload:userGesture:target:triggeringEvent:form:formValues:]): (-[WebFrameBridge didFirstLayout]): (-[WebFrameBridge imageTitleForFilename:size:]): (-[WebFrameBridge notifyIconChanged:]): (-[WebFrameBridge originalRequestURL]): (-[WebFrameBridge isLoadTypeReload]): * WebView/WebFrame.m: (-[NSView setWebFrame::]): (-[WebFramePrivate dealloc]): (-[WebFramePrivate setWebFrameView:]): (-[WebFramePrivate setProvisionalItem:]): (-[WebFrame _webDataRequestForData:MIMEType:textEncodingName:baseURL:unreachableURL:]): (-[WebFrame _createItem:]): (-[WebFrame _createItemTreeWithTargetFrame:clippedAtTarget:]): (-[WebFrame _detachFromParent]): (-[WebFrame _makeDocumentView]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _provisionalLoadStarted]): (-[WebFrame _opened]): (-[WebFrame _checkLoadCompleteForThisFrame]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _recursiveGoToItem:fromItem:withLoadType:]): (-[WebFrame _continueLoadRequestAfterNewWindowPolicy:frameName:formState:]): (-[WebFrame _loadURL:referrer:intoChild:]): (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrame _setTitle:]): (-[WebFrame _defersCallbacksChanged]): (-[WebFrame _currentBackForwardListItemToResetTo]): (-[WebFrame _itemForSavingDocState]): (-[WebFrame _itemForRestoringDocState]): (-[WebFrame _saveDocumentAndScrollState]): (-[WebFrame _shouldTreatURLAsSameAsCurrent:]): (-[WebFrame _loadRequest:inFrameNamed:]): (-[WebFrame _initWithWebFrameView:webView:bridge:]): (-[WebFrame _addExtraFieldsToRequest:mainResource:alwaysFromRequest:]): (-[WebFrame _frameLoader]): (-[WebFrame _prepareForDataSourceReplacement]): (-[WebFrame _restoreScrollPositionAndViewState]): (-[WebFrame _firstLayoutDone]): (-[WebFrame _loadType]): (-[WebFrame frameView]): (-[WebFrame provisionalDataSource]): (-[WebFrame dataSource]): (-[WebFrame loadRequest:]): (-[WebFrame loadArchive:]): (-[WebFrame stopLoading]): (-[WebFrame reload]): (-[WebFrame _resetBackForwardList]): (-[WebFrame _invalidateCurrentItemPageCache]): (-[WebFrame _provisionalItemIsTarget]): (-[WebFrame _loadProvisionalItemFromPageCache]): * WebView/WebFrameInternal.h: 2006-10-08 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - move remaining movable data fields from WebFrameLoader to WebFrame * Loader/WebDocumentLoadState.m: (-[WebDocumentLoadState commitIfReady]): * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader provisionalLoadStarted]): (-[WebFrameLoader _setState:]): (-[WebFrameLoader stopLoadingSubframes]): (-[WebFrameLoader stopLoading]): (-[WebFrameLoader startLoading]): (-[WebFrameLoader _receivedMainResourceError:complete:]): (-[WebFrameLoader clientRedirectCancelledOrFinished:]): (-[WebFrameLoader clientRedirectedTo:delay:fireDate:lockHistory:isJavaScriptFormAction:]): (-[WebFrameLoader shouldReloadForCurrent:andDestination:]): (-[WebFrameLoader loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrameLoader continueFragmentScrollAfterNavigationPolicy:formState:]): (-[WebFrameLoader closeOldDataSources]): (-[WebFrameLoader commitProvisionalLoad:]): (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrameLoader isQuickRedirectComing]): * Loader/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameBridge.h: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge frameLoader]): (-[WebFrameBridge setTitle:]): (-[WebFrameBridge reportClientRedirectToURL:delay:fireDate:lockHistory:isJavaScriptFormAction:]): (-[WebFrameBridge reportClientRedirectCancelled:]): (-[WebFrameBridge loadURL:referrer:reload:userGesture:target:triggeringEvent:form:formValues:]): * WebView/WebDataSource.m: (-[WebDataSource _loadFromPageCache:]): * WebView/WebFrame.m: (-[NSView setWebFrame::]): (-[WebFrame _addHistoryItemForFragmentScroll]): (-[WebFrame _didFinishLoad]): (-[WebFrame _provisionalLoadStarted]): (-[WebFrame _checkLoadCompleteForThisFrame]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _loadURL:referrer:intoChild:]): (-[WebFrame _frameLoadCompleted]): (-[WebFrame stopLoading]): (-[WebFrame _invalidateCurrentItemPageCache]): * WebView/WebFrameInternal.h: 2006-10-08 Darin Adler <darin@apple.com> Rubber stamped by Maciej. - changed "document load state" to "document loader" * Loader/WebDocumentLoadState.h: Removed. * Loader/WebDocumentLoadState.m: Removed. * Loader/WebDocumentLoader.h: Added. * Loader/WebDocumentLoader.m: Added. (-[WebDocumentLoader setMainDocumentError:]): (-[WebDocumentLoader mainReceivedError:complete:]): (-[WebDocumentLoader finishedLoading]): (-[WebDocumentLoader commitLoadWithData:]): (-[WebDocumentLoader setupForReplaceByMIMEType:]): (-[WebDocumentLoader updateLoading]): (-[WebDocumentLoader setTitle:]): * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader dealloc]): (-[WebFrameLoader activeDocumentLoader]): (-[WebFrameLoader activeDataSource]): (-[WebFrameLoader addPlugInStreamLoader:]): (-[WebFrameLoader removePlugInStreamLoader:]): (-[WebFrameLoader addSubresourceLoader:]): (-[WebFrameLoader removeSubresourceLoader:]): (-[WebFrameLoader dataSource]): (-[WebFrameLoader setDocumentLoader:]): (-[WebFrameLoader documentLoader]): (-[WebFrameLoader policyDataSource]): (-[WebFrameLoader setPolicyDocumentLoader:]): (-[WebFrameLoader clearDataSource]): (-[WebFrameLoader provisionalDataSource]): (-[WebFrameLoader provisionalDocumentLoader]): (-[WebFrameLoader setProvisionalDocumentLoader:]): (-[WebFrameLoader _clearProvisionalDataSource]): (-[WebFrameLoader _setState:]): (-[WebFrameLoader clearProvisionalLoad]): (-[WebFrameLoader commitProvisionalLoad]): (-[WebFrameLoader stopLoading]): (-[WebFrameLoader startLoading]): (-[WebFrameLoader startProvisionalLoad:]): (-[WebFrameLoader setupForReplace]): (-[WebFrameLoader _didReceiveResponse:forResource:]): (-[WebFrameLoader _originalRequest]): (-[WebFrameLoader _receivedMainResourceError:complete:]): (-[WebFrameLoader _receivedData:]): (-[WebFrameLoader _setRequest:]): (-[WebFrameLoader _isStopping]): (-[WebFrameLoader _setupForReplaceByMIMEType:]): (-[WebFrameLoader _setResponse:]): (-[WebFrameLoader _mainReceivedError:complete:]): (-[WebFrameLoader _finishedLoading]): (-[WebFrameLoader _checkContentPolicyForMIMEType:andCall:withSelector:]): (-[WebFrameLoader _loadRequest:archive:]): (-[WebFrameLoader _loadRequest:triggeringAction:loadType:formState:]): (-[WebFrameLoader _reloadAllowingStaleDataWithOverrideEncoding:]): (-[WebFrameLoader reload]): (-[WebFrameLoader finishedLoadingDocument:]): (-[WebFrameLoader committedLoadWithDocumentLoader:data:]): (-[WebFrameLoader revertToProvisionalWithDocumentLoader:]): (-[WebFrameLoader documentLoader:setMainDocumentError:]): (-[WebFrameLoader documentLoader:mainReceivedCompleteError:]): (-[WebFrameLoader finalSetupForReplaceWithDocumentLoader:]): (-[WebFrameLoader willChangeTitleForDocument:]): (-[WebFrameLoader didChangeTitleForDocument:]): (-[WebFrameLoader checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrameLoader loadDataSource:withLoadType:formState:]): * Plugins/WebPluginController.m: (-[WebPluginController pluginView:receivedResponse:]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge setTitle:]): (-[WebFrameBridge receivedData:textEncodingName:]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _mainDocumentError]): (-[WebDataSource _loadFromPageCache:]): (-[WebDataSource _bridge]): (-[WebDataSource _webView]): (-[WebDataSource _URLForHistory]): (-[WebDataSource _documentLoader]): (-[WebDataSource _initWithDocumentLoader:]): (-[WebDataSource initWithRequest:]): (-[WebDataSource dealloc]): (-[WebDataSource data]): (-[WebDataSource webFrame]): (-[WebDataSource initialRequest]): (-[WebDataSource request]): (-[WebDataSource response]): (-[WebDataSource textEncodingName]): (-[WebDataSource isLoading]): (-[WebDataSource unreachableURL]): (-[WebDataSource webArchive]): * WebView/WebDataSourceInternal.h: * WebView/WebDocumentLoadStateMac.h: Removed. * WebView/WebDocumentLoadStateMac.m: Removed. * WebView/WebDocumentLoaderMac.h: Added. * WebView/WebDocumentLoaderMac.m: Added. * WebView/WebFrame.m: (-[WebFrame _createItem:]): (-[WebFrame _receivedMainResourceError:]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _opened]): (-[WebFrame _checkLoadCompleteForThisFrame]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:formState:]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _addChild:]): (-[WebFrame _provisionalLoadStarted]): (-[WebFrame _dataSourceForDocumentLoader:]): (-[WebFrame _createDocumentLoaderWithRequest:]): * WebView/WebFrameInternal.h: * WebView/WebHTMLRepresentation.m: (-[WebHTMLRepresentation title]): * WebView/WebView.m: (-[WebView _mainFrameOverrideEncoding]): 2006-10-08 Darin Adler <darin@apple.com> Reviewed by Mitz. - fix http://bugs.webkit.org/show_bug.cgi?id=11218 REGRESSION: Assertion failure in WebFrameLoader when going back from a file: or data: URL Also added a helper function in WebFrameLoader so that checks for back/forward load types are easier to read. * Loader/WebFrameLoader.m: (-[WebFrameLoader _setPolicyDocumentLoadState:]): Fixed line of code that was setting the load state to nil instead of the passed-in object. (isBackForwardLoadType): Added. (-[WebFrameLoader shouldReloadToHandleUnreachableURLFromRequest:]): Use isBackForwardLoadType. (-[WebFrameLoader checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): Ditto. (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]): Ditto. 2006-10-08 Darin Adler <darin@apple.com> Reviewed by Maciej. - fix two recently introduced leaks: one of an NSString, the other of a WebDataSource * Loader/WebDocumentLoadState.m: (-[WebDocumentLoadState setTitle:]): Rearranged code to avoid storage leak in case of identical title. * Loader/WebFrameLoader.h: Removed _setPolicyDocumentLoadState: method from the header. * Loader/WebFrameLoader.m: (-[WebFrameLoader _setPolicyDocumentLoadState:]): Added logic to call detachFromFrameLoader as needed if this load state is going away rather than moving on to become the provisional load state. (-[WebFrameLoader shouldReloadToHandleUnreachableURLFromRequest:]): Tweaked formatting. (-[WebFrameLoader _loadRequest:archive:]): Added an assertion. (-[WebFrameLoader _loadRequest:triggeringAction:loadType:formState:]): Added an assertion. (-[WebFrameLoader _reloadAllowingStaleDataWithOverrideEncoding:]): Added an assertion. (-[WebFrameLoader reload]): Added an assertion. (-[WebFrameLoader loadDataSource:withLoadType:formState:]): Added a local variable to avoid calling _documentLoadState over and over again. 2006-10-07 Peter Kasting <pkasting@google.com> Reviewed/landed by Adam. http://bugs.webkit.org/show_bug.cgi?id=11199 Update Session History when a load is committed rather than completed. * COM/WebFrame.cpp: (WebFrame::receivedResponse): (WebFrame::receivedAllData): 2006-10-07 Sam Weinig <sam.weinig@gmail.com> Reviewed by Tim H. Patch for http://bugs.webkit.org/show_bug.cgi?id=11198 Auto-generate a few more Objective-C DOM interfaces * MigrateHeaders.make: 2006-10-07 Mark Rowe <bdash@webkit.org> Reviewed by Mitz. Fix memory leak from -[WebDocumentLoadState setTitle:]. * Loader/WebDocumentLoadState.m: (-[WebDocumentLoadState setTitle:]): Ensure 'trimmed' is released even when length is zero, and untangle the confusing logic around this case. 2006-10-06 Brady Eidson <beidson@apple.com> Reviewed by Darin Refactored a whole bunch of WebFramePrivate.h SPI to WebFrameInternal * DefaultDelegates/WebDefaultContextMenuDelegate.m: * History/WebHistoryItem.m: * Loader/WebFrameLoader.h: * Misc/WebCoreStatistics.m: * Misc/WebElementDictionary.m: * Plugins/WebNetscapePluginEmbeddedView.m: * Plugins/WebPluginController.m: * WebCoreSupport/WebViewFactory.m: * WebView/WebArchiver.m: * WebView/WebDataSource.m: * WebView/WebFrame.m: (-[WebFrame _isDescendantOfFrame:]): (-[WebFrame _setShouldCreateRenderers:]): (-[WebFrame _bodyBackgroundColor]): (-[WebFrame _isFrameSet]): (-[WebFrame _firstLayoutDone]): (-[WebFrame _loadType]): * WebView/WebFrameInternal.h: * WebView/WebFramePrivate.h: * WebView/WebHTMLRepresentation.m: * WebView/WebScriptDebugDelegate.m: 2006-10-06 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - Move all delegate dispatching code out of WebDataSource. * Loader/WebFrameLoader.m: (-[WebFrameLoader startLoading]): (-[WebFrameLoader _identifierForInitialRequest:]): (-[WebFrameLoader _willSendRequest:forResource:redirectResponse:]): (-[WebFrameLoader _didReceiveAuthenticationChallenge:forResource:]): (-[WebFrameLoader _didCancelAuthenticationChallenge:forResource:]): (-[WebFrameLoader _didReceiveResponse:forResource:]): (-[WebFrameLoader _didReceiveData:contentLength:forResource:]): (-[WebFrameLoader _didFinishLoadingForResource:]): (-[WebFrameLoader _didFailLoadingWithError:forResource:]): (-[WebFrameLoader _receivedMainResourceError:complete:]): (-[WebFrameLoader _downloadWithLoadingConnection:request:response:proxy:]): (-[WebFrameLoader _checkContentPolicyForMIMEType:andCall:withSelector:]): * WebView/WebDataSource.m: (-[WebDataSource _setLoadingFromPageCache:]): (-[WebDataSource _stopLoadingWithError:]): * WebView/WebDataSourceInternal.h: 2006-10-06 Darin Adler <darin@apple.com> Reviewed by Maciej. - moved firstLayoutDone BOOL from WebFrame to WebFrameLoader * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader didFirstLayout]): (-[WebFrameLoader provisionalLoadStarted]): (-[WebFrameLoader frameLoadCompleted]): (-[WebFrameLoader firstLayoutDone]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge didFirstLayout]): * WebView/WebFrame.m: (-[WebFrame _firstLayoutDone]): (-[WebFrame _provisionalLoadStarted]): (-[WebFrame _frameLoadCompleted]): (-[WebFrame _restoreScrollPositionAndViewState]): * WebView/WebFrameInternal.h: 2006-10-06 Darin Adler <darin@apple.com> Reviewed by Maciej. - moved more data and the corresponding code from WebFrame to WebFrameLoader * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader cannotShowMIMETypeForURL:]): (-[WebFrameLoader _checkNavigationPolicyForRequest:andCall:withSelector:]): (-[WebFrameLoader shouldReloadToHandleUnreachableURLFromRequest:]): (-[WebFrameLoader _loadRequest:archive:]): (-[WebFrameLoader _loadRequest:triggeringAction:loadType:formState:]): (-[WebFrameLoader _reloadAllowingStaleDataWithOverrideEncoding:]): (-[WebFrameLoader reload]): (-[WebFrameLoader invalidatePendingPolicyDecisionCallingDefaultAction:]): (-[WebFrameLoader checkNewWindowPolicyForRequest:action:frameName:formState:andCall:withSelector:]): (-[WebFrameLoader _continueAfterNewWindowPolicy:]): (-[WebFrameLoader checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): (-[WebFrameLoader continueAfterNavigationPolicy:]): (-[WebFrameLoader continueAfterWillSubmitForm:]): (-[WebFrameLoader continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrameLoader loadDataSource:withLoadType:formState:]): (-[WebFrameLoader handleUnimplementablePolicyWithErrorCode:forURL:]): (-[WebFrameLoader delegateIsHandlingProvisionalLoadError]): (-[WebFrameLoader setDelegateIsHandlingProvisionalLoadError:]): * Loader/WebFrameLoaderClient.h: * WebView/WebFrame.m: (-[NSView setWebFrame::]): (-[WebFramePrivate dealloc]): (-[WebFrame _checkLoadCompleteForThisFrame]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrame _loadRequest:inFrameNamed:]): (-[WebFrame stopLoading]): (-[WebFrame _resetBackForwardList]): (-[WebFrame _quickRedirectComing]): (-[WebFrame _provisionalItemIsTarget]): (-[WebFrame _loadProvisionalItemFromPageCache]): * WebView/WebFrameInternal.h: * WebView/WebFramePrivate.h: * WebKit.xcodeproj/project.pbxproj: 2006-10-06 Maciej Stachowiak <mjs@apple.com> Rubber stamped by Darin. - removed includes of unused headers. * WebView/WebDataSource.m: 2006-10-06 Maciej Stachowiak <mjs@apple.com> Not reviewed. - fix build breakage * Loader/WebFrameLoader.m: (-[WebFrameLoader willChangeTitleForDocumentLoadState:]): (-[WebFrameLoader didChangeTitleForDocumentLoadState:]): 2006-10-06 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - move remaining movable WebDataSource fields to WebDocumentLoadState * Loader/WebDocumentLoadState.h: * Loader/WebDocumentLoadState.m: (-[WebDocumentLoadState dealloc]): (-[WebDocumentLoadState isLoadingInAPISense]): (-[WebDocumentLoadState addResponse:]): (-[WebDocumentLoadState stopRecordingResponses]): (-[WebDocumentLoadState title]): (-[WebDocumentLoadState setLastCheckedRequest:]): (-[WebDocumentLoadState lastCheckedRequest]): (-[WebDocumentLoadState triggeringAction]): (-[WebDocumentLoadState setTriggeringAction:]): (-[WebDocumentLoadState responses]): (-[WebDocumentLoadState setOverrideEncoding:]): (-[WebDocumentLoadState overrideEncoding]): (-[WebDocumentLoadState setTitle:]): * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader _setState:]): (-[WebFrameLoader _loadRequest:archive:]): (-[WebFrameLoader _loadRequest:triggeringAction:loadType:formState:]): (-[WebFrameLoader _reloadAllowingStaleDataWithOverrideEncoding:]): (-[WebFrameLoader reload]): (-[WebFrameLoader willChangeTitleForDocumentLoadState:]): (-[WebFrameLoader didChangeTitleForDocumentLoadState:]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge setTitle:]): (-[WebFrameBridge receivedData:textEncodingName:]): * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _didReceiveResponse:forResource:]): (-[WebDataSource textEncodingName]): * WebView/WebDataSourceInternal.h: * WebView/WebFrame.m: (-[WebFrame _opened]): (-[WebFrame _checkNavigationPolicyForRequest:dataSource:formState:andCall:withSelector:]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _addChild:]): (-[WebFrame _loadDataSource:withLoadType:formState:]): * WebView/WebHTMLRepresentation.m: (-[WebHTMLRepresentation title]): * WebView/WebView.m: (-[WebView _mainFrameOverrideEncoding]): 2006-10-06 Darin Adler <darin@apple.com> Reviewed by Maciej. - moved loadType into WebFrameLoader * WebView/WebFramePrivate.h: Removed _setLoadType, but not _loadType because it's currently used by Safari. * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader _loadRequest:archive:]): (-[WebFrameLoader _loadRequest:triggeringAction:loadType:formState:]): (-[WebFrameLoader isReplacing]): (-[WebFrameLoader setReplacing]): (-[WebFrameLoader loadType]): (-[WebFrameLoader setLoadType:]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge isLoadTypeReload]): * WebView/WebFrame.m: (-[WebFrame _loadType]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _commitProvisionalLoad:]): (-[WebFrame _opened]): (-[WebFrame _checkLoadCompleteForThisFrame]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _loadURL:referrer:intoChild:]): (-[WebFrame _currentBackForwardListItemToResetTo]): (-[WebFrame _itemForRestoringDocState]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrame _didFirstLayout]): (-[WebFrame _addExtraFieldsToRequest:mainResource:alwaysFromRequest:]): (-[WebFrame _provisionalLoadStarted]): (-[WebFrame loadRequest:]): 2006-10-06 Darin Adler <darin@apple.com> Reviewed by Maciej. - added WebFrameLoaderClient protocol -- to be used to make WebFrameLoader forget all about WebFrame * Loader/WebDocumentLoadState.h: Added comment about Maciej's planned renaming here. * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: Renamed webFrame to client and added the new protocol. Eventually we'll be removing the dependency on WebFrame entirely. * WebView/WebFrame.m: (-[WebFrame _initWithWebFrameView:webView:bridge:]): Update to call the method by its new name. * Loader/WebFrameLoaderClient.h: Added. * WebKit.xcodeproj/project.pbxproj: Updated for new file, sorted things. 2006-10-06 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - segregate WebFrame methods into ones that should be moved into WebFrameLoader and ones that don't need to Also removed useless WebFrameLoader part * WebView/WebFrame.m: (-[WebFramePrivate dealloc]): 2006-10-06 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - moved more data from WebDataSource to WebDocumentLoadState * Loader/WebDocumentLoadState.h: * Loader/WebDocumentLoadState.m: (-[WebDocumentLoadState commitLoadWithData:]): (-[WebDocumentLoadState prepareForLoadStart]): (-[WebDocumentLoadState loadingStartedTime]): (-[WebDocumentLoadState setIsClientRedirect:]): (-[WebDocumentLoadState isClientRedirect]): (-[WebDocumentLoadState setPrimaryLoadComplete:]): (-[WebDocumentLoadState isLoadingInAPISense]): * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader _setState:]): (-[WebFrameLoader _finishedLoading]): (-[WebFrameLoader documentLoadState:mainReceivedCompleteError:]): (-[WebFrameLoader prepareForLoadStart]): (-[WebFrameLoader subframeIsLoading]): * WebView/WebDataSource.m: (-[WebDataSource _fileWrapperForURL:]): (-[WebDataSource _startLoading]): (-[WebDataSource _loadFromPageCache:]): (-[WebDataSource isLoading]): * WebView/WebDataSourceInternal.h: * WebView/WebFrame.m: (-[WebFrame _transitionToCommitted:]): (-[WebFrame _opened]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): 2006-10-06 Alexey Proskuryakov <ap@nypop.com> Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=11183 REGRESSION: Safari loads error pages unstyled * WebView/WebFrame.m: (-[WebFrame _loadHTMLString:baseURL:unreachableURL:]): Use utf-8 encoding instead of the string's "fastest" encoding. 2006-10-06 Maciej Stachowiak <mjs@apple.com> Reviewed by Adam. - fixed the following bugs: http://bugs.webkit.org/show_bug.cgi?id=11136 "REGRESSION: Safari snippet editor doesn't work" http://bugs.webkit.org/show_bug.cgi?id=11140 "REGRESSION: view source window blank" http://bugs.webkit.org/show_bug.cgi?id=11146 "REGRESSION: Instead of showing the error page, Safari opens its Resources folder in the Finder" Possibly more. * Loader/WebDocumentLoadState.h: * Loader/WebDocumentLoadState.m: (-[WebDocumentLoadState actualRequest]): New method. * WebView/WebDataSource.m: (-[WebDataSource _startLoading]): We need to make sure not to start loading the main resource with the fake external request for an applewebdata: request. 2006-10-05 Adele Peterson <adele@apple.com> Reviewed by the letter 'B'. More build fixes. * WebKit.xcodeproj/project.pbxproj: * WebView/WebDynamicScrollBarsView.h: * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView updateScrollers]): (-[WebDynamicScrollBarsView setAllowsScrolling:]): (-[WebDynamicScrollBarsView allowsScrolling]): (-[WebDynamicScrollBarsView setAllowsHorizontalScrolling:]): (-[WebDynamicScrollBarsView setAllowsVerticalScrolling:]): (-[WebDynamicScrollBarsView allowsHorizontalScrolling]): (-[WebDynamicScrollBarsView allowsVerticalScrolling]): (-[WebDynamicScrollBarsView horizontalScrollingMode]): (-[WebDynamicScrollBarsView verticalScrollingMode]): (-[WebDynamicScrollBarsView setHorizontalScrollingMode:]): (-[WebDynamicScrollBarsView setVerticalScrollingMode:]): (-[WebDynamicScrollBarsView setScrollingMode:]): * WebView/WebView.m: (-[WebView setAlwaysShowVerticalScroller:]): (-[WebView alwaysShowVerticalScroller]): (-[WebView setAlwaysShowHorizontalScroller:]): (-[WebView alwaysShowHorizontalScroller]): 2006-10-05 Vladimir Olexa <vladimir.olexa@gmail.com> Reviewed by Timothy. Bug: http://bugs.webkit.org/show_bug.cgi?id=9887 Continuous spell checking now remembers user's setting. The change is applied globally, meaning, both TextArea and TextField are affected when either of them enables/disables spell checking. * WebView/WebPreferenceKeysPrivate.h: added a define for WebContinuousSpellCheckingEnabled * WebView/WebView.m: (-[WebViewPrivate init]): reads WebContinuousSpellCheckingEnabled from NSUserDefaults (-[WebView setContinuousSpellCheckingEnabled:]): (-[WebView isContinuousSpellCheckingEnabled]): 2006-10-05 MorganL <morganl.webkit@yahoo.com> Reviewed by Darin. Fixes http://bugs.webkit.org/show_bug.cgi?id=11162 * COM/WebFrame.cpp: (WebFrame::loadDataSource): (WebFrame::receivedResponse): 2006-10-05 Peter Kasting <pkasting@google.com> Reviewed by Darin, landed by Adam. http://bugs.webkit.org/show_bug.cgi?id=11176 Fix win32 build, adapt to Maciej's ResourceLoader changes. * COM/WebFrame.cpp: (WebFrame::loadDataSource): 2006-10-05 Marvin Decker <marv.decker@gmail.com> Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=10989 Provide a way for embedders to implement BrowserExtensionWin * COM/Interfaces/IWebUIDelegate.idl: * COM/WebFrame.cpp: (WebFrame::createNewWindow): * COM/WebFrame.h: 2006-10-04 Mark Rowe <bdash@webkit.org> Reviewed by NOBODY (build fix). * WebView/WebView.m: (-[WebView scrollDOMRangeToVisible:]): Move scrollDOMRangeToVisible: into the correct category. 2006-09-26 David Smith <catfish.man@gmail.com> Reviewed by Timothy. http://bugs.webkit.org/show_bug.cgi?id=3723 Add -scrollDOMRangeToVisible: * WebView/WebView.m: (-[WebView scrollDOMRangeToVisible:]): * WebView/WebViewPrivate.h: 2006-10-03 Graham Dennis <graham.dennis@gmail.com> Reviewed by Timothy. <http://bugs.webkit.org/show_bug.cgi?id=10338> When contentEditable, cursor doesn't change to hand Allow the behaviour of editable links to be specified by a WebPreference The preference WebKitEditableLinkBehavior has four options: - AlwaysLive: Safari 2.0 behaviour - OnlyLiveWithShiftKey: Firefox/WinIE behaviour (and prior WebKit-ToT behaviour) - LiveWhenNotFocused: Editable links are live only when their editable block is not focused, or when the shift key is pressed - DefaultBehavior: This is the same as OnlyLiveWithShiftKey. No layout tests, just a modification of a manual-test as it isn't possible to test this automatically. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.m: (+[WebPreferences initialize]): (-[WebPreferences editableLinkBehavior]): (-[WebPreferences setEditableLinkBehavior:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.m: (-[WebView _updateWebCoreSettingsFromPreferences:]): 2006-10-03 Justin Garcia <justin.garcia@apple.com> Reviewed by harrison execCommand("Cut"/"Copy"/"Paste") broken in editable subframes. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge issueCutCommand]): Issue the command on the WebHTMLView, not the WebView. (-[WebFrameBridge issueCopyCommand]): Ditto. (-[WebFrameBridge issuePasteCommand]): Ditto. (-[WebFrameBridge issuePasteAndMatchStyleCommand]): Ditto. (-[WebFrameBridge issueTransposeCommand]): Fixed formatting. (-[WebFrameBridge canPaste]): Ask the WebHTMLView, not the WebView. * WebView/WebHTMLView.m: (-[WebHTMLView copy:]): Moved to WebInternal (-[WebHTMLView cut:]): Ditto. (-[WebHTMLView paste:]): Ditto. (-[WebHTMLView pasteAsPlainText:]): Ditto. * WebView/WebHTMLViewInternal.h: * WebView/WebView.m: Removed the now unused _canPaste. * WebView/WebViewInternal.h: Ditto. 2006-10-03 Justin Garcia <justin.garcia@apple.com> Reviewed by geoff <rdar://problem/4763519> REGRESSION: Multipart/x-mixed-replace sub-resources fail to load * Loader/WebSubresourceLoader.m: (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forFrameLoader:]): Enable multipart/x-mixed-replace support on the request. This line was accidently removed during some loader refactoring. 2006-10-02 Adam Roben <aroben@apple.com> Reviewed by Maciej. Add message paramter to WebView::mouse* methods to pass down to PlatformMouseEvent. * COM/WebView.cpp: (WebView::mouseMoved): (WebView::mouseDown): (WebView::mouseUp): (WebView::mouseDoubleClick): (WebViewWndProc): * COM/WebView.h: 2006-10-02 Maciej Stachowiak <mjs@apple.com> Reviewed by Alice. - take away direct knowledge of WebFrame from WebDataSource * Loader/WebDocumentLoadState.h: * Loader/WebDocumentLoadState.m: (-[WebDocumentLoadState setFrameLoader:]): (-[WebDocumentLoadState detachFromFrameLoader]): * Loader/WebFrameLoader.m: (-[WebFrameLoader _setDocumentLoadState:]): (-[WebFrameLoader _setProvisionalDocumentLoadState:]): * WebView/WebDataSource.m: * WebView/WebDataSourceInternal.h: * WebView/WebDocumentLoadStateMac.m: (-[WebDocumentLoadStateMac detachFromFrameLoader]): * WebView/WebFrame.m: (-[WebFrame _loadDataSource:withLoadType:formState:]): 2006-10-02 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - move a big slice of data and logic from WebDataSource to WebDocumentLoadState * Loader/WebDocumentLoadState.h: * Loader/WebDocumentLoadState.m: (-[WebDocumentLoadState initWithRequest:]): (-[WebDocumentLoadState dealloc]): (-[WebDocumentLoadState originalRequestCopy]): (-[WebDocumentLoadState request]): (-[WebDocumentLoadState replaceRequestURLForAnchorScrollWithURL:]): (-[WebDocumentLoadState setRequest:]): (-[WebDocumentLoadState setResponse:]): (-[WebDocumentLoadState isStopping]): (-[WebDocumentLoadState bridge]): (-[WebDocumentLoadState setMainDocumentError:]): (-[WebDocumentLoadState mainDocumentError]): (-[WebDocumentLoadState clearErrors]): (-[WebDocumentLoadState mainReceivedError:complete:]): (-[WebDocumentLoadState stopLoading]): (-[WebDocumentLoadState setupForReplace]): (-[WebDocumentLoadState commitIfReady]): (-[WebDocumentLoadState finishedLoading]): (-[WebDocumentLoadState setCommitted:]): (-[WebDocumentLoadState isCommitted]): (-[WebDocumentLoadState setLoading:]): (-[WebDocumentLoadState isLoading]): (-[WebDocumentLoadState commitLoadWithData:]): (-[WebDocumentLoadState doesProgressiveLoadWithMIMEType:]): (-[WebDocumentLoadState receivedData:]): (-[WebDocumentLoadState setupForReplaceByMIMEType:]): (-[WebDocumentLoadState updateLoading]): (-[WebDocumentLoadState response]): * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader activeDocumentLoadState]): (-[WebFrameLoader activeDataSource]): (-[WebFrameLoader _archivedSubresourceForURL:]): (-[WebFrameLoader addPlugInStreamLoader:]): (-[WebFrameLoader removePlugInStreamLoader:]): (-[WebFrameLoader addSubresourceLoader:]): (-[WebFrameLoader removeSubresourceLoader:]): (-[WebFrameLoader documentLoadState]): (-[WebFrameLoader provisionalDocumentLoadState]): (-[WebFrameLoader stopLoading]): (-[WebFrameLoader _originalRequest]): (-[WebFrameLoader _receivedData:]): (-[WebFrameLoader _setRequest:]): (-[WebFrameLoader bridge]): (-[WebFrameLoader _handleFallbackContent]): (-[WebFrameLoader _isStopping]): (-[WebFrameLoader _setupForReplaceByMIMEType:]): (-[WebFrameLoader _setResponse:]): (-[WebFrameLoader _mainReceivedError:complete:]): (-[WebFrameLoader _finishedLoading]): (-[WebFrameLoader didReceiveServerRedirectForProvisionalLoadForFrame]): (-[WebFrameLoader finishedLoadingDocumentLoadState:]): (-[WebFrameLoader commitProvisitionalLoad]): (-[WebFrameLoader committedLoadWithDocumentLoadState:data:]): (-[WebFrameLoader isReplacing]): (-[WebFrameLoader setReplacing]): (-[WebFrameLoader revertToProvisionalWithDocumentLoadState:]): (-[WebFrameLoader documentLoadState:setMainDocumentError:]): (-[WebFrameLoader documentLoadState:mainReceivedCompleteError:]): (-[WebFrameLoader finalSetupForReplaceWithDocumentLoadState:]): * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _prepareForLoadStart]): (-[WebDataSource _mainDocumentError]): (-[WebDataSource _finishedLoading]): (-[WebDataSource _receivedData:]): (-[WebDataSource _setMainDocumentError:]): (-[WebDataSource _clearUnarchivingState]): (-[WebDataSource _revertToProvisionalState]): (-[WebDataSource _receivedMainResourceError:complete:]): (-[WebDataSource _startLoading]): (-[WebDataSource _loadFromPageCache:]): (-[WebDataSource _bridge]): (-[WebDataSource _setPrimaryLoadComplete:]): (-[WebDataSource _URLForHistory]): (-[WebDataSource _setTitle:]): (-[WebDataSource _initWithDocumentLoadState:]): (-[WebDataSource request]): (-[WebDataSource response]): (-[WebDataSource isLoading]): (-[WebDataSource webArchive]): * WebView/WebDataSourceInternal.h: * WebView/WebDocumentLoadStateMac.m: (-[WebDocumentLoadStateMac initWithRequest:]): * WebView/WebFrame.m: (-[WebFrame _createItem:]): (-[WebFrame _receivedMainResourceError:]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _commitProvisionalLoad:]): (-[WebFrame _checkLoadCompleteForThisFrame]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:formState:]): (-[WebFrame _didReceiveServerRedirectForProvisionalLoadForFrame]): (-[WebFrame _provisionalLoadStarted]): * WebView/WebFrameInternal.h: 2006-10-02 Justin Garcia <justin.garcia@apple.com> Reviewed by john <rdar://problem/4757583> REGRESSION: tabbing into page focuses wrong control on 2nd pass <rdar://problem/4757594> REGRESSION: Form field is left with secondary selection after tabbing out of WebView * WebView/WebHTMLView.m: (-[NSArray maintainsInactiveSelection]): Replace code that I removed in error in the patch for 9642. Only leave inactive editable selections in the WebHTMLView if the nextResponder is in the same WebView. 2006-10-02 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - remove webFrame field from WebDataSourcePrivate, it can get it from WebDocumentLoadState now * Loader/WebDocumentLoadState.h: * Loader/WebDocumentLoadState.m: (-[WebDocumentLoadState frameLoader]): * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _revertToProvisionalState]): (-[WebDataSource _setupForReplaceByMIMEType:]): (-[WebDataSource _updateLoading]): (-[WebDataSource _startLoading]): (-[WebDataSource _setWebFrame:]): (-[WebDataSource _defersCallbacksChanged]): (-[WebDataSource _stopLoading]): (-[WebDataSource _webView]): (-[WebDataSource _stopLoadingWithError:]): (-[WebDataSource _setPrimaryLoadComplete:]): (-[WebDataSource dealloc]): (-[WebDataSource webFrame]): (-[WebDataSource isLoading]): 2006-10-02 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - fix crash on back/forward - reattach WebDocumentLoadState to data source when needed * WebView/WebDataSource.m: (-[WebDataSource _setWebFrame:]): (-[WebDataSource _initWithDocumentLoadState:]): * WebView/WebDataSourceInternal.h: 2006-10-02 Maciej Stachowiak <mjs@apple.com> Build fix, not reviewed. - Added missing files to fix build. * WebView/WebDocumentLoadStateMac.h: Added. * WebView/WebDocumentLoadStateMac.m: Added. (-[WebDocumentLoadStateMac initWithRequest:]): (-[WebDocumentLoadStateMac dealloc]): (-[WebDocumentLoadStateMac setDataSource:]): (-[WebDocumentLoadStateMac dataSource]): (-[WebDocumentLoadStateMac setFrameLoader:]): 2006-10-01 Maciej Stachowiak <mjs@apple.com> Reviewed by Brady and Oliver. - move things around so that WebDataSource and WebDocumentLoadState know about each other in the right way. This lines things up to move nearly all functionality down to WebDocumentLoadState. * Loader/WebDocumentLoadState.h: * Loader/WebDocumentLoadState.m: (-[WebDocumentLoadState initWithRequest:]): (-[WebDocumentLoadState dealloc]): (-[WebDocumentLoadState originalRequest]): * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader dealloc]): (-[WebFrameLoader addSubresourceLoader:]): (-[WebFrameLoader startLoadingMainResourceWithRequest:identifier:]): (-[WebFrameLoader dataSource]): (-[WebFrameLoader _setDocumentLoadState:]): (-[WebFrameLoader policyDataSource]): (-[WebFrameLoader _setPolicyDocumentLoadState:]): (-[WebFrameLoader clearDataSource]): (-[WebFrameLoader provisionalDataSource]): (-[WebFrameLoader _setProvisionalDocumentLoadState:]): (-[WebFrameLoader _clearProvisionalDataSource]): (-[WebFrameLoader _setState:]): (-[WebFrameLoader clearProvisionalLoad]): (-[WebFrameLoader commitProvisionalLoad]): (-[WebFrameLoader stopLoading]): (-[WebFrameLoader startLoading]): (-[WebFrameLoader startProvisionalLoad:]): (-[WebFrameLoader setupForReplace]): (-[WebFrameLoader activeDocumentLoadState]): (-[WebFrameLoader activeDataSource]): (-[WebFrameLoader _loadRequest:archive:]): (-[WebFrameLoader _loadRequest:triggeringAction:loadType:formState:]): (-[WebFrameLoader _reloadAllowingStaleDataWithOverrideEncoding:]): (-[WebFrameLoader reload]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _startLoading]): (-[WebDataSource _setWebFrame:]): (-[WebDataSource _documentLoadState]): (-[WebDataSource _initWithDocumentLoadState:]): (-[WebDataSource initWithRequest:]): (-[WebDataSource initialRequest]): (-[WebDataSource unreachableURL]): * WebView/WebDataSourceInternal.h: * WebView/WebFrame.m: (-[WebFramePrivate dealloc]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrame _loadDataSource:withLoadType:formState:]): (-[WebFrame _policyDataSource]): (-[WebFrame _shouldReloadToHandleUnreachableURLFromRequest:]): (-[WebFrame _dataSourceForDocumentLoadState:]): (-[WebFrame _createDocumentLoadStateWithRequest:]): * WebView/WebFrameInternal.h: 2006-09-29 David Hyatt <hyatt@apple.com> Change the default minimum font size pref to 0 in order to allow font-size:0 to work. * WebView/WebPreferences.m: (+[WebPreferences initialize]): 2006-09-28 Timothy Hatcher <timothy@apple.com> Reviewed by Maciej. Switch the inspector over to use border-image with styled buttons and selects. * WebInspector/WebInspector.m: (-[NSWindow window]): (-[NSWindow setWebFrame:]): (-[WebInspector _updateRoot]): * WebInspector/webInspector/Images/button.png: Added. * WebInspector/webInspector/Images/buttonDivider.png: Added. * WebInspector/webInspector/Images/buttonPressed.png: Added. * WebInspector/webInspector/Images/popup.png: Added. * WebInspector/webInspector/Images/popupFill.png: Removed. * WebInspector/webInspector/Images/popupFillPressed.png: Removed. * WebInspector/webInspector/Images/popupLeft.png: Removed. * WebInspector/webInspector/Images/popupLeftPressed.png: Removed. * WebInspector/webInspector/Images/popupPressed.png: Added. * WebInspector/webInspector/Images/popupRight.png: Removed. * WebInspector/webInspector/Images/popupRightPressed.png: Removed. * WebInspector/webInspector/Images/squareButtonRight.png: Removed. * WebInspector/webInspector/Images/squareButtonRightPressed.png: Removed. * WebInspector/webInspector/inspector.css: * WebInspector/webInspector/inspector.html: * WebInspector/webInspector/inspector.js: 2006-09-28 Alice Liu <alice.liu@apple.com> fixing the windows build * COM/WebView.cpp: (WebView::mouseMoved): (WebView::mouseDown): (WebView::mouseUp): (WebView::mouseDoubleClick): 2006-09-27 Justin Garcia <justin.garcia@apple.com> Reviewed by thatcher <rdar://problem/4044271> Writing Direction menu doesn't reflect the current writing direction (9773) * English.lproj/Localizable.strings: Added "Right to Left" and "Left to Right" * WebView/WebHTMLView.m: (-[NSArray validateUserInterfaceItem:]): Validate menu items that perform toggleBaseWritingDirection and changeBaseWritingDirection. Disable the menu item that changes the writing direction to NSWritingDirectionNautral because NSWritingDirectionNatural's behavior can't be implemented with CSS. Take control of the title of the menu item that performs toggleBaseWritingDirection: instead of checking/unchecking it, otherwise we wouldn't know what a check means. (-[NSArray changeBaseWritingDirection:]): ASSERT that the requested writing direction is not NSWritingDirectionNatural, since we've disabled the menu item that performs it. 2006-09-27 MorganL <morganl.webkit@yahoo.com> Reviewed by Maciej, landed by Brady Update URL request associated with provisional data source on redirect. Notify IWebFrameLoadDelegate of redirects for the provisional load. Notify IWebFrameLoadDelegate of a provisional load being commited. * COM/WebDataSource.cpp: (WebDataSource::replaceRequest): * COM/WebDataSource.h: * COM/WebFrame.cpp: (WebFrame::receivedRedirect): (WebFrame::receivedResponse): (WebFrame::receivedData): 2006-09-26 John Sullivan <sullivan@apple.com> Reviewed by Darin * WebView/WebHTMLViewPrivate.h: * WebView/WebHTMLView.m: (-[WebHTMLView markAllMatchesForText:caseSensitive:limit:]): Added limit parameter, passed over the bridge. Stop the search if it hits limit. * WebView/WebViewPrivate.h: * WebView/WebView.m: (-[WebView markAllMatchesForText:caseSensitive:highlight:limit:]): Added limit parameter, passed to WebHTMLView. 2006-09-26 David Harrison <harrison@apple.com> Reviewed by John and TimH. <rdar://problem/4743256> Seed: Ctrl-Y key binding does nothing when kill ring is empty Use deleteBackward: when the killring string is empty. Was always using insertText:, but that ends up early-returning if the string to insert is empty. * WebView/WebHTMLView.m: (-[NSArray yank:]): (-[NSArray yankAndSelect:]): 2006-09-25 Timothy Hatcher <timothy@apple.com> Reviewed by Brady. Use the non-deprecated method names for getComputedStyle, setEnd and setStart. * WebInspector/WebInspector.m: (-[WebInspector _highlightNode:]): * WebView/WebHTMLView.m: (unionDOMRanges): (-[WebHTMLView _selectRangeInMarkedText:]): (-[WebTextCompleteController doCompletion]): * WebView/WebView.m: (-[WebView computedStyleForElement:pseudoElement:]): 2006-09-22 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Pass all headers through unifdef to filter out BUILDING_ON_TIGER blocks if MACOSX_DEPLOYMENT_TARGET is 10.4. * MigrateHeaders.make: 2006-09-20 Justin Garcia <justin.garcia@apple.com> Reviewed by john <http://bugs.webkit.org/show_bug.cgi?id=7165> TinyMCE: Dragging & dropping content always leaves a copy when editing inside a subframe The top level WebHTMLView is responsible for performing dragging operations, but the inner view, the view that holds the drag caret, should be consulted to determine if the drag is a move drag. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLView.m: (-[NSArray dragImage:at:offset:event:pasteboard:source:slideBack:]): Don't set initatedDrag here, because it's only the top level WebHTMLView that performs this operation. (-[WebHTMLView _setInitiatedDrag:]): Added. (-[WebHTMLView _initiatedDrag]): Ditto. (-[WebHTMLView _canProcessDragWithDraggingInfo:]): Ask the innerView if it initiated the drag, not the top level view. (-[WebHTMLView _isMoveDrag]): The top level view asks the innerView if it should perform a move drag, so don't ASSERT _isTopHTMLView. (-[WebHTMLView draggingUpdatedWithDraggingInfo:actionMask:]): Ask the innerView if _isMoveDrag. (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): Ditto. * WebView/WebHTMLViewInternal.h: Added two private SPI so that the top level WebHTMLView can set and get the initiatedDrag BOOL. === Safari-521.27 === 2006-09-20 Brady Eidson <beidson@apple.com> Reviewed by Tim Omernick Fixing part of a crash Tim O showed me. [WebIconDatabase init] should finish gracefully even if we can't open the database * Misc/WebIconDatabase.m: (-[WebIconDatabase init]): 2006-09-20 Timothy Hatcher <timothy@apple.com> Reviewed by Tim O. <rdar://problem/4741392> Develop a system to find what version of WebKit an app was linked with * Misc/WebKitVersionChecks.h: Added. * Misc/WebKitVersionChecks.m: Added. (WebKitLinkedOnOrAfter): Added. (WebKitLinkTimeVersion): Added. (WebKitRunTimeVersion): Added. * WebKit.xcodeproj/project.pbxproj: 2006-09-20 Tim Omernick <timo@apple.com> Reviewed by Darin. * Misc/WebIconDatabase.m: (-[WebIconDatabase init]): Fixed a typo. 2006-09-20 Brady Eidson <beidson@apple.com> Reviewed by Darin Preparing to make the WebIconDatabase disabled by default - this patch tells the bridge whether its enabled or not * Misc/WebIconDatabase.m: (-[WebIconDatabase init]): 2006-09-19 Brady Eidson <beidson@apple.com> Reviewed by Sarge Decker <rdar://problem/4739892> and <rdar://problem/4729797> - WebCore::IconDatabase needs to have and respect an enabled() flag - Mail on ToT WebKit crashes in IconDatabase code when mailing a page from Safari * Misc/WebIconDatabase.m: (-[WebIconDatabase init]): If preference says icons are disabled, tell the bridge (-[WebIconDatabase _isEnabled]): Ask the bridge if the database is enabled 2006-09-19 Alexey Proskuryakov <ap@nypop.com> Reviewed by Tim O. http://bugs.webkit.org/show_bug.cgi?id=10661 REGRESSION: CFM plug-ins (Shockwave, SVG) are not loaded * Plugins/WebBasePluginPackage.m: (-[WebBasePluginPackage initWithPath:]): On 32-bit PowerPC, don't bail out if the bundle is nil - it can be a CFM plugin. 2006-09-18 Brady Eidson <beidson@apple.com> Reviewed by Anders Implement a bridge method so WebCore can find the reload type of a frame load * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge isLoadTypeReload]): 2006-09-18 Sam Weinig <sam.weinig@gmail.com> Reviewed by Tim H. Patch for http://bugs.webkit.org/show_bug.cgi?id=10903 Yet Another Objective-C Bindings Patch * MigrateHeaders.make: 2006-09-17 David Harrison <harrison@apple.com> Reviewed by John Sullivan. <rdar://problem/4494340> REGRESSION: Making the font size bigger/smaller in an HTML message doesn't affect the body until you reopen it Problem was the public API -[WebView setTextSizeMultiplier] did not notify anyone that the value changed. * WebView/WebDocumentInternal.h: Add _textSizeMultiplierChanged to the _WebDocumentTextSizing protocol. * WebView/WebHTMLView.m: (-[WebHTMLView _textSizeMultiplierChanged]): Send [self _updateTextSizeMultiplier]. * WebView/WebPDFView.m: (-[WebPDFView _textSizeMultiplierChanged]): ASSERT_NOT_REACHED() because WebPDFView does not track the common multiplier. * WebView/WebView.m: (-[WebView setTextSizeMultiplier:]): Send [self _notifyTextSizeMultiplierChanged]; (-[WebView _performTextSizingSelector:withObject:onTrackingDocs:selForNonTrackingDocs:newScaleFactor:]): Alter the _textSizeMultiplier directly so that notification is not sent. Minor formatting. (-[WebView _notifyTextSizeMultiplierChanged]): New. Send _textSizeMultiplierChanged to all document views that track the common multiplier. 2006-09-16 Brady Eidson <beidson@apple.com> Reviewed by Hyatt WebIconLoader is dead, long live WebCore::IconLoader (code prune) * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader dealloc]): (-[WebFrameLoader commitProvisionalLoad]): * Loader/WebIconLoader.h: Removed. * Loader/WebIconLoader.m: Removed. * Misc/WebIconDatabase.h: * Misc/WebIconDatabase.m: * Misc/WebIconDatabasePrivate.h: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge notifyIconChanged:]): * WebCoreSupport/WebIconDatabaseBridge.h: * WebCoreSupport/WebIconDatabaseBridge.m: (-[WebIconDatabaseBridge _init]): (-[WebIconDatabaseBridge _setIconData:forIconURL:]): (-[WebIconDatabaseBridge _setHaveNoIconForIconURL:]): * WebKit.exp: * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _stopLoading]): (-[WebDataSource _setPrimaryLoadComplete:]): * WebView/WebDataSourceInternal.h: 2006-09-16 Mark Rowe <opendarwin.org@bdash.net.nz> Reviewed by Anders. http://bugs.webkit.org/show_bug.cgi?id=10887 Fix build error * MigrateHeaders.make: Remove reference to DOMEventPrivate.h. 2006-09-15 Timothy Hatcher <timothy@apple.com> Reviewed by Brady. Make new style ObjC methods public API. * MigrateHeaders.make: 2006-09-15 Sam Weinig <sam.weinig@gmail.com> Reviewed by Tim H. Patch for http://bugs.webkit.org/show_bug.cgi?id=10870 Auto-generate DOMNode for the Objective-C bindings * MigrateHeaders.make: 2006-09-15 Timothy Hatcher <timothy@apple.com> Reviewed by Justin. Call the bridge directly for alter selection calls. All of this logic is now in WebCore's SelectionController. * WebView/WebHTMLView.m: (-[NSArray moveBackward:]): (-[NSArray moveBackwardAndModifySelection:]): (-[NSArray moveDown:]): (-[NSArray moveDownAndModifySelection:]): (-[NSArray moveForward:]): (-[NSArray moveForwardAndModifySelection:]): (-[NSArray moveLeft:]): (-[NSArray moveLeftAndModifySelection:]): (-[NSArray moveRight:]): (-[NSArray moveRightAndModifySelection:]): (-[NSArray moveToBeginningOfDocument:]): (-[NSArray moveToBeginningOfDocumentAndModifySelection:]): (-[NSArray moveToBeginningOfSentence:]): (-[NSArray moveToBeginningOfSentenceAndModifySelection:]): (-[NSArray moveToBeginningOfLine:]): (-[NSArray moveToBeginningOfLineAndModifySelection:]): (-[NSArray moveToBeginningOfParagraph:]): (-[NSArray moveToBeginningOfParagraphAndModifySelection:]): (-[NSArray moveToEndOfDocument:]): (-[NSArray moveToEndOfDocumentAndModifySelection:]): (-[NSArray moveToEndOfSentence:]): (-[NSArray moveToEndOfSentenceAndModifySelection:]): (-[NSArray moveToEndOfLine:]): (-[NSArray moveToEndOfLineAndModifySelection:]): (-[NSArray moveToEndOfParagraph:]): (-[NSArray moveToEndOfParagraphAndModifySelection:]): (-[NSArray moveParagraphBackwardAndModifySelection:]): (-[NSArray moveParagraphForwardAndModifySelection:]): (-[NSArray moveUp:]): (-[NSArray moveUpAndModifySelection:]): (-[NSArray moveWordBackward:]): (-[NSArray moveWordBackwardAndModifySelection:]): (-[NSArray moveWordForward:]): (-[NSArray moveWordForwardAndModifySelection:]): (-[NSArray moveWordLeft:]): (-[NSArray moveWordLeftAndModifySelection:]): (-[NSArray moveWordRight:]): (-[NSArray moveWordRightAndModifySelection:]): (-[NSArray pageUp:]): (-[NSArray pageDown:]): (-[NSArray pageUpAndModifySelection:]): (-[NSArray pageDownAndModifySelection:]): 2006-09-15 Adam Roben <aroben@apple.com> Reviewed by eseidel. Fixes http://bugs.webkit.org/show_bug.cgi?id=10876 containsItemForURLUnicode uses matchLetter instead of matchUnicodeLetter Small fixes for _WebCoreHistoryProvider. * History/WebHistory.m: Consistently use BUFFER_SIZE #define (-[_WebCoreHistoryProvider containsItemForURLLatin1:length:]): (-[_WebCoreHistoryProvider containsItemForURLUnicode:length:]): Replace incorrect call to matchLetter to matchUnicodeLetter 2006-09-13 Brady Eidson <beidson@apple.com> Reviewed by Maciej Add infrastructure to support icon loads taking place in WebCore Will remove WebKit icon loaders in a later patch * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge notifyIconChanged:]): (-[WebFrameBridge originalRequestURL]): - Nuked two old, obsolete methods - Added bridge for notifying of an icon change - Added bridge for getting the "original request URL" which is still needed until that info is available in the WebCore loaders * WebView/WebDataSource.m: (-[WebDataSource _loadIcon]): - Empty body just for now, as it still gets called - next patch will prune all the old impl out 2006-09-13 Timothy Hatcher <timothy@apple.com> Reviewed by Tim O. <rdar://problem/4726416> obsolete confusing "ADVISORY NOTE" comment in WebHistory.h Removed the "ADVISORY NOTE: This method may change for the 1.0 SDK" comments. * History/WebHistory.h: === Safari-521.26 === 2006-09-11 MorganL <morlmor@yahoo.com> Reviewed/landed by aroben. Fixes http://bugs.webkit.org/show_bug.cgi?id=10765 Windows build busted due to std::copy usage in Vector.h * WebKit.vcproj/WebKit.vcproj: Define _SCL_SECURE_NO_DEPRECATE to get rid of deprecation warnings on std::copy 2006-09-11 Brady Eidson <beidson@apple.com> Despite the fact that some people built okay without this change, it sure was biting me, probably because I just wiped my build directory for a fresh build - Today's earlier removal of DOMList.h needed to occur in MigrateHeaders.make, as well * MigrateHeaders.make: removed DOMList.h 2006-09-10 Darin Adler <darin@apple.com> Reviewed by Brady. - fix http://bugs.webkit.org/show_bug.cgi?id=10547 REGRESSION: Links that should open in a new window open in the same window, while opening another blank window * WebView/WebFrame.m: (-[WebFrame _continueLoadRequestAfterNewWindowPolicy:frameName:formState:]): Changed a mistaken "self" to "frame", which was the cause of the bug. Also fixed the method so that it won't crash if createWebViewWithRequest does something that has a side effect of releasing this WebView or this frame by retaining "self" and "frame" as needed. Also fixed a problem where the code to set "opener" was backwards, and would set the opener of the old frame to point to the new frame instead of vice versa. 2006-09-09 Sam Weinig <sam.weinig@gmail.com> Reviewed by Eric. Patch for http://bugs.webkit.org/show_bug.cgi?id=10795 Auto-generate the Objective-C DOM XPath bindings * MigrateHeaders.make: 2006-09-09 Sam Weinig <sam.weinig@gmail.com> Reviewed by Eric. Patch for http://bugs.webkit.org/show_bug.cgi?id=10791 Even More Objective-C DOM auto-generation cleanup * MigrateHeaders.make: 2006-09-08 Tim Omernick <timo@apple.com> Reviewed by Brady Eidson. Rolled out Maciej's code cleanup from 8/22. It turns out that keeping the "loading" flag is a useful optimization, as it avoids many Objective-C method calls while polling resources for their load state. This fixes a 3-4% PLT performance regression (as measured on my MacBook Pro). * Loader/WebFrameLoader.m: (-[WebFrameLoader addPlugInStreamLoader:]): (-[WebFrameLoader removePlugInStreamLoader:]): (-[WebFrameLoader addSubresourceLoader:]): (-[WebFrameLoader removeSubresourceLoader:]): * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _prepareForLoadStart]): (-[WebDataSource _setLoading:]): (-[WebDataSource _updateLoading]): (-[WebDataSource _startLoading]): (-[WebDataSource _stopLoading]): (-[WebDataSource _setPrimaryLoadComplete:]): (-[WebDataSource isLoading]): * WebView/WebDataSourceInternal.h: 2006-09-07 Sam Weinig <sam.weinig@gmail.com> Reviewed by Darin and Tim H. Patch for http://bugs.webkit.org/show_bug.cgi?id=10774 Auto-generate the Objective-C DOM Traversal bindings * MigrateHeaders.make: 2006-09-07 Sam Weinig <sam.weinig@gmail.com> Reviewed by Darin. Patch for http://bugs.webkit.org/show_bug.cgi?id=10766 Auto-generate the Objective-C DOM Events bindings * MigrateHeaders.make: * WebKit.xcodeproj/project.pbxproj: 2006-09-06 Alexey Proskuryakov <ap@nypop.com> * MigrateHeaders.make: Fixed a double slash in "$(PRIVATE_HEADERS_DIR)//DOMCharacterDataPrivate.h" (this was reported to cause a build failure under certain circumstances). 2006-09-05 MorganL <morlmor@yahoocom> Reviewed/landed by aroben. Fixes bug 10743: Windows build is busted. * COM/WebView.cpp: (WebView::keyPress): 2006-09-05 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Drastically simplified the makefile for migrating headers from WebCore and JavaScriptCore. The old version was always copying the files. * MigrateHeaders.make: 2006-09-05 Darin Adler <darin@apple.com> Reviewed by Alexey. - WebKit side of changes to encoding * WebView/WebHTMLRepresentation.m: (-[WebHTMLRepresentation documentSource]): Changed to call new -[WebCoreFrameBridge stringWithData:] instead of the calling the old methods that used a CFStringEncoding: -[WebCoreFrameBridge textEncoding] and +[WebCoreFrameBridge stringWithData:textEncoding:]. * WebView/WebResource.m: (-[WebResource _stringValue]): Removed special case for nil encoding name. The bridge itself now has the rule that "nil encoding name means Latin-1", so we don't need to check for nil. * WebView/WebFrame.m: (-[WebFrame _checkLoadComplete]): Retain the frame until we get the parent frame while walking up parent frames, because it's possible for _checkLoadCompleteForThisFrame to release the last reference to the frame. (Not reviewed; needed to run performance tests successfully.) 2006-09-05 Timothy Hatcher <timothy@apple.com> Reviewed by Tim O. <rdar://problem/4682225> conflicting typedefs in Netscape plug-in headers * Plugins/npfunctions.h: fix the return type for NPN_IntFromIdentifierProcPtr to be int32_t 2006-09-04 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Bug 10714: ObjC autogeneration needs safe-guards against easily modifying the public API http://bugs.webkit.org/show_bug.cgi?id=10714 - Added the new private DOM headers. - Factored out the common commands into variables. - Made WebDashboardRegion.h private again. - Rename DOMDOMImplementation.h to DOMImplementation.h when files are migrated. Also fixes up #imports. * MigrateHeaders.make: 2006-09-03 Sam Weinig <sam.weinig@gmail.com> Reviewed by Darin and Tim H. - patch for http://bugs.webkit.org/show_bug.cgi?id=10711 Auto-generate the Objective-C DOM Stylesheet bindings * MigrateHeaders.make: 2006-09-02 Sam Weinig <sam.weinig@gmail.com> Reviewed by Tim H. - patch for http://bugs.webkit.org/show_bug.cgi?id=10684 Auto-generate the Objective-C DOM CSS bindings * MigrateHeaders.make: 2006-09-01 MorganL <morlmor@yahoo.com> Reviewed by Darin. Updated/landed by Adam. Fixes http://bugs.webkit.org/show_bug.cgi?id=10553 Windows build fixes * COM/WebFrame.cpp: (WebFrame::initWithName): 2006-09-01 Brady Eidson <beidson@apple.com> Reviewed by Darin A "never should be reached" method was reached - lets not release the shared database bridge, esp since we never retain it! * Misc/WebIconDatabase.m: (-[WebIconDatabase _applicationWillTerminate:]): Don't release the bridge 2006-09-01 Darin Adler <darin@apple.com> Reviewed by Brady. - a few small tweaks to the icon database bridge * Misc/WebIconDatabase.m: (-[WebIconDatabase init]): Updated for name change. * WebCoreSupport/WebIconDatabaseBridge.h: Removed unneeded declarations. * WebCoreSupport/WebIconDatabaseBridge.m: (-[WebIconDatabaseBridge init]): Added. Always returns nil since you're not supposed to allocate one of these. (-[WebIconDatabaseBridge _init]): Renamed from init. Used internally to make the shared instance. Added the "self = [super init]" idiom even though it's not important in this case just to be consistent. (-[WebIconDatabaseBridge releaseCachedLoaderForIconURL:]): Moved this up in the file so it can be called without declaring it in the header. (+[WebIconDatabaseBridge sharedInstance]): Renamed. Calls the new _init. Also use CFRetain for compatibility. (-[WebIconDatabaseBridge dealloc]): Emptied this out and made it just assert (false). (-[WebIconDatabaseBridge finalize]): Added and made it assert (false) too. 2006-09-01 Timothy Hatcher <timothy@apple.com> Reviewed by Adele. Bug 10677: Omit "-webkit-text-security: none;" from the computed style list http://bugs.webkit.org/show_bug.cgi?id=10677 * WebInspector/webInspector/inspector.js: 2006-08-31 Sam Weinig <sam.weinig@gmail.com> Reviewed by Tim H. - patch for http://bugs.webkit.org/show_bug.cgi?id=10669 Auto-generate the remaining Objective-C HTML DOM bindings * MigrateHeaders.make: 2006-08-31 Adele Peterson <adele@apple.com> Reviewed by Darin. WebKit part of fix for http://bugs.webkit.org/show_bug.cgi?id=10666 Password: Disallow Spelling, Font, Speech, and Writing Direction context menu * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate editingContextMenuItemsForElement:defaultMenuItems:]): Check that the selection isn't in a password field before adding these items to the default editing context menu. Search In Google, Search In Spotlight, Look up in Dictionary, Spelling, Font, Speech, Writing Direction * WebView/WebHTMLView.m: (-[WebHTMLView _isSelectionInPasswordField]): Added. * WebView/WebHTMLViewPrivate.h: 2006-08-31 Sam Weinig <sam.weinig@gmail.com> Reviewed by Tim H. - patch for http://bugs.webkit.org/show_bug.cgi?id=10653 Auto-generate another 20 Objective-C DOM HTML bindings * MigrateHeaders.make: * WebKit.xcodeproj/project.pbxproj: 2006-08-31 Adele Peterson <adele@apple.com> Reviewed by John Sullivan. Removed wkSecureEventInput and wkSetSecureEventInput, since this can be done with API. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2006-08-31 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick - fixed <rdar://problem/4711200> Loading history would be faster if it bypassed NSURL API for local files * History/WebHistory.m: (-[WebHistoryPrivate _loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]): Load file URLs using [NSDictionary dictionaryWithContentsOfFile:]. I also cleaned up some minor style issues in this method, and I removed the support for old NSArray-style history files (which we stopped using before Safari 1.0). 2006-08-30 Adele Peterson <adele@apple.com> Reviewed by Hyatt. WebKit part of fix for http://bugs.webkit.org/show_bug.cgi?id=10575 Enable secure input mode for new password fields * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2006-08-30 Brady Eidson <beidson@apple.com> Reviewed by John <rdar://problem/4707718> Change behavior so if the WebCore::IconDatabase can't open, WebKit releases the bridge and continues on as if the IconDatabase is disabled. * Misc/WebIconDatabase.m: (-[WebIconDatabase init]): Release the bridge on failure to open * WebCoreSupport/WebIconDatabaseBridge.m: (+[WebIconDatabaseBridge sharedBridgeInstance]): Moved static shared instance out as a global (-[WebIconDatabaseBridge dealloc]): Clear pointer to the shared instance 2006-08-30 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Simplify the header copies from WebCore and JavaScriptCore. Headers that need to be migrated from the other projects need to be added to MigrateHeaders.make. * MigrateHeaders.make: Added. * WebKit.xcodeproj/project.pbxproj: 2006-08-30 Sam Weinig <sam.weinig@gmail.com> Reviewed by Tim H. - patch for http://bugs.webkit.org/show_bug.cgi?id=10640 Auto-generate 10 more Objective-C DOM HTML bindings * WebKit.xcodeproj/project.pbxproj: 2006-08-30 Adele Peterson <adele@apple.com> Reviewed by Darin. WebKit part of fix for: http://bugs.webkit.org/show_bug.cgi?id=10576 Disallow copy from new password fields * WebView/WebHTMLView.m: (-[WebHTMLView _canCopy]): Now also calls across the bridge to ask if it mayCopy. (-[WebHTMLView _canCut]): Calls _canCopy now. (-[NSArray validateUserInterfaceItem:]): Calls _canCut when validating the "Cut" menu item. This used to call _canDelete (which used to be the same as _canCut), but now _canCut also checks _canCopy. 2006-08-30 Karl Adam <karladam@yahoo-inc.com> Reviewed by Eric and Tim H. Bug 10634: -webView:dragDestinationActionMaskForDraggingInfo: is ignored http://bugs.webkit.org/show_bug.cgi?id=10634 Remove the check for canShowFile: from _web_bestURL: since it shouldn't be concerned with whether or not the view can show the URL, merely return the most appropriate URL. * Misc/WebNSPasteboardExtras.m: (-[NSPasteboard _web_bestURL]): * Misc/WebNSViewExtras.m: (-[NSView _web_dragOperationForDraggingInfo:]): 2006-08-29 Brady Eidson <beidson@apple.com> Reviewed by Kevin Decker (Sarge) <rdar://problem/4678414> - New IconDB needs to delete icons when asked * Misc/WebIconDatabase.m: (-[WebIconDatabase removeAllIcons]): Call through to WebCore to remove icons, then send notification 2006-08-29 Brady Eidson <beidson@apple.com> Reviewed by Alice Added a truth value check for to setIconURL:forURL so WebKit can avoid sending a notification This is a win on the iBench * Misc/WebIconDatabase.m: (-[WebIconDatabase _setIconURL:forURL:]): 2006-08-29 Brady Eidson <beidson@apple.com> Reviewed by Tim Hatchers rubber stamp Removed some accidentally left-in console spew during the conversion to the new DB * Misc/WebIconDatabase.m: (objectFromPathForKey): Nuked some NSLogs 2006-08-29 Tim Omernick <timo@apple.com> Reviewed by Darin Adler. <rdar://problem/4688618> REGRESSION(10.4.7-9A241): JMol java applet fails in Safari not Firefox No layout test for now because Java doesn't work in DumpRenderTree. * Plugins/WebPluginDatabase.m: (-[WebPluginDatabase refresh]): Add each plug-in MIME type to registeredMIMETypes, even if we don't register a document view class for the MIME type. This fixes -[WebPluginDatabase isMIMETypeRegistered:] and thus fallback content for Java applets (we were always rendering fallback content, if any, for Java applets). 2006-08-29 Sam Weinig <sam.weinig@gmail.com> Reviewed by Tim H. - patch for http://bugs.webkit.org/show_bug.cgi?id=10628 Auto-generate the remaining Objective-C DOM bindings Auto-generates DOMHTMLCollection, DOMHTMLElement, DOMHTMLFormElement, and DOMHTMLOptionsCollection. * WebKit.xcodeproj/project.pbxproj: 2006-08-28 Brady Eidson <beidson@apple.com> Reviewed by Darin Short of a few small snippets that still need to be pushed to WebCore, this is a final prune of WebIconDatabase. WebFileDatabase and WebLRUFileList are gone and the small remaining snippets of WebFileDatabase code that were still important are now in static functions in WebIconDatabase.m * Loader/WebIconLoader.m: (-[WebIconLoader didFinishLoading]): Removed the flag * Misc/WebFileDatabase.h: Removed. * Misc/WebFileDatabase.m: Removed. * Misc/WebIconDatabase.m: (+[WebIconDatabase sharedIconDatabase]): (-[WebIconDatabase init]): (-[WebIconDatabase iconForURL:withSize:cache:]): (-[WebIconDatabase iconURLForURL:]): (-[WebIconDatabase defaultIconWithSize:]): (-[WebIconDatabase retainIconForURL:]): (-[WebIconDatabase releaseIconForURL:]): (-[WebIconDatabase _isEnabled]): (-[WebIconDatabase _setIconData:forIconURL:]): (-[WebIconDatabase _setHaveNoIconForIconURL:]): (-[WebIconDatabase _setIconURL:forURL:]): (-[WebIconDatabase _hasEntryForIconURL:]): (-[WebIconDatabase _applicationWillTerminate:]): (-[WebIconDatabase _resetCachedWebPreferences:]): (uniqueFilePathForKey): Added from WebFileDatabase (objectFromPathForKey): Added from WebFileDatabase (iconDataFromPathForIconURL): (-[WebIconDatabase _convertToWebCoreFormat]): Make use of static functions and local variables instead of using WebFileDatabase and WebIconDatabase variables that are now obsolete * Misc/WebIconDatabasePrivate.h: Removed alot of obsoleted members * Misc/WebLRUFileList.h: Removed. * Misc/WebLRUFileList.m: Removed. * WebKit.xcodeproj/project.pbxproj: Deleted 4 files * WebKitPrefix.h: Removed ICONDEBUG 2006-08-28 Tim Omernick <timo@apple.com> Reviewed by Darin Adler. * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView createPluginScriptableObject]): Removed a bogus typecast. 2006-08-28 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. Part of <rdar://problem/4481553> NetscapeMoviePlugIn example code scripting doesn't work in Firefox (4319) <http://bugs.webkit.org/show_bug.cgi?id=4319>: NetscapeMoviePlugIn example code scripting doesn't work in Firefox * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView createPluginScriptableObject]): Renamed this method (see corresponding WebCore ChangeLog entry for an explanation). Style changes. 2006-08-28 Brady Eidson <beidson@apple.com> Reviewed by Tim Hatcher's rubberstamp Rolled out my last change (16070 - pruning WebFileDatabase code) as it caused a difficult-to-track down failure in layout tests on a release build. * Misc/WebFileDatabase.h: * Misc/WebFileDatabase.m: (+[WebFileDatabaseOp opWithCode:key:object:]): (-[WebFileDatabaseOp initWithCode:key:object:]): (-[WebFileDatabaseOp opcode]): (-[WebFileDatabaseOp key]): (-[WebFileDatabaseOp object]): (-[WebFileDatabaseOp perform:]): (-[WebFileDatabaseOp dealloc]): (SetThreadPriority): (-[WebFileDatabase _createLRUList:]): (-[WebFileDatabase _truncateToSizeLimit:]): (+[WebFileDatabase _syncLoop:]): (databaseInit): (-[WebFileDatabase setTimer]): (-[WebFileDatabase setObject:forKey:]): (-[WebFileDatabase removeObjectForKey:]): (-[WebFileDatabase removeAllObjects]): (-[WebFileDatabase objectForKey:]): (-[WebFileDatabase performSetObject:forKey:]): (-[WebFileDatabase performRemoveObjectForKey:]): (-[WebFileDatabase open]): (-[WebFileDatabase close]): (-[WebFileDatabase lazySync:]): (-[WebFileDatabase sync]): (-[WebFileDatabase sizeLimit]): (-[WebFileDatabase count]): (-[WebFileDatabase usage]): (-[WebFileDatabase setSizeLimit:]): * Misc/WebIconDatabase.m: (-[WebIconDatabase _createFileDatabase]): (-[WebIconDatabase _loadIconDictionaries]): * WebKit.xcodeproj/project.pbxproj: 2006-08-28 Darin Adler <darin@apple.com> Reviewed by Tim Hatcher. * WebInspector/webInspector/inspector.js: Add "resize: none" to the list of default values for CSS properties so it will be omitted from most displays of computed style. 2006-08-28 Brady Eidson <beidson@apple.com> Reviewed by Maciej Major prune of unnecessary WebFileDatabase code. In the end, what useful code that remains in WebFileDatabase will likely be moved directly into WebIconDatabase * Misc/WebFileDatabase.h: * Misc/WebFileDatabase.m: (-[WebFileDatabase initWithPath:]): (-[WebFileDatabase objectForKey:]): (-[WebFileDatabase open]): (-[WebFileDatabase close]): * Misc/WebIconDatabase.m: (-[WebIconDatabase _createFileDatabase]): (-[WebIconDatabase _loadIconDictionaries]): * Misc/WebLRUFileList.h: Removed. * Misc/WebLRUFileList.m: Removed. * WebKit.xcodeproj/project.pbxproj: 2006-08-27 Sam Weinig <sam.weinig@gmail.com> Reviewed by Tim H. - patch for http://bugs.webkit.org/show_bug.cgi?id=4624 WebCore needs autogenerated Obj-C DOM bindings First round of auto-generated Objective C DOM bindings, starting with the DOM Core. * WebKit.xcodeproj/project.pbxproj: 2006-08-25 Brady Eidson <beidson@apple.com> Reviewed by Tim Hatcher Fixed up some leaks on [WebIconDatabase init] * Misc/WebIconDatabase.m: (-[WebIconDatabase init]): 2006-08-24 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. * WebView/WebFrame.m: (-[WebFrame _updateBackground]): reworded the comment about scroll view and setDrawsBackground:YES * WebView/WebView.m: (-[WebViewPrivate dealloc]): release the background color 2006-08-24 Timothy Hatcher <timothy@apple.com> Reviewed by Hyatt. WebView API to allow changing the background color that draws under transparent page backgrounds. * WebView/WebFrame.m: (-[WebFrame _makeDocumentView]): (-[WebFrame _updateBackground]): * WebView/WebFrameInternal.h: * WebView/WebFrameView.m: (-[WebFrameView drawRect:]): * WebView/WebView.m: (-[WebView setBackgroundColor:]): (-[WebView backgroundColor]): (-[WebView _commonInitializationWithFrameName:groupName:]): (-[WebView setDrawsBackground:]): * WebView/WebViewPrivate.h: 2006-08-24 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Fix for Mail stationary. Selecting a stationary item would cause this exception. *** -[WebSubresourceLoader copyWithZone:]: selector not recognized Uncaught exception - *** -[WebSubresourceLoader copyWithZone:]: selector not recognized * Loader/WebFrameLoader.m: (-[WebFrameLoader willUseArchiveForRequest:originalURL:loader:]): Use _webkit_setObject:forUncopiedKey: when addign the resource to pendingArchivedResources. 2006-08-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Adele. - fix assertion which I accidentally changed to one that sometimes fails http://bugs.webkit.org/show_bug.cgi?id=10531 * Loader/WebDocumentLoadState.m: (-[WebDocumentLoadState dealloc]): * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource dealloc]): 2006-08-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Brady. - move WebFrame code that creates WebDataSources down to WebFrameLoader, in preparation for WebFrameLoader just holding on to WebDocumentLoadState * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader _loadRequest:archive:]): (-[WebFrameLoader _loadRequest:triggeringAction:loadType:formState:]): (-[WebFrameLoader _reloadAllowingStaleDataWithOverrideEncoding:]): (-[WebFrameLoader reload]): * WebView/WebFrame.m: (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _continueLoadRequestAfterNewWindowPolicy:frameName:formState:]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrame _shouldReloadToHandleUnreachableURLFromRequest:]): (-[WebFrame loadRequest:]): (-[WebFrame loadArchive:]): (-[WebFrame reload]): * WebView/WebFrameInternal.h: * WebView/WebFramePrivate.h: * WebView/WebView.m: (-[WebView setCustomTextEncodingName:]): 2006-08-23 Brady Eidson <beidson@apple.com> Reviewed by Maciej First pass at pruning unused WebIconDatabase code. Focus on removing methods that simply have no place in the new DB at all. A few renames and a few important FIXMEs result, but no functionality changes. * Loader/WebIconLoader.m: (-[WebIconLoader didFinishLoading]): Call to WebIconDatabase instead of directly to the bridge * Misc/WebIconDatabase.h: * Misc/WebIconDatabase.m: (-[WebIconDatabase init]): (-[WebIconDatabase iconForURL:withSize:cache:]): (-[WebIconDatabase iconURLForURL:]): (-[WebIconDatabase defaultIconWithSize:]): (-[WebIconDatabase retainIconForURL:]): (-[WebIconDatabase releaseIconForURL:]): (-[WebIconDatabase removeAllIcons]): (-[WebIconDatabase _setIconData:forIconURL:]): (-[WebIconDatabase _setHaveNoIconForIconURL:]): (-[WebIconDatabase _setIconURL:forURL:]): (-[WebIconDatabase _hasEntryForIconURL:]): (-[WebIconDatabase _applicationWillTerminate:]): (-[WebIconDatabase _resetCachedWebPreferences:]): * Misc/WebIconDatabasePrivate.h: Changed setIcon: to setIconData: 2006-08-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Adele. - started factoring most of the guts of WebDataSource into a new class WebDocumentLoadState is decoupled from the rest of WebKit and will be moved down to WebCore. I only moved one of the data fields of WebDataSource for now. * Loader/WebDocumentLoadState.h: Added. * Loader/WebDocumentLoadState.m: Added. (-[WebDocumentLoadState initWithRequest:]): New class. (-[WebDocumentLoadState dealloc]): (-[WebDocumentLoadState setFrameLoader:]): (-[WebDocumentLoadState setMainResourceData:]): (-[WebDocumentLoadState mainResourceData]): * Loader/WebFrameLoader.m: (-[WebFrameLoader _setDataSource:]): Remove redundant _setWebFrame: call, it would have been called already by this point. (-[WebFrameLoader _setProvisionalDataSource:]): ditto. * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _setWebFrame:]): (-[WebDataSource _setPrimaryLoadComplete:]): (-[WebDataSource initWithRequest:]): (-[WebDataSource data]): 2006-08-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Adele. - refactoring of WebDataSource in preparation for moving a bunch of it to a new class - minimize WebDataSourceInternal.h to be only methods called from outside WebDataSource - reduce Private category implementation to be only the SPI methods - make new Internal and FileInternal categories which contain the remainder (depending on whether they are called from outside of WebDataSource) * WebView/WebDataSource.m: (-[WebDataSource _setMainDocumentError:]): (addTypesFromClass): (+[WebDataSource _representationClassForMIMEType:]): (-[WebDataSource _commitIfReady]): (-[WebDataSource _commitLoadWithData:]): (-[WebDataSource _doesProgressiveLoadWithMIMEType:]): (-[WebDataSource _addResponse:]): (-[WebDataSource _revertToProvisionalState]): (-[WebDataSource _mainDocumentError]): (-[WebDataSource _addSubframeArchives:]): (-[WebDataSource _fileWrapperForURL:]): (+[WebDataSource _repTypesAllowImageTypeOmission:]): (-[WebDataSource _decidePolicyForMIMEType:decisionListener:]): (-[WebDataSource _finishedLoading]): (-[WebDataSource _setResponse:]): (-[WebDataSource _setRequest:]): (-[WebDataSource _setupForReplaceByMIMEType:]): (-[WebDataSource _receivedMainResourceError:complete:]): (-[WebDataSource _mainReceivedError:complete:]): (-[WebDataSource _defersCallbacks]): (-[WebDataSource _downloadWithLoadingConnection:request:response:proxy:]): (-[WebDataSource _didFailLoadingWithError:forResource:]): (-[WebDataSource _didFinishLoadingForResource:]): (-[WebDataSource _didReceiveData:contentLength:forResource:]): (-[WebDataSource _didReceiveResponse:forResource:]): (-[WebDataSource _didCancelAuthenticationChallenge:forResource:]): (-[WebDataSource _didReceiveAuthenticationChallenge:forResource:]): (-[WebDataSource _willSendRequest:forResource:redirectResponse:]): (-[WebDataSource _identifierForInitialRequest:]): (-[WebDataSource _archivedSubresourceForURL:]): (-[WebDataSource _startLoading]): (-[WebDataSource _stopRecordingResponses]): (-[WebDataSource _loadingStartedTime]): (-[WebDataSource _replaceSelectionWithArchive:selectReplacement:]): (-[WebDataSource _documentFragmentWithArchive:]): (-[WebDataSource _documentFragmentWithImageResource:]): (-[WebDataSource _imageElementWithImageResource:]): (-[WebDataSource _title]): (-[WebDataSource _isStopping]): (-[WebDataSource _setWebFrame:]): (-[WebDataSource _URL]): (-[WebDataSource _loadFromPageCache:]): (-[WebDataSource _popSubframeArchiveWithName:]): (-[WebDataSource _setIsClientRedirect:]): (-[WebDataSource _setURL:]): (-[WebDataSource _setLastCheckedRequest:]): (-[WebDataSource _defersCallbacksChanged]): (-[WebDataSource _lastCheckedRequest]): (-[WebDataSource _stopLoading]): (-[WebDataSource _bridge]): (-[WebDataSource _webView]): (-[WebDataSource _triggeringAction]): (-[WebDataSource _setTriggeringAction:]): (-[WebDataSource __adoptRequest:]): (-[WebDataSource _isDocumentHTML]): (-[WebDataSource _stopLoadingWithError:]): (-[WebDataSource _setPrimaryLoadComplete:]): (-[WebDataSource _responses]): (-[WebDataSource _makeRepresentation]): (-[WebDataSource _isClientRedirect]): (-[WebDataSource _originalRequest]): (-[WebDataSource _URLForHistory]): (-[WebDataSource _addToUnarchiveState:]): (-[WebDataSource _setOverrideEncoding:]): (-[WebDataSource _setIconURL:]): (-[WebDataSource _setIconURL:withType:]): (-[WebDataSource _overrideEncoding]): (-[WebDataSource _setTitle:]): * WebView/WebDataSourceInternal.h: 2006-08-23 Brady Eidson <beidson@apple.com> Reviewed by John Sullivan /me crosses fingers Flip the switch to the new Icon Database Massive code pruning is coming up * WebKitPrefix.h: Flipped the switch 2006-08-23 Brady Eidson <beidson@apple.com> Reviewed by Beth Since I just pushed the default URL icon from WebKit to WebCore, but WebKit was still using its version of the default icon, this patch makes it use the WebCore version * Misc/WebIconDatabase.m: (-[WebIconDatabase defaultIconWithSize:]): 2006-08-22 Maciej Stachowiak <mjs@apple.com> Reviewed by Brady. - remove "loading" flag from WebDataSource and code that manages it; it is redundat. * Loader/WebFrameLoader.m: (-[WebFrameLoader addPlugInStreamLoader:]): (-[WebFrameLoader removePlugInStreamLoader:]): (-[WebFrameLoader addSubresourceLoader:]): (-[WebFrameLoader removeSubresourceLoader:]): * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _setPrimaryLoadComplete:]): (-[WebDataSource _stopLoading]): (-[WebDataSource _prepareForLoadStart]): (-[WebDataSource _startLoading]): (-[WebDataSource isLoading]): * WebView/WebDataSourceInternal.h: 2006-08-22 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. <rdar://problem/4683948> REGRESSION: Assertion failure in [FrameProgressEntry addChild:forDataSource:] (fandango.com) * Loader/WebFrameLoader.m: (-[WebFrameLoader addSubresourceLoader:]): Add a WebKit-level assertion that should fire when this bad situation occurs. * Loader/WebSubresourceLoader.m: (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forFrameLoader:]): Prevent the situation from occuring. 2006-08-22 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - pull more WebDataSource code into WebFrameLoader - make WebMainResourceLoader not depend on WebKit or on SPI * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader _downloadWithLoadingConnection:request:response:proxy:]): (-[WebFrameLoader _updateIconDatabaseWithURL:]): (-[WebFrameLoader _notifyIconChanged:]): (-[WebFrameLoader _iconLoaderReceivedPageIcon:]): (-[WebFrameLoader _checkNavigationPolicyForRequest:andCall:withSelector:]): (-[WebFrameLoader _checkContentPolicyForMIMEType:andCall:withSelector:]): (-[WebFrameLoader cancelContentPolicy]): * Loader/WebIconLoader.m: (-[WebIconLoader didFinishLoading]): * Loader/WebLoader.m: (-[NSURLProtocol loadWithRequest:]): (-[NSURLProtocol setDefersCallbacks:]): * Loader/WebMainResourceLoader.h: * Loader/WebMainResourceLoader.m: (-[WebMainResourceLoader initWithFrameLoader:]): (-[WebMainResourceLoader dealloc]): (-[WebMainResourceLoader cancelWithError:]): (-[WebMainResourceLoader continueAfterNavigationPolicy:formState:]): (-[WebMainResourceLoader willSendRequest:redirectResponse:]): (-[WebMainResourceLoader continueAfterContentPolicy:]): (-[WebMainResourceLoader checkContentPolicy]): (-[WebMainResourceLoader didReceiveResponse:]): * Plugins/WebPluginContainerCheck.m: * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): * WebView/WebDataSource.m: (-[WebDataSource _loadIcon]): (-[WebDataSource _cancelledError]): (+[WebDataSource _repTypesAllowImageTypeOmission:]): (+[WebDataSource _representationClassForMIMEType:]): (-[WebDataSource _commitLoadWithData:]): (-[WebDataSource _isDocumentHTML]): * WebView/WebDataSourceInternal.h: * WebView/WebFramePrivate.h: * WebView/WebPolicyDelegate.m: * WebView/WebPolicyDelegatePrivate.h: 2006-08-21 Maciej Stachowiak <mjs@apple.com> Reviewed by Brady. - move more code from WebDataSource to WebFrameLoader Also marked a few more methods in WebDataSource as likely MOVABLE in a future round, since they do not use any of WebDataSource's private data. * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader addPlugInStreamLoader:]): (-[WebFrameLoader removePlugInStreamLoader:]): (-[WebFrameLoader addSubresourceLoader:]): (-[WebFrameLoader removeSubresourceLoader:]): (-[WebFrameLoader _didReceiveAuthenticationChallenge:forResource:]): (-[WebFrameLoader _didCancelAuthenticationChallenge:forResource:]): (-[WebFrameLoader _didReceiveResponse:forResource:]): (-[WebFrameLoader _didReceiveData:contentLength:forResource:]): (-[WebFrameLoader _didFinishLoadingForResource:]): (-[WebFrameLoader _didFailLoadingWithError:forResource:]): (-[WebFrameLoader _privateBrowsingEnabled]): (-[WebFrameLoader _finishedLoadingResource]): (-[WebFrameLoader _receivedError:]): (-[WebFrameLoader _finishedLoading]): * Loader/WebMainResourceLoader.m: (-[WebMainResourceLoader didReceiveData:lengthReceived:allAtOnce:]): (-[WebMainResourceLoader didFinishLoading]): * Loader/WebNetscapePlugInStreamLoader.m: (-[WebNetscapePlugInStreamLoader didFinishLoading]): (-[WebNetscapePlugInStreamLoader didFailWithError:]): (-[WebNetscapePlugInStreamLoader cancelWithError:]): * Loader/WebSubresourceLoader.m: (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forFrameLoader:]): (-[WebSubresourceLoader signalFinish]): (-[WebSubresourceLoader didFailWithError:]): (-[WebSubresourceLoader cancel]): * Plugins/WebNetscapePluginStream.m: (-[WebNetscapePluginStream start]): * WebView/WebDataSource.m: (-[WebDataSource _replaceSelectionWithArchive:selectReplacement:]): (-[WebDataSource _updateIconDatabaseWithURL:]): (-[WebDataSource _loadIcon]): (-[WebDataSource _setPrimaryLoadComplete:]): (-[WebDataSource _cancelledError]): (+[WebDataSource _repTypesAllowImageTypeOmission:]): (+[WebDataSource _representationClassForMIMEType:]): (-[WebDataSource _commitLoadWithData:]): (-[WebDataSource _receivedMainResourceError:complete:]): (-[WebDataSource _iconLoaderReceivedPageIcon:]): (-[WebDataSource _isDocumentHTML]): * WebView/WebDataSourceInternal.h: 2006-08-21 Brady Eidson <beidson@apple.com> Reviewed by John Quick ICONDEBUG flag fix * Misc/WebIconDatabase.m: (-[WebIconDatabase _applicationWillTerminate:]): 2006-08-21 Brady Eidson <beidson@apple.com> Reviewed by Anders -Renamed an internal only method for clarity -Tweaked WebDataSource for notification purposes with the new expiring icons -Fixed a bug with the ICONDEBUG flag * Misc/WebIconDatabase.m: (-[WebIconDatabase init]): (-[WebIconDatabase iconForURL:withSize:cache:]): #ifdef bug fixed (-[WebIconDatabase _hasEntryForIconURL:]): Renamed for clarity * Misc/WebIconDatabasePrivate.h: * WebView/WebDataSource.m: (-[WebDataSource _updateIconDatabaseWithURL:]): (-[WebDataSource _notifyIconChanged:]): (-[WebDataSource _loadIcon]): (-[WebDataSource _iconLoaderReceivedPageIcon:]): 2006-08-17 Maciej Stachowiak <mjs@apple.com> Reviewed by Brady. - pull a bit of WebDataSource code into WebFrameLoader * Loader/WebFrameLoader.m: (-[WebFrameLoader _receivedError:]): (-[WebFrameLoader webFrame]): (-[WebFrameLoader _handleFallbackContent]): (+[WebFrameLoader _canShowMIMEType:]): (+[WebFrameLoader _representationExistsForURLScheme:]): (+[WebFrameLoader _generatedMIMETypeForURLScheme:]): * WebView/WebDataSource.m: * WebView/WebDataSourceInternal.h: 2006-08-17 Timothy Hatcher <timothy@apple.com> Reviewed by Kevin Decker. <rdar://problem/4606857> WebKit: WebPreferencesChangedNotification not exported in 64-bit * WebKit.LP64.exp: 2006-08-17 Timothy Hatcher <timothy@apple.com> Reviewed by Kevin Decker. <rdar://problem/4633896> -[WebView close] should clear all delegates and call setHostWindow:nil <rdar://problem/4649759> Crash when selecting View Source menu using Chinese (-[WebView _close]) Check to make sure _private is not null. A WebView can be dealloced before _private is setup. Set the _private->closed flag at the beginning of _close to prevent reentry. Set the host window and all the delegates to nil in _close. * WebView/WebView.m: (-[WebView _close]): 2006-08-16 Brady Eidson <beidson@apple.com> Reviewed by Maciej * Misc/WebIconDatabase.m: Pruned unused method * Misc/WebIconDatabasePrivate.h: Ditto 2006-08-15 Maciej Stachowiak <mjs@apple.com> Reviewed by Adele (preliminary version) and later by Kevin. - remove most WebKit dependencies from WebMainResourceLoader. * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader cannotShowMIMETypeForURL:]): (-[WebFrameLoader interruptForPolicyChangeErrorWithRequest:]): (-[WebFrameLoader isHostedByObjectElement]): (-[WebFrameLoader isLoadingMainFrame]): (+[WebFrameLoader _canShowMIMEType:]): (+[WebFrameLoader _representationExistsForURLScheme:]): (+[WebFrameLoader _generatedMIMETypeForURLScheme:]): * Loader/WebMainResourceLoader.h: * Loader/WebMainResourceLoader.m: (-[WebMainResourceLoader interruptForPolicyChangeError]): (-[WebMainResourceLoader willSendRequest:redirectResponse:]): (isCaseInsensitiveEqual): (shouldLoadAsEmptyDocument): (-[WebMainResourceLoader continueAfterContentPolicy:response:]): (-[WebMainResourceLoader didReceiveResponse:]): (-[WebMainResourceLoader didReceiveData:lengthReceived:allAtOnce:]): (-[WebMainResourceLoader didFinishLoading]): (-[WebMainResourceLoader loadWithRequestNow:]): (-[WebMainResourceLoader loadWithRequest:]): 2006-08-15 Tim Omernick <timo@apple.com> Reviewed by Kevin Decker. * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage _unloadWithShutdown:]): Fixed a subtle problem with the 64-bit debug build -- as written, this would LOG() on 64-bit and do nothing on 32-bit! * Plugins/WebPluginDatabase.m: (-[WebPluginDatabase _scanForNewPlugins]): Use +[NSMutableSet set] here. 2006-08-15 Tim Omernick <timo@apple.com> Reviewed by Darin Adler. <http://bugs.webkit.org/show_bug.cgi?id=8980> ASSERTION FAILED: !isLoaded (WebKit/WebKit/Plugins/WebBasePluginPackage.m:228 -[WebBasePluginPackage dealloc]) <rdar://problem/4526052> intermittent assertion failure in -[WebBasePluginPackage dealloc] running layout tests (8980) * Plugins/WebPluginDatabase.h: * Plugins/WebPluginDatabase.m: (+[WebPluginDatabase installedPlugins]): Observe NSApplicationWillTerminateNotification so we can unload plug-ins on quit. (-[WebPluginDatabase plugins]): 'plugins' is now a dictionary. (-[WebPluginDatabase close]): Call new -_removePlugin: method. (-[WebPluginDatabase refresh]): Moved parts of this method out into other methods: -_addPlugin:, -_removePlugin:, and -_scanForNewPlugins. (-[WebPluginDatabase _plugInPaths]): No changes; just moved in file. (-[WebPluginDatabase _addPlugin:]): New method. Refactored from -refresh. Adds a plug-in to the database. (-[WebPluginDatabase _removePlugin:]): New method. Refactored from -refresh. Remove a plug-in from the database. (-[WebPluginDatabase _scanForNewPlugins]): New method. Refactored from -refresh. Returns the list of plug-in packages on disk. (-[WebPluginDatabase _applicationWillTerminate]): New method. Called when the application terminates. Closes the plug-in database so that all plug-ins are removed from the DB (and unloaded if necessary). * Plugins/WebBasePluginPackage.h: * Plugins/WebBasePluginPackage.m: (-[WebBasePluginPackage initWithPath:]): Try to create the NSBundle first, so if the file is not a valid bundle we bail out early. This avoids some stat()s and allocations during the plug-in refresh process. (-[WebBasePluginPackage isLoaded]): Removed. (-[WebBasePluginPackage load]): Base class for plug-in packages now always loads "successfully". (-[WebBasePluginPackage dealloc]): Removed this assertion. The base plug-in package class has no concept of "unloading". (-[WebBasePluginPackage finalize]): ditto. (-[WebBasePluginPackage wasRemovedFromPluginDatabase:]): Moved code to unload plug-in package to WebNetscapePluginPackage. Not all plug-in packages can be "unloaded". * Plugins/WebNetscapePluginPackage.h: * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage _unloadWithShutdown:]): Combined old -unload and -unloadWithoutShutdown methods into this new one. (-[WebNetscapePluginPackage initWithPath:]): Call new unload method. (-[WebNetscapePluginPackage load]): ditto (-[WebNetscapePluginPackage wasRemovedFromPluginDatabase:]): ditto (-[WebNetscapePluginPackage open]): New method. Called when a plug-in instance starts running. (-[WebNetscapePluginPackage close]): New method. Called when a plug-in instance stops running. When all plug-in instances close the plug-in package, and the plug-in package is removed from the database, the plug-in is unloaded. * Plugins/WebPluginPackage.m: (-[WebPluginPackage initWithPath:]): (-[WebPluginPackage load]): Made this a bit more efficient by checking if the bundle is already loaded. (-[WebBasePluginPackage unload]): Removed. (-[WebBasePluginPackage isLoaded]): Removed. * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView start]): Open the plug-in package so it remains loaded while this instance uses it. (-[WebBaseNetscapePluginView stop]): Close the plug-in package when the plug-in instance is stopped. * Plugins/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:]): This check is not necessary. Netscape plug-in packages are never unloaded until all their instances have been stopped, and a Netscape plug-in instance will stop its streams when it is stopped. (-[WebBaseNetscapePluginStream _destroyStream]): ditto (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): ditto (-[WebBaseNetscapePluginStream _deliverData]): ditto 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz> Reviewed by Tim H. Build fix: DWARF and -gfull are incompatible with symbol separation. * WebKit.xcodeproj/project.pbxproj: 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz> Reviewed by Tim H. http://bugs.webkit.org/show_bug.cgi?id=10394 Bug 10394: WebKit Release and Production configurations should enable dead code stripping * WebKit.xcodeproj/project.pbxproj: 2006-08-15 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - remove WebKit dependencies from WebPlugInStreamLoader via a protocol veil of ignorance * Loader/WebNetscapePlugInStreamLoader.h: * Loader/WebNetscapePlugInStreamLoader.m: (-[WebNetscapePlugInStreamLoader initWithDelegate:frameLoader:]): * Loader/WebPlugInStreamLoaderDelegate.h: Added. * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]): * WebKit.xcodeproj/project.pbxproj: 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz> Reviewed by Tim H. http://bugs.webkit.org/show_bug.cgi?id=10384 Bug 10384: Switch to DWARF for Release configuration * WebKit.xcodeproj/project.pbxproj: 2006-08-15 Graham Dennis <graham.dennis@gmail.com> Reviewed by Darin. - patch for http://bugs.webkit.org/show_bug.cgi?id=10314 WebUnarchivingState archivedResourceForURL: doesn't work * WebView/WebUnarchivingState.m: (-[WebUnarchivingState archivedResourceForURL:]): Fixed to get objects from the archived resources dictionary using the URL as a string instead of as the URL itself (as this is how the data is put into the dictionary). 2006-08-14 Maciej Stachowiak <mjs@apple.com> Reviewed by Beth. - remove many (but not all) WebKit dependencies from WebNetscapePlugInStreamLoader (it still depends on WebNetscapePluginStream). * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader fileDoesNotExistErrorWithResponse:]): * Loader/WebNetscapePlugInStreamLoader.h: * Loader/WebNetscapePlugInStreamLoader.m: (-[WebNetscapePlugInStreamLoader initWithStream:frameLoader:]): (-[WebNetscapePlugInStreamLoader releaseResources]): (-[WebNetscapePlugInStreamLoader didReceiveResponse:]): * Plugins/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]): 2006-08-14 Maciej Stachowiak <mjs@apple.com> Reviewed by Tim Omernick. - fixed REGRESSION: crash when leaving youtube page while movie is still loading http://bugs.webkit.org/show_bug.cgi?id=10398 * Loader/WebNetscapePlugInStreamLoader.m: (-[WebNetscapePlugInStreamLoader initWithStream:view:]): Set the frame loader for this stream. (-[WebNetscapePlugInStreamLoader cancelWithError:]): Make sure to destroy the stream as well; otherwise, when we try to clean up later, we won't have the right context. 2006-08-14 David Hyatt <hyatt@apple.com> Fix for Radar bug 4478840, Safari should not reduce null events sent to plug-ins in windows that are inactive but visible. With this fix you can view videos in visible background windows on YouTube (for example) and not see any drop in frame rate. Reviewed by timo * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView restartNullEvents]): 2006-08-14 Maciej Stachowiak <mjs@apple.com> Reviewed by Brady. - removed WebKit-level dependencies from WebFormDataStream. Use WebCore version of system interface * Loader/WebFormDataStream.m: (formCanRead): (formEventCallback): (webSetHTTPBody): * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2006-08-14 Maciej Stachowiak <mjs@apple.com> Rubber stamped by Brady. - move WebFormDataStream from WebView to Loader * WebKit.xcodeproj/project.pbxproj: * WebView/WebFormDataStream.h: Removed. * WebView/WebFormDataStream.m: Removed. 2006-08-13 Maciej Stachowiak <mjs@apple.com> Reviewed by Brady. - remove WebKit dependencies from WebSubresourceLoader, except WebFormDataStream (WebFormDataStream will be moved into the Loader directory soon) * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader _addExtraFieldsToRequest:mainResource:alwaysFromRequest:]): * Loader/WebSubresourceLoader.m: (isConditionalRequest): (hasCaseInsensitivePrefix): (isFileURLString): (setHTTPReferrer): (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forFrameLoader:]): 2006-08-13 Brady Eidson <beidson@apple.com> Reviewed by Maciej Relocated the WebIconLoaders * Misc/WebIconLoader.h: Moved to Loader/ * Misc/WebIconLoader.m: Moved to Loader/ * WebKit.xcodeproj/project.pbxproj: 2006-08-13 Maciej Stachowiak <mjs@apple.com> Reviewed by Beth. - removed non-Loader WebKit dependencies from WebDataProtocol for real (whoops) and fix some typos. * Loader/WebDataProtocol.m: (isCaseInsensitiveEqual): Added. (+[WebDataProtocol _webIsDataProtocolURL:]): Avoid WebKit calls. (-[WebDataProtocol startLoading]): ditto * Loader/WebFrameLoader.m: (isCaseInsensitiveEqual): Fixed spelling from isCaseSensitiveEqual. (-[WebFrameLoader _canUseResourceForRequest:]): Use proper call. 2006-08-13 Brady Eidson <beidson@apple.com> Reviewed by Maciej The way of detecting a failed icon load before was to try and construct an image from the icon and if that image construction failed, mark the icon as missing. A much more efficient way is to check for an error response. We'll still check for invalid image data, but most servers will correctly return an HTTP error on a missing icon. * Misc/WebIconLoader.m: (-[WebIconLoader didFinishLoading]): Added check for http error response 2006-08-13 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - remove all non-Loader dependencies from WebLoader As part of this I moved WebDataProtocol to the loader directory and removed dependencies on the rest of WebKit from that too. * Loader/WebFrameLoader.h: * Loader/WebFrameLoader.m: (-[WebFrameLoader setDefersCallbacks:]): (-[WebFrameLoader stopLoading]): (-[WebFrameLoader cancelledErrorWithRequest:]): (-[WebFrameLoader clearArchivedResources]): (-[WebFrameLoader deliverArchivedResources]): (-[WebFrameLoader deliverArchivedResourcesAfterDelay]): (isCaseSensitiveEqual): (-[WebFrameLoader _canUseResourceForRequest:]): (-[WebFrameLoader _canUseResourceWithResponse:]): (-[WebFrameLoader pendingArchivedResources]): (-[WebFrameLoader willUseArchiveForRequest:originalURL:loader:]): (-[WebFrameLoader archiveLoadPendingForLoader:]): (-[WebFrameLoader cancelPendingArchiveLoadForLoader:]): * Loader/WebLoader.h: * Loader/WebLoader.m: (-[NSURLProtocol releaseResources]): (-[NSURLProtocol loadWithRequest:]): (-[NSURLProtocol setDefersCallbacks:]): (-[NSURLProtocol addData:allAtOnce:]): (-[NSURLProtocol resourceData]): (-[NSURLProtocol didReceiveData:lengthReceived:allAtOnce:]): (-[NSURLProtocol connection:didReceiveData:lengthReceived:]): (-[NSURLProtocol cancelWithError:]): (-[NSURLProtocol cancelledError]): * Loader/WebMainResourceLoader.m: (-[WebMainResourceLoader addData:allAtOnce:]): (-[WebMainResourceLoader didReceiveData:lengthReceived:allAtOnce:]): * Loader/WebNetscapePlugInStreamLoader.m: (-[WebNetscapePlugInStreamLoader didReceiveData:lengthReceived:allAtOnce:]): * Loader/WebSubresourceLoader.m: (-[WebSubresourceLoader didReceiveData:lengthReceived:allAtOnce:]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataProtocol.h: Removed. * WebView/WebDataProtocol.m: Removed. 2006-08-11 Tim Omernick <timo@apple.com> Reviewed by Darin. <http://bugs.webkit.org/show_bug.cgi?id=10111> - Menu flickers over Flash content <rdar://problem/3052546> Plugins don't work with z-index (overlapping elements, etc.) * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): Don't just clip to the dirty region for "transparent" plug-ins -- do it for all plug-ins. This is a generally useful thing to do, as it prevents the plug-in from drawing over parts of the window that have already been drawn and are not expected to be redrawn in the same update. 2006-08-11 Brady Eidson <beidson@apple.com> Reviewed by John, Timo, Adele, and Darin In addition to a few style/good-practice cleanups, this patch will convert the old icon database format to the WebCore format if the WebCore db is empty (implying this conversion has yet to take place). After the conversion, it will delete all traces of the old format to free the unneeded space * Misc/WebIconDatabase.m: (-[WebIconDatabase init]): (-[WebIconDatabase _setIconURL:forURL:]): Changed the bridge's name for this method to be more clear (-[WebIconDatabase _createFileDatabase]): (-[WebIconDatabase _iconDataForIconURL:]): This grabs the raw data for use in the conversion function (-[WebIconDatabase _convertToWebCoreFormat]): This does the actual conversion 2006-08-11 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. Needed for <rdar://problem/4678070>. * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendEvent:]): Changed an assertion to an early return. It should be possible to send events, especially updateEvt (for image capturing purposes), to off-screen plug-ins. It just doesn't work right now. See <rdar://problem/4318269>. 2006-08-11 John Sullivan <sullivan@apple.com> Reviewed by Darin - fixed <rdar://problem/4522894> Would be nice if Safari shrank pages a little if necessary to avoid printing an almost-empty page * WebView/WebHTMLView.m: (-[NSArray knowsPageRange:]): If the last page has a short-enough orphan (< 1/10 of the page height is the number I pulled out of ... the air), then we adjust the scale factor slightly and check whether this reduces the page count and thus eliminates the orphan. 2006-08-07 Brady Eidson <beidson@apple.com> Reviewed by Anders and John * Misc/WebIconDatabase.m: (-[WebIconDatabase init]): (-[WebIconDatabase isIconExpiredForIconURL:]): Get if an icon expired (-[WebIconDatabase isIconExpiredForPageURL:]): Ditto (-[WebIconDatabase _setIconURL:forURL:]): (-[WebIconDatabase _sendNotificationForURL:]): Moved to WebKitPendingPublic for use outside of WebIconDatabase (-[WebIconDatabase loadIconFromURL:]): Allow a load outside the context of a page load * Misc/WebIconDatabasePrivate.h: * Misc/WebIconLoader.m: (-[WebIconLoader didFinishLoading]): fixed up the "flipping the switch" #defs a bit (-[WebIconLoader willSendRequest:redirectResponse:]): override to allow a load outside of the context of a page load * WebCoreSupport/WebIconDatabaseBridge.h: Added. * WebCoreSupport/WebIconDatabaseBridge.m: Added. (-[WebIconDatabaseBridge init]): (-[WebIconDatabaseBridge dealloc]): (-[WebIconDatabaseBridge loadIconFromURL:]): Kick off a load on an icon outside of the context of any page load (-[WebIconDatabaseBridge _setIconData:forIconURL:]): WebKit side of bridge method (-[WebIconDatabaseBridge _setHaveNoIconForIconURL:]): WebKit side of bridge method (-[WebIconDatabaseBridge releaseCachedLoaderForIconURL:]): (+[WebIconDatabaseBridge sharedBridgeInstance]): Moved this from WebCore to WebKit so both sides of the bridge get the WebKit version * WebKit.xcodeproj/project.pbxproj: Added some files * WebView/WebDataSource.m: (-[WebDataSource _loadIcon]): Added check for reload/expired icon to force a load even if we already have it 2006-08-04 Sam Weinig <sam.weinig@gmail.com> Reviewed by Darin. - patch for http://bugs.webkit.org/show_bug.cgi?id=10192 Make WebCore (and friends) compile with -Wshorten-64-to-32 * Adds 'f' to float literals where expecting a float. * Use ceilf() instead of ceil() when assigning to a float. * Adds explicit casts where OK. NOTE: The -Wshorten-64-to-32 flag was not added for WebKit because there are still a few places where no error handling is in place. The flag can be added as soon as those are worked out. * Misc/WebNSControlExtras.m: (-[NSControl sizeToFitAndAdjustWindowHeight]): * Misc/WebNSImageExtras.m: (-[NSImage _web_scaleToMaxSize:]): * Misc/WebNSViewExtras.h: * Misc/WebNSViewExtras.m: * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebBaseNetscapePluginView drawRect:]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge expiresTimeForResponse:]): * WebInspector/WebInspector.m: (-[NSWindow window]): (-[WebInspector treeViewScrollTo:]): (-[WebInspector _updateSystemColors]): (-[WebInspector webView:plugInViewWithArguments:]): (-[WebInspector outlineView:objectValueForTableColumn:byItem:]): * WebInspector/WebInspectorOutlineView.m: (-[WebInspectorOutlineView _highlightRow:clipRect:]): * WebInspector/WebNodeHighlight.m: (-[WebNodeHighlight initWithBounds:andRects:forView:]): * WebInspector/WebNodeHighlightView.m: (-[WebNodeHighlightView roundedRect:withRadius:]): (-[WebNodeHighlightView initWithHighlight:andRects:forView:]): (-[WebNodeHighlightView drawRect:]): * WebView/WebFrame.m: (-[WebFrame _opened]): * WebView/WebFrameView.m: (-[WebFrameView initWithFrame:]): * WebView/WebHTMLView.m: (-[WebHTMLView _dragImageForLinkElement:]): (-[WebHTMLView _web_setPrintingModeRecursive]): (-[WebHTMLView _web_clearPrintingModeRecursive]): (-[NSArray layout]): (-[NSArray _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]): (-[NSArray adjustPageHeightNew:top:bottom:limit:]): (-[NSArray _scaleFactorForPrintOperation:]): (-[NSArray setPageWidthForPrinting:]): (-[NSArray _endPrintMode]): (-[NSArray knowsPageRange:]): (-[NSArray _originalFontA]): (-[NSArray _originalFontB]): (-[WebTextCompleteController _buildUI]): (-[WebTextCompleteController _placePopupWindow:]): * WebView/WebPDFView.m: (-[WebPDFView _makeTextStandardSize:]): (-[WebPDFView selectionImageForcingWhiteText:]): (-[PDFPrefUpdatingProxy forwardInvocation:]): * WebView/WebPreferences.m: (-[WebPreferences _floatValueForKey:]): * WebView/WebView.m: (-[WebView makeTextSmaller:]): (-[WebView canMakeTextStandardSize]): (-[WebView makeTextStandardSize:]): 2006-08-04 David Kilzer <ddkilzer@kilzer.net> Reviewed by NOBODY (build fix). * WebCoreSupport/WebSubresourceLoader.m: REALLY moved to Loader/ * WebView/WebFrameLoader.h: REALLY moved to Loader/ * WebView/WebFrameLoader.m: REALLY moved to Loader/ * WebView/WebLoader.h: REALLY moved to Loader/ * WebView/WebLoader.m: REALLY moved to Loader/ * WebView/WebMainResourceLoader.m: REALLY moved to Loader/ 2006-08-03 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - moved all loader code that is slated to be moved down to WebCore to a new Loader directory (next step is to remove dependencies on the rest of WebKit from this directory) * Loader/WebNetscapePlugInStreamLoader.h: Added. * Loader/WebNetscapePlugInStreamLoader.m: Added. Cut out of WebNetscapePluginStream.m (-[WebNetscapePlugInStreamLoader initWithStream:view:]): (-[WebNetscapePlugInStreamLoader isDone]): (-[WebNetscapePlugInStreamLoader releaseResources]): (-[WebNetscapePlugInStreamLoader didReceiveResponse:]): (-[WebNetscapePlugInStreamLoader didReceiveData:lengthReceived:]): (-[WebNetscapePlugInStreamLoader didFinishLoading]): (-[WebNetscapePlugInStreamLoader didFailWithError:]): (-[WebNetscapePlugInStreamLoader cancelWithError:]): * Plugins/WebNetscapePluginStream.m: * WebKit.xcodeproj/project.pbxproj: * WebCoreSupport/WebSubresourceLoader.h: Moved to Loader/ * WebCoreSupport/WebSubresourceLoader.m: Moved to Loader/ * WebView/WebFrameLoader.h: Moved to Loader/ * WebView/WebFrameLoader.m: Moved to Loader/ * WebView/WebLoader.h: Moved to Loader/ * WebView/WebLoader.m: Moved to Loader/ * WebView/WebMainResourceLoader.h: Moved to Loader/ * WebView/WebMainResourceLoader.m: Moved to Loader/ 2006-08-03 Tim Omernick <timo@apple.com> Reviewed by Kevin Decker. <rdar://problem/4667460> Windowless OpenGL plug-ins render incorrectly on PowerPC * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView _aglOffscreenImageForDrawingInRect:]): Fixed color component swapping so that it works on both x86 and PPC. See comments. 2006-08-03 Brady Eidson <beidson@apple.com> Reviewed by Tim Hatcher's rubber stamp Fixed Intel build break caused by weinig's -W change in r15781 * WebView/WebView.m: wrapped cpu-dependent defs with defined() macro 2006-08-03 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - fixed problem that could cause assertion failures in Safari * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]): Don't allow a plugin to start new loads once its document is no longer the one actively loading. 2006-08-03 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - remove use of WebDataSource from WebLoader and subclasses, just have them talk to the WebFrameLoader instead. For now this is done by forarding all the calls. * Misc/WebIconLoader.m: (-[WebIconLoader didFinishLoading]): * Plugins/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]): (-[WebNetscapePluginStream start]): (-[WebNetscapePlugInStreamLoader didFinishLoading]): (-[WebNetscapePlugInStreamLoader didFailWithError:]): (-[WebNetscapePlugInStreamLoader cancelWithError:]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:]): (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:postData:]): * WebCoreSupport/WebSubresourceLoader.h: * WebCoreSupport/WebSubresourceLoader.m: (-[WebSubresourceLoader initWithLoader:frameLoader:]): (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forFrameLoader:]): (+[WebSubresourceLoader startLoadingResource:withMethod:URL:customHeaders:referrer:forFrameLoader:]): (+[WebSubresourceLoader startLoadingResource:withMethod:URL:customHeaders:postData:referrer:forFrameLoader:]): (-[WebSubresourceLoader receivedError:]): (-[WebSubresourceLoader signalFinish]): (-[WebSubresourceLoader didFailWithError:]): (-[WebSubresourceLoader cancel]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.m: (-[WebDataSource _updateLoading]): (-[WebDataSource textEncodingName]): (-[WebDataSource _mainReceivedBytesSoFar:complete:]): * WebView/WebFrameLoader.h: * WebView/WebFrameLoader.m: (-[WebFrameLoader loadIconWithRequest:]): (-[WebFrameLoader startLoadingMainResourceWithRequest:identifier:]): (-[WebFrameLoader clearIconLoader]): (-[WebFrameLoader commitProvisionalLoad]): (-[WebFrameLoader activeDataSource]): (-[WebFrameLoader _archivedSubresourceForURL:]): (-[WebFrameLoader _defersCallbacks]): (-[WebFrameLoader _identifierForInitialRequest:]): (-[WebFrameLoader _willSendRequest:forResource:redirectResponse:]): (-[WebFrameLoader _didReceiveAuthenticationChallenge:forResource:]): (-[WebFrameLoader _didCancelAuthenticationChallenge:forResource:]): (-[WebFrameLoader _didReceiveResponse:forResource:]): (-[WebFrameLoader _didReceiveData:contentLength:forResource:]): (-[WebFrameLoader _didFinishLoadingForResource:]): (-[WebFrameLoader _didFailLoadingWithError:forResource:]): (-[WebFrameLoader _privateBrowsingEnabled]): (-[WebFrameLoader _addPlugInStreamLoader:]): (-[WebFrameLoader _removePlugInStreamLoader:]): (-[WebFrameLoader _finishedLoadingResource]): (-[WebFrameLoader _receivedError:]): (-[WebFrameLoader _addSubresourceLoader:]): (-[WebFrameLoader _removeSubresourceLoader:]): (-[WebFrameLoader _originalRequest]): (-[WebFrameLoader webFrame]): (-[WebFrameLoader _receivedMainResourceError:complete:]): (-[WebFrameLoader initialRequest]): (-[WebFrameLoader _receivedData:]): (-[WebFrameLoader _setRequest:]): (-[WebFrameLoader _downloadWithLoadingConnection:request:response:proxy:]): (-[WebFrameLoader _handleFallbackContent]): (-[WebFrameLoader _isStopping]): (-[WebFrameLoader _decidePolicyForMIMEType:decisionListener:]): (-[WebFrameLoader _setupForReplaceByMIMEType:]): (-[WebFrameLoader _setResponse:]): (-[WebFrameLoader _mainReceivedError:complete:]): (-[WebFrameLoader _finishedLoading]): (-[WebFrameLoader _mainReceivedBytesSoFar:complete:]): (-[WebFrameLoader _iconLoaderReceivedPageIcon:]): (-[WebFrameLoader _URL]): * WebView/WebLoader.h: * WebView/WebLoader.m: (-[NSURLProtocol releaseResources]): (-[NSURLProtocol loadWithRequest:]): (-[NSURLProtocol setFrameLoader:]): (-[NSURLProtocol frameLoader]): (-[NSURLProtocol willSendRequest:redirectResponse:]): (-[NSURLProtocol didReceiveAuthenticationChallenge:]): (-[NSURLProtocol didCancelAuthenticationChallenge:]): (-[NSURLProtocol didReceiveResponse:]): (-[NSURLProtocol didReceiveData:lengthReceived:]): (-[NSURLProtocol signalFinish]): (-[NSURLProtocol didFailWithError:]): (-[NSURLProtocol willCacheResponse:]): (-[NSURLProtocol cancelWithError:]): * WebView/WebMainResourceLoader.h: * WebView/WebMainResourceLoader.m: (-[WebMainResourceLoader initWithFrameLoader:]): (-[WebMainResourceLoader receivedError:]): (-[WebMainResourceLoader cancelWithError:]): (-[WebMainResourceLoader _isPostOrRedirectAfterPost:redirectResponse:]): (-[WebMainResourceLoader addData:]): (-[WebMainResourceLoader willSendRequest:redirectResponse:]): (-[WebMainResourceLoader continueAfterContentPolicy:response:]): (-[WebMainResourceLoader continueAfterContentPolicy:]): (-[WebMainResourceLoader checkContentPolicyForResponse:]): (-[WebMainResourceLoader didReceiveResponse:]): (-[WebMainResourceLoader didReceiveData:lengthReceived:]): (-[WebMainResourceLoader didFinishLoading]): (-[WebMainResourceLoader didFailWithError:]): (-[WebMainResourceLoader loadWithRequestNow:]): 2006-08-03 Sam Weinig <sam.weinig@gmail.com> Reviewed by Darin. - patch for http://bugs.webkit.org/show_bug.cgi?id=10176 Make WebCore compile with -Wundef * Adds -Wundef flag to Xcode project * Converts #ifs to #ifdef and #ifndefs where needed. * Carbon/CarbonUtils.m: * Carbon/CarbonWindowAdapter.m: * Carbon/HIViewAdapter.m: (+[NSView bindHIViewToNSView:nsView:]): * Carbon/HIWebView.m: (HIWebViewEventHandler): * Misc/WebFileDatabase.m: (UniqueFilePathForKey): * Misc/WebNSWindowExtras.m: (swizzleInstanceMethod): * Misc/WebTypesInternal.h: * Plugins/WebNetscapeDeprecatedFunctions.c: * Plugins/WebNetscapeDeprecatedFunctions.h: * Plugins/WebNetscapePluginPackage.h: * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage unloadWithoutShutdown]): (-[WebNetscapePluginPackage load]): * WebKit.xcodeproj/project.pbxproj: 2006-08-03 Darin Adler <darin@apple.com> Reviewed by Eric Seidel. - fix storage leak * WebView/WebFrame.m: (-[WebFramePrivate dealloc]): Release the frame loader. 2006-08-02 Timothy Hatcher <timothy@apple.com> Rubber stamped by Maciej. Adding back resultsWithXpathQuery, removed by Darin's earlier change. This function is called from ObjC, but not used from JavaScript. * WebInspector/webInspector/inspector.js: 2006-08-02 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Bug 10200: [Drosera] Deadlock between Drosera and Safari while loading page http://bugs.webkit.org/show_bug.cgi?id=10200 Prevent reentrancy in our debugger callbacks. This was causing a deadlock in Drosera because suspendProcessIfPaused was being called during a DO call into Safari. Preventing reentrancy also prevents scripts that Drosera injects and evaluates from showing up in rare cases (such as a iframe loading about:blank). I thought this would prevent cases where you call a function from the console and expect it to break on a breakpoint in them, but this appears to never have worked even without this change. When that is figured out we can reconsider a better solution to reentrancy. I have filed that as bug 10214. I also removed the NSRunLoop runMode:beforeDate: calls since DO handles this for us since we don't use "onway void" as the return type for the callbacks. Note: using onway void for the listener callbacks causes bad synchronization issues and obscure crashes. * DefaultDelegates/WebScriptDebugServer.m: (-[WebScriptDebugServer webView:didLoadMainResourceForDataSource:]): (-[WebScriptDebugServer webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:]): (-[WebScriptDebugServer webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:]): (-[WebScriptDebugServer webView:didEnterCallFrame:sourceId:line:forWebFrame:]): (-[WebScriptDebugServer webView:willExecuteStatement:sourceId:line:forWebFrame:]): (-[WebScriptDebugServer webView:willLeaveCallFrame:sourceId:line:forWebFrame:]): (-[WebScriptDebugServer webView:exceptionWasRaised:sourceId:line:forWebFrame:]): * DefaultDelegates/WebScriptDebugServerPrivate.h: 2006-08-02 Maciej Stachowiak <mjs@apple.com> Reviewed by John. - fix assertion failure on layout tests by stopping plugins from loading at a clearly defined time - add more assertions for safety * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): Removed obsolete comment. (-[WebDataSource _updateLoading]): Add assertion ensuring this method is only called at a time when this data source is the one that might be loading for a frame. (-[WebDataSource _stopLoading]): Stop loading plugins as a FIXME suggests we should. * WebView/WebFrameLoader.m: (-[WebFrameLoader isLoadingPlugIns]): New helper method. (-[WebFrameLoader isLoading]): Consider plugin loads too - otherwise we won't stop them at stopLoading time. 2006-08-02 Adam Roben <aroben@apple.com> Reviewed by Brady. - Rename TransferJob to ResourceLoader (this file was forgotten in an earlier change by Maciej) * COM/WebView.cpp: 2006-08-01 Maciej Stachowiak <mjs@apple.com> Reviewed by Adele. - Change things around so WebFrameLoader tracks the main and provisional data source, as well as the frame load state, pulling much code out of WebFrame along the way. The most significant aspects of this change are: - management of WebDataSources and WebFrameState was moved into WebFrameLoader - there is now just one WebFrameLoader shared between the primary and provisional data source * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _updateLoading]): (-[WebDataSource _loadIcon]): (-[WebDataSource _setPrimaryLoadComplete:]): (-[WebDataSource _stopLoading]): (-[WebDataSource _startLoading]): (-[WebDataSource _addSubresourceLoader:]): (-[WebDataSource _removeSubresourceLoader:]): (-[WebDataSource _addPlugInStreamLoader:]): (-[WebDataSource _removePlugInStreamLoader:]): (-[WebDataSource _defersCallbacksChanged]): (-[WebDataSource _stopLoadingWithError:]): (-[WebDataSource _revertToProvisionalState]): (-[WebDataSource _setupForReplaceByMIMEType:]): (-[WebDataSource initWithRequest:]): (-[WebDataSource data]): (-[WebDataSource isLoading]): * WebView/WebFrame.m: (-[WebFramePrivate init]): (-[WebFramePrivate dealloc]): (-[WebFrame _closeOldDataSources]): (-[WebFrame _detachFromParent]): (-[WebFrame _makeDocumentView]): (-[WebFrame _receivedMainResourceError:]): (-[WebFrame _transitionToCommitted:]): (+[WebFrame _timeOfLastCompletedLoad]): (-[WebFrame _checkLoadCompleteForThisFrame]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _continueAfterWillSubmitForm:]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrame _initWithWebFrameView:webView:bridge:]): (-[WebFrame _frameLoader]): (-[WebFrame _provisionalLoadStarted]): (-[WebFrame _prepareForDataSourceReplacement]): (-[WebFrame _frameLoadCompleted]): (-[WebFrame provisionalDataSource]): (-[WebFrame dataSource]): (-[WebFrame stopLoading]): * WebView/WebFrameInternal.h: * WebView/WebFrameLoader.h: * WebView/WebFrameLoader.m: (-[WebFrameLoader initWithWebFrame:]): (-[WebFrameLoader dealloc]): (-[WebFrameLoader dataSource]): (-[WebFrameLoader _setDataSource:]): (-[WebFrameLoader clearDataSource]): (-[WebFrameLoader provisionalDataSource]): (-[WebFrameLoader _setProvisionalDataSource:]): (-[WebFrameLoader _clearProvisionalDataSource]): (-[WebFrameLoader state]): (+[WebFrameLoader timeOfLastCompletedLoad]): (-[WebFrameLoader _setState:]): (-[WebFrameLoader clearProvisionalLoad]): (-[WebFrameLoader markLoadComplete]): (-[WebFrameLoader commitProvisionalLoad]): (-[WebFrameLoader stopLoading]): (-[WebFrameLoader startLoading]): (-[WebFrameLoader startProvisionalLoad:]): (-[WebFrameLoader setupForReplace]): * WebView/WebFramePrivate.h: 2006-08-01 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. <rdar://problem/4480737> Flash crashes after it replaces itself via a document.write() I kind of hate to do this, but this is the best way to work around buggy plug-ins like Flash that assume that NPP_Destroy() cannot be called while the browser is calling one of its other plug-in functions. The classic situation is a plug-in that replaces itself via an NPN_Invoke() that executes a document.write(). * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendEvent:]): Call -willCallPlugInFunction and -didCallPlugInFunction around calls to the NPP_* functions. (-[WebBaseNetscapePluginView setWindowIfNecessary]): ditto (-[WebBaseNetscapePluginView start]): It should not be possible to start a plug-in instance while we are calling into it (one of those chicken/egg problems). Added a sanity-checking assertion. (-[WebBaseNetscapePluginView stop]): If we're already calling a plug-in function, do not call NPP_Destroy(). The plug-in function we are calling may assume that its instance->pdata, or other memory freed by NPP_Destroy(), is valid and unchanged until said plugin-function returns. (-[WebBaseNetscapePluginView pluginScriptableObject]): Call -willCallPlugInFunction and -didCallPlugInFunction around calls to the NPP_* functions. (-[WebBaseNetscapePluginView willCallPlugInFunction]): Increment plug-in function call depth. (-[WebBaseNetscapePluginView didCallPlugInFunction]): Decrement plug-in function call depth. Stop if we're supposed to stop. (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]): Call -willCallPlugInFunction and -didCallPlugInFunction around calls to the NPP_* functions. (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]): ditto (-[WebBaseNetscapePluginView _printedPluginBitmap]): ditto * Plugins/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:]): Call -willCallPlugInFunction and -didCallPlugInFunction around calls to the NPP_* functions. (-[WebBaseNetscapePluginStream _destroyStream]): ditto (-[WebBaseNetscapePluginStream _deliverData]): ditto 2006-08-01 Maciej Stachowiak <mjs@apple.com> - fix build after last change * WebView/WebFrame.m: (-[WebFrame _checkLoadCompleteForThisFrame]): 2006-08-01 Maciej Stachowiak <mjs@apple.com> Reviewed by Beth. - revert part of my last fix that broke the Safari bookmarks view * WebView/WebFrame.m: (-[WebFrame _checkLoadCompleteForThisFrame]): still send layout message for non-HTML views 2006-08-01 Tim Omernick <timo@apple.com> Reviewed by Anders. Fixed an assertion failure I ran into while debugging <rdar://problem/4652683>. * Plugins/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView redeliverStream]): Don't clear the "instance" ivar here. This code was refactored here from the old WebNetscapePluginRepresentation, which also had an "instance" ivar. It is never appropriate to clear a plug-in view's instance. That is done when the plug-in is destroyed. 2006-08-01 Maciej Stachowiak <mjs@apple.com> Reviewed by Geoff. - some refactoring in preparation for moving more stuff to WebFrameLoader. * WebView/WebFrame.m: (-[WebFrame _clearDataSource]): (-[WebFrame _detachFromParent]): (-[WebFrame _commitProvisionalLoad]): (-[WebFrame _transitionToCommitted:]): (-[WebFrame _clearProvisionalLoad]): (-[WebFrame _markLoadComplete]): (-[WebFrame _checkLoadCompleteForThisFrame]): (-[WebFrame _startProvisionalLoad:]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): (-[WebFrame stopLoading]): 2006-07-31 Maciej Stachowiak <mjs@apple.com> Reviewed by Tim Hatcher. - renamed TransferJob to ResourceLoader in WebCore * COM/WebFrame.cpp: (WebFrame::loadDataSource): (WebFrame::receivedRedirect): (WebFrame::receivedResponse): (WebFrame::receivedData): (WebFrame::receivedAllData): (WebFrame::setStatusText): * COM/WebFrame.h: 2006-07-31 Darin Adler <darin@apple.com> Reviewed by Maciej. - omit the margin and padding boxes for display types where they are ignored - use CSS instead of properties for table spacing and padding as suggested by Tim H. * WebInspector/webInspector/inspector.css: Added rules for spacing and padding. Added rules that hide the margin and padding boxes (borders and all but the center cell) when the hide attribute is present. * WebInspector/webInspector/inspector.html: Added classes for the rules above. Removed cellpadding and cellspacing attributes. * WebInspector/webInspector/inspector.js: Added code to hide/show the margin and padding boxes based on the display type. 2006-07-31 Duncan Wilcox <duncan@mclink.it> Reviewed by Darin. Fixes <http://bugs.webkit.org/show_bug.cgi?id=10159> "REGRESSION: delegate returning no menu elements crashes webkit" No automated test, because there's no way to programmatically open a context menu, no manual test because there's no way to customize the context menu delegate. * WebView/WebView.m: (-[WebView _menuForElement:defaultItems:]): Make sure the context menu returned some menu items before accessing the first one. 2006-07-31 Timothy Hatcher <timothy@apple.com> Reviewed by John. <rdar://problem/4658194> REGRESSION: "Search in Google" and "Search in Spotlight" fail to work on text selected in a frame Use selectedFrame to get the frame with the text selection. * WebView/WebView.m: (-[WebView _searchWithGoogleFromMenu:]): (-[WebView _searchWithSpotlightFromMenu:]): 2006-07-31 Darin Adler <darin@apple.com> Reviewed by Tim Hatcher. - http://bugs.webkit.org/show_bug.cgi?id=10168 add a first cut at a Metrics pane to the inspector * WebInspector/webInspector/inspector.css: Add styles for the new metrics pane. * WebInspector/webInspector/inspector.html: Add the new metrics pane, starting with the table to show the box model. * WebInspector/webInspector/inspector.js: Add the new metrics pane. Add back some "title" attributes so we have more tooltips. Removed the optional parameter to getComputedStyle. 2006-07-31 Anders Carlsson <acarlsson@apple.com> Reviewed by John. * Plugins/WebPluginDatabase.m: (-[WebPluginDatabase refresh]): Create a mutable set instead of a mutable array. 2006-07-30 Darin Adler <darin@apple.com> Reviewed by Tim Hatcher. * WebInspector/webInspector/inspector.js: Fix bug where a null property value leads to an empty style pane. 2006-07-30 Darin Adler <darin@apple.com> Reviewed by Tim Hatcher. - http://bugs.webkit.org/show_bug.cgi?id=10163 some improvements for the inspector * WebInspector/WebInspector.m: (+[WebInspector sharedWebInspector:]): Fixed bug that could cause the inspector to be garbage collected if used in an application with GC enabled. (-[WebInspector dealloc]): Removed a call to a non-existent close method. (-[WebInspector window]): Added a custom WebPreferences object and called setPrivateBrowsingEnabled:YES so the inspector won't appear in the history menu. Also call setProhibitsMainFrameScrolling:YES to try to get rid of trouble where the inspector scrolls when dragging. * WebInspector/webInspector/inspector.css: Added style for the new color swatch, and JavaScript properties. More of the style should be shared between the panes, but this should be OK for now. * WebInspector/webInspector/inspector.html: Added a first cut at a JavaScript properties pane. Needs work, but better than nothing. * WebInspector/webInspector/inspector.js: Lots of improvements: - Omit "typical" property values from computed style display, making it much shorter. - Use the words "black", "white", and "transparent" when appropriate for color values. - Refactored the loaded() function to get rid of repetitive scrollbar setup. - Added a new scrollarea for the JavaScript properties pane. - Simplified refreshScrollbars() -- we now refresh all scrollbars every time, which does no harm. - Removed unused resultsWithXpathQuery(). - Use [] instead of "new Array()" and {} instead of "new Object()". - Removed unused xpathForNode(). - Changed style pane to display the style for a text node's parent instead of saying it can't display the style for text. - Fixed regression I caused a while back by checking the length of a computed style and not trying to display anything if its length is 0. Before this change and the corresponding change in WebCore, we'd see a complete list of all styles with the empty string as the value for each one. - Changed the name of the computedStyle flag on the style rules array to isComputedStyle to make it easier to understand it's a boolean. - Fixed an error in the code that does !important scanning where it was trying to do a special case for computed style, but was checking the computed style flag on the wrong object. - Added populateStyleListItem() function to factor out things in common between the items in the top level list and the expanded tree for shorthand properties. - Added code to make a color swatch next to the textual representation for any property that contains a color. - Implemented a first cut at a simple JavaScript properties pane. 2006-07-29 Darin Adler <darin@apple.com> - Removed tabs from these source files that still had them. We don't use them; that way source files look fine in editors that have tabs set to 8 spaces or to 4 spaces. - Removed allow-tabs Subversion property from the files too. * DefaultDelegates/WebDefaultPolicyDelegate.m: * History/WebHistory.m: * Misc/WebDownload.m: * Misc/WebIconDatabase.m: * Misc/WebKitErrors.m: * Misc/WebKitLogging.m: * Misc/WebNSDataExtras.m: * Misc/WebNSFileManagerExtras.m: * Panels/WebPanelAuthenticationHandler.m: * Plugins/WebBaseNetscapePluginView.m: * Plugins/npfunctions.h: * WebCoreSupport/WebSubresourceLoader.m: * WebView/WebMainResourceLoader.m: * WebView/WebView.h: * WebView/WebView.m: 2006-07-29 Sam Weinig <sam.weinig@gmail.com> Reviewed by Darin. - patch for http://bugs.webkit.org/show_bug.cgi?id=10080 Adopt pedantic changes from the Unity project to improve cross-compiler compatibility Changes include: * Adding missing newline to the end of the file. * Turning on gcc warning for missing newline at the end of a source file (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc). * WebKit.xcodeproj/project.pbxproj: * WebView/WebResourcePrivate.h: 2006-07-29 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by John Sullivan. - fix http://bugs.webkit.org/show_bug.cgi?id=9984 ASSERTION FAILURE: _private->mouseDownEvent != nil (WebKit/WebView/WebHTMLView.m:4863 -[WebHTMLView(WebInternal) _delegateDragSourceActionMask]) * WebView/WebHTMLView.m: (-[WebHTMLView _setMouseDownEvent:]): Moved into the WebHTMLViewFileInternal category and changed to accept nil. (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): Copy the hit HTMLView's mouse down event to the top HTMLView. (-[WebHTMLView acceptsFirstMouse:]): Added a call to _setMouseDownEvent:nil before returning. (-[WebHTMLView shouldDelayWindowOrderingForEvent:]): Added a call to _setMouseDownEvent:nil before returning. (-[WebHTMLView mouseUp:]): Added a call to _setMouseDownEvent:nil to clear the event set in mouseDown: (and used during dragging). (-[WebHTMLView _delegateDragSourceActionMask]): Copy the hit HTMLView's mouse down event to the top HTMLView. 2006-07-28 Timothy Hatcher <timothy@apple.com> Reviewed by John. <rdar://problem/4657473> REGRESSION: Spell check not available from contextual menu in Mail The context menu code should be checking isContentEditable on DOMNode not just DOMElement. This is needed because DOMText will be the node class of any text that is clicked. * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): 2006-07-25 Geoffrey Garen <ggaren@apple.com> Reviewed by Maciej, inspired by John. - Fixed <rdar://problem/4651931> 1% REGRESSION on iBench HTML due to repeated requests for non-existent favicon An optimization to avoid serializing favicon data for missing icons had stomped an optimization to avoid GETing a missing favicon more than once. The solution is a happy marriage of optimizations, ensuring that we *retain* the missing favicon's "i am missing" data without posting a notification or saving it to disk. * Misc/WebIconDatabase.m: (-[WebIconDatabase _setIconURL:forURL:]): 2006-07-25 David Harrison <harrison@apple.com> Reviewed by timo and Darin. <rdar://problem/4618584> "Paste and Match Style" is not working in Mail (add SPI) * WebKit.xcodeproj/project.pbxproj: * WebView/WebView.m: (-[WebView replaceSelectionWithNode:]): (-[WebView _replaceSelectionWithNode:matchStyle:]): * WebView/WebViewPrivate.h: (-[WebView _replaceSelectionWithNode:matchStyle::]): New SPI that is same as replaceSelectionWithNode: with added parameter whether to match existing style. 2006-07-24 Darin Adler <darin@apple.com> Reviewed by Adele and Justin. - update for change to require context when creating fragments from text (needed to handle whitespace properly) * WebView/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]): Added context parameter, pass through to bridge. (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]): Pass selection range as context when calling above method. (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): Pass drag caret as context when calling above method. 2006-07-24 Maciej Stachowiak <mjs@apple.com> Reviewed by Geoff. - fix <rdar://problem/4609195> Help Viewer loads empty window (not getting didFailLoadingWithError: callback) (without re-introducing http://bugs.webkit.org/show_bug.cgi?id=10062 ) * WebView/WebLoader.h: * WebView/WebMainResourceLoader.m: (-[WebMainResourceLoader receivedError:]): Copy in some code from the base class to do it in the proper order, surrounding the call to [ds _receivedMainResourceError:error complete:YES]. 2006-07-24 Anders Carlsson <acarlsson@apple.com> Reviewed by Tim O. * Misc/WebIconDatabase.m: (-[WebIconDatabase removeAllIcons]): Make an array of the keys and iterate through it to avoid modifying the dictionary while enumerating it. 2006-07-24 Timothy Hatcher <timothy@apple.com> Reviewed by John and Darin. <rdar://problem/4634290> Cannot selectively install a custom scroller that differs from the default Aqua frame size. Adds two new private methods to WebFrameView that allows an application to set a custom scroll view class. This is needed if the application wants to install a custom scroller that is wider than the typical scroller, because NSScrollView does the content rect calculations in a class method (ignoring custom scrollers.) The _setScrollViewClass method requires the class to be a subclass of WebDynamicScrollBarView, or nil can be passed to reset to the default class. A new scroll view of the specified class will then replace the previous one without the need to reload content of the frame. * WebView/WebFrameView.m: (-[WebFrameView _customScrollViewClass]): (-[WebFrameView _setCustomScrollViewClass:]): * WebView/WebFrameViewPrivate.h: 2006-07-24 Alexey Proskuryakov <ap@nypop.com> Reviewed by Darin. Fix http://bugs.webkit.org/show_bug.cgi?id=10009 REGRESSION: Schubert-IT PDF Plug-in not working for full page (works in frames) * WebView/WebView.m: (+[WebView _viewClass:andRepresentationClass:forMIMEType:]): If we've got a type supported by WebPDFView, make sure to initialize the plugin database, in case a plugin wants to handle it. 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz> Reviewed by Maciej. Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions http://bugs.webkit.org/show_bug.cgi?id=9686 WebKit portion of the fix. * DefaultDelegates/WebDefaultScriptDebugDelegate.m: (-[WebDefaultScriptDebugDelegate webView:exceptionWasRaised:sourceId:line:forWebFrame:]): * DefaultDelegates/WebScriptDebugServer.h: * DefaultDelegates/WebScriptDebugServer.m: (-[WebScriptDebugServer webView:exceptionWasRaised:sourceId:line:forWebFrame:]): Notify listeners that an exception has been raised. * WebView/WebScriptDebugDelegate.h: * WebView/WebScriptDebugDelegate.m: (-[WebScriptCallFrame exceptionRaised:sourceId:line:]): Dispatch through to delegate and WebScriptDebugServer. 2006-07-23 Adele Peterson <adele@apple.com> Reviewed by Darin. - Fix for <rdar://problem/4646276> CrashTracer: 7 crashes in Safari at com.apple.WebCore: WebCore::RenderTableSection::paint + 155 * WebView/WebHTMLView.m: (-[WebHTMLView _web_layoutIfNeededRecursive:testDirtyRect:]): needsDisplay was returning NO even though the view has a dirty rect (see <rdar://problem/4647062>). Since we know about the dirty rect, we don't actually need to check needsDisplay. 2006-07-22 Timothy Hatcher <timothy@apple.com> Rolling out r15572. Bug 10062: REGRESSION: dom/xhtml/level2/html/HTMLIFrameElement11.xhtml asserts/crashes http://bugs.webkit.org/show_bug.cgi?id=10062 2006-07-21 Timothy Hatcher <timothy@apple.com> Reviewed by Maciej. <rdar://problem/4609195> Help Viewer loads empty window (not getting didFailLoadingWithError: callback) Call super's didFailWithError before _receivedMainResourceError because _receivedMainResourceError will cause the datasource's frame to be set to nil before the didFailLoadingWithError delegate callback is sent. (This order is needed now that WebDataSource does not hold on to the WebView; it uses the WebFrame to get to the WebView. If the WebFrame is nil we can't get to the WebView's resource load delegate.) * WebView/WebMainResourceLoader.m: (-[WebMainResourceLoader receivedError:]): 2006-07-22 Timothy Hatcher <timothy@apple.com> Reviewed by Adele. <rdar://problem/4646318> REGRESSION: Ctrl-clicking on a selection containing a word doesn't display a complete contextual menu Show the editing context menu if the WebView is editible. The original change only checked if the DOM element was editable, and isContentEditable returns NO if entire WebView is editable. * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): 2006-07-21 Timothy Hatcher <timothy@apple.com> Reviewed by Maciej. <rdar://problem/4609195> Help Viewer loads empty window (not getting didFailLoadingWithError: callback) Call super's didFailWithError before _receivedMainResourceError because _receivedMainResourceError will cause the datasource's frame to be set to nil before the didFailLoadingWithError delegate callback is sent. (This order is needed now that WebDataSource does not hold on to the WebView; it uses the WebFrame to get to the WebView. If the WebFrame is nil we can't get to the WebView's resource load delegate.) * WebView/WebMainResourceLoader.m: (-[WebMainResourceLoader receivedError:]): === Safari-521.20 === 2006-07-21 Timothy Hatcher <timothy@apple.com> Reviewed by John. <rdar://problem/4607572> REGRESSION (521.10.1 - 521.13): most context menu items missing when a form field is focused (common on google.com) (9680) Do not use _isEditable call since that only checks if the current selection or frame is editible. We now check if the currently clicked element is a content editible area, a textarea, an isindex or an input element that return YES to _isTextField. * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate webView:contextMenuItemsForElement:defaultMenuItems:]): 2006-07-20 John Sullivan <sullivan@apple.com> Reviewed by Maciej - WebKit part of fix for: <rdar://problem/4557386> REGRESSION (419.3-521.19): repro Safari world leak involving closing tabs after clicking in a web page * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge textViewWasFirstResponderAtMouseDownTime:]): renamed to be more specific (formerly wasFirstResponderAtMouseDownTime:) * WebView/WebHTMLViewInternal.h: * WebView/WebHTMLView.m: (-[WebTextCompleteController dealloc]): updated for name change (-[NSArray _setMouseDownEvent:]): Now only retains the first responder if it's a textView, since that's the only case that the only client actually cares about. This avoids a reference cycle caused by retaining self. This is the only substantive part of the patch; all the rest is just renaming for clarity, and comments. (-[NSArray mouseDown:]): updated for name change (-[WebHTMLView _textViewWasFirstResponderAtMouseDownTime:]): renamed to be more specific (formerly _wasFirstResponderAtMouseDownTime:) 2006-07-19 Tim Omernick <timo@apple.com> Reviewed by Darin. <rdar://problem/4523432> safari crashed right after disabling "block pop up windows" (or other WebPreferences changes) * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView viewWillMoveToSuperview:]): Stop the plug-in when it is removed from its superview. It is not sufficient to do this in -viewWillMoveToWindow:nil, because the WebView might still has a hostWindow at that point, which prevents the plug-in from being destroyed. There is no need to start the plug-in when moving into a superview. -viewDidMoveToWindow takes care of that. === Safari-521.19 === 2006-07-17 Tim Omernick <timo@apple.com> Reviewed by Maciej. <rdar://problem/4612079> need a way to prevent pages from scrolling to reveal elements that are focused by script * WebView/WebViewPrivate.h: * WebView/WebView.m: (-[WebView setProhibitsMainFrameScrolling:]): New method. Prohibits scrolling in the WebView's main frame. Used to "lock" a WebView to a specific scroll position. 2006-07-17 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/4635311> REGRESSION: WebKit should call windowScriptObjectAvailable before attaching the script debugger * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge windowObjectCleared]): 2006-07-17 Timothy Hatcher <timothy@apple.com> Reviewed by Maciej. <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit Copy WebScriptObject.h from WebCore's private headers, not JavaScriptCore. * WebKit.xcodeproj/project.pbxproj: 2006-07-17 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - fixed <rdar://problem/4604366> Orange Find highlight displays text in wrong size on PDF pages if they're not at "actual size" To match WebHTMLView, I made the methods that return attributed strings take the view's scale factor into account. * WebView/WebPDFView.m: (-[WebPDFView _scaledAttributedString:]): new helper method, takes an attributed string and returns one that's scaled by the view's current scale factor (-[WebPDFView attributedString]): pass result through _scaledAttributedString: (-[WebPDFView selectedAttributedString]): ditto 2006-07-17 Justin Garcia <justin.garcia@apple.com> Reviewed by levi Rolled the first fix for: <http://bugs.webkit.org/show_bug.cgi?id=9642> GMail Editor: Operations that use drop down menus blow away the selection back in and removed the call to _clearSelectionInOtherFrames from -[WebHTMLView becomeFirstResponder] to fix the bug. * WebView/WebHTMLView.m: (-[NSArray maintainsInactiveSelection]): (-[NSArray becomeFirstResponder]): * WebView/WebView.m: (-[WebView maintainsInactiveSelection]): 2006-07-15 Darin Adler <darin@apple.com> Reviewed by John Sullivan. - fix http://bugs.webkit.org/show_bug.cgi?id=9928 REGRESSION: Text Encoding menu inoperative (after gcc protocol build fix) * WebView/WebHTMLView.m: (-[WebHTMLView _documentRange]): Moved into WebHTMLViewFileInternal category. (-[WebHTMLView selectionRect]): Moved into WebDocumentPrivateProtocols category. (-[WebHTMLView selectionView]): Ditto. (-[WebHTMLView selectionImageForcingWhiteText:]): Ditto. (-[WebHTMLView selectionImageRect]): Ditto. (-[WebHTMLView pasteboardTypesForSelection]): Ditto. (-[WebHTMLView selectAll]): Ditto. (-[WebHTMLView deselectAll]): Ditto. (-[WebHTMLView string]): Ditto. (-[WebHTMLView _attributeStringFromDOMRange:]): Ditto. (-[WebHTMLView attributedString]): Ditto. (-[WebHTMLView selectedString]): Ditto. (-[WebHTMLView selectedAttributedString]): Ditto. (-[WebHTMLView supportsTextEncoding]): Ditto. (-[WebHTMLView _canProcessDragWithDraggingInfo:]): Moved into WebDocumentInternalProtocols. (-[WebHTMLView _isMoveDrag]): Ditto. (-[WebHTMLView _isNSColorDrag:]): Ditto. (-[WebHTMLView draggingUpdatedWithDraggingInfo:actionMask:]): Ditto. (-[WebHTMLView draggingCancelledWithDraggingInfo:]): Ditto. (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): Ditto. (-[WebHTMLView elementAtPoint:]): Ditto. (-[WebHTMLView elementAtPoint:allowShadowContent:]): Ditto. * WebKit.xcodeproj/project.pbxproj: Let Xcode 2.3 do its thing. === Safari-521.17 === 2006-07-14 Timothy Hatcher <timothy@apple.com> Rolling out this fix from r15358 since it isn't resolved. 2006-07-11 Justin Garcia <justin.garcia@apple.com> Reviewed by levi & thatcher <http://bugs.webkit.org/show_bug.cgi?id=9642> GMail Editor: Operations that use drop down menus blow away the selection * WebView/WebHTMLView.m: (-[WebHTMLView maintainsInactiveSelection]): Maintain an inactive selection when resigning as first responder if the selection is editable or if the WebView tells us to. * WebView/WebView.m: (-[WebView maintainsInactiveSelection]): Just because a WebView is editable doesn't mean selections inside subframes will be. Return NO by default. 2006-07-14 Timothy Hatcher <timothy@apple.com> <rdar://problem/4623957> SWB: gcc-5412 (new?) objc warning causes WebCore project failure Build fix with the new GCC. Removes forward declarations of protocols. * Misc/WebSearchableTextView.h: * WebCoreSupport/WebSubresourceLoader.h: * WebKit.xcodeproj/project.pbxproj: * WebView/WebDocumentInternal.h: * WebView/WebDocumentPrivate.h: * WebView/WebHTMLView.h: * WebView/WebPDFView.h: * WebView/WebScriptDebugDelegatePrivate.h: 2006-06-28 Darin Adler <darin@apple.com> Reviewed by Adele. - fix http://bugs.webkit.org/show_bug.cgi?id=9625 <rdar://problem/4604703> REGRESSION: Focus not removed from password field after ctrl-click in text field * WebView/WebHTMLView.m: (-[WebHTMLView menuForEvent:]): Set handlingMouseDownEvent to YES while calling sendContextMenuEvent: on the bridge. 2006-07-14 Timothy Hatcher <timothy@apple.com> Reviewed by Maciej. Moved JavaScriptCore to be a public framework. * WebKit.xcodeproj/project.pbxproj: 2006-07-13 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=9795 REGRESSION: Crash in [WebHTMLView(WebPrivate) _updateMouseoverWithEvent:] and http://bugs.webkit.org/show_bug.cgi?id=9850 REGRESSION: Assertion failure (SHOULD NEVER BE REACHED) in - [WebHTMLView(WebPrivate) removeTrackingRect:] * WebView/WebHTMLView.m: (-[WebHTMLView _updateMouseoverWithEvent:]): Return immediately if the view has already been closed. 2006-07-13 David Harrison <harrison@apple.com> Reviewed by Justin and Levi. <rdar://problem/4620743> REGRESSION: Option-Delete doesn't delete words during typing * Tests: editing/deleting/delete-by-word-001.html editing/deleting/delete-by-word-002.html * WebView/WebHTMLView.m: (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:deletionAction:granularity:]): 2006-07-13 Timothy Hatcher <timothy@apple.com> Rolling out this earlier change (r15378) now that it is fixed on AGL's end. Fixes <rdar://problem/4624865> Restore 64-bit OpenGL plug-in support once AGL is 64-bit <rdar://problem/4624858> AGL isn't 64-bit yet; temporarily remove it from WebKit 64-bit build * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.m: 2006-07-13 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/4616920> REGRESSION: tabbing in mail moves focus to next control instead of inserting a tab space. Change editible WebView's tabKeyCyclesThroughElements to NO only if the setTabKeyCyclesThroughElements SPI wasn't called. * WebView/WebView.m: (-[WebView setEditable:]): 2006-07-12 Anders Carlsson <acarlsson@apple.com> Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=9624 REGRESSION: After ctrl-clicking in a EMPTY input or textarea field, the contextual menu shows "Search in Google" and "Search in Spotlight" as active menu items * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate editingContextMenuItemsForElement:defaultMenuItems:]): Don't create Dictionary, Spotlight or Google lookup items if there's no selection. 2006-07-12 Mark Rowe <opendarwin.org@bdash.net.nz> Reviewed by Timothy. http://bugs.webkit.org/show_bug.cgi?id=9868 Applications shown in Drosera's "Attach" window remain after exit * DefaultDelegates/WebScriptDebugServer.m: (-[WebScriptDebugServer init]): Register for NSApplicationWillTerminateNotification so we will know when the application is being exited. (-[WebScriptDebugServer dealloc]): Unregister notification before we are deallocated. (-[WebScriptDebugServer applicationTerminating:]): Inform anyone listening that we are going away. 2006-07-12 Tim Omernick <timo@apple.com> Reviewed by Tim Hatcher. <rdar://problem/4624858> AGL isn't 64-bit yet; temporarily remove it from WebKit 64-bit build Also, fixed a LOG_ERROR() so that it uses the CGL error instead of the AGL error; Tim H missed this in his build fix from earlier. * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.m: 2006-07-11 John Sullivan <sullivan@apple.com> Reviewed by Kevin and Tim O - added support for creating a selection image with white text * WebView/WebDocumentPrivate.h: added -selectionImageForcingWhiteText: and -selectionImageRect to the private <WebDocumentSelection> protocol * Misc/WebSearchableTextView.m: (-[NSString selectionImageForcingWhiteText:]): added stub for this new method to this obsolete class to satisfy the compiler (-[NSString selectionImageRect]): ditto * WebView/WebHTMLView.m: (-[WebHTMLView _selectionDraggingImage]): now calls -selectionImageForcingWhiteText:NO instead of just -selectionImage (-[WebHTMLView _selectionDraggingRect]): now calls selectionImageRect, to which the implementation moved (-[WebHTMLView selectionImageForcingWhiteText:]): implemented this new method by calling through to new bridge method selectionImageForcingWhiteText: (-[WebHTMLView selectionImageRect]): implemented this new method by using existing _selectionDraggingRect implementation * WebView/WebPDFView.m: (-[WebPDFView selectionImageForcingWhiteText:]): implemented by using code that was formerly in Safari (-[WebPDFView selectionImageRect]): implemented by returning selectionRect 2006-07-11 Tim Omernick <timo@apple.com> Reviewed by Geoff. <http://bugs.webkit.org/show_bug.cgi?id=9843>: Give Netscape plug-ins access to their own DOM element * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView dealloc]): Release DOM element. (-[WebBaseNetscapePluginView getVariable:value:]): Return NPObject for plugin DOM element. * Plugins/WebNetscapePluginEmbeddedView.h: * Plugins/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:DOMElement:]): Now takes a DOMElement, in much the same way that WebKit plug-in views take a DOMElement. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]): Pass DOMElement to Netscape plug-ins. (-[WebFrameBridge viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:DOMElement:]): ditto 2006-07-11 Justin Garcia <justin.garcia@apple.com> Reviewed by levi & thatcher <http://bugs.webkit.org/show_bug.cgi?id=9642> GMail Editor: Operations that use drop down menus blow away the selection * WebView/WebHTMLView.m: (-[WebHTMLView maintainsInactiveSelection]): Maintain an inactive selection when resigning as first responder if the selection is editable or if the WebView tells us to. * WebView/WebView.m: (-[WebView maintainsInactiveSelection]): Just because a WebView is editable doesn't mean selections inside subframes will be. Return NO by default. 2006-07-11 Tim Omernick <timo@apple.com> Reviewed by Tim Hatcher. <rdar://problem/4622748> WebKit now uses deprecated AGL functions * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView _createWindowedAGLContext]): aglSetDrawable() is deprecated in AGL 3.0. Use aglSetWindowRef() instead. (-[WebBaseNetscapePluginView _createWindowlessAGLContext]): aglSetOffScreen() is deprecated in AGL 3.0. Use CGLSetOffScreen(), which does the same thing. 2006-07-11 Alexey Proskuryakov <ap@nypop.com> Reviewed by Tim O. - http://bugs.webkit.org/show_bug.cgi?id=7808 Assertion failure in -[WebBaseNetscapePluginStream dealloc] when requesting an invalid URL * Plugins/WebNetscapePluginStream.m: (-[WebNetscapePluginStream initWithRequest:pluginPointer:notifyData:sendNotification:]): Remove the early return when requesting an invalid (unsupported) URL. === Safari-521.16 === 2006-07-10 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by John Sullivan. - fix <rdar://problem/4621541>, aka <http://bugs.webkit.org/show_bug.cgi?id=9838> REGRESSION (r14968-r14977): View Source doesn't work for pages from the back/forward cache * WebView/WebDataSource.m: (-[WebDataSource _setPrimaryLoadComplete:]): Set our data only if the frame loader is has just loaded it (when coming from the back/forward cache, it hasn't). 2006-07-10 Brady Eidson <beidson@apple.com> Reviewed by Alexey Resolved the console error messages people got from the new DB even if they didn't have it enabled * Misc/WebIconDatabase.m: (-[WebIconDatabase init]): Disabled initializing the IconDatabaseBridge if user is living on the old DB 2006-07-10 Darin Adler <darin@apple.com> - try to fix Windows build * COM/WebFrame.h: Qualify DeprecatedString and KURL with WebCore:: prefixes. 2006-07-09 Darin Adler <darin@apple.com> - try to fix Windows build * COM/WebFrame.cpp: Rename QChar to DeprecatedChar. 2006-07-09 Darin Adler <darin@apple.com> - fix newlines to be consistent for all files in the COM directory (many had mixed style) and set the EOL style to "native" on them. * COM/*: Set properties and changed files. 2006-07-09 Tim Omernick <timo@apple.com> Reviewed by Maciej. <rdar://problem/4404652> Netscape plug-in mouse events broken in HiDPI Multiply global mouse coordinates by the window scale factor so that plug-ins can use GlobalToLocal() in HiDPI. This fixes many bugs involving plug-in mouse event handling in HiDPI. Most notably, the Flash player will now correctly respond to clicks. * Plugins/WebBaseNetscapePluginView.m: (+[WebBaseNetscapePluginView getCarbonEvent:]): (-[WebBaseNetscapePluginView getCarbonEvent:withEvent:]): 2006-07-09 Darin Adler <darin@apple.com> Reviewed by Tim Hatcher. - fix assertion firing in plug-in layout tests * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView restartNullEvents]): Don't start null events if the plug-in is not in the started state. This happens when the plug-in moves within its view hierarchy after it has been stopped. 2006-07-09 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Bug 9820: Move new DOM API that has been through API review to public headers http://bugs.webkit.org/show_bug.cgi?id=9820 * Misc/WebElementDictionary.m: include DOMExtensions.h * Misc/WebNSViewExtras.m: include DOMExtensions.h * WebKit.xcodeproj/project.pbxproj: make DOMXPath.h public 2006-07-09 Timothy Hatcher <timothy@apple.com> Reviewed by Kevin. Bug 9818: move new UIDelegate API that has been through API review to public headers http://bugs.webkit.org/show_bug.cgi?id=9818 <rdar://problem/4387541> API: Remove webView:setContentRect: & webViewContentRect: delegate methods? The fix for 4310363 removed the only use of webViewContentRect: in our code. webView:setContentRect: was never used to begin with. There's no harm in leaving these around in the API, but they'll cruft it up. Also removes the never used webViewPrint: SPI that was replaced by webView:printFrameView:. * DefaultDelegates/WebDefaultUIDelegate.m: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge print]): * WebView/WebFrameView.h: * WebView/WebFrameView.m: * WebView/WebFrameViewPrivate.h: * WebView/WebUIDelegate.h: * WebView/WebUIDelegatePrivate.h: 2006-07-09 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Bug 9814: Move new WebView API that has been through API review to public headers http://bugs.webkit.org/show_bug.cgi?id=9814 * WebView/WebView.h: * WebView/WebView.m: (-[WebView close]): (-[WebView setShouldCloseWithWindow:]): (-[WebView shouldCloseWithWindow]): (-[WebView selectedFrame]): (-[WebView setMainFrameURL:]): (-[WebView mainFrameURL]): (-[WebView isLoading]): (-[WebView mainFrameTitle]): (-[WebView mainFrameIcon]): (-[WebView mainFrameDocument]): (-[WebView setDrawsBackground:]): (-[WebView drawsBackground]): (-[WebView toggleSmartInsertDelete:]): (-[WebView toggleContinuousSpellChecking:]): (-[WebView canMakeTextStandardSize]): (-[WebView makeTextStandardSize:]): (-[WebView maintainsInactiveSelection]): * WebView/WebViewPrivate.h: 2006-07-09 Timothy Hatcher <timothy@apple.com> Reviewed by Maciej. Bug 9487: The XPath section should be removed and/or moved. http://bugs.webkit.org/show_bug.cgi?id=9487 * WebInspector/webInspector/inspector.css: * WebInspector/webInspector/inspector.html: * WebInspector/webInspector/inspector.js: 2006-07-09 Anders Carlsson <acarlsson@apple.com> Reviewed by Tim O. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Initialize wkPathFromFont. 2006-07-09 Darin Adler <darin@apple.com> - fix release build * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView restorePortState:]): Cast inside the assertion so that we don't have an unused variable in versions with assertions disabled. The alternative would be to wrap the whole thing in an #if statement. 2006-07-08 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. * Plugins/WebBaseNetscapePluginView.h: - Added ivars for OpenGL support. Someday it would be nice to refactor this class so that each drawing model is encapsulated in a class; this would allow WebBaseNetscapePluginView to make more efficient use of space, for example by not keeping OpenGL-related ivars for Quickdraw plug-ins. * Plugins/WebBaseNetscapePluginView.m: - Declared a bunch of internal methods for OpenGL support (see below). - Removed "forUpdate" from CoreGraphics port state struct; it was always set to "YES", so I just cleaned up the silly code that used it. - Declared OpenGL port state struct. (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): - Moved a CoreGraphics-related assertion down to the big "switch" statement. - Don't set window.type here -- according to the Netscape Plug-in API docs, the plug-in should default to "windowed" mode, and may call NPN_SetValue() during its NPN_New() to request that the browser use a "windowless" (offscreen) context instead. - Moved the assertion from the top of this method here; removed a less restrictive assertion that is now obsolete. - Removed "forUpdate" flag from CoreGraphics port state struct. - Fill in OpenGL port state struct. Set up the viewport appropriately for both windowed and windowless OpenGL plug-ins. Windowed plug-ins need to have their GL viewport transformed by the amount the plug-in is clipped; windowless plug-ins are drawn off-screen into a surface whose geometry is never changed or clipped, so they may always draw with a viewport origin of (0, 0). (-[WebBaseNetscapePluginView restorePortState:]): - Removed "forUpdate" flag from CoreGraphics port state struct. - Restore the old OpenGL context saved by -saveAndSetNewPortStateForUpdate:. (-[WebBaseNetscapePluginView sendEvent:]): - Updated an assertion to also include OpenGL. To ensure that attached plug-in window movements happen atomically with web page redisplays, we assert that the plug-in's window is set only while the plug-in view is redrawing. - Same deal as with the assertion; only save/set port state when redrawing the plug-in view. Plug-ins that use the new drawing models are only allowed to draw when the web page draws. I might consider changing this for windowed OpenGL plug-ins, since they always obscure the page content anyway. (-[WebBaseNetscapePluginView isNewWindowEqualToOldWindow]): - Compare new NP_GLContext structs. (-[WebBaseNetscapePluginView updateAndSetWindow]): - In OpenGL mode, can only set window when updating plug-in view. (-[WebBaseNetscapePluginView setWindowIfNecessary]): - ditto - Updated logging for OpenGL drawing mode. (-[WebBaseNetscapePluginView addWindowObservers]): - No need to observe frame/bounds change notifications for this and all parent views. See -renewGState comments below. (-[WebBaseNetscapePluginView removeWindowObservers]): - Don't need to remove frame/bounds observers anymore. (-[WebBaseNetscapePluginView start]): - Plug-ins are "windowed" by default. This is not a change from our previous behavior, but this is a better place to set the default value as it allows the plug-in to override it later. (-[WebBaseNetscapePluginView stop]): - Destroy AGL context when the plug-in stops. (-[WebBaseNetscapePluginView dealloc]): - Assert that the AGL stuff has been cleaned up. (-[WebBaseNetscapePluginView drawRect:]): - If this is a windowless OpenGL plugin, blit its contents back into this view. (-[WebBaseNetscapePluginView renewGState]): - This method is called when the view or one of its parents is moved or resized (see comments). (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): - Hide the AGL window if the plug-in view is about to be removed from its window. (-[WebBaseNetscapePluginView viewHasMoved:]): - Renamed and moved to the "Internal" category. (-[WebBaseNetscapePluginView invalidateRegion:]): - Style changes. - Add support for OpenGL (uses the same region type as CoreGraphics). (-[WebBaseNetscapePluginView getVariable:value:]): - Style changes. - Implemented NPNVsupportsOpenGLBool; returns YES since we now support the OpenGL drawing model. (-[WebBaseNetscapePluginView setVariable:value:]): - Implemented NPPVpluginWindowBool, which allows plug-ins to specify whether they should be rendered in "windowed" or "windowless" mode. This is an older part of the Netscape Plug-in API that was never implemented in WebKit. "Windowed" Quickdraw plug-ins do not actually reside in a separate window, and can already do many of the same things (such as transparency) that only "windowless" plug-ins can do on other platforms. However, we need the "windowed" vs. "windowless" distinction for OpenGL plug-ins so that they have some way of specifying whether they should be rendered on an accelerated overlay surface, composited into the browser window. - Support for setting the drawing model to OpenGL. (-[WebBaseNetscapePluginView _viewHasMoved]): - Renamed from -viewHasMoved:, and moved down in the file. - None of this work is necessary when the plug-in is not in a window; the plug-in's state will be properly restored when it is moved back into a window. - Reshape OpenGL surface window here. (-[WebBaseNetscapePluginView _createAGLContextIfNeeded]): - Creates the AGL context of the appropriate type (windowed/windowless). (-[WebBaseNetscapePluginView _createWindowedAGLContext]): - Creates a windowed AGL context, which is an AGL context attached to a child window. This is the only way to get true hardware acceleration. (-[WebBaseNetscapePluginView _createWindowlessAGLContext]): - Creates a windowless AGL context, which is an AGL context attached to an offscreen buffer. This buffer can then be blitted back into the browser window with a different alpha, or scaled, or whatever. (-[WebBaseNetscapePluginView _cglContext]): - Returns the underlying CGL context from the AGL context. We give the plug-in access to the CGL context because CGL is the more primitive of the GL drawable APIs and allows for finer control over the context. (-[WebBaseNetscapePluginView _getAGLOffscreenBuffer:width:height:]): - Returns the buffer allocated for the offscreen AGL context, if there is one. (-[WebBaseNetscapePluginView _destroyAGLContext]): - Destroys the AGL context, as well as the associated offscreen buffer or child window. (-[WebBaseNetscapePluginView _reshapeAGLWindow]): - Positions the AGL window over the browser window. (-[WebBaseNetscapePluginView _hideAGLWindow]): - Hides the AGL window. (-[WebBaseNetscapePluginView _aglOffscreenImageForDrawingInRect:]): - Returns an NSImage representation of the offscreen AGL context's framebuffer. This is used to draw the offscreen bits back into the plug-in view. This is kind of tricky because it has to convert the offscreen buffer in-place from BGRA to RGBA so that it can be wrapped in an NSBitmapImageRep. See comments. * WebKit.xcodeproj/project.pbxproj: Link OpenGL and AGL. 2006-07-09 Brady Eidson <beidson@apple.com> Reviewed by Maciej The ICONDEBUG flag now chooses either the new icon database or the old one No longer any need to live side by side to compare results * Misc/WebIconDatabase.m: (-[NSMutableDictionary iconURLForURL:]): (-[NSMutableDictionary retainIconForURL:]): (-[NSMutableDictionary releaseIconForURL:]): (-[WebIconDatabase _setHaveNoIconForIconURL:]): (-[WebIconDatabase _setIconURL:forURL:]): (-[WebIconDatabase _resetCachedWebPreferences:]): 2006-07-08 Timothy Hatcher <timothy@apple.com> Reviewed by Maciej. Bug 5312: comments aren't available via DOM http://bugs.webkit.org/show_bug.cgi?id=5312 Makes the Web Inspector show comment node contents. * WebInspector/WebInspector.m: (-[DOMNode _displayName]): return the contents of the comment * WebInspector/webInspector/inspector.js: check for comment nodes 2006-07-09 Alexey Proskuryakov <ap@nypop.com> Reviewed by Darin. - http://bugs.webkit.org/show_bug.cgi?id=9572 Add application/xhtml+xml to the Accept header * WebView/WebFrame.m: (-[WebFrame _addExtraFieldsToRequest:mainResource:alwaysFromRequest:]): Add an Accept header to main resource requests. * English.lproj/StringsNotToBeLocalized.txt: Added new strings. 2006-07-08 Darin Adler <darin@apple.com> * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate contextMenuItemsForElement:defaultMenuItems:]): Removed misleading old comment. === Safari-521.15 === 2006-07-07 Levi Weintraub <lweintraub@apple.com> Reviewed by justin Finished moving deletion selection expansion across the bridge... say that 3 times fast. * WebView/WebHTMLView.m: Pass granularity to WebCore to handle expansion (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:deletionAction:granularity:]): (-[WebHTMLView _deleteSelection]): (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): (-[WebHTMLView deleteToMark:]): 2006-07-07 Brady Eidson <beidson@apple.com> Reviewed by John Changed an ASSERT to a LOG_ERROR for an error that could be handled gracefully, but whose assertion was reproducibly causing a build bot failure * Misc/WebIconDatabase.m: (-[WebIconDatabase _releaseIconForIconURLString:]): 2006-07-06 Levi Weintraub <lweintraub@apple.com> Reviewed by justin Improved table editing * WebCoreSupport/WebFrameBridge.m: Added method to allow WebCore to trigger deletion editing delegate (-[WebFrameBridge shouldDeleteSelectedDOMRange:]): * WebView/WebHTMLView.m: Moved code that expanded a selection when the delete key is pressed over to WebCore so we can be more intelligent about how to handle it (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:deletionAction:]): (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): 2006-07-07 John Sullivan <sullivan@apple.com> Reviewed by Tim Hatcher - fixed <rdar://problem/4606857> WebKit: WebPreferencesChangedNotification not exported * WebKit.exp: added surprisingly missing _WebPreferencesChangedNotification, defined in WebPreferences.h 2006-07-06 Brady Eidson <beidson@apple.com> Reviewed by John. Small fix to my previous small fix that only lets the ASSERT off the hook if the DB is closing * Misc/WebIconDatabase.m: (-[WebIconDatabase _releaseIconForIconURLString:]): 2006-07-05 Brady Eidson <beidson@apple.com> Reviewed by Maciej Small fix that prevents an assertion from triggering if the DB is being cleaned up (ie, the app being shut down) * Misc/WebIconDatabase.h: * Misc/WebIconDatabase.m: (-[NSMutableDictionary init]): (-[WebIconDatabase _applicationWillTerminate:]): (-[WebIconDatabase _releaseIconForIconURLString:]): 2006-07-05 Adele Peterson <adele@apple.com> Reviewed by Maciej and Hyatt. WebKit part of initial popup menu implementation. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Initialize WKPopupMenu. 2006-07-05 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. http://bugs.webkit.org/show_bug.cgi?id=3581 iFrames set to display:none are Missing from frames array * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]): (-[WebFrameBridge createChildFrameNamed:withURL:referrer:ownerElement:allowsScrolling:marginWidth:marginHeight:]): Modify to pass the owner element instead of the owner renderer. * WebView/WebHTMLView.m: (-[WebHTMLView _topHTMLView]): Remove assertion, it's not valid anymore. 2006-07-05 Timothy Hatcher <timothy@apple.com> Reviewed by Harrison. <rdar://problem/4608423> HIViewAdapter used but not defined Adds a new export file to fix the build. * WebKit.LP64.exp: Added. * WebKit.xcodeproj/project.pbxproj: 2006-07-04 Timothy Hatcher <timothy@apple.com> Reviewed by Maciej. Bug 9731: [Drosera] crash when trying to access the scope chain http://bugs.webkit.org/show_bug.cgi?id=9731 Because of <rdar://problem/4608404> the WebScriptObject, _globalObj, that WebCoreScriptDebugger holds is unprotected each time the page changes. This causes Drosera to crash Safari when trying to access the scope chain. We simply need to detach and re-attach the debugger when the window script object is cleared until 4608404 is fixed. This change also attaches the debugger before we call the windowScriptObjectAvailable: delegate method, so the debugger is ready before anyone might use the window object. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge windowObjectCleared]): 2006-07-04 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Bug 9732: [Drosera] calling removeListener to many times will cause WebKit's listener count to underflow/wraparound http://bugs.webkit.org/show_bug.cgi?id=9732 Adds a check to make sure the listener was in our listeners set before decrementing the global listener count. Also checks for nil in addListner to prevent a possible exception when adding the object to the set. * DefaultDelegates/WebScriptDebugServer.m: (-[WebScriptDebugServer addListener:]): (-[WebScriptDebugServer removeListener:]): 2006-07-04 Alexey Proskuryakov <ap@nypop.com> Reviewed by Maciej. - http://bugs.webkit.org/show_bug.cgi?id=8210 Conditional XMLHttpRequest gets should pass 304 responses unchanged Test: http/tests/xmlhttprequest/cache-override.html * Misc/WebNSURLRequestExtras.h: Added _web_isConditionalRequest * Misc/WebNSURLRequestExtras.m: (-[NSURLRequest _web_isConditionalRequest]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): Bypass the cache for conditional requests. * WebCoreSupport/WebSubresourceLoader.m: (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forDataSource:]): Ditto. 2006-07-01 David Kilzer <ddkilzer@kilzer.net> Reviewed by NOBODY (fixed Tim's build fix). * WebView/WebView.m: Added back missing '/' at the beginning of the file. 2006-07-01 Tim Omernick <timo@apple.com> Reviewed by NOBODY (build fix) * WebView/WebView.m: (-[WebView _isMIMETypeRegisteredAsPlugin:]): Changed nil to NO (typo). === Safari-521.14 === 2006-06-30 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Only enable shouldCloseWithWindow when ObjC GC is enabled. This maintains backwards compatibility with applications that expect a WebView to be usable after the window closes. * WebView/WebView.m: (-[WebViewPrivate init]): 2006-06-30 Timothy Hatcher <timothy@apple.com> Reviewed by Anders. Call _close in dealloc to ensure we cleanup for backwards compatibility. This will safeguard and cleanup even if the application doesn't use the new close API yet, like Mail. * WebView/WebView.m: (-[WebView dealloc]): 2006-06-29 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/4484405> WebKit leaks, improper tear-down <rdar://problem/3694059> -[WebBackForwardList finalize] is incorrect; design change needed <rdar://problem/3694103> -[WebFrame finalize] is incorrect; design change needed <rdar://problem/3694104> -[WebHTMLView finalize] is incorrect; design change needed Adds a close method to WebView, this needs to be called when the WebView is no longer needed. To make this easier for the common cases there is now an "auto close" on WebView that listens to the view's parent window. If the parent window closes and the WebView has no hostWindow then the WebView is automatically closed if autoClose is YES. To manage WebView closing yourself call setAutoClose: and pass NO. When a WebView closes it will tear-down and not be usable anymore. Close will will called on various other internal objects as a part of this, to ensure proper tear-down in GC without relying on finalize. * History/WebBackForwardList.m: (-[WebBackForwardList dealloc]): (-[WebBackForwardList finalize]): (-[WebBackForwardList _close]): * History/WebHistoryItem.m: (+[WebHistoryItem _closeObjectsInPendingPageCaches]): (+[WebHistoryItem _releaseAllPendingPageCaches]): * History/WebHistoryItemPrivate.h: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge close]): (-[WebFrameBridge saveDocumentToPageCache:]): (-[WebFrameBridge canGoBackOrForward:]): * WebView/WebFrame.m: (-[WebFrame _detachFromParent]): (-[WebFrame dealloc]): (-[WebFrame finalize]): * WebView/WebFrameView.m: (-[WebFrameView _setWebFrame:]): (-[WebFrameView finalize]): * WebView/WebHTMLView.m: (-[WebHTMLView close]): (-[WebHTMLView dealloc]): (-[WebHTMLView finalize]): * WebView/WebHTMLViewInternal.h: * WebView/WebHTMLViewPrivate.h: * WebView/WebScriptDebugDelegate.m: (-[WebScriptCallFrame _initWithFrame:initWithWebFrame:]): (-[WebScriptCallFrame parsedSource:fromURL:sourceId:startLine:errorLine:errorMessage:]): (-[WebScriptCallFrame enteredFrame:sourceId:line:]): (-[WebScriptCallFrame hitStatement:sourceId:line:]): (-[WebScriptCallFrame leavingFrame:sourceId:line:]): * WebView/WebScriptDebugDelegatePrivate.h: * WebView/WebView.m: (-[WebViewPrivate init]): (-[WebView _close]): (-[WebView dealloc]): (-[WebView finalize]): (-[WebView viewWillMoveToWindow:]): (-[WebView _windowWillClose:]): (-[WebView setPreferencesIdentifier:]): (-[WebView mainFrame]): (-[WebView setHostWindow:]): (-[WebView searchFor:direction:caseSensitive:wrap:]): (-[WebView writeSelectionWithPasteboardTypes:toPasteboard:]): (-[WebView close]): (-[WebView setAutoClose:]): (-[WebView autoClose]): (-[WebView _frameViewAtWindowPoint:]): * WebView/WebViewPrivate.h: 2006-06-29 Kevin Decker <kdecker@apple.com> Reviewed by mjs and timo. Fixed: <rdar://problem/4609119> handleAuthenticationFromResource was removed; needed by the Dashboard * WebView/WebViewPrivate.h: Added handleAuthenticationFromResource back into the header. Needed by the Dashboard, but was removed in r.14028 on 2006-04-23. 2006-06-29 Tim Omernick <timo@apple.com> Reviewed by Kevin Decker. <rdar://problem/4608487> REGRESSION: reproducible crash in +[WebCoreFrameBridge supportedImageMIMETypes] * Plugins/WebPluginDatabase.m: (+[WebPluginDatabase setAdditionalWebPlugInPaths:]): One might be tempted to add additionalWebPlugInPaths to the global WebPluginDatabase here. For backward compatibility with earlier versions of the +setAdditionalWebPlugInPaths: SPI, we need to save a copy of the additional paths and not cause a refresh of the plugin DB at this time. (-[WebPluginDatabase _plugInPaths]): Include additionalWebPlugInPaths if this is the global DB. (-[WebPluginDatabase refresh]): Call -_plugInPaths to get the modified array of paths. This is similar to what the old code (before we had per-WebView plugin search paths). 2006-06-29 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. WebHistoryItem now supports getting and setting arbitrary properties via _transientPropertyForKey: and -_setTransientProperty:forKey:. For now, these properties do not persist with the rest of the history data. They are intended to hold transient per-history-item state, which is something that was until now difficult for a WebKit client app to do. * History/WebHistoryItemPrivate.h: * History/WebHistoryItem.m: (-[WebHistoryItemPrivate dealloc]): (-[WebHistoryItem _transientPropertyForKey:]): (-[WebHistoryItem _setTransientProperty:forKey:]): 2006-06-29 Timothy Hatcher <timothy@apple.com> Reviewed by Harrison. Smart insert and delete, continuous spell checking and autoscroll can now be used for any WebView, not just editable ones. All of these make sense for documents that might contain content editable areas or our new text fields. Autoscroll is usefull for dragging for file input controls also. Added a SPI to toggle WebViews tab key behavior, tabKeyCyclesThroughElements. WebHTMLView's _interceptEditingKeyEvent now uses WebView's tabKeyCyclesThroughElements state to determine whether or not to process tab key events. The idea here is that tabKeyCyclesThroughElements will be YES when this WebView is being used in a browser, and we desire the behavior where tab moves to the next element in tab order. If tabKeyCyclesThroughElements is NO, it is likely that the WebView is being embedded as the whole view, as in Mail, and tabs should input tabs as expected in a text editor. Using Option-Tab always cycles through elements. * WebView/WebHTMLRepresentation.m: (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): * WebView/WebHTMLView.m: (-[WebHTMLView _interceptEditingKeyEvent:]): * WebView/WebView.m: (-[WebViewPrivate init]): (-[WebView _autoscrollForDraggingInfo:timeDelta:]): (-[WebView _shouldAutoscrollForDraggingInfo:]): (-[WebView validateUserInterfaceItem:]): (-[WebView toggleSmartInsertDelete:]): (-[WebView toggleContinuousSpellChecking:]): (-[WebView setTabKeyCyclesThroughElements:]): (-[WebView tabKeyCyclesThroughElements]): * WebView/WebViewPrivate.h: 2006-06-29 Anders Carlsson <acarlsson@apple.com> Reviewed by Tim O. * WebKit.xcodeproj/project.pbxproj: Add DOMXPath.h header. 2006-06-28 David Hyatt <hyatt@apple.com> Fix custom highlighting so that you can paint the entire line (and go outside the bounds of the line). Reviewed by harrison * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge customHighlightRect:forLine:]): (-[WebFrameBridge paintCustomHighlight:forBox:onLine:behindText:entireLine:]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLViewPrivate.h: 2006-06-28 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - fix Frame leak on layout tests * WebCoreSupport/WebPageBridge.m: (-[WebPageBridge outerView]): Return WebFrameView for main frame instead of WebView to avoid reference cycle between WebView and Page. 2006-06-28 Timothy Hatcher <timothy@apple.com> Prefer the Stabs debugging symbols format until DWARF bugs are fixed. * WebKit.xcodeproj/project.pbxproj: 2006-06-28 Levi Weintraub <lweintraub@apple.com> Reviewed by justin http://bugs.webkit.org/show_bug.cgi?id=7568 Bug 7568: Implement Indent/Outdent Added undo action strings and enum values * English.lproj/Localizable.strings: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge nameForUndoAction:]): 2006-06-27 Brady Eidson <beidson@apple.com> Reviewed by Maciej Hookup the new semi-functional SQLite icon database. For now, it is living side-by-side with the old DB so one can compare the two for debugging purposes. Also, it is disabled (in WebKit) by default unless you compile with ICONDEBUG #defined. Note: To repeat that, if you want to try the new DB, #define ICONDEBUG (WebKitPrefix.h is a good place to do it) * Misc/WebIconDatabase.m: (-[NSMutableDictionary iconForURL:withSize:cache:]): (-[NSMutableDictionary iconURLForURL:]): (-[NSMutableDictionary retainIconForURL:]): (-[NSMutableDictionary releaseIconForURL:]): (-[WebIconDatabase _setHaveNoIconForIconURL:]): (-[WebIconDatabase _setIconURL:forURL:]): (-[WebIconDatabase _hasIconForIconURL:]): (-[WebIconDatabase _resetCachedWebPreferences:]): * Misc/WebIconLoader.m: (-[WebIconLoader didFinishLoading]): * WebKit.xcodeproj/project.pbxproj: 2006-06-26 David Hyatt <hyatt@apple.com> Fix for 9538, support syntax highlighting for HTML source. Reviewed by darin * WebKit.xcodeproj/project.pbxproj: * WebView/WebView.m: (-[WebView _setInViewSourceMode:]): (-[WebView _inViewSourceMode]): * WebView/WebViewPrivate.h: 2006-06-25 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Bug 9574: Drosera should show inline scripts within the original HTML http://bugs.webkit.org/show_bug.cgi?id=9574 * Adds a new version of the didParseSource delegate callback with base line number. * Adds a new delegate callback for when a script fails to parse. * These new callbacks use NSURLs for the url parameter. * Adds a new script listener callback to notify when the main resource loads. * Adds a WebScriptErrorDomian and other keys for use with NSError. * DefaultDelegates/WebDefaultScriptDebugDelegate.m: (-[WebDefaultScriptDebugDelegate webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:]): (-[WebDefaultScriptDebugDelegate webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:]): * DefaultDelegates/WebScriptDebugServer.h: * DefaultDelegates/WebScriptDebugServer.m: (-[WebScriptDebugServer webView:didLoadMainResourceForDataSource:]): (-[WebScriptDebugServer webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:]): (-[WebScriptDebugServer webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:]): * DefaultDelegates/WebScriptDebugServerPrivate.h: * WebKit.exp: * WebView/WebDataSource.m: (-[WebDataSource _setPrimaryLoadComplete:]): * WebView/WebScriptDebugDelegate.h: * WebView/WebScriptDebugDelegate.m: (-[WebScriptCallFrame parsedSource:fromURL:sourceId:startLine:errorLine:errorMessage:]): 2006-06-24 David Kilzer <ddkilzer@kilzer.net> Reviewed by Timothy. * Info.plist: Fixed copyright to include 2003-2006. 2006-06-24 Alexey Proskuryakov <ap@nypop.com> Reviewed by Darin. - http://bugs.webkit.org/show_bug.cgi?id=9418 WebKit will not build when Space exists in path * WebKit.xcodeproj/project.pbxproj: Enclose search paths in quotes. 2006-06-23 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendEvent:]): Fixed a bug I found in the CoreGraphics drawing model that was preventing certain types of events from being dispatched to the plugin, unless the plugin was being updated. The check for portState was only required to call -setWindowIfNecessary, not required for the entire event dispatch. Also, don't paint the green debug rect unless this is a QuickDraw plugin. Otherwise the current QD port is not set, and the green rect fills the entire screen. Pretty awesome looking, but not intended behavior. (-[WebBaseNetscapePluginView setWindowIfNecessary]): Improved the logging here to include the NPWindow's width and height. 2006-06-23 Timothy Hatcher <timothy@apple.com> Reviewed by Tim O. Adds back SPI that Mail is still depending on. * WebView/WebDataSource.m: (-[WebDataSource _addSubframeArchives:]): * WebView/WebDataSourcePrivate.h: === WebKit-521.13 === 2006-06-23 Timothy Hatcher <timothy@apple.com> Reviewed by Geoff. script debugger should only attach to JavaScriptCore when there are listeners http://bugs.webkit.org/show_bug.cgi?id=9552 Attaches the debugger to all WebFrames when the first listener is added. Detaches when the last listener is removed. Also detach when the script debug delegate is set to nil. * DefaultDelegates/WebScriptDebugServer.m: (+[WebScriptDebugServer listenerCount]): (-[WebScriptDebugServer dealloc]): (-[WebScriptDebugServer attachScriptDebuggerToAllWebViews]): (-[WebScriptDebugServer detachScriptDebuggerFromAllWebViews]): (-[WebScriptDebugServer listenerConnectionDidDie:]): (-[WebScriptDebugServer addListener:]): (-[WebScriptDebugServer removeListener:]): * DefaultDelegates/WebScriptDebugServerPrivate.h: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge windowObjectCleared]): * WebView/WebFrame.m: (-[WebFrame _attachScriptDebugger]): (-[WebFrame _detachScriptDebugger]): * WebView/WebFramePrivate.h: * WebView/WebScriptDebugDelegate.m: (-[WebScriptCallFrame parsedSource:fromURL:sourceId:]): (-[WebScriptCallFrame enteredFrame:sourceId:line:]): (-[WebScriptCallFrame hitStatement:sourceId:line:]): (-[WebScriptCallFrame leavingFrame:sourceId:line:]): * WebView/WebView.m: (-[WebView _attachScriptDebuggerToAllFrames]): (-[WebView _detachScriptDebuggerFromAllFrames]): (-[WebView setScriptDebugDelegate:]): * WebView/WebViewPrivate.h: 2006-06-22 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick - added support for UIDelegate to be notified of scrolling in any WebHTMLView - cleaned up recently-added UIDelegate code * WebView/WebUIDelegatePrivate.h: declared webView:didScrollDocumentInFrameView: method * DefaultDelegates/WebDefaultUIDelegate.m: (-[NSApplication webView:didDrawRect:]): provide default (empty) implementation of this recently-added method, so the DelegateForwarder mechanism will work for it (-[NSApplication webView:didScrollDocumentInFrameView:]): same thing for the new method * WebView/WebHTMLView.m: (-[WebHTMLView _frameOrBoundsChanged]): use _UIDelegateForwarder mechanism to notify delegate that scrolling occurred (-[WebHTMLView drawSingleRect:]): use _UIDelegateForwarder mechanism instead of checking respondsToSelector stuff here (that's packaged up nicely by the forwarder mechanism) 2006-06-22 Tim Omernick <timo@apple.com> Reviewed by NOBODY (build fix) * WebView/WebFrameLoader.m: Import WebMainResourceLoader instead of using @class so that we can call WebMainResourceLoader methods. 2006-06-22 Tim Omernick <timo@apple.com> Reviewed by NOBODY (build fix) * WebView/WebFrameLoader.m: Import JavaScriptCore/Assertions.h instead of WebKit/WebAssertions.h (which no longer exists) 2006-06-22 Maciej Stachowiak <mjs@apple.com> Reviewed by Adele. - start moving loading logic to new WebFrameLoader class; move management of WebLoaders there * Misc/WebIconLoader.h: * Misc/WebIconLoader.m: (-[WebIconLoader didFinishLoading]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _updateLoading]): (-[WebDataSource _loadIcon]): (-[WebDataSource _setPrimaryLoadComplete:]): (-[WebDataSource _stopLoading]): (-[WebDataSource _startLoading]): (-[WebDataSource _addSubresourceLoader:]): (-[WebDataSource _removeSubresourceLoader:]): (-[WebDataSource _addPlugInStreamLoader:]): (-[WebDataSource _removePlugInStreamLoader:]): (-[WebDataSource _iconLoaderReceivedPageIcon:]): (-[WebDataSource _defersCallbacksChanged]): (-[WebDataSource _stopLoadingWithError:]): (-[WebDataSource _setupForReplaceByMIMEType:]): (-[WebDataSource initWithRequest:]): (-[WebDataSource dealloc]): (-[WebDataSource finalize]): (-[WebDataSource data]): (-[WebDataSource isLoading]): * WebView/WebFrameLoader.h: Added. * WebView/WebFrameLoader.m: Added. (-[WebFrameLoader initWithDataSource:]): (-[WebFrameLoader dealloc]): (-[WebFrameLoader hasIconLoader]): (-[WebFrameLoader loadIconWithRequest:]): (-[WebFrameLoader stopLoadingIcon]): (-[WebFrameLoader addPlugInStreamLoader:]): (-[WebFrameLoader removePlugInStreamLoader:]): (-[WebFrameLoader setDefersCallbacks:]): (-[WebFrameLoader stopLoadingPlugIns]): (-[WebFrameLoader isLoadingMainResource]): (-[WebFrameLoader isLoadingSubresources]): (-[WebFrameLoader isLoading]): (-[WebFrameLoader stopLoadingSubresources]): (-[WebFrameLoader addSubresourceLoader:]): (-[WebFrameLoader removeSubresourceLoader:]): (-[WebFrameLoader mainResourceData]): (-[WebFrameLoader releaseMainResourceLoader]): (-[WebFrameLoader cancelMainResourceLoad]): (-[WebFrameLoader startLoadingMainResourceWithRequest:identifier:]): (-[WebFrameLoader stopLoadingWithError:]): 2006-06-21 Brady Eidson <beidson@apple.com> Reviewed by Maciej The WebCoreIconDatabaseBridge was getting messages sent to it after it had been closed, resulting in a crash on an ASSERT(). After closing the databaseBridge, we simply set it to nil so this can't happen. anymore. * Misc/WebIconDatabase.m: (-[WebIconDatabase _applicationWillTerminate:]): 2006-06-21 Tim Omernick <timo@apple.com> Reviewed by Geoff Garen. <rdar://problem/4564131> WebPluginDatabase setAdditionalWebPlugInPaths needs to be per WebView Added some WebView SPI so that individual WebViews may have different plugin search paths. There are some limitations with the approach taken here: - JavaScript may only access the global plugin DB. - When this SPI is in use, certain WebView methods may not give accurate results, such as +canShowMIMEType:. - This only works for plugins referenced using the <object> or <embed> tags; plugins that reside in non-standard file system locations may not be loaded directly into frames. None of these issues are important to the client that needs this SPI. Rather than re-architect our entire plugin database, I think it is better to simply accept these limitations for now. * Plugins/WebPluginDatabase.h: Added "plugInPaths" ivar, so different plugin databases can have different search paths. * Plugins/WebPluginDatabase.m: (+[WebPluginDatabase installedPlugins]): Give the global plugin database the default plugin search paths. (+[WebPluginDatabase setAdditionalWebPlugInPaths:]): Removed static global; this method now sets the plugin paths on the global plugin database. (-[WebPluginDatabase setPlugInPaths:]): Setter method for plugin paths. (-[WebPluginDatabase close]): New method; called when the plugin database is no longer needed (when its WebView is being destroyed). (-[WebPluginDatabase init]): Don't refresh in -init, so that callers can set the DB's plugin path array before it refreshes. (-[WebPluginDatabase dealloc]): Moved here from near the bottom of the file. Release new ivar. (-[WebPluginDatabase refresh]): Use the plugInPaths ivar instead of calling pluginLocations(). Notify plugin packages when they are added to and removed from a plugin database. A plugin package will unload itself when it is removed from all of its plugin databases. The only really tricky thing here is that the global MIME <-> view class registrations are only modified by the shared plugin DB. (+[WebPluginDatabase _defaultPlugInPaths]): Refactored from the old pluginLocations() function; returns the default set of plugin search paths. * Plugins/WebBasePluginPackage.h: * Plugins/WebBasePluginPackage.m: (-[WebBasePluginPackage dealloc]): Assert that this package has been removed from all of its containing plugin databases. (-[WebBasePluginPackage finalize]): ditto (-[WebBasePluginPackage wasAddedToPluginDatabase:]): Add plugin database to set. (-[WebBasePluginPackage wasRemovedFromPluginDatabase:]): Remove plugin database from set. If it was the last DB, then unload the plugin package. * WebView/WebViewInternal.h: Added instance methods to find the view class or plugin package, given a MIME type or file extension. * WebView/WebViewPrivate.h: Added SPI to set plugin search paths per WebView. * WebView/WebView.m: (-[WebView _viewClass:andRepresentationClass:forMIMEType:]): New method; tries the global MIME <-> view map first; failing that, it checks the WebView's plugin DB. (-[WebView _close]): Close the plugin DB. (-[WebView _setAdditionalWebPlugInPaths:]): Create the plugin DB if necessary, and set its plugin paths. (-[WebView _pluginForMIMEType:]): Checks global plugin DB, falls back on WebView DB. (-[WebView _pluginForExtension:]): ditto (-[WebView _isMIMETypeRegisteredAsPlugin:]): ditto * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]): Use new WebView instance methods to look for plugins. (-[WebFrameBridge viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:DOMElement:]): ditto (-[WebFrameBridge determineObjectFromMIMEType:URL:]): ditto 2006-06-20 Brady Eidson <beidson@apple.com> Reviewed by Maciej Added calls through to the WebCoreIconDatabaseBridge for all the major WebIconDatabase API. For now these calls are wrapped with #ifdef's and are for debugging only. * Misc/WebIconDatabase.h: * Misc/WebIconDatabase.m: (-[NSMutableDictionary _scaleIcon:toSize:]): (-[NSMutableDictionary init]): (-[NSMutableDictionary iconForURL:withSize:cache:]): (-[NSMutableDictionary iconURLForURL:]): (-[NSMutableDictionary retainIconForURL:]): (-[NSMutableDictionary releaseIconForURL:]): (-[WebIconDatabase _setHaveNoIconForIconURL:]): (-[WebIconDatabase _setIconURL:forURL:]): (-[WebIconDatabase _hasIconForIconURL:]): * Misc/WebIconLoader.m: (-[WebIconLoader didFinishLoading]): * Misc/WebKitLogging.h: Added a logging channel for WebIconDatabase debugging * Misc/WebKitLogging.m: (WebKitInitializeLoggingChannelsIfNecessary): 2006-06-20 Adele Peterson <adele@apple.com> Reviewed by Tim Hatcher. * WebView/WebMainResourceLoader.m: Added missing header to fix build on Leopard. 2006-06-20 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Removes the @try/@catch from the callbacks to improve performance, simply check if the proxy object's connection is still valid first. Listener objects are now required to be NSDistantObjects. Adds pause, resume and step support. The debugger process use to handle this, but it caused problems when there were multiple listeners. Sends the bundle identifier in the notification userInfo dictionary along with process name and process ID. * DefaultDelegates/WebScriptDebugServer.h: * DefaultDelegates/WebScriptDebugServer.m: (-[WebScriptDebugServer serverQuery:]): (-[WebScriptDebugServer addListener:]): (-[WebScriptDebugServer removeListener:]): (-[WebScriptDebugServer step]): (-[WebScriptDebugServer pause]): (-[WebScriptDebugServer resume]): (-[WebScriptDebugServer isPaused]): (-[WebScriptDebugServer suspendProcessIfPaused]): (-[WebScriptDebugServer webView:didParseSource:fromURL:sourceId:forWebFrame:]): (-[WebScriptDebugServer webView:didEnterCallFrame:sourceId:line:forWebFrame:]): (-[WebScriptDebugServer webView:willExecuteStatement:sourceId:line:forWebFrame:]): (-[WebScriptDebugServer webView:willLeaveCallFrame:sourceId:line:forWebFrame:]): * DefaultDelegates/WebScriptDebugServerPrivate.h: * WebKit.exp: 2006-06-19 Alexey Proskuryakov <ap@nypop.com> Reviewed by Darin. - http://bugs.webkit.org/show_bug.cgi?id=5499 Page reload does not send any cache control headers * WebView/WebFrame.m: (-[WebFrame _addExtraFieldsToRequest:mainResource:alwaysFromRequest:]): Set a proper Cache-Control header for reload requests. (-[WebFrame loadRequest:]): Reset loadType to WebFrameLoadTypeStandard (after a reload, it stayed at WebFrameLoadTypeReload, so _addExtraFieldsToRequest erroneously added a Cache-Control header to them). 2006-06-19 John Sullivan <sullivan@apple.com> Reviewed by Darin. - added mechanism to notify UIDelegate when part of the webview is redrawn. For now, it only works for HTML views. * WebView/WebUIDelegatePrivate.h: Define a new UIDelegate method -webView:didDrawRect: * WebView/WebHTMLView.m: (-[WebView drawSingleRect:]): Call through to UIDelegate if it implements that method. I tested that this does not impact PLT numbers in the case where the delegate implements the method but does nothing in it. 2006-06-19 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Maciej. - fix http://bugs.webkit.org/show_bug.cgi?id=9452 Assertion failure in -[WebFramePrivate setProvisionalDataSource:] * WebView/WebFrame.m: (-[WebFrame _checkLoadCompleteForThisFrame]): Avoid re-entering the delegate's -[webView:didFailProvisionalLoadWithError:forFrame]. 2006-06-18 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by xenon. - http://bugs.webkit.org/show_bug.cgi?id=9479 Disassociate the inspector from the frame when it detaches from its parent * WebInspector/WebInspector.m: (-[NSWindow setWebFrame:]): Added code to (de)register with the WebFrame the inspector is (no longer) targeting. (-[WebInspector _webFrameDetached:]): Added. Moved the code that was previously in -[inspectedWindowWillClose:] here. This is called by the WebFrame when it is detached from its parent. * WebInspector/WebInspectorInternal.h: * WebView/WebFrame.m: (-[WebFramePrivate dealloc]): (-[WebFrame _detachFromParent]): Added code to notify all registered inspectors that the WebFrame is detaching. (-[WebFrame _addInspector:]): Added. (-[WebFrame _removeInspector:]): Added. * WebView/WebFrameInternal.h: 2006-06-18 Anders Carlsson <acarlsson@apple.com> Reviewed by Geoff. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge shouldInterruptJavaScript]): Ask the UI delegate if the script should be interrupted. * WebView/WebUIDelegatePrivate.h: Declare webViewShouldInterruptJavaScript: delegate method 2006-06-17 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=9466 Assertion failure when dragging an image from the document into Safari's address bar * WebView/WebFrameView.m: (-[WebFrameView _setDocumentView:]): Reset the WebView's initiatedDrag flag when the document view is changed. * WebView/WebHTMLView.m: (-[WebHTMLView draggedImage:endedAt:operation:]): Changed the ASSERT to allow for drags that end after the view has been removed from the WebView. 2006-06-16 Timothy Hatcher <timothy@apple.com> Reviewed by Tim O. Exposes a distributed objects server for clients to register for script debugger calls. For preformance concerns this is disabled by default, you will need to enable this per application. To enable for Safari do this: defaults write com.apple.Safari WebKitScriptDebuggerEnabled -bool true Clients will need to listen to the following distributed notification to discover servers: WebScriptDebugServerDidLoadNotification To discover servers that previously loaded before the client, the client needs to send the following notification: WebScriptDebugServerQueryNotification All servers will reply with the WebScriptDebugServerQueryReplyNotification notification that contains the registered server connection name to use with distributed objects. * DefaultDelegates/WebScriptDebugServer.h: Added. * DefaultDelegates/WebScriptDebugServer.m: Added. (+[WebScriptDebugServer sharedScriptDebugServer]): (-[WebScriptDebugServer init]): (-[WebScriptDebugServer dealloc]): (-[WebScriptDebugServer serverQuery:]): (-[WebScriptDebugServer listenerConnectionDidDie:]): (-[WebScriptDebugServer addListener:]): (-[WebScriptDebugServer removeListener:]): (-[WebScriptDebugServer webView:didParseSource:fromURL:sourceId:forWebFrame:]): (-[WebScriptDebugServer webView:didEnterCallFrame:sourceId:line:forWebFrame:]): (-[WebScriptDebugServer webView:willExecuteStatement:sourceId:line:forWebFrame:]): (-[WebScriptDebugServer webView:willLeaveCallFrame:sourceId:line:forWebFrame:]): * DefaultDelegates/WebScriptDebugServerPrivate.h: Added. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge windowObjectCleared]): * WebKit.exp: * WebKit.xcodeproj/project.pbxproj: * WebView/WebScriptDebugDelegate.m: (-[WebScriptCallFrame parsedSource:fromURL:sourceId:]): (-[WebScriptCallFrame enteredFrame:sourceId:line:]): (-[WebScriptCallFrame hitStatement:sourceId:line:]): (-[WebScriptCallFrame leavingFrame:sourceId:line:]): * WebView/WebView.m: (+[WebView _developerExtrasEnabled]): (+[WebView _scriptDebuggerEnabled]): (-[WebView _menuForElement:defaultItems:]): (-[WebView _commonInitializationWithFrameName:groupName:]): * WebView/WebViewPrivate.h: 2006-06-16 Adele Peterson <adele@apple.com> Reviewed by Alice. Added initialization for WKDrawBezeledTextArea. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): 2006-06-15 Timothy Hatcher <timothy@apple.com> Reviewed by Geoff and Darin. Prefer the DWARF debugging symbols format for use in Xcode 2.3. * WebKit.xcodeproj/project.pbxproj: 2006-06-15 John Sullivan <sullivan@apple.com> Reviewed by Tim O. Fixed bug in WebKit support for computing but not highlighting rects for text matches. * WebView/WebView.m: (-[WebView rectsForTextMatches]): leave out empty rects, and convert rects to WebView coordinates. Since this makes a batch of autoreleased NSValue objects, use a local autorelease pool 2006-02-11 David Kilzer <ddkilzer@kilzer.net> Reviewed by John Sullivan. * Plugins/WebPluginController.m: (-[WebPluginController _cancelOutstandingChecks]): add nil check before calling CFSetApplyFunction 2006-06-14 Levi Weintraub <lweintraub@apple.com> Reviewed by justin <http://bugs.webkit.org/show_bug.cgi?id=7580> TinyMCE: Implement execCommand(formatBlock, ...) * English.lproj/Localizable.strings: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge nameForUndoAction:]): 2006-06-14 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. <rdar://problem/4577988> GC: WebPluginController uses inefficient resurrecting enumeration * Plugins/WebPluginController.m: (cancelOutstandingCheck): (-[WebPluginController _cancelOutstandingChecks]): Use CFSetApplyFunction() instead of an enumerator to guard against modifications to the set while enumerating. 2006-06-13 John Sullivan <sullivan@apple.com> Reviewed by Tim O. - fixed <rdar://problem/4498606> REGRESSION (417.8-420+): 3 missing items (but extra separators) in context menu in Mail message body * WebView/WebView.m: (-[WebView _menuForElement:defaultItems:]): Add special-case hackery to recover from this SPI -> API mismatch. 2006-06-13 Tim Omernick <timo@apple.com> Reviewed by Anders. Fixed a recently-introduced assertion failure when handling 404 errors. * WebView/WebDataSource.m: (-[WebDataSource _handleFallbackContent]): Use the -[WebFrame _bridge] instead of -[WebDataSource _bridge]. The former is not valid until the data source has been committed, which is not the case when the resource fails to load. The latter is safe to call at any time. This broke last night with Maciej's change to WebFrameResourceLoader. The old code used to call -[WebFrame _bridge]. 2006-06-13 Anders Carlsson <acarlsson@apple.com> Reviewed by Geoff. http://bugs.webkit.org/show_bug.cgi?id=9406 REGRESSION: fix for bug 9390 broke two layout tests * Plugins/WebPluginDatabase.h: (-[WebPluginDatabase isMIMETypeRegistered:]): Add new function isMIMETypeRegistered which returns whether a given MIME type has a plugin registered. * Plugins/WebPluginDatabase.m: (-[WebPluginDatabase init]): Init set of registered MIME types. (-[WebPluginDatabase refresh]): Add and remove MIME types from the set of registered MIME types when registering and unregistering plugin MIME types. (-[WebPluginDatabase dealloc]): Release set of registered MIME types. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge determineObjectFromMIMEType:URL:]): Use isMIMETypeRegistered here. 2006-06-12 Maciej Stachowiak <mjs@apple.com> - fix for cocoa exception (whoops) * WebView/WebView.m: (+[WebView _generatedMIMETypeForURLScheme:]): put this back * WebView/WebDataSource.m: (+[WebDataSource _generatedMIMETypeForURLScheme:]): call WebView 2006-06-12 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - remove use of WebView and related from WebMainResourceLoader * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.m: (+[WebDataSource _generatedMIMETypeForURLScheme:]): (+[WebDataSource _representationExistsForURLScheme:]): (+[WebDataSource _canShowMIMEType:]): (-[WebDataSource _handleFallbackContent]): (-[WebDataSource _decidePolicyForMIMEType:decisionListener:]): * WebView/WebDataSourceInternal.h: * WebView/WebFrame.m: (-[WebFrame _isMainFrame]): * WebView/WebFrameInternal.h: * WebView/WebMainResourceLoader.m: (-[WebMainResourceLoader willSendRequest:redirectResponse:]): (-[WebMainResourceLoader continueAfterContentPolicy:response:]): (-[WebMainResourceLoader checkContentPolicyForResponse:]): (-[WebMainResourceLoader loadWithRequestNow:]): * WebView/WebView.m: 2006-06-12 Tim Omernick <timo@apple.com> Reviewed by Maciej. <rdar://problem/4526052> intermittent assertion failure in -[WebBasePluginPackage dealloc] running layout tests * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage _initWithPath:]): Renamed from -initWithPath:. Instead of releasing/deallocating self on error, return NO. (-[WebNetscapePluginPackage initWithPath:]): Call the new -_initWithPath:. If it returns NO, unload the plugin package before deallocating it. 2006-06-11 Darin Adler <darin@apple.com> - try to fix Windows build * COM/WebKitDLL.cpp: (loadResourceIntoArray): Use Vector<char> instead of DeprecatedByteArray. 2006-06-11 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Tim H. - fix http://bugs.webkit.org/show_bug.cgi?id=8672 Red outline from web inspector reappears after inspector is closed * WebInspector/WebInspector.m: (-[NSWindow windowWillClose:]): Added a call to setWebFrame to avoid further load progress notifications. (-[NSWindow setWebFrame:]): Changed to resign the WebView's hostWindow rather than its window for close notifications, to avoid resigning from all windows' close notifications (including the inspector window's) when the WebView is in a hidden tab. Also changed to prevent highlighting the initial focused node. 2006-06-11 Anders Carlsson <acarlsson@apple.com> Reviewed by Tim. http://bugs.webkit.org/show_bug.cgi?id=9390 Move full-frame plugins to WebCore * Plugins/WebBaseNetscapePluginStream.h: * Plugins/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream instance]): Add instance method which returns the plugin instance. * Plugins/WebBasePluginPackage.h: Add WebPluginManualLoader protocol * Plugins/WebNetscapePluginDocumentView.h: Removed. * Plugins/WebNetscapePluginDocumentView.m: Removed. * Plugins/WebNetscapePluginEmbeddedView.h: * Plugins/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView initWithFrame:plugin:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:]): (-[WebNetscapePluginEmbeddedView dealloc]): (-[WebNetscapePluginEmbeddedView didStart]): (-[WebNetscapePluginEmbeddedView pluginView:receivedResponse:]): (-[WebNetscapePluginEmbeddedView pluginView:receivedData:]): (-[WebNetscapePluginEmbeddedView pluginView:receivedError:]): (-[WebNetscapePluginEmbeddedView pluginViewFinishedLoading:]): (-[WebNetscapePluginEmbeddedView redeliverStream]): Make WebNetscapePluginEmbeddedView support the WebPluginManualLoader protocol. It creates a plugin stream and feeds the data manually. Much of this code has been copied from WebNetscapePluginRepresentation. * Plugins/WebNetscapePluginRepresentation.h: Removed. * Plugins/WebNetscapePluginRepresentation.m: Removed. * Plugins/WebPluginController.h: * Plugins/WebPluginController.m: (-[WebPluginController pluginView:receivedResponse:]): (-[WebPluginController pluginView:receivedData:]): (-[WebPluginController pluginView:receivedError:]): (-[WebPluginController pluginViewFinishedLoading:]): Make WebPluginController support the WebPluginManualLoader protocol so it can feed data manually to WebKit plugins. * Plugins/WebPluginDatabase.m: (-[WebPluginDatabase refresh]): Use WebHTMLView and WebHTMLRepresentation when registering/unregistering plug-in MIME types. * Plugins/WebPluginDocumentView.h: Removed. * Plugins/WebPluginDocumentView.m: Removed. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:DOMElement:loadManually:]): (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:loadManually:]): Add loadManually argument. (-[WebFrameBridge redirectDataToPlugin:]): Call down to the HTML representation. (-[WebFrameBridge viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:DOMElement:]): Pass NO to loadManually. (-[WebFrameBridge determineObjectFromMIMEType:URL:]): Explicitly check if the MIME type is supported by a plug-in instead of checking the view class. * WebCoreSupport/WebViewFactory.m: (-[WebViewFactory pluginSupportsMIMEType:]): New function which returns whether any plugins support a given MIME type. * WebKit.xcodeproj/project.pbxproj: Update for removed files. * WebView/WebFrame.m: (-[WebFrame _reloadForPluginChanges]): Remove view type checks. (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]): (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]): Remove FIXME comments. * WebView/WebHTMLRepresentation.m: (-[WebHTMLRepresentation _redirectDataToManualLoader:forPluginView:]): New function which redirects incoming data to a manual loader. (-[WebHTMLRepresentation receivedData:withDataSource:]): (-[WebHTMLRepresentation receivedError:withDataSource:]): (-[WebHTMLRepresentation finishedLoadingWithDataSource:]): Optionally redirect incoming data. * WebView/WebHTMLRepresentationPrivate.h: 2006-06-09 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick and Dave Hyatt. WebKit support for computing but not highlighting rects for text matches. * WebView/WebHTMLViewPrivate.h: added markedTextMatchesAreHighlighted/setMarkedTextMatchesAreHighlighted and rectsForTextMatches, and renamed related methods for clarity/consistency * WebView/WebHTMLView.m: (-[WebHTMLView markAllMatchesForText:caseSensitive:]): renamed, calls similarly-renamed method (-[WebHTMLView setMarkedTextMatchesAreHighlighted:]): new method, calls through to bridge (-[WebHTMLView markedTextMatchesAreHighlighted]): ditto (-[WebHTMLView unmarkAllTextMatches]): renamed (-[WebHTMLView rectsForTextMatches]): new method, calls through to bridge * WebView/WebViewPrivate.h: added rectsForTextMatches, renamed other methods (and added highlight: parameter) * WebView/WebView.m: (-[WebView markAllMatchesForText:caseSensitive:highlight:]): renamed for clarity/consistency, and now has highlight: parameter, which is passed down (-[WebView unmarkAllTextMatches]): renamed for clarity/consistency, and calls similarly-renamed method lower down. diff got confused with the end of this and the end of the next method. (-[WebView rectsForTextMatches]): new method, calls through to WebHTMLView as related methods currently do 2006-06-10 Graham Dennis <Graham.Dennis@gmail.com> <http://bugs.webkit.org/show_bug.cgi?id=9384> WebView's initWithCoder: method does not set useBackForwardList correctly Reviewed by John Sullivan. * WebView/WebView.m: (-[WebView initWithCoder:]): Make sure that the function variable useBackForwardList is correctly set, so that the copy in the _private ivar is set. 2006-06-09 David Hyatt <hyatt@apple.com> Rename updateFocusState to updateActiveState. * WebView/WebHTMLView.m: (-[WebHTMLView _updateActiveState]): (-[WebHTMLView viewDidMoveToWindow]): (-[WebHTMLView windowDidBecomeKey:]): (-[WebHTMLView windowDidResignKey:]): (-[WebHTMLView becomeFirstResponder]): (-[WebHTMLView resignFirstResponder]): (-[WebHTMLView _formControlIsBecomingFirstResponder:]): (-[WebHTMLView _formControlIsResigningFirstResponder:]): * WebView/WebHTMLViewPrivate.h: 2006-06-09 David Hyatt <hyatt@apple.com> Rename displaysWithFocusAttributes to isActive. Reviewed by sfalken * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLView.m: (-[WebHTMLView _updateFocusState]): 2006-06-08 Justin Garcia <justin.garcia@apple.com> Reviewed by levi <http://bugs.webkit.org/show_bug.cgi?id=4468> Implement execCommand(Insert{Un}OrderedList) * WebView/WebFrame.m: (-[WebFrame _findFrameWithSelection]): Removed an assertion that we only have one frame with a selection. * WebView/WebView.m: (-[WebView selectedFrame]): Ditto. 2006-06-08 Timothy Hatcher <timothy@apple.com> Reviewed by Darin and John. <rdar://problem/3600734> API: please add a way to turn vertical scrollbar always on (for Mail, to avoid reflow when typing) Adds new methods to lock the scrolling mode on WebDynamicScrollBarsView. Locking the scroll mode prevents WebCore from changing it as needed. Also adds an SPI on WebView that will lock the "always on" mode for each scroller. * WebKit.xcodeproj/project.pbxproj: * WebView/WebDynamicScrollBarsView.h: * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView setAllowsScrolling:]): (-[WebDynamicScrollBarsView allowsScrolling]): (-[WebDynamicScrollBarsView setAllowsHorizontalScrolling:]): (-[WebDynamicScrollBarsView setAllowsVerticalScrolling:]): (-[WebDynamicScrollBarsView setHorizontalScrollingMode:]): (-[WebDynamicScrollBarsView setVerticalScrollingMode:]): (-[WebDynamicScrollBarsView setScrollingMode:]): (-[WebDynamicScrollBarsView setHorizontalScrollingModeLocked:]): (-[WebDynamicScrollBarsView setVerticalScrollingModeLocked:]): (-[WebDynamicScrollBarsView setScrollingModesLocked:]): (-[WebDynamicScrollBarsView horizontalScrollingModeLocked]): (-[WebDynamicScrollBarsView verticalScrollingModeLocked]): * WebView/WebView.m: (-[WebView setAlwaysShowVerticalScroller:]): (-[WebView alwaysShowVerticalScroller]): (-[WebView setAlwaysShowHorizontalScroller:]): (-[WebView alwaysShowHorizontalScroller]): * WebView/WebViewPrivate.h: 2006-06-08 Darin Adler <darin@apple.com> Reviewed by Justin. - fix http://bugs.webkit.org/show_bug.cgi?id=8616 REGRESSION: TinyMCE: Crash on Undo * WebView/WebHTMLView.m: (-[WebHTMLView _topHTMLView]): Added. (-[WebHTMLView _isTopHTMLView]): Added. (-[WebHTMLView _insideAnotherHTMLView]): Changed to use _topHTMLView. (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): Forward to the top HTML view, so that only the top view ever starts a dragging operation. Change dragging code to not assume that the dragged node is in the current view's document. Added checks that the node is an element in a couple places and coordinate conversions. (-[WebHTMLView _mayStartDragAtEventLocation:]): Forward to the top HTML view. (-[WebHTMLView addMouseMovedObserver]): Change to do nothing when the dataSource field is 0, since we now use the dataSource field to get to the WebView. (-[WebHTMLView removeMouseMovedObserver]): Added a comment. (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): Forward to the top HTML view. (-[WebHTMLView draggingSourceOperationMaskForLocal:]): Assert that it's the top HTML view. (-[WebHTMLView draggedImage:movedTo:]): Ditto. (-[WebHTMLView draggedImage:endedAt:operation:]): Ditto. (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Ditto. (-[WebHTMLView _canProcessDragWithDraggingInfo:]): Ditto. (-[WebHTMLView _isMoveDrag]): Ditto. (-[WebHTMLView draggingUpdatedWithDraggingInfo:actionMask:]): Ditto. (-[WebHTMLView draggingCancelledWithDraggingInfo:]): Ditto. (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): Ditto. Also added code to work with the appropriate bridge when receiving a drag. This fixes the problem where the top level frame got a selection intended for the inner frame; the source of the bug. (-[WebHTMLView elementAtPoint:allowShadowContent:]): Added code to convert the coordinates so this works properly when returning an element from an inner frame. (-[WebHTMLView setDataSource:]): Added a call to addMouseMovedObserver, needed now that addMouseMovedObserver won't do anything if called when dataSource is nil. (-[WebHTMLView _delegateDragSourceActionMask]): Forward to the top HTML view. * WebView/WebView.m: (-[WebViewPrivate dealloc]): Removed code to release dragCaretBridge since that field is now gone. (-[WebView moveDragCaretToPoint:]): Always call the main frame's bridge, since the drag caret is now a page-level item. Later we'll move it to the page bridge. (-[WebView removeDragCaret]): Ditto. 2006-06-07 David Hyatt <hyatt@apple.com> Add support for custom highlighting to WebKit. Reviewed by justin * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge paintCustomHighlight:forBox:onLine:behindText:]): * WebView/WebHTMLView.m: (-[WebHTMLView _highlighterForType:]): * WebView/WebHTMLViewInternal.h: * WebView/WebHTMLViewPrivate.h: 2006-06-07 Adele Peterson <adele@apple.com> Reviewed by Hyatt. Added resources for missingImage and textAreaResizeCorner. * COM/WebKitDLL.cpp: (loadResourceIntoArray): Added. Returns a DeprecatedByteArray with the resource's data. * WebKit.vcproj/WebKit.rc: Added missing image and resize pngs as resources. * WebKit.vcproj/WebKit.vcproj: Added pngs. * WebKit.vcproj/missingImage.png: Added. * WebKit.vcproj/resource.h: Added entries for pngs. * WebKit.vcproj/textAreaResizeCorner.png: Added. 2006-06-07 David Hyatt <hyatt@apple.com> Add SPI for setting and removing custom highlighters. Reviewed by Tim H * WebView/WebHTMLView.m: (-[WebTextCompleteController dealloc]): (-[WebHTMLView _setHighlighter:ofType:]): (-[WebHTMLView _removeHighlighterOfType:]): * WebView/WebHTMLViewInternal.h: * WebView/WebHTMLViewPrivate.h: 2006-06-06 Adele Peterson <adele@apple.com> Reviewed by Justin. * COM/WebView.cpp: (WebView::keyPress): Added case for VK_RETURN. 2006-06-06 Anders Carlsson <acarlsson@apple.com> Reviewed by John. * WebView/WebFrame.m: (-[WebFrame _reloadForPluginChanges]): Don't traverse the view hierarchy looking for plugin views. Instead, just ask the frame whether it contains any plugins. 2006-06-03 Steve Falkenburg <sfalken@apple.com> Reviewed by hyatt. Add implementation of loadHTMLString for Spinneret * COM/WebFrame.cpp: (WebFrame::loadHTMLString): 2006-06-02 Steve Falkenburg <sfalken@apple.com> Reviewed by darin. New hosting for Spinneret to avoid static linking * COM: Added. * COM/Interfaces: Added. * COM/Interfaces/DOMCSS.idl: Added. * COM/Interfaces/DOMCore.idl: Added. * COM/Interfaces/DOMHTML.idl: Added. * COM/Interfaces/DOMRange.idl: Added. * COM/Interfaces/IWebArchive.idl: Added. * COM/Interfaces/IWebAttributedString.idl: Added. * COM/Interfaces/IWebBackForwardList.idl: Added. * COM/Interfaces/IWebDataSource.idl: Added. * COM/Interfaces/IWebDocument.idl: Added. * COM/Interfaces/IWebDownload.idl: Added. * COM/Interfaces/IWebEditingDelegate.idl: Added. * COM/Interfaces/IWebError.idl: Added. * COM/Interfaces/IWebFrame.idl: Added. * COM/Interfaces/IWebFrameLoadDelegate.idl: Added. * COM/Interfaces/IWebFrameView.idl: Added. * COM/Interfaces/IWebHistoryItem.idl: Added. * COM/Interfaces/IWebIconDatabase.idl: Added. * COM/Interfaces/IWebImage.idl: Added. * COM/Interfaces/IWebMutableURLRequest.idl: Added. * COM/Interfaces/IWebNotification.idl: Added. * COM/Interfaces/IWebPolicyDelegate.idl: Added. * COM/Interfaces/IWebPreferences.idl: Added. * COM/Interfaces/IWebResource.idl: Added. * COM/Interfaces/IWebResourceLoadDelegate.idl: Added. * COM/Interfaces/IWebScriptObject.idl: Added. * COM/Interfaces/IWebUIDelegate.idl: Added. * COM/Interfaces/IWebURLAuthenticationChallenge.idl: Added. * COM/Interfaces/IWebURLRequest.idl: Added. * COM/Interfaces/IWebURLResponse.idl: Added. * COM/Interfaces/IWebUndoManager.idl: Added. * COM/Interfaces/IWebView.idl: Added. * COM/Interfaces/WebKit.idl: Added. * COM/WebBackForwardList.cpp: Added. (WebBackForwardList::WebBackForwardList): (WebBackForwardList::~WebBackForwardList): (WebBackForwardList::createInstance): (WebBackForwardList::QueryInterface): (WebBackForwardList::AddRef): (WebBackForwardList::Release): (WebBackForwardList::addItem): (WebBackForwardList::goBack): (WebBackForwardList::goForward): (WebBackForwardList::goToItem): (WebBackForwardList::backItem): (WebBackForwardList::currentItem): (WebBackForwardList::forwardItem): (WebBackForwardList::backListWithLimit): (WebBackForwardList::forwardListWithLimit): (WebBackForwardList::capacity): (WebBackForwardList::setCapacity): (WebBackForwardList::backListCount): (WebBackForwardList::forwardListCount): (WebBackForwardList::containsItem): (WebBackForwardList::itemAtIndex): (WebBackForwardList::setPageCacheSize): (WebBackForwardList::pageCacheSize): * COM/WebBackForwardList.h: Added. * COM/WebDataSource.cpp: Added. (WebDataSource::WebDataSource): (WebDataSource::~WebDataSource): (WebDataSource::createInstance): (WebDataSource::QueryInterface): (WebDataSource::AddRef): (WebDataSource::Release): (WebDataSource::initWithRequest): (WebDataSource::data): (WebDataSource::representation): (WebDataSource::webFrame): (WebDataSource::initialRequest): (WebDataSource::request): (WebDataSource::response): (WebDataSource::textEncodingName): (WebDataSource::isLoading): (WebDataSource::pageTitle): (WebDataSource::unreachableURL): (WebDataSource::webArchive): (WebDataSource::mainResource): (WebDataSource::subresources): (WebDataSource::subresourceForURL): (WebDataSource::addSubresource): * COM/WebDataSource.h: Added. * COM/WebFrame.cpp: Added. (WebFrame::WebFramePrivate::WebFramePrivate): (WebFrame::WebFramePrivate::~WebFramePrivate): (WebFrame::WebFrame): (WebFrame::~WebFrame): (WebFrame::createInstance): (WebFrame::QueryInterface): (WebFrame::AddRef): (WebFrame::Release): (WebFrame::initWithName): (WebFrame::name): (WebFrame::webView): (WebFrame::frameView): (WebFrame::DOMDocument): (WebFrame::frameElement): (WebFrame::loadRequest): (WebFrame::loadData): (WebFrame::loadHTMLString): (WebFrame::loadAlternateHTMLString): (WebFrame::loadArchive): (WebFrame::dataSource): (WebFrame::provisionalDataSource): (WebFrame::stopLoading): (WebFrame::reload): (WebFrame::findFrameNamed): (WebFrame::parentFrame): (WebFrame::childFrames): (WebFrame::paint): (WebFrame::impl): (WebFrame::loadDataSource): (WebFrame::loading): (WebFrame::goToItem): (WebFrame::loadItem): (WebSystemMainMemory): (WebFrame::getObjectCacheSize): (WebFrame::receivedRedirect): (WebFrame::receivedResponse): (WebFrame::receivedData): (WebFrame::receivedAllData): (WebFrame::openURL): (WebFrame::submitForm): (WebFrame::setTitle): (WebFrame::setStatusText): * COM/WebFrame.h: Added. * COM/WebHistoryItem.cpp: Added. (WebHistoryItem::WebHistoryItem): (WebHistoryItem::~WebHistoryItem): (WebHistoryItem::createInstance): (WebHistoryItem::QueryInterface): (WebHistoryItem::AddRef): (WebHistoryItem::Release): (WebHistoryItem::initWithURLString): (WebHistoryItem::originalURLString): (WebHistoryItem::URLString): (WebHistoryItem::title): (WebHistoryItem::lastVisitedTimeInterval): (WebHistoryItem::setAlternateTitle): (WebHistoryItem::alternateTitle): (WebHistoryItem::icon): * COM/WebHistoryItem.h: Added. * COM/WebIconDatabase.cpp: Added. (WebIconDatabase::WebIconDatabase): (WebIconDatabase::~WebIconDatabase): (WebIconDatabase::createInstance): (WebIconDatabase::QueryInterface): (WebIconDatabase::AddRef): (WebIconDatabase::Release): (WebIconDatabase::sharedIconDatabase): (WebIconDatabase::iconForURL): (WebIconDatabase::defaultIconWithSize): (WebIconDatabase::retainIconForURL): (WebIconDatabase::releaseIconForURL): (WebIconDatabase::delayDatabaseCleanup): (WebIconDatabase::allowDatabaseCleanup): * COM/WebIconDatabase.h: Added. * COM/WebKitClassFactory.cpp: Added. (WebKitClassFactory::WebKitClassFactory): (WebKitClassFactory::~WebKitClassFactory): (WebKitClassFactory::QueryInterface): (WebKitClassFactory::AddRef): (WebKitClassFactory::Release): (WebKitClassFactory::CreateInstance): (WebKitClassFactory::LockServer): * COM/WebKitClassFactory.h: Added. * COM/WebKitDLL.cpp: Added. (DllMain): (DllGetClassObject): (DllCanUnloadNow): (DllUnregisterServer): (DllRegisterServer): * COM/WebKitDLL.h: Added. * COM/WebMutableURLRequest.cpp: Added. (WebMutableURLRequest::WebMutableURLRequest): (WebMutableURLRequest::~WebMutableURLRequest): (WebMutableURLRequest::createInstance): (WebMutableURLRequest::QueryInterface): (WebMutableURLRequest::AddRef): (WebMutableURLRequest::Release): (WebMutableURLRequest::requestWithURL): (WebMutableURLRequest::allHTTPHeaderFields): (WebMutableURLRequest::cachePolicy): (WebMutableURLRequest::HTTPBody): (WebMutableURLRequest::HTTPBodyStream): (WebMutableURLRequest::HTTPMethod): (WebMutableURLRequest::HTTPShouldHandleCookies): (WebMutableURLRequest::initWithURL): (WebMutableURLRequest::mainDocumentURL): (WebMutableURLRequest::timeoutInterval): (WebMutableURLRequest::URL): (WebMutableURLRequest::valueForHTTPHeaderField): (WebMutableURLRequest::addValue): (WebMutableURLRequest::setAllHTTPHeaderFields): (WebMutableURLRequest::setCachePolicy): (WebMutableURLRequest::setHTTPBody): (WebMutableURLRequest::setHTTPBodyStream): (WebMutableURLRequest::setHTTPMethod): (WebMutableURLRequest::setHTTPShouldHandleCookies): (WebMutableURLRequest::setMainDocumentURL): (WebMutableURLRequest::setTimeoutInterval): (WebMutableURLRequest::setURL): (WebMutableURLRequest::setValue): (WebMutableURLRequest::setFormData): (WebMutableURLRequest::formData): * COM/WebMutableURLRequest.h: Added. * COM/WebView.cpp: Added. (WebView::WebView): (WebView::~WebView): (WebView::createInstance): (WebView::mouseMoved): (WebView::mouseDown): (WebView::mouseUp): (WebView::mouseDoubleClick): (WebView::keyPress): (registerWebView): (WebViewWndProc): (calculateScrollDelta): (scrollMessageForKey): (WebView::goToItem): (WebView::QueryInterface): (WebView::AddRef): (WebView::Release): (WebView::canShowMIMEType): (WebView::canShowMIMETypeAsHTML): (WebView::MIMETypesShownAsHTML): (WebView::setMIMETypesShownAsHTML): (WebView::URLFromPasteboard): (WebView::URLTitleFromPasteboard): (WebView::initWithFrame): (WebView::setUIDelegate): (WebView::uiDelegate): (WebView::setResourceLoadDelegate): (WebView::resourceLoadDelegate): (WebView::setDownloadDelegate): (WebView::downloadDelegate): (WebView::setFrameLoadDelegate): (WebView::frameLoadDelegate): (WebView::setPolicyDelegate): (WebView::policyDelegate): (WebView::mainFrame): (WebView::backForwardList): (WebView::setMaintainsBackForwardList): (WebView::goBack): (WebView::goForward): (WebView::goToBackForwardItem): (WebView::setTextSizeMultiplier): (WebView::textSizeMultiplier): (WebView::setApplicationNameForUserAgent): (WebView::applicationNameForUserAgent): (WebView::setCustomUserAgent): (WebView::customUserAgent): (WebView::userAgentForURL): (WebView::supportsTextEncoding): (WebView::setCustomTextEncodingName): (WebView::customTextEncodingName): (WebView::setMediaStyle): (WebView::mediaStyle): (WebView::stringByEvaluatingJavaScriptFromString): (WebView::windowScriptObject): (WebView::setPreferences): (WebView::preferences): (WebView::setPreferencesIdentifier): (WebView::preferencesIdentifier): (WebView::setHostWindow): (WebView::hostWindow): (WebView::searchFor): (WebView::registerViewClass): (WebView::takeStringURLFrom): (WebView::stopLoading): (WebView::reload): (WebView::canGoBack): (WebView::canGoForward): (WebView::canMakeTextLarger): (WebView::makeTextLarger): (WebView::canMakeTextSmaller): (WebView::makeTextSmaller): (WebView::computedStyleForElement): (WebView::editableDOMRangeForPoint): (WebView::setSelectedDOMRange): (WebView::selectedDOMRange): (WebView::selectionAffinity): (WebView::setEditable): (WebView::isEditable): (WebView::setTypingStyle): (WebView::typingStyle): (WebView::setSmartInsertDeleteEnabled): (WebView::smartInsertDeleteEnabled): (WebView::setContinuousSpellCheckingEnabled): (WebView::isContinuousSpellCheckingEnabled): (WebView::spellCheckerDocumentTag): (WebView::undoManager): (WebView::setEditingDelegate): (WebView::editingDelegate): (WebView::styleDeclarationWithText): (WebView::replaceSelectionWithNode): (WebView::replaceSelectionWithText): (WebView::replaceSelectionWithMarkupString): (WebView::replaceSelectionWithArchive): (WebView::deleteSelection): (WebView::applyStyle): (WebView::copy): (WebView::cut): (WebView::paste): (WebView::copyFont): (WebView::pasteFont): (WebView::delete_): (WebView::pasteAsPlainText): (WebView::pasteAsRichText): (WebView::changeFont): (WebView::changeAttributes): (WebView::changeDocumentBackgroundColor): (WebView::changeColor): (WebView::alignCenter): (WebView::alignJustified): (WebView::alignLeft): (WebView::alignRight): (WebView::checkSpelling): (WebView::showGuessPanel): (WebView::performFindPanelAction): (WebView::startSpeaking): (WebView::stopSpeaking): (WebView::viewWindow): * COM/WebView.h: Added. * WebKit.vcproj: Added. * WebKit.vcproj/Interfaces.vcproj: Added. * WebKit.vcproj/WebKit.def: Added. * WebKit.vcproj/WebKit.rc: Added. * WebKit.vcproj/WebKit.sln: Added. * WebKit.vcproj/WebKit.vcproj: Added. * WebKit.vcproj/WebKitGUID.vcproj: Added. * WebKit.vcproj/autoversion.h: Added. * WebKit.vcproj/resource.h: Added. 2006-06-02 Darin Adler <darin@apple.com> * WebCoreSupport/WebImageRendererFactory.m: Fix crash on Safari startup by include NSObject as a superclass (oops!). 2006-06-01 Darin Adler <darin@apple.com> Reviewed by Maciej. - WebCore doesn't need to load WebKit images any more; removed code for that * Resources/missing_image.tiff: Removed. * WebCoreSupport/WebImageRendererFactory.h: Removed. * WebCoreSupport/WebImageRendererFactory.m: Moved @interface in here. Removed all but the "threaded decoding" calls that older Safari calls. This file can go altogether when compatibility with that older Safari is no longer needed. * WebKit.xcodeproj/project.pbxproj: Removed WebImageRendererFactory.h and missing_image.tiff. * WebView/WebFrameView.m: (-[WebFrameView initWithFrame:]): Removed call to [WebImageRendererFactory createSharedFactory]. 2006-06-01 Brady Eidson <beidson@apple.com> Reviewed by Maciej. Simple changes to hook up the new WebCore based Icon Database for testing. * ChangeLog: * Misc/WebIconDatabase.m: (-[WebIconDatabase _applicationWillTerminate:]): * Misc/WebIconDatabasePrivate.h: * WebKit.xcodeproj/project.pbxproj: 2006-06-01 Anders Carlsson <acarlsson@apple.com> Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=6309 multiple problems prevent bookmarking/back button technique for AJAX/DHTML applications from working * Misc/WebNSURLExtras.m: (-[NSString _webkit_URLFragment]): Don't include the "#" character in the fragment. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge historyURL:]): New function, returns the history URL for a given position in the back/forward list * WebView/WebFrame.m: (-[WebFrame _loadItem:withLoadType:]): Always call scrollToAnchorWithURL, even if there is no fragment. This way we keep the WebCore frame's URL up-to-date. 2006-06-01 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - fixed "REGRESSION: Can't order from Pizza Hut (ToT, 05/24/06)" http://bugs.webkit.org/show_bug.cgi?id=9103 * WebView/WebDataSource.m: (-[WebDataSource _willSendRequest:forResource:redirectResponse:]): Set up the User-Agent header. * WebView/WebDataSourceInternal.h: * WebView/WebLoader.m: (-[NSURLProtocol willSendRequest:redirectResponse:]): Pass a mutable URL request so the above can work. 2006-06-01 Anders Carlsson <acarlsson@apple.com> Reviewed by Darin. * WebView/WebFrameView.m: (+[WebFrameView _canShowMIMETypeAsHTML:]): Use _webkit_objectForMIMEType here so we'll get an object back for "text/". 2006-05-31 David Hyatt <hyatt@apple.com> Make programmatic focus/blur actually work on sub-frames. Make the top-level UI delegate get called for deactivation of windows. Reviewed by darin * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge activateWindow]): (-[WebFrameBridge deactivateWindow]): (-[WebFrameBridge loadURL:referrer:reload:userGesture:target:triggeringEvent:form:formValues:]): (-[WebFrameBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): * WebKit.xcodeproj/project.pbxproj: === WebKit-521.12 === 2006-05-26 David Harrison <harrison@apple.com> Reviewed by John Sullivan. <rdar://problem/4514529> Add a list type parameter and a return value to _increaseSelectionListLevel * WebView/WebHTMLView.m: (-[WebHTMLView _increaseSelectionListLevel]): - Now returns DOMNode* (-[WebHTMLView _increaseSelectionListLevelOrdered]): (-[WebHTMLView _increaseSelectionListLevelUnordered]): - Added. These also return DOMNode* * WebView/WebHTMLViewPrivate.h: - Updated as above 2006-05-25 Tim Omernick <timo@apple.com> Reviewed by Anders. <http://bugs.webkit.org/show_bug.cgi?id=8347> REGRESSION: Flash movie audible but not visible until window is resized * Plugins/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView dataSourceUpdated:]): Layout if needed here. Maciej recently removed the "LayoutAcceptable" frame state, which used to cause plugin document views to lay out immediately upon receiving data. This call to -layout has the same effect. === WebKit-521.11.1 === 2006-05-25 Timothy Hatcher <timothy@apple.com> Reviewed by Tim O. <rdar://problem/4559808> WebKit fails to compile for ppc64 <rdar://problem/4522085> 64-bit: WebKit uses FSSpec which is not available in 64-bit Gets WebKit building under 64-bit. Rename WebNSInt and WebNSUInt to WebNSInteger and WebNSUInteger. Start using WebNSInteger where we need to match AppKit API usage of NSInteger. HIWebView and a couple of helper functions are disabled until they can be moved off of QuickDraw. <rdar://problem/4561772> HIWebView needs to be reworked to not use QuickDraw, needed for 64-bit * Carbon/CarbonUtils.m: disabled this file in 64-bit <rdar://problem/4561772> * Carbon/CarbonWindowAdapter.m: (-[CarbonWindowAdapter initWithCarbonWindowRef:takingOwnership:disableOrdering:carbon:]): * Carbon/CarbonWindowFrame.m: (+[CarbonWindowFrame frameRectForContentRect:styleMask:]): (+[CarbonWindowFrame contentRectForFrameRect:styleMask:]): (+[CarbonWindowFrame minFrameSizeForMinContentSize:styleMask:]): (-[CarbonWindowFrame frameRectForContentRect:styleMask:]): (-[CarbonWindowFrame contentRectForFrameRect:styleMask:]): (-[CarbonWindowFrame minFrameSizeForMinContentSize:styleMask:]): * Carbon/HIViewAdapter.m: disabled this file in 64-bit <rdar://problem/4561772> * Carbon/HIWebView.m: disabled this file in 64-bit <rdar://problem/4561772> (HIWebViewEventHandler): * DefaultDelegates/WebDefaultResourceLoadDelegate.m: (-[WebDefaultResourceLoadDelegate webView:resource:didReceiveContentLength:fromDataSource:]): * History/WebBackForwardList.m: (-[WebBackForwardList removeItem:]): (-[WebBackForwardList goToItem:]): * Misc/WebDownload.m: (-[WebDownloadInternal download:didReceiveDataOfLength:]): * Misc/WebFileDatabase.m: (UniqueFilePathForKey): * Misc/WebIconDatabase.m: (-[NSMutableDictionary retainIconForURL:]): (-[NSMutableDictionary releaseIconForURL:]): (-[WebIconDatabase _totalRetainCountForIconURLString:]): (-[WebIconDatabase _retainIconForIconURLString:]): (-[WebIconDatabase _releaseIconForIconURLString:]): * Misc/WebSearchableTextView.m: (-[NSString selectionRect]): * Misc/WebTypesInternal.h: Added. * Plugins/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream _destroyStream]): (CarbonPathFromPOSIXPath): * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView sendActivateEvent:]): (-[WebBaseNetscapePluginView sendUpdateEvent]): (TSMEventHandler): (-[WebBaseNetscapePluginView _postURL:target:len:buf:file:notifyData:sendNotification:allowHeaders:]): (-[WebBaseNetscapePluginView _printedPluginBitmap]): (-[NSData _web_locationAfterFirstBlankLine]): * Plugins/WebBasePluginPackage.m: (-[WebBasePluginPackage hash]): * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): (functionPointerForTVector): * WebInspector/WebInspector.m: (-[WebInspector _updateSystemColors]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.m: (-[WebDataSource _didReceiveData:contentLength:forResource:]): * WebView/WebFrame.m: (-[WebFrame _sendRemainingDelegateMessagesWithIdentifier:response:length:error:]): * WebView/WebHTMLView.m: (-[WebHTMLView drawRect:]): (-[WebHTMLView characterIndexForPoint:]): (-[WebHTMLView conversationIdentifier]): * WebView/WebResourceLoadDelegate.h: * WebView/WebUIDelegate.h: * WebView/WebView.h: * WebView/WebView.m: (-[WebView _mouseDidMoveOverElement:modifierFlags:]): (-[WebView spellCheckerDocumentTag]): * WebView/WebViewInternal.h: * WebView/WebViewPrivate.h: === WebKit-521.11 === 2006-05-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Tim. - more loader refactoring to simplify things and remove knowledge of WebView from WebSubresourceLoader * WebCoreSupport/WebSubresourceLoader.m: (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forDataSource:]): (-[WebSubresourceLoader didReceiveResponse:]): * WebView/WebDataSource.m: (-[WebDataSource _loadIcon]): (-[WebDataSource _startLoading]): * WebView/WebFrame.m: (-[WebFrame _loadRequest:archive:]): (-[WebFrame _loadItem:withLoadType:]): (-[WebFrame _loadURL:referrer:loadType:target:triggeringEvent:form:formValues:]): (-[WebFrame _postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrame _addExtraFieldsToRequest:mainResource:alwaysFromRequest:]): * WebView/WebFrameInternal.h: * WebView/WebFramePrivate.h: * WebView/WebLoader.h: * WebView/WebLoader.m: * WebView/WebMainResourceLoader.m: (-[WebMainResourceLoader initWithDataSource:]): (-[WebMainResourceLoader didReceiveResponse:]): 2006-05-23 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. <rdar://problem/4558301> REGRESSION (420+): After clearing history and closing bookmark view window, attempting to select Safari's menu bar results in a crash * Misc/WebNSWindowExtras.m: (replacementPostWindowNeedsDisplay): My fix yesterday for 4557117 was not quite good enough. Now that we cancel the display timer for a window *before* it deallocates, we need to make sure that while a window deallocates, no new display timers are scheduled for that window. This is actually possible, as 4558301 demonstrates. Luckily, NSWindow sets a handy "windowDying" flag when it deallocates, so we can just check that flag and bail out of the throttle hack if it is set. This should fix the last of the crashes involving display timers scheduled for deallocated or deallocating windows. 2006-05-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. - remove knowledge of WebView from WebLoader in preparation for moving the code down * WebView/WebDataSource.m: (-[WebDataSource _defersCallbacks]): (-[WebDataSource _identifierForInitialRequest:]): (-[WebDataSource _willSendRequest:forResource:redirectResponse:]): (-[WebDataSource _didReceiveAuthenticationChallenge:forResource:]): (-[WebDataSource _didCancelAuthenticationChallenge:forResource:]): (-[WebDataSource _didReceiveResponse:forResource:]): (-[WebDataSource _didReceiveData:contentLength:forResource:]): (-[WebDataSource _didFinishLoadingForResource:]): (-[WebDataSource _didFailLoadingWithError:forResource:]): (-[WebDataSource _downloadWithLoadingConnection:request:response:proxy:]): (-[WebDataSource _privateBrowsingEnabled]): * WebView/WebDataSourceInternal.h: * WebView/WebLoader.h: * WebView/WebLoader.m: (-[WebLoader releaseResources]): (-[WebLoader setDataSource:]): (-[WebLoader willSendRequest:redirectResponse:]): (-[WebLoader didReceiveAuthenticationChallenge:]): (-[WebLoader didCancelAuthenticationChallenge:]): (-[WebLoader didReceiveResponse:]): (-[WebLoader didReceiveData:lengthReceived:]): (-[WebLoader signalFinish]): (-[WebLoader didFinishLoading]): (-[WebLoader didFailWithError:]): (-[WebLoader willCacheResponse:]): (-[WebLoader cancelWithError:]): * WebView/WebMainResourceLoader.m: (-[WebMainResourceLoader continueAfterContentPolicy:response:]): * WebView/WebView.m: (-[WebView _incrementProgressForIdentifier:response:]): (-[WebView _incrementProgressForIdentifier:data:]): (-[WebView _completeProgressForIdentifier:]): * WebView/WebViewInternal.h: === WebKit-521.10 === 2006-05-22 Tim Omernick <timo@apple.com> Reviewed by Geoff. <rdar://problem/4557117> TOT REGRESSION: Repro crash in cancelPendingWindowDisplay --> _timerRelease when opening file from file open dialog Note that I could not reproduce this situation at all on any of my machines; I had to debug this on Geoff's machine. * Misc/WebNSWindowExtras.m: (replacementDealloc): Cancel display timer before dealloc, not after. Cancelling the timer can cause a message to be sent to the window; best to do that before the window deallocates. (replacementFinalize): ditto 2006-05-20 Maciej Stachowiak <mjs@apple.com> Reviewed by Beth. - fix assertion failure on layout tests * WebView/WebDataSource.m: (-[WebDataSource _mainReceivedError:complete:]): Don't do anything if this data source is no longer connected to a frame. Used to be this couldn't happen because the WebView would have been nil, but we no longer go through the WebView. 2006-05-20 Timothy Hatcher <timothy@apple.com> Reviewed by Anders. Bug 9018: REGRESSION: resizing the top area of the inspector does not grow as expected http://bugs.webkit.org/show_bug.cgi?id=9018 Use clientHeight now that offsetHeight includes the border and padding. clientHeight should have been used initially. * WebInspector/WebInspector.m: (-[WebInspector resizeTopArea]): 2006-05-18 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. - remove loading-related code from WebView http://bugs.webkit.org/show_bug.cgi?id=8981 * Plugins/WebNetscapePluginStream.m: (-[WebNetscapePlugInStreamLoader didFinishLoading]): (-[WebNetscapePlugInStreamLoader didFailWithError:]): * WebCoreSupport/WebSubresourceLoader.m: (-[WebSubresourceLoader receivedError:]): (-[WebSubresourceLoader signalFinish]): * WebView/WebDataSource.m: (-[WebDataSource _stopLoading]): (-[WebDataSource _receivedMainResourceError:complete:]): (-[WebDataSource _finishedLoadingResource]): (-[WebDataSource _mainReceivedBytesSoFar:complete:]): (-[WebDataSource _receivedError:]): (-[WebDataSource _mainReceivedError:complete:]): * WebView/WebDataSourceInternal.h: * WebView/WebFrame.m: (-[WebFrame _sendRemainingDelegateMessagesWithIdentifier:response:length:error:]): * WebView/WebMainResourceLoader.m: (-[WebMainResourceLoader didReceiveData:lengthReceived:]): (-[WebMainResourceLoader didFinishLoading]): * WebView/WebView.m: * WebView/WebViewInternal.h: 2006-05-18 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. <rdar://problem/4551938> More options needed for window display throttle We decided to play it safe and leave our window flushing behavior unchanged from the previous public release. By default, CoreGraphics deferred updates are once again OFF, and the window display throttle is OFF. Individual applications should set the WebKitThrottleWindowDisplayPreferenceKey and WebKitEnableDeferredUpdatesPreferenceKey defaults to suit their needs. Old behavior (like 10.4.6): WebKitThrottleWindowDisplayPreferenceKey=0 (or unset), WebKitEnableDeferredUpdatesPreferenceKey (or unset). Tear-free scrolling/animations: WebKitThrottleWindowDisplayPreferenceKey=0 (or unset), WebKitEnableDeferredUpdatesPreferenceKey=1. While this configuration fixes the tearing issues caused by over-flushing, some applications will experience performance problems as over-flushing with CG deferred updates enabled will cause the app to block. Tear-free scrolling/animations, high performance: WebKitThrottleWindowDisplayPreferenceKey=1, WebKitEnableDeferredUpdatesPreferenceKey=1. This is the riskiest configuration in that it enables the window display throttle "feature", potentially breaking applications' assumptions about when displays occur. However, it provides the "best of both worlds", in that updates are tear-free, and performance impact should me minimal. * WebView/WebPreferenceKeysPrivate.h: Declared WebKitThrottleWindowDisplayPreferenceKey and WebKitEnableDeferredUpdatesPreferenceKey. * WebView/WebFrameView.m: (-[WebFrameView initWithFrame:]): Turn off CG deferred updates if WebKitEnableDeferredUpdatesPreferenceKey is NO or has no value. Added some comments. 2006-05-18 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. - fixed <rdar://problem/4552713> REGRESSION: WebFrameView no longer responds to responder methods sent by Safari code * WebView/WebView.m: (-[WebView _responderForResponderOperations]): Treat sibling views of the main frameView the same as views outside of the webview for the purposes of this mechanism. 2006-05-18 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. <rdar://problem/4553450> Make disabling window throttle safer * Misc/WebNSWindowExtras.m: (+[NSWindow _webkit_enableWindowDisplayThrottle]): Don't assume that +_webkit_disableWindowDisplayThrottle restored the NSWindow method implementations; now we'll only swizzle them once, and our replacement IMPs will call the old IMPs when the window throttle is disabled. This is a safer approach when other components/"haxies" override the same methods that we are overriding, as it allows the overrides to "chain" properly. Moved the dictionary initialization code down a bit. The order doesn't matter here. (disableWindowDisplayThrottleApplierFunction): Noticed that this could have been written safer with respect to the timer having the last reference to the window. I never experienced a crash here, but this code is definitely safer. (+[NSWindow _webkit_disableWindowDisplayThrottle]): Don't restore NSWindow method implementations; just clear the flag, flush pending displays, and destroy the dictionary. (replacementPostWindowNeedsDisplay): If throttling is disabled, just call the original IMP. (clearWindowDisplayInfo): Added an assert. (replacementDealloc): Don't call clearWindowDisplayInfo() when throttling is disabled. (replacementFinalize): ditto (cancelPendingWindowDisplay): Removed an unnecessary assertion. 2006-05-17 Tim Omernick <timo@apple.com> Reviewed by Kevin Decker and John Sullivan. <rdar://problem/4550801> REGRESSION: Window throttle code can sometimes leak NSWindows The window display throttle depended on windows being closed before they were deallocated; this is not guaranteed by AppKit. Windows that were being released without being closed were getting stuck in our NSWindow -> WindowDisplayInfo dictionary. * Misc/WebNSWindowExtras.m: (+[NSWindow _webkit_enableWindowDisplayThrottle]): Don't retain the NSWindow keys in the window display info dictionary. Instead of overriding -close, override -dealloc and -finalize so that we can remove the NSWindow -> WindowDisplayInfo mapping when a window deallocates. (+[NSWindow _webkit_disableWindowDisplayThrottle]): Restore -dealloc and -finalize. (clearWindowDisplayInfo): Factored the WindowDisplayInfo cleanup code out of the now-defunct replacementClose(). (replacementClose): Removed; no longer needed. (replacementDealloc): Clear the WindowDisplayInfo for the window after deallocation. (replacementFinalize): ditto (-[NSWindow _webkit_doPendingPostWindowNeedsDisplay:]): Rewrote this method to be safe in the case where the firing display timer has the last reference to the window. Added comments. 2006-05-17 bradeeoh <beidson@apple.com> Reviewed by Tim Hatcher Consolidated WebDatabase base class into WebFileDatabase as the inheritance relationship became obsolete. This improves readability and sets the stage for a further in-depth rewrite of the WebIcon* code. * Misc/WebDatabase.h: Removed. * Misc/WebDatabase.m: Removed. * Misc/WebFileDatabase.h: * Misc/WebFileDatabase.m: (-[WebFileDatabaseOp dealloc]): (-[WebFileDatabase dealloc]): (-[WebFileDatabase path]): (-[WebFileDatabase isOpen]): (-[WebFileDatabase sizeLimit]): * WebKit.xcodeproj/project.pbxproj: 2006-05-17 Adele Peterson <adele@apple.com> Reviewed by Hyatt. WebKit part of initial checkin to prepare for http://bugs.webkit.org/show_bug.cgi?id=8948 Switch to use new text field implementation for <textarea> * WebView/WebHTMLView.m: (-[WebHTMLView insertNewline:]): If we're in plain text mode, insert a line break instead of a paragraph separator. (-[WebHTMLView insertParagraphSeparator:]): ditto. * WebView/WebView.m: (-[WebView _menuForElement:defaultItems:]): Checks for textareas as well as textfields before allowing the delegate to control the context menu. This won't affect the old textareas because AppKit handles those context menus. 2006-05-17 John Sullivan <sullivan@apple.com> Reviewed by Maciej. First step towards making text-matching mechanism more flexible; updated for changes to WebCoreFrameBridge calls. * WebView/WebHTMLView.m: (-[WebHTMLView highlightAllMatchesForString:caseSensitive:]): updated for name change in WebCoreFrameBridge, also now calls setMarkedTextMatchesAreHighlighted: (-[WebHTMLView clearHighlightedMatches]): updated for name change in WebCoreFrameBridge 2006-05-16 Matt Gough <matt@softchaos.com> Reviewed by Geoff. Ensured all the public headers have a newline at their end. Client code can now have 'Missing Newline at end of File' warnings enabled without emitting such warnings against any WebKit includes. * Misc/WebDownload.h: * Plugins/npfunctions.h: * WebView/WebResourceLoadDelegate.h: * WebView/WebUIDelegate.h: * WebView/WebView.h: 2006-05-16 Tim Omernick <timo@apple.com> Reviewed by Tim Hatcher. http://bugs.webkit.org/show_bug.cgi?id=8945 (REGRESSION: Scrolling is very slow when dragging the thumb) Rolled out one of my tweaks to the window display throttle hack (remember the last flush time instead of the last display time). While that was technically a better approach, we discovered a problem with how it interacts with NSView scroll tracking. Rather than further complicate this already crazy hack, I'm reverting back to the simple version. This should yield similar numbers on iBench, but not exhibit the nasty scrolling problem. * Misc/WebNSWindowExtras.m: (+[NSWindow _webkit_enableWindowDisplayThrottle]): (+[NSWindow _webkit_disableWindowDisplayThrottle]): (getWindowDisplayInfo): (requestWindowDisplay): 2006-05-16 bradeeoh <beidson@apple.com> Reviewed by Maciej Stachowiak - Fixed an old deprecated method in Misc/WebFileDatabase.m * Misc/WebFileDatabase.m: (UniqueFilePathForKey): changed `lossyCString` to `UTF8String` 2006-05-16 Darin Adler <darin@apple.com> Reviewed by Anders. - did the name change from "ImageElement" to "ImageForElement" that I said I would (oops!) * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate copyImageToClipboard:]): * Misc/WebNSPasteboardExtras.h: * Misc/WebNSPasteboardExtras.m: (-[NSPasteboard _web_declareAndWriteDragImageForElement:URL:title:archive:source:]): * Misc/WebNSViewExtras.h: * Misc/WebNSViewExtras.m: (-[NSView _web_DragImageForElement:rect:event:pasteboard:source:offset:]): * WebView/WebHTMLView.m: (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): * WebView/WebView.m: (-[WebView _writeImageForElement:withPasteboardTypes:toPasteboard:]): (-[WebView writeElement:withPasteboardTypes:toPasteboard:]): * WebView/WebViewInternal.h: 2006-05-16 Darin Adler <darin@apple.com> Reviewed by Anders. - http://bugs.webkit.org/show_bug.cgi?id=8940 remove extra copy of image code * English.lproj/StringsNotToBeLocalized.txt: Updated for many recent changes. * WebKit.xcodeproj/project.pbxproj: Removed files. * WebCoreSupport/WebImageData.h: Removed. * WebCoreSupport/WebImageData.m: Removed. * WebCoreSupport/WebImageDecodeItem.h: Removed. * WebCoreSupport/WebImageDecodeItem.m: Removed. * WebCoreSupport/WebImageDecoder.h: Removed. * WebCoreSupport/WebImageDecoder.m: Removed. * WebCoreSupport/WebImageRenderer.h: Removed. * WebCoreSupport/WebImageRenderer.m: Removed. * WebCoreSupport/WebImageRendererFactory.h: * WebCoreSupport/WebImageRendererFactory.m: Removed everything except for shouldUseThreadedDecoding, setShouldUseThreadedDecoding, and imageDataForName:. * Misc/WebNSPasteboardExtras.h: Removed WebImageRenderer parameter from _web_declareAndWriteDragImage and renamed _web_declareAndWriteDragImageElement. * Misc/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeImage:element:URL:title:archive:types:]): Changed to call +[WebFrameBridge supportedImageResourceMIMETypes] instead of -[WebImageRendererFactory supportedMIMETypes]. (-[NSPasteboard _web_declareAndWriteDragImageElement:URL:title:archive:source:]): Removed WebImageRenderer parameter, and updated code since it was always nil. * Misc/WebNSViewExtras.h: Removed WebImageRenderer parameter from _web_dragImage and renamed _web_dragImageElement. * Misc/WebNSViewExtras.m: (-[NSView _web_dragImageElement:rect:event:pasteboard:source:offset:]): Removed WebImageRenderer parameter, and updated code since it was always nil. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Added some new functions now used by WebCore. * WebView/WebDataSource.m: (-[WebDataSource _documentFragmentWithArchive:]): Call +[WebFrameBridge supportedImageResourceMIMETypes] instead of -[WebImageRendererFactory supportedMIMETypes]. * WebView/WebFrameView.m: Removed include of WebImageRenderer.h. * WebView/WebHTMLRepresentation.m: (+[WebHTMLRepresentation supportedImageMIMETypes]): Removed call to +[WebImageRendererFactory createSharedFactory]. * WebView/WebHTMLView.m: (-[WebHTMLView _imageExistsAtPaths:]): Call +[WebFrameBridge supportedImageResourceMIMETypes] instead of -[WebImageRendererFactory supportedMIMETypes]. (-[WebHTMLView _documentFragmentWithPaths:]): Ditto. (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): Update to no longer pass nil for an image to _web_declareAndWriteDragImageElement and to _web_dragImageElement. (-[WebHTMLView dealloc]): Remove call to now-unneeded _reset. (-[WebHTMLView finalize]): Ditto. (-[WebHTMLView viewDidMoveToWindow]): Remove logic for calling _reset, including the inWindow boolean field. * WebView/WebHTMLViewInternal.h: Removed inWindow boolean. * WebView/WebHTMLViewPrivate.h: Removed _reset method. 2006-05-16 Darin Adler <darin@apple.com> Reviewed by Hyatt. - fix http://bugs.webkit.org/show_bug.cgi?id=8898 REGRESSION: Attempting to right-click image in own tab on website causes crash - fix http://bugs.webkit.org/show_bug.cgi?id=8919 REGRESSION: image could not be dragged, subsequent click-drag activity caused crash These fixes may become obsolete when Anders lands his standalone image viewer patch, but in my tree they are needed to make Copy Image work after the fix over on the WebCore side to avoid the crashes. * Misc/WebNSPasteboardExtras.h: Change _web_writeImage parameter to an NSImage. * Misc/WebNSPasteboardExtras.m: (-[NSPasteboard _web_writeImage:element:URL:title:archive:types:]): Change parameter to an NSImage instead of a WebImageRenderer. (-[NSPasteboard _web_declareAndWriteDragImage:element:URL:title:archive:source:]): Call -[WebImageRenderer image] to get an NSImage to pass to _web_writeImage. * WebView/WebView.m: (-[WebView _writeImageElement:withPasteboardTypes:toPasteboard:]): Get the image using WebElementImageKey if WebElementDOMNodeKey is nil. 2006-05-16 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. http://bugs.webkit.org/show_bug.cgi?id=8921 Use WebCore to render full-frame images * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge determineObjectFromMIMEType:URL:]): Remove WebImageView handling. (-[WebFrameBridge mainResourceURLResponse]): New function which returns the URL response for the main resource. This is used by the manual loading of images. (-[WebFrameBridge imageTitleForFilename:size:]): New function which returns a correctly translated image title given a filename and a size. * WebCoreSupport/WebImageRenderer.m: (-[WebImageRenderer _startOrContinueAnimationIfNecessary]): Remove WebImageView handling. * WebKit.xcodeproj/project.pbxproj: Remove WebImageRepresentation and WebImageView. * WebView/WebArchiver.h: * WebView/WebArchiver.m: (+[WebArchiver archiveMainResourceForFrame:]): New functions which returns a WebArchive with just the main resource, ignoring any subresources. * WebView/WebDataSource.m: (+[WebDataSource _repTypesAllowImageTypeOmission:]): Use MIME types from WebHTMLRepresentation instead of WebImageRepresentation. * WebView/WebFrameView.m: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): Use MIME types from WebHTMLRepresentation instead of WebImageRepresentation. (+[WebHTMLRepresentation supportedMIMETypes]): Create an array of image and non-image MIME Types. (+[WebHTMLRepresentation supportedNonImageMIMETypes]): (+[WebHTMLRepresentation supportedImageMIMETypes]): New functions, separating the list of MIME types into image and non-image ones. * WebView/WebHTMLView.m: (+[WebHTMLView supportedImageMIMETypes]): (+[WebHTMLView supportedNonImageMIMETypes]): New functions which call down to WebHTMLRepresentation. (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): If the image element comes from an ImageDocument, just use an archive of the main resource instead of the generated HTML document. * WebView/WebHTMLViewPrivate.h: Declare new functions. * WebView/WebImageRepresentation.h: Removed. * WebView/WebImageRepresentation.m: Removed. * WebView/WebImageView.h: Removed. * WebView/WebImageView.m: Removed. 2006-05-15 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API Added to the Netscape Plugin API the concept of "plugin drawing models". The drawing model determines the kind of graphics context created by the browser for the plugin, as well as the Mac types of various Netscape Plugin API data structures. There is a drawing model to represent the old QuickDraw-based API. It is used by default if QuickDraw is available on the system, unless the plugin specifies another drawing model. The big change is the addition of the CoreGraphics drawing model. A plugin may request this drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr. * Plugins/WebBaseNetscapePluginView.h: Added PluginPort union, which wraps a NP_Port and a NP_CGContext. This is to make access to the nPort and lastSetPort ivars more convenient now that the port type differs based on the drawing model. Changed types of nPort and lastSetPort to PluginPort so they can be used with any drawing model. Added drawingModel ivar. * Plugins/WebBaseNetscapePluginView.m: Renamed PortState to PortState_QD. PortState is now an opaque pointer. PortState_QD cannot be used if QuickDraw is unavailable. (-[WebBaseNetscapePluginView fixWindowPort]): Cannot be used if QuickDraw is unavailable. (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): Only fix window port if drawing model is QuickDraw. Re-ordered some code so I could group QuickDraw-specific stuff into switch and if blocks (that's why the diff here is so terrible). Now returns a malloc()'ed PortState that the caller is responsible for freeing. Renamed to better reflect this behavior. Support for the CoreGraphics drawing model -- fill PortState_CG struct, save CGContext state. (-[WebBaseNetscapePluginView restorePortState:]): Switch based on drawing model. Support for the CoreGraphics drawing model -- restore CGContext state saved earlier. (-[WebBaseNetscapePluginView sendEvent:]): Formatting. Don't set save/set port state or set the window in CoreGraphics mode unless the event being sent is an updateEvt. We can't provide the plugin with a CGContext outside of our view display cycle. Don't restore PortState if it's NULL (didn't used to be a pointer). Free when we're done with it. (-[WebBaseNetscapePluginView isNewWindowEqualToOldWindow]): Formatting. Switch how we compare ports based on the drawing model. (-[WebBaseNetscapePluginView updateAndSetWindow]): Fixed for CoreGraphics by triggering a redisplay instead of sending an update event to the plugin outside of the view display cycle. Don't restore PortState if it's NULL (didn't used to be a pointer). Free when we're done with it. (-[WebBaseNetscapePluginView setWindowIfNecessary]): Assert that the window is only set when updating in CoreGraphics mode. Log differently depending on the drawing model. (-[WebBaseNetscapePluginView start]): Fall back on QuickDraw if the plugin does not specify a drawing model. (-[WebBaseNetscapePluginView tellQuickTimeToChill]): Cannot be used if QuickDraw is unavailable. (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): Only call -tellQuickTimeToChill in QuickDraw mode. (-[WebBaseNetscapePluginView viewHasMoved:]): ditto (-[WebBaseNetscapePluginView invalidateRegion:]): NPRegion is a CGPathRef in CoreGraphics mode. (-[WebBaseNetscapePluginView getVariable:value:]): Added support for retriveing the NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool browser variables. (-[WebBaseNetscapePluginView setVariable:value:]): Added support for setting the NPNVpluginDrawingModel variable. 2006-05-15 Tim Omernick <timo@apple.com> Reviewed by Kevin Decker. Follow-up to my previous PLT fix. I found upon further testing (by dramatically decreasing the allowed display rate) that +_webkit_displayThrottledWindows did not always force a display when necessary. The reason is that I was not giving a proper timeout to CFRunLoopRunInMode(). I was passing 0, which was causing only "expired" timers to fire. This method is actually supposed to block until all currently scheduled display timers fire. I tested this change and found that it did not affect my PLT times when the display rate was capped to 60 fps. It also behaves as expected when the display rate is set much lower (say, 1 display per second); my previous fix did not work well at such display rates. * Misc/WebNSWindowExtras.m: (+[NSWindow _webkit_displayThrottledWindows]): Run the runloop for an amount of time equal to the minimum allowed interval between displays. This ensures that we'll block until all currently scheduled display timers fire (but we won't block for future display timers). 2006-05-15 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - followup to previous fix; I hadn't tested quitting adequately * WebView/WebHTMLView.m: (-[WebHTMLView dealloc]): call removeAllToolTips before clearing _private so that removeTrackingRect: override can work properly. Normally removeAllToolTips would be called by super, but that's too late. (-[WebHTMLView finalize]): ditto 2006-05-15 John Sullivan <sullivan@apple.com> Reviewed by Darin. - fixed <rdar://problem/4503016> TOT assertion failure in -[WebHTMLView(WebPrivate) removeTrackingRect:] We have some tricky code to deal with tracking rects, which succumbed to a fix in AppKit. Updated our tricky code to work with the AppKit fix. * WebView/WebHTMLViewInternal.h: new instance variable lastToolTipTag * WebView/WebHTMLView.m: (-[WebHTMLView removeTrackingRect:]): handle removing lastToolTipTag by calling super (-[WebHTMLView _setToolTip:]): save tool tip tag in lastToolTipTag; this apparently used to always return 0, so we formerly had no way to distinguish it from the no-tool-tips-yet case. * WebKit.xcodeproj/project.pbxproj: Xcode removed some old cruft 2006-05-15 Tim Omernick <timo@apple.com> Reviewed by Darin. Safari's Page Load Test (PLT) saturates the runloop with so many sources that timers are not allowed to fire as frequently as they should. This is a general problem with the PLT -- because of this, it does not measure work done in timer callbacks during/after the page load process. Unfortunately, this aspect of the PLT interferes with our window display throttle hack. Because we throttle display using timers, and the PLT starves timers, most of the pages loaded by the PLT do not actually display. This makes the PLT run "too fast", yielding ridiculously fast numbers compared to when throttling is disabled. I've added a new method that the PLT can call after each page load to force any starved display throttle timers to fire. By doing this, Safari's PLT will be guaranteed to display each page at least once. * Misc/WebNSWindowExtras.h: * Misc/WebNSWindowExtras.m: Added a special internal runloop mode for the throttle timers. (+[NSWindow _webkit_displayThrottledWindows]): Run the runloop in our special internal mode until there are no more sources to handle. (requestWindowDisplay): Schedule the timer in the new mode as well as the standard modes. 2006-05-15 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. http://bugs.webkit.org/show_bug.cgi?id=8913 REGRESSION: Can view source for text files * WebView/WebDocumentPrivate.h: Add canSaveAsWebArchive. * WebView/WebHTMLRepresentation.m: (-[WebHTMLRepresentation canProvideDocumentSource]): Call the bridge. (-[WebHTMLRepresentation canSaveAsWebArchive]): New function. This will be used in Safari ToT to determine if a page can be saved as an archive. 2006-05-14 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=8739 Crash in RenderTableSection::paint due to manipulating DOM on resize Manual test: manual-tests/dom-manipulation-on-resize.html * WebView/WebHTMLView.m: (-[WebHTMLView layoutToMinimumPageWidth:maximumPageWidth:adjustingViewSize:]): Relayout if necessary after sending the resize event. 2006-05-12 Maciej Stachowiak <mjs@apple.com> Reviewed by Brady. http://bugs.webkit.org/show_bug.cgi?id=8876 - move most private WebDataSource methods to uninstalled header I put the declarations for the ones only used in WebKit in WebDataSourceInternal.h and removed two entirey unused ones. * Plugins/WebNetscapePluginRepresentation.m: * Plugins/WebNetscapePluginStream.m: * Plugins/WebPluginController.m: * Plugins/WebPluginDocumentView.m: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge dataSource]): * WebCoreSupport/WebSubresourceLoader.m: * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.m: (-[WebDataSource _updateIconDatabaseWithURL:]): (-[WebDataSource _loadIcon]): (-[WebDataSource _clearErrors]): (-[WebDataSource _commitLoadWithData:]): (-[WebDataSource _doesProgressiveLoadWithMIMEType:]): (-[WebDataSource _addResponse:]): * WebView/WebDataSourceInternal.h: Added. * WebView/WebDataSourcePrivate.h: * WebView/WebFrame.m: * WebView/WebHTMLRepresentation.m: * WebView/WebHTMLView.m: * WebView/WebImageView.m: * WebView/WebLoader.m: * WebView/WebMainResourceLoader.m: * WebView/WebPDFView.m: * WebView/WebRenderNode.m: * WebView/WebView.m: 2006-05-12 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. <rdar://problem/4542808> REGRESSION: benchjs test 1 has slowed by over 150% (8740) <http://bugs.webkit.org/show_bug.cgi?id=8740> Improvement to my NSWindow display throttle hack. Remember the last flush time instead of the last display time. Our goal is to never draw less than 1/60th of a second after the window is flushed in order to avoid blocking on a CG coalesced update. Using the last display time is close, but this is much more accurate. I have verified that this further improves our score on BenchJS Test 1 (by 9.8% with the status bar shown compared to the previous build), as well as on our internal PLT scores by a smaller percentage. * Misc/WebNSWindowExtras.m: Renamed lastDisplayTime to lastFlushTime. (+[NSWindow _webkit_enableWindowDisplayThrottle]): Replace -[NSWindow flushWindow] with our own implementation. (+[NSWindow _webkit_disableWindowDisplayThrottle]): Restore -[NSWindow flushWindow]. (replacementFlushWindow): Use the last flush time instead of the last display time. (getWindowDisplayInfo): Renamed lastDisplayTime to lastFlushTime. (requestWindowDisplay): Moved some code to replacementFlushWindow(). 2006-05-11 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. Bug 8856: Web Inspector should show the Xpath for the selected node http://bugs.webkit.org/show_bug.cgi?id=8856 Adds an Xpath area to the Node panel. * WebInspector/webInspector/inspector.css: * WebInspector/webInspector/inspector.html: * WebInspector/webInspector/inspector.js: 2006-05-11 Timothy Hatcher <timothy@apple.com> Reviewed by Anders. Fixes <rdar://problem/4411845> lots of SPOD trying to scroll through Markup & Content inspecting body at apple.com (6614) http://bugs.webkit.org/show_bug.cgi?id=6614 Removed the Markup & Content pane when viewing a element. This pane was not that useful and made the inspector really slow when the markup was large. Only show this pane for text nodes. * WebInspector/webInspector/inspector.css: use -webkit prefix * WebInspector/webInspector/inspector.html: * WebInspector/webInspector/inspector.js: 2006-05-11 Sam Weinig <sam.weinig@gmail.com> Reviewed by Timothy. Patch for <http://bugs.webkit.org/show_bug.cgi?id=8810> Bug 8810: Scrollbars in WebInspector rendered incorrectly * WebInspector/webInspector/inspector.css: Make scroll bars absolutely positioned. 2006-05-10 Tim Omernick <timo@apple.com> Reviewed by Darin. <rdar://problem/4542808> REGRESSION: benchjs test 1 has slowed by over 150% (8740) <http://bugs.webkit.org/show_bug.cgi?id=8740> * Misc/WebNSWindowExtras.h: * Misc/WebNSWindowExtras.m: (+[NSWindow _webkit_enableWindowDisplayThrottle]): Overrides certain NSWindow methods so that window autodisplay can be throttled to 60Hz. (disableWindowDisplayThrottleApplierFunction): CFDictionary applier function for when the throttle is disabled. Cancels all pending window displays, and calls -displayIfNeeded on each window with a pending display. (+[NSWindow _webkit_disableWindowDisplayThrottle]): Restores default NSWindow method implementations and clears pending window displays. (swizzleInstanceMethod): Helper function to swizzle ObjC method implementations. (replacementPostWindowNeedsDisplay): Don't call into -[NSWindow _postWindowNeedsDisplay] if requestWindowDisplay() returns NO (this is the function that throttles display). (replacementClose): Clean up the WindowDisplayInfo struct for the window, since it's about to go away. (getWindowDisplayInfo): Gets the WindowDisplayInfo struct for the window, or creates it if absent. (requestWindowDisplay): Returns YES if a display is allowed right now. Returns NO otherwise, and schedules a timer to try the display again. (cancelPendingWindowDisplay): Cancels the pending display for the window, if any. (-[NSWindow _webkit_doPendingPostWindowNeedsDisplay:]): Try to call _postWindowNeedsDisplay again. * WebView/WebFrameView.m: (-[WebFrameView initWithFrame:]): If the secret "WebKitThrottleWindowDisplay" default is set, then enable the NSWindow throttle. 2006-05-10 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. * WebView/WebHTMLView.m: (+[WebHTMLView unsupportedTextMIMETypes]): Add text/rtf 2006-05-09 Levi Weintraub <lweintraub@apple.com> Reviewed by justin. <rdar://problem/4442395> Tiny MCE: Link isn't inserted after dragging into textarea field * WebView/WebHTMLView.m: (-[WebHTMLView _documentFragmentFromPasteboard:allowPlainText:chosePlainText:]): Modified to create an anchor object with a title as opposed to just the URL as text. 2006-05-09 Tim Omernick <timo@apple.com> Reviewed by Dave Harrison. <rdar://problem/4523432> safari crashed right after disabling "block pop up windows" (or other WebPreferences changes) * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView viewWillMoveToHostWindow:]): When the plugin view is removed from both its window and its hostWindow, stop observing WebPreferences. 2006-05-09 Anders Carlsson <acarlsson@apple.com> Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=8808 WebCore should handle text files * WebKit.exp: Remove WebTextView. * WebKit.xcodeproj/project.pbxproj: Get rid of WebTextView and WebTextRepresentation. * WebView/WebDataSource.m: (+[WebDataSource _repTypesAllowImageTypeOmission:]): * WebView/WebFrameView.m: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): * WebView/WebHTMLView.m: The text MIME types are now handled by WebHTMLView. (+[WebHTMLView unsupportedTextMIMETypes]): New function, moved here from WebTextView. * WebView/WebHTMLViewPrivate.h: * WebView/WebTextRepresentation.h: Removed. * WebView/WebTextRepresentation.m: Removed. * WebView/WebTextView.h: Removed. * WebView/WebTextView.m: Removed. * WebView/WebView.m: (+[WebView _viewClass:andRepresentationClass:forMIMEType:]): Now special-case WebHTMLView instead of WebTextView for MIME types that shouldn't be shown. 2006-05-09 Maciej Stachowiak <mjs@apple.com> Rubber stamped by Anders. - renamed kxmlcore to wtf kxmlcore --> wtf KXMLCore --> WTF KXC --> WTF * Misc/WebKitLogging.h: * Misc/WebKitLogging.m: (initializeLogChannel): 2006-05-09 Timothy Hatcher <timothy@apple.com> Reviewed by Anders. Bug 8804: Inspector should support searching by Xpath query http://bugs.webkit.org/show_bug.cgi?id=8804 * WebInspector/WebInspector.m: (-[WebInspector _refreshSearch]): * WebInspector/webInspector/inspector.js: 2006-05-08 Maciej Stachowiak <mjs@apple.com> Reviewed by Tim Hatcher. - refactor things so that WebKit doesn't save a WebResource for every loaded URL, but rather retrieves the data from the WebCore cache as needed. http://bugs.webkit.org/show_bug.cgi?id=8802 * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge objectLoadedFromCacheWithURL:response:data:]): (-[WebFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): * WebCoreSupport/WebSubresourceLoader.m: (-[WebSubresourceLoader didReceiveResponse:]): * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _setupForReplaceByMIMEType:]): (-[WebDataSource _archivedSubresourceForURL:]): (-[WebDataSource initWithRequest:]): (-[WebDataSource subresources]): (-[WebDataSource subresourceForURL:]): (-[WebDataSource addSubresource:]): * WebView/WebDataSourcePrivate.h: * WebView/WebFrame.m: * WebView/WebFrameInternal.h: * WebView/WebHTMLView.m: * WebView/WebLoader.h: * WebView/WebLoader.m: (-[NSURLProtocol loadWithRequest:]): (-[NSURLProtocol didFinishLoading]): * WebView/WebUnarchivingState.h: * WebView/WebUnarchivingState.m: (-[WebUnarchivingState addResource:]): 2006-05-04 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=8594 REGRESSION: Exception on closing a page containing (just) an mp3 Test: plugins/pluginDocumentView-deallocated-dataSource.html * Plugins/WebPluginDocumentView.m: (-[WebPluginDocumentView dealloc]): Release the dataSource. (-[WebPluginDocumentView setDataSource:]): Retain the dataSource. 2006-05-04 Tim Omernick <timo@apple.com> Reviewed by Darin. <rdar://problem/4537606> Give Java WebKit plugin access to its own DOM element * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:DOMElement:]): Pass the DOMElement to the plugin if it's a WebKit plugin (we need to handle Netscape plugins differently). 2006-05-04 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. <rdar://problem/4480186> Give WebKit plugins access to their own DOM element This does not fix <rdar://problem/4480187> Give Netscape plugins access to their own DOM element -- we're not going to use the ObjC DOM API for that, but rather the NP bindings API. * Plugins/WebPluginPackage.m: Declared WebPlugInContainingElementKey. This is not a new plugin argument -- it's been in our public headers since all along, but has never been concretely declared -- plugins that referenced it would not link. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:DOMElement:]): Added DOMElement parameter, which is now included in the plugin arguments dictionary. (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:DOMElement:]): ditto * WebKit.exp: Export WebPlugInContainingElementKey. 2006-05-02 Darin Adler <darin@apple.com> Reviewed by Eric. - http://bugs.webkit.org/show_bug.cgi?id=8677 REGRESSION: wkSetUpFontCache() may be called before the SPIs are connected. I don't know how reproduce this without one of Rosyna's hacks installed, so I did not include a test. * Misc/WebStringTruncator.m: (+[WebStringTruncator initialize]): Add call to InitWebCoreSystemInterface. * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): Add a boolean so we will only do this one time. 2006-05-02 Adele Peterson <adele@apple.com> Reviewed by Tim O. - fix http://bugs.webkit.org/show_bug.cgi?id=6988 REGRESSION: Display correct context menus for new text fields * WebView/WebView.m: (-[WebView _menuForElement:defaultItems:]): Don't let the UI delegate have control over the context menu for text fields. 2006-05-01 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=8658 Assertion failure in -[WebPluginContainerCheck _isForbiddenFileLoad] (bridge is null) when clicking QuickTime object with href * WebView/WebHTMLView.m: (-[WebHTMLView setDataSource:]): Set the pluginController's dataSource. 2006-05-01 Maciej Stachowiak <mjs@apple.com> - fix build * WebKit.exp: Add symbol that the new Safari will need. 2006-05-01 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - fixed <rdar://problem/3126419> history load enforces history limit, but deletes the newest instead of oldest items - added notification reporting items discarded during load because the age limit or item count limit is exceeded - a few other minor tweaks * History/WebHistory.h: fixed a typo and an incorrect method name * History/WebHistoryPrivate.h: Added declaration of WebHistoryItemsDiscardedWhileLoadingNotification. Also changed signature of WebHistoryPrivate method -loadFromURL:error: to have new collectDiscardedItemsInto: parameter. Also deleted declarations of two methods that didn't actually exist (loadHistory and initWithFile:), and added comments about which methods should become public API, WebKit-internal, or file-internal. * History/WebHistory.m: (-[WebHistoryPrivate arrayRepresentation]): This method, called only by _saveHistoryGuts:, used to deliberately leave out items that violated either the age limit or the item count limit. Now all the items are included (and thus saved), and all the pruning is done at load time, so clients can keep track of the pruned items by observing the new WebHistoryItemsDiscardedWhileLoadingNotification (-[WebHistoryPrivate _loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]): Now keeps track of all the items that violated the age limit or item count limit in the new collectedDiscardedItemsInto: parameter. Also, now processes items in forward order rather than reverse order to fix 3126419. Now uses compare: rather than _webkit_compareDay: to check against age limit; this is faster and also more correct (most noticeable with small age limits). (-[WebHistoryPrivate loadFromURL:collectDiscardedItemsInto:error:]): new collectDiscardedItemsInto: parameter, passed into _loadHistoryGuts:... (-[WebHistory loadFromURL:error:]): Now sends new WebHistoryItemsDiscardedWhileLoadingNotification if any items were discarded due to age limit or item count limit. * WebKit.exp: exported symbol for WebHistoryItemsDiscardedWhileLoadingNotification 2006-04-29 Timothy Hatcher <timothy@apple.com> Reviewed by Maciej. Bug 8577: [TabBarView _web_superviewOfClass:stoppingAtClass:] http://bugs.webkit.org/show_bug.cgi?id=8577 Added back _web_superviewOfClass:stoppingAtClass:. This method was removed in r14032 (bug 8562), but Safari 2.0 still uses it. We should remove this method once Open Source users have a new version to use with TOT WebKit. * Misc/WebNSViewExtras.m: (-[NSView _web_superviewOfClass:stoppingAtClass:]): 2006-04-28 David Hyatt <hyatt@apple.com> Double the cache size to account for our revised (more accurate) measurement of the image buffers. Reviewed by darin * WebView/WebPreferences.m: (+[WebPreferences initialize]): 2006-04-28 David Hyatt <hyatt@apple.com> Fix for 8586, move WebTextRenderer into WebCore. Reviewed by darin * Misc/WebKitNSStringExtras.m: (-[NSString _web_drawAtPoint:font:textColor:]): (-[NSString _web_widthWithFont:]): * Misc/WebStringTruncator.m: (+[WebStringTruncator centerTruncateString:toWidth:]): (+[WebStringTruncator centerTruncateString:toWidth:withFont:]): (+[WebStringTruncator rightTruncateString:toWidth:withFont:]): (+[WebStringTruncator widthOfString:font:]): * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface): * WebCoreSupport/WebTextRenderer.h: Removed. * WebCoreSupport/WebTextRenderer.m: Removed. * WebCoreSupport/WebTextRendererFactory.h: Removed. * WebCoreSupport/WebTextRendererFactory.m: Removed. * WebKit.xcodeproj/project.pbxproj: * WebView/WebFrameView.m: (-[WebFrameView initWithFrame:]): * WebView/WebHTMLView.m: (-[WebHTMLView _addToStyle:fontA:fontB:]): * WebView/WebTextView.m: (-[WebTextView setFixedWidthFont]): * WebView/WebView.m: (+[WebView _setAlwaysUseATSU:]): (+[WebView _setShouldUseFontSmoothing:]): (+[WebView _shouldUseFontSmoothing]): 2006-04-28 Eric Seidel <eseidel@apple.com> Reviewed by darin. Misc. style cleanup. http://bugs.webkit.org/show_bug.cgi?id=8643 * Misc/WebIconDatabase.m: (-[NSMutableDictionary iconForURL:withSize:cache:]): (-[NSMutableDictionary iconURLForURL:]): (-[NSMutableDictionary retainIconForURL:]): (-[NSMutableDictionary releaseIconForURL:]): (-[WebIconDatabase _setIcon:forIconURL:]): (-[WebIconDatabase _iconsForIconURLString:]): (-[WebIconDatabase _forgetIconForIconURLString:]): (-[WebIconDatabase _releaseIconForIconURLString:]): (-[WebIconDatabase _iconsBySplittingRepresentationsOfIcon:]): * Plugins/WebBasePluginPackage.m: (+[WebBasePluginPackage pluginWithPath:]): (-[WebBasePluginPackage pathByResolvingSymlinksAndAliasesInPath:]): (-[WebBasePluginPackage initWithPath:]): (-[WebBasePluginPackage getPluginInfoFromBundleAndMIMEDictionary:]): (-[WebBasePluginPackage pListForPath:createFile:]): (-[WebBasePluginPackage getPluginInfoFromPLists]): (-[WebBasePluginPackage load]): (-[WebBasePluginPackage setMIMEToExtensionsDictionary:]): (-[WebBasePluginPackage isNativeLibraryData:]): (-[NSArray _web_lowercaseStrings]): * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage openResourceFile]): (-[WebNetscapePluginPackage closeResourceFile:]): (-[WebNetscapePluginPackage stringForStringListID:andIndex:]): (-[WebNetscapePluginPackage getPluginInfoFromResources]): (-[WebNetscapePluginPackage initWithPath:]): (-[WebNetscapePluginPackage executableType]): (-[WebNetscapePluginPackage unloadWithoutShutdown]): (-[WebNetscapePluginPackage load]): (-[WebNetscapePluginPackage unload]): * Plugins/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation redeliverStream]): * Plugins/WebPluginDatabase.m: (+[WebPluginDatabase installedPlugins]): (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): (-[WebPluginDatabase pluginForExtension:]): (pluginLocations): (-[WebPluginDatabase init]): (-[WebPluginDatabase refresh]): * Plugins/npapi.m: (NPN_MemAlloc): (NPN_MemFree): (pluginViewForInstance): * WebCoreSupport/WebSubresourceLoader.m: (+[WebSubresourceLoader startLoadingResource:withRequest:customHeaders:referrer:forDataSource:]): (-[WebSubresourceLoader willSendRequest:redirectResponse:]): * WebView/WebDataSource.m: (-[WebDataSource isLoading]): * WebView/WebFrame.m: (-[WebFrame _loadDataSource:withLoadType:formState:]): (-[WebFrame _subframeIsLoading]): * WebView/WebView.m: (-[WebView initWithFrame:]): (-[WebView initWithFrame:frameName:groupName:]): 2006-04-26 Tim Omernick <timo@apple.com> Reviewed by Geoff. <rdar://problem/4525105> Repro TOT crash in [WebBaseNetscapePluginView dealloc] at coachella.com <http://bugs.webkit.org/show_bug.cgi?id=8564> crashed when closing a tab * WebView/WebFrame.m: (-[WebFramePrivate dealloc]): Assert that plugInViews has been released. (-[WebFrame _addPlugInView:]): New method. Adds the plug-in view to the plugInViews set and calls -setWebFrame: on it. (-[WebFrame _removeAllPlugInViews]): New method. Calls -setWebFrame:nil on all plug-in views and releases the plugInViews set. (-[WebFrame _willCloseURL]): New method. Dispose of plug-in views when leaving a page (or closing the WebView). * WebView/WebFrameInternal.h: Declared -_addPlugInView:, -_removeAllPlugInViews, -_willCloseURL * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:]): Call -[WebFrame _addPlugInView:] instead of directly setting plug-in views' frames. This allows us to keep track of them so that we can explicitly dispose of them when leaving the page. (-[WebFrameBridge closeURL]): Override -[WebCoreFrameBridge closeURL] so that we can perform our own teardown when leaving a page or closing the WebView. * Plugins/WebBaseNetscapePluginView.h: Declared -stop so that subclass WebNetscapePluginEmbeddedView can call it. * Plugins/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView setWebFrame:]): Stop the plug-in when it is removed from its WebFrame. 2006-04-25 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. <rdar://problem/4472035> SPI that checks for URL policy fails in plugin documents * Plugins/WebPluginController.h: * Plugins/WebPluginController.m: (-[WebPluginController URLPolicyCheckReferrer]): New method. Get the referrer from the frame's data source's NSURLResponse. Note that for document types loaded by WebCore, this URL is the same as -[WebCorePageBridge referrer], since the response URL is what we pass to -[WebCorePageBridge openURL:]. * Plugins/WebPluginContainerCheck.m: (-[WebPluginContainerCheck _isForbiddenFileLoad]): Use the WebPluginController's -URLPolicyCheckReferrer instead of assuming that the bridge's -referrer is valid. -[WebCorePageBridge referrer] is only set during the normal WebCore page load process, which has nothing to do with loading standalone plugin documents. 2006-04-25 Tim Omernick <timo@apple.com> Reviewed by Eric. <rdar://problem/4526052> intermittent assertion failure in -[WebBasePluginPackage dealloc] running layout tests * Plugins/WebPluginPackage.m: (-[WebPluginPackage unload]): Clear isLoaded here. It turns out that only WebNetscapePluginPackage cleared its isLoaded flag in -unload. We need to also do it here, because the superclass (WebBasePluginPackage) asserts in -dealloc that -unload has been called. 2006-04-25 Tim Omernick <timo@apple.com> Reviewed by Eric. <rdar://problem/4526120> -[WebBasePluginPackage finalize] leaks the CFBundle (under GC only) * Plugins/WebBasePluginPackage.m: (-[WebBasePluginPackage finalize]): Release the CFBundle here. 2006-04-25 Tim Omernick <timo@apple.com> Reviewed by Geoff. <rdar://problem/4472037> Private extensions to the WebPlugin interface. A plugin may implement these methods to receive loading callbacks for its main resource. Plug-ins that implement this SPI show better loading progress in the browser, can be saved to disk, and are more efficient by avoiding making duplicate GET or POST requests for the plug-in's main resource. I want to provide a solid API for plug-in networking, but time constraints require that I first provide this simple SPI for internal clients. * Plugins/WebPluginViewFactoryPrivate.h: Added a new plugin argument, WebPlugInShouldLoadMainResourceKey. If YES, the plugin is responsible for loading its own content. If NO, the plugin should wait for WebKit to send it the data via the new request-sharing SPI. * Plugins/WebPluginPrivate.h: Added. Request-sharing SPI. See comments in code. * Plugins/WebPluginDocumentView.h: Hang onto the plugin view as an ivar so we can call the new resource loading methods on it. * Plugins/WebPluginDocumentView.m: (-[WebPluginDocumentView dealloc]): Release pluginView ivar. (-[WebPluginDocumentView setDataSource:]): Pass NO for WebPlugInShouldLoadMainResourceKey to indicate to the plugin that it should not load its own main resource -- the data will come from WebKit. This is only necessary for plugin documents. By the time we create the view for a plugin document, we already have fetched some of its main resource's data. Embedded plugins do not have this issue because WebKit is not involved in loading their content. Call -webPlugInMainResourceDidReceivResponse: on the plugin if necessary. This lets the plugin know how much and what kind of data is going to be received. (-[WebPluginDocumentView dataSourceUpdated:]): If the plugin implements the new request-sharing SPI, don't cancel the in-progress request. (-[WebPluginDocumentView receivedData:withDataSource:]): Forward to the plugin via the new request-sharing SPI. (-[WebPluginDocumentView receivedError:withDataSource:]): ditto (-[WebPluginDocumentView finishedLoadingWithDataSource:]): ditto * Plugins/WebPluginPackage.m: Added WebPlugInShouldLoadMainResourceKey, tweaked some style a bit. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge pluginViewWithPackage:attributeNames:attributeValues:baseURL:]): Pass YES for WebPlugInShouldLoadMainResourceKey. Embedded plugins must load their own data. (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:]): ditto * WebKit.xcodeproj/project.pbxproj: Added WebPluginPrivate.h 2006-04-24 Maciej Stachowiak <mjs@apple.com> Reviewed by Geoff. <rdar://problem/4525364> REGRESSION (yesterday?): LOG() mechanism is broken - initialize WebKit's log channels * Misc/WebKitLogging.h: * Misc/WebKitLogging.m: (initializeLogChannel): (WebKitInitializeLoggingChannelsIfNecessary): * WebView/WebPreferences.m: (+[WebPreferences initialize]): * WebView/WebView.m: (-[WebView _commonInitializationWithFrameName:groupName:]): 2006-04-24 Maciej Stachowiak <mjs@apple.com> Build fix: - move some prematurely moved code back * WebCoreSupport/WebFrameBridge.h: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge fini]): (-[WebFrameBridge _preferences]): (-[WebFrameBridge _retrieveKeyboardUIModeFromPreferences:]): (-[WebFrameBridge keyboardUIMode]): 2006-04-24 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - move more code from WebFrameBridge to WebCoreFrameBridge * WebCoreSupport/WebFrameBridge.h: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge fini]): (-[WebFrameBridge expiresTimeForResponse:]): (-[WebFrameBridge loadURL:referrer:reload:userGesture:target:triggeringEvent:form:formValues:]): (-[WebFrameBridge postWithURL:referrer:target:data:contentType:triggeringEvent:form:formValues:]): (-[WebFrameBridge valueForKey:keys:values:]): (-[WebFrameBridge _preferences]): 2006-04-24 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - Remove use of _webSuperviewOfClass: and related http://bugs.webkit.org/show_bug.cgi?id=8562 I removed all use of these, now objects get at each other via actual pointers, not using the view hierarchy. However, I left two of the calls in because other clients rely on them as SPI (ugh). * History/WebHistoryItem.m: * Misc/WebNSViewExtras.h: * Misc/WebNSViewExtras.m: (-[NSView _web_superviewOfClass:]): (-[NSView _web_parentWebFrameView]): * Plugins/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView layout]): * Plugins/WebNetscapePluginEmbeddedView.h: * Plugins/WebNetscapePluginEmbeddedView.m: (-[WebNetscapePluginEmbeddedView setWebFrame:]): (-[WebNetscapePluginEmbeddedView dataSource]): * Plugins/WebNullPluginView.h: * Plugins/WebNullPluginView.m: (-[WebNullPluginView setWebFrame:]): (-[WebNullPluginView viewDidMoveToWindow]): * Plugins/WebPluginController.h: * Plugins/WebPluginController.m: (-[WebPluginController setDataSource:]): (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]): (-[WebPluginController webPlugInContainerShowStatus:]): (-[WebPluginController webPlugInContainerSelectionColor]): (-[WebPluginController webFrame]): * Plugins/WebPluginDocumentView.h: * Plugins/WebPluginDocumentView.m: (-[WebPluginDocumentView setDataSource:]): (-[WebPluginDocumentView layout]): (-[WebPluginDocumentView currentWindow]): (-[WebPluginDocumentView viewWillMoveToWindow:]): * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge formControlIsBecomingFirstResponder:]): (-[WebFrameBridge formControlIsResigningFirstResponder:]): (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:]): * WebCoreSupport/WebViewFactory.m: (-[WebViewFactory bridgeForView:]): * WebView/WebClipView.m: (-[NSView initWithFrame:]): * WebView/WebFrameView.m: (-[WebFrameView _shouldDrawBorder]): (-[WebFrameView webCoreBridge]): * WebView/WebHTMLView.m: (-[WebTextCompleteController dealloc]): (-[WebHTMLView _dataSource]): (-[WebHTMLView _bridge]): (-[WebHTMLView _webView]): (-[WebHTMLView _frameView]): (-[WebHTMLView _web_firstResponderCausesFocusDisplay]): (-[WebHTMLView becomeFirstResponder]): (-[WebHTMLView setDataSource:]): (-[WebHTMLView pageUp:]): (-[WebHTMLView pageDown:]): (-[WebHTMLView pageUpAndModifySelection:]): (-[WebHTMLView pageDownAndModifySelection:]): (-[WebHTMLView _frame]): * WebView/WebHTMLViewInternal.h: * WebView/WebImageView.h: * WebView/WebImageView.m: (-[WebImageView drawRect:]): (-[WebImageView adjustFrameSize]): (-[WebImageView setDataSource:]): (-[WebImageView webView]): (-[WebImageView writeImageToPasteboard:types:]): (-[WebImageView copy:]): (-[WebImageView elementAtPoint:]): (-[WebImageView mouseDragged:]): * WebView/WebPDFView.h: * WebView/WebPDFView.m: (-[WebPDFView _applyPDFDefaults]): (-[WebPDFView _trackFirstResponder]): (-[PDFPrefUpdatingProxy forwardInvocation:]): * WebView/WebRenderNode.m: (-[WebRenderNode initWithWebFrameView:]): * WebView/WebTextView.h: * WebView/WebTextView.m: (-[WebTextView _textSizeMultiplierFromWebView]): (-[WebTextView _preferences]): (-[WebTextView setDataSource:]): (-[WebTextView _webFrame]): (-[WebTextView dragSelectionWithEvent:offset:slideBack:]): (-[WebTextView menuForEvent:]): (-[WebTextView resignFirstResponder]): (-[WebTextView drawPageBorderWithSize:]): (-[WebTextView knowsPageRange:]): * WebView/WebView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): (containingFrameView): (-[WebView _focusedFrame]): (-[WebView _frameViewAtWindowPoint:]): 2006-04-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - push WebFileButton and WebStringTruncator code down to WebCore http://bugs.webkit.org/show_bug.cgi?id=8552 * Misc/WebStringTruncator.m: (+[WebStringTruncator centerTruncateString:toWidth:]): (+[WebStringTruncator centerTruncateString:toWidth:withFont:]): (+[WebStringTruncator rightTruncateString:toWidth:withFont:]): (+[WebStringTruncator widthOfString:font:]): * WebCoreSupport/WebFileButton.h: Removed. * WebCoreSupport/WebFileButton.m: Removed. * WebCoreSupport/WebFrameBridge.h: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge runOpenPanelForFileButtonWithResultListener:]): * WebCoreSupport/WebViewFactory.m: (-[WebViewFactory fileButtonChooseFileLabel]): (-[WebViewFactory fileButtonNoFileSelectedLabel]): * WebKit.xcodeproj/project.pbxproj: 2006-04-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. - remove WebCookieAdapter, WebCore can just use Foundation directly. * WebCoreSupport/WebCookieAdapter.h: Removed. * WebCoreSupport/WebCookieAdapter.m: Removed. * WebKit.xcodeproj/project.pbxproj: * WebView/WebFrameView.m: (-[WebFrameView initWithFrame:]): 2006-04-23 Maciej Stachowiak <mjs@apple.com> Reviewed by Adele. - prune WebView SPI of unused calls Specifically I moved methods that have no callers outside WebKit to WebViewInternal.h or removed them entirely. * DefaultDelegates/WebDefaultContextMenuDelegate.m: * Plugins/WebBaseNetscapePluginView.m: * Plugins/WebNetscapePluginDocumentView.m: * Plugins/WebNetscapePluginStream.m: * Plugins/WebNullPluginView.m: * Plugins/WebPluginContainerCheck.m: * Plugins/WebPluginController.m: * WebCoreSupport/WebFrameBridge.m: * WebCoreSupport/WebPageBridge.m: * WebCoreSupport/WebSubresourceLoader.m: * WebView/WebDataSource.m: * WebView/WebHTMLView.m: * WebView/WebImageView.m: * WebView/WebLoader.m: * WebView/WebMainResourceLoader.m: * WebView/WebPDFView.m: * WebView/WebScriptDebugDelegate.m: * WebView/WebView.m: (-[WebView _downloadURL:]): * WebView/WebViewInternal.h: * WebView/WebViewPrivate.h: 2006-04-22 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. - remove WebKit copy of assertions code, use the assertions stuff from JavaScriptCore instead. * Carbon/HIViewAdapter.m: * DOM/WebDOMOperations.m: * DefaultDelegates/WebDefaultContextMenuDelegate.m: * DefaultDelegates/WebDefaultPolicyDelegate.m: (-[WebDefaultPolicyDelegate webView:unableToImplementPolicyWithError:frame:]): * History/WebBackForwardList.m: * History/WebHistory.m: (-[WebHistoryPrivate _loadHistoryGuts:URL:error:]): (-[WebHistoryPrivate _saveHistoryGuts:URL:error:]): * History/WebHistoryItem.m: * Misc/WebAssertions.h: Removed. * Misc/WebAssertions.m: Removed. * Misc/WebDatabase.m: * Misc/WebDownload.m: * Misc/WebFileDatabase.m: (SetThreadPriority): * Misc/WebIconDatabase.m: (-[NSMutableDictionary iconForURL:withSize:cache:]): (-[NSMutableDictionary releaseIconForURL:]): (-[NSMutableDictionary delayDatabaseCleanup]): (-[NSMutableDictionary allowDatabaseCleanup]): (-[WebIconDatabase _loadIconDictionaries]): (-[WebIconDatabase _updateFileDatabase]): (-[WebIconDatabase _iconsBySplittingRepresentationsOfIcon:]): * Misc/WebIconLoader.m: * Misc/WebKitLogging.h: * Misc/WebKitLogging.m: * Misc/WebKitSystemBits.m: (initCapabilities): * Misc/WebLRUFileList.m: (WebLRUFileListRemoveOldestFileFromList): (WebLRUFileListGetFileSize): * Misc/WebLocalizableStrings.m: * Misc/WebNSCalendarDateExtras.m: * Misc/WebNSDataExtras.m: * Misc/WebNSDictionaryExtras.m: * Misc/WebNSFileManagerExtras.m: * Misc/WebNSPasteboardExtras.m: * Misc/WebNSURLExtras.m: (hexDigit): (hexDigitValue): (allCharactersInIDNScriptWhiteList): * Misc/WebNSURLRequestExtras.m: * Misc/WebNSUserDefaultsExtras.m: * Misc/WebStringTruncator.m: * Panels/WebAuthenticationPanel.m: (-[WebAuthenticationPanel loadNib]): * Panels/WebPanelAuthenticationHandler.m: * Plugins/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:]): (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): * Plugins/WebBaseNetscapePluginView.m: (TSMEventHandler): (-[WebBaseNetscapePluginView start]): (-[WebBaseNetscapePluginView status:]): (-[WebBaseNetscapePluginView _printedPluginBitmap]): * Plugins/WebBasePluginPackage.m: * Plugins/WebNetscapePluginDocumentView.m: * Plugins/WebNetscapePluginPackage.m: (-[WebNetscapePluginPackage load]): * Plugins/WebNetscapePluginRepresentation.m: * Plugins/WebPluginContainerCheck.m: * Plugins/WebPluginController.m: (-[WebPluginController addPlugin:]): (-[WebPluginController webPlugInContainerLoadRequest:inFrame:]): (-[WebPluginController webPlugInContainerShowStatus:]): * Plugins/WebPluginDatabase.m: * Plugins/WebPluginDocumentView.m: * WebCoreSupport/WebCookieAdapter.m: * WebCoreSupport/WebFileButton.m: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge runModal]): * WebCoreSupport/WebImageData.m: (-[WebImageData _checkSolidColor:]): (-[WebImageData tileInRect:fromPoint:context:]): (-[WebImageData scaleAndTileInRect:fromRect:withHorizontalTileRule:withVerticalTileRule:context:]): * WebCoreSupport/WebImageDecoder.m: * WebCoreSupport/WebImageRenderer.m: (-[WebImageRenderer TIFFRepresentation]): * WebCoreSupport/WebImageRendererFactory.m: * WebCoreSupport/WebJavaScriptTextInputPanel.m: * WebCoreSupport/WebKeyGenerator.m: * WebCoreSupport/WebPageBridge.m: * WebCoreSupport/WebSubresourceLoader.m: * WebCoreSupport/WebTextRenderer.m: (widthForGlyph): (-[WebTextRenderer initWithFont:]): (drawGlyphs): (initializeATSUStyle): (createATSULayoutParameters): (getTextBounds): (ATSU_draw): * WebCoreSupport/WebTextRendererFactory.m: * WebCoreSupport/WebViewFactory.m: * WebKit.exp: * WebKit.xcodeproj/project.pbxproj: * WebKitPrefix.h: * WebView/WebArchiver.m: (+[WebArchiver _archiveWithMarkupString:fromFrame:nodes:]): * WebView/WebClipView.m: * WebView/WebDataProtocol.m: * WebView/WebDataSource.m: (-[WebDataSource _startLoading]): * WebView/WebFormDataStream.m: (formEventCallback): (webSetHTTPBody): * WebView/WebFrame.m: (-[WebFrame _transitionToCommitted:]): * WebView/WebFrameView.m: * WebView/WebHTMLRepresentation.m: * WebView/WebHTMLView.m: (-[WebHTMLView _lookUpInDictionaryFromMenu:]): (-[WebHTMLView drawSingleRect:]): (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): (-[WebHTMLView _scaleFactorForPrintOperation:]): (-[WebHTMLView deleteBackwardByDecomposingPreviousCharacter:]): (-[WebHTMLView checkSpelling:]): (-[WebHTMLView showGuessPanel:]): (-[WebHTMLView _changeSpellingToWord:]): (-[WebHTMLView ignoreSpelling:]): (-[WebHTMLView performFindPanelAction:]): (-[WebTextCompleteController doCompletion]): * WebView/WebImageView.m: * WebView/WebLoader.m: (-[NSURLProtocol connection:willCacheResponse:]): * WebView/WebPDFRepresentation.m: (+[WebPDFRepresentation PDFDocumentClass]): * WebView/WebPDFView.m: (+[WebPDFView PDFKitBundle]): (+[WebPDFView PDFViewClass]): (-[WebPDFView _menuItemsFromPDFKitForEvent:]): * WebView/WebTextRepresentation.m: * WebView/WebTextView.m: * WebView/WebUnarchivingState.m: * WebView/WebView.m: 2006-04-22 Timothy Hatcher <timothy@apple.com> Reviewed by Eric. http://bugs.webkit.org/show_bug.cgi?id=8514 Bug 8514: Web Inspector hides when the app is in the background Makes the inspector not hide in the background. Since the inspector is a floating panel we need to call setFloatingPanel:NO when the app is switching into the background. Then call setFloatingPanel:YES when the app is activated again. Without this the inspector would float above all applications. * WebInspector/WebInspector.m: (-[NSWindow window]): setHidesOnDeactivate:NO (-[NSWindow windowWillClose:]): de-regiser appliction active notifications (-[NSWindow showWindow:]): register for appliction active notifications (-[WebInspector _applicationWillResignActive]): setFloatingPanel:NO (-[WebInspector _applicationDidBecomeActive]): setFloatingPanel:YES 2006-04-21 Adele Peterson <adele@apple.com> Reviewed by Darin. - Fix for http://bugs.webkit.org/show_bug.cgi?id=8181 REGRESSION: After tabbing in page's field, attempting to tab from Google toolbar search to page fails on first try Test: manual-tests/tabbing-input-google.html * WebView/WebHTMLView.m: (-[WebHTMLView resignFirstResponder]): When resigning first responder, reset willBecomeFirstResponderForNodeFocus, so when the WebHTMLView gets focus again it knows it can start moving through the tab cycle. 2006-04-20 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. <rdar://problem/4476875> Support printing for embedded Netscape plugins NOTE: This only works with the Flash plugin right now. It appears that the other major plugins either have awful printing support, or no printing support. If someone can find an example of any other embedded Netscape plugin printing in any browser on the Mac, I will be happy to eat my own words! * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView drawRect:]): When printing, get the printed bitmap via -_printedPluginBitmap, and draw it into the plugin view. (-[WebBaseNetscapePluginView _printedPluginBitmap]): Call NPP_Print on the plugin to render it into a GWorld. This GWorld has the same underlying buffer as an NSBitmapImageRep, which is returned to the caller. 2006-04-20 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin. WebKit part of: - fix http://bugs.webkit.org/show_bug.cgi?id=8276 REGRESSION (NativeTextField): Pasting a Finder item into a text field results in a file: URL being pasted instead of just the file name - fix http://bugs.webkit.org/show_bug.cgi?id=8283 REGRESSION: File's path doesn't appear after dragging file into input field * WebView/WebHTMLView.m: (-[WebHTMLView _plainTextFromPasteboard:]): Added method that tries to copy AppKit text fields' logic for extracting plain text from the pasteboard. (-[WebHTMLView _pasteAsPlainTextWithPasteboard:]): Added helper method. (-[WebHTMLView _shouldInsertText:replacingDOMRange:givenAction:]): (-[WebHTMLView _shouldReplaceSelectionWithText:givenAction:]): (-[WebHTMLView readSelectionFromPasteboard:]): Paste as plain text if rich text is not allowed. (-[WebHTMLView validateUserInterfaceItem:]): Changed to not allow pasteAsRichText: if the paste is not going to be handled by the DOM and the selection does not allow pasting rich text. (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]): Paste as plain text if rich text is not allowed. (-[WebHTMLView paste:]): Ditto. (-[WebHTMLView pasteAsPlainText:]): 2006-04-20 Darin Adler <darin@apple.com> Reviewed by Adele. - WebKit part of http://bugs.webkit.org/show_bug.cgi?id=8505 eliminate WebCoreGraphics bridge, demonstrate new SystemInterface technique * WebCoreSupport/WebGraphicsBridge.h: Removed. * WebCoreSupport/WebGraphicsBridge.m: Removed. * WebCoreSupport/WebSystemInterface.h: Added. * WebCoreSupport/WebSystemInterface.m: Added. * WebKit.xcodeproj/project.pbxproj: Updated for removed and added files. * WebCoreSupport/WebImageData.m: Removed unneeded include of WebGraphicsBridge.h. * WebCoreSupport/WebImageRenderer.m: Ditto. * WebCoreSupport/WebTextRenderer.m: Ditto. * WebView/WebFrameView.m: (-[WebFrameView initWithFrame:]): Guarded all the one-time initialization inside a boolean, just in case some things take a little time. Added a call to InitWebCoreSystemInterface to the one-time initialization here. Later, we will need to add it in some other places if we call code that requires the use of WebCoreSystemInterface functions from anywhere that can be invoked before creations of the first WebFrameView, but for now there is no need. 2006-04-19 James G. Speth <speth@end.com> Reviewed by Timothy. http://bugs.webkit.org/show_bug.cgi?id=8442 Bug 8442: improvements to Cocoa bindings support in WebView - code simplification Removes the WebController class added earlier; changes NSTreeController and WebView to together without it. Now you can just bind the contentObject binding of the tree controller directly to the mainFrameDocument key of the WebView. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge windowObjectCleared]): * WebView/WebDataSource.m: (-[WebDataSource _setTitle:]): * WebView/WebFrame.m: (-[WebFrame _closeOldDataSources]): * WebView/WebView.m: (-[WebView _progressStarted:]): (-[WebView _finalProgressComplete]): (-[WebView _commonInitializationWithFrameName:groupName:]): (-[WebView setMainFrameDocumentReady:]): (-[WebView mainFrameDocument]): * WebView/WebViewPrivate.h: 2006-04-19 James G. Speth <speth@end.com> Reviewed by Timothy. http://bugs.webkit.org/show_bug.cgi?id=6635 Bug 6635: Crash selecting inspector nodes for tabs that aren't foremost Stop observing window will close notifications before we tell the highlight window to close, this prevents the crash. Also prevent drawing highlights for hidden tabs. * WebInspector/WebInspector.m: (-[WebInspector _highlightNode:]): * WebInspector/WebNodeHighlight.m: (-[WebNodeHighlight expire]): 2006-04-19 James G. Speth <speth@end.com> Reviewed by Timothy. http://bugs.webkit.org/show_bug.cgi?id=6637 Bug 6637: selecting node in Inspector after closing window crashes Safari When the window the Web Inspector was inspecting is closed, the inspector goes into its no-selection state. Choosing to inspect another element activates it again. The inspector will also follow the WebView if the URL changes and select the root element on the new page. * WebInspector/WebInspector.m: (-[NSWindow setWebFrame:]): (-[NSWindow setRootDOMNode:]): (-[WebInspector _revealAndSelectNodeInTree:]): (-[WebInspector _update]): (-[WebInspector _updateRoot]): (-[WebInspector inspectedWebViewProgressFinished:]): (-[WebInspector inspectedWindowWillClose:]): (-[WebInspector webView:didFinishLoadForFrame:]): * WebInspector/WebInspectorPanel.m: (-[WebInspectorPanel canBecomeMainWindow]): 2006-04-18 Darin Adler <darin@apple.com> Reviewed by Beth. * WebInspector/webInspector/inspector.css: Add "-webkit-" prefixes to the border radius properties to make the corners rounded again. 2006-04-16 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin. - WebKit part of fix for http://bugs.webkit.org/show_bug.cgi?id=8324 REGRESSION: textarea :focus not applied immediately * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge formControlIsBecomingFirstResponder:]): Added. Calls the ancestor WebHTMLView's _formControlIsBecomingFirstResponder: * WebView/WebHTMLView.m: (-[WebHTMLView _updateFocusState:]): If a descendant is becoming first responder, enable focused appearance. (-[WebHTMLView _formControlIsBecomingFirstResponder:]): Added. Calls _updateFocusState, causing the frame to display with focus attributes. * WebView/WebHTMLViewInternal.h: 2006-04-14 James G. Speth <speth@end.com> Reviewed by Timothy. Bug 8389: support for Cocoa bindings - binding an NSTreeController to the WebView's DOM http://bugs.webkit.org/show_bug.cgi?id=8389 Added a controller class, WebController, that is a subclass of NSTreeController that has a new outlet/binding for the WebView. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge windowObjectCleared]): notify bindings about the document change * WebView/WebView.m: (-[WebView _progressStarted:]): notify bindings about the document change (-[WebView _finalProgressComplete]): notify bindings about the document change (-[WebView _declaredKeys]): added a key for the main frame document (-[WebController init]): (-[WebController exposedBindings]): (-[WebController valueClassForBinding:]): (-[WebController setContent:]): (-[WebController webView]): (-[WebController setWebView:]): (-[WebView mainFrameDocument]): get the main frame's DOMDocument * WebView/WebViewPrivate.h: Adds mainFrameDocument to pending public. 2006-04-12 David Harrison <harrison@apple.com> Reviewed by Darin. <rdar://problem/4386640> AX: AXPreviousSentenceStartTextMarkerForTextMarker does not respect paragraph boundary <rdar://problem/4414575> AX: Dictionary popup cannot find some words on Dictionary.app (see related changes in WebCore) Tests added: * editing/selection/extend-by-sentence-001.html: Added. * fast/dom/inner-text-001.html: Added. * WebView/WebHTMLView.m: (-[WebHTMLView validateUserInterfaceItem:]): (-[WebHTMLView moveToBeginningOfSentence:]): (-[WebHTMLView moveToBeginningOfSentenceAndModifySelection:]): (-[WebHTMLView moveToEndOfSentence:]): (-[WebHTMLView moveToEndOfSentenceAndModifySelection:]): (-[WebHTMLView selectSentence:]): * WebView/WebView.m: * WebView/WebViewPrivate.h: Add sentence navigation and selection. 2006-04-12 Tim Omernick <timo@apple.com> Reviewed by Darin. Part of <rdar://problem/4482530> * WebView/WebView.m: (-[WebView _focusedFrame]): Fixed up the logic here to take into account immediate subviews of WebView, which are not actually in a WebFrameView (they are peers to the main frame's WebFrameView). 2006-04-10 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - fixed <rdar://problem/4139799> Seed: Safari: Private Browsing leaves traces in Icon Cache * Misc/WebIconDatabasePrivate.h: new ivars: pageURLsBoundDuringPrivateBrowsing, iconURLsBoundDuringPrivateBrowsing, and privateBrowsingEnabled * Misc/WebIconDatabase.m: (-[NSMutableDictionary init]): initialize new ivars, and listen for notifications that WebPreferences changed so we can react to changes to private browsing. (-[NSMutableDictionary iconForURL:withSize:cache:]): Don't remove icon URL from extraRetain dictionary; that's now done in _forgetIconForIconURLString. (I left a comment here earlier about why I was worried about this change, but I convinced myself that it's fine.) (-[WebIconDatabase removeAllIcons]): Removed no-longer-true (and never very clear) comment, and braces. Also remove all objects from the two private-browsing-related dictionaries. (-[WebIconDatabase _setIcon:forIconURL:]): remember icon URL if private browsing is enabled (-[WebIconDatabase _setHaveNoIconForIconURL:]): remember icon URL if private browsing is enabled (-[WebIconDatabase _setIconURL:forURL:]): added an assert that helped me out at one point (-[WebIconDatabase _clearDictionaries]): clear the two new dictionaries too (-[WebIconDatabase _loadIconDictionaries]): made an existing ERROR not fire in the expected case where there are no icons at all on disk (-[WebIconDatabase _updateFileDatabase]): when saving the pageURLToIconURL dictionary to disk, first remove any values that were created during private browsing (-[WebIconDatabase _retainIconForIconURLString:]): skip the code that deals with saving changes to disk if private browsing is enabled (-[WebIconDatabase _forgetIconForIconURLString:]): Remove the icon URL from extraRetain dictionary here. We're forgetting everything about this icon URL so we should forget its former extraRetain count too. (-[WebIconDatabase _resetCachedWebPreferences:]): Cache the new value of private browsing. If it has now been turned off, forget everything we learned while it was on. This causes (e.g.) icons for bookmarks or pre-existing history items to be forgotten if the icon was only learned during private browsing. * History/WebHistoryItem.m: removed an unnecessary #import I happened to notice 2006-04-10 David Hyatt <hyatt@apple.com> Make the broken CG focus ring painting work when WebCore sets a clip (in addition to respecting the dirty rect clip). Reviewed by darin * WebCoreSupport/WebGraphicsBridge.m: (-[WebGraphicsBridge drawFocusRingWithPath:radius:color:clipRect:]): 2006-04-10 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=8100 REGRESSION (NativeTextField): Right-aligned and RTL text jitters in new text fields * WebCoreSupport/WebTextRenderer.m: (overrideLayoutOperation): For RTL runs, apply the word-rounding on the left. (CG_floatWidthForRun): For RTL runs, apply the last character's rounding on the left by adjusting the start position. (initializeWidthIterator): Added finalRoundingWidth field to WidthIterator. (advanceWidthIterator): For RTL runs, apply rounding on the left of the character, by increasing the width of the next character (which is the character to the left). For the last character, keep the rounding width in the iterator's finalRoundingWidth, to be used by CG_floatWidthForRun(). 2006-04-08 John Sullivan <sullivan@apple.com> Reviewed by Adele Peterson. - fixed http://bugs.webkit.org/show_bug.cgi?id=8260 REGRESSION: Assertion failure: ![_private->iconsToSaveWithURLs containsObject:iconURLString] in WebIconDatabase.m:695-[WebIconDatabase(WebInternal) _retainIconForIconURLString:] * Misc/WebIconDatabase.m: (-[WebIconDatabase _retainIconForIconURLString:]): This new assertion was one block too high; moved it in. 2006-04-07 David Hyatt <hyatt@apple.com> A fix that makes coalesced updates work much better (and makes our single animated GIF timer work better). The new rect painting algorithm for WebHTMLView will use the single unioned rect if the # of rects exceeds a threshold (10 is my initial cut), or if the union has enough "wasted" additional pixels (conservatively set at 75%). Reviewed by darin * WebView/WebHTMLView.m: (-[WebHTMLView drawSingleRect:]): (-[WebHTMLView drawRect:]): 2006-04-07 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - simplify archive loading * WebView/WebDataSource.m: (-[WebDataSource representation]): fix whitespace * WebView/WebHTMLRepresentation.m: (-[WebHTMLRepresentation loadArchive]): Use WebFrame's loadArchive: instead of trying to do a manual load here. (-[WebHTMLRepresentation documentSource]): No more special case for WebArchive. 2006-04-07 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - fixed <rdar://problem/4507054> If an icon file is removed from disk behind Safari's back, Safari will not try to refetch it In addition to letting WebIconDatabase recover from disk/memory mismatches as per 4507054, I also found a bug in the way icons are remembered that could account for some of the other cases where site icons didn't appear (and you'd get an ERROR on debug builds about WebIconDatabase saying it had some icon when it really doesn't). * Misc/WebIconDatabase.m: (-[WebIconDatabase iconForURL:withSize:cache:]): When the icon file for a previously-saved site icon isn't found, forget about the darn icon URL thoroughly so that this situation is self-correcting. Formerly, once you got into this state WebKit would never find the icon again (short of removing the entire icon database cleanly). Note that this does *not* change the behavior of sites that didn't have a site icon when WebKit checked -- these will continue to not return a site icon indefinitely (that's a separate, possibly performance-sensitive issue). (-[WebIconDatabase _retainIconForIconURLString:]): This code did the wrong thing in the case where an icon was in the process of being forgotten about. In that case, the icon would still be in _private->iconsOnDiskWithURLs, so we wouldn't try to save it here, so the new icon wouldn't stick. 2006-04-07 David Hyatt <hyatt@apple.com> Re-enable coalesced updates. Our move to a single timer has essentially implemented coalescing of updates anyway, so the regression has already come back. Since we have to deal with that now anyway, there's no reason to visually tear also. :) Reviewed by darin * ChangeLog: * WebView/WebView.m: (-[WebView _commonInitializationWithFrameName:groupName:]): 2006-04-05 Darin Adler <darin@apple.com> - fixed a storage leak from that last check-in * WebView/WebUnarchivingState.m: (-[WebUnarchivingState dealloc]): Release the two dictionaries. 2006-04-05 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. - start on factoring WebArchive unpacking more into a separate class. http://bugs.webkit.org/show_bug.cgi?id=8208 * WebKit.xcodeproj/project.pbxproj: * WebView/WebDataSource.m: (-[WebDataSourcePrivate dealloc]): (-[WebDataSource _addToUnarchiveState:]): (-[WebDataSource _popSubframeArchiveWithName:]): (-[WebDataSource _documentFragmentWithArchive:]): (-[WebDataSource _setupForReplaceByMIMEType:]): (-[WebDataSource subresourceForURL:]): * WebView/WebDataSourcePrivate.h: * WebView/WebFrame.m: (-[WebFrame _loadRequest:archive:]): (-[WebFrame loadRequest:]): (-[WebFrame loadArchive:]): * WebView/WebFramePrivate.h: * WebView/WebHTMLRepresentation.m: (-[WebHTMLRepresentation loadArchive]): * WebView/WebUnarchivingState.h: Added. * WebView/WebUnarchivingState.m: Added. (-[WebUnarchivingState init]): (-[WebUnarchivingState addArchive:]): (-[WebUnarchivingState archivedResourceForURL:]): (-[WebUnarchivingState popSubframeArchiveWithFrameName:]): 2006-04-04 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. The Debug and Release frameworks are now built with install paths relative to the build products directory. This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore. * WebKit.xcodeproj/project.pbxproj: 2006-04-04 John Sullivan <sullivan@apple.com> Reviewed by Adele Peterson. - WebKit part of <rdar://problem/4498418> "Autosaved" searchterms are saved during private browsing * WebView/WebView.m: (-[WebView _updateWebCoreSettingsFromPreferences:]): Pass private browsing setting down to WebCore. 2006-04-03 John Sullivan <sullivan@apple.com> Reviewed by Tim Hatcher. - re-fixed <rdar://problem/4481198> REGRESSION (TOT): search results list in bookmarks view remains when search text is deleted * WebView/WebView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): I fixed this recently, but then broke it again by adding an early bail-out to this method. So now I'm removing the early bail-out. 2006-04-02 Trey Matteson <trey@usa.net> Reviewed by Maciej. fix http://bugs.webkit.org/show_bug.cgi?id=8121 REGRESSION: 404s are not displayed * WebView/WebMainResourceLoader.m: (-[WebMainResourceLoader continueAfterContentPolicy:response:]): Only cancel failed loads for object elements, not for frames or a whole page. 2006-04-02 Maciej Stachowiak <mjs@apple.com> Reviewed by Hyatt. - fixed <rdar://problem/4198619> REGRESSION: tabbing through links fails after hitting text field w/ sys's "tab to all controls" off - fixed <rdar://problem/4463760> REGRESSION: Can't tab from old text field (like password fields) to new text field (6811) (http://bugs.webkit.org/show_bug.cgi?id=6811) - fixed tab and shift tab don't select the right things http://bugs.webkit.org/show_bug.cgi?id=5685 * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge willMakeFirstResponderForNodeFocus]): New method - let WebHTMLView know that the next time it becomes first responder, it's to change focus within the page and the right node has already been set, so it should not move focus forward or backward inside it. * WebView/WebHTMLView.m: (-[WebHTMLView needsPanelToBecomeKey]): Override to return YES, oddly enough this is the right way to tell AppKit that you should be in the tab cycle loop. (-[WebHTMLView becomeFirstResponder]): Don't move forward or back in tab cycle when this becomeFirstResponder is for tabbing from a control in the page. (-[WebHTMLView _willMakeFirstResponderForNodeFocus]): Note that the next time this view becomes first responder, it will be for in-page focus navigation. * WebView/WebHTMLViewInternal.h: 2006-04-01 Darin Adler <darin@apple.com> Reviewed by Maciej. - fix http://bugs.webkit.org/show_bug.cgi?id=8105 REGRESSION (NativeTextField): Option-delete deletes one space before the deleted word Test: fast/forms/input-text-option-delete.html * WebView/WebHTMLView.m: (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): Pass NO for smartDeleteOK. Smart deletion only applies to deleting a word at a time, and none of the callers of this function that delete a word at a time want smart deletion. (-[WebHTMLView deleteToEndOfLine:]): Fixed tiny formatting glitch. 2006-03-31 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. We need to set reachedTerminalState to YES before we release the resources to prevent a double dealloc of WebView Fixes <rdar://problem/4372628> crash deallocating a WebView in -[WebFrame stopLoading] * WebView/WebLoader.m: (-[NSURLProtocol releaseResources]): set reachedTerminalState earlier 2006-03-31 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. Some cleanup in the WebIconDatabase code in a fruitless search for the cause of the mysterious -[WebFileDatabase performSetObject:forKey] crash * Misc/WebIconDatabase.m: (-[WebIconDatabase _createFileDatabase]): removed obsolete comment (-[WebIconDatabase _loadIconDictionaries]): Added ERRORs for unexpected early returns. Made dictionaries be autoreleased until the end of the method where they are retained, so that the early returns don't leak; added ASSERTs that the _private->dictionary values aren't being leaked. (-[WebIconDatabase _updateFileDatabase]): Added an ERROR for an unexpected early return, and made a trivial style fix. 2006-03-31 Trey Matteson <trey@usa.net> Reviewed by Maciej, landed by ap. http://bugs.webkit.org/show_bug.cgi?id=7739 REGRESSION: Assertion failure loading acid2 test in -[WebCoreFrameBridge installInFrame:] Tests: http/tests/misc/acid2.html, http/tests/misc/acid2-pixel.html The gist of this change is that we must cancel the load from the Webkit side when we realize we're switching to the fallback content. This is somewhat a temp workaround since control of loading will be moving to WebCore. * WebView/WebMainResourceLoader.m: (-[WebMainResourceLoader continueAfterContentPolicy:response:]): 2006-03-30 Justin Garcia <justin.garcia@apple.com> Reviewed by darin http://bugs.webkit.org/show_bug.cgi?id=6989 REGRESSION: Plain-text mode needed for contenteditable area used in new text field * WebView/WebHTMLView.m: (-[WebHTMLView _canEditRichly]): Added. (-[WebHTMLView _canIncreaseSelectionListLevel]): Use _canEditRichly (-[WebHTMLView _canDecreaseSelectionListLevel]): Ditto. (-[WebHTMLView _increaseSelectionListLevel]): (-[WebHTMLView _decreaseSelectionListLevel]): (-[WebHTMLView validateUserInterfaceItem:]): Split rich text editing actions off from ones that can be applied anywhere. (-[WebHTMLView _applyStyleToSelection:withUndoAction:]): (-[WebHTMLView _applyParagraphStyleToSelection:withUndoAction:]): (-[WebHTMLView _alignSelectionUsingCSSValue:withUndoAction:]): * WebView/WebHTMLViewPrivate.h: 2006-03-29 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. <rdar://problem/4495316> REGRESSION (420+): After page has loaded, spinning progress indicator is displayed on tab at versiontracker.com * WebView/WebFrame.m: (-[WebFrame _receivedMainResourceError:]): Call -_clientRedirectCancelledOrFinished: here so that the frame load delegate is notified that the redirect's status has changed, if there was a redirect. The frame load delegate may have saved some state about the redirect in its -webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:. Since we are definitely not going to use this provisional resource, as it was cancelled, notify the frame load delegate that the redirect has ended. The fix for 4432562 was similar to this, but only took care of the case where the redirect load was actually committed to the frame. The new call to -_clientRedirectCancelledOrFinished: handles the case where the redirect load was successful, but was not committed. This happens with downloads. 2006-03-29 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - fixed these bugs: <rdar://problem/4483806> REGRESSION (417.8-TOT): PDFs don't scale correctly with auto-size (5356) <rdar://problem/3874856> Safari PDF display should be full width by default rather than sized to show the entire page * WebView/WebPDFRepresentation.m: (-[WebPDFRepresentation finishedLoadingWithDataSource:]): Let the WebPDFView handle setting the document, because that's the best time to apply the sizing-related preferences. * WebView/WebPDFView.h: eliminated firstLayoutDone ivar and -PDFSubview public method; added -setPDFDocument: * WebView/WebPDFView.m: (-[WebPDFView initWithFrame:]): eliminate use of obsolete firstLayoutDone ivar (-[WebPDFView _applyPDFDefaults]): renamed from _readPDFDefaults for clarity (-[WebPDFView layout]): removed code that applied the preferences here. This was too early to handle auto-sizing correctly, because -layout can be called before the document exists, and calling setAutoSize:YES at that point confuses PDFView into setting the scale factor to 20 (the maximum). (-[WebPDFView setPDFDocument:]): New method, does what WebPDFRepresentation used to do and also applies the preferences here. This is a good place to apply them because the document is guaranteed to now exist (of course). (-[WebPDFView PDFSubview]): Moved this into a new FileInternal category because it's still needed by another class in this file but no longer needs to be public. * WebView/WebPreferences.m: (+[WebPreferences initialize]): Change WebKitPDFScaleFactorPreferenceKey to 0, which represents auto-size. This fixes 3874856, but wasn't feasible until 4483806 was fixed. 2006-03-28 Darin Adler <darin@apple.com> Reviewed by Geoff. - added a build step that checks for init routines * WebKit.xcodeproj/project.pbxproj: Added a custom build phase that invokes the check-for-global-initializers script. 2006-03-28 Tim Omernick <timo@apple.com> Reviewed by Darin. <rdar://problem/3694090> -[WebBaseNetscapePluginView finalize] is incorrect; design change needed * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView initWithFrame:]): Don't observe preferences changes here -- we only want to observe preferences while the view is installed in the view hierarchy. Plugins will appropriately start and stop themselves when added to or removed from a window. (-[WebBaseNetscapePluginView dealloc]): Don't remove observers here -- they should have been removed when the view was removed from its window. (-[WebBaseNetscapePluginView finalize]): ditto (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): Stop observing preferences when the view is removed from its window. (-[WebBaseNetscapePluginView viewDidMoveToWindow]): Start observing preferences when the view is added to a window. 2006-03-27 Tim Omernick <timo@apple.com> Reviewed by Eric. <rdar://problem/3694090> -[WebBaseNetscapePluginView finalize] is incorrect; design change needed * ChangeLog: * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView dealloc]): Instead of calling -stop, assert that the plugin is not running. A plugin view cannot be deallocated until it is removed from its window. When a plugin view is removed from its window, it calls -stop on itself. Therefore I believe that this call to -stop is unnecessary; if I'm wrong, then the assertion will help catch any edge cases. (-[WebBaseNetscapePluginView finalize]): ditto 2006-03-27 Tim Omernick <timo@apple.com> Reviewed by Eric. <rdar://problem/3694086> -[WebBaseNetscapePluginStream finalize] is incorrect; design change needed * Plugins/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream dealloc]): Assert that the stream file path either never existed, or was deleted and NULL-ed out. The stream file is now deleted immediately after calling NPP_StreamAsFile(). (-[WebBaseNetscapePluginStream finalize]): ditto (-[WebBaseNetscapePluginStream _destroyStream]): Delete the file after calling NPP_StreamAsFile(), instead of in -dealloc/-finalize. It should be OK to delete the file here -- NPP_StreamAsFile() is always called immediately before NPP_DestroyStream() (the stream destruction function), so there can be no expectation that a plugin will read the stream file asynchronously after NPP_StreamAsFile() is called. 2006-03-27 Tim Omernick <timo@apple.com> Reviewed by Eric. <rdar://problem/3694093> -[WebBasePluginPackage finalize] is incorrect; design change needed Call -unload on plug-in packages instead of relying on -dealloc/-finalize to do it. Currently the only place plug-in packages are deallocated is when refreshing the set of plugins, as when handling JavaScript's navigator.plugins.refresh(). * Plugins/WebBasePluginPackage.m: (-[WebBasePluginPackage dealloc]): Assert that the plug-in has been unloaded by the time -dealloc is called. (-[WebBasePluginPackage finalize]): ditto * Plugins/WebPluginDatabase.m: (-[WebPluginDatabase refresh]): Call -unload on the plug-in packages before releasing them. 2006-03-27 Tim Omernick <timo@apple.com> Reviewed by Tim Hatcher. Part of <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser * Carbon/HIViewAdapter.h: HIViewAdapter is no longer an NSView subclass, since we no longer pose it as NSView. * Carbon/HIViewAdapter.m: (+[NSView bindHIViewToNSView:nsView:]): Replace individual NSView methods instead of posing as NSView. (_webkit_NSView_setNeedsDisplay): Replacement implementation of -[NSView setNeedsDisplay:]. (_webkit_NSView_setNeedsDisplayInRect): Replacement implementation of -[NSView setNeedsDisplayInRect:] (_webkit_NSView_nextValidKeyView): Replacement implementation of -[NSView nextValidKeyView] 2006-03-27 John Sullivan <sullivan@apple.com> Reviewed by Darin Adler. Removed two overzealous assertions that the steps to reproduce 4451831 were running into. Improved comments to match. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge _nextKeyViewOutsideWebFrameViewsWithValidityCheck:]): Remove assertion that _inNextKeyViewOutsideWebFrameViews should always be false here. * WebView/WebHTMLView.m: (-[WebHTMLView nextValidKeyView]): Removed assertion that the frame should never be the main frame here. 2006-03-27 Tim Omernick <timo@apple.com> Reviewed by Tim Hatcher. Removed tabs & reformatted code. * Carbon/HIViewAdapter.m: (+[NSView bindHIViewToNSView:nsView:]): (+[NSView getHIViewForNSView:]): (+[NSView unbindNSView:]): (-[NSView setNeedsDisplay:]): (-[NSView setNeedsDisplayInRect:]): (-[NSView nextValidKeyView]): (SetViewNeedsDisplay): 2006-03-26 Justin Garcia <justin.garcia@apple.com> Reviewed by darin <http://bugs.webkit.org/show_bug.cgi?id=7974> Add EditActions and WebUndoActions for CreateLink and Unlink * English.lproj/Localizable.strings: * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge nameForUndoAction:]): 2006-03-23 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. At John's suggestion, renamed a private WebFrame method and tightened up some of the redirect logic I recently touched. * WebView/WebFramePrivate.h: Renamed -_clientRedirectCancelled: to -_clientRedirectCancelledOrFinished:, since we call this both when a redirect is cancelled and when a redirect is successfully committed. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge reportClientRedirectCancelled:]): Call renamed WebFrame method. * WebView/WebFrame.m: Added sentRedirectNotification flag to WebFramePrivate. This flag is set when we notify the frame load delegate that a redirect will occur. We check this flag when committing a provisional load to ensure that the frame load delegate is notified that the redirect finished. (-[WebFrame _commitProvisionalLoad:]): After committing a provisional load, make sure that the frame load delegate is notified that there is no longer a pending redirect. (-[WebFrame _clientRedirectedTo:delay:fireDate:lockHistory:isJavaScriptFormAction:]): Set the new sentRedirectNotification flag. (-[WebFrame _clientRedirectCancelledOrFinished:]): Renamed method. Clear the sentRedirectNotification flag. (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): Call renamed method. 2006-03-23 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. <rdar://problem/4439752> TinyMCE: "Search in Google" context menu is active but fails to work when selection is active in textarea field. * DefaultDelegates/WebDefaultContextMenuDelegate.m: (-[WebDefaultUIDelegate menuItemWithTag:target:representedObject:]): Added a representedObject parameter, which is set on the newly created menu item. (-[WebDefaultUIDelegate contextMenuItemsForElement:defaultMenuItems:]): Instead of setting the representedObject on each menu item after creating them all, pass the element to -menuItemWithTag:target:representedObject:. (-[WebDefaultUIDelegate editingContextMenuItemsForElement:defaultMenuItems:]): ditto. This fixes 4439752 because this method failed to set the representedObject on the menu items as -contextMenuItemsForElement:defaultMenuItems: did. 2006-03-23 Darin Adler <darin@apple.com> Reviewed by Eric. - fix <rdar://problem/4380465> repro crash when unsuccessfully attempting to import image from Services menu * WebView/WebDataSource.m: (-[WebDataSource _imageElementWithImageResource:]): Quietly do nothing if passed nil. (-[WebDataSource _documentFragmentWithImageResource:]): Ditto. 2006-03-22 Tim Omernick <timo@apple.com> Reviewed by Kevin Decker. Even better fix for <rdar://problem/4432562>. We need to notify the frame delegate of a finished redirect for both "fast" and "slow" redirects, after committing the load. My previous change only notified for "fast", history-locking redirects. Now we notify the frame delegate after committing any kind of provisional load, not just in the case of a fast redirect. * WebView/WebFrame.m: (-[WebFrame _transitionToCommitted:]): (-[WebFrame _commitProvisionalLoad:]): 2006-03-22 Tim Omernick <timo@apple.com> Reviewed by Kevin Decker. Better fix for <rdar://problem/4432562> REGRESSION (TOT): Safari's "stop loading" active, "view source" inactive after page load [7058] * WebView/WebFrame.m: (-[WebFrame _transitionToCommitted:]): Cancel the client redirect when we commit the provisional load, if we were waiting for a redirect. This is a better fix for 7058 (<rdar://problem/4432562>). The original fix for 7058 changed the timing of the redirect cancel in such a way that WebKit was precluded from ever reusing back/forward list entries for redirects. Clearing the redirect state here actually makes logical sense, as the redirect's target page is being committed at this point. 2006-03-21 Darin Adler <darin@apple.com> - fix http://bugs.webkit.org/show_bug.cgi?id=3784 <rdar://problem/4483827> JavaScript save dialog disappears right away (sheet triggers blur event) (3784) * WebView/WebHTMLView.m: (-[WebHTMLView _updateFocusState]): Treat window as having focus if its sheet is key. (-[WebHTMLView addWindowObservers]): Observe all focus notifications, not just the ones involving this window. (-[WebHTMLView removeWindowObservers]): Ditto. (-[WebHTMLView windowDidBecomeKey:]): Add checks so that we call the methods only when appropriate, since this will now be called for all windows. (-[WebHTMLView windowDidResignKey:]): Ditto. 2006-03-21 Adele Peterson <adele@apple.com> Reviewed by Darin. - Fix for http://bugs.webkit.org/show_bug.cgi?id=6813 elementAtPoint needs to return input element when clicking on new text field * WebView/WebDocumentInternal.h: Added elementAtPoint:allowShadowContent: * WebView/WebHTMLView.m: (-[WebHTMLView elementAtPoint:]): Does not allow shadow content. This way, by default, callers would get the input element instead of the inner div. (-[WebHTMLView elementAtPoint:allowShadowContent:]): Allows callers to specify whether or not the element can be a shadow node. (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): Allows shadow content when getting element. (-[WebHTMLView _mayStartDragAtEventLocation:]): ditto. (-[WebHTMLView _isSelectionEvent:]): ditto. (-[WebHTMLView _canProcessDragWithDraggingInfo:]): ditto. * WebView/WebFrame.m: (-[WebFrame _actionInformationForNavigationType:event:originalURL:]): Does not allow shadow content when getting element. * WebView/WebImageView.m: (-[WebImageView elementAtPoint:allowShadowContent:]): Added to conform to the WebDocumentElement protocol. * WebView/WebPDFView.m: (-[WebPDFView elementAtPoint:allowShadowContent:]): ditto. * WebView/WebTextView.m: (-[WebTextView elementAtPoint:allowShadowContent:]): ditto. 2006-03-21 Tim Omernick <timo@apple.com> Reviewed by Tim Hatcher and Darin. <rdar://problem/4427068> LMGetCurApRefNum, CloseConnection and GetDiskFragment deprecated, used in Netscape plugin code * Plugins/WebNetscapeDeprecatedFunctions.h: Added. * Plugins/WebNetscapeDeprecatedFunctions.c: Added. Added wrappers for deprecated CFM and LowMem functions. These exist in a separate file so that we can set -Wno-deprecated-declarations on this one file without ignoring other deprecated function usage elsewhere. (WebGetDiskFragment): (WebCloseConnection): (WebLMGetCurApRefNum): (WebLMSetCurApRefNum): * Plugins/WebNetscapePluginPackage.h: Don't include connID ivar in 64-bit, since CFM is not supported in 64-bit. * Plugins/WebNetscapePluginPackage.m: (+[WebNetscapePluginPackage initialize]): Don't bother setting the resource refNum in 64-bit, because the API to get and set it does not exist. A theoretical 64-bit plugin couldn't possibly rely this, since there is no API. (-[WebNetscapePluginPackage unloadWithoutShutdown]): No need to close the connID in 64-bit. (-[WebNetscapePluginPackage load]): Don't load CFM bundles in 64-bit, because CFM is not supported. * WebKit.xcodeproj/project.pbxproj: Added WebNetscapeDeprecatedFunctions.[hm]. 2006-03-21 John Sullivan <sullivan@apple.com> Reviewed by Kevin Decker. - fixed <rdar://problem/4485637> Implementors of searchFor:direction:caseSensitive:wrap: should bail out early if search string is empty This doesn't change any existing behavior, but avoids unnecessary work. * Misc/WebSearchableTextView.m: (-[WebSearchableTextView searchFor:direction:caseSensitive:wrap:]): bail out immediately (returning NO) if search string is empty * WebView/WebHTMLView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): ditto * WebView/WebPDFView.m: (-[WebPDFView searchFor:direction:caseSensitive:wrap:]): ditto * WebView/WebView.m: (-[WebView searchFor:direction:caseSensitive:wrap:]): ditto 2006-03-20 Tim Omernick <timo@apple.com> Reviewed by John Sullivan. Moved -_contentView from WebFrameViewInternal to WebFrameViewPrivate. Safari needs this. * WebView/WebFrameView.m: (-[WebFrameView _contentView]): * WebView/WebFrameViewInternal.h: * WebView/WebFrameViewPrivate.h: 2006-03-17 Mitz Pettel <opendarwin.org@mitzpettel.com> Reviewed by Darin, landed by Beth. - fix http://bugs.webkit.org/show_bug.cgi?id=7693 WebKit relies on unpredictable timing for onload events * WebView/WebDataSource.m: (-[WebDataSource _receivedMainResourceError:complete:]): Check for completion on the WebCore side before checking on the WebKit side, to ensure that the onload event is emitted before the WebFrame load delegate is sent the webView:didFinishLoadForFrame: message. For DumpRenderTree, this ensures that the render tree is dumped after the onload handler is run. * WebView/WebLoader.m: (-[NSURLProtocol didFailWithError:]): If load has already been cancelled (which could happen if the parent's onload handler caused the frame to detach), do nothing. 2006-03-17 John Sullivan <sullivan@apple.com> Reviewed by Beth Dakin - fixed <rdar://problem/4239051> Sometimes "Copy Link" in Safari results in a URL on the pasteboard with no usable "title" * History/WebURLsWithTitles.m: (+[WebURLsWithTitles writeURLs:andTitles:toPasteboard:]): trim whitespace from titles that are put on pasteboard. This leaves an empty string for the title in cases where there's no displayed text, like an image in an <a> element that happens to have whitespace in the source, e.g. <a href="foo"> <img whatever></a> 2006-03-17 Darin Adler <darin@apple.com> - missing bit of my check-in yesterday Maciej moved setWindowFrame for me, but I also had removed setWindowContentRect. * WebCoreSupport/WebFrameBridge.m: Removed unused setWindowContextRect and windowContentRect methods. 2006-03-17 Adele Peterson <adele@apple.com> Reviewed by Hyatt. WebKit part of fix for: http://bugs.webkit.org/show_bug.cgi?id=7797 Can't set background color on new text fields Added function to draw bezeled text field without drawing background. * WebCoreSupport/WebGraphicsBridge.m: (-[WebGraphicsBridge drawBezeledTextFieldCell:enabled:]): Added. 2006-03-16 Maciej Stachowiak <mjs@apple.com> Reviewed by Eric. - move setWindowFrame / windowFrame to WebPageBridge to fix build * WebCoreSupport/WebFrameBridge.m: * WebCoreSupport/WebPageBridge.m: (-[WebPageBridge setWindowFrame:]): (-[WebPageBridge windowFrame]): 2006-03-15 Darin Adler <darin@apple.com> Fix by Patrick Beard, reviewed by me. - fix <rdar://problem/4478181> WebPluginController leaks NSArray and NSMutableSet objects * Plugins/WebPluginController.m: (-[WebPluginController initWithDocumentView:]): Call CFMakeCollectable on the CFSet so we can act like it's an NSSet. (-[WebPluginController dealloc]): Release _views and _checksInProgress. 2006-03-13 Tim Omernick <timo@apple.com> Reviewed by Maciej. <rdar://problem/4476873> Support printing for plugin documents (not embedded plugins) * WebView/WebFrameViewPrivate.h: * WebView/WebFrameView.m: (-[WebFrameView documentViewShouldHandlePrint]): Called by the host application before it initializes and runs a print operation. If NO is returned, the host application will abort its print operation and call -printDocumentView on the WebFrameView. The document view is then expected to run its own print operation. If YES is returned, the host application's print operation will continue as normal. (-[WebFrameView printDocumentView]): Called by the host application when the WebFrameView returns YES from -documentViewShouldHandlePrint. * Plugins/WebNetscapePluginDocumentView.m: (-[WebNetscapePluginDocumentView documentViewShouldHandlePrint]): Allow the plugin to take over printing if it defines an NPP_Print function (-[WebNetscapePluginDocumentView printDocumentView]): Print the plugin document. 2006-03-13 Geoffrey Garen <ggaren@apple.com> Reviewed by timo. - Fixed the load progress indicator to give more incremental feedback, and to stop spending so much time near 100%. I did two things: (1) Fixed some bugs and a misspelling in the previous heuristic's implementation (2) Added two new rules to the heuristic: (a) Treat the first layout as the half-way point. (b) Just like we jump the first 10% to indicate that a load has started, jump the last 10% to indicate that a load has finished. Rule 2a is good for two reasons. First, it seems unnatural for loading to be "more than half done" when you can't even see anything. Second, in the early stages of laading our estimate of how much we'll need to load is often off by as much as 6000% (e.g., cnn.com). So anything that makes the progress indicator more conservative in the early stages of loading is helpful. Rule 2b is good because it's confusing for loading to be "100% done" but still ongoing. FIXME: The indicator still isn't perfect. For example, the old behavior shows up @ moviefone.com. Two areas for future work: (1) Estimate number of linked resources. Our code estimates the size of a single resource, but does nothing to estimate the number of resources that resource might link to. This is the key to why we're so wrong at the beginning. (2) Improve "when to do first layout" heuristic. A JavaScript query for a style property forces layout, creating a phantom first layout with no content, essentially nullifying 2a for certain pages. Filed <rdar://problem/4475834> to track estimating the number of linked resources. Phantom layouts are already on Hyatt's radar. * WebView/WebFrame.m: (-[WebFrame _setState:]): Update firstLayoutDone (-[WebFrame _numPendingOrLoadingRequests:]): Bug fix: In the recurisve case, query 'frame' instead of 'self', so that we actually recurse. (-[WebFrame _firstLayoutDone]): New method (-[WebFrame _didFirstLayout]): Update firstLayoutDone * WebView/WebFramePrivate.h: Added firstLayoutDone ivar * WebView/WebView.m: (-[WebView _incrementProgressForConnectionDelegate:data:]): (1) Implemented 2a and 2b (2) Bug fix: only update the 'last time I sent a notification' time if we actually send a notification. (3) Don't test for progress < 0 because ensuring progress < max also ensures max - progress > 0. (Do still test for progress > max because rounding errors make that a possibility -- although a very minor one.) (4) Query only the loading frame and its subframes for pending requests instead of defaulting to the main frame. This is a slight optimization in cases where the main frame did not begin the load, and it makes the code more consistent. 2006-03-13 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. - fixed <rdar://problem/4475857> API: Setting a history item limit programmatically doesn't work * History/WebHistory.m: (-[WebHistoryPrivate _loadHistoryGuts:URL:error:]): use [self historyItemLimit], which prefers the explicitly-set value and falls back to the NSUserDefaults value, instead of using the NSUserDefaults value explicitly. 2006-03-10 Darin Adler <darin@apple.com> Reviewed by Adele. * WebCoreSupport/WebFrameBridge.m: Remove unused requestedURLString method. 2006-03-10 Darin Adler <darin@apple.com> Reviewed by Geoff. - change how frame namespacing works to be more completely on the WebCore side * WebView/WebFrameInternal.h: Remove _setFrameNamespace: and _frameNamespace. * WebView/WebFrame.m: Ditto. * WebView/WebView.m: (-[WebView setGroupName:]): Call -[WebCorePageBridge setGroupName:]. (-[WebView groupName]): Call -[WebCorePageBridge groupName]. 2006-03-09 Alexey Proskuryakov <ap@nypop.com> Reviewed by Darin. - http://bugs.webkit.org/show_bug.cgi?id=7656 Query string always appended to Flash URLs, instead of being replaced. * Misc/WebNSURLExtras.h: Added _webkit_URLByRemovingResourceSpecifier. * Misc/WebNSURLExtras.m: (+[NSURL _web_URLWithData:relativeToURL:]): Call _webkit_URLByRemovingResourceSpecifier to work around CFURL not removing non-path components from base URLs in some cases. (-[NSURL _webkit_URLByRemovingComponent:]): New generic function for removing URL components. (-[NSURL _webkit_URLByRemovingFragment]): Moved implementation to the above method. (-[NSURL _webkit_URLByRemovingResourceSpecifier]): Added. 2006-03-07 Darin Adler <darin@apple.com> Reviewed by Anders. - fix http://bugs.webkit.org/show_bug.cgi?id=7655 unwanted output while running layout tests * WebView/WebDataSourcePrivate.h: * WebView/WebDataSource.m: (-[WebDataSource _setRepresentation:]): Clear the flag that records whether we've sent all the data to the representation or not; need this to prevent telling the same representation both that we've succeeded and then later that we've failed. (-[WebDataSource _setMainDocumentError:]): Don't send an error if representationFinishedLoading is already YES. Set representationFinishedLoading. (-[WebDataSource _finishedLoading]): Set representationFinishedLoading. (-[WebDataSource _setupForReplaceByMIMEType:]): Ditto. 2006-03-06 Tim Omernick <timo@apple.com> Reviewed by Kevin Decker. <rdar://problem/4457574> assertion failure watching trailers at netflix.com -[WebNetscapePluginRepresentation receivedData:withDataSource:] + 684 * Plugins/WebNetscapePluginRepresentation.m: (-[WebNetscapePluginRepresentation receivedData:withDataSource:]): Moved the ASSERT(instance) to the block that actually requires an assertion -- the plugin view should never have a NULL instance by the time we start the NPStream (by calling -startStreamWithResponse:). Some stream teardown logic changed with my fix to 4153419: when a WebBaseNetscapePluginStream is destroyed, it now clears its NPP instance backpointer. The WebBaseNetscapePluginStream may be destroyed from within -startStreamWithResponse: if NPP_NewStream() returns an error. We can handle this gracefully by changing the assertion before -receivedData: to a simple NULL check. This is unrelated to the Radar, but prior to this fix, we would attempt an NPP_Write() with the initial stream data even if NPP_NewStream() returned an error. Seems like that alone could cause issues, though I'm guessing that plugins handle this in practice. 2006-03-03 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. <rdar://problem/4411822> wrong element shown in Inspector inspecting main image at apple.com <rdar://problem/4411908> in the Web Inspector, state of disclosure triangles should be preserved after search http://bugs.webkit.org/show_bug.cgi?id=6616 Bug 6616: Double-clicking on a search result seems broken http://bugs.webkit.org/show_bug.cgi?id=6709 Bug 6709: TypeError: Value undefined (result of expression treeScrollbar.refresh) is not object. Code clean up and move more code into JavaScript. Removes a few unused ObjC methods. Many search fixes. Reveals the focused node when exiting the search. Shows a "No Selection" screen when there are no search results. Shows a node count for the number of results. Fixes a couple of TypeErrors that show on the console. Uses the system selection color in the Style pane tables. * English.lproj/Localizable.strings: removed localized strings * WebInspector.subproj/WebInspector.m: (-[WebInspector init]): (-[WebInspector dealloc]): (-[WebInspector window]): (-[WebInspector setSearchQuery:]): (-[WebInspector resizeTopArea]): (-[WebInspector searchPerformed:]): called from JavaScript when a search happens (-[WebInspector _toggleIgnoreWhitespace:]): (-[WebInspector _exitSearch:]): exit search results on double click (-[WebInspector _focusRootNode:]): (-[WebInspector _revealAndSelectNodeInTree:]): (-[WebInspector _refreshSearch]): (-[WebInspector _update]): (-[WebInspector _updateTraversalButtons]): (-[WebInspector _updateRoot]): (-[WebInspector _updateTreeScrollbar]): (-[WebInspector _updateSystemColors]): update CSS with system colors (-[WebInspector webView:didFinishLoadForFrame:]): (-[WebInspector webView:plugInViewWithArguments:]): (-[WebInspector outlineViewSelectionDidChange:]): test for webViewLoaded (-[WebInspectorPrivate init]): alloc rightArrowImage and downArrowImage (-[WebInspectorPrivate dealloc]): no more matchedRules (-[DOMNode _displayName]): removed localization UI_STRING calls. * WebInspector.subproj/WebInspectorInternal.h: * WebInspector.subproj/webInspector/inspector.css: * WebInspector.subproj/webInspector/inspector.html: * WebInspector.subproj/webInspector/inspector.js: 2006-03-02 Alexey Proskuryakov <ap@nypop.com> Fixed a typo in the comments added in the previous checkin. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): * WebCoreSupport/WebSubresourceLoader.m: (+[WebSubresourceLoader startLoadingResource:withMethod:URL:customHeaders:referrer:forDataSource:]): (+[WebSubresourceLoader startLoadingResource:withMethod:URL:customHeaders:postData:referrer:forDataSource:]): 2006-03-02 Alexey Proskuryakov <ap@nypop.com> Reviewed by Darin. - http://bugs.webkit.org/show_bug.cgi?id=7540 REGRESSION: frequent cache-related crashes - http://bugs.webkit.org/show_bug.cgi?id=7393 A stale comment about XMLHttpRequest responses being never cached * WebCoreSupport/WebFrameBridge.m: Don't call setHTTPHeader if the method is GET. (-[WebFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): * WebCoreSupport/WebSubresourceLoader.m: Ditto. Also removed a stale comment about XMLHTTPRequests. (+[WebSubresourceLoader startLoadingResource:withMethod:URL:customHeaders:referrer:forDataSource:]): (+[WebSubresourceLoader startLoadingResource:withMethod:URL:customHeaders:postData:referrer:forDataSource:]): 2006-02-23 David Harrison <harrison@apple.com> Reviewed by Justin. <rdar://problem/4359736> Support outlining ability with lists Added Mail SPI for list level changes. It is SPI because it is not complete support for outlining. See <rdar://problem/4457070> "API for html lists as note outlines". * WebView/WebHTMLView.m: (-[WebHTMLView _canIncreaseSelectionListLevel]): (-[WebHTMLView _canDecreaseSelectionListLevel]): (-[WebHTMLView _increaseSelectionListLevel]): (-[WebHTMLView _decreaseSelectionListLevel]): * WebView/WebHTMLViewPrivate.h: 2006-03-01 Alexey Proskuryakov <ap@nypop.com> Reviewed by Darin. - http://bugs.webkit.org/show_bug.cgi?id=3812 XMLHttpRequest: PUT, DELETE, HEAD and all other methods but POST actually do a GET. All WebKit changes are to use the method parameter passed from WebCore. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:]): (-[WebFrameBridge startLoadingResource:withMethod:URL:customHeaders:postData:]): (-[WebFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): * WebCoreSupport/WebSubresourceLoader.h: * WebCoreSupport/WebSubresourceLoader.m: (+[WebSubresourceLoader startLoadingResource:withMethod:URL:customHeaders:referrer:forDataSource:]): (+[WebSubresourceLoader startLoadingResource:withMethod:URL:customHeaders:postData:referrer:forDataSource:]): 2006-03-01 Timothy Hatcher <timothy@apple.com> Reviewed by Darin. http://bugs.webkit.org/show_bug.cgi?id=7450 elementAtPoint is expensive and should return a smart dictionary <rdar://problem/2952761> moving the mouse around eats more CPU than I would expect (7450) elementAtPoint for WebHTMLView now returns a WebElementDictionary, when objectForKey is called it will lookup in the DOM, cache and return the value * Misc/WebElementDictionary.h: Added. * Misc/WebElementDictionary.m: Added. (addLookupKey): (cacheValueForKey): (+[WebElementDictionary initializeLookupTable]): (-[WebElementDictionary initWithInnerNonSharedNode:innerNode:URLElement:andPoint:]): (-[WebElementDictionary dealloc]): (-[WebElementDictionary _fillCache]): (-[WebElementDictionary count]): (-[WebElementDictionary keyEnumerator]): (-[WebElementDictionary objectForKey:]): (-[WebElementDictionary _domNode]): (-[WebElementDictionary _webFrame]): (-[WebElementDictionary _targetWebFrame]): (-[WebElementDictionary _title]): (-[WebElementDictionary _imageRect]): (-[WebElementDictionary _isSelected]): * Misc/WebNSViewExtras.m: (-[NSView _web_dragImage:element:rect:event:pasteboard:source:offset:]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebHTMLView.m: (-[WebHTMLView _updateMouseoverWithEvent:]): (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): (-[WebHTMLView elementAtPoint:]): * WebView/WebView.m: * WebView/WebViewPrivate.h: 2006-02-28 Darin Adler <darin@apple.com> Reviewed by Adele. - remove obsolete WebCoreScrollView class * WebView/WebDynamicScrollBarsView.h: Change base class to NSScrollView instead of WebCoreScrollView. * WebView/WebDynamicScrollBarsView.m: (-[WebDynamicScrollBarsView autoforwardsScrollWheelEvents]): Added. 2006-02-28 John Sullivan <sullivan@apple.com> Reviewed by Eric Seidel Wean WebKit from one more SPI call. We learned about this new-to-Tiger API from filing Radar 4433222. * WebView/WebHTMLView.m: (-[WebHTMLView _autoscroll]): use public CGEventSourceButtonState() instead of WKMouseIsDown() (which was using SPI internally) 2006-02-27 Tim Omernick <timo@apple.com> Reviewed by Adele. <rdar://problem/4222043> Safari should reduce null events sent to invisible plugins * Plugins/WebBaseNetscapePluginView.h: * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView restartNullEvents]): Check to see if the plugin view is completely obscured (scrolled out of view, for example). If it is obscured and it wasn't before, or the other way around, then restart the null event timer so it can fire at the appropriate rate. (-[WebBaseNetscapePluginView viewHasMoved:]): If a plugin is obscured, send it null events as if it were in an inactive window. 2006-02-26 Mitz Pettel <opendarwin.org@mitzpettel.com> Test: fast/frames/empty-frame-document.html Reviewed by Darin. - fix http://bugs.webkit.org/show_bug.cgi?id=7293 REGRESSION: Using Javascript Bookmarklets that reference location.href on a blank tab crashes WebKit The crash happened because an empty frame did not have a document. * WebView/WebFrame.m: (-[WebFrame _commitProvisionalLoad:]): Use "about:blank" instead of an empty URL for empty frames. This causes a document to be created for the frame. 2006-02-21 Kevin Decker <kdecker@apple.com> Reviewed by Darin. Backed out my previous check in. Since these methods are internal to WebKit (and not private) it's perfectly OK for them to remain as categories. * ChangeLog: * WebView/WebPreferences.m: (-[WebPreferences _integerValueForKey:]): (-[WebPreferences _setIntegerValue:forKey:]): (-[WebPreferences _floatValueForKey:]): (-[WebPreferences _setFloatValue:forKey:]): (-[WebPreferences _boolValueForKey:]): (-[WebPreferences _setBoolValue:forKey:]): * WebView/WebPreferencesPrivate.h: 2006-02-20 Darin Adler <darin@apple.com> Collaborated with Graham Dennis <Graham.Dennis@gmail.com> on this. - WebKit part of fix for http://bugs.webkit.org/show_bug.cgi?id=6831 contentEditable outline darkens as caret moves * WebCoreSupport/WebGraphicsBridge.m: (-[WebGraphicsBridge drawFocusRingWithPath:radius:color:]): Replaced the old bridge function that set up style with this one that renders a path. 2006-02-19 Darin Adler <darin@apple.com> Reviewed by Maciej. - cut out a little unneeded bridge code * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge webView]): Added. Helper, since the WebCore side of the bridge no longer has this method. (-[WebFrameBridge createWindowWithURL:]): Removed the frameName parameter -- this is now handled on the WebCore side. Also return a page bridge instead of a frame bridge. (-[WebFrameBridge createModalDialogWithURL:]): Changed to return a page bridge instead of a frame bridge. * WebView/WebFrame.m: (-[WebFrame webView]): Change to get the webView from the page bridge instead of the frame bridge, since it's a per-page thing. * WebView/WebView.m: Removed init method since it just does what the default does (calls initWithFrame: with a zero rect). (-[WebView initWithCoder:]): Added checking so that if the obejcts have the wrong type we will fail gracefully instead of hitting "method not found" and the like. (-[WebView setPreferencesIdentifier:]): Fix storage leak. The WebPreferences object was not released. (-[WebView mainFrame]): Removed excess "return nil". (-[WebView _pageBridge]): Added. Helper to let you go from the WebView to the bridge from outside the WebView class. * WebView/WebViewInternal.h: Put _pageBridge into an internal header. * WebCoreSupport/WebPageBridge.m: (-[WebPageBridge outerView]): Added. Replaces "webView" as public method to tell the WebCore side about the view everything's embedded in. - other cleanup * WebCoreSupport/WebPageBridge.h: Removed some unneeded declarations. * Plugins/WebBaseNetscapePluginView.m: (-[WebBaseNetscapePluginView loadPluginRequest:]): Rearrange code so it doesn't have to get the main frame twice. 2006-02-18 Maciej Stachowiak <mjs@apple.com> Not reviewed. - fix build broken by my last checkin, the remaining code was not doing anything. * WebView/WebDataSource.m: * WebView/WebDataSourcePrivate.h: * WebView/WebFrame.m: (-[WebFrame _createPageCacheForItem:]): 2006-02-16 Maciej Stachowiak <mjs@apple.com> Reviewed by Darin. - removed a few unused fields and methods of WebDataSource * WebView/WebDataSource.m: * WebView/WebDataSourcePrivate.h: * WebView/WebView.m: (+[WebView _MIMETypeForFile:]): (-[WebView _updateWebCoreSettingsFromPreferences:]): 2006-02-15 Justin Garcia <justin.garcia@apple.com> Reviewed by darin <http://bugs.webkit.org/show_bug.cgi?id=7148> Add drag and drop support to DumpRenderTree Added a UI delegate method so that DumpRenderTree can perform dragging on its own. Made _updateFocusState SPI, to allow us to test the behavior and appearance of windows that have or don't have focus. * WebView/WebHTMLView.m: (-[WebHTMLView _updateFocusState]): (-[WebHTMLView viewDidMoveToWindow]): (-[WebHTMLView windowDidBecomeKey:]): (-[WebHTMLView windowDidResignKey:]): (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]): (-[WebHTMLView becomeFirstResponder]): (-[WebHTMLView resignFirstResponder]): (-[WebHTMLView _formControlIsResigningFirstResponder:]): * WebView/WebHTMLViewInternal.h: * WebView/WebHTMLViewPrivate.h: * WebView/WebUIDelegatePrivate.h: * WebView/WebView.m: 2006-02-15 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes. 2006-02-15 Maciej Stachowiak <mjs@apple.com> Rubber stamped by Anders. * WebView/WebControllerPolicyHandlerDelegate.h: Removed. 2006-02-15 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. - remove some voodoo code * WebView/WebDataSource.m: (-[WebDataSource _setLoading:]): Removed useless ref/deref of self and WebView. A WebDataSource cannot be loading unless it is still connected to the WebView that owns it and retained by it, because getting disconnected stops loading. 2006-02-13 Maciej Stachowiak <mjs@apple.com> Reviewed by Anders. Improvements to frame loading: - remove LayoutAcceptable state entirely - fix WebImageView to work right without LayoutAcceptable state - move guts of commitIfReady: to WebFrame - try to separate page cache loading from normal loading a bit more * English.lproj/StringsNotToBeLocalized.txt: * WebView/WebDataSource.m: (-[WebDataSource _prepareForLoadStart]): (-[WebDataSource _loadFromPageCache:]): (-[WebDataSource _startLoading]): (-[WebDataSource _commitIfReady]): (-[WebDataSource _setupForReplaceByMIMEType:]): * WebView/WebDataSourcePrivate.h: * WebView/WebFrame.m: (-[WebFrame _transitionToCommitted:]): (-[WebFrame _commitProvisionalLoad:]): (-[WebFrame _checkLoadCompleteForThisFrame]): (-[WebFrame _continueLoadRequestAfterNavigationPolicy:formState:]): * WebView/WebFramePrivate.h: * WebView/WebImageRepresentation.h: * WebView/WebImageRepresentation.m: * WebView/WebImageView.m: (-[WebImageView dataSourceUpdated:]): (-[WebImageView setNeedsLayout:]): (-[WebImageView writeImageToPasteboard:types:]): (-[WebImageView copy:]): (-[WebImageView mouseDragged:]): * WebView/WebView.m: (-[WebView _finishedLoadingResourceFromDataSource:]): (-[WebView _mainReceivedBytesSoFar:fromDataSource:complete:]): 2006-02-13 John Sullivan <sullivan@apple.com> Reviewed by Tim Omernick. Support for highlighting multiple text matches. * WebView/WebHTMLViewPrivate.h: * WebView/WebHTMLView.m: (-[WebHTMLView highlightAllMatchesForString:caseSensitive:]): new method, calls through to bridge (-[WebHTMLView clearHighlightedMatches]): ditto * WebView/WebViewPrivate.h: * WebView/WebView.m: (-[WebView highlightAllMatchesForString:caseSensitive:]): new method, calls through to documentView. For now this is hardwired to only work with WebHTMLViews. (-[WebView clearHighlightedMatches]): ditto 2006-02-13 Darin Adler <darin@apple.com> Reviewed by Maciej. - move pointer from frame to page over to WebCore * WebCoreSupport/WebPageBridge.m: (-[WebPageBridge initWithMainFrameName:webView:frameView:]): Call super init to create the page before creating the main frame and calling setMainFrame: with it. * WebCoreSupport/WebFrameBridge.h: Remove page pointer, and change init function parameters. * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge initMainFrameWithPage:frameName:view:]): New function that is used only for the main frame. Passes the page over to the other side of the bridge. (-[WebFrameBridge initSubframeWithRenderer:frameName:view:]): New function that is used only for subframes. Passes the renderer over to the other side of the bridge. (-[WebFrameBridge mainFrame]): (-[WebFrameBridge webView]): (-[WebFrameBridge createWindowWithURL:frameName:]): (-[WebFrameBridge showWindow]): (-[WebFrameBridge areToolbarsVisible]): (-[WebFrameBridge setToolbarsVisible:]): (-[WebFrameBridge isStatusbarVisible]): (-[WebFrameBridge setStatusbarVisible:]): (-[WebFrameBridge setWindowFrame:]): (-[WebFrameBridge windowFrame]): (-[WebFrameBridge setWindowContentRect:]): (-[WebFrameBridge windowContentRect]): (-[WebFrameBridge setWindowIsResizable:]): (-[WebFrameBridge windowIsResizable]): (-[WebFrameBridge firstResponder]): (-[WebFrameBridge makeFirstResponder:]): (-[WebFrameBridge closeWindowSoon]): (-[WebFrameBridge runJavaScriptAlertPanelWithMessage:]): (-[WebFrameBridge runJavaScriptConfirmPanelWithMessage:]): (-[WebFrameBridge canRunBeforeUnloadConfirmPanel]): (-[WebFrameBridge runBeforeUnloadConfirmPanelWithMessage:]): (-[WebFrameBridge runJavaScriptTextInputPanelWithPrompt:defaultText:returningText:]): (-[WebFrameBridge addMessageToConsole:]): (-[WebFrameBridge runOpenPanelForFileButtonWithResultListener:]): (-[WebFrameBridge setStatusText:]): (-[WebFrameBridge syncLoadResourceWithURL:customHeaders:postData:finalURL:responseHeaders:statusCode:]): (-[WebFrameBridge focusWindow]): (-[WebFrameBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]): (-[WebFrameBridge userAgentForURL:]): (-[WebFrameBridge _nextKeyViewOutsideWebFrameViewsWithValidityCheck:]): (-[WebFrameBridge previousKeyViewOutsideWebFrameViews]): (-[WebFrameBridge defersLoading]): (-[WebFrameBridge setDefersLoading:]): (-[WebFrameBridge viewForPluginWithURL:attributeNames:attributeValues:MIMEType:]): (-[WebFrameBridge _preferences]): (-[WebFrameBridge selectWordBeforeMenuEvent]): (-[WebFrameBridge historyLength]): (-[WebFrameBridge canGoBackOrForward:]): (-[WebFrameBridge goBackOrForward:]): (-[WebFrameBridge print]): (-[WebFrameBridge pollForAppletInView:]): (-[WebFrameBridge respondToChangedContents]): (-[WebFrameBridge respondToChangedSelection]): (-[WebFrameBridge undoManager]): (-[WebFrameBridge issueCutCommand]): (-[WebFrameBridge issueCopyCommand]): (-[WebFrameBridge issuePasteCommand]): (-[WebFrameBridge issuePasteAndMatchStyleCommand]): (-[WebFrameBridge canPaste]): (-[WebFrameBridge overrideMediaType]): (-[WebFrameBridge isEditable]): (-[WebFrameBridge shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:]): (-[WebFrameBridge shouldBeginEditing:]): (-[WebFrameBridge shouldEndEditing:]): (-[WebFrameBridge windowObjectCleared]): (-[WebFrameBridge spellCheckerDocumentTag]): (-[WebFrameBridge isContinuousSpellCheckingEnabled]): (-[WebFrameBridge didFirstLayout]): (-[WebFrameBridge dashboardRegionsChanged:]): (-[WebFrameBridge createModalDialogWithURL:]): (-[WebFrameBridge canRunModal]): (-[WebFrameBridge runModal]): Change all calls to [_page webView] to use [self webView] instead. === WebKit-521.7 2006-02-11 Maciej Stachowiak <mjs@apple.com> Reviewed by Hyatt. - factor WebArchive creation code out of other classes into new WebArchiver http://bugs.webkit.org/show_bug.cgi?id=7208 * DOM/WebDOMOperations.m: (-[DOMNode webArchive]): (-[DOMRange webArchive]): * WebKit.xcodeproj/project.pbxproj: * WebView/WebArchiver.h: Added. * WebView/WebArchiver.m: Added. (+[WebArchiver _subframeArchivesForFrame:]): (+[WebArchiver archiveFrame:]): (+[WebArchiver _archiveCurrentStateForFrame:]): (+[WebArchiver _archiveWithMarkupString:fromFrame:nodes:]): (+[WebArchiver archiveRange:]): (+[WebArchiver archiveNode:]): (+[WebArchiver archiveSelectionInFrame:]): * WebView/WebDataSource.m: (-[WebDataSource webArchive]): * WebView/WebDataSourcePrivate.h: * WebView/WebHTMLView.m: (-[WebHTMLView _writeSelectionWithPasteboardTypes:toPasteboard:cachedAttributedString:]): (-[WebHTMLView _writeSelectionToPasteboard:]): * WebView/WebHTMLViewPrivate.h: 2006-02-11 Darin Adler <darin@apple.com> * English.lproj/StringsNotToBeLocalized.txt: Updated paths for recent changes in directory structure. 2006-02-11 David Kilzer <ddkilzer@kilzer.net> Reviewed by John Sullivan. - Fix http://bugs.webkit.org/show_bug.cgi?id=7171 No description in WebKitErrors.m for WebKitErrorPlugInWillHandleLoad * English.lproj/Localizable.strings: Added new UI_STRING(). * Misc/WebKitErrors.m: Added #define for description. (registerErrors): Added dictionary entry. 2006-02-09 Tim Omernick <timo@apple.com> Reviewed by Tim Hatcher. <rdar://problem/4153419> CrashTracer: 576 crashes in Safari at com.apple.WebKit: NPN_DestroyStream + 56 I never could reproduce this crasher, which seems to be caused by the Speed Download plugin. However, I did find a way to make the affected code more bulletproof for those who are experiencing the crash. * Plugins/WebBaseNetscapePluginStream.h: Keep a WebBaseNetscapePluginView instead of the WebNetscapePluginPackage, since the plugin view could potentially be deallocated before the stream finishes loading. * Plugins/WebBaseNetscapePluginStream.m: (-[WebBaseNetscapePluginStream _pluginCancelledConnectionError]): Use pluginView instead of plugin. (-[WebBaseNetscapePluginStream dealloc]): Assert that the plugin instance has been nulled out, since that's now part of the stream's teardown phase. Release pluginView instead of plugin. (-[WebBaseNetscapePluginStream setPluginPointer:]): Retain the plugin view instead of the plugin package, since the plugin view could be deallocated while the stream is running. This method now accepts a NULL argument so that we can easily clear out the pluginView backpointer (and other ivars derived from it). (-[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:]): Use pluginView instead of plugin. (-[WebBaseNetscapePluginStream _destroyStream]): ditto (-[WebBaseNetscapePluginStream finishedLoadingWithData:]): ditto (-[WebBaseNetscapePluginStream cancelLoadAndDestroyStreamWithError]): Set the plugin instance to NULL, so that the pluginView backpointer is released. This method is called for every plugin view's stream when the plugin view is stopped/destroyed. (-[WebBaseNetscapePluginStream _deliverData]): Use pluginView instead of plugin. == Rolled over to ChangeLog-2006-02-09 == �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/mac/PublicHeaderChangesFromTiger.txt���������������������������������������������������������0000644�0001750�0001750�00000002705�10714225174�017306� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������This file lists changes to WebKit public header files that have been made since WebKit-412, which shipped with Mac OS X 10.4. All of these changes will have to be approved by the Apple API approval process, or rolled out, before Apple ships a new version of WebKit. When you make changes to public header files, please update this file, in the same general style as the ChangeLog file (new entries at top). =============================================== 2005-08-01 John Sullivan <sullivan@apple.com> Removed -[DOMHTMLInputElement isTextField] from DOMExtensions.h. I changed it to _isTextField and put it in DOMPrivate.h instead, until we decide what we want to do about the public API. 2005-07-22 John Sullivan <sullivan@apple.com> Added -[DOMHTMLInputElement isTextField] to DOMExtensions.h (in WebCore, copied by build steps to WebKit). This is used by autocomplete code in Safari and could be moved there, but is a better fit in WebKit and is useful for developers. 2005-06-22 John Sullivan <sullivan@apple.com> Added the following values to the enum of WebMenuItem tags in WebUIDelegate.h: WebMenuItemTagOpenWithDefaultApplication, WebMenuItemPDFActualSize, WebMenuItemPDFZoomIn, WebMenuItemPDFZoomOut, WebMenuItemPDFAutoSize, WebMenuItemPDFSinglePage, WebMenuItemPDFFacingPages, WebMenuItemPDFContinuous, WebMenuItemPDFNextPage, WebMenuItemPDFPreviousPage, These are all used by the context menu for PDF documents. �����������������������������������������������������������WebKit/WebKit.xcodeproj/����������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024256�013524� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/WebKit.xcodeproj/project.pbxproj�������������������������������������������������������������0000644�0001750�0001750�00000566046�11260532745�016622� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 42; objects = { /* Begin PBXBuildFile section */ 065AD5A30B0C32C7005A2B1D /* WebContextMenuClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 065AD5A10B0C32C7005A2B1D /* WebContextMenuClient.h */; }; 065AD5A40B0C32C7005A2B1D /* WebContextMenuClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 065AD5A20B0C32C7005A2B1D /* WebContextMenuClient.mm */; }; 06693DDC0BFBA85200216072 /* WebInspectorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 06693DDA0BFBA85200216072 /* WebInspectorClient.h */; }; 06693DDD0BFBA85200216072 /* WebInspectorClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 06693DDB0BFBA85200216072 /* WebInspectorClient.mm */; }; 0AB752370FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AB752350FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h */; }; 0AB752380FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0AB752360FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm */; }; 0AEBFF630F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AEBFF610F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0AEBFF640F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0AEBFF620F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm */; }; 14D8252F0AF955090004F057 /* WebChromeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D8252D0AF955090004F057 /* WebChromeClient.h */; }; 14D825300AF955090004F057 /* WebChromeClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 14D8252E0AF955090004F057 /* WebChromeClient.mm */; }; 1A20D08B0ED384F20043FA9F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A20D08A0ED384F20043FA9F /* QuartzCore.framework */; }; 1A2D754D0DE480B900F0A648 /* WebIconFetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2D754B0DE480B900F0A648 /* WebIconFetcher.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1A2D754E0DE480B900F0A648 /* WebIconFetcher.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A2D754C0DE480B900F0A648 /* WebIconFetcher.mm */; }; 1A2D75500DE4810E00F0A648 /* WebIconFetcherInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2D754F0DE4810E00F0A648 /* WebIconFetcherInternal.h */; }; 1A2DBE9F0F251E3A0036F8A6 /* ProxyInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2DBE9D0F251E3A0036F8A6 /* ProxyInstance.h */; }; 1A2DBEA00F251E3A0036F8A6 /* ProxyInstance.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A2DBE9E0F251E3A0036F8A6 /* ProxyInstance.mm */; }; 1A4DF5220EC8C74D006BD4B4 /* WebNetscapePluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4DF5200EC8C74D006BD4B4 /* WebNetscapePluginView.h */; }; 1A4DF5230EC8C74D006BD4B4 /* WebNetscapePluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A4DF5210EC8C74D006BD4B4 /* WebNetscapePluginView.mm */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; }; 1A4DF5E40EC8D104006BD4B4 /* WebBaseNetscapePluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4DF5E20EC8D104006BD4B4 /* WebBaseNetscapePluginView.h */; }; 1A4DF5E50EC8D104006BD4B4 /* WebBaseNetscapePluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A4DF5E30EC8D104006BD4B4 /* WebBaseNetscapePluginView.mm */; }; 1A74A28E0F4F75400082E228 /* WebTextInputWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A74A28C0F4F75400082E228 /* WebTextInputWindowController.h */; }; 1A74A28F0F4F75400082E228 /* WebTextInputWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A74A28D0F4F75400082E228 /* WebTextInputWindowController.m */; }; 1A77B02E0EE7730500C8A1F9 /* WebPluginRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A77B02C0EE7730500C8A1F9 /* WebPluginRequest.h */; }; 1A77B02F0EE7730500C8A1F9 /* WebPluginRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */; }; 1A8DED500EE88B8A00F25022 /* HostedNetscapePluginStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8DED4E0EE88B8A00F25022 /* HostedNetscapePluginStream.h */; }; 1A8DED510EE88B8A00F25022 /* HostedNetscapePluginStream.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A8DED4F0EE88B8A00F25022 /* HostedNetscapePluginStream.mm */; }; 1AAF58940EDCCF15008D883D /* WebKitPluginAgent.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */; settings = {ATTRIBUTES = (Private, ); }; }; 1AAF58950EDCCF15008D883D /* WebKitPluginAgentReply.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588B0EDCCEA3008D883D /* WebKitPluginAgentReply.defs */; settings = {ATTRIBUTES = (Private, ); }; }; 1AAF58960EDCCF15008D883D /* WebKitPluginClient.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588C0EDCCEA3008D883D /* WebKitPluginClient.defs */; settings = {ATTRIBUTES = (Private, ); }; }; 1AAF58970EDCCF15008D883D /* WebKitPluginHost.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588D0EDCCEA3008D883D /* WebKitPluginHost.defs */; settings = {ATTRIBUTES = (Private, ); }; }; 1AAF58980EDCCF15008D883D /* WebKitPluginHostTypes.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588E0EDCCEA3008D883D /* WebKitPluginHostTypes.defs */; settings = {ATTRIBUTES = (Private, ); }; }; 1AAF5CEA0EDDE1FE008D883D /* NetscapePluginHostManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5CE40EDDE1FE008D883D /* NetscapePluginHostManager.h */; }; 1AAF5CEB0EDDE1FE008D883D /* NetscapePluginHostManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5CE50EDDE1FE008D883D /* NetscapePluginHostManager.mm */; }; 1AAF5CEC0EDDE1FE008D883D /* NetscapePluginHostProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5CE60EDDE1FE008D883D /* NetscapePluginHostProxy.h */; }; 1AAF5CED0EDDE1FE008D883D /* NetscapePluginHostProxy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5CE70EDDE1FE008D883D /* NetscapePluginHostProxy.mm */; }; 1AAF5CEE0EDDE1FE008D883D /* NetscapePluginInstanceProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5CE80EDDE1FE008D883D /* NetscapePluginInstanceProxy.h */; }; 1AAF5CEF0EDDE1FE008D883D /* NetscapePluginInstanceProxy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5CE90EDDE1FE008D883D /* NetscapePluginInstanceProxy.mm */; }; 1AAF5CF10EDDE586008D883D /* WebKitPluginHost.defs in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF588D0EDCCEA3008D883D /* WebKitPluginHost.defs */; }; 1AAF5D000EDDE604008D883D /* WebKitPluginClient.defs in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF588C0EDCCEA3008D883D /* WebKitPluginClient.defs */; settings = {ATTRIBUTES = (Server, ); }; }; 1AAF5D090EDDE71D008D883D /* WebKitPluginHostTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5D080EDDE71D008D883D /* WebKitPluginHostTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1AAF5D0F0EDDE7A7008D883D /* WebKitPluginAgent.defs in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */; }; 1AAF5FBF0EDE3A92008D883D /* WebHostedNetscapePluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5FBD0EDE3A92008D883D /* WebHostedNetscapePluginView.h */; }; 1AAF5FC00EDE3A92008D883D /* WebHostedNetscapePluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5FBE0EDE3A92008D883D /* WebHostedNetscapePluginView.mm */; }; 1AEA66D40DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEA66D20DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h */; }; 1AEA66D50DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AEA66D30DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm */; }; 1AEA66D80DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEA66D60DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.h */; }; 1AEA66D90DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AEA66D70DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.mm */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; }; 1AEA6A500DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEA6A4E0DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.h */; }; 1AEA6A510DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AEA6A4F0DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.mm */; }; 1C0D40870AC1C8F40009C113 /* WebKitVersionChecks.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0D40850AC1C8F40009C113 /* WebKitVersionChecks.h */; }; 1C0D40880AC1C8F40009C113 /* WebKitVersionChecks.m in Sources */ = {isa = PBXBuildFile; fileRef = 1C0D40860AC1C8F40009C113 /* WebKitVersionChecks.m */; }; 1C68F66F095B5FC100C2984E /* WebNodeHighlight.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C68F663095B5FC100C2984E /* WebNodeHighlight.h */; }; 1C68F670095B5FC100C2984E /* WebNodeHighlight.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C68F664095B5FC100C2984E /* WebNodeHighlight.mm */; }; 1C68F671095B5FC100C2984E /* WebNodeHighlightView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C68F665095B5FC100C2984E /* WebNodeHighlightView.h */; }; 1C68F672095B5FC100C2984E /* WebNodeHighlightView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C68F666095B5FC100C2984E /* WebNodeHighlightView.mm */; }; 1C7B0C660EB2464D00A28502 /* WebInspectorClientCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C7B0C650EB2464D00A28502 /* WebInspectorClientCF.cpp */; }; 1C8CB07A0AE9830C00B1F6E9 /* WebEditingDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C8CB0790AE9830C00B1F6E9 /* WebEditingDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1CCFFD130B1F81F2002EE926 /* OldWebAssertions.c in Sources */ = {isa = PBXBuildFile; fileRef = 1CCFFD120B1F81F2002EE926 /* OldWebAssertions.c */; }; 224100F3091818D900D2D266 /* WebPluginsPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 224100F2091818D900D2D266 /* WebPluginsPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 224100F90918190100D2D266 /* WebPluginsPrivate.m in Sources */ = {isa = PBXBuildFile; fileRef = 224100F80918190100D2D266 /* WebPluginsPrivate.m */; }; 225F881509F97E8A00423A40 /* WebPluginPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 225F881409F97E8A00423A40 /* WebPluginPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 226E9E6A09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 226E9E6809D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h */; }; 226E9E6B09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c in Sources */ = {isa = PBXBuildFile; fileRef = 226E9E6909D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; }; 22F219CC08D236730030E078 /* WebBackForwardListPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 37B6FB4E1063530C000FDB3B /* WebPDFDocumentExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 37B6FB4C1063530C000FDB3B /* WebPDFDocumentExtras.h */; }; 37B6FB4F1063530C000FDB3B /* WebPDFDocumentExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37B6FB4D1063530C000FDB3B /* WebPDFDocumentExtras.mm */; }; 37D1DCA81065928C0068F7EF /* WebJSPDFDoc.h in Headers */ = {isa = PBXBuildFile; fileRef = 37D1DCA61065928C0068F7EF /* WebJSPDFDoc.h */; }; 37D1DCA91065928C0068F7EF /* WebJSPDFDoc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37D1DCA71065928C0068F7EF /* WebJSPDFDoc.mm */; }; 41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F4484D10338E8C0030E55E /* WebWorkersPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41F4484E10338E8C0030E55E /* WebWorkersPrivate.mm */; }; 441793A60E34EE150055E1AE /* WebHTMLRepresentationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */; }; 4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */; settings = {ATTRIBUTES = (); }; }; 4BF99F910AE050BC00815C2B /* WebEditorClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */; }; 51079D170CED11B00077247D /* WebSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51079D140CED11B00077247D /* WebSecurityOrigin.mm */; }; 51079D180CED11B00077247D /* WebSecurityOriginInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51079D150CED11B00077247D /* WebSecurityOriginInternal.h */; }; 51079D190CED11B00077247D /* WebSecurityOriginPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51079D160CED11B00077247D /* WebSecurityOriginPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 511F3FD50CECC88F00852565 /* WebDatabaseManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 511F3FD10CECC88F00852565 /* WebDatabaseManager.mm */; }; 511F3FD60CECC88F00852565 /* WebDatabaseManagerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 511F3FD20CECC88F00852565 /* WebDatabaseManagerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 511F3FD70CECC88F00852565 /* WebDatabaseTrackerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 511F3FD30CECC88F00852565 /* WebDatabaseTrackerClient.h */; }; 511F3FD80CECC88F00852565 /* WebDatabaseTrackerClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 511F3FD40CECC88F00852565 /* WebDatabaseTrackerClient.mm */; }; 51494CD60C7EBDE0004178C5 /* WebIconDatabaseClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51494CD40C7EBDE0004178C5 /* WebIconDatabaseClient.h */; }; 51494CD70C7EBDE0004178C5 /* WebIconDatabaseClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51494CD50C7EBDE0004178C5 /* WebIconDatabaseClient.mm */; }; 51494D240C7EC1B7004178C5 /* WebNSNotificationCenterExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 51494D220C7EC1B6004178C5 /* WebNSNotificationCenterExtras.h */; }; 51494D250C7EC1B7004178C5 /* WebNSNotificationCenterExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 51494D230C7EC1B7004178C5 /* WebNSNotificationCenterExtras.m */; }; 5158F6EF106D862A00AF457C /* WebHistoryDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5158F6EE106D862A00AF457C /* WebHistoryDelegate.h */; }; 5185F62610712B80007AA393 /* WebNavigationData.h in Headers */ = {isa = PBXBuildFile; fileRef = 5185F62510712B80007AA393 /* WebNavigationData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5185F62810712B97007AA393 /* WebNavigationData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5185F62710712B97007AA393 /* WebNavigationData.mm */; }; 51AEDEF10CECF45700854328 /* WebDatabaseManagerInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51AEDEF00CECF45700854328 /* WebDatabaseManagerInternal.h */; }; 51B2A1000ADB15D0002A9BEE /* WebIconDatabaseDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B2A0FF0ADB15D0002A9BEE /* WebIconDatabaseDelegate.h */; }; 51C714FB0B20F79F00E5E33C /* WebBackForwardListInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C714FA0B20F79F00E5E33C /* WebBackForwardListInternal.h */; }; 51CBFCAD0D10E6C5002DBF51 /* WebCachedFramePlatformData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CBFCAC0D10E6C5002DBF51 /* WebCachedFramePlatformData.h */; }; 51FDC4D30B0AF5C100F84EB3 /* WebHistoryItemPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FDC4D20B0AF5C100F84EB3 /* WebHistoryItemPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5241ADF50B1BC48A004012BD /* WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 5241ADF30B1BC48A004012BD /* WebCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5241ADF60B1BC48A004012BD /* WebCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5241ADF40B1BC48A004012BD /* WebCache.mm */; }; 59C77F3510545F7E00506104 /* WebGeolocationMock.mm in Sources */ = {isa = PBXBuildFile; fileRef = 59C77F3310545F7E00506104 /* WebGeolocationMock.mm */; }; 59C77F4B105471E700506104 /* WebGeolocationMockPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 59C77F4A105471E700506104 /* WebGeolocationMockPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5D1638F30E35B45D00F3038E /* EmptyProtocolDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D1638F20E35B45D00F3038E /* EmptyProtocolDefinitions.h */; }; 5D7BF8140C2A1D90008CE06D /* WebInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D7BF8120C2A1D90008CE06D /* WebInspector.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5D7BF8150C2A1D90008CE06D /* WebInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5D7BF8130C2A1D90008CE06D /* WebInspector.mm */; }; 5DE83A7A0D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = 5DE83A740D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib */; }; 5DE83A7F0D0F7FAD00CAD12A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5DE83A7D0D0F7FAD00CAD12A /* Localizable.strings */; }; 5DE92FEF0BD7017E0059A5FD /* WebAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DE92FEE0BD7017E0059A5FD /* WebAssertions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 65488DA1084FBCCB00831AD0 /* WebNSDictionaryExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 65488D9F084FBCCB00831AD0 /* WebNSDictionaryExtras.h */; }; 65488DA2084FBCCB00831AD0 /* WebNSDictionaryExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 65488DA0084FBCCB00831AD0 /* WebNSDictionaryExtras.m */; }; 656D333E0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 656D333D0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 658A40960A14853B005E6987 /* WebDataSourceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 658A40950A14853B005E6987 /* WebDataSourceInternal.h */; }; 65E0F88408500917007E5CB9 /* WebNSURLRequestExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E0F88208500917007E5CB9 /* WebNSURLRequestExtras.h */; }; 65E0F88508500917007E5CB9 /* WebNSURLRequestExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 65E0F88308500917007E5CB9 /* WebNSURLRequestExtras.m */; }; 65E0F9E608500F23007E5CB9 /* WebNSUserDefaultsExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E0F9E408500F23007E5CB9 /* WebNSUserDefaultsExtras.h */; settings = {ATTRIBUTES = (Private, ); }; }; 65E0F9E708500F23007E5CB9 /* WebNSUserDefaultsExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 65E0F9E508500F23007E5CB9 /* WebNSUserDefaultsExtras.m */; }; 65EEDE57084FFC9E0002DB25 /* WebNSFileManagerExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 65EEDE55084FFC9E0002DB25 /* WebNSFileManagerExtras.h */; settings = {ATTRIBUTES = (Private, ); }; }; 65EEDE58084FFC9E0002DB25 /* WebNSFileManagerExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 65EEDE56084FFC9E0002DB25 /* WebNSFileManagerExtras.m */; }; 65FFB7FC0AD0B7D30048CD05 /* WebDocumentLoaderMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 65FFB7FA0AD0B7D30048CD05 /* WebDocumentLoaderMac.h */; }; 65FFB7FD0AD0B7D30048CD05 /* WebDocumentLoaderMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65FFB7FB0AD0B7D30048CD05 /* WebDocumentLoaderMac.mm */; }; 7E6FEF0808985A7200C44C3F /* WebScriptDebugDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E6FEF0508985A7200C44C3F /* WebScriptDebugDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 7E6FEF0908985A7200C44C3F /* WebScriptDebugDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.mm */; }; 9304B3000B02341500F7850D /* WebIconDatabaseInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 9304B2FF0B02341500F7850D /* WebIconDatabaseInternal.h */; }; 931633EB0AEDFF930062B92D /* WebFrameLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */; }; 931633EF0AEDFFAE0062B92D /* WebFrameLoaderClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */; }; 934C11670D8710BB00C32ABD /* WebDynamicScrollBarsViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 934C11660D8710BB00C32ABD /* WebDynamicScrollBarsViewInternal.h */; }; 934C4A910F01406C009372C0 /* WebNSObjectExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 934C4A900F01406C009372C0 /* WebNSObjectExtras.mm */; }; 934C4AA00F0141F7009372C0 /* WebResourceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 934C4A9F0F0141F7009372C0 /* WebResourceInternal.h */; }; 936A2DE80FD2D08000D312DB /* WebTextCompletionController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 936A2DE70FD2D08000D312DB /* WebTextCompletionController.mm */; }; 936A2DEA0FD2D08400D312DB /* WebTextCompletionController.h in Headers */ = {isa = PBXBuildFile; fileRef = 936A2DE90FD2D08400D312DB /* WebTextCompletionController.h */; }; 939810110824BF01008DF038 /* WebBackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607D020F50ED0ECA1767 /* WebBackForwardList.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810120824BF01008DF038 /* WebHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = F520FB190221DEFD01C1A525 /* WebHistory.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810130824BF01008DF038 /* WebHistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607F020F50ED0ECA1767 /* WebHistoryItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810140824BF01008DF038 /* WebHistoryPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F5B92B820223191D01C1A525 /* WebHistoryPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810150824BF01008DF038 /* WebURLsWithTitles.h in Headers */ = {isa = PBXBuildFile; fileRef = F5E0A76E02B8FEE401C1A525 /* WebURLsWithTitles.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810160824BF01008DF038 /* WebCoreStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = F59EAE3E0253C7EE018635CA /* WebCoreStatistics.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810180824BF01008DF038 /* WebIconDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = F528E3E9031E91AD01CA2ACA /* WebIconDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810190824BF01008DF038 /* WebIconDatabasePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F528E3EB031E91AD01CA2ACA /* WebIconDatabasePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9398101B0824BF01008DF038 /* WebKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 2568C72C0174912D0ECA149E /* WebKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9398101C0824BF01008DF038 /* WebKitErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = F5927D4E02D26C5E01CA2DBB /* WebKitErrors.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9398101D0824BF01008DF038 /* WebKitLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AEB17D032C1735008635CE /* WebKitLogging.h */; settings = {ATTRIBUTES = (); }; }; 9398101E0824BF01008DF038 /* WebKitNSStringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 7082F56F038EADAA00A80180 /* WebKitNSStringExtras.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9398101F0824BF01008DF038 /* WebKitStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = F53444CE02E87CBA018635CA /* WebKitStatistics.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810200824BF01008DF038 /* WebKitStatisticsPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F53444D202E87D4B018635CA /* WebKitStatisticsPrivate.h */; }; 939810210824BF01008DF038 /* WebNSControlExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 9345DDB20365FFD0008635CE /* WebNSControlExtras.h */; }; 939810220824BF01008DF038 /* WebNSImageExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 8398847A03426FB000BC5F5E /* WebNSImageExtras.h */; }; 939810230824BF01008DF038 /* WebNSPasteboardExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2B2474033A2DA800C1A526 /* WebNSPasteboardExtras.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810240824BF01008DF038 /* WebNSViewExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = F508946902B71D59018A9CD4 /* WebNSViewExtras.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810250824BF01008DF038 /* WebNSWindowExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 9345DDAE0365FB27008635CE /* WebNSWindowExtras.h */; }; 939810270824BF01008DF038 /* WebStringTruncator.h in Headers */ = {isa = PBXBuildFile; fileRef = F59668C802AD2923018635CA /* WebStringTruncator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810290824BF01008DF038 /* WebAuthenticationPanel.h in Headers */ = {isa = PBXBuildFile; fileRef = F8CA15B5029A39D901000122 /* WebAuthenticationPanel.h */; }; 9398102A0824BF01008DF038 /* WebPanelAuthenticationHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 93154EF103A41270008635CE /* WebPanelAuthenticationHandler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9398102B0824BF01008DF038 /* WebBaseNetscapePluginStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F5A672B90263866E01000102 /* WebBaseNetscapePluginStream.h */; }; 9398102E0824BF01008DF038 /* WebBasePluginPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E4AF46036652150000E506 /* WebBasePluginPackage.h */; }; 939810310824BF01008DF038 /* WebNetscapePluginPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = F5F7171E0288493C018635CA /* WebNetscapePluginPackage.h */; }; 939810340824BF01008DF038 /* WebNullPluginView.h in Headers */ = {isa = PBXBuildFile; fileRef = F5883BE0025E5E9D01000102 /* WebNullPluginView.h */; }; 939810350824BF01008DF038 /* WebPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 848DFF840365FE6A00CA2ACA /* WebPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810360824BF01008DF038 /* WebPluginContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 848DFF850365FE6A00CA2ACA /* WebPluginContainer.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810370824BF01008DF038 /* WebPluginController.h in Headers */ = {isa = PBXBuildFile; fileRef = 8467275C0367158500CA2ACA /* WebPluginController.h */; }; 939810380824BF01008DF038 /* WebPluginDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = F5F717200288493C018635CA /* WebPluginDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810390824BF01008DF038 /* WebPluginPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E4AF4B036659440000E506 /* WebPluginPackage.h */; }; 9398103A0824BF01008DF038 /* WebPluginViewFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 848DFF860365FE6A00CA2ACA /* WebPluginViewFactory.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810420824BF01008DF038 /* WebJavaScriptTextInputPanel.h in Headers */ = {isa = PBXBuildFile; fileRef = 9345D4EA0365C5B2008635CE /* WebJavaScriptTextInputPanel.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810460824BF01008DF038 /* WebViewFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = F5F7174C02885C5B018635CA /* WebViewFactory.h */; settings = {ATTRIBUTES = (); }; }; 939810470824BF01008DF038 /* WebKitPrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C283730284676D018635CA /* WebKitPrefix.h */; }; 939810490824BF01008DF038 /* WebClipView.h in Headers */ = {isa = PBXBuildFile; fileRef = 933D659903413FF2008635CE /* WebClipView.h */; }; 9398104B0824BF01008DF038 /* WebDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 39446070020F50ED0ECA1767 /* WebDataSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9398104C0824BF01008DF038 /* WebDataSourcePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 39446072020F50ED0ECA1767 /* WebDataSourcePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9398104E0824BF01008DF038 /* WebDefaultContextMenuDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5152FADD033FC50400CA2ACD /* WebDefaultContextMenuDelegate.h */; settings = {ATTRIBUTES = (); }; }; 9398104F0824BF01008DF038 /* WebDefaultPolicyDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5152FADF033FC50400CA2ACD /* WebDefaultPolicyDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810500824BF01008DF038 /* WebDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 35081DAE02B6D4F50ACA2ACA /* WebDocument.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810510824BF01008DF038 /* WebDynamicScrollBarsView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944606B020F50ED0ECA1767 /* WebDynamicScrollBarsView.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810520824BF01008DF038 /* WebFormDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D81DAB203EB0B2D00A80166 /* WebFormDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810530824BF01008DF038 /* WebFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 39446074020F50ED0ECA1767 /* WebFrame.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810540824BF01008DF038 /* WebFramePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CF0E249021361B00ECA16EA /* WebFramePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810550824BF01008DF038 /* WebHTMLRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 35081D9202B6D4D80ACA2ACA /* WebHTMLRepresentation.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810560824BF01008DF038 /* WebHTMLRepresentationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F5A55DC702BAA2E8018635CC /* WebHTMLRepresentationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810570824BF01008DF038 /* WebHTMLView.h in Headers */ = {isa = PBXBuildFile; fileRef = 35081D9402B6D4D80ACA2ACA /* WebHTMLView.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810580824BF01008DF038 /* WebHTMLViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 35081D9602B6D4D80ACA2ACA /* WebHTMLViewPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9398105B0824BF01008DF038 /* WebFrameLoadDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5152FAE5033FC52200CA2ACD /* WebFrameLoadDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9398105D0824BF01008DF038 /* WebPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944606E020F50ED0ECA1767 /* WebPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9398105E0824BF01008DF038 /* WebPreferencesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CAE9D070252A4130ECA16EA /* WebPreferencesPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9398105F0824BF01008DF038 /* WebRenderNode.h in Headers */ = {isa = PBXBuildFile; fileRef = F5F81C3902B67C26018635CA /* WebRenderNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810600824BF01008DF038 /* WebResourceLoadDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 513D422E034CF55A00CA2ACD /* WebResourceLoadDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810630824BF01008DF038 /* WebHistoryItemInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 516F296F03A6C45A00CA2D3A /* WebHistoryItemInternal.h */; }; 939810640824BF01008DF038 /* WebFormDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D36FD5E03F78F9E00A80166 /* WebFormDelegatePrivate.h */; }; 939810650824BF01008DF038 /* CarbonWindowAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = F7EBEE9003F9DBA103CA0DE6 /* CarbonWindowAdapter.h */; }; 939810660824BF01008DF038 /* CarbonWindowContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = F7EBEE9203F9DBA103CA0DE6 /* CarbonWindowContentView.h */; }; 939810670824BF01008DF038 /* CarbonWindowFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = F7EBEE9403F9DBA103CA0DE6 /* CarbonWindowFrame.h */; }; 939810680824BF01008DF038 /* HIViewAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = F7EBEE9A03F9DBA103CA0DE6 /* HIViewAdapter.h */; }; 939810690824BF01008DF038 /* HIWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = F7EBEEAA03F9DBA103CA0DE6 /* HIWebView.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9398106A0824BF01008DF038 /* CarbonUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = F79B974804019934036909D2 /* CarbonUtils.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9398106D0824BF01008DF038 /* WebKitErrorsPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 84CA5F7E042685E800CA2ACA /* WebKitErrorsPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9398106E0824BF01008DF038 /* WebFrameView.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A8B52E04282B5900CA2D3A /* WebFrameView.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9398106F0824BF01008DF038 /* WebFrameViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A8B53204282BD200CA2D3A /* WebFrameViewInternal.h */; }; 939810700824BF01008DF038 /* WebView.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A8B579042834F700CA2D3A /* WebView.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810710824BF01008DF038 /* WebViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A8B57D0428353A00CA2D3A /* WebViewPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810720824BF01008DF038 /* WebPolicyDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51443F9A0429392B00CA2D3A /* WebPolicyDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810730824BF01008DF038 /* WebPolicyDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51443F9C0429392B00CA2D3A /* WebPolicyDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810750824BF01008DF038 /* WebUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 515E27CC0458C86500CA2D3A /* WebUIDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810760824BF01008DF038 /* WebDefaultUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 515E27CF0458CA4B00CA2D3A /* WebDefaultUIDelegate.h */; }; 939810770824BF01008DF038 /* WebDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = 6578F5DE045F817400000128 /* WebDownload.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810790824BF01008DF038 /* WebLocalizableStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = BEE18F990472B73200CA289C /* WebLocalizableStrings.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9398107A0824BF01008DF038 /* WebKitSystemBits.h in Headers */ = {isa = PBXBuildFile; fileRef = BEE52D4A0473032500CA289C /* WebKitSystemBits.h */; }; 9398107E0824BF01008DF038 /* WebNSURLExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = BE6DC39904C62C4E004D0EF6 /* WebNSURLExtras.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9398107F0824BF01008DF038 /* WebDocumentInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = ED21B9810528F7AA003299AC /* WebDocumentInternal.h */; }; 939810800824BF01008DF038 /* WebDocumentPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 833987810543012D00EE146E /* WebDocumentPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810820824BF01008DF038 /* WebNSDataExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = BECD14290565830A005BB09C /* WebNSDataExtras.h */; }; 939810830824BF01008DF038 /* WebUIDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A7D44A0568AB2600E70EF6 /* WebUIDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810840824BF01008DF038 /* WebNSEventExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = BE887BFF056D3A6E009BB3E7 /* WebNSEventExtras.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810850824BF01008DF038 /* WebKeyGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 84723BE3056D719E0044BFEA /* WebKeyGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810870824BF01008DF038 /* WebNSPrintOperationExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = EDD1A5C605C83987008E3150 /* WebNSPrintOperationExtras.h */; }; 939810880824BF01008DF038 /* WebResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84311A1205EAAAF00088EDA4 /* WebResource.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810890824BF01008DF038 /* WebResourcePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 84311AF105EAB12B0088EDA4 /* WebResourcePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9398108D0824BF01008DF038 /* WebDefaultEditingDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = BE95BEE605FD0805006E1513 /* WebDefaultEditingDelegate.h */; }; 939810990824BF01008DF038 /* WebDOMOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 846171F90624AE5B0071A4A3 /* WebDOMOperations.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9398109A0824BF01008DF038 /* WebArchive.h in Headers */ = {isa = PBXBuildFile; fileRef = 8373435A0624EE0D00F3B289 /* WebArchive.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9398109B0824BF01008DF038 /* WebViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 930D02BB06275F640076701E /* WebViewInternal.h */; }; 9398109C0824BF01008DF038 /* WebFrameInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 930D02BD06275F710076701E /* WebFrameInternal.h */; }; 9398109D0824BF01008DF038 /* WebDOMOperationsPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AE905F062DE6A80075BBF9 /* WebDOMOperationsPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9398109E0824BF01008DF038 /* WebEditingDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = BE4FBECB0653DF47005EDE15 /* WebEditingDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810A00824BF01008DF038 /* WebJavaPlugIn.h in Headers */ = {isa = PBXBuildFile; fileRef = 51863EFC065419EB00E9E8DD /* WebJavaPlugIn.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810A10824BF01008DF038 /* WebHTMLViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93185DB506679F42005D5E7E /* WebHTMLViewInternal.h */; }; 939810A20824BF01008DF038 /* WebNSObjectExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D1FE13067EB10B009CE68A /* WebNSObjectExtras.h */; }; 939810A40824BF01008DF038 /* WebPDFView.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E94C3406C0321200A9B09E /* WebPDFView.h */; }; 939810A50824BF01008DF038 /* WebPDFRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E94C6806C0347500A9B09E /* WebPDFRepresentation.h */; }; 939810A80824BF01008DF038 /* WebPreferenceKeysPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE850CD06ECC79E005FAB05 /* WebPreferenceKeysPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810AC0824BF01008DF038 /* WebPluginViewFactoryPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E679780726D7CF006C7A36 /* WebPluginViewFactoryPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810AF0824BF01008DF038 /* WebFrameViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C6F14507920B93002449CD /* WebFrameViewPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810B00824BF01008DF038 /* WebPluginContainerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 65836F5E07EE425900682F95 /* WebPluginContainerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 939810B10824BF01008DF038 /* WebPluginContainerCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E1150307EFFEBF009B8BF7 /* WebPluginContainerCheck.h */; }; 939810B50824BF01008DF038 /* WebAuthenticationPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = 9345D17B0365BF35008635CE /* WebAuthenticationPanel.nib */; }; 939810B60824BF01008DF038 /* nullplugin.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F5883BDE025E5C6A01000102 /* nullplugin.tiff */; }; 939810B70824BF01008DF038 /* url_icon.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F5B67130023EDF8901C1A525 /* url_icon.tiff */; }; 939810BA0824BF01008DF038 /* IDNScriptWhiteList.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9325FBDC07D829AE00159862 /* IDNScriptWhiteList.txt */; }; 939810BC0824BF01008DF038 /* WebBackForwardList.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3944607E020F50ED0ECA1767 /* WebBackForwardList.mm */; }; 939810BD0824BF01008DF038 /* WebHistoryItem.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39446080020F50ED0ECA1767 /* WebHistoryItem.mm */; }; 939810BE0824BF01008DF038 /* WebURLsWithTitles.m in Sources */ = {isa = PBXBuildFile; fileRef = F5E0A76F02B8FEE401C1A525 /* WebURLsWithTitles.m */; }; 939810BF0824BF01008DF038 /* WebCoreStatistics.mm in Sources */ = {isa = PBXBuildFile; fileRef = F59EAE410253C8DE018635CA /* WebCoreStatistics.mm */; }; 939810C10824BF01008DF038 /* WebIconDatabase.mm in Sources */ = {isa = PBXBuildFile; fileRef = F528E3EA031E91AD01CA2ACA /* WebIconDatabase.mm */; }; 939810C30824BF01008DF038 /* WebKitLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = 93AEB17E032C1735008635CE /* WebKitLogging.m */; }; 939810C40824BF01008DF038 /* WebKitNSStringExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7082F570038EADAA00A80180 /* WebKitNSStringExtras.mm */; }; 939810C50824BF01008DF038 /* WebKitStatistics.m in Sources */ = {isa = PBXBuildFile; fileRef = F53444CF02E87CBA018635CA /* WebKitStatistics.m */; }; 939810C60824BF01008DF038 /* WebNSControlExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 9345DDB30365FFD0008635CE /* WebNSControlExtras.m */; }; 939810C70824BF01008DF038 /* WebNSImageExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 8398847B03426FB000BC5F5E /* WebNSImageExtras.m */; }; 939810C80824BF01008DF038 /* WebNSPasteboardExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED2B2475033A2DA800C1A526 /* WebNSPasteboardExtras.mm */; }; 939810C90824BF01008DF038 /* WebNSViewExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = F508946A02B71D59018A9CD4 /* WebNSViewExtras.m */; }; 939810CA0824BF01008DF038 /* WebNSWindowExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 9345DDAF0365FB27008635CE /* WebNSWindowExtras.m */; }; 939810CC0824BF01008DF038 /* WebStringTruncator.mm in Sources */ = {isa = PBXBuildFile; fileRef = F59668C902AD2923018635CA /* WebStringTruncator.mm */; }; 939810CF0824BF01008DF038 /* WebAuthenticationPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = F8CA15B6029A39D901000122 /* WebAuthenticationPanel.m */; }; 939810D00824BF01008DF038 /* WebPanelAuthenticationHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 93154EF203A41270008635CE /* WebPanelAuthenticationHandler.m */; }; 939810D10824BF01008DF038 /* WebBaseNetscapePluginStream.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5A672BA0263866E01000102 /* WebBaseNetscapePluginStream.mm */; }; 939810D30824BF01008DF038 /* WebBasePluginPackage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83E4AF47036652150000E506 /* WebBasePluginPackage.mm */; }; 939810D60824BF01008DF038 /* WebNetscapePluginPackage.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F7171F0288493C018635CA /* WebNetscapePluginPackage.mm */; }; 939810D90824BF01008DF038 /* WebNullPluginView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5883BE1025E5E9D01000102 /* WebNullPluginView.mm */; }; 939810DA0824BF01008DF038 /* WebPluginController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8467275D0367158500CA2ACA /* WebPluginController.mm */; }; 939810DB0824BF01008DF038 /* WebPluginDatabase.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F717210288493C018635CA /* WebPluginDatabase.mm */; }; 939810DC0824BF01008DF038 /* WebPluginPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E4AF4C036659440000E506 /* WebPluginPackage.m */; }; 939810DD0824BF01008DF038 /* npapi.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F717230288493C018635CA /* npapi.mm */; }; 939810E30824BF01008DF038 /* WebImageRendererFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */; }; 939810E40824BF01008DF038 /* WebJavaScriptTextInputPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9345D4EB0365C5B2008635CE /* WebJavaScriptTextInputPanel.m */; }; 939810E80824BF01008DF038 /* WebViewFactory.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F7174D02885C5B018635CA /* WebViewFactory.mm */; }; 939810EB0824BF01008DF038 /* WebClipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 933D659A03413FF2008635CE /* WebClipView.m */; }; 939810ED0824BF01008DF038 /* WebDataSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39446071020F50ED0ECA1767 /* WebDataSource.mm */; }; 939810EF0824BF01008DF038 /* WebDefaultContextMenuDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5152FADE033FC50400CA2ACD /* WebDefaultContextMenuDelegate.mm */; }; 939810F00824BF01008DF038 /* WebDefaultPolicyDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5152FAE0033FC50400CA2ACD /* WebDefaultPolicyDelegate.m */; }; 939810F10824BF01008DF038 /* WebDynamicScrollBarsView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3944606C020F50ED0ECA1767 /* WebDynamicScrollBarsView.mm */; }; 939810F20824BF01008DF038 /* WebFrame.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5143A370221DCCE01A80181 /* WebFrame.mm */; }; 939810F30824BF01008DF038 /* WebHTMLRepresentation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35081D9302B6D4D80ACA2ACA /* WebHTMLRepresentation.mm */; }; 939810F40824BF01008DF038 /* WebHTMLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35081D9502B6D4D80ACA2ACA /* WebHTMLView.mm */; }; 939810F80824BF01008DF038 /* WebPreferences.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5AEBB3D024A527601C1A526 /* WebPreferences.mm */; }; 939810F90824BF01008DF038 /* WebRenderNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F81C3A02B67C26018635CA /* WebRenderNode.mm */; }; 939810FC0824BF01008DF038 /* WebFormDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D81DAB303EB0B2D00A80166 /* WebFormDelegate.m */; }; 939810FD0824BF01008DF038 /* CarbonWindowAdapter.mm in Sources */ = {isa = PBXBuildFile; fileRef = F7EBEE9103F9DBA103CA0DE6 /* CarbonWindowAdapter.mm */; }; 939810FE0824BF01008DF038 /* CarbonWindowContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EBEE9303F9DBA103CA0DE6 /* CarbonWindowContentView.m */; }; 939810FF0824BF01008DF038 /* CarbonWindowFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EBEE9503F9DBA103CA0DE6 /* CarbonWindowFrame.m */; }; 939811000824BF01008DF038 /* HIViewAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EBEE9B03F9DBA103CA0DE6 /* HIViewAdapter.m */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; }; 939811010824BF01008DF038 /* CarbonUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = F79B974904019934036909D2 /* CarbonUtils.m */; }; 939811020824BF01008DF038 /* HIWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F7EBEEAB03F9DBA103CA0DE6 /* HIWebView.mm */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; }; 939811030824BF01008DF038 /* WebKitErrors.m in Sources */ = {isa = PBXBuildFile; fileRef = 83730F9803FB1E660004736E /* WebKitErrors.m */; }; 939811060824BF01008DF038 /* WebFrameView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51A8B52F04282B5900CA2D3A /* WebFrameView.mm */; }; 939811070824BF01008DF038 /* WebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51A8B57A042834F700CA2D3A /* WebView.mm */; }; 939811080824BF01008DF038 /* WebPolicyDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51443F9B0429392B00CA2D3A /* WebPolicyDelegate.mm */; }; 9398110A0824BF01008DF038 /* WebDefaultUIDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 515E27D00458CA4B00CA2D3A /* WebDefaultUIDelegate.m */; }; 9398110D0824BF01008DF038 /* WebLocalizableStrings.m in Sources */ = {isa = PBXBuildFile; fileRef = BEE18F9A0472B73200CA289C /* WebLocalizableStrings.m */; }; 9398110E0824BF01008DF038 /* WebKitSystemBits.m in Sources */ = {isa = PBXBuildFile; fileRef = BEE52D4B0473032500CA289C /* WebKitSystemBits.m */; }; 939811120824BF01008DF038 /* WebNSURLExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = BE6DC39A04C62C4E004D0EF6 /* WebNSURLExtras.mm */; }; 939811130824BF01008DF038 /* WebHistory.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65DA2608052CC18700A97B31 /* WebHistory.mm */; }; 939811150824BF01008DF038 /* WebNSDataExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = BECD142A0565830A005BB09C /* WebNSDataExtras.m */; }; 939811160824BF01008DF038 /* WebNSEventExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = BE887C00056D3A6E009BB3E7 /* WebNSEventExtras.m */; }; 939811170824BF01008DF038 /* WebKeyGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 84723BE4056D719E0044BFEA /* WebKeyGenerator.m */; }; 939811190824BF01008DF038 /* WebNSPrintOperationExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = EDD1A5C705C83987008E3150 /* WebNSPrintOperationExtras.m */; }; 9398111A0824BF01008DF038 /* WebResource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84311A1305EAAAF00088EDA4 /* WebResource.mm */; }; 9398111B0824BF01008DF038 /* WebDefaultEditingDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BE95BEE505FD0805006E1513 /* WebDefaultEditingDelegate.m */; }; 9398111C0824BF01008DF038 /* WebDOMOperations.mm in Sources */ = {isa = PBXBuildFile; fileRef = 846171FA0624AE5B0071A4A3 /* WebDOMOperations.mm */; }; 9398111D0824BF01008DF038 /* WebArchive.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8373435B0624EE0D00F3B289 /* WebArchive.mm */; }; 9398111E0824BF01008DF038 /* WebPDFView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E94C3506C0321200A9B09E /* WebPDFView.mm */; }; 9398111F0824BF01008DF038 /* WebPDFRepresentation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E94C6906C0347500A9B09E /* WebPDFRepresentation.mm */; }; 939811260824BF01008DF038 /* WebPluginContainerCheck.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65E1150407EFFEBF009B8BF7 /* WebPluginContainerCheck.mm */; }; 939811290824BF01008DF038 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C2869402846DCD018635CA /* Carbon.framework */; }; 9398112A0824BF01008DF038 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C2869502846DCD018635CA /* Cocoa.framework */; }; 9398112B0824BF01008DF038 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F738C9E903FAD3DF0321FBE0 /* JavaScriptCore.framework */; }; 9398112C0824BF01008DF038 /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F738C9EA03FAD3DF0321FBE0 /* WebCore.framework */; }; 9398112E0824BF01008DF038 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 93D623DD051E791F002F47DD /* libicucore.dylib */; }; 9398112F0824BF01008DF038 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 830E81E005853AC000AD0891 /* Security.framework */; }; 93EB178D09F88D460091F8FF /* WebSystemInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = 93EB178C09F88D460091F8FF /* WebSystemInterface.m */; }; 93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EB178E09F88D510091F8FF /* WebSystemInterface.h */; }; 93FDE9330D79CAF30074F029 /* WebHistoryInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FDE9320D79CAF30074F029 /* WebHistoryInternal.h */; }; A70936AF0B5608DC00CDB48E /* WebDragClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A70936AD0B5608DC00CDB48E /* WebDragClient.h */; }; A70936B00B5608DC00CDB48E /* WebDragClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = A70936AE0B5608DC00CDB48E /* WebDragClient.mm */; }; A7D3C5BC0B5773C5002CA450 /* WebPasteboardHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */; }; A7D3C5BD0B5773C5002CA450 /* WebPasteboardHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = A7D3C5BB0B5773C5002CA450 /* WebPasteboardHelper.mm */; }; AB9FBBBB0F8582B0006ADC43 /* WebDOMOperationsInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = AB9FBBBA0F8582B0006ADC43 /* WebDOMOperationsInternal.h */; }; ABDDF20D08EB0DDC001E1241 /* WebDownloadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */; }; B6CE5C24100BC5CE00219936 /* WebApplicationCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = B68049720FFBCEC1009F7F62 /* WebApplicationCache.mm */; }; B6CE5C25100BC5F500219936 /* WebApplicationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = B68049710FFBCEC1009F7F62 /* WebApplicationCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC2E464D0FD8A96800A9D9DE /* WebViewData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2E464B0FD8A96800A9D9DE /* WebViewData.h */; }; BC2E464E0FD8A96800A9D9DE /* WebViewData.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC2E464C0FD8A96800A9D9DE /* WebViewData.mm */; }; BC542C420FD7766F00D8AB5D /* WebDelegateImplementationCaching.h in Headers */ = {isa = PBXBuildFile; fileRef = BC542C400FD7766F00D8AB5D /* WebDelegateImplementationCaching.h */; }; BC542C430FD7766F00D8AB5D /* WebDelegateImplementationCaching.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC542C410FD7766F00D8AB5D /* WebDelegateImplementationCaching.mm */; }; C0167BF80D7F5DD00028696E /* WebScriptDebugger.h in Headers */ = {isa = PBXBuildFile; fileRef = C0167BF60D7F5DD00028696E /* WebScriptDebugger.h */; }; C0167BF90D7F5DD00028696E /* WebScriptDebugger.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0167BF70D7F5DD00028696E /* WebScriptDebugger.mm */; }; DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */; }; DD89682009AA87240097E7F0 /* WebElementDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = DD89681E09AA87240097E7F0 /* WebElementDictionary.h */; }; DD89682109AA87240097E7F0 /* WebElementDictionary.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */; }; E15663190FB61C1F00C199CA /* WebDownload.mm in Sources */ = {isa = PBXBuildFile; fileRef = E15663180FB61C1F00C199CA /* WebDownload.mm */; }; ED6BE2E7088C32B50044DEDC /* WebNSAttributedStringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = ED6BE2E5088C32B50044DEDC /* WebNSAttributedStringExtras.h */; }; ED6BE2E8088C32B50044DEDC /* WebNSAttributedStringExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED6BE2E6088C32B50044DEDC /* WebNSAttributedStringExtras.mm */; }; ED7F6D8B0980683500C235ED /* WebNSDataExtrasPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = ED7F6D8A0980683500C235ED /* WebNSDataExtrasPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; EDE983800BCDF5FE00FDAE28 /* WebNSArrayExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE9837E0BCDF5FE00FDAE28 /* WebNSArrayExtras.h */; }; EDE983810BCDF5FE00FDAE28 /* WebNSArrayExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = EDE9837F0BCDF5FE00FDAE28 /* WebNSArrayExtras.m */; }; F834AAD70E64B1C700E2737C /* WebTextIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = F834AAD50E64B1C700E2737C /* WebTextIterator.h */; settings = {ATTRIBUTES = (Private, ); }; }; F834AAD80E64B1C700E2737C /* WebTextIterator.mm in Sources */ = {isa = PBXBuildFile; fileRef = F834AAD60E64B1C700E2737C /* WebTextIterator.mm */; }; FEF52DFA0F6748F200FF70EE /* WebGeolocation.mm in Sources */ = {isa = PBXBuildFile; fileRef = FEF52DF70F6748F200FF70EE /* WebGeolocation.mm */; }; FEF52DFB0F6748F200FF70EE /* WebGeolocationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF52DF80F6748F200FF70EE /* WebGeolocationInternal.h */; }; FEF52DFC0F6748F200FF70EE /* WebGeolocationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF52DF90F6748F200FF70EE /* WebGeolocationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 065AD5A10B0C32C7005A2B1D /* WebContextMenuClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebContextMenuClient.h; sourceTree = "<group>"; }; 065AD5A20B0C32C7005A2B1D /* WebContextMenuClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuClient.mm; sourceTree = "<group>"; }; 06693DDA0BFBA85200216072 /* WebInspectorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebInspectorClient.h; sourceTree = "<group>"; }; 06693DDB0BFBA85200216072 /* WebInspectorClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspectorClient.mm; sourceTree = "<group>"; }; 0AB752350FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapeContainerCheckContextInfo.h; sourceTree = "<group>"; }; 0AB752360FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapeContainerCheckContextInfo.mm; sourceTree = "<group>"; }; 0AEBFF610F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = WebNetscapeContainerCheckPrivate.h; sourceTree = "<group>"; }; 0AEBFF620F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapeContainerCheckPrivate.mm; sourceTree = "<group>"; }; 14D8252D0AF955090004F057 /* WebChromeClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebChromeClient.h; sourceTree = "<group>"; }; 14D8252E0AF955090004F057 /* WebChromeClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebChromeClient.mm; sourceTree = "<group>"; }; 1A20D08A0ED384F20043FA9F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; }; 1A2D754B0DE480B900F0A648 /* WebIconFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconFetcher.h; sourceTree = "<group>"; }; 1A2D754C0DE480B900F0A648 /* WebIconFetcher.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebIconFetcher.mm; sourceTree = "<group>"; }; 1A2D754F0DE4810E00F0A648 /* WebIconFetcherInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconFetcherInternal.h; sourceTree = "<group>"; }; 1A2DBE9D0F251E3A0036F8A6 /* ProxyInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyInstance.h; sourceTree = "<group>"; }; 1A2DBE9E0F251E3A0036F8A6 /* ProxyInstance.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProxyInstance.mm; sourceTree = "<group>"; }; 1A4DF5200EC8C74D006BD4B4 /* WebNetscapePluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginView.h; sourceTree = "<group>"; }; 1A4DF5210EC8C74D006BD4B4 /* WebNetscapePluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapePluginView.mm; sourceTree = "<group>"; }; 1A4DF5E20EC8D104006BD4B4 /* WebBaseNetscapePluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebBaseNetscapePluginView.h; sourceTree = "<group>"; }; 1A4DF5E30EC8D104006BD4B4 /* WebBaseNetscapePluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebBaseNetscapePluginView.mm; sourceTree = "<group>"; }; 1A74A28C0F4F75400082E228 /* WebTextInputWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTextInputWindowController.h; sourceTree = "<group>"; }; 1A74A28D0F4F75400082E228 /* WebTextInputWindowController.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; path = WebTextInputWindowController.m; sourceTree = "<group>"; }; 1A77B02C0EE7730500C8A1F9 /* WebPluginRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginRequest.h; sourceTree = "<group>"; }; 1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginRequest.m; sourceTree = "<group>"; }; 1A8DED4E0EE88B8A00F25022 /* HostedNetscapePluginStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HostedNetscapePluginStream.h; sourceTree = "<group>"; }; 1A8DED4F0EE88B8A00F25022 /* HostedNetscapePluginStream.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HostedNetscapePluginStream.mm; sourceTree = "<group>"; }; 1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginAgent.defs; sourceTree = "<group>"; }; 1AAF588B0EDCCEA3008D883D /* WebKitPluginAgentReply.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginAgentReply.defs; sourceTree = "<group>"; }; 1AAF588C0EDCCEA3008D883D /* WebKitPluginClient.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginClient.defs; sourceTree = "<group>"; }; 1AAF588D0EDCCEA3008D883D /* WebKitPluginHost.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginHost.defs; sourceTree = "<group>"; }; 1AAF588E0EDCCEA3008D883D /* WebKitPluginHostTypes.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginHostTypes.defs; sourceTree = "<group>"; }; 1AAF5CE40EDDE1FE008D883D /* NetscapePluginHostManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapePluginHostManager.h; sourceTree = "<group>"; }; 1AAF5CE50EDDE1FE008D883D /* NetscapePluginHostManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetscapePluginHostManager.mm; sourceTree = "<group>"; }; 1AAF5CE60EDDE1FE008D883D /* NetscapePluginHostProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapePluginHostProxy.h; sourceTree = "<group>"; }; 1AAF5CE70EDDE1FE008D883D /* NetscapePluginHostProxy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetscapePluginHostProxy.mm; sourceTree = "<group>"; }; 1AAF5CE80EDDE1FE008D883D /* NetscapePluginInstanceProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapePluginInstanceProxy.h; sourceTree = "<group>"; }; 1AAF5CE90EDDE1FE008D883D /* NetscapePluginInstanceProxy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetscapePluginInstanceProxy.mm; sourceTree = "<group>"; }; 1AAF5D080EDDE71D008D883D /* WebKitPluginHostTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitPluginHostTypes.h; sourceTree = "<group>"; }; 1AAF5FBD0EDE3A92008D883D /* WebHostedNetscapePluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHostedNetscapePluginView.h; sourceTree = "<group>"; }; 1AAF5FBE0EDE3A92008D883D /* WebHostedNetscapePluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHostedNetscapePluginView.mm; sourceTree = "<group>"; }; 1AEA66D20DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginEventHandler.h; sourceTree = "<group>"; }; 1AEA66D30DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapePluginEventHandler.mm; sourceTree = "<group>"; }; 1AEA66D60DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginEventHandlerCarbon.h; sourceTree = "<group>"; }; 1AEA66D70DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapePluginEventHandlerCarbon.mm; sourceTree = "<group>"; }; 1AEA6A4E0DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginEventHandlerCocoa.h; sourceTree = "<group>"; }; 1AEA6A4F0DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapePluginEventHandlerCocoa.mm; sourceTree = "<group>"; }; 1C0D40850AC1C8F40009C113 /* WebKitVersionChecks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitVersionChecks.h; sourceTree = "<group>"; }; 1C0D40860AC1C8F40009C113 /* WebKitVersionChecks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitVersionChecks.m; sourceTree = "<group>"; }; 1C68F663095B5FC100C2984E /* WebNodeHighlight.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNodeHighlight.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; wrapsLines = 0; }; 1C68F664095B5FC100C2984E /* WebNodeHighlight.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebNodeHighlight.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 1C68F665095B5FC100C2984E /* WebNodeHighlightView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNodeHighlightView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 1C68F666095B5FC100C2984E /* WebNodeHighlightView.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebNodeHighlightView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 1C6CB03E0AA6391D00D23BFD /* MigrateHeaders.make */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = MigrateHeaders.make; path = mac/MigrateHeaders.make; sourceTree = "<group>"; }; 1C7B0C650EB2464D00A28502 /* WebInspectorClientCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebInspectorClientCF.cpp; path = cf/WebCoreSupport/WebInspectorClientCF.cpp; sourceTree = SOURCE_ROOT; }; 1C8CB0790AE9830C00B1F6E9 /* WebEditingDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebEditingDelegatePrivate.h; sourceTree = "<group>"; }; 1C904FD20BA9DD0F0081E9D0 /* WebKit.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebKit.xcconfig; sourceTree = "<group>"; }; 1C904FD30BA9DD0F0081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; }; 1C904FD40BA9DD0F0081E9D0 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; }; 1C904FD50BA9DD0F0081E9D0 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; }; 1CCFFD120B1F81F2002EE926 /* OldWebAssertions.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = OldWebAssertions.c; sourceTree = "<group>"; }; 224100F2091818D900D2D266 /* WebPluginsPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginsPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 224100F80918190100D2D266 /* WebPluginsPrivate.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginsPrivate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 225F881409F97E8A00423A40 /* WebPluginPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginPrivate.h; sourceTree = "<group>"; }; 226E9E6809D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapeDeprecatedFunctions.h; sourceTree = "<group>"; }; 226E9E6909D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = WebNetscapeDeprecatedFunctions.c; sourceTree = "<group>"; }; 22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBackForwardListPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 2568C72C0174912D0ECA149E /* WebKit.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKit.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 2D36FD5E03F78F9E00A80166 /* WebFormDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFormDelegatePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 2D81DAB203EB0B2D00A80166 /* WebFormDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFormDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 2D81DAB303EB0B2D00A80166 /* WebFormDelegate.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebFormDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 35081D9202B6D4D80ACA2ACA /* WebHTMLRepresentation.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; indentWidth = 4; path = WebHTMLRepresentation.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 35081D9302B6D4D80ACA2ACA /* WebHTMLRepresentation.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHTMLRepresentation.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 35081D9402B6D4D80ACA2ACA /* WebHTMLView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 35081D9502B6D4D80ACA2ACA /* WebHTMLView.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHTMLView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 35081D9602B6D4D80ACA2ACA /* WebHTMLViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLViewPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 35081DAE02B6D4F50ACA2ACA /* WebDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDocument.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 37B6FB4C1063530C000FDB3B /* WebPDFDocumentExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPDFDocumentExtras.h; sourceTree = "<group>"; }; 37B6FB4D1063530C000FDB3B /* WebPDFDocumentExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPDFDocumentExtras.mm; sourceTree = "<group>"; }; 37D1DCA61065928C0068F7EF /* WebJSPDFDoc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebJSPDFDoc.h; sourceTree = "<group>"; }; 37D1DCA71065928C0068F7EF /* WebJSPDFDoc.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = WebJSPDFDoc.mm; sourceTree = "<group>"; }; 3944606B020F50ED0ECA1767 /* WebDynamicScrollBarsView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDynamicScrollBarsView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 3944606C020F50ED0ECA1767 /* WebDynamicScrollBarsView.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebDynamicScrollBarsView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 3944606E020F50ED0ECA1767 /* WebPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPreferences.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 39446070020F50ED0ECA1767 /* WebDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDataSource.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 39446071020F50ED0ECA1767 /* WebDataSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDataSource.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 39446072020F50ED0ECA1767 /* WebDataSourcePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDataSourcePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 39446074020F50ED0ECA1767 /* WebFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrame.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 3944607D020F50ED0ECA1767 /* WebBackForwardList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBackForwardList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 3944607E020F50ED0ECA1767 /* WebBackForwardList.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebBackForwardList.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 3944607F020F50ED0ECA1767 /* WebHistoryItem.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryItem.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 39446080020F50ED0ECA1767 /* WebHistoryItem.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHistoryItem.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 41F4484D10338E8C0030E55E /* WebWorkersPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebWorkersPrivate.h; path = mac/Workers/WebWorkersPrivate.h; sourceTree = "<group>"; }; 41F4484E10338E8C0030E55E /* WebWorkersPrivate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebWorkersPrivate.mm; path = mac/Workers/WebWorkersPrivate.mm; sourceTree = "<group>"; }; 441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebHTMLRepresentationInternal.h; sourceTree = "<group>"; }; 449098B90F8F82DF0076A327 /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; }; 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebEditorClient.h; sourceTree = "<group>"; }; 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEditorClient.mm; sourceTree = "<group>"; }; 51079D140CED11B00077247D /* WebSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSecurityOrigin.mm; sourceTree = "<group>"; }; 51079D150CED11B00077247D /* WebSecurityOriginInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSecurityOriginInternal.h; sourceTree = "<group>"; }; 51079D160CED11B00077247D /* WebSecurityOriginPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSecurityOriginPrivate.h; sourceTree = "<group>"; }; 511F3FD10CECC88F00852565 /* WebDatabaseManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDatabaseManager.mm; sourceTree = "<group>"; }; 511F3FD20CECC88F00852565 /* WebDatabaseManagerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseManagerPrivate.h; sourceTree = "<group>"; }; 511F3FD30CECC88F00852565 /* WebDatabaseTrackerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseTrackerClient.h; sourceTree = "<group>"; }; 511F3FD40CECC88F00852565 /* WebDatabaseTrackerClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDatabaseTrackerClient.mm; sourceTree = "<group>"; }; 513D422E034CF55A00CA2ACD /* WebResourceLoadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceLoadDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51443F9A0429392B00CA2D3A /* WebPolicyDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPolicyDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51443F9B0429392B00CA2D3A /* WebPolicyDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPolicyDelegate.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51443F9C0429392B00CA2D3A /* WebPolicyDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPolicyDelegatePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51494CD40C7EBDE0004178C5 /* WebIconDatabaseClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebIconDatabaseClient.h; sourceTree = "<group>"; }; 51494CD50C7EBDE0004178C5 /* WebIconDatabaseClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebIconDatabaseClient.mm; sourceTree = "<group>"; }; 51494D220C7EC1B6004178C5 /* WebNSNotificationCenterExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNSNotificationCenterExtras.h; sourceTree = "<group>"; }; 51494D230C7EC1B7004178C5 /* WebNSNotificationCenterExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSNotificationCenterExtras.m; sourceTree = "<group>"; }; 5152FADD033FC50400CA2ACD /* WebDefaultContextMenuDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDefaultContextMenuDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 5152FADE033FC50400CA2ACD /* WebDefaultContextMenuDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDefaultContextMenuDelegate.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 5152FADF033FC50400CA2ACD /* WebDefaultPolicyDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDefaultPolicyDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 5152FAE0033FC50400CA2ACD /* WebDefaultPolicyDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDefaultPolicyDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 5152FAE5033FC52200CA2ACD /* WebFrameLoadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameLoadDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 5158F6EE106D862A00AF457C /* WebHistoryDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryDelegate.h; sourceTree = "<group>"; }; 515E27CC0458C86500CA2D3A /* WebUIDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebUIDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 515E27CF0458CA4B00CA2D3A /* WebDefaultUIDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDefaultUIDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 515E27D00458CA4B00CA2D3A /* WebDefaultUIDelegate.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDefaultUIDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 516F296F03A6C45A00CA2D3A /* WebHistoryItemInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryItemInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 5185F62510712B80007AA393 /* WebNavigationData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNavigationData.h; sourceTree = "<group>"; }; 5185F62710712B97007AA393 /* WebNavigationData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNavigationData.mm; sourceTree = "<group>"; }; 51863EFC065419EB00E9E8DD /* WebJavaPlugIn.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebJavaPlugIn.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51A8B52E04282B5900CA2D3A /* WebFrameView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51A8B52F04282B5900CA2D3A /* WebFrameView.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrameView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51A8B53204282BD200CA2D3A /* WebFrameViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameViewInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51A8B579042834F700CA2D3A /* WebView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51A8B57A042834F700CA2D3A /* WebView.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51A8B57D0428353A00CA2D3A /* WebViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebViewPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51AEDEF00CECF45700854328 /* WebDatabaseManagerInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseManagerInternal.h; sourceTree = "<group>"; }; 51B2A0FF0ADB15D0002A9BEE /* WebIconDatabaseDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabaseDelegate.h; sourceTree = "<group>"; }; 51C714FA0B20F79F00E5E33C /* WebBackForwardListInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebBackForwardListInternal.h; sourceTree = "<group>"; }; 51CBFCAC0D10E6C5002DBF51 /* WebCachedFramePlatformData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCachedFramePlatformData.h; sourceTree = "<group>"; }; 51E94C3406C0321200A9B09E /* WebPDFView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPDFView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51E94C3506C0321200A9B09E /* WebPDFView.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPDFView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51E94C6806C0347500A9B09E /* WebPDFRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPDFRepresentation.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51E94C6906C0347500A9B09E /* WebPDFRepresentation.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPDFRepresentation.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 51FDC4D20B0AF5C100F84EB3 /* WebHistoryItemPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryItemPrivate.h; sourceTree = "<group>"; }; 5241ADF30B1BC48A004012BD /* WebCache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCache.h; sourceTree = "<group>"; }; 5241ADF40B1BC48A004012BD /* WebCache.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCache.mm; sourceTree = "<group>"; }; 59C77F3310545F7E00506104 /* WebGeolocationMock.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebGeolocationMock.mm; sourceTree = "<group>"; }; 59C77F4A105471E700506104 /* WebGeolocationMockPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGeolocationMockPrivate.h; sourceTree = "<group>"; }; 5D1638F20E35B45D00F3038E /* EmptyProtocolDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmptyProtocolDefinitions.h; sourceTree = "<group>"; }; 5D7BF8120C2A1D90008CE06D /* WebInspector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebInspector.h; sourceTree = "<group>"; }; 5D7BF8130C2A1D90008CE06D /* WebInspector.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspector.mm; sourceTree = "<group>"; }; 5DE83A750D0F7F9400CAD12A /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/WebJavaScriptTextInputPanel.nib; sourceTree = SOURCE_ROOT; }; 5DE83A7E0D0F7FAD00CAD12A /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; 5DE92FEE0BD7017E0059A5FD /* WebAssertions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebAssertions.h; sourceTree = "<group>"; }; 65488D9F084FBCCB00831AD0 /* WebNSDictionaryExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSDictionaryExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 65488DA0084FBCCB00831AD0 /* WebNSDictionaryExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSDictionaryExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 656D333D0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebResourceLoadDelegatePrivate.h; sourceTree = "<group>"; }; 6578F5DE045F817400000128 /* WebDownload.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDownload.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 65836F5E07EE425900682F95 /* WebPluginContainerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginContainerPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 658A40950A14853B005E6987 /* WebDataSourceInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebDataSourceInternal.h; sourceTree = "<group>"; }; 65A7D44A0568AB2600E70EF6 /* WebUIDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebUIDelegatePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 65DA2608052CC18700A97B31 /* WebHistory.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHistory.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 65E0F88208500917007E5CB9 /* WebNSURLRequestExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSURLRequestExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 65E0F88308500917007E5CB9 /* WebNSURLRequestExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSURLRequestExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 65E0F9E408500F23007E5CB9 /* WebNSUserDefaultsExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSUserDefaultsExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 65E0F9E508500F23007E5CB9 /* WebNSUserDefaultsExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSUserDefaultsExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 65E1150307EFFEBF009B8BF7 /* WebPluginContainerCheck.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginContainerCheck.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 65E1150407EFFEBF009B8BF7 /* WebPluginContainerCheck.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPluginContainerCheck.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 65EEDE55084FFC9E0002DB25 /* WebNSFileManagerExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSFileManagerExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 65EEDE56084FFC9E0002DB25 /* WebNSFileManagerExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSFileManagerExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 65FFB7FA0AD0B7D30048CD05 /* WebDocumentLoaderMac.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebDocumentLoaderMac.h; sourceTree = "<group>"; }; 65FFB7FB0AD0B7D30048CD05 /* WebDocumentLoaderMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDocumentLoaderMac.mm; sourceTree = "<group>"; }; 7082F56F038EADAA00A80180 /* WebKitNSStringExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitNSStringExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 7082F570038EADAA00A80180 /* WebKitNSStringExtras.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; indentWidth = 4; path = WebKitNSStringExtras.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 7E6FEF0508985A7200C44C3F /* WebScriptDebugDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptDebugDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebScriptDebugDelegate.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 830E81E005853AC000AD0891 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; }; 833987810543012D00EE146E /* WebDocumentPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDocumentPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 83730F9803FB1E660004736E /* WebKitErrors.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitErrors.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 8373435A0624EE0D00F3B289 /* WebArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebArchive.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 8373435B0624EE0D00F3B289 /* WebArchive.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebArchive.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 8398847A03426FB000BC5F5E /* WebNSImageExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSImageExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 8398847B03426FB000BC5F5E /* WebNSImageExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSImageExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 83E4AF46036652150000E506 /* WebBasePluginPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBasePluginPackage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 83E4AF47036652150000E506 /* WebBasePluginPackage.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebBasePluginPackage.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 83E4AF4B036659440000E506 /* WebPluginPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginPackage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 83E4AF4C036659440000E506 /* WebPluginPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginPackage.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 83E679780726D7CF006C7A36 /* WebPluginViewFactoryPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginViewFactoryPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 84311A1205EAAAF00088EDA4 /* WebResource.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebResource.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 84311A1305EAAAF00088EDA4 /* WebResource.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebResource.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 84311AF105EAB12B0088EDA4 /* WebResourcePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebResourcePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 846171F90624AE5B0071A4A3 /* WebDOMOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDOMOperations.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 846171FA0624AE5B0071A4A3 /* WebDOMOperations.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDOMOperations.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 8467275C0367158500CA2ACA /* WebPluginController.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginController.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 8467275D0367158500CA2ACA /* WebPluginController.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPluginController.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 84723BE3056D719E0044BFEA /* WebKeyGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKeyGenerator.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 84723BE4056D719E0044BFEA /* WebKeyGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebKeyGenerator.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 848DFF840365FE6A00CA2ACA /* WebPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPlugin.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 848DFF850365FE6A00CA2ACA /* WebPluginContainer.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginContainer.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 848DFF860365FE6A00CA2ACA /* WebPluginViewFactory.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginViewFactory.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 84AE905F062DE6A80075BBF9 /* WebDOMOperationsPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDOMOperationsPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 84CA5F7E042685E800CA2ACA /* WebKitErrorsPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitErrorsPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9304B2FF0B02341500F7850D /* WebIconDatabaseInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabaseInternal.h; sourceTree = "<group>"; }; 930D02BB06275F640076701E /* WebViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebViewInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 930D02BD06275F710076701E /* WebFrameInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 93154EF103A41270008635CE /* WebPanelAuthenticationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPanelAuthenticationHandler.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 93154EF203A41270008635CE /* WebPanelAuthenticationHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebPanelAuthenticationHandler.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameLoaderClient.h; sourceTree = "<group>"; }; 931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrameLoaderClient.mm; sourceTree = "<group>"; }; 93185DB506679F42005D5E7E /* WebHTMLViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLViewInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9325FBDC07D829AE00159862 /* IDNScriptWhiteList.txt */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; path = IDNScriptWhiteList.txt; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 933D659903413FF2008635CE /* WebClipView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebClipView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 933D659A03413FF2008635CE /* WebClipView.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebClipView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9345D17C0365BF35008635CE /* English */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = wrapper.nib; name = English; path = Panels/English.lproj/WebAuthenticationPanel.nib; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9345D4EA0365C5B2008635CE /* WebJavaScriptTextInputPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebJavaScriptTextInputPanel.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9345D4EB0365C5B2008635CE /* WebJavaScriptTextInputPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebJavaScriptTextInputPanel.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9345DDAE0365FB27008635CE /* WebNSWindowExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSWindowExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9345DDAF0365FB27008635CE /* WebNSWindowExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSWindowExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9345DDB20365FFD0008635CE /* WebNSControlExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSControlExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9345DDB30365FFD0008635CE /* WebNSControlExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSControlExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 934C11660D8710BB00C32ABD /* WebDynamicScrollBarsViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDynamicScrollBarsViewInternal.h; sourceTree = "<group>"; }; 934C4A900F01406C009372C0 /* WebNSObjectExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNSObjectExtras.mm; sourceTree = "<group>"; }; 934C4A9F0F0141F7009372C0 /* WebResourceInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceInternal.h; sourceTree = "<group>"; }; 936A2DE70FD2D08000D312DB /* WebTextCompletionController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebTextCompletionController.mm; sourceTree = "<group>"; }; 936A2DE90FD2D08400D312DB /* WebTextCompletionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTextCompletionController.h; sourceTree = "<group>"; }; 939811320824BF01008DF038 /* Info.plist */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = mac/Info.plist; sourceTree = SOURCE_ROOT; tabWidth = 8; usesTabs = 1; }; 939811330824BF01008DF038 /* WebKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 93AEB17D032C1735008635CE /* WebKitLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitLogging.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 93AEB17E032C1735008635CE /* WebKitLogging.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitLogging.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 93C6F14507920B93002449CD /* WebFrameViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameViewPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 93D1FE13067EB10B009CE68A /* WebNSObjectExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSObjectExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 93D623DD051E791F002F47DD /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = /usr/lib/libicucore.dylib; sourceTree = "<absolute>"; }; 93EB178C09F88D460091F8FF /* WebSystemInterface.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebSystemInterface.m; sourceTree = "<group>"; }; 93EB178E09F88D510091F8FF /* WebSystemInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSystemInterface.h; sourceTree = "<group>"; }; 93FDE9320D79CAF30074F029 /* WebHistoryInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryInternal.h; sourceTree = "<group>"; }; 9CAE9D070252A4130ECA16EA /* WebPreferencesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPreferencesPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebImageRendererFactory.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9CF0E249021361B00ECA16EA /* WebFramePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFramePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; A70936AD0B5608DC00CDB48E /* WebDragClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebDragClient.h; sourceTree = "<group>"; }; A70936AE0B5608DC00CDB48E /* WebDragClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDragClient.mm; sourceTree = "<group>"; }; A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPasteboardHelper.h; sourceTree = "<group>"; }; A7D3C5BB0B5773C5002CA450 /* WebPasteboardHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPasteboardHelper.mm; sourceTree = "<group>"; }; AB9FBBBA0F8582B0006ADC43 /* WebDOMOperationsInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDOMOperationsInternal.h; sourceTree = "<group>"; }; ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDownloadInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; B68049710FFBCEC1009F7F62 /* WebApplicationCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebApplicationCache.h; sourceTree = "<group>"; }; B68049720FFBCEC1009F7F62 /* WebApplicationCache.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebApplicationCache.mm; sourceTree = "<group>"; }; BC2E464B0FD8A96800A9D9DE /* WebViewData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewData.h; sourceTree = "<group>"; }; BC2E464C0FD8A96800A9D9DE /* WebViewData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewData.mm; sourceTree = "<group>"; }; BC542C400FD7766F00D8AB5D /* WebDelegateImplementationCaching.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDelegateImplementationCaching.h; sourceTree = "<group>"; }; BC542C410FD7766F00D8AB5D /* WebDelegateImplementationCaching.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDelegateImplementationCaching.mm; sourceTree = "<group>"; }; BE4FBECB0653DF47005EDE15 /* WebEditingDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebEditingDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; BE6DC39904C62C4E004D0EF6 /* WebNSURLExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSURLExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; BE6DC39A04C62C4E004D0EF6 /* WebNSURLExtras.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNSURLExtras.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; BE887BFF056D3A6E009BB3E7 /* WebNSEventExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSEventExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; BE887C00056D3A6E009BB3E7 /* WebNSEventExtras.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSEventExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; BE95BEE505FD0805006E1513 /* WebDefaultEditingDelegate.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDefaultEditingDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; BE95BEE605FD0805006E1513 /* WebDefaultEditingDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDefaultEditingDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; BECD14290565830A005BB09C /* WebNSDataExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSDataExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; BECD142A0565830A005BB09C /* WebNSDataExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSDataExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; BEE18F990472B73200CA289C /* WebLocalizableStrings.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebLocalizableStrings.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; BEE18F9A0472B73200CA289C /* WebLocalizableStrings.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebLocalizableStrings.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; BEE52D4A0473032500CA289C /* WebKitSystemBits.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitSystemBits.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; BEE52D4B0473032500CA289C /* WebKitSystemBits.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitSystemBits.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; C0167BF60D7F5DD00028696E /* WebScriptDebugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptDebugger.h; sourceTree = "<group>"; }; C0167BF70D7F5DD00028696E /* WebScriptDebugger.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebScriptDebugger.mm; sourceTree = "<group>"; }; DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTypesInternal.h; sourceTree = "<group>"; }; DD89681E09AA87240097E7F0 /* WebElementDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebElementDictionary.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebElementDictionary.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; E15663180FB61C1F00C199CA /* WebDownload.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDownload.mm; sourceTree = "<group>"; }; ED21B9810528F7AA003299AC /* WebDocumentInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDocumentInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; ED2B2474033A2DA800C1A526 /* WebNSPasteboardExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSPasteboardExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; ED2B2475033A2DA800C1A526 /* WebNSPasteboardExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNSPasteboardExtras.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; ED3B48DE0CC51F7E00DFF1EB /* StringsNotToBeLocalized.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = StringsNotToBeLocalized.txt; sourceTree = SOURCE_ROOT; }; ED6BE2E5088C32B50044DEDC /* WebNSAttributedStringExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSAttributedStringExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; ED6BE2E6088C32B50044DEDC /* WebNSAttributedStringExtras.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNSAttributedStringExtras.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; ED7F6D8A0980683500C235ED /* WebNSDataExtrasPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNSDataExtrasPrivate.h; sourceTree = "<group>"; }; EDD1A5C605C83987008E3150 /* WebNSPrintOperationExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSPrintOperationExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; EDD1A5C705C83987008E3150 /* WebNSPrintOperationExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSPrintOperationExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; EDE850CD06ECC79E005FAB05 /* WebPreferenceKeysPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPreferenceKeysPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; EDE9837E0BCDF5FE00FDAE28 /* WebNSArrayExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNSArrayExtras.h; sourceTree = "<group>"; }; EDE9837F0BCDF5FE00FDAE28 /* WebNSArrayExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSArrayExtras.m; sourceTree = "<group>"; }; F508946902B71D59018A9CD4 /* WebNSViewExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSViewExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F508946A02B71D59018A9CD4 /* WebNSViewExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSViewExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5143A370221DCCE01A80181 /* WebFrame.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrame.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F520FB190221DEFD01C1A525 /* WebHistory.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHistory.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F528E3E9031E91AD01CA2ACA /* WebIconDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabase.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F528E3EA031E91AD01CA2ACA /* WebIconDatabase.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebIconDatabase.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F528E3EB031E91AD01CA2ACA /* WebIconDatabasePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabasePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F53444CE02E87CBA018635CA /* WebKitStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitStatistics.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F53444CF02E87CBA018635CA /* WebKitStatistics.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebKitStatistics.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F53444D202E87D4B018635CA /* WebKitStatisticsPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitStatisticsPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5883BDE025E5C6A01000102 /* nullplugin.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = nullplugin.tiff; sourceTree = "<group>"; }; F5883BE0025E5E9D01000102 /* WebNullPluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNullPluginView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5883BE1025E5E9D01000102 /* WebNullPluginView.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNullPluginView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5927D4E02D26C5E01CA2DBB /* WebKitErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitErrors.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F59668C802AD2923018635CA /* WebStringTruncator.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebStringTruncator.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F59668C902AD2923018635CA /* WebStringTruncator.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebStringTruncator.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F59EAE3E0253C7EE018635CA /* WebCoreStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreStatistics.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F59EAE410253C8DE018635CA /* WebCoreStatistics.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreStatistics.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5A55DC702BAA2E8018635CC /* WebHTMLRepresentationPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLRepresentationPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5A672B90263866E01000102 /* WebBaseNetscapePluginStream.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBaseNetscapePluginStream.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5A672BA0263866E01000102 /* WebBaseNetscapePluginStream.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebBaseNetscapePluginStream.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5AEBB3D024A527601C1A526 /* WebPreferences.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebPreferences.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5B67130023EDF8901C1A525 /* url_icon.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = url_icon.tiff; sourceTree = "<group>"; }; F5B92B820223191D01C1A525 /* WebHistoryPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5C283730284676D018635CA /* WebKitPrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = WebKitPrefix.h; path = mac/WebKitPrefix.h; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; F5C2869402846DCD018635CA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; }; F5C2869502846DCD018635CA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; F5E0A76E02B8FEE401C1A525 /* WebURLsWithTitles.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebURLsWithTitles.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5E0A76F02B8FEE401C1A525 /* WebURLsWithTitles.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebURLsWithTitles.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5F7171E0288493C018635CA /* WebNetscapePluginPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginPackage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5F7171F0288493C018635CA /* WebNetscapePluginPackage.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebNetscapePluginPackage.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5F717200288493C018635CA /* WebPluginDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginDatabase.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5F717210288493C018635CA /* WebPluginDatabase.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebPluginDatabase.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5F717230288493C018635CA /* npapi.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = npapi.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5F7174C02885C5B018635CA /* WebViewFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebViewFactory.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5F7174D02885C5B018635CA /* WebViewFactory.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewFactory.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5F732D202FF4D4F01A80180 /* WebKit.exp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.exports; name = WebKit.exp; path = mac/WebKit.exp; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; F5F81C3902B67C26018635CA /* WebRenderNode.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebRenderNode.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F5F81C3A02B67C26018635CA /* WebRenderNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebRenderNode.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F738C9E903FAD3DF0321FBE0 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F738C9EA03FAD3DF0321FBE0 /* WebCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F79B974804019934036909D2 /* CarbonUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = CarbonUtils.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F79B974904019934036909D2 /* CarbonUtils.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = CarbonUtils.m; sourceTree = "<group>"; usesTabs = 0; }; F7EBEE9003F9DBA103CA0DE6 /* CarbonWindowAdapter.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = CarbonWindowAdapter.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F7EBEE9103F9DBA103CA0DE6 /* CarbonWindowAdapter.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CarbonWindowAdapter.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F7EBEE9203F9DBA103CA0DE6 /* CarbonWindowContentView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = CarbonWindowContentView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F7EBEE9303F9DBA103CA0DE6 /* CarbonWindowContentView.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = CarbonWindowContentView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F7EBEE9403F9DBA103CA0DE6 /* CarbonWindowFrame.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = CarbonWindowFrame.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F7EBEE9503F9DBA103CA0DE6 /* CarbonWindowFrame.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = CarbonWindowFrame.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F7EBEE9A03F9DBA103CA0DE6 /* HIViewAdapter.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HIViewAdapter.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F7EBEE9B03F9DBA103CA0DE6 /* HIViewAdapter.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = HIViewAdapter.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F7EBEEAA03F9DBA103CA0DE6 /* HIWebView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HIWebView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F7EBEEAB03F9DBA103CA0DE6 /* HIWebView.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = HIWebView.mm; sourceTree = "<group>"; usesTabs = 0; }; F834AAD50E64B1C700E2737C /* WebTextIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTextIterator.h; sourceTree = "<group>"; }; F834AAD60E64B1C700E2737C /* WebTextIterator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebTextIterator.mm; sourceTree = "<group>"; }; F8CA15B5029A39D901000122 /* WebAuthenticationPanel.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebAuthenticationPanel.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; F8CA15B6029A39D901000122 /* WebAuthenticationPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebAuthenticationPanel.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; FEF52DF70F6748F200FF70EE /* WebGeolocation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebGeolocation.mm; sourceTree = "<group>"; }; FEF52DF80F6748F200FF70EE /* WebGeolocationInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGeolocationInternal.h; sourceTree = "<group>"; }; FEF52DF90F6748F200FF70EE /* WebGeolocationPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGeolocationPrivate.h; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 939811270824BF01008DF038 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 939811290824BF01008DF038 /* Carbon.framework in Frameworks */, 9398112A0824BF01008DF038 /* Cocoa.framework in Frameworks */, 9398112B0824BF01008DF038 /* JavaScriptCore.framework in Frameworks */, 9398112E0824BF01008DF038 /* libicucore.dylib in Frameworks */, 1A20D08B0ED384F20043FA9F /* QuartzCore.framework in Frameworks */, 9398112F0824BF01008DF038 /* Security.framework in Frameworks */, 9398112C0824BF01008DF038 /* WebCore.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 034768DFFF38A50411DB9C8B /* Products */ = { isa = PBXGroup; children = ( 939811330824BF01008DF038 /* WebKit.framework */, ); name = Products; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; 0867D691FE84028FC02AAC07 /* WebKit */ = { isa = PBXGroup; children = ( 1C6CB03E0AA6391D00D23BFD /* MigrateHeaders.make */, F5F732D202FF4D4F01A80180 /* WebKit.exp */, F5C283730284676D018635CA /* WebKitPrefix.h */, 6508A4A7099B375F00BCBF45 /* Default Delegates */, F57D194A034E732C01A80180 /* DOM */, 25A8176801B5474B0ECA149E /* History */, 254DC334016E1D3F0ECA149E /* Misc */, F8CA15B4029A399401000122 /* Panels */, F5EBC45202134BB601CA1520 /* Plugins */, 511F3FC30CECC7E200852565 /* Storage */, F5B36B400281DE87018635CB /* WebCoreSupport */, 9C7CABBB0190A37C0ECA16EA /* WebView */, 1C68F63F095B5F9C00C2984E /* WebInspector */, 41F4484C10338E570030E55E /* Workers */, F7EBEE5903F9DB2203CA0DE6 /* Carbon */, 089C1665FE841158C02AAC07 /* Resources */, 0867D69AFE84028FC02AAC07 /* Frameworks and Libraries */, 034768DFFF38A50411DB9C8B /* Products */, 1C904FCE0BA9DCF20081E9D0 /* Configurations */, ); name = WebKit; sourceTree = "<group>"; }; 0867D69AFE84028FC02AAC07 /* Frameworks and Libraries */ = { isa = PBXGroup; children = ( F5C2869402846DCD018635CA /* Carbon.framework */, F5C2869502846DCD018635CA /* Cocoa.framework */, F738C9E903FAD3DF0321FBE0 /* JavaScriptCore.framework */, 93D623DD051E791F002F47DD /* libicucore.dylib */, 1A20D08A0ED384F20043FA9F /* QuartzCore.framework */, 830E81E005853AC000AD0891 /* Security.framework */, F738C9EA03FAD3DF0321FBE0 /* WebCore.framework */, ); name = "Frameworks and Libraries"; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; 089C1665FE841158C02AAC07 /* Resources */ = { isa = PBXGroup; children = ( 9325FBDC07D829AE00159862 /* IDNScriptWhiteList.txt */, 939811320824BF01008DF038 /* Info.plist */, 5DE83A7D0D0F7FAD00CAD12A /* Localizable.strings */, F5883BDE025E5C6A01000102 /* nullplugin.tiff */, ED3B48DE0CC51F7E00DFF1EB /* StringsNotToBeLocalized.txt */, F5B67130023EDF8901C1A525 /* url_icon.tiff */, 5DE83A740D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib */, ); name = Resources; path = mac/Resources; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; 1A1F91430ECBB16F006351DA /* Hosted */ = { isa = PBXGroup; children = ( 1A8DED4E0EE88B8A00F25022 /* HostedNetscapePluginStream.h */, 1A8DED4F0EE88B8A00F25022 /* HostedNetscapePluginStream.mm */, 1AAF5CE40EDDE1FE008D883D /* NetscapePluginHostManager.h */, 1AAF5CE50EDDE1FE008D883D /* NetscapePluginHostManager.mm */, 1AAF5CE60EDDE1FE008D883D /* NetscapePluginHostProxy.h */, 1AAF5CE70EDDE1FE008D883D /* NetscapePluginHostProxy.mm */, 1AAF5CE80EDDE1FE008D883D /* NetscapePluginInstanceProxy.h */, 1AAF5CE90EDDE1FE008D883D /* NetscapePluginInstanceProxy.mm */, 1A2DBE9D0F251E3A0036F8A6 /* ProxyInstance.h */, 1A2DBE9E0F251E3A0036F8A6 /* ProxyInstance.mm */, 1AAF5FBD0EDE3A92008D883D /* WebHostedNetscapePluginView.h */, 1AAF5FBE0EDE3A92008D883D /* WebHostedNetscapePluginView.mm */, 1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */, 1AAF588B0EDCCEA3008D883D /* WebKitPluginAgentReply.defs */, 1AAF588C0EDCCEA3008D883D /* WebKitPluginClient.defs */, 1AAF588D0EDCCEA3008D883D /* WebKitPluginHost.defs */, 1AAF588E0EDCCEA3008D883D /* WebKitPluginHostTypes.defs */, 1AAF5D080EDDE71D008D883D /* WebKitPluginHostTypes.h */, 1A74A28C0F4F75400082E228 /* WebTextInputWindowController.h */, 1A74A28D0F4F75400082E228 /* WebTextInputWindowController.m */, ); path = Hosted; sourceTree = "<group>"; }; 1A9C78030EBBC455008599D4 /* Events */ = { isa = PBXGroup; children = ( 1AEA66D20DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h */, 1AEA66D30DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm */, 1AEA66D60DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.h */, 1AEA66D70DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.mm */, 1AEA6A4E0DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.h */, 1AEA6A4F0DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.mm */, ); name = Events; sourceTree = "<group>"; }; 1C68F63F095B5F9C00C2984E /* WebInspector */ = { isa = PBXGroup; children = ( 5D7BF8120C2A1D90008CE06D /* WebInspector.h */, 5D7BF8130C2A1D90008CE06D /* WebInspector.mm */, 1C68F663095B5FC100C2984E /* WebNodeHighlight.h */, 1C68F664095B5FC100C2984E /* WebNodeHighlight.mm */, 1C68F665095B5FC100C2984E /* WebNodeHighlightView.h */, 1C68F666095B5FC100C2984E /* WebNodeHighlightView.mm */, ); name = WebInspector; path = mac/WebInspector; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; 1C904FCE0BA9DCF20081E9D0 /* Configurations */ = { isa = PBXGroup; children = ( 1C904FD50BA9DD0F0081E9D0 /* Base.xcconfig */, 1C904FD40BA9DD0F0081E9D0 /* DebugRelease.xcconfig */, 449098B90F8F82DF0076A327 /* FeatureDefines.xcconfig */, 1C904FD30BA9DD0F0081E9D0 /* Version.xcconfig */, 1C904FD20BA9DD0F0081E9D0 /* WebKit.xcconfig */, ); name = Configurations; path = mac/Configurations; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; 254DC334016E1D3F0ECA149E /* Misc */ = { isa = PBXGroup; children = ( 5D1638F20E35B45D00F3038E /* EmptyProtocolDefinitions.h */, 1CCFFD120B1F81F2002EE926 /* OldWebAssertions.c */, 5DE92FEE0BD7017E0059A5FD /* WebAssertions.h */, 5241ADF30B1BC48A004012BD /* WebCache.h */, 5241ADF40B1BC48A004012BD /* WebCache.mm */, F59EAE3E0253C7EE018635CA /* WebCoreStatistics.h */, F59EAE410253C8DE018635CA /* WebCoreStatistics.mm */, 6578F5DE045F817400000128 /* WebDownload.h */, E15663180FB61C1F00C199CA /* WebDownload.mm */, ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */, DD89681E09AA87240097E7F0 /* WebElementDictionary.h */, DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */, F528E3E9031E91AD01CA2ACA /* WebIconDatabase.h */, F528E3EA031E91AD01CA2ACA /* WebIconDatabase.mm */, 51B2A0FF0ADB15D0002A9BEE /* WebIconDatabaseDelegate.h */, 9304B2FF0B02341500F7850D /* WebIconDatabaseInternal.h */, F528E3EB031E91AD01CA2ACA /* WebIconDatabasePrivate.h */, 1A2D754B0DE480B900F0A648 /* WebIconFetcher.h */, 1A2D754C0DE480B900F0A648 /* WebIconFetcher.mm */, 1A2D754F0DE4810E00F0A648 /* WebIconFetcherInternal.h */, 2568C72C0174912D0ECA149E /* WebKit.h */, F5927D4E02D26C5E01CA2DBB /* WebKitErrors.h */, 83730F9803FB1E660004736E /* WebKitErrors.m */, 84CA5F7E042685E800CA2ACA /* WebKitErrorsPrivate.h */, 93AEB17D032C1735008635CE /* WebKitLogging.h */, 93AEB17E032C1735008635CE /* WebKitLogging.m */, 7082F56F038EADAA00A80180 /* WebKitNSStringExtras.h */, 7082F570038EADAA00A80180 /* WebKitNSStringExtras.mm */, F53444CE02E87CBA018635CA /* WebKitStatistics.h */, F53444CF02E87CBA018635CA /* WebKitStatistics.m */, F53444D202E87D4B018635CA /* WebKitStatisticsPrivate.h */, BEE52D4A0473032500CA289C /* WebKitSystemBits.h */, BEE52D4B0473032500CA289C /* WebKitSystemBits.m */, 1C0D40850AC1C8F40009C113 /* WebKitVersionChecks.h */, 1C0D40860AC1C8F40009C113 /* WebKitVersionChecks.m */, BEE18F990472B73200CA289C /* WebLocalizableStrings.h */, BEE18F9A0472B73200CA289C /* WebLocalizableStrings.m */, EDE9837E0BCDF5FE00FDAE28 /* WebNSArrayExtras.h */, EDE9837F0BCDF5FE00FDAE28 /* WebNSArrayExtras.m */, ED6BE2E5088C32B50044DEDC /* WebNSAttributedStringExtras.h */, ED6BE2E6088C32B50044DEDC /* WebNSAttributedStringExtras.mm */, 9345DDB20365FFD0008635CE /* WebNSControlExtras.h */, 9345DDB30365FFD0008635CE /* WebNSControlExtras.m */, BECD14290565830A005BB09C /* WebNSDataExtras.h */, BECD142A0565830A005BB09C /* WebNSDataExtras.m */, ED7F6D8A0980683500C235ED /* WebNSDataExtrasPrivate.h */, 65488D9F084FBCCB00831AD0 /* WebNSDictionaryExtras.h */, 65488DA0084FBCCB00831AD0 /* WebNSDictionaryExtras.m */, BE887BFF056D3A6E009BB3E7 /* WebNSEventExtras.h */, BE887C00056D3A6E009BB3E7 /* WebNSEventExtras.m */, 65EEDE55084FFC9E0002DB25 /* WebNSFileManagerExtras.h */, 65EEDE56084FFC9E0002DB25 /* WebNSFileManagerExtras.m */, 8398847A03426FB000BC5F5E /* WebNSImageExtras.h */, 8398847B03426FB000BC5F5E /* WebNSImageExtras.m */, 51494D220C7EC1B6004178C5 /* WebNSNotificationCenterExtras.h */, 51494D230C7EC1B7004178C5 /* WebNSNotificationCenterExtras.m */, 93D1FE13067EB10B009CE68A /* WebNSObjectExtras.h */, 934C4A900F01406C009372C0 /* WebNSObjectExtras.mm */, ED2B2474033A2DA800C1A526 /* WebNSPasteboardExtras.h */, ED2B2475033A2DA800C1A526 /* WebNSPasteboardExtras.mm */, EDD1A5C605C83987008E3150 /* WebNSPrintOperationExtras.h */, EDD1A5C705C83987008E3150 /* WebNSPrintOperationExtras.m */, BE6DC39904C62C4E004D0EF6 /* WebNSURLExtras.h */, BE6DC39A04C62C4E004D0EF6 /* WebNSURLExtras.mm */, 65E0F88208500917007E5CB9 /* WebNSURLRequestExtras.h */, 65E0F88308500917007E5CB9 /* WebNSURLRequestExtras.m */, 65E0F9E408500F23007E5CB9 /* WebNSUserDefaultsExtras.h */, 65E0F9E508500F23007E5CB9 /* WebNSUserDefaultsExtras.m */, F508946902B71D59018A9CD4 /* WebNSViewExtras.h */, F508946A02B71D59018A9CD4 /* WebNSViewExtras.m */, 9345DDAE0365FB27008635CE /* WebNSWindowExtras.h */, 9345DDAF0365FB27008635CE /* WebNSWindowExtras.m */, F59668C802AD2923018635CA /* WebStringTruncator.h */, F59668C902AD2923018635CA /* WebStringTruncator.mm */, DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */, ); name = Misc; path = mac/Misc; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; 25A8176801B5474B0ECA149E /* History */ = { isa = PBXGroup; children = ( 3944607D020F50ED0ECA1767 /* WebBackForwardList.h */, 3944607E020F50ED0ECA1767 /* WebBackForwardList.mm */, 51C714FA0B20F79F00E5E33C /* WebBackForwardListInternal.h */, 22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */, F520FB190221DEFD01C1A525 /* WebHistory.h */, 65DA2608052CC18700A97B31 /* WebHistory.mm */, 93FDE9320D79CAF30074F029 /* WebHistoryInternal.h */, 3944607F020F50ED0ECA1767 /* WebHistoryItem.h */, 39446080020F50ED0ECA1767 /* WebHistoryItem.mm */, 516F296F03A6C45A00CA2D3A /* WebHistoryItemInternal.h */, 51FDC4D20B0AF5C100F84EB3 /* WebHistoryItemPrivate.h */, F5B92B820223191D01C1A525 /* WebHistoryPrivate.h */, F5E0A76E02B8FEE401C1A525 /* WebURLsWithTitles.h */, F5E0A76F02B8FEE401C1A525 /* WebURLsWithTitles.m */, ); name = History; path = mac/History; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; 41F4484C10338E570030E55E /* Workers */ = { isa = PBXGroup; children = ( 41F4484D10338E8C0030E55E /* WebWorkersPrivate.h */, 41F4484E10338E8C0030E55E /* WebWorkersPrivate.mm */, ); name = Workers; sourceTree = "<group>"; }; 511F3FC30CECC7E200852565 /* Storage */ = { isa = PBXGroup; children = ( 511F3FD10CECC88F00852565 /* WebDatabaseManager.mm */, 51AEDEF00CECF45700854328 /* WebDatabaseManagerInternal.h */, 511F3FD20CECC88F00852565 /* WebDatabaseManagerPrivate.h */, 511F3FD30CECC88F00852565 /* WebDatabaseTrackerClient.h */, 511F3FD40CECC88F00852565 /* WebDatabaseTrackerClient.mm */, 51079D140CED11B00077247D /* WebSecurityOrigin.mm */, 51079D150CED11B00077247D /* WebSecurityOriginInternal.h */, 51079D160CED11B00077247D /* WebSecurityOriginPrivate.h */, ); name = Storage; path = mac/Storage; sourceTree = "<group>"; }; 51E94C0706C02CA300A9B09E /* PDF */ = { isa = PBXGroup; children = ( 37D1DCA61065928C0068F7EF /* WebJSPDFDoc.h */, 37D1DCA71065928C0068F7EF /* WebJSPDFDoc.mm */, 37B6FB4C1063530C000FDB3B /* WebPDFDocumentExtras.h */, 37B6FB4D1063530C000FDB3B /* WebPDFDocumentExtras.mm */, 51E94C6806C0347500A9B09E /* WebPDFRepresentation.h */, 51E94C6906C0347500A9B09E /* WebPDFRepresentation.mm */, 51E94C3406C0321200A9B09E /* WebPDFView.h */, 51E94C3506C0321200A9B09E /* WebPDFView.mm */, ); name = PDF; sourceTree = "<group>"; }; 6508A4A7099B375F00BCBF45 /* Default Delegates */ = { isa = PBXGroup; children = ( 5152FADD033FC50400CA2ACD /* WebDefaultContextMenuDelegate.h */, 5152FADE033FC50400CA2ACD /* WebDefaultContextMenuDelegate.mm */, BE95BEE605FD0805006E1513 /* WebDefaultEditingDelegate.h */, BE95BEE505FD0805006E1513 /* WebDefaultEditingDelegate.m */, 5152FADF033FC50400CA2ACD /* WebDefaultPolicyDelegate.h */, 5152FAE0033FC50400CA2ACD /* WebDefaultPolicyDelegate.m */, 515E27CF0458CA4B00CA2D3A /* WebDefaultUIDelegate.h */, 515E27D00458CA4B00CA2D3A /* WebDefaultUIDelegate.m */, ); name = "Default Delegates"; path = mac/DefaultDelegates; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; 848DFF410365F6FB00CA2ACA /* Netscape Plug-ins */ = { isa = PBXGroup; children = ( 1A9C78030EBBC455008599D4 /* Events */, 1A1F91430ECBB16F006351DA /* Hosted */, F5F717230288493C018635CA /* npapi.mm */, F5A672B90263866E01000102 /* WebBaseNetscapePluginStream.h */, F5A672BA0263866E01000102 /* WebBaseNetscapePluginStream.mm */, 1A4DF5E20EC8D104006BD4B4 /* WebBaseNetscapePluginView.h */, 1A4DF5E30EC8D104006BD4B4 /* WebBaseNetscapePluginView.mm */, 0AB752350FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h */, 0AB752360FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm */, 0AEBFF610F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h */, 0AEBFF620F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm */, 226E9E6909D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c */, 226E9E6809D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h */, F5F7171E0288493C018635CA /* WebNetscapePluginPackage.h */, F5F7171F0288493C018635CA /* WebNetscapePluginPackage.mm */, 1A4DF5200EC8C74D006BD4B4 /* WebNetscapePluginView.h */, 1A4DF5210EC8C74D006BD4B4 /* WebNetscapePluginView.mm */, 1A77B02C0EE7730500C8A1F9 /* WebPluginRequest.h */, 1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */, ); name = "Netscape Plug-ins"; sourceTree = "<group>"; }; 848DFF430365F71500CA2ACA /* WebKit Plug-ins */ = { isa = PBXGroup; children = ( 51863EFC065419EB00E9E8DD /* WebJavaPlugIn.h */, 848DFF840365FE6A00CA2ACA /* WebPlugin.h */, 848DFF850365FE6A00CA2ACA /* WebPluginContainer.h */, 65E1150307EFFEBF009B8BF7 /* WebPluginContainerCheck.h */, 65E1150407EFFEBF009B8BF7 /* WebPluginContainerCheck.mm */, 65836F5E07EE425900682F95 /* WebPluginContainerPrivate.h */, 8467275C0367158500CA2ACA /* WebPluginController.h */, 8467275D0367158500CA2ACA /* WebPluginController.mm */, 83E4AF4B036659440000E506 /* WebPluginPackage.h */, 83E4AF4C036659440000E506 /* WebPluginPackage.m */, 225F881409F97E8A00423A40 /* WebPluginPrivate.h */, 848DFF860365FE6A00CA2ACA /* WebPluginViewFactory.h */, 83E679780726D7CF006C7A36 /* WebPluginViewFactoryPrivate.h */, ); name = "WebKit Plug-ins"; sourceTree = "<group>"; }; 9C7CABBB0190A37C0ECA16EA /* WebView */ = { isa = PBXGroup; children = ( F52CA6BD02DF9D0F018635CA /* HTML */, 51E94C0706C02CA300A9B09E /* PDF */, 8373435A0624EE0D00F3B289 /* WebArchive.h */, 8373435B0624EE0D00F3B289 /* WebArchive.mm */, 933D659903413FF2008635CE /* WebClipView.h */, 933D659A03413FF2008635CE /* WebClipView.m */, 39446070020F50ED0ECA1767 /* WebDataSource.h */, 39446071020F50ED0ECA1767 /* WebDataSource.mm */, 658A40950A14853B005E6987 /* WebDataSourceInternal.h */, 39446072020F50ED0ECA1767 /* WebDataSourcePrivate.h */, BC542C400FD7766F00D8AB5D /* WebDelegateImplementationCaching.h */, BC542C410FD7766F00D8AB5D /* WebDelegateImplementationCaching.mm */, 35081DAE02B6D4F50ACA2ACA /* WebDocument.h */, ED21B9810528F7AA003299AC /* WebDocumentInternal.h */, 65FFB7FA0AD0B7D30048CD05 /* WebDocumentLoaderMac.h */, 65FFB7FB0AD0B7D30048CD05 /* WebDocumentLoaderMac.mm */, 833987810543012D00EE146E /* WebDocumentPrivate.h */, 3944606B020F50ED0ECA1767 /* WebDynamicScrollBarsView.h */, 3944606C020F50ED0ECA1767 /* WebDynamicScrollBarsView.mm */, 934C11660D8710BB00C32ABD /* WebDynamicScrollBarsViewInternal.h */, BE4FBECB0653DF47005EDE15 /* WebEditingDelegate.h */, 1C8CB0790AE9830C00B1F6E9 /* WebEditingDelegatePrivate.h */, 2D81DAB203EB0B2D00A80166 /* WebFormDelegate.h */, 2D81DAB303EB0B2D00A80166 /* WebFormDelegate.m */, 2D36FD5E03F78F9E00A80166 /* WebFormDelegatePrivate.h */, 39446074020F50ED0ECA1767 /* WebFrame.h */, F5143A370221DCCE01A80181 /* WebFrame.mm */, 930D02BD06275F710076701E /* WebFrameInternal.h */, 5152FAE5033FC52200CA2ACD /* WebFrameLoadDelegate.h */, 9CF0E249021361B00ECA16EA /* WebFramePrivate.h */, 51A8B52E04282B5900CA2D3A /* WebFrameView.h */, 51A8B52F04282B5900CA2D3A /* WebFrameView.mm */, 51A8B53204282BD200CA2D3A /* WebFrameViewInternal.h */, 93C6F14507920B93002449CD /* WebFrameViewPrivate.h */, 5158F6EE106D862A00AF457C /* WebHistoryDelegate.h */, 5185F62710712B97007AA393 /* WebNavigationData.mm */, 5185F62510712B80007AA393 /* WebNavigationData.h */, 51443F9A0429392B00CA2D3A /* WebPolicyDelegate.h */, 51443F9B0429392B00CA2D3A /* WebPolicyDelegate.mm */, 51443F9C0429392B00CA2D3A /* WebPolicyDelegatePrivate.h */, EDE850CD06ECC79E005FAB05 /* WebPreferenceKeysPrivate.h */, 3944606E020F50ED0ECA1767 /* WebPreferences.h */, F5AEBB3D024A527601C1A526 /* WebPreferences.mm */, 9CAE9D070252A4130ECA16EA /* WebPreferencesPrivate.h */, F5F81C3902B67C26018635CA /* WebRenderNode.h */, F5F81C3A02B67C26018635CA /* WebRenderNode.mm */, 84311A1205EAAAF00088EDA4 /* WebResource.h */, 84311A1305EAAAF00088EDA4 /* WebResource.mm */, 934C4A9F0F0141F7009372C0 /* WebResourceInternal.h */, 513D422E034CF55A00CA2ACD /* WebResourceLoadDelegate.h */, 656D333D0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h */, 84311AF105EAB12B0088EDA4 /* WebResourcePrivate.h */, 7E6FEF0508985A7200C44C3F /* WebScriptDebugDelegate.h */, 7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.mm */, C0167BF60D7F5DD00028696E /* WebScriptDebugger.h */, C0167BF70D7F5DD00028696E /* WebScriptDebugger.mm */, 936A2DE90FD2D08400D312DB /* WebTextCompletionController.h */, 936A2DE70FD2D08000D312DB /* WebTextCompletionController.mm */, F834AAD50E64B1C700E2737C /* WebTextIterator.h */, F834AAD60E64B1C700E2737C /* WebTextIterator.mm */, 515E27CC0458C86500CA2D3A /* WebUIDelegate.h */, 65A7D44A0568AB2600E70EF6 /* WebUIDelegatePrivate.h */, 51A8B579042834F700CA2D3A /* WebView.h */, 51A8B57A042834F700CA2D3A /* WebView.mm */, BC2E464B0FD8A96800A9D9DE /* WebViewData.h */, BC2E464C0FD8A96800A9D9DE /* WebViewData.mm */, 930D02BB06275F640076701E /* WebViewInternal.h */, 51A8B57D0428353A00CA2D3A /* WebViewPrivate.h */, ); name = WebView; path = mac/WebView; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; F52CA6BD02DF9D0F018635CA /* HTML */ = { isa = PBXGroup; children = ( 35081D9202B6D4D80ACA2ACA /* WebHTMLRepresentation.h */, 35081D9302B6D4D80ACA2ACA /* WebHTMLRepresentation.mm */, 441793A50E34EE150055E1AE /* WebHTMLRepresentationInternal.h */, F5A55DC702BAA2E8018635CC /* WebHTMLRepresentationPrivate.h */, 35081D9402B6D4D80ACA2ACA /* WebHTMLView.h */, 35081D9502B6D4D80ACA2ACA /* WebHTMLView.mm */, 93185DB506679F42005D5E7E /* WebHTMLViewInternal.h */, 35081D9602B6D4D80ACA2ACA /* WebHTMLViewPrivate.h */, ); name = HTML; sourceTree = "<group>"; }; F57D194A034E732C01A80180 /* DOM */ = { isa = PBXGroup; children = ( 846171F90624AE5B0071A4A3 /* WebDOMOperations.h */, 846171FA0624AE5B0071A4A3 /* WebDOMOperations.mm */, AB9FBBBA0F8582B0006ADC43 /* WebDOMOperationsInternal.h */, 84AE905F062DE6A80075BBF9 /* WebDOMOperationsPrivate.h */, ); name = DOM; path = mac/DOM; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; F5B36B400281DE87018635CB /* WebCoreSupport */ = { isa = PBXGroup; children = ( 59C77F4A105471E700506104 /* WebGeolocationMockPrivate.h */, 59C77F3310545F7E00506104 /* WebGeolocationMock.mm */, B68049710FFBCEC1009F7F62 /* WebApplicationCache.h */, B68049720FFBCEC1009F7F62 /* WebApplicationCache.mm */, 51CBFCAC0D10E6C5002DBF51 /* WebCachedFramePlatformData.h */, 14D8252D0AF955090004F057 /* WebChromeClient.h */, 14D8252E0AF955090004F057 /* WebChromeClient.mm */, 065AD5A10B0C32C7005A2B1D /* WebContextMenuClient.h */, 065AD5A20B0C32C7005A2B1D /* WebContextMenuClient.mm */, A70936AD0B5608DC00CDB48E /* WebDragClient.h */, A70936AE0B5608DC00CDB48E /* WebDragClient.mm */, 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */, 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */, 931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */, 931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */, FEF52DF70F6748F200FF70EE /* WebGeolocation.mm */, FEF52DF80F6748F200FF70EE /* WebGeolocationInternal.h */, FEF52DF90F6748F200FF70EE /* WebGeolocationPrivate.h */, 51494CD40C7EBDE0004178C5 /* WebIconDatabaseClient.h */, 51494CD50C7EBDE0004178C5 /* WebIconDatabaseClient.mm */, 9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */, 06693DDA0BFBA85200216072 /* WebInspectorClient.h */, 06693DDB0BFBA85200216072 /* WebInspectorClient.mm */, 1C7B0C650EB2464D00A28502 /* WebInspectorClientCF.cpp */, 9345D4EA0365C5B2008635CE /* WebJavaScriptTextInputPanel.h */, 9345D4EB0365C5B2008635CE /* WebJavaScriptTextInputPanel.m */, 84723BE3056D719E0044BFEA /* WebKeyGenerator.h */, 84723BE4056D719E0044BFEA /* WebKeyGenerator.m */, A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */, A7D3C5BB0B5773C5002CA450 /* WebPasteboardHelper.mm */, 93EB178E09F88D510091F8FF /* WebSystemInterface.h */, 93EB178C09F88D460091F8FF /* WebSystemInterface.m */, F5F7174C02885C5B018635CA /* WebViewFactory.h */, F5F7174D02885C5B018635CA /* WebViewFactory.mm */, ); name = WebCoreSupport; path = mac/WebCoreSupport; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; F5EBC45202134BB601CA1520 /* Plugins */ = { isa = PBXGroup; children = ( 848DFF410365F6FB00CA2ACA /* Netscape Plug-ins */, 848DFF430365F71500CA2ACA /* WebKit Plug-ins */, 83E4AF46036652150000E506 /* WebBasePluginPackage.h */, 83E4AF47036652150000E506 /* WebBasePluginPackage.mm */, F5883BE0025E5E9D01000102 /* WebNullPluginView.h */, F5883BE1025E5E9D01000102 /* WebNullPluginView.mm */, F5F717200288493C018635CA /* WebPluginDatabase.h */, F5F717210288493C018635CA /* WebPluginDatabase.mm */, 224100F2091818D900D2D266 /* WebPluginsPrivate.h */, 224100F80918190100D2D266 /* WebPluginsPrivate.m */, ); name = Plugins; path = mac/Plugins; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; F7EBEE5903F9DB2203CA0DE6 /* Carbon */ = { isa = PBXGroup; children = ( F7EBEECF03F9DBBD03CA0DE6 /* AppKit Overrides */, F7EBEED103F9DBEB03CA0DE6 /* C API */, F7EBEED203F9DBFE03CA0DE6 /* Glue */, ); name = Carbon; path = mac/Carbon; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; F7EBEECF03F9DBBD03CA0DE6 /* AppKit Overrides */ = { isa = PBXGroup; children = ( F7EBEE9003F9DBA103CA0DE6 /* CarbonWindowAdapter.h */, F7EBEE9103F9DBA103CA0DE6 /* CarbonWindowAdapter.mm */, F7EBEE9203F9DBA103CA0DE6 /* CarbonWindowContentView.h */, F7EBEE9303F9DBA103CA0DE6 /* CarbonWindowContentView.m */, F7EBEE9403F9DBA103CA0DE6 /* CarbonWindowFrame.h */, F7EBEE9503F9DBA103CA0DE6 /* CarbonWindowFrame.m */, F7EBEE9A03F9DBA103CA0DE6 /* HIViewAdapter.h */, F7EBEE9B03F9DBA103CA0DE6 /* HIViewAdapter.m */, ); name = "AppKit Overrides"; sourceTree = "<group>"; }; F7EBEED103F9DBEB03CA0DE6 /* C API */ = { isa = PBXGroup; children = ( F7EBEEAA03F9DBA103CA0DE6 /* HIWebView.h */, F7EBEEAB03F9DBA103CA0DE6 /* HIWebView.mm */, ); name = "C API"; sourceTree = "<group>"; }; F7EBEED203F9DBFE03CA0DE6 /* Glue */ = { isa = PBXGroup; children = ( F79B974804019934036909D2 /* CarbonUtils.h */, F79B974904019934036909D2 /* CarbonUtils.m */, ); name = Glue; sourceTree = "<group>"; }; F8CA15B4029A399401000122 /* Panels */ = { isa = PBXGroup; children = ( F8CA15B5029A39D901000122 /* WebAuthenticationPanel.h */, F8CA15B6029A39D901000122 /* WebAuthenticationPanel.m */, 9345D17B0365BF35008635CE /* WebAuthenticationPanel.nib */, 93154EF103A41270008635CE /* WebPanelAuthenticationHandler.h */, 93154EF203A41270008635CE /* WebPanelAuthenticationHandler.m */, ); name = Panels; path = mac/Panels; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 9398100D0824BF01008DF038 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 9398106A0824BF01008DF038 /* CarbonUtils.h in Headers */, 939810650824BF01008DF038 /* CarbonWindowAdapter.h in Headers */, 939810660824BF01008DF038 /* CarbonWindowContentView.h in Headers */, 939810670824BF01008DF038 /* CarbonWindowFrame.h in Headers */, 5D1638F30E35B45D00F3038E /* EmptyProtocolDefinitions.h in Headers */, 939810680824BF01008DF038 /* HIViewAdapter.h in Headers */, 939810690824BF01008DF038 /* HIWebView.h in Headers */, 1A8DED500EE88B8A00F25022 /* HostedNetscapePluginStream.h in Headers */, 1AAF5CEA0EDDE1FE008D883D /* NetscapePluginHostManager.h in Headers */, 1AAF5CEC0EDDE1FE008D883D /* NetscapePluginHostProxy.h in Headers */, 1AAF5CEE0EDDE1FE008D883D /* NetscapePluginInstanceProxy.h in Headers */, 1A2DBE9F0F251E3A0036F8A6 /* ProxyInstance.h in Headers */, B6CE5C25100BC5F500219936 /* WebApplicationCache.h in Headers */, 9398109A0824BF01008DF038 /* WebArchive.h in Headers */, 5DE92FEF0BD7017E0059A5FD /* WebAssertions.h in Headers */, 939810290824BF01008DF038 /* WebAuthenticationPanel.h in Headers */, 939810110824BF01008DF038 /* WebBackForwardList.h in Headers */, 51C714FB0B20F79F00E5E33C /* WebBackForwardListInternal.h in Headers */, 22F219CC08D236730030E078 /* WebBackForwardListPrivate.h in Headers */, 9398102B0824BF01008DF038 /* WebBaseNetscapePluginStream.h in Headers */, 1A4DF5E40EC8D104006BD4B4 /* WebBaseNetscapePluginView.h in Headers */, 9398102E0824BF01008DF038 /* WebBasePluginPackage.h in Headers */, 5241ADF50B1BC48A004012BD /* WebCache.h in Headers */, 51CBFCAD0D10E6C5002DBF51 /* WebCachedFramePlatformData.h in Headers */, 14D8252F0AF955090004F057 /* WebChromeClient.h in Headers */, 939810490824BF01008DF038 /* WebClipView.h in Headers */, 065AD5A30B0C32C7005A2B1D /* WebContextMenuClient.h in Headers */, 939810160824BF01008DF038 /* WebCoreStatistics.h in Headers */, 51AEDEF10CECF45700854328 /* WebDatabaseManagerInternal.h in Headers */, 511F3FD60CECC88F00852565 /* WebDatabaseManagerPrivate.h in Headers */, 511F3FD70CECC88F00852565 /* WebDatabaseTrackerClient.h in Headers */, 9398104B0824BF01008DF038 /* WebDataSource.h in Headers */, 658A40960A14853B005E6987 /* WebDataSourceInternal.h in Headers */, 9398104C0824BF01008DF038 /* WebDataSourcePrivate.h in Headers */, 9398104E0824BF01008DF038 /* WebDefaultContextMenuDelegate.h in Headers */, 9398108D0824BF01008DF038 /* WebDefaultEditingDelegate.h in Headers */, 9398104F0824BF01008DF038 /* WebDefaultPolicyDelegate.h in Headers */, 939810760824BF01008DF038 /* WebDefaultUIDelegate.h in Headers */, BC542C420FD7766F00D8AB5D /* WebDelegateImplementationCaching.h in Headers */, 939810500824BF01008DF038 /* WebDocument.h in Headers */, 9398107F0824BF01008DF038 /* WebDocumentInternal.h in Headers */, 65FFB7FC0AD0B7D30048CD05 /* WebDocumentLoaderMac.h in Headers */, 939810800824BF01008DF038 /* WebDocumentPrivate.h in Headers */, 939810990824BF01008DF038 /* WebDOMOperations.h in Headers */, AB9FBBBB0F8582B0006ADC43 /* WebDOMOperationsInternal.h in Headers */, 9398109D0824BF01008DF038 /* WebDOMOperationsPrivate.h in Headers */, 939810770824BF01008DF038 /* WebDownload.h in Headers */, ABDDF20D08EB0DDC001E1241 /* WebDownloadInternal.h in Headers */, A70936AF0B5608DC00CDB48E /* WebDragClient.h in Headers */, 939810510824BF01008DF038 /* WebDynamicScrollBarsView.h in Headers */, 934C11670D8710BB00C32ABD /* WebDynamicScrollBarsViewInternal.h in Headers */, 9398109E0824BF01008DF038 /* WebEditingDelegate.h in Headers */, 1C8CB07A0AE9830C00B1F6E9 /* WebEditingDelegatePrivate.h in Headers */, 4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */, DD89682009AA87240097E7F0 /* WebElementDictionary.h in Headers */, 939810520824BF01008DF038 /* WebFormDelegate.h in Headers */, 939810640824BF01008DF038 /* WebFormDelegatePrivate.h in Headers */, 939810530824BF01008DF038 /* WebFrame.h in Headers */, 9398109C0824BF01008DF038 /* WebFrameInternal.h in Headers */, 9398105B0824BF01008DF038 /* WebFrameLoadDelegate.h in Headers */, 931633EB0AEDFF930062B92D /* WebFrameLoaderClient.h in Headers */, 939810540824BF01008DF038 /* WebFramePrivate.h in Headers */, 9398106E0824BF01008DF038 /* WebFrameView.h in Headers */, 9398106F0824BF01008DF038 /* WebFrameViewInternal.h in Headers */, 939810AF0824BF01008DF038 /* WebFrameViewPrivate.h in Headers */, FEF52DFB0F6748F200FF70EE /* WebGeolocationInternal.h in Headers */, FEF52DFC0F6748F200FF70EE /* WebGeolocationPrivate.h in Headers */, 939810120824BF01008DF038 /* WebHistory.h in Headers */, 93FDE9330D79CAF30074F029 /* WebHistoryInternal.h in Headers */, 939810130824BF01008DF038 /* WebHistoryItem.h in Headers */, 939810630824BF01008DF038 /* WebHistoryItemInternal.h in Headers */, 51FDC4D30B0AF5C100F84EB3 /* WebHistoryItemPrivate.h in Headers */, 939810140824BF01008DF038 /* WebHistoryPrivate.h in Headers */, 1AAF5FBF0EDE3A92008D883D /* WebHostedNetscapePluginView.h in Headers */, 939810550824BF01008DF038 /* WebHTMLRepresentation.h in Headers */, 441793A60E34EE150055E1AE /* WebHTMLRepresentationInternal.h in Headers */, 939810560824BF01008DF038 /* WebHTMLRepresentationPrivate.h in Headers */, 939810570824BF01008DF038 /* WebHTMLView.h in Headers */, 939810A10824BF01008DF038 /* WebHTMLViewInternal.h in Headers */, 939810580824BF01008DF038 /* WebHTMLViewPrivate.h in Headers */, 939810180824BF01008DF038 /* WebIconDatabase.h in Headers */, 51494CD60C7EBDE0004178C5 /* WebIconDatabaseClient.h in Headers */, 51B2A1000ADB15D0002A9BEE /* WebIconDatabaseDelegate.h in Headers */, 9304B3000B02341500F7850D /* WebIconDatabaseInternal.h in Headers */, 939810190824BF01008DF038 /* WebIconDatabasePrivate.h in Headers */, 1A2D754D0DE480B900F0A648 /* WebIconFetcher.h in Headers */, 1A2D75500DE4810E00F0A648 /* WebIconFetcherInternal.h in Headers */, 5D7BF8140C2A1D90008CE06D /* WebInspector.h in Headers */, 06693DDC0BFBA85200216072 /* WebInspectorClient.h in Headers */, 939810A00824BF01008DF038 /* WebJavaPlugIn.h in Headers */, 939810420824BF01008DF038 /* WebJavaScriptTextInputPanel.h in Headers */, 939810850824BF01008DF038 /* WebKeyGenerator.h in Headers */, 9398101B0824BF01008DF038 /* WebKit.h in Headers */, 9398101C0824BF01008DF038 /* WebKitErrors.h in Headers */, 9398106D0824BF01008DF038 /* WebKitErrorsPrivate.h in Headers */, 9398101D0824BF01008DF038 /* WebKitLogging.h in Headers */, 9398101E0824BF01008DF038 /* WebKitNSStringExtras.h in Headers */, 1AAF58940EDCCF15008D883D /* WebKitPluginAgent.defs in Headers */, 1AAF58950EDCCF15008D883D /* WebKitPluginAgentReply.defs in Headers */, 1AAF58960EDCCF15008D883D /* WebKitPluginClient.defs in Headers */, 1AAF58970EDCCF15008D883D /* WebKitPluginHost.defs in Headers */, 1AAF58980EDCCF15008D883D /* WebKitPluginHostTypes.defs in Headers */, 1AAF5D090EDDE71D008D883D /* WebKitPluginHostTypes.h in Headers */, 939810470824BF01008DF038 /* WebKitPrefix.h in Headers */, 9398101F0824BF01008DF038 /* WebKitStatistics.h in Headers */, 939810200824BF01008DF038 /* WebKitStatisticsPrivate.h in Headers */, 9398107A0824BF01008DF038 /* WebKitSystemBits.h in Headers */, 1C0D40870AC1C8F40009C113 /* WebKitVersionChecks.h in Headers */, 939810790824BF01008DF038 /* WebLocalizableStrings.h in Headers */, 0AB752370FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h in Headers */, 0AEBFF630F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h in Headers */, 226E9E6A09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h in Headers */, 1AEA66D40DC6B1FF003D12BF /* WebNetscapePluginEventHandler.h in Headers */, 1AEA66D80DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.h in Headers */, 1AEA6A500DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.h in Headers */, 939810310824BF01008DF038 /* WebNetscapePluginPackage.h in Headers */, 1A4DF5220EC8C74D006BD4B4 /* WebNetscapePluginView.h in Headers */, 1C68F66F095B5FC100C2984E /* WebNodeHighlight.h in Headers */, 1C68F671095B5FC100C2984E /* WebNodeHighlightView.h in Headers */, EDE983800BCDF5FE00FDAE28 /* WebNSArrayExtras.h in Headers */, ED6BE2E7088C32B50044DEDC /* WebNSAttributedStringExtras.h in Headers */, 939810210824BF01008DF038 /* WebNSControlExtras.h in Headers */, 939810820824BF01008DF038 /* WebNSDataExtras.h in Headers */, ED7F6D8B0980683500C235ED /* WebNSDataExtrasPrivate.h in Headers */, 65488DA1084FBCCB00831AD0 /* WebNSDictionaryExtras.h in Headers */, 939810840824BF01008DF038 /* WebNSEventExtras.h in Headers */, 65EEDE57084FFC9E0002DB25 /* WebNSFileManagerExtras.h in Headers */, 939810220824BF01008DF038 /* WebNSImageExtras.h in Headers */, 51494D240C7EC1B7004178C5 /* WebNSNotificationCenterExtras.h in Headers */, 939810A20824BF01008DF038 /* WebNSObjectExtras.h in Headers */, 939810230824BF01008DF038 /* WebNSPasteboardExtras.h in Headers */, 939810870824BF01008DF038 /* WebNSPrintOperationExtras.h in Headers */, 9398107E0824BF01008DF038 /* WebNSURLExtras.h in Headers */, 65E0F88408500917007E5CB9 /* WebNSURLRequestExtras.h in Headers */, 65E0F9E608500F23007E5CB9 /* WebNSUserDefaultsExtras.h in Headers */, 939810240824BF01008DF038 /* WebNSViewExtras.h in Headers */, 939810250824BF01008DF038 /* WebNSWindowExtras.h in Headers */, 939810340824BF01008DF038 /* WebNullPluginView.h in Headers */, 9398102A0824BF01008DF038 /* WebPanelAuthenticationHandler.h in Headers */, A7D3C5BC0B5773C5002CA450 /* WebPasteboardHelper.h in Headers */, 939810A50824BF01008DF038 /* WebPDFRepresentation.h in Headers */, 939810A40824BF01008DF038 /* WebPDFView.h in Headers */, 939810350824BF01008DF038 /* WebPlugin.h in Headers */, 939810360824BF01008DF038 /* WebPluginContainer.h in Headers */, 939810B10824BF01008DF038 /* WebPluginContainerCheck.h in Headers */, 939810B00824BF01008DF038 /* WebPluginContainerPrivate.h in Headers */, 939810370824BF01008DF038 /* WebPluginController.h in Headers */, 939810380824BF01008DF038 /* WebPluginDatabase.h in Headers */, 939810390824BF01008DF038 /* WebPluginPackage.h in Headers */, 225F881509F97E8A00423A40 /* WebPluginPrivate.h in Headers */, 1A77B02E0EE7730500C8A1F9 /* WebPluginRequest.h in Headers */, 224100F3091818D900D2D266 /* WebPluginsPrivate.h in Headers */, 9398103A0824BF01008DF038 /* WebPluginViewFactory.h in Headers */, 939810AC0824BF01008DF038 /* WebPluginViewFactoryPrivate.h in Headers */, 939810720824BF01008DF038 /* WebPolicyDelegate.h in Headers */, 939810730824BF01008DF038 /* WebPolicyDelegatePrivate.h in Headers */, 939810A80824BF01008DF038 /* WebPreferenceKeysPrivate.h in Headers */, 9398105D0824BF01008DF038 /* WebPreferences.h in Headers */, 9398105E0824BF01008DF038 /* WebPreferencesPrivate.h in Headers */, 9398105F0824BF01008DF038 /* WebRenderNode.h in Headers */, 939810880824BF01008DF038 /* WebResource.h in Headers */, 934C4AA00F0141F7009372C0 /* WebResourceInternal.h in Headers */, 939810600824BF01008DF038 /* WebResourceLoadDelegate.h in Headers */, 656D333E0AF21AE900212169 /* WebResourceLoadDelegatePrivate.h in Headers */, 939810890824BF01008DF038 /* WebResourcePrivate.h in Headers */, 7E6FEF0808985A7200C44C3F /* WebScriptDebugDelegate.h in Headers */, C0167BF80D7F5DD00028696E /* WebScriptDebugger.h in Headers */, 51079D180CED11B00077247D /* WebSecurityOriginInternal.h in Headers */, 51079D190CED11B00077247D /* WebSecurityOriginPrivate.h in Headers */, 939810270824BF01008DF038 /* WebStringTruncator.h in Headers */, 93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */, 936A2DEA0FD2D08400D312DB /* WebTextCompletionController.h in Headers */, 1A74A28E0F4F75400082E228 /* WebTextInputWindowController.h in Headers */, F834AAD70E64B1C700E2737C /* WebTextIterator.h in Headers */, DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */, 939810750824BF01008DF038 /* WebUIDelegate.h in Headers */, 939810830824BF01008DF038 /* WebUIDelegatePrivate.h in Headers */, 939810150824BF01008DF038 /* WebURLsWithTitles.h in Headers */, 939810700824BF01008DF038 /* WebView.h in Headers */, BC2E464D0FD8A96800A9D9DE /* WebViewData.h in Headers */, 939810460824BF01008DF038 /* WebViewFactory.h in Headers */, 9398109B0824BF01008DF038 /* WebViewInternal.h in Headers */, 939810710824BF01008DF038 /* WebViewPrivate.h in Headers */, 41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */, 59C77F4B105471E700506104 /* WebGeolocationMockPrivate.h in Headers */, 37B6FB4E1063530C000FDB3B /* WebPDFDocumentExtras.h in Headers */, 37D1DCA81065928C0068F7EF /* WebJSPDFDoc.h in Headers */, 5158F6EF106D862A00AF457C /* WebHistoryDelegate.h in Headers */, 5185F62610712B80007AA393 /* WebNavigationData.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 9398100A0824BF01008DF038 /* WebKit */ = { isa = PBXNativeTarget; buildConfigurationList = 149C282D08902B0F008A9EFC /* Build configuration list for PBXNativeTarget "WebKit" */; buildPhases = ( 5D2F7DB70C687A5A00B5B72B /* Update Info.plist with version information */, 1C6CB0510AA63EB000D23BFD /* Migrate Headers */, 939811300824BF01008DF038 /* Make Frameworks Symbolic Link */, 9398100D0824BF01008DF038 /* Headers */, 939810B20824BF01008DF038 /* Resources */, 939810BB0824BF01008DF038 /* Sources */, 1C395DE20C6BE8E0000D1E52 /* Generate 64-bit Export File */, 939811270824BF01008DF038 /* Frameworks */, 939D054F09DA02D500984996 /* Check For Global Initializers */, 9337D6540EBFE54D00DA3CB5 /* Check For Exit Time Destructors */, 5D0D54210E98631D0029E223 /* Check For Weak VTables */, 5DE6D18C0FCF231B002DE28C /* Symlink WebKitPluginHost in to place */, ); buildRules = ( ); dependencies = ( ); name = WebKit; productInstallPath = /System/Library/Frameworks; productName = WebKit; productReference = 939811330824BF01008DF038 /* WebKit.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */; compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; knownRegions = ( English, Japanese, French, German, Spanish, Dutch, Italian, ); mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 9398100A0824BF01008DF038 /* WebKit */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 939810B20824BF01008DF038 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 939810BA0824BF01008DF038 /* IDNScriptWhiteList.txt in Resources */, 5DE83A7F0D0F7FAD00CAD12A /* Localizable.strings in Resources */, 939810B60824BF01008DF038 /* nullplugin.tiff in Resources */, 939810B70824BF01008DF038 /* url_icon.tiff in Resources */, 939810B50824BF01008DF038 /* WebAuthenticationPanel.nib in Resources */, 5DE83A7A0D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 1C395DE20C6BE8E0000D1E52 /* Generate 64-bit Export File */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "$(PROJECT_DIR)/mac/WebKit.exp", ); name = "Generate 64-bit Export File"; outputPaths = ( "$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit/WebKit.LP64.exp", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "mkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit\"\n\n# exclude Carbon functions on 64-bit\nsed -e s/^_HIWebViewCreate$// -e s/^_HIWebViewGetWebView$// -e s/^_WebConvertNSImageToCGImageRef$// -e s/^_WebInitForCarbon$// \"${PROJECT_DIR}/mac/WebKit.exp\" > \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit/WebKit.LP64.exp\"\n"; }; 1C6CB0510AA63EB000D23BFD /* Migrate Headers */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "$(PROJECT_DIR)/mac/MigrateHeaders.make", ); name = "Migrate Headers"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "mkdir -p \"${TARGET_BUILD_DIR}/${PRIVATE_HEADERS_FOLDER_PATH}\"\nmkdir -p \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\nmkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit\"\n\nif [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" ]; then\n make -C mac -f \"MigrateHeaders.make\" -j `/usr/sbin/sysctl -n hw.availcpu`\nfi\n"; }; 5D0D54210E98631D0029E223 /* Check For Weak VTables */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)", ); name = "Check For Weak VTables"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../WebKitTools/Scripts/check-for-weak-vtables ]; then\n ../WebKitTools/Scripts/check-for-weak-vtables || exit $?\nfi"; }; 5D2F7DB70C687A5A00B5B72B /* Update Info.plist with version information */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "$(PROJECT_DIR)/mac/Configurations/Version.xcconfig", ); name = "Update Info.plist with version information"; outputPaths = ( "$(PROJECT_DIR)/mac/Info.plist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "# Touch Info.plist to let Xcode know it needs to copy it into the built product\ntouch \"$PROJECT_DIR/mac/Info.plist\"\n"; }; 5DE6D18C0FCF231B002DE28C /* Symlink WebKitPluginHost in to place */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = "Symlink WebKitPluginHost in to place"; outputPaths = ( "$(CONFIGURATION_BUILD_DIR)/WebKit.framework/WebKitPluginHost.app", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "if [[ \"${MACOSX_DEPLOYMENT_TARGET}\" > \"10.5\" && \"${CONFIGURATION}\" != \"Production\" && \"${ACTION}\" == \"build\" ]]; then\n if [[ ! -e \"${CONFIGURATION_BUILD_DIR}/WebKit.framework/WebKitPluginHost.app\" ]]; then\n ln -s /System/Library/Frameworks/WebKit.framework/WebKitPluginHost.app \"${CONFIGURATION_BUILD_DIR}/WebKit.framework/WebKitPluginHost.app\"\n fi\nfi\n"; }; 9337D6540EBFE54D00DA3CB5 /* Check For Exit Time Destructors */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)", ); name = "Check For Exit Time Destructors"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../WebKitTools/Scripts/check-for-exit-time-destructors ]; then\n ../WebKitTools/Scripts/check-for-exit-time-destructors || exit $?\nfi"; }; 939811300824BF01008DF038 /* Make Frameworks Symbolic Link */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 8; files = ( ); inputPaths = ( WebKit.xcodeproj, ); name = "Make Frameworks Symbolic Link"; outputPaths = ( "$(TARGET_BUILD_DIR)/$(PRIVATE_HEADERS_FOLDER_PATH)/frameworks-symlink-stamp", ); runOnlyForDeploymentPostprocessing = 1; shellPath = /bin/sh; shellScript = "ln -sf Versions/Current/Frameworks \"$TARGET_BUILD_DIR/WebKit.framework/Frameworks\"\n"; }; 939D054F09DA02D500984996 /* Check For Global Initializers */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)", ); name = "Check For Global Initializers"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../WebKitTools/Scripts/check-for-global-initializers ]; then\n ../WebKitTools/Scripts/check-for-global-initializers || exit $?\nfi"; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 939810BB0824BF01008DF038 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 939811010824BF01008DF038 /* CarbonUtils.m in Sources */, 939810FD0824BF01008DF038 /* CarbonWindowAdapter.mm in Sources */, 939810FE0824BF01008DF038 /* CarbonWindowContentView.m in Sources */, 939810FF0824BF01008DF038 /* CarbonWindowFrame.m in Sources */, 939811000824BF01008DF038 /* HIViewAdapter.m in Sources */, 939811020824BF01008DF038 /* HIWebView.mm in Sources */, 1A8DED510EE88B8A00F25022 /* HostedNetscapePluginStream.mm in Sources */, 1AAF5CEB0EDDE1FE008D883D /* NetscapePluginHostManager.mm in Sources */, 1AAF5CED0EDDE1FE008D883D /* NetscapePluginHostProxy.mm in Sources */, 1AAF5CEF0EDDE1FE008D883D /* NetscapePluginInstanceProxy.mm in Sources */, 939810DD0824BF01008DF038 /* npapi.mm in Sources */, 1CCFFD130B1F81F2002EE926 /* OldWebAssertions.c in Sources */, 1A2DBEA00F251E3A0036F8A6 /* ProxyInstance.mm in Sources */, B6CE5C24100BC5CE00219936 /* WebApplicationCache.mm in Sources */, 9398111D0824BF01008DF038 /* WebArchive.mm in Sources */, 939810CF0824BF01008DF038 /* WebAuthenticationPanel.m in Sources */, 939810BC0824BF01008DF038 /* WebBackForwardList.mm in Sources */, 939810D10824BF01008DF038 /* WebBaseNetscapePluginStream.mm in Sources */, 1A4DF5E50EC8D104006BD4B4 /* WebBaseNetscapePluginView.mm in Sources */, 939810D30824BF01008DF038 /* WebBasePluginPackage.mm in Sources */, 5241ADF60B1BC48A004012BD /* WebCache.mm in Sources */, 14D825300AF955090004F057 /* WebChromeClient.mm in Sources */, 939810EB0824BF01008DF038 /* WebClipView.m in Sources */, 065AD5A40B0C32C7005A2B1D /* WebContextMenuClient.mm in Sources */, 939810BF0824BF01008DF038 /* WebCoreStatistics.mm in Sources */, 511F3FD50CECC88F00852565 /* WebDatabaseManager.mm in Sources */, 511F3FD80CECC88F00852565 /* WebDatabaseTrackerClient.mm in Sources */, 939810ED0824BF01008DF038 /* WebDataSource.mm in Sources */, 939810EF0824BF01008DF038 /* WebDefaultContextMenuDelegate.mm in Sources */, 9398111B0824BF01008DF038 /* WebDefaultEditingDelegate.m in Sources */, 939810F00824BF01008DF038 /* WebDefaultPolicyDelegate.m in Sources */, 9398110A0824BF01008DF038 /* WebDefaultUIDelegate.m in Sources */, BC542C430FD7766F00D8AB5D /* WebDelegateImplementationCaching.mm in Sources */, 65FFB7FD0AD0B7D30048CD05 /* WebDocumentLoaderMac.mm in Sources */, 9398111C0824BF01008DF038 /* WebDOMOperations.mm in Sources */, E15663190FB61C1F00C199CA /* WebDownload.mm in Sources */, A70936B00B5608DC00CDB48E /* WebDragClient.mm in Sources */, 939810F10824BF01008DF038 /* WebDynamicScrollBarsView.mm in Sources */, 4BF99F910AE050BC00815C2B /* WebEditorClient.mm in Sources */, DD89682109AA87240097E7F0 /* WebElementDictionary.mm in Sources */, 939810FC0824BF01008DF038 /* WebFormDelegate.m in Sources */, 939810F20824BF01008DF038 /* WebFrame.mm in Sources */, 931633EF0AEDFFAE0062B92D /* WebFrameLoaderClient.mm in Sources */, 939811060824BF01008DF038 /* WebFrameView.mm in Sources */, FEF52DFA0F6748F200FF70EE /* WebGeolocation.mm in Sources */, 939811130824BF01008DF038 /* WebHistory.mm in Sources */, 939810BD0824BF01008DF038 /* WebHistoryItem.mm in Sources */, 1AAF5FC00EDE3A92008D883D /* WebHostedNetscapePluginView.mm in Sources */, 939810F30824BF01008DF038 /* WebHTMLRepresentation.mm in Sources */, 939810F40824BF01008DF038 /* WebHTMLView.mm in Sources */, 939810C10824BF01008DF038 /* WebIconDatabase.mm in Sources */, 51494CD70C7EBDE0004178C5 /* WebIconDatabaseClient.mm in Sources */, 1A2D754E0DE480B900F0A648 /* WebIconFetcher.mm in Sources */, 939810E30824BF01008DF038 /* WebImageRendererFactory.m in Sources */, 5D7BF8150C2A1D90008CE06D /* WebInspector.mm in Sources */, 06693DDD0BFBA85200216072 /* WebInspectorClient.mm in Sources */, 1C7B0C660EB2464D00A28502 /* WebInspectorClientCF.cpp in Sources */, 939810E40824BF01008DF038 /* WebJavaScriptTextInputPanel.m in Sources */, 939811170824BF01008DF038 /* WebKeyGenerator.m in Sources */, 939811030824BF01008DF038 /* WebKitErrors.m in Sources */, 939810C30824BF01008DF038 /* WebKitLogging.m in Sources */, 939810C40824BF01008DF038 /* WebKitNSStringExtras.mm in Sources */, 1AAF5D0F0EDDE7A7008D883D /* WebKitPluginAgent.defs in Sources */, 1AAF5D000EDDE604008D883D /* WebKitPluginClient.defs in Sources */, 1AAF5CF10EDDE586008D883D /* WebKitPluginHost.defs in Sources */, 939810C50824BF01008DF038 /* WebKitStatistics.m in Sources */, 9398110E0824BF01008DF038 /* WebKitSystemBits.m in Sources */, 1C0D40880AC1C8F40009C113 /* WebKitVersionChecks.m in Sources */, 9398110D0824BF01008DF038 /* WebLocalizableStrings.m in Sources */, 0AB752380FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm in Sources */, 0AEBFF640F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm in Sources */, 226E9E6B09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c in Sources */, 1AEA66D50DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm in Sources */, 1AEA66D90DC6B209003D12BF /* WebNetscapePluginEventHandlerCarbon.mm in Sources */, 1AEA6A510DC8CE2F003D12BF /* WebNetscapePluginEventHandlerCocoa.mm in Sources */, 939810D60824BF01008DF038 /* WebNetscapePluginPackage.mm in Sources */, 1A4DF5230EC8C74D006BD4B4 /* WebNetscapePluginView.mm in Sources */, 1C68F670095B5FC100C2984E /* WebNodeHighlight.mm in Sources */, 1C68F672095B5FC100C2984E /* WebNodeHighlightView.mm in Sources */, EDE983810BCDF5FE00FDAE28 /* WebNSArrayExtras.m in Sources */, ED6BE2E8088C32B50044DEDC /* WebNSAttributedStringExtras.mm in Sources */, 939810C60824BF01008DF038 /* WebNSControlExtras.m in Sources */, 939811150824BF01008DF038 /* WebNSDataExtras.m in Sources */, 65488DA2084FBCCB00831AD0 /* WebNSDictionaryExtras.m in Sources */, 939811160824BF01008DF038 /* WebNSEventExtras.m in Sources */, 65EEDE58084FFC9E0002DB25 /* WebNSFileManagerExtras.m in Sources */, 939810C70824BF01008DF038 /* WebNSImageExtras.m in Sources */, 51494D250C7EC1B7004178C5 /* WebNSNotificationCenterExtras.m in Sources */, 934C4A910F01406C009372C0 /* WebNSObjectExtras.mm in Sources */, 939810C80824BF01008DF038 /* WebNSPasteboardExtras.mm in Sources */, 939811190824BF01008DF038 /* WebNSPrintOperationExtras.m in Sources */, 939811120824BF01008DF038 /* WebNSURLExtras.mm in Sources */, 65E0F88508500917007E5CB9 /* WebNSURLRequestExtras.m in Sources */, 65E0F9E708500F23007E5CB9 /* WebNSUserDefaultsExtras.m in Sources */, 939810C90824BF01008DF038 /* WebNSViewExtras.m in Sources */, 939810CA0824BF01008DF038 /* WebNSWindowExtras.m in Sources */, 939810D90824BF01008DF038 /* WebNullPluginView.mm in Sources */, 939810D00824BF01008DF038 /* WebPanelAuthenticationHandler.m in Sources */, A7D3C5BD0B5773C5002CA450 /* WebPasteboardHelper.mm in Sources */, 9398111F0824BF01008DF038 /* WebPDFRepresentation.mm in Sources */, 9398111E0824BF01008DF038 /* WebPDFView.mm in Sources */, 939811260824BF01008DF038 /* WebPluginContainerCheck.mm in Sources */, 939810DA0824BF01008DF038 /* WebPluginController.mm in Sources */, 939810DB0824BF01008DF038 /* WebPluginDatabase.mm in Sources */, 939810DC0824BF01008DF038 /* WebPluginPackage.m in Sources */, 1A77B02F0EE7730500C8A1F9 /* WebPluginRequest.m in Sources */, 224100F90918190100D2D266 /* WebPluginsPrivate.m in Sources */, 939811080824BF01008DF038 /* WebPolicyDelegate.mm in Sources */, 939810F80824BF01008DF038 /* WebPreferences.mm in Sources */, 939810F90824BF01008DF038 /* WebRenderNode.mm in Sources */, 9398111A0824BF01008DF038 /* WebResource.mm in Sources */, 7E6FEF0908985A7200C44C3F /* WebScriptDebugDelegate.mm in Sources */, C0167BF90D7F5DD00028696E /* WebScriptDebugger.mm in Sources */, 51079D170CED11B00077247D /* WebSecurityOrigin.mm in Sources */, 939810CC0824BF01008DF038 /* WebStringTruncator.mm in Sources */, 93EB178D09F88D460091F8FF /* WebSystemInterface.m in Sources */, 936A2DE80FD2D08000D312DB /* WebTextCompletionController.mm in Sources */, 1A74A28F0F4F75400082E228 /* WebTextInputWindowController.m in Sources */, F834AAD80E64B1C700E2737C /* WebTextIterator.mm in Sources */, 939810BE0824BF01008DF038 /* WebURLsWithTitles.m in Sources */, 939811070824BF01008DF038 /* WebView.mm in Sources */, BC2E464E0FD8A96800A9D9DE /* WebViewData.mm in Sources */, 939810E80824BF01008DF038 /* WebViewFactory.mm in Sources */, 41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */, 59C77F3510545F7E00506104 /* WebGeolocationMock.mm in Sources */, 37B6FB4F1063530C000FDB3B /* WebPDFDocumentExtras.mm in Sources */, 37D1DCA91065928C0068F7EF /* WebJSPDFDoc.mm in Sources */, 5185F62810712B97007AA393 /* WebNavigationData.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 5DE83A740D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib */ = { isa = PBXVariantGroup; children = ( 5DE83A750D0F7F9400CAD12A /* English */, ); name = WebJavaScriptTextInputPanel.nib; path = mac/Resources; sourceTree = SOURCE_ROOT; }; 5DE83A7D0D0F7FAD00CAD12A /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( 5DE83A7E0D0F7FAD00CAD12A /* English */, ); name = Localizable.strings; path = mac/Resources; sourceTree = SOURCE_ROOT; }; 9345D17B0365BF35008635CE /* WebAuthenticationPanel.nib */ = { isa = PBXVariantGroup; children = ( 9345D17C0365BF35008635CE /* English */, ); name = WebAuthenticationPanel.nib; path = ..; sourceTree = "<group>"; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 149C282E08902B0F008A9EFC /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1C904FD20BA9DD0F0081E9D0 /* WebKit.xcconfig */; buildSettings = { DEBUG_DEFINES = "$(DEBUG_DEFINES_debug) ENABLE_WEBKIT_UNSET_DYLD_FRAMEWORK_PATH"; INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; OTHER_LDFLAGS = ( "$(OTHER_LDFLAGS)", "-l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY)", ); }; name = Debug; }; 149C282F08902B0F008A9EFC /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1C904FD20BA9DD0F0081E9D0 /* WebKit.xcconfig */; buildSettings = { DEBUG_DEFINES = "$(DEBUG_DEFINES_$(CURRENT_VARIANT)) ENABLE_WEBKIT_UNSET_DYLD_FRAMEWORK_PATH"; INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; OTHER_LDFLAGS = ( "$(OTHER_LDFLAGS)", "-l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY)", ); }; name = Release; }; 149C283108902B0F008A9EFC /* Production */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1C904FD20BA9DD0F0081E9D0 /* WebKit.xcconfig */; buildSettings = { BUILD_VARIANTS = ( normal, debug, ); OTHER_LDFLAGS = ( "$(OTHER_LDFLAGS)", "-lWebKitSystemInterface", ); }; name = Production; }; 149C283308902B0F008A9EFC /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1C904FD40BA9DD0F0081E9D0 /* DebugRelease.xcconfig */; buildSettings = { DEBUG_DEFINES = "$(DEBUG_DEFINES_debug)"; GCC_OPTIMIZATION_LEVEL = "$(GCC_OPTIMIZATION_LEVEL_debug)"; STRIP_INSTALLED_PRODUCT = "$(STRIP_INSTALLED_PRODUCT_debug)"; }; name = Debug; }; 149C283408902B0F008A9EFC /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1C904FD40BA9DD0F0081E9D0 /* DebugRelease.xcconfig */; buildSettings = { STRIP_INSTALLED_PRODUCT = NO; }; name = Release; }; 149C283608902B0F008A9EFC /* Production */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1C904FD50BA9DD0F0081E9D0 /* Base.xcconfig */; buildSettings = { }; name = Production; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 149C282D08902B0F008A9EFC /* Build configuration list for PBXNativeTarget "WebKit" */ = { isa = XCConfigurationList; buildConfigurations = ( 149C282E08902B0F008A9EFC /* Debug */, 149C282F08902B0F008A9EFC /* Release */, 149C283108902B0F008A9EFC /* Production */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Production; }; 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */ = { isa = XCConfigurationList; buildConfigurations = ( 149C283308902B0F008A9EFC /* Debug */, 149C283408902B0F008A9EFC /* Release */, 149C283608902B0F008A9EFC /* Production */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Production; }; /* End XCConfigurationList section */ }; rootObject = 0867D690FE84028FC02AAC07 /* Project object */; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/haiku/���������������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024257�011445� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/haiku/WebCoreSupport/������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024257�014370� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp����������������������������������������������0000644�0001750�0001750�00000052463�11233645153�021406� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 Don Gibson <dgibson77@gmail.com> * Copyright (C) 2006 Zack Rusin <zack@kde.org> * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. * Copyright (C) 2007 Trolltech ASA * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> All rights reserved. * Copyright (C) 2009 Maxime Simon <simon.maxime@gmail.com> 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. */ #include "config.h" #include "FrameLoaderClientHaiku.h" #include "DocumentLoader.h" #include "Frame.h" #include "FrameLoader.h" #include "FrameTree.h" #include "FrameView.h" #include "HTMLFrameOwnerElement.h" #include "NotImplemented.h" #include "Page.h" #include "PlatformString.h" #include "ResourceRequest.h" #include "WebView.h" #include <Message.h> #include <String.h> #include <app/Messenger.h> namespace WebCore { FrameLoaderClientHaiku::FrameLoaderClientHaiku() : m_frame(0) { } void FrameLoaderClientHaiku::setFrame(Frame* frame) { m_frame = frame; } void FrameLoaderClientHaiku::setWebView(WebView* webview) { m_webView = webview; m_messenger = new BMessenger(m_webView); ASSERT(m_messenger->IsValid()); } void FrameLoaderClientHaiku::detachFrameLoader() { m_frame = 0; } bool FrameLoaderClientHaiku::hasWebView() const { return m_webView; } bool FrameLoaderClientHaiku::hasBackForwardList() const { notImplemented(); return true; } void FrameLoaderClientHaiku::resetBackForwardList() { notImplemented(); } bool FrameLoaderClientHaiku::provisionalItemIsTarget() const { notImplemented(); return false; } void FrameLoaderClientHaiku::makeRepresentation(DocumentLoader*) { notImplemented(); } void FrameLoaderClientHaiku::forceLayout() { notImplemented(); } void FrameLoaderClientHaiku::forceLayoutForNonHTML() { notImplemented(); } void FrameLoaderClientHaiku::updateHistoryForCommit() { notImplemented(); } void FrameLoaderClientHaiku::updateHistoryForBackForwardNavigation() { notImplemented(); } void FrameLoaderClientHaiku::updateHistoryForReload() { notImplemented(); } void FrameLoaderClientHaiku::updateHistoryForStandardLoad() { notImplemented(); } void FrameLoaderClientHaiku::updateHistoryForInternalLoad() { notImplemented(); } void FrameLoaderClientHaiku::updateHistoryAfterClientRedirect() { notImplemented(); } void FrameLoaderClientHaiku::setCopiesOnScroll() { // apparently mac specific notImplemented(); } LoadErrorResetToken* FrameLoaderClientHaiku::tokenForLoadErrorReset() { notImplemented(); return 0; } void FrameLoaderClientHaiku::resetAfterLoadError(LoadErrorResetToken*) { notImplemented(); } void FrameLoaderClientHaiku::doNotResetAfterLoadError(LoadErrorResetToken*) { notImplemented(); } void FrameLoaderClientHaiku::willCloseDocument() { notImplemented(); } void FrameLoaderClientHaiku::detachedFromParent2() { notImplemented(); } void FrameLoaderClientHaiku::detachedFromParent3() { notImplemented(); } void FrameLoaderClientHaiku::dispatchDidHandleOnloadEvents() { if (m_webView) { BMessage message(LOAD_ONLOAD_HANDLE); message.AddString("url", m_frame->loader()->documentLoader()->request().url().string()); m_messenger->SendMessage(&message); } } void FrameLoaderClientHaiku::dispatchDidReceiveServerRedirectForProvisionalLoad() { notImplemented(); } void FrameLoaderClientHaiku::dispatchDidCancelClientRedirect() { notImplemented(); } void FrameLoaderClientHaiku::dispatchWillPerformClientRedirect(const KURL&, double interval, double fireDate) { notImplemented(); } void FrameLoaderClientHaiku::dispatchDidChangeLocationWithinPage() { notImplemented(); } void FrameLoaderClientHaiku::dispatchWillClose() { notImplemented(); } void FrameLoaderClientHaiku::dispatchDidStartProvisionalLoad() { if (m_webView) { BMessage message(LOAD_NEGOCIATING); message.AddString("url", m_frame->loader()->provisionalDocumentLoader()->request().url().string()); m_messenger->SendMessage(&message); } } void FrameLoaderClientHaiku::dispatchDidReceiveTitle(const String& title) { if (m_webView) { m_webView->SetPageTitle(title); BMessage message(TITLE_CHANGED); message.AddString("title", title); m_messenger->SendMessage(&message); } } void FrameLoaderClientHaiku::dispatchDidCommitLoad() { if (m_webView) { BMessage message(LOAD_TRANSFERRING); message.AddString("url", m_frame->loader()->documentLoader()->request().url().string()); m_messenger->SendMessage(&message); } } void FrameLoaderClientHaiku::dispatchDidFinishDocumentLoad() { if (m_webView) { BMessage message(LOAD_DOC_COMPLETED); message.AddString("url", m_frame->loader()->url().string()); m_messenger->SendMessage(&message); } } void FrameLoaderClientHaiku::dispatchDidFinishLoad() { notImplemented(); } void FrameLoaderClientHaiku::dispatchDidFirstLayout() { notImplemented(); } void FrameLoaderClientHaiku::dispatchDidFirstVisuallyNonEmptyLayout() { notImplemented(); } void FrameLoaderClientHaiku::dispatchShow() { notImplemented(); } void FrameLoaderClientHaiku::cancelPolicyCheck() { notImplemented(); } void FrameLoaderClientHaiku::dispatchWillSubmitForm(FramePolicyFunction function, PassRefPtr<FormState>) { // FIXME: Send an event to allow for alerts and cancellation. if (!m_frame) return; (m_frame->loader()->*function)(PolicyUse); } void FrameLoaderClientHaiku::dispatchDidLoadMainResource(DocumentLoader*) { notImplemented(); } void FrameLoaderClientHaiku::revertToProvisionalState(DocumentLoader*) { notImplemented(); } void FrameLoaderClientHaiku::postProgressStartedNotification() { notImplemented(); } void FrameLoaderClientHaiku::postProgressEstimateChangedNotification() { notImplemented(); } void FrameLoaderClientHaiku::postProgressFinishedNotification() { if (m_webView) { BMessage message(LOAD_DL_COMPLETED); message.AddString("url", m_frame->loader()->url().string()); m_messenger->SendMessage(&message); } } void FrameLoaderClientHaiku::progressStarted() { notImplemented(); } void FrameLoaderClientHaiku::progressCompleted() { notImplemented(); } void FrameLoaderClientHaiku::setMainFrameDocumentReady(bool) { notImplemented(); // this is only interesting once we provide an external API for the DOM } void FrameLoaderClientHaiku::willChangeTitle(DocumentLoader*) { notImplemented(); } void FrameLoaderClientHaiku::didChangeTitle(DocumentLoader* docLoader) { setTitle(docLoader->title(), docLoader->url()); } void FrameLoaderClientHaiku::finishedLoading(DocumentLoader*) { notImplemented(); } bool FrameLoaderClientHaiku::canShowMIMEType(const String& MIMEType) const { notImplemented(); return true; } bool FrameLoaderClientHaiku::representationExistsForURLScheme(const String& URLScheme) const { notImplemented(); return false; } String FrameLoaderClientHaiku::generatedMIMETypeForURLScheme(const String& URLScheme) const { notImplemented(); return String(); } void FrameLoaderClientHaiku::frameLoadCompleted() { if (m_webView->LockLooper()) { m_webView->Draw(m_webView->Bounds()); m_webView->UnlockLooper(); } } void FrameLoaderClientHaiku::saveViewStateToItem(HistoryItem*) { notImplemented(); } void FrameLoaderClientHaiku::restoreViewState() { notImplemented(); } void FrameLoaderClientHaiku::restoreScrollPositionAndViewState() { notImplemented(); } void FrameLoaderClientHaiku::provisionalLoadStarted() { notImplemented(); } bool FrameLoaderClientHaiku::shouldTreatURLAsSameAsCurrent(const KURL&) const { notImplemented(); return false; } void FrameLoaderClientHaiku::addHistoryItemForFragmentScroll() { notImplemented(); } void FrameLoaderClientHaiku::didFinishLoad() { notImplemented(); } void FrameLoaderClientHaiku::prepareForDataSourceReplacement() { notImplemented(); } void FrameLoaderClientHaiku::setTitle(const String& title, const KURL&) { notImplemented(); } String FrameLoaderClientHaiku::userAgent(const KURL&) { return String("Mozilla/5.0 (compatible; U; InfiNet 0.1; Haiku) AppleWebKit/420+ (KHTML, like Gecko)"); } void FrameLoaderClientHaiku::dispatchDidReceiveIcon() { notImplemented(); } void FrameLoaderClientHaiku::frameLoaderDestroyed() { m_frame = 0; m_messenger = 0; delete this; } bool FrameLoaderClientHaiku::canHandleRequest(const WebCore::ResourceRequest&) const { notImplemented(); return true; } void FrameLoaderClientHaiku::partClearedInBegin() { notImplemented(); } void FrameLoaderClientHaiku::updateGlobalHistory() { notImplemented(); } void FrameLoaderClientHaiku::updateGlobalHistoryRedirectLinks() { notImplemented(); } bool FrameLoaderClientHaiku::shouldGoToHistoryItem(WebCore::HistoryItem*) const { notImplemented(); return true; } void FrameLoaderClientHaiku::saveScrollPositionAndViewStateToItem(WebCore::HistoryItem*) { notImplemented(); } bool FrameLoaderClientHaiku::canCachePage() const { return false; } void FrameLoaderClientHaiku::setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&) { notImplemented(); } void FrameLoaderClientHaiku::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length) { if (!m_frame) return; FrameLoader* frameLoader = loader->frameLoader(); frameLoader->setEncoding(m_response.textEncodingName(), false); frameLoader->addData(data, length); } WebCore::ResourceError FrameLoaderClientHaiku::cancelledError(const WebCore::ResourceRequest& request) { notImplemented(); return ResourceError(String(), WebKitErrorCannotShowURL, request.url().string(), String()); } WebCore::ResourceError FrameLoaderClientHaiku::blockedError(const ResourceRequest& request) { notImplemented(); return ResourceError(String(), WebKitErrorCannotShowURL, request.url().string(), String()); } WebCore::ResourceError FrameLoaderClientHaiku::cannotShowURLError(const WebCore::ResourceRequest& request) { return ResourceError(String(), WebKitErrorCannotShowURL, request.url().string(), String()); } WebCore::ResourceError FrameLoaderClientHaiku::interruptForPolicyChangeError(const WebCore::ResourceRequest& request) { notImplemented(); return ResourceError(String(), WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(), String()); } WebCore::ResourceError FrameLoaderClientHaiku::cannotShowMIMETypeError(const WebCore::ResourceResponse& response) { notImplemented(); return ResourceError(String(), WebKitErrorCannotShowMIMEType, response.url().string(), String()); } WebCore::ResourceError FrameLoaderClientHaiku::fileDoesNotExistError(const WebCore::ResourceResponse& response) { notImplemented(); return ResourceError(String(), WebKitErrorCannotShowURL, response.url().string(), String()); } bool FrameLoaderClientHaiku::shouldFallBack(const WebCore::ResourceError& error) { notImplemented(); return false; } WTF::PassRefPtr<DocumentLoader> FrameLoaderClientHaiku::createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData) { return DocumentLoader::create(request, substituteData); } void FrameLoaderClientHaiku::download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&) { notImplemented(); } void FrameLoaderClientHaiku::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&) { notImplemented(); } void FrameLoaderClientHaiku::dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest& request, const ResourceResponse& response) { notImplemented(); } bool FrameLoaderClientHaiku::shouldUseCredentialStorage(DocumentLoader*, unsigned long) { notImplemented(); return false; } void FrameLoaderClientHaiku::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&) { notImplemented(); } void FrameLoaderClientHaiku::dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&) { notImplemented(); } void FrameLoaderClientHaiku::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long id, const ResourceResponse& response) { notImplemented(); m_response = response; m_firstData = true; } void FrameLoaderClientHaiku::dispatchDidReceiveContentLength(DocumentLoader* loader, unsigned long id, int length) { notImplemented(); } void FrameLoaderClientHaiku::dispatchDidFinishLoading(DocumentLoader*, unsigned long) { notImplemented(); } void FrameLoaderClientHaiku::dispatchDidFailLoading(DocumentLoader* loader, unsigned long, const ResourceError&) { if (m_webView) { BMessage message(LOAD_FAILED); message.AddString("url", m_frame->loader()->documentLoader()->request().url().string()); m_messenger->SendMessage(&message); } } bool FrameLoaderClientHaiku::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int) { notImplemented(); return false; } void FrameLoaderClientHaiku::dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const ScriptString&) { notImplemented(); } void FrameLoaderClientHaiku::dispatchDidFailProvisionalLoad(const ResourceError&) { notImplemented(); } void FrameLoaderClientHaiku::dispatchDidFailLoad(const ResourceError&) { notImplemented(); } Frame* FrameLoaderClientHaiku::dispatchCreatePage() { notImplemented(); return false; } void FrameLoaderClientHaiku::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const String& mimetype, const ResourceRequest& request) { if (!m_frame) return; notImplemented(); (m_frame->loader()->*function)(PolicyUse); } void FrameLoaderClientHaiku::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction&, const ResourceRequest& request, PassRefPtr<FormState>, const String& targetName) { if (!m_frame) return; if (m_webView) { BMessage message(NEW_WINDOW_REQUESTED); message.AddString("url", request.url().string()); if (m_messenger->SendMessage(&message)) { (m_frame->loader()->*function)(PolicyIgnore); return; } } (m_frame->loader()->*function)(PolicyUse); } void FrameLoaderClientHaiku::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState>) { if (!m_frame || !function) return; if (m_webView) { BMessage message(NAVIGATION_REQUESTED); message.AddString("url", request.url().string()); m_messenger->SendMessage(&message); (m_frame->loader()->*function)(PolicyUse); } } void FrameLoaderClientHaiku::dispatchUnableToImplementPolicy(const ResourceError&) { notImplemented(); } void FrameLoaderClientHaiku::startDownload(const ResourceRequest&) { notImplemented(); } PassRefPtr<Frame> FrameLoaderClientHaiku::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) { // FIXME: We should apply the right property to the frameView. (scrollbar,margins) RefPtr<Frame> childFrame = Frame::create(m_frame->page(), ownerElement, this); setFrame(childFrame.get()); RefPtr<FrameView> frameView = FrameView::create(childFrame.get()); frameView->setAllowsScrolling(allowsScrolling); frameView->deref(); childFrame->setView(frameView.get()); childFrame->init(); childFrame->tree()->setName(name); m_frame->tree()->appendChild(childFrame); childFrame->loader()->loadURLIntoChildFrame(url, referrer, childFrame.get()); // The frame's onload handler may have removed it from the document. if (!childFrame->tree()->parent()) return 0; return childFrame.release(); notImplemented(); return 0; } ObjectContentType FrameLoaderClientHaiku::objectContentType(const KURL& url, const String& mimeType) { notImplemented(); return ObjectContentType(); } PassRefPtr<Widget> FrameLoaderClientHaiku::createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) { notImplemented(); return 0; } void FrameLoaderClientHaiku::redirectDataToPlugin(Widget* pluginWidget) { notImplemented(); return; } ResourceError FrameLoaderClientHaiku::pluginWillHandleLoadError(const ResourceResponse& response) { notImplemented(); return ResourceError(String(), WebKitErrorCannotLoadPlugIn, response.url().string(), String()); } PassRefPtr<Widget> FrameLoaderClientHaiku::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues) { notImplemented(); return 0; } String FrameLoaderClientHaiku::overrideMediaType() const { notImplemented(); return String(); } void FrameLoaderClientHaiku::windowObjectCleared() { if (m_webView) { BMessage message(JAVASCRIPT_WINDOW_OBJECT_CLEARED); m_messenger->SendMessage(&message); } } void FrameLoaderClientHaiku::documentElementAvailable() { } void FrameLoaderClientHaiku::didPerformFirstNavigation() const { notImplemented(); } void FrameLoaderClientHaiku::registerForIconNotification(bool listen) { notImplemented(); } void FrameLoaderClientHaiku::savePlatformDataToCachedFrame(CachedFrame*) { notImplemented(); } void FrameLoaderClientHaiku::transitionToCommittedFromCachedFrame(CachedFrame*) { notImplemented(); } void FrameLoaderClientHaiku::transitionToCommittedForNewPage() { ASSERT(m_frame); ASSERT(m_webView); Page* page = m_frame->page(); ASSERT(page); bool isMainFrame = m_frame == page->mainFrame(); m_frame->setView(0); RefPtr<FrameView> frameView; if (isMainFrame) { if (m_webView->LockLooper()) { // We lock the looper in order to get the bounds of the WebView. frameView = FrameView::create(m_frame, IntRect(m_webView->Bounds()).size()); m_webView->UnlockLooper(); } } else frameView = FrameView::create(m_frame); ASSERT(frameView); m_frame->setView(frameView); frameView->setPlatformWidget(m_webView); if (HTMLFrameOwnerElement* owner = m_frame->ownerElement()) m_frame->view()->setScrollbarModes(owner->scrollingMode(), owner->scrollingMode()); } } // namespace WebCore �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp���������������������������������������������������0000644�0001750�0001750�00000017716�11254742231�020442� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 Zack Rusin <zack@kde.org> * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> 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. */ #include "config.h" #include "ChromeClientHaiku.h" #include "Frame.h" #include "FrameLoadRequest.h" #include "FrameView.h" #include "HitTestResult.h" #include "NotImplemented.h" #include "PlatformString.h" #include <Alert.h> #include <String.h> namespace WebCore { ChromeClientHaiku::ChromeClientHaiku() { } ChromeClientHaiku::~ChromeClientHaiku() { } void ChromeClientHaiku::chromeDestroyed() { notImplemented(); } void ChromeClientHaiku::setWindowRect(const FloatRect&) { notImplemented(); } FloatRect ChromeClientHaiku::windowRect() { notImplemented(); return FloatRect(0, 0, 200, 200); } FloatRect ChromeClientHaiku::pageRect() { notImplemented(); return FloatRect(0, 0, 200, 200); } float ChromeClientHaiku::scaleFactor() { notImplemented(); return 1.0; } void ChromeClientHaiku::focus() { notImplemented(); } void ChromeClientHaiku::unfocus() { notImplemented(); } bool ChromeClientHaiku::canTakeFocus(FocusDirection) { notImplemented(); return true; } void ChromeClientHaiku::takeFocus(FocusDirection) { notImplemented(); } Page* ChromeClientHaiku::createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&) { notImplemented(); return 0; } Page* ChromeClientHaiku::createModalDialog(Frame*, const FrameLoadRequest&) { notImplemented(); return 0; } void ChromeClientHaiku::show() { notImplemented(); } bool ChromeClientHaiku::canRunModal() { notImplemented(); return false; } void ChromeClientHaiku::runModal() { notImplemented(); } void ChromeClientHaiku::setToolbarsVisible(bool) { notImplemented(); } bool ChromeClientHaiku::toolbarsVisible() { notImplemented(); return false; } void ChromeClientHaiku::setStatusbarVisible(bool) { notImplemented(); } bool ChromeClientHaiku::statusbarVisible() { notImplemented(); return false; } void ChromeClientHaiku::setScrollbarsVisible(bool) { notImplemented(); } bool ChromeClientHaiku::scrollbarsVisible() { notImplemented(); return true; } void ChromeClientHaiku::setMenubarVisible(bool) { notImplemented(); } bool ChromeClientHaiku::menubarVisible() { notImplemented(); return false; } void ChromeClientHaiku::setResizable(bool) { notImplemented(); } void ChromeClientHaiku::addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID) { printf("MESSAGE %s:%i %s\n", BString(sourceID).String(), lineNumber, BString(message).String()); } void ChromeClientHaiku::addMessageToConsole(MessageSource, MessageLevel, const String& message, unsigned int lineNumber, const String& sourceID) { printf("MESSAGE %s:%i %s\n", BString(sourceID).String(), lineNumber, BString(message).String()); } void ChromeClientHaiku::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned int lineNumber, const String& sourceID) { printf("MESSAGE %s:%i %s\n", BString(sourceID).String(), lineNumber, BString(message).String()); } bool ChromeClientHaiku::canRunBeforeUnloadConfirmPanel() { notImplemented(); return false; } bool ChromeClientHaiku::runBeforeUnloadConfirmPanel(const String& message, Frame* frame) { notImplemented(); return false; } void ChromeClientHaiku::closeWindowSoon() { notImplemented(); } void ChromeClientHaiku::runJavaScriptAlert(Frame*, const String& msg) { BAlert* alert = new BAlert("JavaScript", BString(msg).String(), "OK"); alert->Go(); } bool ChromeClientHaiku::runJavaScriptConfirm(Frame*, const String& msg) { BAlert* alert = new BAlert("JavaScript", BString(msg).String(), "Yes", "No"); return !alert->Go(); } bool ChromeClientHaiku::runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result) { notImplemented(); return false; } void ChromeClientHaiku::setStatusbarText(const String&) { notImplemented(); } bool ChromeClientHaiku::shouldInterruptJavaScript() { notImplemented(); return false; } bool ChromeClientHaiku::tabsToLinks() const { return false; } IntRect ChromeClientHaiku::windowResizerRect() const { return IntRect(); } void ChromeClientHaiku::repaint(const IntRect&, bool contentChanged, bool immediate, bool repaintContentOnly) { notImplemented(); } void ChromeClientHaiku::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) { notImplemented(); } IntPoint ChromeClientHaiku::screenToWindow(const IntPoint&) const { notImplemented(); return IntPoint(); } IntRect ChromeClientHaiku::windowToScreen(const IntRect&) const { notImplemented(); return IntRect(); } PlatformPageClient ChromeClientHaiku::platformPageClient() const { notImplemented(); return PlatformWidget(); } void ChromeClientHaiku::contentsSizeChanged(Frame*, const IntSize&) const { notImplemented(); } void ChromeClientHaiku::scrollRectIntoView(const IntRect&, const ScrollView*) const { notImplemented(); } void ChromeClientHaiku::addToDirtyRegion(const IntRect&) { } void ChromeClientHaiku::scrollBackingStore(int, int, const IntRect&, const IntRect&) { } void ChromeClientHaiku::updateBackingStore() { } void ChromeClientHaiku::mouseDidMoveOverElement(const HitTestResult& hit, unsigned /*modifierFlags*/) { // Some extra info notImplemented(); } void ChromeClientHaiku::setToolTip(const String& tip) { notImplemented(); } void ChromeClientHaiku::setToolTip(const String& tip, TextDirection) { notImplemented(); } void ChromeClientHaiku::print(Frame*) { notImplemented(); } void ChromeClientHaiku::exceededDatabaseQuota(Frame*, const String& databaseName) { notImplemented(); } #if ENABLE(OFFLINE_WEB_APPLICATIONS) void ChromeClientWx::reachedMaxAppCacheSize(int64_t spaceNeeded) { notImplemented(); } #endif void ChromeClientHaiku::requestGeolocationPermissionForFrame(Frame*, Geolocation*) { notImplemented(); } void ChromeClientHaiku::runOpenPanel(Frame*, PassRefPtr<FileChooser>) { notImplemented(); } bool ChromeClientHaiku::setCursor(PlatformCursorHandle) { notImplemented(); return false; } // Notification that the given form element has changed. This function // will be called frequently, so handling should be very fast. void ChromeClientHaiku::formStateDidChange(const Node*) { notImplemented(); } PassOwnPtr<HTMLParserQuirks> ChromeClientHaiku::createHTMLParserQuirks() { notImplemented(); return 0; } } // namespace WebCore ��������������������������������������������������WebKit/haiku/WebCoreSupport/DragClientHaiku.cpp�����������������������������������������������������0000644�0001750�0001750�00000004531�11230011776�020066� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple Inc. All rights reserved. * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> * * 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. */ #include "config.h" #include "DragClientHaiku.h" #include "NotImplemented.h" namespace WebCore { DragDestinationAction DragClientHaiku::actionMaskForDrag(DragData*) { notImplemented(); return DragDestinationActionAny; } void DragClientHaiku::willPerformDragDestinationAction(DragDestinationAction, DragData*) { notImplemented(); } void DragClientHaiku::dragControllerDestroyed() { notImplemented(); } DragSourceAction DragClientHaiku::dragSourceActionMaskForPoint(const IntPoint&) { notImplemented(); return DragSourceActionAny; } void DragClientHaiku::willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*) { notImplemented(); } void DragClientHaiku::startDrag(DragImageRef dragImage, const IntPoint&, const IntPoint&, Clipboard*, Frame*, bool) { notImplemented(); } DragImageRef DragClientHaiku::createDragImageForLink(KURL&, const String&, Frame*) { notImplemented(); return 0; } } // namespace WebCore �����������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.h������������������������������������������������0000644�0001750�0001750�00000004200�11230011743�021112� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 Zack Rusin <zack@kde.org> * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> * * 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 ContextMenuClientHaiku_h #define ContextMenuClientHaiku_h #include "ContextMenuClient.h" namespace WebCore { class ContextMenu; class ContextMenuClientHaiku : public ContextMenuClient { public: virtual void contextMenuDestroyed(); virtual PlatformMenuDescription getCustomMenuFromDefaultItems(ContextMenu*); virtual void contextMenuItemSelected(ContextMenuItem*, const ContextMenu*); virtual void downloadURL(const KURL& url); virtual void searchWithGoogle(const Frame*); virtual void lookUpInDictionary(Frame*); virtual void speak(const String&); virtual bool isSpeaking(); virtual void stopSpeaking(); }; } // namespace WebCore #endif // ContextMenuClientHaiku_h ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp���������������������������������������������������0000644�0001750�0001750�00000031146�11230012015�020424� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> * Copyright (C) 2006 Zack Rusin <zack@kde.org> * Copyright (C) 2006 Apple Computer, Inc. * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> * Copyright (C) 2007 Andrea Anzani <andrea.anzani@gmail.com> * * 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. */ #include "config.h" #include "EditorClientHaiku.h" #include "Document.h" #include "Editor.h" #include "FocusController.h" #include "Frame.h" #include "KeyboardCodes.h" #include "KeyboardEvent.h" #include "Page.h" #include "PlatformKeyboardEvent.h" #include "NotImplemented.h" namespace WebCore { EditorClientHaiku::EditorClientHaiku() : m_editing(false) , m_inUndoRedo(false) { } void EditorClientHaiku::setPage(Page* page) { m_page = page; } void EditorClientHaiku::pageDestroyed() { notImplemented(); } bool EditorClientHaiku::shouldDeleteRange(Range*) { notImplemented(); return true; } bool EditorClientHaiku::shouldShowDeleteInterface(HTMLElement*) { notImplemented(); return false; } bool EditorClientHaiku::smartInsertDeleteEnabled() { notImplemented(); return false; } bool EditorClientHaiku::isSelectTrailingWhitespaceEnabled() { notImplemented(); return false; } bool EditorClientHaiku::isContinuousSpellCheckingEnabled() { notImplemented(); return false; } void EditorClientHaiku::toggleContinuousSpellChecking() { notImplemented(); } bool EditorClientHaiku::isGrammarCheckingEnabled() { notImplemented(); return false; } void EditorClientHaiku::toggleGrammarChecking() { notImplemented(); } int EditorClientHaiku::spellCheckerDocumentTag() { notImplemented(); return 0; } bool EditorClientHaiku::isEditable() { // FIXME: should be controllable return false; } bool EditorClientHaiku::shouldBeginEditing(WebCore::Range*) { notImplemented(); return true; } bool EditorClientHaiku::shouldEndEditing(WebCore::Range*) { notImplemented(); return true; } bool EditorClientHaiku::shouldInsertNode(Node*, Range*, EditorInsertAction) { notImplemented(); return true; } bool EditorClientHaiku::shouldInsertText(const String&, Range*, EditorInsertAction) { notImplemented(); return true; } bool EditorClientHaiku::shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting) { notImplemented(); return true; } bool EditorClientHaiku::shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*) { notImplemented(); return true; } bool EditorClientHaiku::shouldMoveRangeAfterDelete(Range*, Range*) { notImplemented(); return true; } void EditorClientHaiku::didBeginEditing() { notImplemented(); m_editing = true; } void EditorClientHaiku::respondToChangedContents() { notImplemented(); } void EditorClientHaiku::respondToChangedSelection() { notImplemented(); } void EditorClientHaiku::didEndEditing() { notImplemented(); m_editing = false; } void EditorClientHaiku::didWriteSelectionToPasteboard() { notImplemented(); } void EditorClientHaiku::didSetSelectionTypesForPasteboard() { notImplemented(); } void EditorClientHaiku::registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand> cmd) { notImplemented(); } void EditorClientHaiku::registerCommandForRedo(WTF::PassRefPtr<WebCore::EditCommand>) { notImplemented(); } void EditorClientHaiku::clearUndoRedoOperations() { notImplemented(); } bool EditorClientHaiku::canUndo() const { notImplemented(); return false; } bool EditorClientHaiku::canRedo() const { notImplemented(); return false; } void EditorClientHaiku::undo() { notImplemented(); m_inUndoRedo = true; m_inUndoRedo = false; } void EditorClientHaiku::redo() { notImplemented(); m_inUndoRedo = true; m_inUndoRedo = false; } void EditorClientHaiku::handleKeyboardEvent(KeyboardEvent* event) { Frame* frame = m_page->focusController()->focusedOrMainFrame(); if (!frame || !frame->document()->focusedNode()) return; const PlatformKeyboardEvent* kevent = event->keyEvent(); if (!kevent || kevent->type() == PlatformKeyboardEvent::KeyUp) return; Node* start = frame->selection()->start().node(); if (!start) return; if (start->isContentEditable()) { switch(kevent->windowsVirtualKeyCode()) { case VK_BACK: frame->editor()->deleteWithDirection(SelectionController::BACKWARD, kevent->ctrlKey() ? WordGranularity : CharacterGranularity, false, true); break; case VK_DELETE: frame->editor()->deleteWithDirection(SelectionController::FORWARD, kevent->ctrlKey() ? WordGranularity : CharacterGranularity, false, true); break; case VK_LEFT: frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, SelectionController::LEFT, kevent->ctrlKey() ? WordGranularity : CharacterGranularity, true); break; case VK_RIGHT: frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, SelectionController::RIGHT, kevent->ctrlKey() ? WordGranularity : CharacterGranularity, true); break; case VK_UP: frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, SelectionController::BACKWARD, kevent->ctrlKey() ? ParagraphGranularity : LineGranularity, true); break; case VK_DOWN: frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, SelectionController::FORWARD, kevent->ctrlKey() ? ParagraphGranularity : LineGranularity, true); break; case VK_PRIOR: // PageUp frame->editor()->command("MoveUpByPageAndModifyCaret"); break; case VK_NEXT: // PageDown frame->editor()->command("MoveDownByPageAndModifyCaret"); break; case VK_RETURN: frame->editor()->command("InsertLineBreak"); break; case VK_TAB: return; default: if (!kevent->ctrlKey() && !kevent->altKey() && !kevent->text().isEmpty()) { if (kevent->text().length() == 1) { UChar ch = kevent->text()[0]; // Don't insert null or control characters as they can result in unexpected behaviour if (ch < ' ') break; } frame->editor()->insertText(kevent->text(), event); } else if (kevent->ctrlKey()) { switch (kevent->windowsVirtualKeyCode()) { case VK_A: frame->editor()->command("SelectAll"); break; case VK_B: frame->editor()->command("ToggleBold"); break; case VK_C: frame->editor()->command("Copy"); break; case VK_I: frame->editor()->command("ToggleItalic"); break; case VK_V: frame->editor()->command("Paste"); break; case VK_X: frame->editor()->command("Cut"); break; case VK_Y: frame->editor()->command("Redo"); break; case VK_Z: frame->editor()->command("Undo"); break; default: return; } } else return; } } else { switch (kevent->windowsVirtualKeyCode()) { case VK_UP: frame->editor()->command("MoveUp"); break; case VK_DOWN: frame->editor()->command("MoveDown"); break; case VK_PRIOR: // PageUp frame->editor()->command("MoveUpByPageAndModifyCaret"); break; case VK_NEXT: // PageDown frame->editor()->command("MoveDownByPageAndModifyCaret"); break; case VK_HOME: if (kevent->ctrlKey()) frame->editor()->command("MoveToBeginningOfDocument"); break; case VK_END: if (kevent->ctrlKey()) frame->editor()->command("MoveToEndOfDocument"); break; default: if (kevent->ctrlKey()) { switch(kevent->windowsVirtualKeyCode()) { case VK_A: frame->editor()->command("SelectAll"); break; case VK_C: case VK_X: frame->editor()->command("Copy"); break; default: return; } } else return; } } event->setDefaultHandled(); } void EditorClientHaiku::handleInputMethodKeydown(KeyboardEvent*) { notImplemented(); } void EditorClientHaiku::textFieldDidBeginEditing(Element*) { m_editing = true; } void EditorClientHaiku::textFieldDidEndEditing(Element*) { m_editing = false; } void EditorClientHaiku::textDidChangeInTextField(Element*) { notImplemented(); } bool EditorClientHaiku::doTextFieldCommandFromEvent(Element*, KeyboardEvent*) { return false; } void EditorClientHaiku::textWillBeDeletedInTextField(Element*) { notImplemented(); } void EditorClientHaiku::textDidChangeInTextArea(Element*) { notImplemented(); } void EditorClientHaiku::ignoreWordInSpellDocument(const String&) { notImplemented(); } void EditorClientHaiku::learnWord(const String&) { notImplemented(); } void EditorClientHaiku::checkSpellingOfString(const UChar*, int, int*, int*) { notImplemented(); } String EditorClientHaiku::getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord) { notImplemented(); return String(); } void EditorClientHaiku::checkGrammarOfString(const UChar*, int, Vector<GrammarDetail>&, int*, int*) { notImplemented(); } void EditorClientHaiku::updateSpellingUIWithGrammarString(const String&, const GrammarDetail&) { notImplemented(); } void EditorClientHaiku::updateSpellingUIWithMisspelledWord(const String&) { notImplemented(); } void EditorClientHaiku::showSpellingUI(bool) { notImplemented(); } bool EditorClientHaiku::spellingUIIsShowing() { notImplemented(); return false; } void EditorClientHaiku::getGuessesForWord(const String&, Vector<String>&) { notImplemented(); } void EditorClientHaiku::setInputMethodState(bool enabled) { notImplemented(); } bool EditorClientHaiku::isEditing() const { return m_editing; } } // namespace WebCore ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h�����������������������������������������������������0000644�0001750�0001750�00000012570�11254742231�020100� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 Zack Rusin <zack@kde.org> * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> 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 ChromeClientHaiku_h #define ChromeClientHaiku_h #include "ChromeClient.h" #include "FloatRect.h" #include "RefCounted.h" namespace WebCore { class FloatRect; class Page; struct FrameLoadRequest; class ChromeClientHaiku : public ChromeClient { public: ChromeClientHaiku(); virtual ~ChromeClientHaiku(); void chromeDestroyed(); void setWindowRect(const FloatRect&); FloatRect windowRect(); FloatRect pageRect(); float scaleFactor(); void focus(); void unfocus(); bool canTakeFocus(FocusDirection); void takeFocus(FocusDirection); Page* createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&); Page* createModalDialog(Frame*, const FrameLoadRequest&); void show(); bool canRunModal(); void runModal(); void setToolbarsVisible(bool); bool toolbarsVisible(); void setStatusbarVisible(bool); bool statusbarVisible(); void setScrollbarsVisible(bool); bool scrollbarsVisible(); void setMenubarVisible(bool); bool menubarVisible(); void setResizable(bool); void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID); void addMessageToConsole(MessageSource, MessageLevel, const String& message, unsigned int lineNumber, const String& sourceID); void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String&, unsigned int, const String&); bool canRunBeforeUnloadConfirmPanel(); bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame); void closeWindowSoon(); void runJavaScriptAlert(Frame*, const String&); bool runJavaScriptConfirm(Frame*, const String&); bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result); bool shouldInterruptJavaScript(); void setStatusbarText(const WebCore::String&); bool tabsToLinks() const; IntRect windowResizerRect() const; void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false); void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); IntPoint screenToWindow(const IntPoint&) const; IntRect windowToScreen(const IntRect&) const; PlatformPageClient platformPageClient() const; void contentsSizeChanged(Frame*, const IntSize&) const; void scrollRectIntoView(const IntRect&, const ScrollView*) const; void addToDirtyRegion(const IntRect&); void scrollBackingStore(int, int, const IntRect&, const IntRect&); void updateBackingStore(); void scrollbarsModeDidChange() const { } void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags); void setToolTip(const String&); virtual void setToolTip(const String&, TextDirection); void print(Frame*); void exceededDatabaseQuota(Frame*, const String& databaseName); #if ENABLE(OFFLINE_WEB_APPLICATIONS) virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); #endif // This is an asynchronous call. The ChromeClient can display UI asking the user for permission // to use Geolococation. The ChromeClient must call Geolocation::setShouldClearCache() appropriately. void requestGeolocationPermissionForFrame(Frame*, Geolocation*); void runOpenPanel(Frame*, PassRefPtr<FileChooser>); bool setCursor(PlatformCursorHandle); // Notification that the given form element has changed. This function // will be called frequently, so handling should be very fast. void formStateDidChange(const Node*); PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks(); }; } // namespace WebCore #endif ����������������������������������������������������������������������������������������������������������������������������������������WebKit/haiku/WebCoreSupport/DragClientHaiku.h�������������������������������������������������������0000644�0001750�0001750�00000004344�11230011776�017535� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple Inc. All rights reserved. * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> * * 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. */ #include "DragClient.h" namespace WebCore { class DragClientHaiku : public DragClient { public: virtual void willPerformDragDestinationAction(DragDestinationAction, DragData*); virtual WebCore::DragDestinationAction actionMaskForDrag(DragData*); virtual void dragControllerDestroyed(); virtual DragSourceAction dragSourceActionMaskForPoint(const IntPoint&); virtual void willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*); virtual void startDrag(DragImageRef dragImage, const IntPoint& dragImageOrigin, const IntPoint& eventPos, Clipboard*, Frame*, bool linkDrag = false); virtual DragImageRef createDragImageForLink(KURL&, const String& label, Frame*); }; } // namespace WebCore ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.cpp����������������������������������������������0000644�0001750�0001750�00000004606�11230011743�021457� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 Zack Rusin <zack@kde.org> * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> * * 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. */ #include "config.h" #include "ContextMenuClientHaiku.h" #include "ContextMenu.h" #include "HitTestResult.h" #include "KURL.h" #include "NotImplemented.h" namespace WebCore { void ContextMenuClientHaiku::contextMenuDestroyed() { notImplemented(); } PlatformMenuDescription ContextMenuClientHaiku::getCustomMenuFromDefaultItems(ContextMenu* menu) { return menu->platformDescription(); } void ContextMenuClientHaiku::contextMenuItemSelected(ContextMenuItem*, const ContextMenu*) { notImplemented(); } void ContextMenuClientHaiku::downloadURL(const KURL& url) { notImplemented(); } void ContextMenuClientHaiku::lookUpInDictionary(Frame*) { notImplemented(); } void ContextMenuClientHaiku::speak(const String&) { notImplemented(); } bool ContextMenuClientHaiku::isSpeaking() { notImplemented(); return false; } void ContextMenuClientHaiku::stopSpeaking() { notImplemented(); } void ContextMenuClientHaiku::searchWithGoogle(const Frame*) { notImplemented(); } } // namespace WebCore ��������������������������������������������������������������������������������������������������������������������������WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h������������������������������������������������0000644�0001750�0001750�00000027505�11233645153�021052� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 Zack Rusin <zack@kde.org> * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> 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 FrameLoaderClientHaiku_h #define FrameLoaderClientHaiku_h #include "FrameLoader.h" #include "FrameLoaderClient.h" #include "KURL.h" #include "ResourceResponse.h" class BMessenger; class WebView; namespace WebCore { class AuthenticationChallenge; class DocumentLoader; class Element; class FormState; class NavigationAction; class ResourceLoader; class String; struct LoadErrorResetToken; class FrameLoaderClientHaiku : public FrameLoaderClient { public: FrameLoaderClientHaiku(); ~FrameLoaderClientHaiku() { } void setFrame(Frame*); void setWebView(WebView*); virtual void detachFrameLoader(); virtual bool hasWebView() const; virtual bool hasBackForwardList() const; virtual void resetBackForwardList(); virtual bool provisionalItemIsTarget() const; virtual void makeRepresentation(DocumentLoader*); virtual void forceLayout(); virtual void forceLayoutForNonHTML(); virtual void updateHistoryForCommit(); virtual void updateHistoryForBackForwardNavigation(); virtual void updateHistoryForReload(); virtual void updateHistoryForStandardLoad(); virtual void updateHistoryForInternalLoad(); virtual void updateHistoryAfterClientRedirect(); virtual void setCopiesOnScroll(); virtual LoadErrorResetToken* tokenForLoadErrorReset(); virtual void resetAfterLoadError(LoadErrorResetToken*); virtual void doNotResetAfterLoadError(LoadErrorResetToken*); virtual void willCloseDocument(); virtual void detachedFromParent2(); virtual void detachedFromParent3(); virtual void frameLoaderDestroyed(); virtual bool canHandleRequest(const ResourceRequest&) const; virtual void dispatchDidHandleOnloadEvents(); virtual void dispatchDidReceiveServerRedirectForProvisionalLoad(); virtual void dispatchDidCancelClientRedirect(); virtual void dispatchWillPerformClientRedirect(const KURL&, double interval, double fireDate); virtual void dispatchDidChangeLocationWithinPage(); virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); virtual void dispatchDidReceiveTitle(const String& title); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFinishDocumentLoad(); virtual void dispatchDidFinishLoad(); virtual void dispatchDidFirstLayout(); virtual void dispatchDidFirstVisuallyNonEmptyLayout(); virtual void dispatchShow(); virtual void cancelPolicyCheck(); virtual void dispatchWillSubmitForm(FramePolicyFunction, PassRefPtr<FormState>); virtual void dispatchDidLoadMainResource(DocumentLoader*); virtual void revertToProvisionalState(DocumentLoader*); virtual void postProgressStartedNotification(); virtual void postProgressEstimateChangedNotification(); virtual void postProgressFinishedNotification(); virtual void progressStarted(); virtual void progressCompleted(); virtual void setMainFrameDocumentReady(bool); virtual void willChangeTitle(DocumentLoader*); virtual void didChangeTitle(DocumentLoader*); virtual void finishedLoading(DocumentLoader*); virtual bool canShowMIMEType(const String& MIMEType) const; virtual bool representationExistsForURLScheme(const String& URLScheme) const; virtual String generatedMIMETypeForURLScheme(const String& URLScheme) const; virtual void frameLoadCompleted(); virtual void saveViewStateToItem(HistoryItem*); virtual void restoreViewState(); virtual void restoreScrollPositionAndViewState(); virtual void provisionalLoadStarted(); virtual bool shouldTreatURLAsSameAsCurrent(const KURL&) const; virtual void addHistoryItemForFragmentScroll(); virtual void didFinishLoad(); virtual void prepareForDataSourceReplacement(); virtual void setTitle(const String& title, const KURL&); virtual String userAgent(const KURL&); virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedForNewPage(); virtual void updateGlobalHistory(); virtual void updateGlobalHistoryRedirectLinks(); virtual bool shouldGoToHistoryItem(HistoryItem*) const; virtual void saveScrollPositionAndViewStateToItem(HistoryItem*); virtual bool canCachePage() const; virtual void setMainDocumentError(DocumentLoader*, const ResourceError&); virtual void committedLoad(DocumentLoader*, const char*, int); virtual ResourceError cancelledError(const ResourceRequest&); virtual ResourceError blockedError(const ResourceRequest&); virtual ResourceError cannotShowURLError(const ResourceRequest&); virtual ResourceError interruptForPolicyChangeError(const ResourceRequest&); virtual ResourceError cannotShowMIMETypeError(const ResourceResponse&); virtual ResourceError fileDoesNotExistError(const ResourceResponse&); virtual bool shouldFallBack(const ResourceError&); virtual WTF::PassRefPtr<DocumentLoader> createDocumentLoader(const ResourceRequest&, const SubstituteData&); virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&); virtual void assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&); virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, const ResourceResponse&); virtual bool shouldUseCredentialStorage(DocumentLoader*, unsigned long identifier); virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&); virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&); virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse&); virtual void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long, int); virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long); virtual void dispatchDidFailLoading(DocumentLoader*, unsigned long, const ResourceError&); virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int); virtual void dispatchDidLoadResourceByXMLHttpRequest(unsigned long, const ScriptString&); virtual void dispatchDidFailProvisionalLoad(const ResourceError&); virtual void dispatchDidFailLoad(const ResourceError&); virtual Frame* dispatchCreatePage(); virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction, const String&, const ResourceRequest&); virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction, const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>, const String&); virtual void dispatchDecidePolicyForNavigationAction(FramePolicyFunction, const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>); virtual void dispatchUnableToImplementPolicy(const ResourceError&); virtual void startDownload(const ResourceRequest&); // FIXME: This should probably not be here, but it's needed for the tests currently. virtual void partClearedInBegin(); virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement*, const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually); virtual void redirectDataToPlugin(Widget* pluginWidget); virtual ResourceError pluginWillHandleLoadError(const ResourceResponse&); virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL, const Vector<String>& paramNames, const Vector<String>& paramValues); virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType); virtual String overrideMediaType() const; virtual void windowObjectCleared(); virtual void documentElementAvailable(); virtual void didPerformFirstNavigation() const; virtual void registerForIconNotification(bool listen = true); private: Frame* m_frame; WebView* m_webView; BMessenger* m_messenger; ResourceResponse m_response; bool m_firstData; }; } // namespace WebCore #endif // FrameLoaderClientHaiku_h �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp������������������������������������������������0000644�0001750�0001750�00000006123�11234144465�021164� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple Inc. All rights reserved. * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> * * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. */ #include "config.h" #include "InspectorClientHaiku.h" #include "PlatformString.h" #include "NotImplemented.h" namespace WebCore { void InspectorClientHaiku::inspectorDestroyed() { notImplemented(); } Page* InspectorClientHaiku::createPage() { notImplemented(); return 0; } String InspectorClientHaiku::localizedStringsURL() { notImplemented(); return String(); } String InspectorClientHaiku::hiddenPanels() { notImplemented(); return String(); } void InspectorClientHaiku::showWindow() { notImplemented(); } void InspectorClientHaiku::closeWindow() { notImplemented(); } void InspectorClientHaiku::attachWindow() { notImplemented(); } void InspectorClientHaiku::detachWindow() { notImplemented(); } void InspectorClientHaiku::setAttachedWindowHeight(unsigned height) { notImplemented(); } void InspectorClientHaiku::highlight(Node* node) { notImplemented(); } void InspectorClientHaiku::hideHighlight() { notImplemented(); } void InspectorClientHaiku::inspectedURLChanged(const String&) { notImplemented(); } void InspectorClientHaiku::inspectorWindowObjectCleared() { notImplemented(); } void InspectorClientHaiku::populateSetting(const String& key, InspectorController::Setting&) { notImplemented(); } void InspectorClientHaiku::storeSetting(const String& key, const InspectorController::Setting&) { notImplemented(); } void InspectorClientHaiku::removeSetting(const String& key) { notImplemented(); } } // namespace WebCore ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h��������������������������������������������������0000644�0001750�0001750�00000005267�11234144465�020641� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2007 Apple Inc. All rights reserved. * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> * * 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 InspectorClientHaiku_h #define InspectorClientHaiku_h #include "InspectorClient.h" namespace WebCore { class Node; class Page; class String; class InspectorClientHaiku : public InspectorClient { public: virtual void inspectorDestroyed(); virtual Page* createPage(); virtual String localizedStringsURL(); virtual String hiddenPanels(); virtual void showWindow(); virtual void closeWindow(); virtual void attachWindow(); virtual void detachWindow(); virtual void setAttachedWindowHeight(unsigned height); virtual void highlight(Node*); virtual void hideHighlight(); virtual void inspectedURLChanged(const String& newURL); virtual void populateSetting(const String& key, InspectorController::Setting&); virtual void storeSetting(const String& key, const InspectorController::Setting&); virtual void removeSetting(const String& key); virtual void inspectorWindowObjectCleared(); }; } // namespace WebCore #endif // InspectorClientHaiku_h �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/haiku/WebCoreSupport/EditorClientHaiku.h�����������������������������������������������������0000644�0001750�0001750�00000012144�11230012015�020066� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> * Copyright (C) 2006 Zack Rusin <zack@kde.org> * Copyright (C) 2006 Apple Computer, Inc. * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> * * 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 EditorClientHaiku_H #define EditorClientHaiku_H #include "EditorClient.h" #include "RefCounted.h" #include "Page.h" #include <wtf/Forward.h> namespace WebCore { class EditorClientHaiku : public EditorClient { public: EditorClientHaiku(); void setPage( Page* page ); virtual void pageDestroyed(); virtual bool shouldDeleteRange(Range*); virtual bool shouldShowDeleteInterface(HTMLElement*); virtual bool smartInsertDeleteEnabled(); virtual bool isSelectTrailingWhitespaceEnabled(); virtual bool isContinuousSpellCheckingEnabled(); virtual void toggleContinuousSpellChecking(); virtual bool isGrammarCheckingEnabled(); virtual void toggleGrammarChecking(); virtual int spellCheckerDocumentTag(); virtual bool isEditable(); virtual bool shouldBeginEditing(Range*); virtual bool shouldEndEditing(Range*); virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction); virtual bool shouldInsertText(const String&, Range*, EditorInsertAction); virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting); virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*); virtual bool shouldMoveRangeAfterDelete(Range*, Range*); virtual void didBeginEditing(); virtual void respondToChangedContents(); virtual void respondToChangedSelection(); virtual void didEndEditing(); virtual void didWriteSelectionToPasteboard(); virtual void didSetSelectionTypesForPasteboard(); virtual void registerCommandForUndo(PassRefPtr<EditCommand>); virtual void registerCommandForRedo(PassRefPtr<EditCommand>); virtual void clearUndoRedoOperations(); virtual bool canUndo() const; virtual bool canRedo() const; virtual void undo(); virtual void redo(); virtual void handleKeyboardEvent(KeyboardEvent*); virtual void handleInputMethodKeydown(KeyboardEvent*); virtual void textFieldDidBeginEditing(Element*); virtual void textFieldDidEndEditing(Element*); virtual void textDidChangeInTextField(Element*); virtual bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*); virtual void textWillBeDeletedInTextField(Element*); virtual void textDidChangeInTextArea(Element*); virtual void ignoreWordInSpellDocument(const String&); virtual void learnWord(const String&); virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); virtual String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord); virtual void checkGrammarOfString(const UChar*, int length, Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&); virtual void updateSpellingUIWithMisspelledWord(const String&); virtual void showSpellingUI(bool show); virtual bool spellingUIIsShowing(); virtual void getGuessesForWord(const String&, Vector<String>& guesses); virtual void setInputMethodState(bool enabled); bool isEditing() const; private: Page* m_page; bool m_editing; bool m_inUndoRedo; // our undo stack works differently - don't re-enter! }; } // namespace WebCore #endif // EditorClientHaiku_h ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/haiku/ChangeLog������������������������������������������������������������������������������0000644�0001750�0001750�00000002254�11254742231�013216� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������2009-09-17 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Simon Hausmann. Make PlatformWindow return something else than PlatformWidget https://bugs.webkit.org/show_bug.cgi?id=29085 Reflect the rename of platformWindow and it's return type. * WebCoreSupport/ChromeClientHaiku.cpp: (WebCore::ChromeClientHaiku::platformPageClient): * WebCoreSupport/ChromeClientHaiku.h: 2009-08-28 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> Reviewed by Holger Freyther. https://bugs.webkit.org/show_bug.cgi?id=25889 [GTK] scrollbar policy for main frame is not implementable Add empty implementation for new ChromeClient method. * WebCoreSupport/ChromeClientHaiku.h: (ChromeClientHaiku::scrollbarsModeDidChange): 2009-07-29 Kevin McCullough <kmccullough@apple.com> Reviewed by Darin Adler. Added foundation work to allow a testing infrastructure for the Web Inspector. * WebCoreSupport/InspectorClientHaiku.cpp: (WebCore::InspectorClientHaiku::inspectorWindowObjectCleared): * WebCoreSupport/InspectorClientHaiku.h: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/chromium/������������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024257�012167� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/chromium/features.gypi�����������������������������������������������������������������������0000644�0001750�0001750�00000005403�11262257550�014701� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # Copyright (C) 2009 Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * 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. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "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 THE COPYRIGHT # OWNER 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. # { # The following defines turn webkit features on and off. 'variables': { 'variables': { # We have to nest variables inside variables as a hack for variables # override. # WARNING: build/features_override.gypi which is included in a full # chromium build, overrides this list with its own values. See # features_override.gypi inline documentation for more details. 'feature_defines%': [ 'ENABLE_3D_CANVAS=0', 'ENABLE_CHANNEL_MESSAGING=1', 'ENABLE_DATABASE=1', 'ENABLE_DATAGRID=0', 'ENABLE_OFFLINE_WEB_APPLICATIONS=1', 'ENABLE_DASHBOARD_SUPPORT=0', 'ENABLE_DOM_STORAGE=1', 'ENABLE_JAVASCRIPT_DEBUGGER=0', 'ENABLE_JSC_MULTIPLE_THREADS=0', 'ENABLE_ICONDATABASE=0', 'ENABLE_NOTIFICATIONS=0', 'ENABLE_ORIENTATION_EVENTS=0', 'ENABLE_XSLT=1', 'ENABLE_XPATH=1', 'ENABLE_SHARED_WORKERS=0', 'ENABLE_SVG=1', 'ENABLE_SVG_ANIMATION=1', 'ENABLE_SVG_AS_IMAGE=1', 'ENABLE_SVG_USE=1', 'ENABLE_SVG_FOREIGN_OBJECT=1', 'ENABLE_SVG_FONTS=1', 'ENABLE_VIDEO=1', 'ENABLE_WEB_SOCKETS=1', 'ENABLE_WORKERS=1', ], }, 'feature_defines%': '<(feature_defines)', }, } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/chromium/webkit.gyp��������������������������������������������������������������������������0000644�0001750�0001750�00000003520�11260216374�014172� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # Copyright (C) 2009 Google 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: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * 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. # * Neither the name of Google Inc. nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "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 THE COPYRIGHT # OWNER 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. # { 'targets': [ { # This target only builds webcore right now, but it will also build # the chromium webkit api once the api is upstreamed. 'target_name': 'webkit', 'type': 'none', 'dependencies': [ '../../WebCore/WebCore.gyp/WebCore.gyp:webcore', ], }, ], # targets } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/chromium/gyp_webkit��������������������������������������������������������������������������0000644�0001750�0001750�00000006606�11261444543�014265� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # Copyright (C) 2009 Google 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: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * 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. # * Neither the name of Google Inc. nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "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 THE COPYRIGHT # OWNER 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. # # This file is used by gclient execute gyp with the proper command # line arguments. import glob import os import shlex import sys script_dir = os.path.dirname(__file__) sys.path.append(os.path.join(script_dir, 'tools', 'gyp', 'pylib')) import gyp def additional_include_files(args=[]): """ Returns a list of additional (.gypi) files to include, without duplicating ones that are already specified on the command line. """ # Determine the include files specified on the command line. # This doesn't cover all the different option formats you can use, # but it's mainly intended to avoid duplicating flags on the automatic # makefile regeneration which only uses this format. specified_includes = set() for arg in args: if arg.startswith('-I') and len(arg) > 2: specified_includes.add(os.path.realpath(arg[2:])) result = [] def AddInclude(path): if os.path.realpath(path) not in specified_includes: result.append(path) # Always include common.gypi AddInclude(os.path.join(script_dir, 'build', 'common.gypi')) # Optionally add supplemental .gypi files if present. supplements = glob.glob(os.path.join(script_dir, '*', 'supplement.gypi')) for supplement in supplements: AddInclude(supplement) return result if __name__ == '__main__': args = sys.argv[1:] # Add includes. args.extend(['-I' + i for i in additional_include_files(args)]) # Other command args: args.extend([ # gyp variable defines. '-Dinside_chromium_build=0', '-Dv8_use_snapshot=false', '-Dmsvs_use_common_release=0', # gyp hack: otherwise gyp assumes its in chromium's src/ dir. '--depth=./', # gyp file to execute. 'webkit.gyp']) print 'Updating webkit projects from gyp files...' sys.stdout.flush() # Off we go... sys.exit(gyp.main(args)) ��������������������������������������������������������������������������������������������������������������������������WebKit/chromium/DEPS��������������������������������������������������������������������������������0000644�0001750�0001750�00000012466�11261444543�012655� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # Copyright (C) 2009 Google 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: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * 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. # * Neither the name of Google Inc. nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "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 THE COPYRIGHT # OWNER 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. # # This file is used by gclient to fetch the projects that the webkit # chromium port depends on. vars = { 'chromium_svn': 'http://src.chromium.org/svn/trunk/src', 'chromium_deps_svn': 'http://src.chromium.org/svn/trunk/deps/third_party', # Dependencies' revisions to use: 'chromium_rev': '27692', 'google-url_rev': '119', 'gyp_rev': '671', 'icu_rev': '27687', 'openvcdiff_rev': '26', 'skia_rev': '341', 'v8_rev': '2966', # Windows: 'cygwin_rev': '11984', 'ffmpeg_ia32_rev': '26428', 'pthreads-win32_rev': '26716', 'python_24_rev': '22967', } deps = { # build tools 'build': Var('chromium_svn')+'/build@'+Var('chromium_rev'), 'webkit/build': Var('chromium_svn')+'/webkit/build@'+Var('chromium_rev'), 'tools/gyp': 'http://gyp.googlecode.com/svn/trunk@'+Var('gyp_rev'), # Basic tools 'base': Var('chromium_svn')+'/base@'+Var('chromium_rev'), # skia dependencies 'skia': Var('chromium_svn')+'/skia@'+Var('chromium_rev'), 'third_party/skia': 'http://skia.googlecode.com/svn/trunk@'+Var('skia_rev'), # testing 'testing': Var('chromium_svn')+'/testing@'+Var('chromium_rev'), # v8 javascript engine 'v8': 'http://v8.googlecode.com/svn/trunk@'+Var('v8_rev'), # net dependencies 'net': Var('chromium_svn')+'/net@'+Var('chromium_rev'), 'sdch': Var('chromium_svn')+'/sdch@'+Var('chromium_rev'), 'sdch/open-vcdiff': 'http://open-vcdiff.googlecode.com/svn/trunk@'+Var('openvcdiff_rev'), 'googleurl': 'http://google-url.googlecode.com/svn/trunk@'+Var('google-url_rev'), # other third party 'third_party/icu': Var('chromium_deps_svn')+'/icu42@'+Var('icu_rev'), 'third_party/bzip2': Var('chromium_svn')+'/third_party/bzip2@'+Var('chromium_rev'), 'third_party/libevent': Var('chromium_svn')+'/third_party/libevent@'+Var('chromium_rev'), 'third_party/libjpeg': Var('chromium_svn')+'/third_party/libjpeg@'+Var('chromium_rev'), 'third_party/libpng': Var('chromium_svn')+'/third_party/libpng@'+Var('chromium_rev'), 'third_party/libxml': Var('chromium_svn')+'/third_party/libxml@'+Var('chromium_rev'), 'third_party/libxslt': Var('chromium_svn')+'/third_party/libxslt@'+Var('chromium_rev'), 'third_party/modp_b64': Var('chromium_svn')+'/third_party/modp_b64@'+Var('chromium_rev'), 'third_party/npapi': Var('chromium_svn')+'/third_party/npapi@'+Var('chromium_rev'), 'third_party/sqlite': Var('chromium_svn')+'/third_party/sqlite@'+Var('chromium_rev'), 'third_party/zlib': Var('chromium_svn')+'/third_party/zlib@'+Var('chromium_rev'), } deps_os = { 'win': { 'third_party/cygwin': Var('chromium_deps_svn')+'/cygwin@'+Var('cygwin_rev'), 'third_party/python_24': Var('chromium_deps_svn')+'/python_24'+Var('python_24_rev'), 'third_party/ffmpeg/binaries/chromium/win/ia32': Var('chromium_deps_svn')+'/ffmpeg/binaries/win@'+Var('ffmpeg_ia32_rev'), 'third_party/pthreads-win32': Var('chromium_deps_svn')+'/pthreads-win32@'+Var('pthreads-win32_rev'), }, } skip_child_includes = [ # Don't look for dependencies in the following folders: 'base', 'build', 'googleurl', 'net', 'sdch', 'skia', 'testing', 'third_party', 'tools', 'v8', 'webkit', ] include_rules = [ # Everybody can use some things. '+base', '+build', '+ipc', # For now, we allow ICU to be included by specifying 'unicode/...', although # this should probably change. '+unicode', '+testing', # Allow anybody to include files from the 'public' Skia directory in the # webkit port. This is shared between the webkit port and Chromium. '+webkit/port/platform/graphics/skia/public', ] hooks = [ { # A change to any file in this directory should run the gyp generator. 'pattern': '.', 'action': ['python', 'gyp_webkit'], }, ] ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/qt/������������������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024262�010764� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/qt/QGVLauncher/������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024257�013107� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/qt/QGVLauncher/main.cpp����������������������������������������������������������������������0000644�0001750�0001750�00000022003�11261145255�014531� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) * Copyright (C) 2006 George Staikos <staikos@kde.org> * Copyright (C) 2006 Dirk Mueller <mueller@kde.org> * Copyright (C) 2006 Zack Rusin <zack@kde.org> * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org> * Copyright (C) 2009 Kenneth Christiansen <kenneth@webkit.org> * Copyright (C) 2009 Antonio Gomes <antonio.gomes@openbossa.org> * * 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. */ #include <QDebug> #include <QFile> #include <QGraphicsScene> #include <QGraphicsView> #include <QGraphicsWidget> #include <QNetworkRequest> #include <QTextStream> #include <QVector> #include <QtGui> #include <QtNetwork/QNetworkProxy> #include <cstdio> #include <qwebelement.h> #include <qwebframe.h> #include <qgraphicswebview.h> #include <qwebpage.h> #include <qwebsettings.h> #include <qwebview.h> class WebPage : public QWebPage { Q_OBJECT public: WebPage(QWidget* parent = 0) : QWebPage(parent) { applyProxy(); } virtual QWebPage* createWindow(QWebPage::WebWindowType); private: void applyProxy(); }; class MainView : public QGraphicsView { Q_OBJECT public: MainView(QWidget* parent) : QGraphicsView(parent), m_mainWidget(0) { setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); } void setMainWidget(QGraphicsWidget* widget) { QRectF rect(QRect(QPoint(0, 0), size())); widget->setGeometry(rect); m_mainWidget = widget; } void resizeEvent(QResizeEvent* event) { QGraphicsView::resizeEvent(event); if (!m_mainWidget) return; QRectF rect(QPoint(0, 0), event->size()); m_mainWidget->setGeometry(rect); } public slots: void flip() { #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) QSizeF center = m_mainWidget->boundingRect().size() / 2; QPointF centerPoint = QPointF(center.width(), center.height()); m_mainWidget->setTransformOriginPoint(centerPoint); m_mainWidget->setRotation(m_mainWidget->rotation() ? 0 : 180); #endif } private: QGraphicsWidget* m_mainWidget; }; class SharedScene : public QSharedData { public: SharedScene() { m_scene = new QGraphicsScene; m_item = new QGraphicsWebView; m_item->setPage(new WebPage()); m_scene->addItem(m_item); m_scene->setActiveWindow(m_item); } ~SharedScene() { delete m_item; delete m_scene; } QGraphicsScene* scene() const { return m_scene; } QGraphicsWebView* webView() const { return m_item; } private: QGraphicsScene* m_scene; QGraphicsWebView* m_item; }; class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QExplicitlySharedDataPointer<SharedScene> other) : QMainWindow(), view(new MainView(this)), scene(other) { init(); } MainWindow() : QMainWindow(), view(new MainView(this)), scene(new SharedScene()) { init(); } void init() { setAttribute(Qt::WA_DeleteOnClose); view->setScene(scene->scene()); view->setFrameShape(QFrame::NoFrame); view->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setCentralWidget(view); view->setMainWidget(scene->webView()); connect(scene->webView(), SIGNAL(loadFinished()), this, SLOT(loadFinished())); connect(scene->webView(), SIGNAL(titleChanged(const QString&)), this, SLOT(setWindowTitle(const QString&))); connect(scene->webView()->page(), SIGNAL(windowCloseRequested()), this, SLOT(close())); resize(640, 480); buildUI(); } void load(const QString& url) { QUrl deducedUrl = guessUrlFromString(url); if (!deducedUrl.isValid()) deducedUrl = QUrl("http://" + url + "/"); urlEdit->setText(deducedUrl.toEncoded()); scene->webView()->load(deducedUrl); scene->webView()->setFocus(Qt::OtherFocusReason); } QUrl guessUrlFromString(const QString& string) { QString input(string); QFileInfo fi(input); if (fi.exists() && fi.isRelative()) input = fi.absoluteFilePath(); return QWebView::guessUrlFromString(input); } QWebPage* page() const { return scene->webView()->page(); } protected slots: void changeLocation() { load(urlEdit->text()); } void loadFinished() { QUrl url = scene->webView()->url(); urlEdit->setText(url.toString()); QUrl::FormattingOptions opts; opts |= QUrl::RemoveScheme; opts |= QUrl::RemoveUserInfo; opts |= QUrl::StripTrailingSlash; QString s = url.toString(opts); s = s.mid(2); if (s.isEmpty()) return; //FIXME: something missing here } public slots: void newWindow(const QString &url = QString()) { MainWindow* mw = new MainWindow(); mw->load(url); mw->show(); } void clone() { MainWindow* mw = new MainWindow(scene); mw->show(); } void flip() { view->flip(); } private: void buildUI() { QWebPage* page = scene->webView()->page(); urlEdit = new QLineEdit(this); urlEdit->setSizePolicy(QSizePolicy::Expanding, urlEdit->sizePolicy().verticalPolicy()); connect(urlEdit, SIGNAL(returnPressed()), SLOT(changeLocation())); QToolBar* bar = addToolBar("Navigation"); bar->addAction(page->action(QWebPage::Back)); bar->addAction(page->action(QWebPage::Forward)); bar->addAction(page->action(QWebPage::Reload)); bar->addAction(page->action(QWebPage::Stop)); bar->addWidget(urlEdit); QMenu* fileMenu = menuBar()->addMenu("&File"); fileMenu->addAction("New Window", this, SLOT(newWindow())); fileMenu->addAction("Clone view", this, SLOT(clone())); fileMenu->addAction("Close", this, SLOT(close())); QMenu* viewMenu = menuBar()->addMenu("&View"); viewMenu->addAction(page->action(QWebPage::Stop)); viewMenu->addAction(page->action(QWebPage::Reload)); QMenu* fxMenu = menuBar()->addMenu("&Effects"); fxMenu->addAction("Flip", this, SLOT(flip())); } private: MainView* view; QExplicitlySharedDataPointer<SharedScene> scene; QLineEdit* urlEdit; }; QWebPage* WebPage::createWindow(QWebPage::WebWindowType) { MainWindow* mw = new MainWindow; mw->show(); return mw->page(); } void WebPage::applyProxy() { QUrl proxyUrl = QWebView::guessUrlFromString(qgetenv("http_proxy")); if (proxyUrl.isValid() && !proxyUrl.host().isEmpty()) { int proxyPort = (proxyUrl.port() > 0) ? proxyUrl.port() : 8080; networkAccessManager()->setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, proxyUrl.host(), proxyPort)); } } int main(int argc, char** argv) { QApplication app(argc, argv); QString url = QString("file://%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html")); app.setApplicationName("GQVLauncher"); QWebSettings::setObjectCacheCapacities((16 * 1024 * 1024) / 8, (16 * 1024 * 1024) / 8, 16 * 1024 * 1024); QWebSettings::setMaximumPagesInCache(4); QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true); QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalStorageEnabled, true); const QStringList args = app.arguments(); if (args.count() > 1) url = args.at(1); MainWindow* window = new MainWindow; window->load(url); for (int i = 2; i < args.count(); i++) window->newWindow(args.at(i)); window->show(); return app.exec(); } #include "main.moc" �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/qt/QGVLauncher/QGVLauncher.pro���������������������������������������������������������������0000644�0001750�0001750�00000000360�11254771106�015746� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������TEMPLATE = app SOURCES += main.cpp CONFIG -= app_bundle CONFIG += uitools DESTDIR = ../../../bin include(../../../WebKit.pri) QT += network macx:QT+=xml QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR symbian:TARGET.UID3 = 0xA000E544 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/qt/Plugins/����������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024257�012411� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/qt/Plugins/ICOHandler.cpp��������������������������������������������������������������������0000644�0001750�0001750�00000034450�11212240625�015021� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * kimgio import filter for MS Windows .ico files * * Distributed under the terms of the LGPL * Copyright (c) 2000 Malte Starostik <malte@kde.org> * */ #include "config.h" #include "ICOHandler.h" #include <cstring> #include <cstdlib> #include <algorithm> #include <vector> #include <QtGui/QImage> #include <QtGui/QBitmap> #include <QtGui/QApplication> #include <QtCore/QVector> #include <QtGui/QDesktopWidget> namespace { // Global header (see http://www.daubnet.com/formats/ICO.html) struct IcoHeader { enum Type { Icon = 1, Cursor }; quint16 reserved; quint16 type; quint16 count; }; inline QDataStream& operator >>( QDataStream& s, IcoHeader& h ) { return s >> h.reserved >> h.type >> h.count; } // Based on qt_read_dib et al. from qimage.cpp // (c) 1992-2002 Nokia Corporation and/or its subsidiary(-ies). struct BMP_INFOHDR { static const quint32 Size = 40; quint32 biSize; // size of this struct quint32 biWidth; // pixmap width quint32 biHeight; // pixmap height quint16 biPlanes; // should be 1 quint16 biBitCount; // number of bits per pixel enum Compression { RGB = 0 }; quint32 biCompression; // compression method quint32 biSizeImage; // size of image quint32 biXPelsPerMeter; // horizontal resolution quint32 biYPelsPerMeter; // vertical resolution quint32 biClrUsed; // number of colors used quint32 biClrImportant; // number of important colors }; const quint32 BMP_INFOHDR::Size; QDataStream& operator >>( QDataStream &s, BMP_INFOHDR &bi ) { s >> bi.biSize; if ( bi.biSize == BMP_INFOHDR::Size ) { s >> bi.biWidth >> bi.biHeight >> bi.biPlanes >> bi.biBitCount; s >> bi.biCompression >> bi.biSizeImage; s >> bi.biXPelsPerMeter >> bi.biYPelsPerMeter; s >> bi.biClrUsed >> bi.biClrImportant; } return s; } #if 0 QDataStream &operator<<( QDataStream &s, const BMP_INFOHDR &bi ) { s << bi.biSize; s << bi.biWidth << bi.biHeight; s << bi.biPlanes; s << bi.biBitCount; s << bi.biCompression; s << bi.biSizeImage; s << bi.biXPelsPerMeter << bi.biYPelsPerMeter; s << bi.biClrUsed << bi.biClrImportant; return s; } #endif // Header for every icon in the file struct IconRec { unsigned char width; unsigned char height; quint16 colors; quint16 hotspotX; quint16 hotspotY; quint32 size; quint32 offset; }; inline QDataStream& operator >>( QDataStream& s, IconRec& r ) { return s >> r.width >> r.height >> r.colors >> r.hotspotX >> r.hotspotY >> r.size >> r.offset; } struct LessDifference { LessDifference( unsigned s, unsigned c ) : size( s ), colors( c ) {} bool operator ()( const IconRec& lhs, const IconRec& rhs ) const { // closest size match precedes everything else if ( std::abs( int( lhs.width - size ) ) < std::abs( int( rhs.width - size ) ) ) return true; else if ( std::abs( int( lhs.width - size ) ) > std::abs( int( rhs.width - size ) ) ) return false; else if ( colors == 0 ) { // high/true color requested if ( lhs.colors == 0 ) return true; else if ( rhs.colors == 0 ) return false; else return lhs.colors > rhs.colors; } else { // indexed icon requested if ( lhs.colors == 0 && rhs.colors == 0 ) return false; else if ( lhs.colors == 0 ) return false; else return std::abs( int( lhs.colors - colors ) ) < std::abs( int( rhs.colors - colors ) ); } } unsigned size; unsigned colors; }; bool loadFromDIB( QDataStream& stream, const IconRec& rec, QImage& icon ) { BMP_INFOHDR header; stream >> header; if ( stream.atEnd() || header.biSize != BMP_INFOHDR::Size || header.biSize > rec.size || header.biCompression != BMP_INFOHDR::RGB || ( header.biBitCount != 1 && header.biBitCount != 4 && header.biBitCount != 8 && header.biBitCount != 24 && header.biBitCount != 32 ) ) return false; unsigned paletteSize, paletteEntries; if (header.biBitCount > 8) { paletteEntries = 0; paletteSize = 0; } else { paletteSize = (1 << header.biBitCount); paletteEntries = paletteSize; if (header.biClrUsed && header.biClrUsed < paletteSize) paletteEntries = header.biClrUsed; } // Always create a 32-bit image to get the mask right // Note: this is safe as rec.width, rec.height are bytes icon = QImage( rec.width, rec.height, QImage::Format_ARGB32 ); if ( icon.isNull() ) return false; QVector< QRgb > colorTable( paletteSize ); colorTable.fill( QRgb( 0 ) ); for ( unsigned i = 0; i < paletteEntries; ++i ) { unsigned char rgb[ 4 ]; stream.readRawData( reinterpret_cast< char* >( &rgb ), sizeof( rgb ) ); colorTable[ i ] = qRgb( rgb[ 2 ], rgb[ 1 ], rgb[ 0 ] ); } unsigned bpl = ( rec.width * header.biBitCount + 31 ) / 32 * 4; unsigned char* buf = new unsigned char[ bpl ]; for ( unsigned y = rec.height; !stream.atEnd() && y--; ) { stream.readRawData( reinterpret_cast< char* >( buf ), bpl ); unsigned char* pixel = buf; QRgb* p = reinterpret_cast< QRgb* >( icon.scanLine( y ) ); switch ( header.biBitCount ) { case 1: for ( unsigned x = 0; x < rec.width; ++x ) *p++ = colorTable[ ( pixel[ x / 8 ] >> ( 7 - ( x & 0x07 ) ) ) & 1 ]; break; case 4: for ( unsigned x = 0; x < rec.width; ++x ) if ( x & 1 ) *p++ = colorTable[ pixel[ x / 2 ] & 0x0f ]; else *p++ = colorTable[ pixel[ x / 2 ] >> 4 ]; break; case 8: for ( unsigned x = 0; x < rec.width; ++x ) *p++ = colorTable[ pixel[ x ] ]; break; case 24: for ( unsigned x = 0; x < rec.width; ++x ) *p++ = qRgb( pixel[ 3 * x + 2 ], pixel[ 3 * x + 1 ], pixel[ 3 * x ] ); break; case 32: for ( unsigned x = 0; x < rec.width; ++x ) *p++ = qRgba( pixel[ 4 * x + 2 ], pixel[ 4 * x + 1 ], pixel[ 4 * x ], pixel[ 4 * x + 3] ); break; } } delete[] buf; if ( header.biBitCount < 32 ) { // Traditional 1-bit mask bpl = ( rec.width + 31 ) / 32 * 4; buf = new unsigned char[ bpl ]; for ( unsigned y = rec.height; y--; ) { stream.readRawData( reinterpret_cast< char* >( buf ), bpl ); QRgb* p = reinterpret_cast< QRgb* >( icon.scanLine( y ) ); for ( unsigned x = 0; x < rec.width; ++x, ++p ) if ( ( ( buf[ x / 8 ] >> ( 7 - ( x & 0x07 ) ) ) & 1 ) ) *p &= RGB_MASK; } delete[] buf; } return true; } } ICOHandler::ICOHandler() { } bool ICOHandler::canRead() const { return canRead(device()); } bool ICOHandler::read(QImage *outImage) { qint64 offset = device()->pos(); QDataStream stream( device() ); stream.setByteOrder( QDataStream::LittleEndian ); IcoHeader header; stream >> header; if ( stream.atEnd() || !header.count || ( header.type != IcoHeader::Icon && header.type != IcoHeader::Cursor) ) return false; unsigned requestedSize = 32; unsigned requestedColors = QApplication::desktop()->depth() > 8 ? 0 : QApplication::desktop()->depth(); int requestedIndex = -1; #if 0 if ( io->parameters() ) { QStringList params = QString(io->parameters()).split( ';', QString::SkipEmptyParts ); QMap< QString, QString > options; for ( QStringList::ConstIterator it = params.begin(); it != params.end(); ++it ) { QStringList tmp = (*it).split( '=', QString::SkipEmptyParts ); if ( tmp.count() == 2 ) options[ tmp[ 0 ] ] = tmp[ 1 ]; } if ( options[ "index" ].toUInt() ) requestedIndex = options[ "index" ].toUInt(); if ( options[ "size" ].toUInt() ) requestedSize = options[ "size" ].toUInt(); if ( options[ "colors" ].toUInt() ) requestedColors = options[ "colors" ].toUInt(); } #endif typedef std::vector< IconRec > IconList; IconList icons; for ( unsigned i = 0; i < header.count; ++i ) { if ( stream.atEnd() ) return false; IconRec rec; stream >> rec; icons.push_back( rec ); } IconList::const_iterator selected; if (requestedIndex >= 0) { selected = std::min( icons.begin() + requestedIndex, icons.end() ); } else { selected = std::min_element( icons.begin(), icons.end(), LessDifference( requestedSize, requestedColors ) ); } if ( stream.atEnd() || selected == icons.end() || offset + selected->offset > device()->size() ) return false; device()->seek( offset + selected->offset ); QImage icon; if ( loadFromDIB( stream, *selected, icon ) ) { #ifndef QT_NO_IMAGE_TEXT icon.setText( "X-Index", 0, QString::number( selected - icons.begin() ) ); if ( header.type == IcoHeader::Cursor ) { icon.setText( "X-HotspotX", 0, QString::number( selected->hotspotX ) ); icon.setText( "X-HotspotY", 0, QString::number( selected->hotspotY ) ); } #endif *outImage = icon; return true; } return false; } bool ICOHandler::write(const QImage &/*image*/) { #if 0 if (image.isNull()) return; QByteArray dibData; QDataStream dib(dibData, QIODevice::ReadWrite); dib.setByteOrder(QDataStream::LittleEndian); QImage pixels = image; QImage mask; if (io->image().hasAlphaBuffer()) mask = image.createAlphaMask(); else mask = image.createHeuristicMask(); mask.invertPixels(); for ( int y = 0; y < pixels.height(); ++y ) for ( int x = 0; x < pixels.width(); ++x ) if ( mask.pixel( x, y ) == 0 ) pixels.setPixel( x, y, 0 ); if (!qt_write_dib(dib, pixels)) return; uint hdrPos = dib.device()->at(); if (!qt_write_dib(dib, mask)) return; memmove(dibData.data() + hdrPos, dibData.data() + hdrPos + BMP_WIN + 8, dibData.size() - hdrPos - BMP_WIN - 8); dibData.resize(dibData.size() - BMP_WIN - 8); QDataStream ico(device()); ico.setByteOrder(QDataStream::LittleEndian); IcoHeader hdr; hdr.reserved = 0; hdr.type = Icon; hdr.count = 1; ico << hdr.reserved << hdr.type << hdr.count; IconRec rec; rec.width = image.width(); rec.height = image.height(); if (image.numColors() <= 16) rec.colors = 16; else if (image.depth() <= 8) rec.colors = 256; else rec.colors = 0; rec.hotspotX = 0; rec.hotspotY = 0; rec.dibSize = dibData.size(); ico << rec.width << rec.height << rec.colors << rec.hotspotX << rec.hotspotY << rec.dibSize; rec.dibOffset = ico.device()->at() + sizeof(rec.dibOffset); ico << rec.dibOffset; BMP_INFOHDR dibHeader; dib.device()->at(0); dib >> dibHeader; dibHeader.biHeight = image.height() << 1; dib.device()->at(0); dib << dibHeader; ico.writeRawBytes(dibData.data(), dibData.size()); return true; #endif return false; } QByteArray ICOHandler::name() const { return "ico"; } bool ICOHandler::canRead(QIODevice *device) { if (!device) { qWarning("ICOHandler::canRead() called with no device"); return false; } const qint64 oldPos = device->pos(); char head[8]; qint64 readBytes = device->read(head, sizeof(head)); const bool readOk = readBytes == sizeof(head); if (device->isSequential()) { while (readBytes > 0) device->ungetChar(head[readBytes-- - 1]); } else { device->seek(oldPos); } if ( !readOk ) return false; return head[2] == '\001' && head[3] == '\000' && // type should be 1 ( head[6] == 16 || head[6] == 32 || head[6] == 64 ) && // width can only be one of those ( head[7] == 16 || head[7] == 32 || head[7] == 64 ); // same for height } class ICOPlugin : public QImageIOPlugin { public: QStringList keys() const; Capabilities capabilities(QIODevice *device, const QByteArray &format) const; QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const; }; QStringList ICOPlugin::keys() const { return QStringList() << "ico" << "ICO"; } QImageIOPlugin::Capabilities ICOPlugin::capabilities(QIODevice *device, const QByteArray &format) const { if (format == "ico" || format == "ICO") return Capabilities(CanRead); if (!format.isEmpty()) return 0; if (!device->isOpen()) return 0; Capabilities cap; if (device->isReadable() && ICOHandler::canRead(device)) cap |= CanRead; return cap; } QImageIOHandler *ICOPlugin::create(QIODevice *device, const QByteArray &format) const { QImageIOHandler *handler = new ICOHandler; handler->setDevice(device); handler->setFormat(format); return handler; } Q_EXPORT_STATIC_PLUGIN(ICOPlugin) Q_EXPORT_PLUGIN2(qtwebico, ICOPlugin) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/qt/Plugins/Plugins.pro�����������������������������������������������������������������������0000644�0001750�0001750�00000000516�10720576350�014556� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������TEMPLATE = lib TARGET = qtwebico CONFIG += plugin HEADERS += ICOHandler.h SOURCES += ICOHandler.cpp include(../../WebKit.pri) contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions target.path = $$[QT_INSTALL_PLUGINS]/imageformats INSTALLS += target ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/qt/Plugins/ICOHandler.h����������������������������������������������������������������������0000644�0001750�0001750�00000003257�10744307516�014503� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * ico.h - kimgio import filter for MS Windows .ico files * * Distributed under the terms of the LGPL * Copyright (c) 2000 Malte Starostik <malte@kde.org> * */ // You can use QImageIO::setParameters() to request a specific // Icon out of an .ico file: // // Options consist of a name=value pair and are separated by a semicolon. // Available options are: // size=<size> select the icon that most closely matches <size> (pixels) // default: 32 // colors=<num> select the icon that has <num> colors (or comes closest) // default: 1 << display depth or 0 (RGB) if display depth > 8 // index=<index> select the indexth icon from the file. If this option // is present, the size and colors options will be ignored. // default: none // If both size and colors are given, size takes precedence. // // The old format is still supported: // the parameters consist of a single string in the form // "<size>[:<colors>]" which correspond to the options above // // If an icon was returned (i.e. the file is valid and the index option // if present was not out of range), the icon's index within the .ico // file is returned in the text tag "X-Index" of the image. // If the icon is in fact a cursor, its hotspot coordinates are returned // in the text tags "X-HotspotX" and "X-HotspotY". #ifndef _ICOHANDLER_H_ #define _ICOHANDLER_H_ #include <QtGui/QImageIOPlugin> class ICOHandler : public QImageIOHandler { public: ICOHandler(); bool canRead() const; bool read(QImage *image); bool write(const QImage &image); QByteArray name() const; static bool canRead(QIODevice *device); }; #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/qt/tests/������������������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024257�012132� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/qt/tests/qwebhistory/������������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024257�014512� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/qt/tests/qwebhistory/data/�������������������������������������������������������������������0000755�0001750�0001750�00000000000�11527024257�015423� 5����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������WebKit/qt/tests/qwebhistory/data/page1.html���������������������������������������������������������0000644�0001750�0001750�00000000060�11221173575�017301� 0����������������������������������������������������������������������������������������������������ustar �lee�����������������������������lee��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<title>page1

page1

WebKit/qt/tests/qwebhistory/data/page2.html0000644000175000017500000000006011221173575017302 0ustar leeleepage2

page2

WebKit/qt/tests/qwebhistory/data/page3.html0000644000175000017500000000006011221173575017303 0ustar leeleepage3

page3

WebKit/qt/tests/qwebhistory/data/page4.html0000644000175000017500000000006011221173575017304 0ustar leeleepage4

page4

WebKit/qt/tests/qwebhistory/data/page5.html0000644000175000017500000000006011221173575017305 0ustar leeleepage5

page5

WebKit/qt/tests/qwebhistory/data/page6.html0000644000175000017500000000006011221173575017306 0ustar leeleepage6

page6

WebKit/qt/tests/qwebhistory/qwebhistory.pro0000644000175000017500000000036511254771106017617 0ustar leeleeTEMPLATE = app TARGET = tst_qwebhistory include(../../../../WebKit.pri) SOURCES += tst_qwebhistory.cpp RESOURCES += tst_qwebhistory.qrc QT += testlib network QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR symbian:TARGET.UID3 = 0xA000E53B WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp0000644000175000017500000002544011256537106020476 0ustar leelee/* Copyright (C) 2008 Holger Hans Peter Freyther 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "qwebpage.h" #include "qwebview.h" #include "qwebframe.h" #include "qwebhistory.h" #include "qdebug.h" class tst_QWebHistory : public QObject { Q_OBJECT public: tst_QWebHistory(); virtual ~tst_QWebHistory(); protected : void loadPage(int nr) { frame->load(QUrl("qrc:/data/page" + QString::number(nr) + ".html")); waitForLoadFinished.exec(); } public slots: void init(); void cleanup(); private slots: void title(); void count(); void back(); void forward(); void itemAt(); void goToItem(); void items(); void serialize_1(); //QWebHistory countity void serialize_2(); //QWebHistory index void serialize_3(); //QWebHistoryItem void saveAndRestore_1(); //simple checks saveState and restoreState void saveAndRestore_2(); //bad parameters saveState and restoreState void saveAndRestore_3(); //try use different version void saveAndRestore_crash_1(); void saveAndRestore_crash_2(); void saveAndRestore_crash_3(); void clear(); private: QWebPage* page; QWebFrame* frame; QWebHistory* hist; QEventLoop waitForLoadFinished; //operation on history are asynchronous! int histsize; }; tst_QWebHistory::tst_QWebHistory() { } tst_QWebHistory::~tst_QWebHistory() { } void tst_QWebHistory::init() { page = new QWebPage(this); frame = page->mainFrame(); connect(page, SIGNAL(loadFinished(bool)), &waitForLoadFinished, SLOT(quit())); for (int i = 1;i < 6;i++) { loadPage(i); } hist = page->history(); histsize = 5; } void tst_QWebHistory::cleanup() { delete page; } /** * Check QWebHistoryItem::title() method */ void tst_QWebHistory::title() { QCOMPARE(hist->currentItem().title(), QString("page5")); } /** * Check QWebHistory::count() method */ void tst_QWebHistory::count() { QCOMPARE(hist->count(), histsize); } /** * Check QWebHistory::back() method */ void tst_QWebHistory::back() { for (int i = histsize;i > 1;i--) { QCOMPARE(page->mainFrame()->toPlainText(), QString("page") + QString::number(i)); hist->back(); waitForLoadFinished.exec(); } //try one more time (too many). crash test hist->back(); } /** * Check QWebHistory::forward() method */ void tst_QWebHistory::forward() { //rewind history :-) while (hist->canGoBack()) { hist->back(); waitForLoadFinished.exec(); } for (int i = 1;i < histsize;i++) { QCOMPARE(page->mainFrame()->toPlainText(), QString("page") + QString::number(i)); hist->forward(); waitForLoadFinished.exec(); } //try one more time (too many). crash test hist->forward(); } /** * Check QWebHistory::itemAt() method */ void tst_QWebHistory::itemAt() { for (int i = 1;i < histsize;i++) { QCOMPARE(hist->itemAt(i - 1).title(), QString("page") + QString::number(i)); QVERIFY(hist->itemAt(i - 1).isValid()); } //check out of range values QVERIFY(!hist->itemAt(-1).isValid()); QVERIFY(!hist->itemAt(histsize).isValid()); } /** * Check QWebHistory::goToItem() method */ void tst_QWebHistory::goToItem() { QWebHistoryItem current = hist->currentItem(); hist->back(); waitForLoadFinished.exec(); hist->back(); waitForLoadFinished.exec(); QVERIFY(hist->currentItem().title() != current.title()); hist->goToItem(current); waitForLoadFinished.exec(); QCOMPARE(hist->currentItem().title(), current.title()); } /** * Check QWebHistory::items() method */ void tst_QWebHistory::items() { QList items = hist->items(); //check count QCOMPARE(histsize, items.count()); //check order for (int i = 1;i <= histsize;i++) { QCOMPARE(items.at(i - 1).title(), QString("page") + QString::number(i)); } } /** * Check history state after serialization (pickle, persistent..) method * Checks history size, history order */ void tst_QWebHistory::serialize_1() { QByteArray tmp; //buffer QDataStream save(&tmp, QIODevice::WriteOnly); //here data will be saved QDataStream load(&tmp, QIODevice::ReadOnly); //from here data will be loaded save << *hist; QVERIFY(save.status() == QDataStream::Ok); QCOMPARE(hist->count(), histsize); //check size of history //load next page to find differences loadPage(6); QCOMPARE(hist->count(), histsize + 1); load >> *hist; QVERIFY(load.status() == QDataStream::Ok); QCOMPARE(hist->count(), histsize); //check order of historyItems QList items = hist->items(); for (int i = 1;i <= histsize;i++) { QCOMPARE(items.at(i - 1).title(), QString("page") + QString::number(i)); } } /** * Check history state after serialization (pickle, persistent..) method * Checks history currentIndex value */ void tst_QWebHistory::serialize_2() { QByteArray tmp; //buffer QDataStream save(&tmp, QIODevice::WriteOnly); //here data will be saved QDataStream load(&tmp, QIODevice::ReadOnly); //from here data will be loaded int oldCurrentIndex = hist->currentItemIndex(); hist->back(); waitForLoadFinished.exec(); hist->back(); waitForLoadFinished.exec(); //check if current index was changed (make sure that it is not last item) QVERIFY(hist->currentItemIndex() != oldCurrentIndex); //save current index oldCurrentIndex = hist->currentItemIndex(); save << *hist; QVERIFY(save.status() == QDataStream::Ok); load >> *hist; QVERIFY(load.status() == QDataStream::Ok); //check current index QCOMPARE(hist->currentItemIndex(), oldCurrentIndex); } /** * Check history state after serialization (pickle, persistent..) method * Checks QWebHistoryItem public property after serialization */ void tst_QWebHistory::serialize_3() { QByteArray tmp; //buffer QDataStream save(&tmp, QIODevice::WriteOnly); //here data will be saved QDataStream load(&tmp, QIODevice::ReadOnly); //from here data will be loaded //prepare two different history items QWebHistoryItem a = hist->currentItem(); a.setUserData("A - user data"); //check properties BEFORE serialization QString title(a.title()); QDateTime lastVisited(a.lastVisited()); QUrl originalUrl(a.originalUrl()); QUrl url(a.url()); QVariant userData(a.userData()); save << *hist; QVERIFY(save.status() == QDataStream::Ok); QVERIFY(!load.atEnd()); hist->clear(); QVERIFY(hist->count() == 1); load >> *hist; QVERIFY(load.status() == QDataStream::Ok); QWebHistoryItem b = hist->currentItem(); //check properties AFTER serialization QCOMPARE(b.title(), title); QCOMPARE(b.lastVisited(), lastVisited); QCOMPARE(b.originalUrl(), originalUrl); QCOMPARE(b.url(), url); QCOMPARE(b.userData(), userData); //Check if all data was read QVERIFY(load.atEnd()); } /** Simple checks should be a bit redundant to streaming operators */ void tst_QWebHistory::saveAndRestore_1() { QAction* actionBack = page->action(QWebPage::Back); hist->back(); waitForLoadFinished.exec(); QVERIFY(actionBack->isEnabled()); QByteArray buffer(hist->saveState()); hist->clear(); QVERIFY(!actionBack->isEnabled()); QVERIFY(hist->count() == 1); hist->restoreState(buffer); //check only few values, do not make full test //because most of the code is shared with streaming operators //and these are checked before QCOMPARE(hist->count(), histsize); QCOMPARE(hist->currentItemIndex(), histsize - 2); QCOMPARE(hist->itemAt(0).title(), QString("page1")); QCOMPARE(hist->itemAt(histsize - 1).title(), QString("page") + QString::number(histsize)); QVERIFY(actionBack->isEnabled()); } /** Check returns value if there are bad parameters. Actually, result * is no so importent. The test shouldn't crash :-) */ void tst_QWebHistory::saveAndRestore_2() { QByteArray buffer; hist->restoreState(buffer); QVERIFY(hist->count() == 1); QVERIFY(hist->itemAt(0).isValid()); } /** Try to use bad version value */ void tst_QWebHistory::saveAndRestore_3() { QByteArray tmp = hist->saveState((QWebHistory::HistoryStateVersion)29999); QVERIFY(hist->saveState((QWebHistory::HistoryStateVersion)29999).isEmpty()); QVERIFY(hist->count() == histsize); QVERIFY(hist->itemAt(3).isValid()); } /** The test shouldn't crash */ void tst_QWebHistory::saveAndRestore_crash_1() { QByteArray tmp = hist->saveState(); for (unsigned i = 0; i < 5; i++){ hist->restoreState(tmp); hist->saveState(); } } /** The test shouldn't crash */ void tst_QWebHistory::saveAndRestore_crash_2() { QByteArray tmp = hist->saveState(); QWebPage* page2 = new QWebPage(this); QWebHistory* hist2 = page2->history(); for (unsigned i = 0; i < 5; i++){ hist2->restoreState(tmp); hist2->saveState(); } delete page2; } /** The test shouldn't crash */ void tst_QWebHistory::saveAndRestore_crash_3() { QByteArray tmp = hist->saveState(); QWebPage* page2 = new QWebPage(this); QWebHistory* hist1 = hist; QWebHistory* hist2 = page2->history(); for (unsigned i = 0; i < 5; i++){ hist1->restoreState(tmp); hist2->restoreState(tmp); QVERIFY(hist1->count() == hist2->count()); QVERIFY(hist1->count() == histsize); hist2->back(); tmp = hist2->saveState(); hist2->clear(); } delete page2; } /** ::clear */ void tst_QWebHistory::clear() { QAction* actionBack = page->action(QWebPage::Back); QVERIFY(actionBack->isEnabled()); hist->saveState(); QVERIFY(hist->count() > 1); hist->clear(); QVERIFY(hist->count() == 1); // Leave current item. QVERIFY(!actionBack->isEnabled()); QWebPage* page2 = new QWebPage(this); QWebHistory* hist2 = page2->history(); QVERIFY(hist2->count() == 0); hist2->clear(); QVERIFY(hist2->count() == 0); // Do not change anything. delete page2; } QTEST_MAIN(tst_QWebHistory) #include "tst_qwebhistory.moc" WebKit/qt/tests/qwebhistory/tst_qwebhistory.qrc0000644000175000017500000000041511221173575020472 0ustar leelee data/page1.html data/page2.html data/page3.html data/page4.html data/page5.html data/page6.html WebKit/qt/tests/qwebhistoryinterface/0000755000175000017500000000000011527024257016373 5ustar leeleeWebKit/qt/tests/qwebhistoryinterface/tst_qwebhistoryinterface.cpp0000644000175000017500000000464211176276353024246 0ustar leelee/* Copyright (C) 2008 Holger Hans Peter Freyther 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include class tst_QWebHistoryInterface : public QObject { Q_OBJECT public: tst_QWebHistoryInterface(); virtual ~tst_QWebHistoryInterface(); public slots: void init(); void cleanup(); private slots: void visitedLinks(); private: private: QWebView* m_view; QWebPage* m_page; }; tst_QWebHistoryInterface::tst_QWebHistoryInterface() { } tst_QWebHistoryInterface::~tst_QWebHistoryInterface() { } void tst_QWebHistoryInterface::init() { m_view = new QWebView(); m_page = m_view->page(); } void tst_QWebHistoryInterface::cleanup() { delete m_view; } class FakeHistoryImplementation : public QWebHistoryInterface { public: void addHistoryEntry(const QString&) {} bool historyContains(const QString& url) const { return url == QLatin1String("http://www.trolltech.com/"); } }; /* * Test that visited links are properly colored. http://www.trolltech.com is marked * as visited, so the below website should have exactly one element in the a:visited * state. */ void tst_QWebHistoryInterface::visitedLinks() { QWebHistoryInterface::setDefaultInterface(new FakeHistoryImplementation); m_view->setHtml("
Trolltech"); QCOMPARE(m_page->mainFrame()->evaluateJavaScript("document.querySelectorAll(':visited').length;").toString(), QString::fromLatin1("1")); } QTEST_MAIN(tst_QWebHistoryInterface) #include "tst_qwebhistoryinterface.moc" WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro0000644000175000017500000000034511254771106023357 0ustar leeleeTEMPLATE = app TARGET = tst_qwebhistoryinterface include(../../../../WebKit.pri) SOURCES += tst_qwebhistoryinterface.cpp QT += testlib network QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR symbian:TARGET.UID3 = 0xA000E53C WebKit/qt/tests/qwebelement/0000755000175000017500000000000011527024257014442 5ustar leeleeWebKit/qt/tests/qwebelement/tst_qwebelement.cpp0000644000175000017500000006317511257755066020375 0ustar leelee/* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include //TESTED_CLASS= //TESTED_FILES= /** * Starts an event loop that runs until the given signal is received. Optionally the event loop * can return earlier on a timeout. * * \return \p true if the requested signal was received * \p false on timeout */ static bool waitForSignal(QObject* obj, const char* signal, int timeout = 0) { QEventLoop loop; QObject::connect(obj, signal, &loop, SLOT(quit())); QTimer timer; QSignalSpy timeoutSpy(&timer, SIGNAL(timeout())); if (timeout > 0) { QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); timer.setSingleShot(true); timer.start(timeout); } loop.exec(); return timeoutSpy.isEmpty(); } class tst_QWebElement : public QObject { Q_OBJECT public: tst_QWebElement(); virtual ~tst_QWebElement(); public slots: void init(); void cleanup(); private slots: void textHtml(); void simpleCollection(); void attributes(); void attributesNS(); void classes(); void namespaceURI(); void foreachManipulation(); void evaluateJavaScript(); void documentElement(); void frame(); void style(); void computedStyle(); void appendAndPrepend(); void insertBeforeAndAfter(); void remove(); void clear(); void replaceWith(); void encloseWith(); void encloseContentsWith(); void nullSelect(); void firstChildNextSibling(); void lastChildPreviousSibling(); void hasSetFocus(); private: QWebView* m_view; QWebPage* m_page; QWebFrame* m_mainFrame; }; tst_QWebElement::tst_QWebElement() { } tst_QWebElement::~tst_QWebElement() { } void tst_QWebElement::init() { m_view = new QWebView(); m_page = m_view->page(); m_mainFrame = m_page->mainFrame(); } void tst_QWebElement::cleanup() { delete m_view; } void tst_QWebElement::textHtml() { QString html = "

test

"; m_mainFrame->setHtml(html); QWebElement body = m_mainFrame->documentElement(); QVERIFY(!body.isNull()); QCOMPARE(body.toPlainText(), QString("test")); QCOMPARE(body.toPlainText(), m_mainFrame->toPlainText()); QCOMPARE(body.toInnerXml(), html); } void tst_QWebElement::simpleCollection() { QString html = "

first para

second para

"; m_mainFrame->setHtml(html); QWebElement body = m_mainFrame->documentElement(); QList list = body.findAll("p"); QCOMPARE(list.count(), 2); QCOMPARE(list.at(0).toPlainText(), QString("first para")); QCOMPARE(list.at(1).toPlainText(), QString("second para")); } void tst_QWebElement::attributes() { m_mainFrame->setHtml("

Test"); QWebElement body = m_mainFrame->documentElement(); QVERIFY(!body.hasAttribute("title")); QVERIFY(!body.hasAttributes()); body.setAttribute("title", "test title"); QVERIFY(body.hasAttributes()); QVERIFY(body.hasAttribute("title")); QCOMPARE(body.attribute("title"), QString("test title")); body.removeAttribute("title"); QVERIFY(!body.hasAttribute("title")); QVERIFY(!body.hasAttributes()); QCOMPARE(body.attribute("does-not-exist", "testvalue"), QString("testvalue")); } void tst_QWebElement::attributesNS() { QString content = "" "" ""; m_mainFrame->setContent(content.toUtf8(), "application/xhtml+xml"); QWebElement svg = m_mainFrame->findFirstElement("svg"); QVERIFY(!svg.isNull()); QVERIFY(!svg.hasAttributeNS("http://www.w3.org/2000/svg", "foobar")); QCOMPARE(svg.attributeNS("http://www.w3.org/2000/svg", "foobar", "defaultblah"), QString("defaultblah")); svg.setAttributeNS("http://www.w3.org/2000/svg", "svg:foobar", "true"); QVERIFY(svg.hasAttributeNS("http://www.w3.org/2000/svg", "foobar")); QCOMPARE(svg.attributeNS("http://www.w3.org/2000/svg", "foobar", "defaultblah"), QString("true")); } void tst_QWebElement::classes() { m_mainFrame->setHtml("

Test"); QWebElement body = m_mainFrame->documentElement(); QCOMPARE(body.classes().count(), 0); QWebElement p = m_mainFrame->documentElement().findAll("p").at(0); QStringList classes = p.classes(); QCOMPARE(classes.count(), 4); QCOMPARE(classes[0], QLatin1String("a")); QCOMPARE(classes[1], QLatin1String("b")); QCOMPARE(classes[2], QLatin1String("c")); QCOMPARE(classes[3], QLatin1String("d")); QVERIFY(p.hasClass("a")); QVERIFY(p.hasClass("b")); QVERIFY(p.hasClass("c")); QVERIFY(p.hasClass("d")); QVERIFY(!p.hasClass("e")); p.addClass("f"); QVERIFY(p.hasClass("f")); p.addClass("a"); QCOMPARE(p.classes().count(), 5); QVERIFY(p.hasClass("a")); QVERIFY(p.hasClass("b")); QVERIFY(p.hasClass("c")); QVERIFY(p.hasClass("d")); p.toggleClass("a"); QVERIFY(!p.hasClass("a")); QVERIFY(p.hasClass("b")); QVERIFY(p.hasClass("c")); QVERIFY(p.hasClass("d")); QVERIFY(p.hasClass("f")); QCOMPARE(p.classes().count(), 4); p.toggleClass("f"); QVERIFY(!p.hasClass("f")); QCOMPARE(p.classes().count(), 3); p.toggleClass("a"); p.toggleClass("f"); QVERIFY(p.hasClass("a")); QVERIFY(p.hasClass("f")); QCOMPARE(p.classes().count(), 5); p.removeClass("f"); QVERIFY(!p.hasClass("f")); QCOMPARE(p.classes().count(), 4); p.removeClass("d"); QVERIFY(!p.hasClass("d")); QCOMPARE(p.classes().count(), 3); p.removeClass("not-exist"); QCOMPARE(p.classes().count(), 3); p.removeClass("c"); QVERIFY(!p.hasClass("c")); QCOMPARE(p.classes().count(), 2); p.removeClass("b"); QVERIFY(!p.hasClass("b")); QCOMPARE(p.classes().count(), 1); p.removeClass("a"); QVERIFY(!p.hasClass("a")); QCOMPARE(p.classes().count(), 0); p.removeClass("foobar"); QCOMPARE(p.classes().count(), 0); } void tst_QWebElement::namespaceURI() { QString content = "" "" ""; m_mainFrame->setContent(content.toUtf8(), "application/xhtml+xml"); QWebElement body = m_mainFrame->documentElement(); QCOMPARE(body.namespaceUri(), QLatin1String("http://www.w3.org/1999/xhtml")); QWebElement svg = body.findAll("*#foobar").at(0); QCOMPARE(svg.prefix(), QLatin1String("svg")); QCOMPARE(svg.localName(), QLatin1String("svg")); QCOMPARE(svg.tagName(), QLatin1String("svg:svg")); QCOMPARE(svg.namespaceUri(), QLatin1String("http://www.w3.org/2000/svg")); } void tst_QWebElement::foreachManipulation() { QString html = "

first para

second para

"; m_mainFrame->setHtml(html); QWebElement body = m_mainFrame->documentElement(); foreach(QWebElement p, body.findAll("p")) { p.setInnerXml("
foo
bar
"); } QCOMPARE(body.findAll("div").count(), 4); } void tst_QWebElement::evaluateJavaScript() { QVariant result; m_mainFrame->setHtml("

test"); QWebElement para = m_mainFrame->findFirstElement("p"); result = para.evaluateJavaScript("this.tagName"); QVERIFY(result.isValid()); QVERIFY(result.type() == QVariant::String); QCOMPARE(result.toString(), QLatin1String("P")); result = para.evaluateJavaScript("this.hasAttributes()"); QVERIFY(result.isValid()); QVERIFY(result.type() == QVariant::Bool); QVERIFY(!result.toBool()); para.evaluateJavaScript("this.setAttribute('align', 'left');"); QCOMPARE(para.attribute("align"), QLatin1String("left")); result = para.evaluateJavaScript("this.hasAttributes()"); QVERIFY(result.isValid()); QVERIFY(result.type() == QVariant::Bool); QVERIFY(result.toBool()); } void tst_QWebElement::documentElement() { m_mainFrame->setHtml("

Test"); QWebElement para = m_mainFrame->documentElement().findAll("p").at(0); QVERIFY(para.parent().parent() == m_mainFrame->documentElement()); QVERIFY(para.document() == m_mainFrame->documentElement()); } void tst_QWebElement::frame() { m_mainFrame->setHtml("

test"); QWebElement doc = m_mainFrame->documentElement(); QVERIFY(doc.webFrame() == m_mainFrame); m_view->setHtml(QString("data:text/html,frame1\">" "frame2\">"), QUrl()); waitForSignal(m_page, SIGNAL(loadFinished(bool))); QCOMPARE(m_mainFrame->childFrames().count(), 2); QWebFrame* firstFrame = m_mainFrame->childFrames().at(0); QWebFrame* secondFrame = m_mainFrame->childFrames().at(1); QCOMPARE(firstFrame->toPlainText(), QString("frame1")); QCOMPARE(secondFrame->toPlainText(), QString("frame2")); QWebElement firstPara = firstFrame->documentElement().findAll("p").at(0); QWebElement secondPara = secondFrame->documentElement().findAll("p").at(0); QVERIFY(firstPara.webFrame() == firstFrame); QVERIFY(secondPara.webFrame() == secondFrame); } void tst_QWebElement::style() { QString html = "" "" "" "" "

some text

" ""; m_mainFrame->setHtml(html); QWebElement p = m_mainFrame->documentElement().findAll("p").at(0); QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue")); QVERIFY(p.styleProperty("cursor", QWebElement::InlineStyle).isEmpty()); p.setStyleProperty("color", "red"); p.setStyleProperty("cursor", "auto"); QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("red")); QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("yellow")); QCOMPARE(p.styleProperty("cursor", QWebElement::InlineStyle), QLatin1String("auto")); p.setStyleProperty("color", "green !important"); QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("green")); QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("green")); p.setStyleProperty("color", "blue"); QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("green")); QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("green")); p.setStyleProperty("color", "blue !important"); QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue")); QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("blue")); QString html2 = "" "" "" "" "

some text

" ""; m_mainFrame->setHtml(html2); p = m_mainFrame->documentElement().findAll("p").at(0); QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue")); QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("blue")); QString html3 = "" "" "" "" "

some text

" ""; m_mainFrame->setHtml(html3); p = m_mainFrame->documentElement().findAll("p").at(0); QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue")); QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("blue")); QString html5 = "" "" "" "" "

some text

" ""; m_mainFrame->setHtml(html5); p = m_mainFrame->documentElement().findAll("p").at(0); QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("")); QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("red")); QString html6 = "" "" "" "" "" "

some text

" ""; // in few seconds, the CSS should be completey loaded QSignalSpy spy(m_page, SIGNAL(loadFinished(bool))); m_mainFrame->setHtml(html6); QTest::qWait(200); p = m_mainFrame->documentElement().findAll("p").at(0); QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue")); QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("black")); QString html7 = "" "" "" "" "" "

some text

" ""; // in few seconds, the style should be completey loaded m_mainFrame->setHtml(html7); QTest::qWait(200); p = m_mainFrame->documentElement().findAll("p").at(0); QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("black")); QString html8 = "

some text

"; m_mainFrame->setHtml(html8); p = m_mainFrame->documentElement().findAll("p").at(0); QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("")); QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("")); } void tst_QWebElement::computedStyle() { QString html = "

some text

"; m_mainFrame->setHtml(html); QWebElement p = m_mainFrame->documentElement().findAll("p").at(0); QCOMPARE(p.styleProperty("cursor", QWebElement::ComputedStyle), QLatin1String("auto")); QVERIFY(!p.styleProperty("cursor", QWebElement::ComputedStyle).isEmpty()); QVERIFY(p.styleProperty("cursor", QWebElement::InlineStyle).isEmpty()); p.setStyleProperty("cursor", "text"); p.setStyleProperty("color", "red"); QCOMPARE(p.styleProperty("cursor", QWebElement::ComputedStyle), QLatin1String("text")); QCOMPARE(p.styleProperty("color", QWebElement::ComputedStyle), QLatin1String("rgb(255, 0, 0)")); QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("red")); } void tst_QWebElement::appendAndPrepend() { QString html = "" "

" "foo" "

" "

" "bar" "

" ""; m_mainFrame->setHtml(html); QWebElement body = m_mainFrame->documentElement().findFirst("body"); QCOMPARE(body.findAll("p").count(), 2); body.appendInside(body.findFirst("p")); QCOMPARE(body.findAll("p").count(), 2); QCOMPARE(body.findFirst("p").toPlainText(), QString("bar")); QCOMPARE(body.findAll("p").last().toPlainText(), QString("foo")); body.appendInside(body.findFirst("p").clone()); QCOMPARE(body.findAll("p").count(), 3); QCOMPARE(body.findFirst("p").toPlainText(), QString("bar")); QCOMPARE(body.findAll("p").last().toPlainText(), QString("bar")); body.prependInside(body.findAll("p").at(1).clone()); QCOMPARE(body.findAll("p").count(), 4); QCOMPARE(body.findFirst("p").toPlainText(), QString("foo")); body.findFirst("p").appendInside("
booyakasha
"); QCOMPARE(body.findAll("p div").count(), 1); QCOMPARE(body.findFirst("p div").toPlainText(), QString("booyakasha")); body.findFirst("div").prependInside("yepp"); QCOMPARE(body.findAll("p div code").count(), 1); QCOMPARE(body.findFirst("p div code").toPlainText(), QString("yepp")); } void tst_QWebElement::insertBeforeAndAfter() { QString html = "" "

" "foo" "

" "
" "yeah" "
" "

" "bar" "

" ""; m_mainFrame->setHtml(html); QWebElement body = m_mainFrame->documentElement().findFirst("body"); QWebElement div = body.findFirst("div"); QCOMPARE(body.findAll("p").count(), 2); QCOMPARE(body.findAll("div").count(), 1); div.prependOutside(body.findAll("p").last().clone()); QCOMPARE(body.findAll("p").count(), 3); QCOMPARE(body.findAll("p").at(0).toPlainText(), QString("foo")); QCOMPARE(body.findAll("p").at(1).toPlainText(), QString("bar")); QCOMPARE(body.findAll("p").at(2).toPlainText(), QString("bar")); div.appendOutside(body.findFirst("p").clone()); QCOMPARE(body.findAll("p").count(), 4); QCOMPARE(body.findAll("p").at(0).toPlainText(), QString("foo")); QCOMPARE(body.findAll("p").at(1).toPlainText(), QString("bar")); QCOMPARE(body.findAll("p").at(2).toPlainText(), QString("foo")); QCOMPARE(body.findAll("p").at(3).toPlainText(), QString("bar")); div.prependOutside("hey"); QCOMPARE(body.findAll("span").count(), 1); div.appendOutside("there"); QCOMPARE(body.findAll("span").count(), 2); QCOMPARE(body.findAll("span").at(0).toPlainText(), QString("hey")); QCOMPARE(body.findAll("span").at(1).toPlainText(), QString("there")); } void tst_QWebElement::remove() { QString html = "" "

" "foo" "

" "
" "

yeah

" "
" "

" "bar" "

" ""; m_mainFrame->setHtml(html); QWebElement body = m_mainFrame->documentElement().findFirst("body"); QCOMPARE(body.findAll("div").count(), 1); QCOMPARE(body.findAll("p").count(), 3); QWebElement div = body.findFirst("div"); div.takeFromDocument(); QCOMPARE(div.isNull(), false); QCOMPARE(body.findAll("div").count(), 0); QCOMPARE(body.findAll("p").count(), 2); body.appendInside(div); QCOMPARE(body.findAll("div").count(), 1); QCOMPARE(body.findAll("p").count(), 3); } void tst_QWebElement::clear() { QString html = "" "

" "foo" "

" "
" "

yeah

" "
" "

" "bar" "

" ""; m_mainFrame->setHtml(html); QWebElement body = m_mainFrame->documentElement().findFirst("body"); QCOMPARE(body.findAll("div").count(), 1); QCOMPARE(body.findAll("p").count(), 3); body.findFirst("div").removeChildren(); QCOMPARE(body.findAll("div").count(), 1); QCOMPARE(body.findAll("p").count(), 2); } void tst_QWebElement::replaceWith() { QString html = "" "

" "foo" "

" "
" "yeah" "
" "

" "haba" "

" ""; m_mainFrame->setHtml(html); QWebElement body = m_mainFrame->documentElement().findFirst("body"); QCOMPARE(body.findAll("div").count(), 1); QCOMPARE(body.findAll("span").count(), 1); body.findFirst("div").replace(body.findFirst("span").clone()); QCOMPARE(body.findAll("div").count(), 0); QCOMPARE(body.findAll("span").count(), 2); QCOMPARE(body.findAll("p").count(), 2); body.findFirst("span").replace("

wow

"); QCOMPARE(body.findAll("p").count(), 3); QCOMPARE(body.findAll("p code").count(), 1); QCOMPARE(body.findFirst("p code").toPlainText(), QString("wow")); } void tst_QWebElement::encloseContentsWith() { QString html = "" "
" "" "yeah" "" "" "hello" "" "
" "

" "foo" "bar" "

" "" "" "hey" ""; m_mainFrame->setHtml(html); QWebElement body = m_mainFrame->documentElement().findFirst("body"); body.findFirst("p").encloseContentsWith(body.findFirst("b")); QCOMPARE(body.findAll("p b span").count(), 2); QCOMPARE(body.findFirst("p b span").toPlainText(), QString("foo")); body.findFirst("u").encloseContentsWith(""); QCOMPARE(body.findAll("u i").count(), 1); QCOMPARE(body.findFirst("u i").toPlainText(), QString()); body.findFirst("div").encloseContentsWith(""); QCOMPARE(body.findAll("div span i").count(), 2); QCOMPARE(body.findFirst("div span i").toPlainText(), QString("yeah")); QString snippet = "" "" "" "" "" "" "" "" "" "" "" "" "
"; body.findFirst("em").encloseContentsWith(snippet); QCOMPARE(body.findFirst("em table tbody tr td").toPlainText(), QString("hey")); } void tst_QWebElement::encloseWith() { QString html = "" "

" "foo" "

" "
" "yeah" "
" "

" "bar" "

" "hey" "

hello

" ""; m_mainFrame->setHtml(html); QWebElement body = m_mainFrame->documentElement().findFirst("body"); body.findFirst("p").encloseWith("
"); QCOMPARE(body.findAll("br").count(), 0); QCOMPARE(body.findAll("div").count(), 1); body.findFirst("div").encloseWith(body.findFirst("span").clone()); QCOMPARE(body.findAll("div").count(), 1); QCOMPARE(body.findAll("span").count(), 2); QCOMPARE(body.findAll("p").count(), 2); body.findFirst("div").encloseWith(""); QCOMPARE(body.findAll("code").count(), 1); QCOMPARE(body.findAll("code div").count(), 1); QCOMPARE(body.findFirst("code div").toPlainText(), QString("yeah")); QString snippet = "" "" "" "" "" "" "" "" "" "" "" "" "
"; body.findFirst("em").encloseWith(snippet); QCOMPARE(body.findFirst("table tbody tr td em").toPlainText(), QString("hey")); } void tst_QWebElement::nullSelect() { m_mainFrame->setHtml("

Test"); QList collection = m_mainFrame->findAllElements("invalid{syn(tax;;%#$f223e>>"); QVERIFY(collection.count() == 0); } void tst_QWebElement::firstChildNextSibling() { m_mainFrame->setHtml("

Test

Test

this d->page->d->setInspector(0); } if (page && page->d->inspector && page->d->inspector != this) { // Break newPage<->newPageCurrentInspector page->d->inspector->setPage(0); } d->page = page; if (page) { // Setup the reciprocal association page->d->setInspector(this); } } /*! Returns the inspected QWebPage. If no web page is currently associated, a null pointer is returned. */ QWebPage* QWebInspector::page() const { return d->page; } /*! \reimp */ QSize QWebInspector::sizeHint() const { return QSize(450, 300); } /*! \reimp */ bool QWebInspector::event(QEvent* ev) { return QWidget::event(ev); } /*! \reimp */ void QWebInspector::resizeEvent(QResizeEvent* event) { d->adjustFrontendSize(event->size()); } /*! \reimp */ void QWebInspector::showEvent(QShowEvent* event) { // Allows QWebInspector::show() to init the inspector. if (d->page) d->page->d->inspectorController()->show(); } /*! \reimp */ void QWebInspector::hideEvent(QHideEvent* event) { if (d->page) d->page->d->inspectorController()->setWindowVisible(false); } /*! \internal */ void QWebInspectorPrivate::setFrontend(QWidget* newFrontend) { if (frontend) frontend->setParent(0); frontend = newFrontend; if (frontend) { frontend->setParent(q); frontend->show(); adjustFrontendSize(q->size()); } } void QWebInspectorPrivate::adjustFrontendSize(const QSize& size) { if (frontend) frontend->resize(size); } /*! \fn void QWebInspector::windowTitleChanged(const QString& newTitle); This is emitted to signal that this widget's title changed to \a newTitle. */ WebKit/qt/Api/qwebsettings.h0000644000175000017500000001070311251455653014374 0ustar leelee/* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef QWEBSETTINGS_H #define QWEBSETTINGS_H #include "qwebkitglobal.h" #include #include #include #include namespace WebCore { class Settings; } class QWebPage; class QWebPluginDatabase; class QWebSettingsPrivate; QT_BEGIN_NAMESPACE class QUrl; QT_END_NAMESPACE class QWEBKIT_EXPORT QWebSettings { public: enum FontFamily { StandardFont, FixedFont, SerifFont, SansSerifFont, CursiveFont, FantasyFont }; enum WebAttribute { AutoLoadImages, JavascriptEnabled, JavaEnabled, PluginsEnabled, PrivateBrowsingEnabled, JavascriptCanOpenWindows, JavascriptCanAccessClipboard, DeveloperExtrasEnabled, LinksIncludedInFocusChain, ZoomTextOnly, PrintElementBackgrounds, OfflineStorageDatabaseEnabled, OfflineWebApplicationCacheEnabled, LocalStorageEnabled, #ifdef QT_DEPRECATED LocalStorageDatabaseEnabled = LocalStorageEnabled, #endif LocalContentCanAccessRemoteUrls, SessionStorageEnabled, DnsPrefetchEnabled }; enum WebGraphic { MissingImageGraphic, MissingPluginGraphic, DefaultFrameIconGraphic, TextAreaSizeGripCornerGraphic }; enum FontSize { MinimumFontSize, MinimumLogicalFontSize, DefaultFontSize, DefaultFixedFontSize }; static QWebSettings *globalSettings(); void setFontFamily(FontFamily which, const QString &family); QString fontFamily(FontFamily which) const; void resetFontFamily(FontFamily which); void setFontSize(FontSize type, int size); int fontSize(FontSize type) const; void resetFontSize(FontSize type); void setAttribute(WebAttribute attr, bool on); bool testAttribute(WebAttribute attr) const; void resetAttribute(WebAttribute attr); void setUserStyleSheetUrl(const QUrl &location); QUrl userStyleSheetUrl() const; void setDefaultTextEncoding(const QString &encoding); QString defaultTextEncoding() const; static void setIconDatabasePath(const QString &location); static QString iconDatabasePath(); static void clearIconDatabase(); static QIcon iconForUrl(const QUrl &url); static QWebPluginDatabase *pluginDatabase(); static void setWebGraphic(WebGraphic type, const QPixmap &graphic); static QPixmap webGraphic(WebGraphic type); static void setMaximumPagesInCache(int pages); static int maximumPagesInCache(); static void setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity); static void setOfflineStoragePath(const QString& path); static QString offlineStoragePath(); static void setOfflineStorageDefaultQuota(qint64 maximumSize); static qint64 offlineStorageDefaultQuota(); static void setOfflineWebApplicationCachePath(const QString& path); static QString offlineWebApplicationCachePath(); static void setOfflineWebApplicationCacheQuota(qint64 maximumSize); static qint64 offlineWebApplicationCacheQuota(); void setLocalStoragePath(const QString& path); QString localStoragePath() const; static void clearMemoryCaches(); static void enablePersistentStorage(const QString& path = QString()); inline QWebSettingsPrivate* handle() const { return d; } private: friend class QWebPagePrivate; friend class QWebSettingsPrivate; Q_DISABLE_COPY(QWebSettings) QWebSettings(); QWebSettings(WebCore::Settings *settings); ~QWebSettings(); QWebSettingsPrivate *d; }; #endif WebKit/qt/Api/qwebdatabase.h0000644000175000017500000000326211231327136014272 0ustar leelee/* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _WEBDATABASE_H_ #define _WEBDATABASE_H_ #include #include #include "qwebkitglobal.h" namespace WebCore { class DatabaseDetails; } class QWebDatabasePrivate; class QWebSecurityOrigin; class QWEBKIT_EXPORT QWebDatabase { public: QWebDatabase(const QWebDatabase& other); QWebDatabase &operator=(const QWebDatabase& other); ~QWebDatabase(); QString name() const; QString displayName() const; qint64 expectedSize() const; qint64 size() const; QString fileName() const; QWebSecurityOrigin origin() const; static void removeDatabase(const QWebDatabase&); static void removeAllDatabases(); private: QWebDatabase(QWebDatabasePrivate* priv); friend class QWebSecurityOrigin; private: QExplicitlySharedDataPointer d; }; #endif WebKit/qt/Api/qwebhistory.h0000644000175000017500000000741311231327136014231 0ustar leelee/* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef QWEBHISTORY_H #define QWEBHISTORY_H #include #include #include #include #include #include "qwebkitglobal.h" class QWebPage; namespace WebCore { class FrameLoaderClientQt; } class QWebHistoryItemPrivate; class QWEBKIT_EXPORT QWebHistoryItem { public: QWebHistoryItem(const QWebHistoryItem &other); QWebHistoryItem &operator=(const QWebHistoryItem &other); ~QWebHistoryItem(); //bool restoreState(QByteArray& buffer); //QByteArray saveState(QWebHistory::HistoryStateVersion version = DefaultHistoryVersion) const; QUrl originalUrl() const; QUrl url() const; QString title() const; QDateTime lastVisited() const; QIcon icon() const; QVariant userData() const; void setUserData(const QVariant& userData); bool isValid() const; private: QWebHistoryItem(QWebHistoryItemPrivate *priv); friend class QWebHistory; friend class QWebPage; friend class WebCore::FrameLoaderClientQt; friend class QWebHistoryItemPrivate; //friend QDataStream & operator<<(QDataStream& out,const QWebHistoryItem& hist); //friend QDataStream & operator>>(QDataStream& in,QWebHistoryItem& hist); QExplicitlySharedDataPointer d; }; //QWEBKIT_EXPORT QDataStream & operator<<(QDataStream& out,const QWebHistoryItem& hist); //QWEBKIT_EXPORT QDataStream & operator>>(QDataStream& in,QWebHistoryItem& hist); class QWebHistoryPrivate; class QWEBKIT_EXPORT QWebHistory { public: enum HistoryStateVersion { HistoryVersion_1, /*, HistoryVersion_2, */ DefaultHistoryVersion = HistoryVersion_1 }; bool restoreState(const QByteArray& buffer); QByteArray saveState(HistoryStateVersion version = DefaultHistoryVersion) const; void clear(); QList items() const; QList backItems(int maxItems) const; QList forwardItems(int maxItems) const; bool canGoBack() const; bool canGoForward() const; void back(); void forward(); void goToItem(const QWebHistoryItem &item); QWebHistoryItem backItem() const; QWebHistoryItem currentItem() const; QWebHistoryItem forwardItem() const; QWebHistoryItem itemAt(int i) const; int currentItemIndex() const; int count() const; int maximumItemCount() const; void setMaximumItemCount(int count); private: QWebHistory(); ~QWebHistory(); friend class QWebPage; friend class QWebPagePrivate; friend QWEBKIT_EXPORT QDataStream& operator>>(QDataStream&, QWebHistory&); friend QWEBKIT_EXPORT QDataStream& operator<<(QDataStream&, const QWebHistory&); Q_DISABLE_COPY(QWebHistory) QWebHistoryPrivate *d; }; QWEBKIT_EXPORT QDataStream& operator<<(QDataStream& stream, const QWebHistory& history); QWEBKIT_EXPORT QDataStream& operator>>(QDataStream& stream, QWebHistory& history); #endif WebKit/qt/Api/qwebsecurityorigin.h0000644000175000017500000000432411243171732015607 0ustar leelee/* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _WEBSECURITYORIGIN_H_ #define _WEBSECURITYORIGIN_H_ #include #include #include "qwebkitglobal.h" namespace WebCore { class SecurityOrigin; class ChromeClientQt; } class QWebSecurityOriginPrivate; class QWebDatabase; class QWebFrame; class QWEBKIT_EXPORT QWebSecurityOrigin { public: static QList allOrigins(); static void addLocalScheme(const QString& scheme); static void removeLocalScheme(const QString& scheme); static QStringList localSchemes(); static void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains); static void resetOriginAccessWhiteLists(); ~QWebSecurityOrigin(); QString scheme() const; QString host() const; int port() const; qint64 databaseUsage() const; qint64 databaseQuota() const; void setDatabaseQuota(qint64 quota); QList databases() const; QWebSecurityOrigin(const QWebSecurityOrigin& other); QWebSecurityOrigin &operator=(const QWebSecurityOrigin& other); private: friend class QWebDatabase; friend class QWebFrame; friend class WebCore::ChromeClientQt; QWebSecurityOrigin(QWebSecurityOriginPrivate* priv); private: QExplicitlySharedDataPointer d; }; #endif WebKit/qt/Api/qwebnetworkinterface.cpp0000644000175000017500000010710411233131324016425 0ustar leelee/* Copyright (C) 2006 Enrico Ros Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) Copyright (C) 2007 Staikos Computing Services 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #if QT_VERSION < 0x040400 #include "qwebframe.h" #include "qwebnetworkinterface.h" #include "qwebnetworkinterface_p.h" #include "qwebpage.h" #include "qcookiejar.h" #include #include #include #include #include #include #include #include "ResourceHandle.h" #include "ResourceHandleClient.h" #include "ResourceHandleInternal.h" #include "MIMETypeRegistry.h" #include "CookieJar.h" #if 0 #define DEBUG qDebug #else #define DEBUG if (1) {} else qDebug #endif static QWebNetworkInterface *s_default_interface = 0; static QWebNetworkManager *s_manager = 0; using namespace WebCore; uint qHash(const HostInfo &info) { return qHash(info.host) + info.port; } static bool operator==(const HostInfo &i1, const HostInfo &i2) { return i1.port == i2.port && i1.host == i2.host; } enum ParserState { State_Begin, State_FirstChar, State_SecondChar }; /* * Decode URLs without doing any charset conversion. * * Most simple approach to do it without any lookahead. */ static QByteArray decodePercentEncoding(const QByteArray& input) { int actualLength = 0; QByteArray tmpVal; QByteArray output; ParserState state = State_Begin; output.resize(input.length()); tmpVal.resize(2); for (int i = 0; i < input.length(); ++i) if (state == State_Begin) { if (input.at(i) == '%') state = State_FirstChar; else output[actualLength++] = input[i]; } else if (state == State_FirstChar) { state = State_SecondChar; tmpVal[0] = input[i]; } else if (state == State_SecondChar) { state = State_Begin; tmpVal[1] = input[i]; output[actualLength++] = tmpVal.toShort(0, 16); } output.resize(actualLength); return output; } void QWebNetworkRequestPrivate::init(const WebCore::ResourceRequest &resourceRequest) { KURL url = resourceRequest.url(); QUrl qurl = QString(url.string()); init(resourceRequest.httpMethod(), qurl, &resourceRequest); } void QWebNetworkRequestPrivate::init(const QString& method, const QUrl& url, const WebCore::ResourceRequest* resourceRequest) { httpHeader = QHttpRequestHeader(method, url.toString(QUrl::RemoveScheme|QUrl::RemoveAuthority)); httpHeader.setValue(QLatin1String("Connection"), QLatin1String("Keep-Alive")); setURL(url); if (resourceRequest) { httpHeader.setValue(QLatin1String("User-Agent"), resourceRequest->httpUserAgent()); const QString scheme = url.scheme().toLower(); if (scheme == QLatin1String("http") || scheme == QLatin1String("https")) { QString cookies = QCookieJar::cookieJar()->cookies(resourceRequest->url()); if (!cookies.isEmpty()) httpHeader.setValue(QLatin1String("Cookie"), cookies); } const HTTPHeaderMap& loaderHeaders = resourceRequest->httpHeaderFields(); HTTPHeaderMap::const_iterator end = loaderHeaders.end(); for (HTTPHeaderMap::const_iterator it = loaderHeaders.begin(); it != end; ++it) httpHeader.setValue(it->first, it->second); // handle and perform a 'POST' request if (method == "POST") { Vector data; resourceRequest->httpBody()->flatten(data); postData = QByteArray(data.data(), data.size()); httpHeader.setValue(QLatin1String("content-length"), QString::number(postData.size())); } } } void QWebNetworkRequestPrivate::setURL(const QUrl& u) { url = u; int port = url.port(); const QString scheme = u.scheme(); if (port > 0 && (port != 80 || scheme != "http") && (port != 443 || scheme != "https")) httpHeader.setValue(QLatin1String("Host"), url.host() + QLatin1Char(':') + QString::number(port)); else httpHeader.setValue(QLatin1String("Host"), url.host()); } /*! \class QWebNetworkRequest \internal The QWebNetworkRequest class represents a request for data from the network with all the necessary information needed for retrieval. This includes the url, extra HTTP header fields as well as data for a HTTP POST request. */ QWebNetworkRequest::QWebNetworkRequest() : d(new QWebNetworkRequestPrivate) { } QWebNetworkRequest::QWebNetworkRequest(const QUrl& url, Method method, const QByteArray& postData) : d(new QWebNetworkRequestPrivate) { d->init(method == Get ? "GET" : "POST", url); d->postData = postData; } QWebNetworkRequest::QWebNetworkRequest(const QWebNetworkRequest &other) : d(new QWebNetworkRequestPrivate(*other.d)) { } QWebNetworkRequest &QWebNetworkRequest::operator=(const QWebNetworkRequest& other) { *d = *other.d; return *this; } /*! \internal */ QWebNetworkRequest::QWebNetworkRequest(const QWebNetworkRequestPrivate& priv) : d(new QWebNetworkRequestPrivate(priv)) { } /*! \internal */ QWebNetworkRequest::QWebNetworkRequest(const WebCore::ResourceRequest& request) : d(new QWebNetworkRequestPrivate) { d->init(request); } QWebNetworkRequest::~QWebNetworkRequest() { delete d; } /*! \internal The requested URL */ QUrl QWebNetworkRequest::url() const { return d->url; } /*! \internal Sets the URL to request. Note that setting the URL also sets the "Host" field in the HTTP header. */ void QWebNetworkRequest::setUrl(const QUrl& url) { d->setURL(url); } /*! \internal The http request header information. */ QHttpRequestHeader QWebNetworkRequest::httpHeader() const { return d->httpHeader; } void QWebNetworkRequest::setHttpHeader(const QHttpRequestHeader& header) const { d->httpHeader = header; } QString QWebNetworkRequest::httpHeaderField(const QString& key) const { return d->httpHeader.value(key); } void QWebNetworkRequest::setHttpHeaderField(const QString& key, const QString& value) { d->httpHeader.setValue(key, value); } /*! \internal Post data sent with HTTP POST requests. */ QByteArray QWebNetworkRequest::postData() const { return d->postData; } void QWebNetworkRequest::setPostData(const QByteArray& data) { d->postData = data; } /*! \class QWebNetworkJob \internal The QWebNetworkJob class represents a network job, that needs to be processed by the QWebNetworkInterface. This class is only required when implementing a new network layer (or support for a special protocol) using QWebNetworkInterface. QWebNetworkJob objects are created and owned by the QtWebKit library. Most of it's properties are read-only. The job is reference counted. This can be used to ensure that the job doesn't get deleted while it's still stored in some data structure. */ /*! \internal */ QWebNetworkJob::QWebNetworkJob() : d(new QWebNetworkJobPrivate) { } /*! \internal */ QWebNetworkJob::~QWebNetworkJob() { delete d; d = 0; } /*! \internal The requested URL */ QUrl QWebNetworkJob::url() const { return d->request.url; } /*! \internal Post data associated with the job */ QByteArray QWebNetworkJob::postData() const { return d->request.postData; } /*! \internal The HTTP request header that should be used to download the job. */ QHttpRequestHeader QWebNetworkJob::httpHeader() const { return d->request.httpHeader; } /*! \internal The complete network request that should be used to download the job. */ QWebNetworkRequest QWebNetworkJob::request() const { return QWebNetworkRequest(d->request); } /*! \internal The HTTP response header received from the network. */ QHttpResponseHeader QWebNetworkJob::response() const { return d->response; } /*! \internal The last error of the Job. */ QString QWebNetworkJob::errorString() const { return d->errorString; } /*! \internal Sets the HTTP reponse header. The response header has to be called before emitting QWebNetworkInterface::started. */ void QWebNetworkJob::setResponse(const QHttpResponseHeader& response) { d->response = response; } void QWebNetworkJob::setErrorString(const QString& errorString) { d->errorString = errorString; } /*! \internal returns true if the job has been cancelled by the WebKit framework */ bool QWebNetworkJob::cancelled() const { return !d->resourceHandle; } /*! \internal reference the job. */ void QWebNetworkJob::ref() { ++d->ref; } /*! \internal derefence the job. If the reference count drops to 0 this method also deletes the job. Returns false if the reference count has dropped to 0. */ bool QWebNetworkJob::deref() { if (!--d->ref) { delete this; return false; } return true; } /*! \internal Returns the network interface that is associated with this job. */ QWebNetworkInterface *QWebNetworkJob::networkInterface() const { return d->interface; } /*! \internal Returns the network interface that is associated with this job. */ QWebFrame *QWebNetworkJob::frame() const { if (!d->resourceHandle) { ResourceHandleInternal *rhi = d->resourceHandle->getInternal(); if (rhi) return rhi->m_frame; } return 0; } QWebNetworkJob::JobStatus QWebNetworkJob::status() const { return d->jobStatus; } void QWebNetworkJob::setStatus(const JobStatus& status) { d->jobStatus = status; } /*! \class QWebNetworkManager \internal */ QWebNetworkManager::QWebNetworkManager() : QObject(0) , m_scheduledWork(false) { connect(this, SIGNAL(scheduleWork()), SLOT(doWork()), Qt::QueuedConnection); } QWebNetworkManager *QWebNetworkManager::self() { // ensure everything's constructed and connected QWebNetworkInterface::defaultInterface(); return s_manager; } bool QWebNetworkManager::add(ResourceHandle* handle, QWebNetworkInterface* interface, JobMode jobMode) { if (!interface) interface = s_default_interface; ASSERT(interface); QWebNetworkJob *job = new QWebNetworkJob(); handle->getInternal()->m_job = job; job->d->resourceHandle = handle; job->d->interface = interface; job->d->request.init(handle->request()); const QString method = handle->getInternal()->m_request.httpMethod(); if (method != "POST" && method != "GET" && method != "HEAD") { qWarning("REQUEST: [%s]\n", qPrintable(job->d->request.httpHeader.toString())); return false; } DEBUG() << "QWebNetworkManager::add:" << job->d->request.httpHeader.toString(); if (jobMode == SynchronousJob) { Q_ASSERT(!m_synchronousJobs.contains(job)); m_synchronousJobs[job] = 1; } interface->addJob(job); return true; } void QWebNetworkManager::cancel(ResourceHandle* handle) { QWebNetworkJob *job = handle->getInternal()->m_job; if (!job) return; DEBUG() << "QWebNetworkManager::cancel:" << job->d->request.httpHeader.toString(); job->d->resourceHandle = 0; job->d->interface->cancelJob(job); handle->getInternal()->m_job = 0; } /*! \internal */ void QWebNetworkManager::started(QWebNetworkJob* job) { Q_ASSERT(job->d); Q_ASSERT(job->status() == QWebNetworkJob::JobCreated || job->status() == QWebNetworkJob::JobRecreated); job->setStatus(QWebNetworkJob::JobStarted); ResourceHandleClient* client = 0; if (!job->d->resourceHandle) return; client = job->d->resourceHandle->client(); if (!client) return; DEBUG() << "ResourceHandleManager::receivedResponse:"; DEBUG() << job->d->response.toString(); QStringList cookies = job->d->response.allValues("Set-Cookie"); KURL url(job->url()); foreach (QString c, cookies) QCookieJar::cookieJar()->setCookies(url, url, c); QString contentType = job->d->response.value("Content-Type"); QString encoding; int idx = contentType.indexOf(QLatin1Char(';')); if (idx > 0) { QString remainder = contentType.mid(idx + 1).toLower(); contentType = contentType.left(idx).trimmed(); idx = remainder.indexOf("charset"); if (idx >= 0) { idx = remainder.indexOf(QLatin1Char('='), idx); if (idx >= 0) encoding = remainder.mid(idx + 1).trimmed(); } } if (contentType.isEmpty()) { // let's try to guess from the extension QString extension = job->d->request.url.path(); int index = extension.lastIndexOf(QLatin1Char('.')); if (index > 0) { extension = extension.mid(index + 1); contentType = MIMETypeRegistry::getMIMETypeForExtension(extension); } } // qDebug() << "Content-Type=" << contentType; // qDebug() << "Encoding=" << encoding; ResourceResponse response(url, contentType, 0 /* FIXME */, encoding, String() /* FIXME */); int statusCode = job->d->response.statusCode(); if (job->url().scheme() != QLatin1String("file")) response.setHTTPStatusCode(statusCode); else if (statusCode == 404) response.setHTTPStatusCode(statusCode); /* Fill in the other fields */ if (statusCode >= 300 && statusCode < 400) { // we're on a redirect page! if the 'Location:' field is valid, we redirect QString location = job->d->response.value("location"); DEBUG() << "Redirection"; if (!location.isEmpty()) { QUrl newUrl = job->d->request.url.resolved(location); if (job->d->resourceHandle) { ResourceRequest newRequest = job->d->resourceHandle->request(); newRequest.setURL(KURL(newUrl)); if (client) client->willSendRequest(job->d->resourceHandle, newRequest, response); } QString method; if (statusCode == 302 || statusCode == 303) { // this is standard-correct for 303 and practically-correct (no standard-correct) for 302 // also, it's required for Yahoo's login process for flickr.com which responds to a POST // with a 302 which must be GET'ed method = "GET"; job->d->request.httpHeader.setContentLength(0); } else method = job->d->request.httpHeader.method(); job->d->request.httpHeader.setRequest(method, newUrl.toString(QUrl::RemoveScheme|QUrl::RemoveAuthority)); job->d->request.setURL(newUrl); job->d->redirected = true; return; } } if (client) client->didReceiveResponse(job->d->resourceHandle, response); } void QWebNetworkManager::data(QWebNetworkJob* job, const QByteArray& data) { Q_ASSERT(job->status() == QWebNetworkJob::JobStarted || job->status() == QWebNetworkJob::JobReceivingData); job->setStatus(QWebNetworkJob::JobReceivingData); ResourceHandleClient* client = 0; if (!job->d->resourceHandle) return; client = job->d->resourceHandle->client(); if (!client) return; if (job->d->redirected) return; // don't emit the "Document has moved here" type of HTML DEBUG() << "receivedData" << job->d->request.url.path(); client->didReceiveData(job->d->resourceHandle, data.constData(), data.length(), data.length() /*FixMe*/); } void QWebNetworkManager::finished(QWebNetworkJob* job, int errorCode) { Q_ASSERT(errorCode == 1 || job->status() == QWebNetworkJob::JobStarted || job->status() == QWebNetworkJob::JobReceivingData); if (m_synchronousJobs.contains(job)) m_synchronousJobs.remove(job); job->setStatus(QWebNetworkJob::JobFinished); ResourceHandleClient* client = 0; if (job->d->resourceHandle) { client = job->d->resourceHandle->client(); if (!client) return; } else { job->deref(); return; } DEBUG() << "receivedFinished" << errorCode << job->url(); if (job->d->redirected) { job->d->redirected = false; job->setStatus(QWebNetworkJob::JobRecreated); job->d->interface->addJob(job); return; } if (job->d->resourceHandle) job->d->resourceHandle->getInternal()->m_job = 0; if (client) { if (errorCode) { //FIXME: error setting error was removed from ResourceHandle client->didFail(job->d->resourceHandle, ResourceError(job->d->request.url.host(), job->d->response.statusCode(), job->d->request.url.toString(), job->d->errorString)); } else client->didFinishLoading(job->d->resourceHandle); } DEBUG() << "receivedFinished done" << job->d->request.url; job->deref(); } void QWebNetworkManager::addHttpJob(QWebNetworkJob* job) { HostInfo hostInfo(job->url()); WebCoreHttp *httpConnection = m_hostMapping.value(hostInfo); if (!httpConnection) { // #### fix custom ports DEBUG() << " new connection to" << hostInfo.host << hostInfo.port; httpConnection = new WebCoreHttp(this, hostInfo); QObject::connect(httpConnection, SIGNAL(connectionClosed(const WebCore::HostInfo&)), this, SLOT(httpConnectionClosed(const WebCore::HostInfo&))); m_hostMapping[hostInfo] = httpConnection; } httpConnection->request(job); } void QWebNetworkManager::cancelHttpJob(QWebNetworkJob* job) { WebCoreHttp *httpConnection = m_hostMapping.value(job->url()); if (httpConnection) httpConnection->cancel(job); } void QWebNetworkManager::httpConnectionClosed(const WebCore::HostInfo& info) { WebCoreHttp *connection = m_hostMapping.take(info); connection->deleteLater(); } void QWebNetworkInterfacePrivate::sendFileData(QWebNetworkJob* job, int statusCode, const QByteArray& data) { int error = statusCode >= 400 ? 1 : 0; if (!job->cancelled()) { QHttpResponseHeader response; response.setStatusLine(statusCode); response.setContentLength(data.length()); job->setResponse(response); q->started(job); if (!data.isEmpty()) q->data(job, data); } q->finished(job, error); } void QWebNetworkInterfacePrivate::parseDataUrl(QWebNetworkJob* job) { QByteArray data = job->url().toString().toLatin1(); //qDebug() << "handling data url:" << data; ASSERT(data.startsWith("data:")); // Here's the syntax of data URLs: // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data // mediatype := [ type "/" subtype ] *( ";" parameter ) // data := *urlchar // parameter := attribute "=" value QByteArray header; bool base64 = false; int index = data.indexOf(','); if (index != -1) { header = data.mid(5, index - 5).toLower(); //qDebug() << "header=" << header; data = data.mid(index+1); //qDebug() << "data=" << data; if (header.endsWith(";base64")) { //qDebug() << "base64"; base64 = true; header = header.left(header.length() - 7); //qDebug() << "mime=" << header; } } else data = QByteArray(); if (base64) data = QByteArray::fromBase64(data); else data = decodePercentEncoding(data); if (header.isEmpty()) header = "text/plain;charset=US-ASCII"; int statusCode = 200; QHttpResponseHeader response; response.setContentType(header); response.setContentLength(data.size()); job->setResponse(response); int error = statusCode >= 400 ? 1 : 0; q->started(job); if (!data.isEmpty()) q->data(job, data); q->finished(job, error); } void QWebNetworkManager::queueStart(QWebNetworkJob* job) { Q_ASSERT(job->d); QMutexLocker locker(&m_queueMutex); job->ref(); m_pendingWork.append(new JobWork(job)); doScheduleWork(); } void QWebNetworkManager::queueData(QWebNetworkJob* job, const QByteArray& data) { ASSERT(job->d); QMutexLocker locker(&m_queueMutex); job->ref(); m_pendingWork.append(new JobWork(job, data)); doScheduleWork(); } void QWebNetworkManager::queueFinished(QWebNetworkJob* job, int errorCode) { Q_ASSERT(job->d); QMutexLocker locker(&m_queueMutex); job->ref(); m_pendingWork.append(new JobWork(job, errorCode)); doScheduleWork(); } void QWebNetworkManager::doScheduleWork() { if (!m_scheduledWork) { m_scheduledWork = true; emit scheduleWork(); } } /* * We will work on a copy of m_pendingWork. While dispatching m_pendingWork * new work will be added that will be handled at a later doWork call. doWork * will be called we set m_scheduledWork to false early in this method. */ void QWebNetworkManager::doWork() { m_queueMutex.lock(); m_scheduledWork = false; bool hasSyncJobs = m_synchronousJobs.size(); const QHash syncJobs = m_synchronousJobs; m_queueMutex.unlock(); foreach (JobWork* work, m_pendingWork) { if (hasSyncJobs && !syncJobs.contains(work->job)) continue; if (work->workType == JobWork::JobStarted) started(work->job); else if (work->workType == JobWork::JobData) { // This job was not yet started if (static_cast(work->job->status()) < QWebNetworkJob::JobStarted) continue; data(work->job, work->data); } else if (work->workType == JobWork::JobFinished) { // This job was not yet started... we have no idea if data comes by... // and it won't start in case of errors if (static_cast(work->job->status()) < QWebNetworkJob::JobStarted && work->errorCode != 1) continue; finished(work->job, work->errorCode); } m_queueMutex.lock(); m_pendingWork.removeAll(work); m_queueMutex.unlock(); work->job->deref(); delete work; } m_queueMutex.lock(); if (hasSyncJobs && !m_synchronousJobs.size()) doScheduleWork(); m_queueMutex.unlock(); } /*! \class QWebNetworkInterface \internal The QWebNetworkInterface class provides an abstraction layer for WebKit's network interface. It allows to completely replace or extend the builtin network layer. QWebNetworkInterface contains two virtual methods, addJob and cancelJob that have to be reimplemented when implementing your own networking layer. QWebNetworkInterface can by default handle the http, https, file and data URI protocols. */ static bool gRoutineAdded = false; static void gCleanupInterface() { delete s_default_interface; s_default_interface = 0; } /*! \internal Sets a new default interface that will be used by all of WebKit for downloading data from the internet. */ void QWebNetworkInterface::setDefaultInterface(QWebNetworkInterface* defaultInterface) { if (s_default_interface == defaultInterface) return; if (s_default_interface) delete s_default_interface; s_default_interface = defaultInterface; if (!gRoutineAdded) { qAddPostRoutine(gCleanupInterface); gRoutineAdded = true; } } /*! \internal Returns the default interface that will be used by WebKit. If no default interface has been set, QtWebkit will create an instance of QWebNetworkInterface to do the work. */ QWebNetworkInterface *QWebNetworkInterface::defaultInterface() { if (!s_default_interface) setDefaultInterface(new QWebNetworkInterface); return s_default_interface; } /*! \internal Constructs a QWebNetworkInterface object. */ QWebNetworkInterface::QWebNetworkInterface(QObject* parent) : QObject(parent) { d = new QWebNetworkInterfacePrivate; d->q = this; if (!s_manager) s_manager = new QWebNetworkManager; } /*! \internal Destructs the QWebNetworkInterface object. */ QWebNetworkInterface::~QWebNetworkInterface() { delete d; } /*! \internal This virtual method gets called whenever QtWebkit needs to add a new job to download. The QWebNetworkInterface should process this job, by first emitting the started signal, then emitting data repeatedly as new data for the Job is available, and finally ending the job with emitting a finished signal. After the finished signal has been emitted, the QWebNetworkInterface is not allowed to access the job anymore. */ void QWebNetworkInterface::addJob(QWebNetworkJob* job) { QString protocol = job->url().scheme(); if (protocol == QLatin1String("http") || protocol == QLatin1String("https")) { QWebNetworkManager::self()->addHttpJob(job); return; } // "file", "data" and all unhandled stuff go through here //DEBUG() << "fileRequest"; DEBUG() << "FileLoader::request" << job->url(); if (job->cancelled()) { d->sendFileData(job, 400, QByteArray()); return; } QUrl url = job->url(); if (protocol == QLatin1String("data")) { d->parseDataUrl(job); return; } int statusCode = 200; QByteArray data; QString path = url.path(); if (protocol == QLatin1String("qrc")) { protocol = "file"; path.prepend(QLatin1Char(':')); } if (!(protocol.isEmpty() || protocol == QLatin1String("file"))) { statusCode = 404; } else { // we simply ignore post data here. QFile f(path); DEBUG() << "opening" << QString(url.path()); if (f.open(QIODevice::ReadOnly)) { QHttpResponseHeader response; response.setStatusLine(200); job->setResponse(response); data = f.readAll(); } else statusCode = 404; } if (statusCode == 404) { QHttpResponseHeader response; response.setStatusLine(404); job->setResponse(response); } d->sendFileData(job, statusCode, data); } /*! \internal This virtual method gets called whenever QtWebkit needs to cancel a new job. The QWebNetworkInterface acknowledge the canceling of the job, by emitting the finished signal with an error code of 1. After emitting the finished signal, the interface should not access the job anymore. */ void QWebNetworkInterface::cancelJob(QWebNetworkJob* job) { QString protocol = job->url().scheme(); if (protocol == QLatin1String("http") || protocol == QLatin1String("https")) QWebNetworkManager::self()->cancelHttpJob(job); } /*! \internal */ void QWebNetworkInterface::started(QWebNetworkJob* job) { Q_ASSERT(s_manager); s_manager->queueStart(job); } /*! \internal */ void QWebNetworkInterface::data(QWebNetworkJob* job, const QByteArray& data) { Q_ASSERT(s_manager); s_manager->queueData(job, data); } /*! \internal */ void QWebNetworkInterface::finished(QWebNetworkJob* job, int errorCode) { Q_ASSERT(s_manager); s_manager->queueFinished(job, errorCode); } /*! \fn void QWebNetworkInterface::sslErrors(QWebFrame *frame, const QUrl& url, const QList& errors, bool *continueAnyway); \internal Signal is emitted when an SSL error occurs. */ /*! \fn void QWebNetworkInterface::authenticate(QWebFrame *frame, const QUrl& url, const QString& hostname, quint16 port, QAuthenticator *auth); \internal Signal is emitted when network authentication is required. */ /*! \fn void QWebNetworkInterface::authenticateProxy(QWebFrame *frame, const QUrl& url, const QNetworkProxy& proxy, QAuthenticator *auth); \internal Signal is emitted when proxy authentication is required. */ ///////////////////////////////////////////////////////////////////////////// WebCoreHttp::WebCoreHttp(QObject* parent, const HostInfo& hi) : QObject(parent) , info(hi) , m_inCancel(false) { for (int i = 0; i < 2; ++i) { connection[i].http = new QHttp(info.host, (hi.protocol == QLatin1String("https")) ? QHttp::ConnectionModeHttps : QHttp::ConnectionModeHttp, info.port); connect(connection[i].http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader&)), this, SLOT(onResponseHeaderReceived(const QHttpResponseHeader&))); connect(connection[i].http, SIGNAL(readyRead(const QHttpResponseHeader&)), this, SLOT(onReadyRead())); connect(connection[i].http, SIGNAL(requestFinished(int, bool)), this, SLOT(onRequestFinished(int, bool))); connect(connection[i].http, SIGNAL(done(bool)), this, SLOT(onDone(bool))); connect(connection[i].http, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int))); connect(connection[i].http, SIGNAL(authenticationRequired(const QString&, quint16, QAuthenticator*)), this, SLOT(onAuthenticationRequired(const QString&, quint16, QAuthenticator*))); connect(connection[i].http, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)), this, SLOT(onProxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*))); connect(connection[i].http, SIGNAL(sslErrors(const QList&)), this, SLOT(onSslErrors(const QList&))); } } WebCoreHttp::~WebCoreHttp() { connection[0].http->deleteLater(); connection[1].http->deleteLater(); } void WebCoreHttp::request(QWebNetworkJob* job) { m_pendingRequests.append(job); scheduleNextRequest(); } void WebCoreHttp::scheduleNextRequest() { int c = 0; for (; c < 2; ++c) { if (!connection[c].current) break; } if (c >= 2) return; QWebNetworkJob *job = 0; while (!job && !m_pendingRequests.isEmpty()) { job = m_pendingRequests.takeFirst(); if (job->cancelled()) { job->networkInterface()->finished(job, 1); job = 0; } } if (!job) return; QHttp* http = connection[c].http; connection[c].current = job; connection[c].id = -1; #ifndef QT_NO_NETWORKPROXY int proxyId = http->setProxy(job->frame()->page()->networkProxy()); #endif QByteArray postData = job->postData(); if (!postData.isEmpty()) connection[c].id = http->request(job->httpHeader(), postData); else connection[c].id = http->request(job->httpHeader()); DEBUG() << "WebCoreHttp::scheduleNextRequest: using connection" << c; DEBUG() << job->httpHeader().toString(); // DEBUG() << job->request.toString(); } int WebCoreHttp::getConnection() { QObject* o = sender(); int c; if (o == connection[0].http) { c = 0; } else { Q_ASSERT(o == connection[1].http); c = 1; } Q_ASSERT(connection[c].current); return c; } void WebCoreHttp::onResponseHeaderReceived(const QHttpResponseHeader& resp) { QHttp* http = qobject_cast(sender()); if (!http->currentId()) { qDebug() << "ERROR! Invalid job id. Why?"; // foxnews.com triggers this return; } int c = getConnection(); QWebNetworkJob* job = connection[c].current; DEBUG() << "WebCoreHttp::slotResponseHeaderReceived connection=" << c; DEBUG() << resp.toString(); job->setResponse(resp); job->networkInterface()->started(job); } void WebCoreHttp::onReadyRead() { QHttp* http = qobject_cast(sender()); if (!http->currentId()) { qDebug() << "ERROR! Invalid job id. Why?"; // foxnews.com triggers this return; } int c = getConnection(); QWebNetworkJob* job = connection[c].current; Q_ASSERT(http == connection[c].http); //DEBUG() << "WebCoreHttp::slotReadyRead connection=" << c; QByteArray data; data.resize(http->bytesAvailable()); http->read(data.data(), data.length()); job->networkInterface()->data(job, data); } void WebCoreHttp::onRequestFinished(int id, bool error) { int c = getConnection(); if (connection[c].id != id) return; QWebNetworkJob* job = connection[c].current; if (!job) { scheduleNextRequest(); return; } QHttp* http = connection[c].http; DEBUG() << "WebCoreHttp::slotFinished connection=" << c << error << job; if (error) { DEBUG() << " error: " << http->errorString(); job->setErrorString(http->errorString()); } if (!error && http->bytesAvailable()) { QByteArray data; data.resize(http->bytesAvailable()); http->read(data.data(), data.length()); job->networkInterface()->data(job, data); } job->networkInterface()->finished(job, error ? 1 : 0); connection[c].current = 0; connection[c].id = -1; scheduleNextRequest(); } void WebCoreHttp::onDone(bool error) { DEBUG() << "WebCoreHttp::onDone" << error; } void WebCoreHttp::onStateChanged(int state) { DEBUG() << "State changed to" << state << "and connections are" << connection[0].current << connection[1].current; if (state == QHttp::Closing || state == QHttp::Unconnected) { if (!m_inCancel && m_pendingRequests.isEmpty() && !connection[0].current && !connection[1].current) emit connectionClosed(info); } } void WebCoreHttp::cancel(QWebNetworkJob* request) { bool doEmit = true; m_inCancel = true; for (int i = 0; i < 2; ++i) { if (request == connection[i].current) { connection[i].http->abort(); doEmit = false; } } if (!m_pendingRequests.removeAll(request)) doEmit = false; m_inCancel = false; if (doEmit) request->networkInterface()->finished(request, 1); if (m_pendingRequests.isEmpty() && !connection[0].current && !connection[1].current) emit connectionClosed(info); } void WebCoreHttp::onSslErrors(const QList& errors) { int c = getConnection(); QWebNetworkJob *job = connection[c].current; if (job) { bool continueAnyway = false; emit job->networkInterface()->sslErrors(job->frame(), job->url(), errors, &continueAnyway); #ifndef QT_NO_OPENSSL if (continueAnyway) connection[c].http->ignoreSslErrors(); #endif } } void WebCoreHttp::onAuthenticationRequired(const QString& hostname, quint16 port, QAuthenticator* auth) { int c = getConnection(); QWebNetworkJob *job = connection[c].current; if (job) { emit job->networkInterface()->authenticate(job->frame(), job->url(), hostname, port, auth); if (auth->isNull()) connection[c].http->abort(); } } void WebCoreHttp::onProxyAuthenticationRequired(const QNetworkProxy& proxy, QAuthenticator* auth) { int c = getConnection(); QWebNetworkJob *job = connection[c].current; if (job) { emit job->networkInterface()->authenticateProxy(job->frame(), job->url(), proxy, auth); if (auth->isNull()) connection[c].http->abort(); } } HostInfo::HostInfo(const QUrl& url) : protocol(url.scheme()) , host(url.host()) , port(url.port()) { if (port < 0) { if (protocol == QLatin1String("http")) port = 80; else if (protocol == QLatin1String("https")) port = 443; } } #endif WebKit/qt/Api/qwebpage.cpp0000644000175000017500000033532011261767507014015 0ustar leelee/* Copyright (C) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies) Copyright (C) 2007 Staikos Computing Services Inc. Copyright (C) 2007 Apple 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "qwebpage.h" #include "qwebview.h" #include "qwebframe.h" #include "qwebpage_p.h" #include "qwebframe_p.h" #include "qwebhistory.h" #include "qwebhistory_p.h" #include "qwebinspector.h" #include "qwebinspector_p.h" #include "qwebsettings.h" #include "qwebkitversion.h" #include "Frame.h" #include "FrameTree.h" #include "FrameLoader.h" #include "FrameLoaderClientQt.h" #include "FrameView.h" #include "FormState.h" #include "ApplicationCacheStorage.h" #include "ChromeClientQt.h" #include "ContextMenu.h" #include "ContextMenuClientQt.h" #include "DocumentLoader.h" #include "DragClientQt.h" #include "DragController.h" #include "DragData.h" #include "EditorClientQt.h" #include "SecurityOrigin.h" #include "Settings.h" #include "Page.h" #include "Pasteboard.h" #include "FrameLoader.h" #include "FrameLoadRequest.h" #include "KURL.h" #include "Logging.h" #include "Image.h" #include "InspectorClientQt.h" #include "InspectorController.h" #include "FocusController.h" #include "Editor.h" #include "Scrollbar.h" #include "PlatformKeyboardEvent.h" #include "PlatformWheelEvent.h" #include "PluginDatabase.h" #include "ProgressTracker.h" #include "RefPtr.h" #include "RenderTextControl.h" #include "TextIterator.h" #include "HashMap.h" #include "HTMLFormElement.h" #include "HTMLInputElement.h" #include "HTMLNames.h" #include "HitTestResult.h" #include "WindowFeatures.h" #include "LocalizedStrings.h" #include "Cache.h" #include "runtime/InitializeThreading.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if QT_VERSION >= 0x040400 #include #include #else #include "qwebnetworkinterface.h" #endif using namespace WebCore; void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories() { PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false); Vector paths; String qtPath(qgetenv("QTWEBKIT_PLUGIN_PATH").data()); qtPath.split(UChar(':'), /* allowEmptyEntries */ false, paths); db->setPluginDirectories(paths); db->refresh(); } bool QWebPagePrivate::drtRun = false; void QWEBKIT_EXPORT qt_drt_run(bool b) { QWebPagePrivate::drtRun = b; } void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName) { page->handle()->page->setGroupName(groupName); } QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page) { return page->handle()->page->groupName(); } // Lookup table mapping QWebPage::WebActions to the associated Editor commands static const char* editorCommandWebActions[] = { 0, // OpenLink, 0, // OpenLinkInNewWindow, 0, // OpenFrameInNewWindow, 0, // DownloadLinkToDisk, 0, // CopyLinkToClipboard, 0, // OpenImageInNewWindow, 0, // DownloadImageToDisk, 0, // CopyImageToClipboard, 0, // Back, 0, // Forward, 0, // Stop, 0, // Reload, "Cut", // Cut, "Copy", // Copy, "Paste", // Paste, "Undo", // Undo, "Redo", // Redo, "MoveForward", // MoveToNextChar, "MoveBackward", // MoveToPreviousChar, "MoveWordForward", // MoveToNextWord, "MoveWordBackward", // MoveToPreviousWord, "MoveDown", // MoveToNextLine, "MoveUp", // MoveToPreviousLine, "MoveToBeginningOfLine", // MoveToStartOfLine, "MoveToEndOfLine", // MoveToEndOfLine, "MoveToBeginningOfParagraph", // MoveToStartOfBlock, "MoveToEndOfParagraph", // MoveToEndOfBlock, "MoveToBeginningOfDocument", // MoveToStartOfDocument, "MoveToEndOfDocument", // MoveToEndOfDocument, "MoveForwardAndModifySelection", // SelectNextChar, "MoveBackwardAndModifySelection", // SelectPreviousChar, "MoveWordForwardAndModifySelection", // SelectNextWord, "MoveWordBackwardAndModifySelection", // SelectPreviousWord, "MoveDownAndModifySelection", // SelectNextLine, "MoveUpAndModifySelection", // SelectPreviousLine, "MoveToBeginningOfLineAndModifySelection", // SelectStartOfLine, "MoveToEndOfLineAndModifySelection", // SelectEndOfLine, "MoveToBeginningOfParagraphAndModifySelection", // SelectStartOfBlock, "MoveToEndOfParagraphAndModifySelection", // SelectEndOfBlock, "MoveToBeginningOfDocumentAndModifySelection", //SelectStartOfDocument, "MoveToEndOfDocumentAndModifySelection", // SelectEndOfDocument, "DeleteWordBackward", // DeleteStartOfWord, "DeleteWordForward", // DeleteEndOfWord, 0, // SetTextDirectionDefault, 0, // SetTextDirectionLeftToRight, 0, // SetTextDirectionRightToLeft, "ToggleBold", // ToggleBold, "ToggleItalic", // ToggleItalic, "ToggleUnderline", // ToggleUnderline, 0, // InspectElement, "InsertNewline", // InsertParagraphSeparator "InsertLineBreak", // InsertLineSeparator "SelectAll", // SelectAll 0, // ReloadAndBypassCache, "PasteAndMatchStyle", // PasteAndMatchStyle "RemoveFormat", // RemoveFormat "Strikethrough", // ToggleStrikethrough, "Subscript", // ToggleSubscript "Superscript", // ToggleSuperscript "InsertUnorderedList", // InsertUnorderedList "InsertOrderedList", // InsertOrderedList "Indent", // Indent "Outdent", // Outdent, "AlignCenter", // AlignCenter, "AlignJustified", // AlignJustified, "AlignLeft", // AlignLeft, "AlignRight", // AlignRight, 0 // WebActionCount }; // Lookup the appropriate editor command to use for WebAction \a action const char* QWebPagePrivate::editorCommandForWebActions(QWebPage::WebAction action) { if ((action > QWebPage::NoWebAction) && (action < int(sizeof(editorCommandWebActions) / sizeof(const char*)))) return editorCommandWebActions[action]; return 0; } // If you change this make sure to also adjust the docs for QWebPage::userAgentForUrl #define WEBKIT_VERSION "527+" static inline DragOperation dropActionToDragOp(Qt::DropActions actions) { unsigned result = 0; if (actions & Qt::CopyAction) result |= DragOperationCopy; if (actions & Qt::MoveAction) result |= DragOperationMove; if (actions & Qt::LinkAction) result |= DragOperationLink; return (DragOperation)result; } static inline Qt::DropAction dragOpToDropAction(unsigned actions) { Qt::DropAction result = Qt::IgnoreAction; if (actions & DragOperationCopy) result = Qt::CopyAction; else if (actions & DragOperationMove) result = Qt::MoveAction; else if (actions & DragOperationLink) result = Qt::LinkAction; return result; } QWebPagePrivate::QWebPagePrivate(QWebPage *qq) : q(qq) , client(0) , view(0) , inspectorFrontend(0) , inspector(0) , inspectorIsInternalOnly(false) , viewportSize(QSize(0, 0)) , clickCausedFocus(false) { WebCore::InitializeLoggingChannelsIfNecessary(); JSC::initializeThreading(); WebCore::FrameLoader::setLocalLoadPolicy(WebCore::FrameLoader::AllowLocalLoadsForLocalAndSubstituteData); chromeClient = new ChromeClientQt(q); contextMenuClient = new ContextMenuClientQt(); editorClient = new EditorClientQt(q); page = new Page(chromeClient, contextMenuClient, editorClient, new DragClientQt(q), new InspectorClientQt(q), 0); // ### should be configurable page->settings()->setDefaultTextEncodingName("iso-8859-1"); settings = new QWebSettings(page->settings()); #ifndef QT_NO_UNDOSTACK undoStack = 0; #endif mainFrame = 0; #if QT_VERSION < 0x040400 networkInterface = 0; #else networkManager = 0; #endif pluginFactory = 0; insideOpenCall = false; forwardUnsupportedContent = false; editable = false; useFixedLayout = false; linkPolicy = QWebPage::DontDelegateLinks; #ifndef QT_NO_CONTEXTMENU currentContextMenu = 0; #endif history.d = new QWebHistoryPrivate(page->backForwardList()); memset(actions, 0, sizeof(actions)); } QWebPagePrivate::~QWebPagePrivate() { #ifndef QT_NO_CONTEXTMENU delete currentContextMenu; #endif #ifndef QT_NO_UNDOSTACK delete undoStack; #endif delete settings; delete page; } #if QT_VERSION < 0x040400 bool QWebPagePrivate::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type) { if (insideOpenCall && frame == mainFrame) return true; return q->acceptNavigationRequest(frame, request, type); } #else bool QWebPagePrivate::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type) { if (insideOpenCall && frame == mainFrame) return true; return q->acceptNavigationRequest(frame, request, type); } #endif void QWebPagePrivate::createMainFrame() { if (!mainFrame) { QWebFrameData frameData(page); mainFrame = new QWebFrame(q, &frameData); emit q->frameCreated(mainFrame); } } static QWebPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuAction action) { switch (action) { case WebCore::ContextMenuItemTagOpenLink: return QWebPage::OpenLink; case WebCore::ContextMenuItemTagOpenLinkInNewWindow: return QWebPage::OpenLinkInNewWindow; case WebCore::ContextMenuItemTagDownloadLinkToDisk: return QWebPage::DownloadLinkToDisk; case WebCore::ContextMenuItemTagCopyLinkToClipboard: return QWebPage::CopyLinkToClipboard; case WebCore::ContextMenuItemTagOpenImageInNewWindow: return QWebPage::OpenImageInNewWindow; case WebCore::ContextMenuItemTagDownloadImageToDisk: return QWebPage::DownloadImageToDisk; case WebCore::ContextMenuItemTagCopyImageToClipboard: return QWebPage::CopyImageToClipboard; case WebCore::ContextMenuItemTagOpenFrameInNewWindow: return QWebPage::OpenFrameInNewWindow; case WebCore::ContextMenuItemTagCopy: return QWebPage::Copy; case WebCore::ContextMenuItemTagGoBack: return QWebPage::Back; case WebCore::ContextMenuItemTagGoForward: return QWebPage::Forward; case WebCore::ContextMenuItemTagStop: return QWebPage::Stop; case WebCore::ContextMenuItemTagReload: return QWebPage::Reload; case WebCore::ContextMenuItemTagCut: return QWebPage::Cut; case WebCore::ContextMenuItemTagPaste: return QWebPage::Paste; case WebCore::ContextMenuItemTagDefaultDirection: return QWebPage::SetTextDirectionDefault; case WebCore::ContextMenuItemTagLeftToRight: return QWebPage::SetTextDirectionLeftToRight; case WebCore::ContextMenuItemTagRightToLeft: return QWebPage::SetTextDirectionRightToLeft; case WebCore::ContextMenuItemTagBold: return QWebPage::ToggleBold; case WebCore::ContextMenuItemTagItalic: return QWebPage::ToggleItalic; case WebCore::ContextMenuItemTagUnderline: return QWebPage::ToggleUnderline; case WebCore::ContextMenuItemTagInspectElement: return QWebPage::InspectElement; default: break; } return QWebPage::NoWebAction; } #ifndef QT_NO_CONTEXTMENU QMenu *QWebPagePrivate::createContextMenu(const WebCore::ContextMenu *webcoreMenu, const QList *items, QBitArray *visitedWebActions) { QMenu* menu = new QMenu(view); for (int i = 0; i < items->count(); ++i) { const ContextMenuItem &item = items->at(i); switch (item.type()) { case WebCore::CheckableActionType: /* fall through */ case WebCore::ActionType: { QWebPage::WebAction action = webActionForContextMenuAction(item.action()); QAction *a = q->action(action); if (a) { ContextMenuItem it(item); webcoreMenu->checkOrEnableIfNeeded(it); PlatformMenuItemDescription desc = it.releasePlatformDescription(); a->setEnabled(desc.enabled); a->setChecked(desc.checked); a->setCheckable(item.type() == WebCore::CheckableActionType); menu->addAction(a); visitedWebActions->setBit(action); } break; } case WebCore::SeparatorType: menu->addSeparator(); break; case WebCore::SubmenuType: { QMenu *subMenu = createContextMenu(webcoreMenu, item.platformSubMenu(), visitedWebActions); bool anyEnabledAction = false; QList actions = subMenu->actions(); for (int i = 0; i < actions.count(); ++i) { if (actions.at(i)->isVisible()) anyEnabledAction |= actions.at(i)->isEnabled(); } // don't show sub-menus with just disabled actions if (anyEnabledAction) { subMenu->setTitle(item.title()); menu->addAction(subMenu->menuAction()); } else delete subMenu; break; } } } return menu; } #endif // QT_NO_CONTEXTMENU void QWebPagePrivate::_q_webActionTriggered(bool checked) { QAction *a = qobject_cast(q->sender()); if (!a) return; QWebPage::WebAction action = static_cast(a->data().toInt()); q->triggerAction(action, checked); } void QWebPagePrivate::_q_cleanupLeakMessages() { #ifndef NDEBUG // Need this to make leak messages accurate. cache()->setCapacities(0, 0, 0); #endif } void QWebPagePrivate::updateAction(QWebPage::WebAction action) { QAction *a = actions[action]; if (!a || !mainFrame) return; WebCore::FrameLoader *loader = mainFrame->d->frame->loader(); WebCore::Editor *editor = page->focusController()->focusedOrMainFrame()->editor(); bool enabled = a->isEnabled(); bool checked = a->isChecked(); switch (action) { case QWebPage::Back: enabled = page->canGoBackOrForward(-1); break; case QWebPage::Forward: enabled = page->canGoBackOrForward(1); break; case QWebPage::Stop: enabled = loader->isLoading(); break; case QWebPage::Reload: case QWebPage::ReloadAndBypassCache: enabled = !loader->isLoading(); break; #ifndef QT_NO_UNDOSTACK case QWebPage::Undo: case QWebPage::Redo: // those two are handled by QUndoStack break; #endif // QT_NO_UNDOSTACK case QWebPage::SelectAll: // editor command is always enabled break; case QWebPage::SetTextDirectionDefault: case QWebPage::SetTextDirectionLeftToRight: case QWebPage::SetTextDirectionRightToLeft: enabled = editor->canEdit(); checked = false; break; default: { // see if it's an editor command const char* commandName = editorCommandForWebActions(action); // if it's an editor command, let it's logic determine state if (commandName) { Editor::Command command = editor->command(commandName); enabled = command.isEnabled(); if (enabled) checked = command.state() != FalseTriState; else checked = false; } break; } } a->setEnabled(enabled); if (a->isCheckable()) a->setChecked(checked); } void QWebPagePrivate::updateNavigationActions() { updateAction(QWebPage::Back); updateAction(QWebPage::Forward); updateAction(QWebPage::Stop); updateAction(QWebPage::Reload); updateAction(QWebPage::ReloadAndBypassCache); } void QWebPagePrivate::updateEditorActions() { updateAction(QWebPage::Cut); updateAction(QWebPage::Copy); updateAction(QWebPage::Paste); updateAction(QWebPage::MoveToNextChar); updateAction(QWebPage::MoveToPreviousChar); updateAction(QWebPage::MoveToNextWord); updateAction(QWebPage::MoveToPreviousWord); updateAction(QWebPage::MoveToNextLine); updateAction(QWebPage::MoveToPreviousLine); updateAction(QWebPage::MoveToStartOfLine); updateAction(QWebPage::MoveToEndOfLine); updateAction(QWebPage::MoveToStartOfBlock); updateAction(QWebPage::MoveToEndOfBlock); updateAction(QWebPage::MoveToStartOfDocument); updateAction(QWebPage::MoveToEndOfDocument); updateAction(QWebPage::SelectNextChar); updateAction(QWebPage::SelectPreviousChar); updateAction(QWebPage::SelectNextWord); updateAction(QWebPage::SelectPreviousWord); updateAction(QWebPage::SelectNextLine); updateAction(QWebPage::SelectPreviousLine); updateAction(QWebPage::SelectStartOfLine); updateAction(QWebPage::SelectEndOfLine); updateAction(QWebPage::SelectStartOfBlock); updateAction(QWebPage::SelectEndOfBlock); updateAction(QWebPage::SelectStartOfDocument); updateAction(QWebPage::SelectEndOfDocument); updateAction(QWebPage::DeleteStartOfWord); updateAction(QWebPage::DeleteEndOfWord); updateAction(QWebPage::SetTextDirectionDefault); updateAction(QWebPage::SetTextDirectionLeftToRight); updateAction(QWebPage::SetTextDirectionRightToLeft); updateAction(QWebPage::ToggleBold); updateAction(QWebPage::ToggleItalic); updateAction(QWebPage::ToggleUnderline); updateAction(QWebPage::InsertParagraphSeparator); updateAction(QWebPage::InsertLineSeparator); updateAction(QWebPage::PasteAndMatchStyle); updateAction(QWebPage::RemoveFormat); updateAction(QWebPage::ToggleStrikethrough); updateAction(QWebPage::ToggleSubscript); updateAction(QWebPage::ToggleSuperscript); updateAction(QWebPage::InsertUnorderedList); updateAction(QWebPage::InsertOrderedList); updateAction(QWebPage::Indent); updateAction(QWebPage::Outdent); updateAction(QWebPage::AlignCenter); updateAction(QWebPage::AlignJustified); updateAction(QWebPage::AlignLeft); updateAction(QWebPage::AlignRight); } void QWebPagePrivate::timerEvent(QTimerEvent *ev) { int timerId = ev->timerId(); if (timerId == tripleClickTimer.timerId()) tripleClickTimer.stop(); else q->QObject::timerEvent(ev); } void QWebPagePrivate::mouseMoveEvent(QGraphicsSceneMouseEvent* ev) { q->setView(ev->widget()); WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); if (!frame->view()) return; bool accepted = frame->eventHandler()->mouseMoved(PlatformMouseEvent(ev, 0)); ev->setAccepted(accepted); } void QWebPagePrivate::mouseMoveEvent(QMouseEvent *ev) { WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); if (!frame->view()) return; bool accepted = frame->eventHandler()->mouseMoved(PlatformMouseEvent(ev, 0)); ev->setAccepted(accepted); } void QWebPagePrivate::mousePressEvent(QGraphicsSceneMouseEvent* ev) { q->setView(ev->widget()); WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); if (!frame->view()) return; if (tripleClickTimer.isActive() && (ev->pos().toPoint() - tripleClick).manhattanLength() < QApplication::startDragDistance()) { mouseTripleClickEvent(ev); return; } bool accepted = false; PlatformMouseEvent mev(ev, 1); // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton if (mev.button() != NoButton) accepted = frame->eventHandler()->handleMousePressEvent(mev); ev->setAccepted(accepted); } void QWebPagePrivate::mousePressEvent(QMouseEvent *ev) { WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); if (!frame->view()) return; RefPtr oldNode; if (page->focusController()->focusedFrame() && page->focusController()->focusedFrame()->document()) oldNode = page->focusController()->focusedFrame()->document()->focusedNode(); if (tripleClickTimer.isActive() && (ev->pos() - tripleClick).manhattanLength() < QApplication::startDragDistance()) { mouseTripleClickEvent(ev); return; } bool accepted = false; PlatformMouseEvent mev(ev, 1); // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton if (mev.button() != NoButton) accepted = frame->eventHandler()->handleMousePressEvent(mev); ev->setAccepted(accepted); RefPtr newNode; if (page->focusController()->focusedFrame() && page->focusController()->focusedFrame()->document()) newNode = page->focusController()->focusedFrame()->document()->focusedNode(); if (newNode && oldNode != newNode) clickCausedFocus = true; } void QWebPagePrivate::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *ev) { q->setView(ev->widget()); WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); if (!frame->view()) return; bool accepted = false; PlatformMouseEvent mev(ev, 2); // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton if (mev.button() != NoButton) accepted = frame->eventHandler()->handleMousePressEvent(mev); ev->setAccepted(accepted); tripleClickTimer.start(QApplication::doubleClickInterval(), q); tripleClick = ev->pos().toPoint(); } void QWebPagePrivate::mouseDoubleClickEvent(QMouseEvent *ev) { WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); if (!frame->view()) return; bool accepted = false; PlatformMouseEvent mev(ev, 2); // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton if (mev.button() != NoButton) accepted = frame->eventHandler()->handleMousePressEvent(mev); ev->setAccepted(accepted); tripleClickTimer.start(QApplication::doubleClickInterval(), q); tripleClick = ev->pos(); } void QWebPagePrivate::mouseTripleClickEvent(QGraphicsSceneMouseEvent *ev) { WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); if (!frame->view()) return; bool accepted = false; PlatformMouseEvent mev(ev, 3); // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton if (mev.button() != NoButton) accepted = frame->eventHandler()->handleMousePressEvent(mev); ev->setAccepted(accepted); } void QWebPagePrivate::mouseTripleClickEvent(QMouseEvent *ev) { WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); if (!frame->view()) return; bool accepted = false; PlatformMouseEvent mev(ev, 3); // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton if (mev.button() != NoButton) accepted = frame->eventHandler()->handleMousePressEvent(mev); ev->setAccepted(accepted); } void QWebPagePrivate::handleClipboard(QEvent* ev, Qt::MouseButton button) { #ifndef QT_NO_CLIPBOARD if (QApplication::clipboard()->supportsSelection()) { bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode(); Pasteboard::generalPasteboard()->setSelectionMode(true); WebCore::Frame* focusFrame = page->focusController()->focusedOrMainFrame(); if (button == Qt::LeftButton) { if (focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) { focusFrame->editor()->copy(); ev->setAccepted(true); } } else if (button == Qt::MidButton) { if (focusFrame && (focusFrame->editor()->canPaste() || focusFrame->editor()->canDHTMLPaste())) { focusFrame->editor()->paste(); ev->setAccepted(true); } } Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode); } #endif } void QWebPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev) { q->setView(ev->widget()); WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); if (!frame->view()) return; bool accepted = false; PlatformMouseEvent mev(ev, 0); // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton if (mev.button() != NoButton) accepted = frame->eventHandler()->handleMouseReleaseEvent(mev); ev->setAccepted(accepted); handleClipboard(ev, ev->button()); handleSoftwareInputPanel(ev->button()); } void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button) { #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) if (view && view->testAttribute(Qt::WA_InputMethodEnabled) && button == Qt::LeftButton && qApp->autoSipEnabled()) { QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel( view->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel)); if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) { QEvent event(QEvent::RequestSoftwareInputPanel); QApplication::sendEvent(view, &event); } } clickCausedFocus = false; #endif } void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev) { WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); if (!frame->view()) return; bool accepted = false; PlatformMouseEvent mev(ev, 0); // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton if (mev.button() != NoButton) accepted = frame->eventHandler()->handleMouseReleaseEvent(mev); ev->setAccepted(accepted); handleClipboard(ev, ev->button()); handleSoftwareInputPanel(ev->button()); } #ifndef QT_NO_CONTEXTMENU void QWebPagePrivate::contextMenuEvent(const QPoint& globalPos) { QMenu *menu = q->createStandardContextMenu(); if (menu) { menu->exec(globalPos); delete menu; } } #endif // QT_NO_CONTEXTMENU /*! \since 4.5 This function creates the standard context menu which is shown when the user clicks on the web page with the right mouse button. It is called from the default contextMenuEvent() handler. The popup menu's ownership is transferred to the caller. */ QMenu *QWebPage::createStandardContextMenu() { #ifndef QT_NO_CONTEXTMENU QMenu *menu = d->currentContextMenu; d->currentContextMenu = 0; return menu; #else return 0; #endif } #ifndef QT_NO_WHEELEVENT void QWebPagePrivate::wheelEvent(QGraphicsSceneWheelEvent* ev) { q->setView(ev->widget()); WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); if (!frame->view()) return; WebCore::PlatformWheelEvent pev(ev); bool accepted = frame->eventHandler()->handleWheelEvent(pev); ev->setAccepted(accepted); } void QWebPagePrivate::wheelEvent(QWheelEvent *ev) { WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); if (!frame->view()) return; WebCore::PlatformWheelEvent pev(ev); bool accepted = frame->eventHandler()->handleWheelEvent(pev); ev->setAccepted(accepted); } #endif // QT_NO_WHEELEVENT #ifndef QT_NO_SHORTCUT QWebPage::WebAction QWebPagePrivate::editorActionForKeyEvent(QKeyEvent* event) { static struct { QKeySequence::StandardKey standardKey; QWebPage::WebAction action; } editorActions[] = { { QKeySequence::Cut, QWebPage::Cut }, { QKeySequence::Copy, QWebPage::Copy }, { QKeySequence::Paste, QWebPage::Paste }, { QKeySequence::Undo, QWebPage::Undo }, { QKeySequence::Redo, QWebPage::Redo }, { QKeySequence::MoveToNextChar, QWebPage::MoveToNextChar }, { QKeySequence::MoveToPreviousChar, QWebPage::MoveToPreviousChar }, { QKeySequence::MoveToNextWord, QWebPage::MoveToNextWord }, { QKeySequence::MoveToPreviousWord, QWebPage::MoveToPreviousWord }, { QKeySequence::MoveToNextLine, QWebPage::MoveToNextLine }, { QKeySequence::MoveToPreviousLine, QWebPage::MoveToPreviousLine }, { QKeySequence::MoveToStartOfLine, QWebPage::MoveToStartOfLine }, { QKeySequence::MoveToEndOfLine, QWebPage::MoveToEndOfLine }, { QKeySequence::MoveToStartOfBlock, QWebPage::MoveToStartOfBlock }, { QKeySequence::MoveToEndOfBlock, QWebPage::MoveToEndOfBlock }, { QKeySequence::MoveToStartOfDocument, QWebPage::MoveToStartOfDocument }, { QKeySequence::MoveToEndOfDocument, QWebPage::MoveToEndOfDocument }, { QKeySequence::SelectNextChar, QWebPage::SelectNextChar }, { QKeySequence::SelectPreviousChar, QWebPage::SelectPreviousChar }, { QKeySequence::SelectNextWord, QWebPage::SelectNextWord }, { QKeySequence::SelectPreviousWord, QWebPage::SelectPreviousWord }, { QKeySequence::SelectNextLine, QWebPage::SelectNextLine }, { QKeySequence::SelectPreviousLine, QWebPage::SelectPreviousLine }, { QKeySequence::SelectStartOfLine, QWebPage::SelectStartOfLine }, { QKeySequence::SelectEndOfLine, QWebPage::SelectEndOfLine }, { QKeySequence::SelectStartOfBlock, QWebPage::SelectStartOfBlock }, { QKeySequence::SelectEndOfBlock, QWebPage::SelectEndOfBlock }, { QKeySequence::SelectStartOfDocument, QWebPage::SelectStartOfDocument }, { QKeySequence::SelectEndOfDocument, QWebPage::SelectEndOfDocument }, { QKeySequence::DeleteStartOfWord, QWebPage::DeleteStartOfWord }, { QKeySequence::DeleteEndOfWord, QWebPage::DeleteEndOfWord }, #if QT_VERSION >= 0x040500 { QKeySequence::InsertParagraphSeparator, QWebPage::InsertParagraphSeparator }, { QKeySequence::InsertLineSeparator, QWebPage::InsertLineSeparator }, #endif { QKeySequence::SelectAll, QWebPage::SelectAll }, { QKeySequence::UnknownKey, QWebPage::NoWebAction } }; for (int i = 0; editorActions[i].standardKey != QKeySequence::UnknownKey; ++i) if (event == editorActions[i].standardKey) return editorActions[i].action; return QWebPage::NoWebAction; } #endif // QT_NO_SHORTCUT void QWebPagePrivate::keyPressEvent(QKeyEvent *ev) { bool handled = false; WebCore::Frame* frame = page->focusController()->focusedOrMainFrame(); // we forward the key event to WebCore first to handle potential DOM // defined event handlers and later on end up in EditorClientQt::handleKeyboardEvent // to trigger editor commands via triggerAction(). if (!handled) handled = frame->eventHandler()->keyEvent(ev); if (!handled) { handled = true; QFont defaultFont; if (view) defaultFont = view->font(); QFontMetrics fm(defaultFont); if (!handleScrolling(ev, frame)) { switch (ev->key()) { case Qt::Key_Back: q->triggerAction(QWebPage::Back); break; case Qt::Key_Forward: q->triggerAction(QWebPage::Forward); break; case Qt::Key_Stop: q->triggerAction(QWebPage::Stop); break; case Qt::Key_Refresh: q->triggerAction(QWebPage::Reload); break; case Qt::Key_Backspace: if (ev->modifiers() == Qt::ShiftModifier) q->triggerAction(QWebPage::Forward); else q->triggerAction(QWebPage::Back); break; default: handled = false; break; } } } ev->setAccepted(handled); } void QWebPagePrivate::keyReleaseEvent(QKeyEvent *ev) { if (ev->isAutoRepeat()) { ev->setAccepted(true); return; } WebCore::Frame* frame = page->focusController()->focusedOrMainFrame(); bool handled = frame->eventHandler()->keyEvent(ev); ev->setAccepted(handled); } void QWebPagePrivate::focusInEvent(QFocusEvent*) { FocusController *focusController = page->focusController(); Frame *frame = focusController->focusedFrame(); focusController->setActive(true); if (frame) focusController->setFocused(true); else focusController->setFocusedFrame(QWebFramePrivate::core(mainFrame)); } void QWebPagePrivate::focusOutEvent(QFocusEvent*) { // only set the focused frame inactive so that we stop painting the caret // and the focus frame. But don't tell the focus controller so that upon // focusInEvent() we can re-activate the frame. FocusController *focusController = page->focusController(); focusController->setActive(false); focusController->setFocused(false); } void QWebPagePrivate::dragEnterEvent(QGraphicsSceneDragDropEvent* ev) { q->setView(ev->widget()); #ifndef QT_NO_DRAGANDDROP DragData dragData(ev->mimeData(), ev->pos().toPoint(), QCursor::pos(), dropActionToDragOp(ev->possibleActions())); Qt::DropAction action = dragOpToDropAction(page->dragController()->dragEntered(&dragData)); ev->setDropAction(action); if (action != Qt::IgnoreAction) ev->accept(); #endif } void QWebPagePrivate::dragEnterEvent(QDragEnterEvent* ev) { #ifndef QT_NO_DRAGANDDROP DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(), dropActionToDragOp(ev->possibleActions())); Qt::DropAction action = dragOpToDropAction(page->dragController()->dragEntered(&dragData)); ev->setDropAction(action); if (action != Qt::IgnoreAction) ev->accept(); #endif } void QWebPagePrivate::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev) { q->setView(ev->widget()); #ifndef QT_NO_DRAGANDDROP DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone); page->dragController()->dragExited(&dragData); ev->accept(); #endif } void QWebPagePrivate::dragLeaveEvent(QDragLeaveEvent* ev) { #ifndef QT_NO_DRAGANDDROP DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone); page->dragController()->dragExited(&dragData); ev->accept(); #endif } void QWebPagePrivate::dragMoveEvent(QGraphicsSceneDragDropEvent* ev) { q->setView(ev->widget()); #ifndef QT_NO_DRAGANDDROP DragData dragData(ev->mimeData(), ev->pos().toPoint(), QCursor::pos(), dropActionToDragOp(ev->possibleActions())); Qt::DropAction action = dragOpToDropAction(page->dragController()->dragUpdated(&dragData)); ev->setDropAction(action); if (action != Qt::IgnoreAction) ev->accept(); #endif } void QWebPagePrivate::dragMoveEvent(QDragMoveEvent* ev) { #ifndef QT_NO_DRAGANDDROP DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(), dropActionToDragOp(ev->possibleActions())); Qt::DropAction action = dragOpToDropAction(page->dragController()->dragUpdated(&dragData)); ev->setDropAction(action); if (action != Qt::IgnoreAction) ev->accept(); #endif } void QWebPagePrivate::dropEvent(QGraphicsSceneDragDropEvent* ev) { #ifndef QT_NO_DRAGANDDROP DragData dragData(ev->mimeData(), ev->pos().toPoint(), QCursor::pos(), dropActionToDragOp(ev->possibleActions())); Qt::DropAction action = dragOpToDropAction(page->dragController()->performDrag(&dragData)); if (action != Qt::IgnoreAction) ev->accept(); #endif } void QWebPagePrivate::dropEvent(QDropEvent* ev) { #ifndef QT_NO_DRAGANDDROP DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(), dropActionToDragOp(ev->possibleActions())); Qt::DropAction action = dragOpToDropAction(page->dragController()->performDrag(&dragData)); if (action != Qt::IgnoreAction) ev->accept(); #endif } void QWebPagePrivate::leaveEvent(QEvent*) { // Fake a mouse move event just outside of the widget, since all // the interesting mouse-out behavior like invalidating scrollbars // is handled by the WebKit event handler's mouseMoved function. QMouseEvent fakeEvent(QEvent::MouseMove, QCursor::pos(), Qt::NoButton, Qt::NoButton, Qt::NoModifier); mouseMoveEvent(&fakeEvent); } /*! \property QWebPage::palette \brief the page's palette The base brush of the palette is used to draw the background of the main frame. By default, this property contains the application's default palette. */ void QWebPage::setPalette(const QPalette &pal) { d->palette = pal; if (!d->mainFrame || !d->mainFrame->d->frame->view()) return; QBrush brush = pal.brush(QPalette::Base); QColor backgroundColor = brush.style() == Qt::SolidPattern ? brush.color() : QColor(); QWebFramePrivate::core(d->mainFrame)->view()->updateBackgroundRecursively(backgroundColor, !backgroundColor.alpha()); } QPalette QWebPage::palette() const { return d->palette; } void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) { WebCore::Frame *frame = page->focusController()->focusedOrMainFrame(); WebCore::Editor *editor = frame->editor(); if (!editor->canEdit()) { ev->ignore(); return; } RenderObject* renderer = 0; RenderTextControl* renderTextControl = 0; if (frame->selection()->rootEditableElement()) renderer = frame->selection()->rootEditableElement()->shadowAncestorNode()->renderer(); if (renderer && renderer->isTextControl()) renderTextControl = toRenderTextControl(renderer); Vector underlines; for (int i = 0; i < ev->attributes().size(); ++i) { const QInputMethodEvent::Attribute& a = ev->attributes().at(i); switch (a.type) { case QInputMethodEvent::TextFormat: { QTextCharFormat textCharFormat = a.value.value().toCharFormat(); QColor qcolor = textCharFormat.underlineColor(); underlines.append(CompositionUnderline(a.start, a.length, Color(makeRGBA(qcolor.red(), qcolor.green(), qcolor.blue(), qcolor.alpha())), false)); break; } case QInputMethodEvent::Cursor: { frame->setCaretVisible(a.length); //if length is 0 cursor is invisible if (a.length > 0) { RenderObject* caretRenderer = frame->selection()->caretRenderer(); if (caretRenderer) { QColor qcolor = a.value.value(); caretRenderer->style()->setColor(Color(makeRGBA(qcolor.red(), qcolor.green(), qcolor.blue(), qcolor.alpha()))); } } break; } #if QT_VERSION >= 0x040600 case QInputMethodEvent::Selection: { if (renderTextControl) { renderTextControl->setSelectionStart(a.start); renderTextControl->setSelectionEnd(a.start + a.length); } break; } #endif } } if (!ev->commitString().isEmpty()) editor->confirmComposition(ev->commitString()); else if (!ev->preeditString().isEmpty()) { QString preedit = ev->preeditString(); editor->setComposition(preedit, underlines, preedit.length(), 0); } ev->accept(); } void QWebPagePrivate::shortcutOverrideEvent(QKeyEvent* event) { WebCore::Frame* frame = page->focusController()->focusedOrMainFrame(); WebCore::Editor* editor = frame->editor(); if (editor->canEdit()) { if (event->modifiers() == Qt::NoModifier || event->modifiers() == Qt::ShiftModifier || event->modifiers() == Qt::KeypadModifier) { if (event->key() < Qt::Key_Escape) { event->accept(); } else { switch (event->key()) { case Qt::Key_Return: case Qt::Key_Enter: case Qt::Key_Delete: case Qt::Key_Home: case Qt::Key_End: case Qt::Key_Backspace: case Qt::Key_Left: case Qt::Key_Right: case Qt::Key_Up: case Qt::Key_Down: case Qt::Key_Tab: event->accept(); default: break; } } } #ifndef QT_NO_SHORTCUT else if (editorActionForKeyEvent(event) != QWebPage::NoWebAction) event->accept(); #endif } } bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame) { ScrollDirection direction; ScrollGranularity granularity; #ifndef QT_NO_SHORTCUT if (ev == QKeySequence::MoveToNextPage || (ev->key() == Qt::Key_Space && !(ev->modifiers() & Qt::ShiftModifier))) { granularity = ScrollByPage; direction = ScrollDown; } else if (ev == QKeySequence::MoveToPreviousPage || (ev->key() == Qt::Key_Space) && (ev->modifiers() & Qt::ShiftModifier)) { granularity = ScrollByPage; direction = ScrollUp; } else #endif // QT_NO_SHORTCUT if (ev->key() == Qt::Key_Up && ev->modifiers() & Qt::ControlModifier || ev->key() == Qt::Key_Home) { granularity = ScrollByDocument; direction = ScrollUp; } else if (ev->key() == Qt::Key_Down && ev->modifiers() & Qt::ControlModifier || ev->key() == Qt::Key_End) { granularity = ScrollByDocument; direction = ScrollDown; } else { switch (ev->key()) { case Qt::Key_Up: granularity = ScrollByLine; direction = ScrollUp; break; case Qt::Key_Down: granularity = ScrollByLine; direction = ScrollDown; break; case Qt::Key_Left: granularity = ScrollByLine; direction = ScrollLeft; break; case Qt::Key_Right: granularity = ScrollByLine; direction = ScrollRight; break; default: return false; } } return frame->eventHandler()->scrollRecursively(direction, granularity); } /*! This method is used by the input method to query a set of properties of the page to be able to support complex input method operations as support for surrounding text and reconversions. \a property specifies which property is queried. \sa QWidget::inputMethodEvent(), QInputMethodEvent, QInputContext */ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const { Frame* frame = d->page->focusController()->focusedFrame(); if (!frame) return QVariant(); WebCore::Editor* editor = frame->editor(); RenderObject* renderer = 0; RenderTextControl* renderTextControl = 0; if (frame->selection()->rootEditableElement()) renderer = frame->selection()->rootEditableElement()->shadowAncestorNode()->renderer(); if (renderer && renderer->isTextControl()) renderTextControl = toRenderTextControl(renderer); switch (property) { case Qt::ImMicroFocus: { return QVariant(frame->selection()->absoluteCaretBounds()); } case Qt::ImFont: { if (renderTextControl) { RenderStyle* renderStyle = renderTextControl->style(); return QVariant(QFont(renderStyle->font().font())); } return QVariant(QFont()); } case Qt::ImCursorPosition: { if (renderTextControl) { if (editor->hasComposition()) { RefPtr range = editor->compositionRange(); return QVariant(renderTextControl->selectionEnd() - TextIterator::rangeLength(range.get())); } return QVariant(renderTextControl->selectionEnd()); } return QVariant(); } case Qt::ImSurroundingText: { if (renderTextControl) { QString text = renderTextControl->text(); RefPtr range = editor->compositionRange(); if (range) { text.remove(range->startPosition().offsetInContainerNode(), TextIterator::rangeLength(range.get())); } return QVariant(text); } return QVariant(); } case Qt::ImCurrentSelection: { if (renderTextControl) { int start = renderTextControl->selectionStart(); int end = renderTextControl->selectionEnd(); if (end > start) return QVariant(QString(renderTextControl->text()).mid(start,end-start)); } return QVariant(); } #if QT_VERSION >= 0x040600 case Qt::ImAnchorPosition: { if (renderTextControl) { if (editor->hasComposition()) { RefPtr range = editor->compositionRange(); return QVariant(renderTextControl->selectionStart() - TextIterator::rangeLength(range.get())); } return QVariant(renderTextControl->selectionStart()); } return QVariant(); } case Qt::ImMaximumTextLength: { if (frame->selection()->isContentEditable()) { if (frame->document() && frame->document()->focusedNode()) { if (frame->document()->focusedNode()->hasTagName(HTMLNames::inputTag)) { HTMLInputElement* inputElement = static_cast(frame->document()->focusedNode()); return QVariant(inputElement->maxLength()); } } return QVariant(InputElement::s_maximumLength); } return QVariant(0); } #endif default: return QVariant(); } } /*! \internal */ void QWebPagePrivate::setInspector(QWebInspector* insp) { if (inspector) inspector->d->setFrontend(0); if (inspectorIsInternalOnly) { QWebInspector* inspToDelete = inspector; inspector = 0; inspectorIsInternalOnly = false; delete inspToDelete; // Delete after to prevent infinite recursion } inspector = insp; // Give inspector frontend web view if previously created if (inspector && inspectorFrontend) inspector->d->setFrontend(inspectorFrontend); } /*! \internal Returns the inspector and creates it if it wasn't created yet. The instance created here will not be available through QWebPage's API. */ QWebInspector* QWebPagePrivate::getOrCreateInspector() { if (!inspector) { QWebInspector* insp = new QWebInspector; insp->setPage(q); insp->connect(q, SIGNAL(webInspectorTriggered(const QWebElement&)), SLOT(show())); insp->show(); // The inspector is expected to be shown on inspection inspectorIsInternalOnly = true; Q_ASSERT(inspector); // Associated through QWebInspector::setPage(q) } return inspector; } /*! \internal */ InspectorController* QWebPagePrivate::inspectorController() { return page->inspectorController(); } /*! \enum QWebPage::FindFlag This enum describes the options available to QWebPage's findText() function. The options can be OR-ed together from the following list: \value FindBackward Searches backwards instead of forwards. \value FindCaseSensitively By default findText() works case insensitive. Specifying this option changes the behaviour to a case sensitive find operation. \value FindWrapsAroundDocument Makes findText() restart from the beginning of the document if the end was reached and the text was not found. \value HighlightAllOccurrences Highlights all existing occurrences of a specific string. */ /*! \enum QWebPage::LinkDelegationPolicy This enum defines the delegation policies a webpage can have when activating links and emitting the linkClicked() signal. \value DontDelegateLinks No links are delegated. Instead, QWebPage tries to handle them all. \value DelegateExternalLinks When activating links that point to documents not stored on the local filesystem or an equivalent - such as the Qt resource system - then linkClicked() is emitted. \value DelegateAllLinks Whenever a link is activated the linkClicked() signal is emitted. */ /*! \enum QWebPage::NavigationType This enum describes the types of navigation available when browsing through hyperlinked documents. \value NavigationTypeLinkClicked The user clicked on a link or pressed return on a focused link. \value NavigationTypeFormSubmitted The user activated a submit button for an HTML form. \value NavigationTypeBackOrForward Navigation to a previously shown document in the back or forward history is requested. \value NavigationTypeReload The user activated the reload action. \value NavigationTypeFormResubmitted An HTML form was submitted a second time. \value NavigationTypeOther A navigation to another document using a method not listed above. */ /*! \enum QWebPage::WebAction This enum describes the types of action which can be performed on the web page. Actions only have an effect when they are applicable. The availability of actions can be be determined by checking \l{QAction::}{isEnabled()} on the action returned by \l{QWebPage::}{action()}. One method of enabling the text editing, cursor movement, and text selection actions is by setting \l contentEditable to true. \value NoWebAction No action is triggered. \value OpenLink Open the current link. \value OpenLinkInNewWindow Open the current link in a new window. \value OpenFrameInNewWindow Replicate the current frame in a new window. \value DownloadLinkToDisk Download the current link to the disk. \value CopyLinkToClipboard Copy the current link to the clipboard. \value OpenImageInNewWindow Open the highlighted image in a new window. \value DownloadImageToDisk Download the highlighted image to the disk. \value CopyImageToClipboard Copy the highlighted image to the clipboard. \value Back Navigate back in the history of navigated links. \value Forward Navigate forward in the history of navigated links. \value Stop Stop loading the current page. \value Reload Reload the current page. \value ReloadAndBypassCache Reload the current page, but do not use any local cache. (Added in Qt 4.6) \value Cut Cut the content currently selected into the clipboard. \value Copy Copy the content currently selected into the clipboard. \value Paste Paste content from the clipboard. \value Undo Undo the last editing action. \value Redo Redo the last editing action. \value MoveToNextChar Move the cursor to the next character. \value MoveToPreviousChar Move the cursor to the previous character. \value MoveToNextWord Move the cursor to the next word. \value MoveToPreviousWord Move the cursor to the previous word. \value MoveToNextLine Move the cursor to the next line. \value MoveToPreviousLine Move the cursor to the previous line. \value MoveToStartOfLine Move the cursor to the start of the line. \value MoveToEndOfLine Move the cursor to the end of the line. \value MoveToStartOfBlock Move the cursor to the start of the block. \value MoveToEndOfBlock Move the cursor to the end of the block. \value MoveToStartOfDocument Move the cursor to the start of the document. \value MoveToEndOfDocument Move the cursor to the end of the document. \value SelectNextChar Select to the next character. \value SelectPreviousChar Select to the previous character. \value SelectNextWord Select to the next word. \value SelectPreviousWord Select to the previous word. \value SelectNextLine Select to the next line. \value SelectPreviousLine Select to the previous line. \value SelectStartOfLine Select to the start of the line. \value SelectEndOfLine Select to the end of the line. \value SelectStartOfBlock Select to the start of the block. \value SelectEndOfBlock Select to the end of the block. \value SelectStartOfDocument Select to the start of the document. \value SelectEndOfDocument Select to the end of the document. \value DeleteStartOfWord Delete to the start of the word. \value DeleteEndOfWord Delete to the end of the word. \value SetTextDirectionDefault Set the text direction to the default direction. \value SetTextDirectionLeftToRight Set the text direction to left-to-right. \value SetTextDirectionRightToLeft Set the text direction to right-to-left. \value ToggleBold Toggle the formatting between bold and normal weight. \value ToggleItalic Toggle the formatting between italic and normal style. \value ToggleUnderline Toggle underlining. \value InspectElement Show the Web Inspector with the currently highlighted HTML element. \value InsertParagraphSeparator Insert a new paragraph. \value InsertLineSeparator Insert a new line. \value SelectAll Selects all content. \value PasteAndMatchStyle Paste content from the clipboard with current style. \value RemoveFormat Removes formatting and style. \value ToggleStrikethrough Toggle the formatting between strikethrough and normal style. \value ToggleSubscript Toggle the formatting between subscript and baseline. \value ToggleSuperscript Toggle the formatting between supercript and baseline. \value InsertUnorderedList Toggles the selection between an ordered list and a normal block. \value InsertOrderedList Toggles the selection between an ordered list and a normal block. \value Indent Increases the indentation of the currently selected format block by one increment. \value Outdent Decreases the indentation of the currently selected format block by one increment. \value AlignCenter Applies center alignment to content. \value AlignJustified Applies full justification to content. \value AlignLeft Applies left justification to content. \value AlignRight Applies right justification to content. \omitvalue WebActionCount */ /*! \enum QWebPage::WebWindowType \value WebBrowserWindow The window is a regular web browser window. \value WebModalDialog The window acts as modal dialog. */ /*! \class QWebPage \since 4.4 \brief The QWebPage class provides an object to view and edit web documents. \inmodule QtWebKit QWebPage holds a main frame responsible for web content, settings, the history of navigated links and actions. This class can be used, together with QWebFrame, to provide functionality like QWebView in a widget-less environment. QWebPage's API is very similar to QWebView, as you are still provided with common functions like action() (known as \l{QWebView::}{pageAction()} in QWebView), triggerAction(), findText() and settings(). More QWebView-like functions can be found in the main frame of QWebPage, obtained via QWebPage::mainFrame(). For example, the load(), setUrl() and setHtml() unctions for QWebPage can be accessed using QWebFrame. The loadStarted() signal is emitted when the page begins to load.The loadProgress() signal, on the other hand, is emitted whenever an element of the web page completes loading, such as an embedded image, a script, etc. Finally, the loadFinished() signal is emitted when the page has loaded completely. Its argument, either true or false, indicates whether or not the load operation succeeded. \section1 Using QWebPage in a Widget-less Environment Before you begin painting a QWebPage object, you need to set the size of the viewport by calling setViewportSize(). Then, you invoke the main frame's render function (QWebFrame::render()). An example of this is shown in the code snippet below. Suppose we have a \c Thumbnail class as follows: \snippet webkitsnippets/webpage/main.cpp 0 The \c Thumbnail's constructor takes in a \a url. We connect our QWebPage object's \l{QWebPage::}{loadFinished()} signal to our private slot, \c render(). \snippet webkitsnippets/webpage/main.cpp 1 The \c render() function shows how we can paint a thumbnail using a QWebPage object. \snippet webkitsnippets/webpage/main.cpp 2 We begin by setting the \l{QWebPage::viewportSize()}{viewportSize} and then we instantiate a QImage object, \c image, with the same size as our \l{QWebPage::viewportSize()}{viewportSize}. This image is then sent as a parameter to \c painter. Next, we render the contents of the main frame and its subframes into \c painter. Finally, we save the scaled image. \sa QWebFrame */ /*! Constructs an empty QWebView with parent \a parent. */ QWebPage::QWebPage(QObject *parent) : QObject(parent) , d(new QWebPagePrivate(this)) { setView(qobject_cast(parent)); connect(this, SIGNAL(loadProgress(int)), this, SLOT(_q_onLoadProgressChanged(int))); #ifndef NDEBUG connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(_q_cleanupLeakMessages())); #endif } /*! Destroys the web page. */ QWebPage::~QWebPage() { d->createMainFrame(); FrameLoader *loader = d->mainFrame->d->frame->loader(); if (loader) loader->detachFromParent(); if (d->inspector) d->inspector->setPage(0); delete d; } /*! Returns the main frame of the page. The main frame provides access to the hierarchy of sub-frames and is also needed if you want to explicitly render a web page into a given painter. \sa currentFrame() */ QWebFrame *QWebPage::mainFrame() const { d->createMainFrame(); return d->mainFrame; } /*! Returns the frame currently active. \sa mainFrame(), frameCreated() */ QWebFrame *QWebPage::currentFrame() const { d->createMainFrame(); return static_cast(d->page->focusController()->focusedOrMainFrame()->loader()->client())->webFrame(); } /*! \since 4.6 Returns the frame at the given point \a pos. \sa mainFrame(), currentFrame() */ QWebFrame* QWebPage::frameAt(const QPoint& pos) const { QWebFrame* webFrame = mainFrame(); if (!webFrame->geometry().contains(pos)) return 0; QWebHitTestResult hitTestResult = webFrame->hitTestContent(pos); return hitTestResult.frame(); } /*! Returns a pointer to the view's history of navigated web pages. */ QWebHistory *QWebPage::history() const { d->createMainFrame(); return &d->history; } /*! Sets the \a view that is associated with the web page. \sa view() */ void QWebPage::setView(QWidget *view) { if (d->view != view) { d->view = view; setViewportSize(view ? view->size() : QSize(0, 0)); } } /*! Returns the view widget that is associated with the web page. \sa setView() */ QWidget *QWebPage::view() const { return d->view; } /*! This function is called whenever a JavaScript program tries to print a \a message to the web browser's console. For example in case of evaluation errors the source URL may be provided in \a sourceID as well as the \a lineNumber. The default implementation prints nothing. */ void QWebPage::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID) { Q_UNUSED(message) Q_UNUSED(lineNumber) Q_UNUSED(sourceID) } /*! This function is called whenever a JavaScript program running inside \a frame calls the alert() function with the message \a msg. The default implementation shows the message, \a msg, with QMessageBox::information. */ void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg) { Q_UNUSED(frame) #ifndef QT_NO_MESSAGEBOX QMessageBox::information(d->view, tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Ok); #endif } /*! This function is called whenever a JavaScript program running inside \a frame calls the confirm() function with the message, \a msg. Returns true if the user confirms the message; otherwise returns false. The default implementation executes the query using QMessageBox::information with QMessageBox::Yes and QMessageBox::No buttons. */ bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg) { Q_UNUSED(frame) #ifdef QT_NO_MESSAGEBOX return true; #else return QMessageBox::Yes == QMessageBox::information(d->view, tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Yes, QMessageBox::No); #endif } /*! This function is called whenever a JavaScript program running inside \a frame tries to prompt the user for input. The program may provide an optional message, \a msg, as well as a default value for the input in \a defaultValue. If the prompt was cancelled by the user the implementation should return false; otherwise the result should be written to \a result and true should be returned. The default implementation uses QInputDialog::getText. */ bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QString& defaultValue, QString* result) { Q_UNUSED(frame) bool ok = false; #ifndef QT_NO_INPUTDIALOG QString x = QInputDialog::getText(d->view, tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), msg, QLineEdit::Normal, defaultValue, &ok); if (ok && result) *result = x; #endif return ok; } /*! \fn bool QWebPage::shouldInterruptJavaScript() \since 4.6 This function is called when a JavaScript program is running for a long period of time. If the user wanted to stop the JavaScript the implementation should return true; otherwise false. The default implementation executes the query using QMessageBox::information with QMessageBox::Yes and QMessageBox::No buttons. \warning Because of binary compatibility constraints, this function is not virtual. If you want to provide your own implementation in a QWebPage subclass, reimplement the shouldInterruptJavaScript() slot in your subclass instead. QtWebKit will dynamically detect the slot and call it. */ bool QWebPage::shouldInterruptJavaScript() { #ifdef QT_NO_MESSAGEBOX return false; #else return QMessageBox::Yes == QMessageBox::information(d->view, tr("JavaScript Problem - %1").arg(mainFrame()->url().host()), tr("The script on this page appears to have a problem. Do you want to stop the script?"), QMessageBox::Yes, QMessageBox::No); #endif } /*! This function is called whenever WebKit wants to create a new window of the given \a type, for example when a JavaScript program requests to open a document in a new window. If the new window can be created, the new window's QWebPage is returned; otherwise a null pointer is returned. If the view associated with the web page is a QWebView object, then the default implementation forwards the request to QWebView's createWindow() function; otherwise it returns a null pointer. \sa acceptNavigationRequest() */ QWebPage *QWebPage::createWindow(WebWindowType type) { QWebView *webView = qobject_cast(d->view); if (webView) { QWebView *newView = webView->createWindow(type); if (newView) return newView->page(); } return 0; } /*! This function is called whenever WebKit encounters a HTML object element with type "application/x-qt-plugin". The \a classid, \a url, \a paramNames and \a paramValues correspond to the HTML object element attributes and child elements to configure the embeddable object. */ QObject *QWebPage::createPlugin(const QString &classid, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues) { Q_UNUSED(classid) Q_UNUSED(url) Q_UNUSED(paramNames) Q_UNUSED(paramValues) return 0; } static WebCore::FrameLoadRequest frameLoadRequest(const QUrl &url, WebCore::Frame *frame) { WebCore::ResourceRequest rr(url, frame->loader()->outgoingReferrer()); return WebCore::FrameLoadRequest(rr); } static void openNewWindow(const QUrl& url, WebCore::Frame* frame) { if (Page* oldPage = frame->page()) { WindowFeatures features; if (Page* newPage = oldPage->chrome()->createWindow(frame, frameLoadRequest(url, frame), features)) newPage->chrome()->show(); } } /*! This function can be called to trigger the specified \a action. It is also called by QtWebKit if the user triggers the action, for example through a context menu item. If \a action is a checkable action then \a checked specified whether the action is toggled or not. \sa action() */ void QWebPage::triggerAction(WebAction action, bool) { WebCore::Frame *frame = d->page->focusController()->focusedOrMainFrame(); if (!frame) return; WebCore::Editor *editor = frame->editor(); const char *command = 0; switch (action) { case OpenLink: if (QWebFrame *targetFrame = d->hitTestResult.linkTargetFrame()) { WTF::RefPtr wcFrame = targetFrame->d->frame; targetFrame->d->frame->loader()->loadFrameRequest(frameLoadRequest(d->hitTestResult.linkUrl(), wcFrame.get()), /*lockHistory*/ false, /*lockBackForwardList*/ false, /*event*/ 0, /*FormState*/ 0); break; } // fall through case OpenLinkInNewWindow: openNewWindow(d->hitTestResult.linkUrl(), frame); break; case OpenFrameInNewWindow: { KURL url = frame->loader()->documentLoader()->unreachableURL(); if (url.isEmpty()) url = frame->loader()->documentLoader()->url(); openNewWindow(url, frame); break; } case CopyLinkToClipboard: { #if defined(Q_WS_X11) bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode(); Pasteboard::generalPasteboard()->setSelectionMode(true); editor->copyURL(d->hitTestResult.linkUrl(), d->hitTestResult.linkText()); Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode); #endif editor->copyURL(d->hitTestResult.linkUrl(), d->hitTestResult.linkText()); break; } case OpenImageInNewWindow: openNewWindow(d->hitTestResult.imageUrl(), frame); break; case DownloadImageToDisk: frame->loader()->client()->startDownload(WebCore::ResourceRequest(d->hitTestResult.imageUrl(), frame->loader()->outgoingReferrer())); break; case DownloadLinkToDisk: frame->loader()->client()->startDownload(WebCore::ResourceRequest(d->hitTestResult.linkUrl(), frame->loader()->outgoingReferrer())); break; #ifndef QT_NO_CLIPBOARD case CopyImageToClipboard: QApplication::clipboard()->setPixmap(d->hitTestResult.pixmap()); break; #endif case Back: d->page->goBack(); break; case Forward: d->page->goForward(); break; case Stop: mainFrame()->d->frame->loader()->stopForUserCancel(); break; case Reload: mainFrame()->d->frame->loader()->reload(/*endtoendreload*/false); break; case ReloadAndBypassCache: mainFrame()->d->frame->loader()->reload(/*endtoendreload*/true); break; case SetTextDirectionDefault: editor->setBaseWritingDirection(NaturalWritingDirection); break; case SetTextDirectionLeftToRight: editor->setBaseWritingDirection(LeftToRightWritingDirection); break; case SetTextDirectionRightToLeft: editor->setBaseWritingDirection(RightToLeftWritingDirection); break; case InspectElement: { QWebElement inspectedElement(QWebElement::enclosingElement(d->hitTestResult.d->innerNonSharedNode.get())); emit webInspectorTriggered(inspectedElement); if (!d->hitTestResult.isNull()) { d->getOrCreateInspector(); // Make sure the inspector is created d->page->inspectorController()->inspect(d->hitTestResult.d->innerNonSharedNode.get()); } break; } default: command = QWebPagePrivate::editorCommandForWebActions(action); break; } if (command) editor->command(command).execute(); } QSize QWebPage::viewportSize() const { if (d->mainFrame && d->mainFrame->d->frame->view()) return d->mainFrame->d->frame->view()->frameRect().size(); return d->viewportSize; } /*! \property QWebPage::viewportSize \brief the size of the viewport The size affects for example the visibility of scrollbars if the document is larger than the viewport. By default, for a newly-created Web page, this property contains a size with zero width and height. */ void QWebPage::setViewportSize(const QSize &size) const { d->viewportSize = size; QWebFrame *frame = mainFrame(); if (frame->d->frame && frame->d->frame->view()) { WebCore::FrameView* view = frame->d->frame->view(); view->setFrameRect(QRect(QPoint(0, 0), size)); view->forceLayout(); view->adjustViewSize(); } } QSize QWebPage::fixedContentsSize() const { QWebFrame* frame = d->mainFrame; if (frame) { WebCore::FrameView* view = frame->d->frame->view(); if (view && view->useFixedLayout()) return d->mainFrame->d->frame->view()->fixedLayoutSize(); } return d->fixedLayoutSize; } /*! \property QWebPage::fixedContentsSize \since 4.6 \brief the size of the fixed layout The size affects the layout of the page in the viewport. If set to a fixed size of 1024x768 for example then webkit will layout the page as if the viewport were that size rather than something different. */ void QWebPage::setFixedContentsSize(const QSize &size) const { d->fixedLayoutSize = size; QWebFrame *frame = mainFrame(); if (frame->d->frame && frame->d->frame->view()) { WebCore::FrameView* view = frame->d->frame->view(); if (size.isValid()) { view->setUseFixedLayout(true); view->setFixedLayoutSize(size); view->forceLayout(); } else if (view->useFixedLayout()) { view->setUseFixedLayout(false); view->forceLayout(); } } } /*! \fn bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type) This function is called whenever WebKit requests to navigate \a frame to the resource specified by \a request by means of the specified navigation type \a type. If \a frame is a null pointer then navigation to a new window is requested. If the request is accepted createWindow() will be called. The default implementation interprets the page's linkDelegationPolicy and emits linkClicked accordingly or returns true to let QWebPage handle the navigation itself. \sa createWindow() */ #if QT_VERSION >= 0x040400 bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type) #else bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type) #endif { Q_UNUSED(frame) if (type == NavigationTypeLinkClicked) { switch (d->linkPolicy) { case DontDelegateLinks: return true; case DelegateExternalLinks: if (WebCore::SecurityOrigin::shouldTreatURLSchemeAsLocal(request.url().scheme())) return true; emit linkClicked(request.url()); return false; case DelegateAllLinks: emit linkClicked(request.url()); return false; } } return true; } /*! \property QWebPage::selectedText \brief the text currently selected By default, this property contains an empty string. \sa selectionChanged() */ QString QWebPage::selectedText() const { d->createMainFrame(); return d->page->focusController()->focusedOrMainFrame()->selectedText(); } /*! Returns a QAction for the specified WebAction \a action. The action is owned by the QWebPage but you can customize the look by changing its properties. QWebPage also takes care of implementing the action, so that upon triggering the corresponding action is performed on the page. \sa triggerAction() */ QAction *QWebPage::action(WebAction action) const { if (action == QWebPage::NoWebAction) return 0; if (d->actions[action]) return d->actions[action]; QString text; QIcon icon; QStyle *style = view() ? view()->style() : qApp->style(); bool checkable = false; switch (action) { case OpenLink: text = contextMenuItemTagOpenLink(); break; case OpenLinkInNewWindow: text = contextMenuItemTagOpenLinkInNewWindow(); break; case OpenFrameInNewWindow: text = contextMenuItemTagOpenFrameInNewWindow(); break; case DownloadLinkToDisk: text = contextMenuItemTagDownloadLinkToDisk(); break; case CopyLinkToClipboard: text = contextMenuItemTagCopyLinkToClipboard(); break; case OpenImageInNewWindow: text = contextMenuItemTagOpenImageInNewWindow(); break; case DownloadImageToDisk: text = contextMenuItemTagDownloadImageToDisk(); break; case CopyImageToClipboard: text = contextMenuItemTagCopyImageToClipboard(); break; case Back: text = contextMenuItemTagGoBack(); #if QT_VERSION >= 0x040400 icon = style->standardIcon(QStyle::SP_ArrowBack); #endif break; case Forward: text = contextMenuItemTagGoForward(); #if QT_VERSION >= 0x040400 icon = style->standardIcon(QStyle::SP_ArrowForward); #endif break; case Stop: text = contextMenuItemTagStop(); #if QT_VERSION >= 0x040400 icon = style->standardIcon(QStyle::SP_BrowserStop); #endif break; case Reload: text = contextMenuItemTagReload(); #if QT_VERSION >= 0x040400 icon = style->standardIcon(QStyle::SP_BrowserReload); #endif break; case Cut: text = contextMenuItemTagCut(); break; case Copy: text = contextMenuItemTagCopy(); break; case Paste: text = contextMenuItemTagPaste(); break; #ifndef QT_NO_UNDOSTACK case Undo: { QAction *a = undoStack()->createUndoAction(d->q); d->actions[action] = a; return a; } case Redo: { QAction *a = undoStack()->createRedoAction(d->q); d->actions[action] = a; return a; } #endif // QT_NO_UNDOSTACK case MoveToNextChar: text = tr("Move the cursor to the next character"); break; case MoveToPreviousChar: text = tr("Move the cursor to the previous character"); break; case MoveToNextWord: text = tr("Move the cursor to the next word"); break; case MoveToPreviousWord: text = tr("Move the cursor to the previous word"); break; case MoveToNextLine: text = tr("Move the cursor to the next line"); break; case MoveToPreviousLine: text = tr("Move the cursor to the previous line"); break; case MoveToStartOfLine: text = tr("Move the cursor to the start of the line"); break; case MoveToEndOfLine: text = tr("Move the cursor to the end of the line"); break; case MoveToStartOfBlock: text = tr("Move the cursor to the start of the block"); break; case MoveToEndOfBlock: text = tr("Move the cursor to the end of the block"); break; case MoveToStartOfDocument: text = tr("Move the cursor to the start of the document"); break; case MoveToEndOfDocument: text = tr("Move the cursor to the end of the document"); break; case SelectAll: text = tr("Select all"); break; case SelectNextChar: text = tr("Select to the next character"); break; case SelectPreviousChar: text = tr("Select to the previous character"); break; case SelectNextWord: text = tr("Select to the next word"); break; case SelectPreviousWord: text = tr("Select to the previous word"); break; case SelectNextLine: text = tr("Select to the next line"); break; case SelectPreviousLine: text = tr("Select to the previous line"); break; case SelectStartOfLine: text = tr("Select to the start of the line"); break; case SelectEndOfLine: text = tr("Select to the end of the line"); break; case SelectStartOfBlock: text = tr("Select to the start of the block"); break; case SelectEndOfBlock: text = tr("Select to the end of the block"); break; case SelectStartOfDocument: text = tr("Select to the start of the document"); break; case SelectEndOfDocument: text = tr("Select to the end of the document"); break; case DeleteStartOfWord: text = tr("Delete to the start of the word"); break; case DeleteEndOfWord: text = tr("Delete to the end of the word"); break; case SetTextDirectionDefault: text = contextMenuItemTagDefaultDirection(); break; case SetTextDirectionLeftToRight: text = contextMenuItemTagLeftToRight(); checkable = true; break; case SetTextDirectionRightToLeft: text = contextMenuItemTagRightToLeft(); checkable = true; break; case ToggleBold: text = contextMenuItemTagBold(); checkable = true; break; case ToggleItalic: text = contextMenuItemTagItalic(); checkable = true; break; case ToggleUnderline: text = contextMenuItemTagUnderline(); checkable = true; break; case InspectElement: text = contextMenuItemTagInspectElement(); break; case InsertParagraphSeparator: text = tr("Insert a new paragraph"); break; case InsertLineSeparator: text = tr("Insert a new line"); break; case PasteAndMatchStyle: text = tr("Paste and Match Style"); break; case RemoveFormat: text = tr("Remove formatting"); break; case ToggleStrikethrough: text = tr("Strikethrough"); checkable = true; break; case ToggleSubscript: text = tr("Subscript"); checkable = true; break; case ToggleSuperscript: text = tr("Superscript"); checkable = true; break; case InsertUnorderedList: text = tr("Insert Bulleted List"); checkable = true; break; case InsertOrderedList: text = tr("Insert Numbered List"); checkable = true; break; case Indent: text = tr("Indent"); break; case Outdent: text = tr("Outdent"); break; case AlignCenter: text = tr("Center"); break; case AlignJustified: text = tr("Justify"); break; case AlignLeft: text = tr("Align Left"); break; case AlignRight: text = tr("Align Right"); break; case NoWebAction: return 0; } if (text.isEmpty()) return 0; QAction *a = new QAction(d->q); a->setText(text); a->setData(action); a->setCheckable(checkable); a->setIcon(icon); connect(a, SIGNAL(triggered(bool)), this, SLOT(_q_webActionTriggered(bool))); d->actions[action] = a; d->updateAction(action); return a; } /*! \property QWebPage::modified \brief whether the page contains unsubmitted form data By default, this property is false. */ bool QWebPage::isModified() const { #ifdef QT_NO_UNDOSTACK return false; #else if (!d->undoStack) return false; return d->undoStack->canUndo(); #endif // QT_NO_UNDOSTACK } #ifndef QT_NO_UNDOSTACK /*! Returns a pointer to the undo stack used for editable content. */ QUndoStack *QWebPage::undoStack() const { if (!d->undoStack) d->undoStack = new QUndoStack(const_cast(this)); return d->undoStack; } #endif // QT_NO_UNDOSTACK /*! \reimp */ bool QWebPage::event(QEvent *ev) { switch (ev->type()) { case QEvent::Timer: d->timerEvent(static_cast(ev)); break; case QEvent::MouseMove: d->mouseMoveEvent(static_cast(ev)); break; case QEvent::GraphicsSceneMouseMove: d->mouseMoveEvent(static_cast(ev)); break; case QEvent::MouseButtonPress: d->mousePressEvent(static_cast(ev)); break; case QEvent::GraphicsSceneMousePress: d->mousePressEvent(static_cast(ev)); break; case QEvent::MouseButtonDblClick: d->mouseDoubleClickEvent(static_cast(ev)); break; case QEvent::GraphicsSceneMouseDoubleClick: d->mouseDoubleClickEvent(static_cast(ev)); break; case QEvent::MouseButtonRelease: d->mouseReleaseEvent(static_cast(ev)); break; case QEvent::GraphicsSceneMouseRelease: d->mouseReleaseEvent(static_cast(ev)); break; #ifndef QT_NO_CONTEXTMENU case QEvent::ContextMenu: d->contextMenuEvent(static_cast(ev)->globalPos()); break; case QEvent::GraphicsSceneContextMenu: d->contextMenuEvent(static_cast(ev)->screenPos()); break; #endif #ifndef QT_NO_WHEELEVENT case QEvent::Wheel: d->wheelEvent(static_cast(ev)); break; case QEvent::GraphicsSceneWheel: d->wheelEvent(static_cast(ev)); break; #endif case QEvent::KeyPress: d->keyPressEvent(static_cast(ev)); break; case QEvent::KeyRelease: d->keyReleaseEvent(static_cast(ev)); break; case QEvent::FocusIn: d->focusInEvent(static_cast(ev)); break; case QEvent::FocusOut: d->focusOutEvent(static_cast(ev)); break; #ifndef QT_NO_DRAGANDDROP case QEvent::DragEnter: d->dragEnterEvent(static_cast(ev)); break; case QEvent::GraphicsSceneDragEnter: d->dragEnterEvent(static_cast(ev)); break; case QEvent::DragLeave: d->dragLeaveEvent(static_cast(ev)); break; case QEvent::GraphicsSceneDragLeave: d->dragLeaveEvent(static_cast(ev)); break; case QEvent::DragMove: d->dragMoveEvent(static_cast(ev)); break; case QEvent::GraphicsSceneDragMove: d->dragMoveEvent(static_cast(ev)); break; case QEvent::Drop: d->dropEvent(static_cast(ev)); break; case QEvent::GraphicsSceneDrop: d->dropEvent(static_cast(ev)); break; #endif case QEvent::InputMethod: d->inputMethodEvent(static_cast(ev)); case QEvent::ShortcutOverride: d->shortcutOverrideEvent(static_cast(ev)); break; case QEvent::Leave: d->leaveEvent(ev); break; default: return QObject::event(ev); } return true; } /*! Similar to QWidget::focusNextPrevChild it focuses the next focusable web element if \a next is true; otherwise the previous element is focused. Returns true if it can find a new focusable element, or false if it can't. */ bool QWebPage::focusNextPrevChild(bool next) { QKeyEvent ev(QEvent::KeyPress, Qt::Key_Tab, Qt::KeyboardModifiers(next ? Qt::NoModifier : Qt::ShiftModifier)); d->keyPressEvent(&ev); bool hasFocusedNode = false; Frame *frame = d->page->focusController()->focusedFrame(); if (frame) { Document *document = frame->document(); hasFocusedNode = document && document->focusedNode(); } //qDebug() << "focusNextPrevChild(" << next << ") =" << ev.isAccepted() << "focusedNode?" << hasFocusedNode; return hasFocusedNode; } /*! \property QWebPage::contentEditable \brief whether the content in this QWebPage is editable or not \since 4.5 If this property is enabled the contents of the page can be edited by the user through a visible cursor. If disabled (the default) only HTML elements in the web page with their \c{contenteditable} attribute set are editable. */ void QWebPage::setContentEditable(bool editable) { if (d->editable != editable) { d->editable = editable; d->page->setTabKeyCyclesThroughElements(!editable); if (d->mainFrame) { WebCore::Frame* frame = d->mainFrame->d->frame; if (editable) { frame->applyEditingStyleToBodyElement(); // FIXME: mac port calls this if there is no selectedDOMRange //frame->setSelectionFromNone(); } else frame->removeEditingStyleFromBodyElement(); } d->updateEditorActions(); } } bool QWebPage::isContentEditable() const { return d->editable; } /*! \property QWebPage::forwardUnsupportedContent \brief whether QWebPage should forward unsupported content If enabled, the unsupportedContent() signal is emitted with a network reply that can be used to read the content. If disabled, the download of such content is aborted immediately. By default unsupported content is not forwarded. */ void QWebPage::setForwardUnsupportedContent(bool forward) { d->forwardUnsupportedContent = forward; } bool QWebPage::forwardUnsupportedContent() const { return d->forwardUnsupportedContent; } /*! \property QWebPage::linkDelegationPolicy \brief how QWebPage should delegate the handling of links through the linkClicked() signal The default is to delegate no links. */ void QWebPage::setLinkDelegationPolicy(LinkDelegationPolicy policy) { d->linkPolicy = policy; } QWebPage::LinkDelegationPolicy QWebPage::linkDelegationPolicy() const { return d->linkPolicy; } #ifndef QT_NO_CONTEXTMENU /*! Filters the context menu event, \a event, through handlers for scrollbars and custom event handlers in the web page. Returns true if the event was handled; otherwise false. A web page may swallow a context menu event through a custom event handler, allowing for context menus to be implemented in HTML/JavaScript. This is used by \l{http://maps.google.com/}{Google Maps}, for example. */ bool QWebPage::swallowContextMenuEvent(QContextMenuEvent *event) { d->page->contextMenuController()->clearContextMenu(); if (QWebFrame* webFrame = frameAt(event->pos())) { Frame* frame = QWebFramePrivate::core(webFrame); if (Scrollbar* scrollbar = frame->view()->scrollbarAtPoint(PlatformMouseEvent(event, 1).pos())) return scrollbar->contextMenu(PlatformMouseEvent(event, 1)); } WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame(); focusedFrame->eventHandler()->sendContextMenuEvent(PlatformMouseEvent(event, 1)); ContextMenu *menu = d->page->contextMenuController()->contextMenu(); // If the website defines its own handler then sendContextMenuEvent takes care of // calling/showing it and the context menu pointer will be zero. This is the case // on maps.google.com for example. return !menu; } #endif // QT_NO_CONTEXTMENU /*! Updates the page's actions depending on the position \a pos. For example if \a pos is over an image element the CopyImageToClipboard action is enabled. */ void QWebPage::updatePositionDependentActions(const QPoint &pos) { // First we disable all actions, but keep track of which ones were originally enabled. QBitArray originallyEnabledWebActions(QWebPage::WebActionCount); for (int i = ContextMenuItemTagNoAction; i < ContextMenuItemBaseApplicationTag; ++i) { QWebPage::WebAction action = webActionForContextMenuAction(WebCore::ContextMenuAction(i)); if (QAction *a = this->action(action)) { originallyEnabledWebActions.setBit(action, a->isEnabled()); a->setEnabled(false); } } d->createMainFrame(); WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame(); HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos), /*allowShadowContent*/ false); if (result.scrollbar()) d->hitTestResult = QWebHitTestResult(); else d->hitTestResult = QWebHitTestResult(new QWebHitTestResultPrivate(result)); WebCore::ContextMenu menu(result); menu.populate(); if (d->page->inspectorController()->enabled()) menu.addInspectElementItem(); QBitArray visitedWebActions(QWebPage::WebActionCount); #ifndef QT_NO_CONTEXTMENU delete d->currentContextMenu; // Then we let createContextMenu() enable the actions that are put into the menu d->currentContextMenu = d->createContextMenu(&menu, menu.platformDescription(), &visitedWebActions); #endif // QT_NO_CONTEXTMENU // Finally, we restore the original enablement for the actions that were not put into the menu. originallyEnabledWebActions &= ~visitedWebActions; // Mask out visited actions (they're part of the menu) for (int i = 0; i < QWebPage::WebActionCount; ++i) { if (originallyEnabledWebActions.at(i)) { if (QAction *a = this->action(QWebPage::WebAction(i))) a->setEnabled(true); } } // This whole process ensures that any actions put into to the context menu has the right // enablement, while also keeping the correct enablement for actions that were left out of // the menu. } /*! \enum QWebPage::Extension This enum describes the types of extensions that the page can support. Before using these extensions, you should verify that the extension is supported by calling supportsExtension(). \value ChooseMultipleFilesExtension Whether the web page supports multiple file selection. This extension is invoked when the web content requests one or more file names, for example as a result of the user clicking on a "file upload" button in a HTML form where multiple file selection is allowed. */ /*! \class QWebPage::ExtensionOption \since 4.4 \brief The ExtensionOption class provides an extended input argument to QWebPage's extension support. \inmodule QtWebKit \sa QWebPage::extension() */ /*! \class QWebPage::ChooseMultipleFilesExtensionOption \since 4.5 \brief The ChooseMultipleFilesExtensionOption class describes the option for the multiple files selection extension. \inmodule QtWebKit The ChooseMultipleFilesExtensionOption class holds the frame originating the request and the suggested filenames which might be provided. \sa QWebPage::chooseFile(), QWebPage::ChooseMultipleFilesExtensionReturn */ /*! \class QWebPage::ChooseMultipleFilesExtensionReturn \since 4.5 \brief The ChooseMultipleFilesExtensionReturn describes the return value for the multiple files selection extension. \inmodule QtWebKit The ChooseMultipleFilesExtensionReturn class holds the filenames selected by the user when the extension is invoked. \sa QWebPage::ChooseMultipleFilesExtensionOption */ /*! This virtual function can be reimplemented in a QWebPage subclass to provide support for extensions. The \a option argument is provided as input to the extension; the output results can be stored in \a output. The behavior of this function is determined by \a extension. You can call supportsExtension() to check if an extension is supported by the page. Returns true if the extension was called successfully; otherwise returns false. \sa supportsExtension(), Extension */ bool QWebPage::extension(Extension extension, const ExtensionOption *option, ExtensionReturn *output) { #ifndef QT_NO_FILEDIALOG if (extension == ChooseMultipleFilesExtension) { // FIXME: do not ignore suggestedFiles QStringList suggestedFiles = static_cast(option)->suggestedFileNames; QStringList names = QFileDialog::getOpenFileNames(d->view, QString::null); static_cast(output)->fileNames = names; return true; } #endif return false; } /*! This virtual function returns true if the web page supports \a extension; otherwise false is returned. \sa extension() */ bool QWebPage::supportsExtension(Extension extension) const { #ifndef QT_NO_FILEDIALOG return extension == ChooseMultipleFilesExtension; #else Q_UNUSED(extension); return false; #endif } /*! Finds the specified string, \a subString, in the page, using the given \a options. If the HighlightAllOccurrences flag is passed, the function will highlight all occurrences that exist in the page. All subsequent calls will extend the highlight, rather than replace it, with occurrences of the new string. If the HighlightAllOccurrences flag is not passed, the function will select an occurrence and all subsequent calls will replace the current occurrence with the next one. To clear the selection, just pass an empty string. Returns true if \a subString was found; otherwise returns false. */ bool QWebPage::findText(const QString &subString, FindFlags options) { ::TextCaseSensitivity caseSensitivity = ::TextCaseInsensitive; if (options & FindCaseSensitively) caseSensitivity = ::TextCaseSensitive; if (options & HighlightAllOccurrences) { if (subString.isEmpty()) { d->page->unmarkAllTextMatches(); return true; } else return d->page->markAllMatchesForText(subString, caseSensitivity, true, 0); } else { ::FindDirection direction = ::FindDirectionForward; if (options & FindBackward) direction = ::FindDirectionBackward; const bool shouldWrap = options & FindWrapsAroundDocument; return d->page->findString(subString, caseSensitivity, direction, shouldWrap); } } /*! Returns a pointer to the page's settings object. \sa QWebSettings::globalSettings() */ QWebSettings *QWebPage::settings() const { return d->settings; } /*! This function is called when the web content requests a file name, for example as a result of the user clicking on a "file upload" button in a HTML form. A suggested filename may be provided in \a suggestedFile. The frame originating the request is provided as \a parentFrame. */ QString QWebPage::chooseFile(QWebFrame *parentFrame, const QString& suggestedFile) { Q_UNUSED(parentFrame) #ifndef QT_NO_FILEDIALOG return QFileDialog::getOpenFileName(d->view, QString::null, suggestedFile); #else return QString::null; #endif } #if QT_VERSION < 0x040400 && !defined qdoc void QWebPage::setNetworkInterface(QWebNetworkInterface *interface) { d->networkInterface = interface; } QWebNetworkInterface *QWebPage::networkInterface() const { if (d->networkInterface) return d->networkInterface; else return QWebNetworkInterface::defaultInterface(); } #ifndef QT_NO_NETWORKPROXY void QWebPage::setNetworkProxy(const QNetworkProxy& proxy) { d->networkProxy = proxy; } QNetworkProxy QWebPage::networkProxy() const { return d->networkProxy; } #endif #else /*! Sets the QNetworkAccessManager \a manager responsible for serving network requests for this QWebPage. \sa networkAccessManager() */ void QWebPage::setNetworkAccessManager(QNetworkAccessManager *manager) { if (manager == d->networkManager) return; if (d->networkManager && d->networkManager->parent() == this) delete d->networkManager; d->networkManager = manager; } /*! Returns the QNetworkAccessManager that is responsible for serving network requests for this QWebPage. \sa setNetworkAccessManager() */ QNetworkAccessManager *QWebPage::networkAccessManager() const { if (!d->networkManager) { QWebPage *that = const_cast(this); that->d->networkManager = new QNetworkAccessManager(that); } return d->networkManager; } #endif /*! Sets the QWebPluginFactory \a factory responsible for creating plugins embedded into this QWebPage. Note: The plugin factory is only used if the QWebSettings::PluginsEnabled attribute is enabled. \sa pluginFactory() */ void QWebPage::setPluginFactory(QWebPluginFactory *factory) { d->pluginFactory = factory; } /*! Returns the QWebPluginFactory that is responsible for creating plugins embedded into this QWebPage. If no plugin factory is installed a null pointer is returned. \sa setPluginFactory() */ QWebPluginFactory *QWebPage::pluginFactory() const { return d->pluginFactory; } /*! This function is called when a user agent for HTTP requests is needed. You can reimplement this function to dynamically return different user agents for different URLs, based on the \a url parameter. The default implementation returns the following value: "Mozilla/5.0 (%Platform%; %Security%; %Subplatform%; %Locale%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko) %AppVersion Safari/%WebKitVersion%" In this string the following values are replaced at run-time: \list \o %Platform% and %Subplatform% are expanded to the windowing system and the operation system. \o %Security% expands to U if SSL is enabled, otherwise N. SSL is enabled if QSslSocket::supportsSsl() returns true. \o %Locale% is replaced with QLocale::name(). The locale is determined from the view of the QWebPage. If no view is set on the QWebPage, then a default constructed QLocale is used instead. \o %WebKitVersion% is the version of WebKit the application was compiled against. \o %AppVersion% expands to QCoreApplication::applicationName()/QCoreApplication::applicationVersion() if they're set; otherwise defaulting to Qt and the current Qt version. \endlist */ QString QWebPage::userAgentForUrl(const QUrl& url) const { Q_UNUSED(url) QString ua = QLatin1String("Mozilla/5.0 (" // Plastform #ifdef Q_WS_MAC "Macintosh" #elif defined Q_WS_QWS "QtEmbedded" #elif defined Q_WS_WIN "Windows" #elif defined Q_WS_X11 "X11" #else "Unknown" #endif "; " // Placeholder for security strength (N or U) "%1; " // Subplatform" #ifdef Q_OS_AIX "AIX" #elif defined Q_OS_WIN32 "%2" #elif defined Q_OS_DARWIN #ifdef __i386__ || __x86_64__ "Intel Mac OS X" #else "PPC Mac OS X" #endif #elif defined Q_OS_BSDI "BSD" #elif defined Q_OS_BSD4 "BSD Four" #elif defined Q_OS_CYGWIN "Cygwin" #elif defined Q_OS_DGUX "DG/UX" #elif defined Q_OS_DYNIX "DYNIX/ptx" #elif defined Q_OS_FREEBSD "FreeBSD" #elif defined Q_OS_HPUX "HP-UX" #elif defined Q_OS_HURD "GNU Hurd" #elif defined Q_OS_IRIX "SGI Irix" #elif defined Q_OS_LINUX "Linux" #elif defined Q_OS_LYNX "LynxOS" #elif defined Q_OS_NETBSD "NetBSD" #elif defined Q_OS_OS2 "OS/2" #elif defined Q_OS_OPENBSD "OpenBSD" #elif defined Q_OS_OS2EMX "OS/2" #elif defined Q_OS_OSF "HP Tru64 UNIX" #elif defined Q_OS_QNX6 "QNX RTP Six" #elif defined Q_OS_QNX "QNX" #elif defined Q_OS_RELIANT "Reliant UNIX" #elif defined Q_OS_SCO "SCO OpenServer" #elif defined Q_OS_SOLARIS "Sun Solaris" #elif defined Q_OS_ULTRIX "DEC Ultrix" #elif defined Q_OS_UNIX "UNIX BSD/SYSV system" #elif defined Q_OS_UNIXWARE "UnixWare Seven, Open UNIX Eight" #else "Unknown" #endif "; "); QChar securityStrength(QLatin1Char('N')); #if !defined(QT_NO_OPENSSL) // we could check QSslSocket::supportsSsl() here, but this makes // OpenSSL, certificates etc being loaded in all cases were QWebPage // is used. This loading is not needed for non-https. securityStrength = QLatin1Char('U'); // this may lead to a false positive: We indicate SSL since it is // compiled in even though supportsSsl() might return false #endif ua = ua.arg(securityStrength); #if defined Q_OS_WIN32 QString ver; switch (QSysInfo::WindowsVersion) { case QSysInfo::WV_32s: ver = "Windows 3.1"; break; case QSysInfo::WV_95: ver = "Windows 95"; break; case QSysInfo::WV_98: ver = "Windows 98"; break; case QSysInfo::WV_Me: ver = "Windows 98; Win 9x 4.90"; break; case QSysInfo::WV_NT: ver = "WinNT4.0"; break; case QSysInfo::WV_2000: ver = "Windows NT 5.0"; break; case QSysInfo::WV_XP: ver = "Windows NT 5.1"; break; case QSysInfo::WV_2003: ver = "Windows NT 5.2"; break; case QSysInfo::WV_VISTA: ver = "Windows NT 6.0"; break; #if QT_VERSION > 0x040500 case QSysInfo::WV_WINDOWS7: ver = "Windows NT 6.1"; break; #endif case QSysInfo::WV_CE: ver = "Windows CE"; break; case QSysInfo::WV_CENET: ver = "Windows CE .NET"; break; case QSysInfo::WV_CE_5: ver = "Windows CE 5.x"; break; case QSysInfo::WV_CE_6: ver = "Windows CE 6.x"; break; } ua = QString(ua).arg(ver); #endif // Language QLocale locale; if (d->view) locale = d->view->locale(); QString name = locale.name(); name[2] = QLatin1Char('-'); ua.append(name); ua.append(QLatin1String(") ")); // webkit/qt version ua.append(QString(QLatin1String("AppleWebKit/%1 (KHTML, like Gecko) ")) .arg(QString(qWebKitVersion()))); // Application name/version QString appName = QCoreApplication::applicationName(); if (!appName.isEmpty()) { ua.append(appName); #if QT_VERSION >= 0x040400 QString appVer = QCoreApplication::applicationVersion(); if (!appVer.isEmpty()) ua.append(QLatin1Char('/') + appVer); #endif } else { // Qt version ua.append(QLatin1String("Qt/")); ua.append(QLatin1String(qVersion())); } ua.append(QString(QLatin1String(" Safari/%1")) .arg(qWebKitVersion())); return ua; } void QWebPagePrivate::_q_onLoadProgressChanged(int) { m_totalBytes = page->progress()->totalPageAndResourceBytesToLoad(); m_bytesReceived = page->progress()->totalBytesReceived(); } /*! Returns the total number of bytes that were received from the network to render the current page, including extra content such as embedded images. \sa bytesReceived() */ quint64 QWebPage::totalBytes() const { return d->m_totalBytes; } /*! Returns the number of bytes that were received from the network to render the current page. \sa totalBytes() */ quint64 QWebPage::bytesReceived() const { return d->m_bytesReceived; } /*! \fn void QWebPage::loadStarted() This signal is emitted when a new load of the page is started. \sa loadFinished() */ /*! \fn void QWebPage::loadProgress(int progress) This signal is emitted when the global progress status changes. The current value is provided by \a progress and scales from 0 to 100, which is the default range of QProgressBar. It accumulates changes from all the child frames. \sa bytesReceived() */ /*! \fn void QWebPage::loadFinished(bool ok) This signal is emitted when a load of the page is finished. \a ok will indicate whether the load was successful or any error occurred. \sa loadStarted() */ /*! \fn void QWebPage::linkHovered(const QString &link, const QString &title, const QString &textContent) This signal is emitted when the mouse hovers over a link. \a link contains the link url. \a title is the link element's title, if it is specified in the markup. \a textContent provides text within the link element, e.g., text inside an HTML anchor tag. When the mouse leaves the link element the signal is emitted with empty parameters. \sa linkClicked() */ /*! \fn void QWebPage::statusBarMessage(const QString& text) This signal is emitted when the statusbar \a text is changed by the page. */ /*! \fn void QWebPage::frameCreated(QWebFrame *frame) This signal is emitted whenever the page creates a new \a frame. */ /*! \fn void QWebPage::selectionChanged() This signal is emitted whenever the selection changes. \sa selectedText() */ /*! \fn void QWebPage::contentsChanged() \since 4.5 This signal is emitted whenever the text in form elements changes as well as other editable content. \sa contentEditable, QWebFrame::toHtml(), QWebFrame::toPlainText() */ /*! \fn void QWebPage::geometryChangeRequested(const QRect& geom) This signal is emitted whenever the document wants to change the position and size of the page to \a geom. This can happen for example through JavaScript. */ /*! \fn void QWebPage::repaintRequested(const QRect& dirtyRect) This signal is emitted whenever this QWebPage should be updated and no view was set. \a dirtyRect contains the area that needs to be updated. To paint the QWebPage get the mainFrame() and call the render(QPainter*, const QRegion&) method with the \a dirtyRect as the second parameter. \sa mainFrame() \sa view() */ /*! \fn void QWebPage::scrollRequested(int dx, int dy, const QRect& rectToScroll) This signal is emitted whenever the content given by \a rectToScroll needs to be scrolled \a dx and \a dy downwards and no view was set. \sa view() */ /*! \fn void QWebPage::windowCloseRequested() This signal is emitted whenever the page requests the web browser window to be closed, for example through the JavaScript \c{window.close()} call. */ /*! \fn void QWebPage::printRequested(QWebFrame *frame) This signal is emitted whenever the page requests the web browser to print \a frame, for example through the JavaScript \c{window.print()} call. \sa QWebFrame::print(), QPrintPreviewDialog */ /*! \fn void QWebPage::unsupportedContent(QNetworkReply *reply) This signals is emitted when webkit cannot handle a link the user navigated to. At signal emissions time the meta data of the QNetworkReply \a reply is available. \note This signal is only emitted if the forwardUnsupportedContent property is set to true. \sa downloadRequested() */ /*! \fn void QWebPage::downloadRequested(const QNetworkRequest &request) This signal is emitted when the user decides to download a link. The url of the link as well as additional meta-information is contained in \a request. \sa unsupportedContent() */ /*! \fn void QWebPage::microFocusChanged() This signal is emitted when for example the position of the cursor in an editable form element changes. It is used inform input methods about the new on-screen position where the user is able to enter text. This signal is usually connected to QWidget's updateMicroFocus() slot. */ /*! \fn void QWebPage::linkClicked(const QUrl &url) This signal is emitted whenever the user clicks on a link and the page's linkDelegationPolicy property is set to delegate the link handling for the specified \a url. By default no links are delegated and are handled by QWebPage instead. \sa linkHovered() */ /*! \fn void QWebPage::webInspectorTriggered(const QWebElement& inspectedElement); \since 4.6 This signal is emitted when the user triggered an inspection through the context menu. If a QWebInspector is associated to this page, it should be visible to the user after this signal has been emitted. If still no QWebInspector is associated to this QWebPage after the emission of this signal, a privately owned inspector will be shown to the user. \note \a inspectedElement contains the QWebElement under the context menu. It is not garanteed to be the same as the focused element in the web inspector. \sa QWebInspector */ /*! \fn void QWebPage::toolBarVisibilityChangeRequested(bool visible) This signal is emitted whenever the visibility of the toolbar in a web browser window that hosts QWebPage should be changed to \a visible. */ /*! \fn void QWebPage::statusBarVisibilityChangeRequested(bool visible) This signal is emitted whenever the visibility of the statusbar in a web browser window that hosts QWebPage should be changed to \a visible. */ /*! \fn void QWebPage::menuBarVisibilityChangeRequested(bool visible) This signal is emitted whenever the visibility of the menubar in a web browser window that hosts QWebPage should be changed to \a visible. */ /*! \fn void QWebPage::databaseQuotaExceeded(QWebFrame* frame, QString databaseName); \since 4.5 This signal is emitted whenever the web site shown in \a frame is asking to store data to the database \a databaseName and the quota allocated to that web site is exceeded. */ /*! \since 4.5 \fn void QWebPage::saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item); This signal is emitted shortly before the history of navigated pages in \a frame is changed, for example when navigating back in the history. The provided QWebHistoryItem, \a item, holds the history entry of the frame before the change. A potential use-case for this signal is to store custom data in the QWebHistoryItem associated to the frame, using QWebHistoryItem::setUserData(). */ /*! \since 4.5 \fn void QWebPage::restoreFrameStateRequested(QWebFrame* frame); This signal is emitted when the load of \a frame is finished and the application may now update its state accordingly. */ /*! \fn QWebPagePrivate* QWebPage::handle() const \internal */ #include "moc_qwebpage.cpp" WebKit/qt/Api/qcookiejar.h0000644000175000017500000000302511231327136013773 0ustar leelee/* Copyright (C) 2007 Staikos Computing Services 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef QCOOKIEJAR_H #define QCOOKIEJAR_H #include #include #include "qwebkitglobal.h" class QCookieJarPrivate; class QWEBKIT_EXPORT QCookieJar : public QObject { Q_OBJECT Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) public: QCookieJar(); ~QCookieJar(); virtual void setCookies(const QUrl& url, const QUrl& policyUrl, const QString& value); virtual QString cookies(const QUrl& url); bool isEnabled() const; static void setCookieJar(QCookieJar* jar); static QCookieJar* cookieJar(); public slots: virtual void setEnabled(bool enabled); private: friend class QCookieJarPrivate; QCookieJarPrivate* d; }; #endif WebKit/qt/Api/qwebkitglobal.h0000644000175000017500000000304611171167267014510 0ustar leelee/* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef QWEBKITGLOBAL_H #define QWEBKITGLOBAL_H #include #if defined(QT_MAKEDLL) /* create a Qt DLL library */ # if defined(BUILD_WEBKIT) # define QWEBKIT_EXPORT Q_DECL_EXPORT # else # define QWEBKIT_EXPORT Q_DECL_IMPORT # endif #elif defined(QT_DLL) /* use a Qt DLL library */ # define QWEBKIT_EXPORT Q_DECL_IMPORT #endif #if !defined(QWEBKIT_EXPORT) # if defined(QT_SHARED) # define QWEBKIT_EXPORT Q_DECL_EXPORT # else # define QWEBKIT_EXPORT # endif #endif #if QT_VERSION < 0x040400 #ifndef QT_BEGIN_NAMESPACE #define QT_BEGIN_NAMESPACE #endif #ifndef QT_END_NAMESPACE #define QT_END_NAMESPACE #endif #endif #endif // QWEBKITGLOBAL_H WebKit/qt/Api/qwebview.h0000644000175000017500000001324011250136303013470 0ustar leelee/* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) Copyright (C) 2007 Staikos Computing Services 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef QWEBVIEW_H #define QWEBVIEW_H #include "qwebkitglobal.h" #include "qwebpage.h" #include #include #include #include #if QT_VERSION >= 0x040400 #include #endif QT_BEGIN_NAMESPACE class QNetworkRequest; class QPrinter; QT_END_NAMESPACE class QWebPage; class QWebViewPrivate; class QWebNetworkRequest; class QWEBKIT_EXPORT QWebView : public QWidget { Q_OBJECT Q_PROPERTY(QString title READ title) Q_PROPERTY(QUrl url READ url WRITE setUrl) Q_PROPERTY(QIcon icon READ icon) Q_PROPERTY(QString selectedText READ selectedText) Q_PROPERTY(bool modified READ isModified) //Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags) Q_PROPERTY(qreal textSizeMultiplier READ textSizeMultiplier WRITE setTextSizeMultiplier DESIGNABLE false) Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor) // FIXME: temporary work around for elftran issue that it couldn't find the QPainter::staticMetaObject // symbol from Qt lib; it should be reverted after the right symbol is exported. // See bug: http://qt.nokia.com/developer/task-tracker/index_html?method=entry&id=258893 #if !defined(Q_OS_SYMBIAN) Q_PROPERTY(QPainter::RenderHints renderHints READ renderHints WRITE setRenderHints) #endif Q_FLAGS(QPainter::RenderHints) public: explicit QWebView(QWidget* parent = 0); virtual ~QWebView(); QWebPage* page() const; void setPage(QWebPage* page); static QUrl guessUrlFromString(const QString& string); void load(const QUrl& url); #if QT_VERSION < 0x040400 && !defined(qdoc) void load(const QWebNetworkRequest& request); #else void load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray &body = QByteArray()); #endif void setHtml(const QString& html, const QUrl& baseUrl = QUrl()); void setContent(const QByteArray& data, const QString& mimeType = QString(), const QUrl& baseUrl = QUrl()); QWebHistory* history() const; QWebSettings* settings() const; QString title() const; void setUrl(const QUrl &url); QUrl url() const; QIcon icon() const; QString selectedText() const; QAction* pageAction(QWebPage::WebAction action) const; void triggerPageAction(QWebPage::WebAction action, bool checked = false); bool isModified() const; /* Qt::TextInteractionFlags textInteractionFlags() const; void setTextInteractionFlags(Qt::TextInteractionFlags flags); void setTextInteractionFlag(Qt::TextInteractionFlag flag); */ QVariant inputMethodQuery(Qt::InputMethodQuery property) const; QSize sizeHint() const; qreal zoomFactor() const; void setZoomFactor(qreal factor); void setTextSizeMultiplier(qreal factor); qreal textSizeMultiplier() const; QPainter::RenderHints renderHints() const; void setRenderHints(QPainter::RenderHints hints); void setRenderHint(QPainter::RenderHint hint, bool enabled = true); bool findText(const QString& subString, QWebPage::FindFlags options = 0); virtual bool event(QEvent*); public Q_SLOTS: void stop(); void back(); void forward(); void reload(); void print(QPrinter*) const; Q_SIGNALS: void loadStarted(); void loadProgress(int progress); void loadFinished(bool); void titleChanged(const QString& title); void statusBarMessage(const QString& text); void linkClicked(const QUrl&); void selectionChanged(); void iconChanged(); void urlChanged(const QUrl&); protected: void resizeEvent(QResizeEvent*); void paintEvent(QPaintEvent*); virtual QWebView *createWindow(QWebPage::WebWindowType type); virtual void changeEvent(QEvent*); virtual void mouseMoveEvent(QMouseEvent*); virtual void mousePressEvent(QMouseEvent*); virtual void mouseDoubleClickEvent(QMouseEvent*); virtual void mouseReleaseEvent(QMouseEvent*); #ifndef QT_NO_CONTEXTMENU virtual void contextMenuEvent(QContextMenuEvent*); #endif #ifndef QT_NO_WHEELEVENT virtual void wheelEvent(QWheelEvent*); #endif virtual void keyPressEvent(QKeyEvent*); virtual void keyReleaseEvent(QKeyEvent*); virtual void dragEnterEvent(QDragEnterEvent*); virtual void dragLeaveEvent(QDragLeaveEvent*); virtual void dragMoveEvent(QDragMoveEvent*); virtual void dropEvent(QDropEvent*); virtual void focusInEvent(QFocusEvent*); virtual void focusOutEvent(QFocusEvent*); virtual void inputMethodEvent(QInputMethodEvent*); virtual bool focusNextPrevChild(bool next); private: friend class QWebPage; QWebViewPrivate* d; Q_PRIVATE_SLOT(d, void _q_pageDestroyed()) }; #endif // QWEBVIEW_H WebKit/qt/Api/qwebplugindatabase.h0000644000175000017500000000527411251213402015506 0ustar leelee/* Copyright (C) 2009 Jakub Wieczorek 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef QWEBPLUGINDATABASE_H #define QWEBPLUGINDATABASE_H #include "qwebkitglobal.h" #include "qwebpluginfactory.h" #include #include namespace WebCore { class PluginDatabase; class PluginPackage; } class QWebPluginInfoPrivate; class QWEBKIT_EXPORT QWebPluginInfo { public: QWebPluginInfo(); QWebPluginInfo(const QWebPluginInfo& other); QWebPluginInfo &operator=(const QWebPluginInfo& other); ~QWebPluginInfo(); private: QWebPluginInfo(WebCore::PluginPackage* package); public: typedef QWebPluginFactory::MimeType MimeType; QString name() const; QString description() const; QList mimeTypes() const; bool supportsMimeType(const QString& mimeType) const; QString path() const; bool isNull() const; void setEnabled(bool enabled); bool isEnabled() const; bool operator==(const QWebPluginInfo& other) const; bool operator!=(const QWebPluginInfo& other) const; friend class QWebPluginDatabase; private: QWebPluginInfoPrivate* d; WebCore::PluginPackage* m_package; mutable QList m_mimeTypes; }; class QWebPluginDatabasePrivate; class QWEBKIT_EXPORT QWebPluginDatabase : public QObject { Q_OBJECT private: QWebPluginDatabase(QObject* parent = 0); ~QWebPluginDatabase(); public: QList plugins() const; static QStringList defaultSearchPaths(); QStringList searchPaths() const; void setSearchPaths(const QStringList& paths); void addSearchPath(const QString& path); void refresh(); QWebPluginInfo pluginForMimeType(const QString& mimeType); void setPreferredPluginForMimeType(const QString& mimeType, const QWebPluginInfo& plugin); friend class QWebSettings; private: QWebPluginDatabasePrivate* d; WebCore::PluginDatabase* m_database; }; #endif // QWEBPLUGINDATABASE_H WebKit/qt/Api/qwebhistoryinterface.h0000644000175000017500000000271611231327136016113 0ustar leelee/* Copyright (C) 2007 Staikos Computing Services, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. This class provides all functionality needed for tracking global history. */ #ifndef QWEBHISTORYINTERFACE_H #define QWEBHISTORYINTERFACE_H #include #include "qwebkitglobal.h" class QWEBKIT_EXPORT QWebHistoryInterface : public QObject { Q_OBJECT public: QWebHistoryInterface(QObject *parent = 0); ~QWebHistoryInterface(); static void setDefaultInterface(QWebHistoryInterface *defaultInterface); static QWebHistoryInterface *defaultInterface(); virtual bool historyContains(const QString &url) const = 0; virtual void addHistoryEntry(const QString &url) = 0; }; #endif WebKit/qt/Api/qwebinspector_p.h0000644000175000017500000000245011260115401015041 0ustar leelee/* Copyright (C) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef QWEBINSPECTOR_P_H #define QWEBINSPECTOR_P_H QT_BEGIN_NAMESPACE class QSize; class QWidget; QT_END_NAMESPACE class QWebInspector; class QWebPage; class QWebInspectorPrivate { public: QWebInspectorPrivate(QWebInspector* qq) : q(qq) , page(0) , frontend(0) {} void setFrontend(QWidget* newFrontend); void adjustFrontendSize(const QSize& size); QWebInspector* q; QWebPage* page; QWidget* frontend; }; #endif WebKit/qt/Api/qwebframe.cpp0000644000175000017500000012714011261360556014163 0ustar leelee/* Copyright (C) 2008,2009 Nokia Corporation and/or its subsidiary(-ies) Copyright (C) 2007 Staikos Computing Services 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "qwebframe.h" #include "CallFrame.h" #include "Document.h" #include "DocumentLoader.h" #include "DragData.h" #include "Element.h" #include "FocusController.h" #include "Frame.h" #include "FrameLoaderClientQt.h" #include "FrameTree.h" #include "FrameView.h" #include "GCController.h" #include "GraphicsContext.h" #include "HTMLMetaElement.h" #include "HitTestResult.h" #include "IconDatabase.h" #include "InspectorController.h" #include "JSDOMBinding.h" #include "JSDOMWindowBase.h" #include "JSLock.h" #include "JSObject.h" #include "NodeList.h" #include "Page.h" #include "PlatformMouseEvent.h" #include "PlatformWheelEvent.h" #include "PrintContext.h" #include "PutPropertySlot.h" #include "RenderTreeAsText.h" #include "RenderView.h" #include "ResourceRequest.h" #include "ScriptController.h" #include "ScriptSourceCode.h" #include "ScriptValue.h" #include "Scrollbar.h" #include "SelectionController.h" #include "SubstituteData.h" #include "htmlediting.h" #include "markup.h" #include "qt_instance.h" #include "qt_runtime.h" #include "qwebelement.h" #include "qwebframe_p.h" #include "qwebpage.h" #include "qwebpage_p.h" #include "qwebsecurityorigin.h" #include "qwebsecurityorigin_p.h" #include "runtime.h" #include "runtime_object.h" #include "runtime_root.h" #include "wtf/HashMap.h" #include #include #include #include #include #include #include #if QT_VERSION < 0x040400 #include "qwebnetworkinterface.h" #endif #if QT_VERSION >= 0x040400 #include #endif using namespace WebCore; // from text/qfont.cpp QT_BEGIN_NAMESPACE extern Q_GUI_EXPORT int qt_defaultDpi(); QT_END_NAMESPACE void QWEBKIT_EXPORT qt_drt_setJavaScriptProfilingEnabled(QWebFrame* qframe, bool enabled) { #if ENABLE(JAVASCRIPT_DEBUGGER) Frame* frame = QWebFramePrivate::core(qframe); InspectorController* controller = frame->page()->inspectorController(); if (!controller) return; if (enabled) controller->enableProfiler(); else controller->disableProfiler(); #endif } // Pause a given CSS animation or transition on the target node at a specific time. // If the animation or transition is already paused, it will update its pause time. // This method is only intended to be used for testing the CSS animation and transition system. bool QWEBKIT_EXPORT qt_drt_pauseAnimation(QWebFrame *qframe, const QString &animationName, double time, const QString &elementId) { Frame* frame = QWebFramePrivate::core(qframe); if (!frame) return false; AnimationController* controller = frame->animation(); if (!controller) return false; Document* doc = frame->document(); Q_ASSERT(doc); Node* coreNode = doc->getElementById(elementId); if (!coreNode || !coreNode->renderer()) return false; return controller->pauseAnimationAtTime(coreNode->renderer(), animationName, time); } bool QWEBKIT_EXPORT qt_drt_pauseTransitionOfProperty(QWebFrame *qframe, const QString &propertyName, double time, const QString &elementId) { Frame* frame = QWebFramePrivate::core(qframe); if (!frame) return false; AnimationController* controller = frame->animation(); if (!controller) return false; Document* doc = frame->document(); Q_ASSERT(doc); Node* coreNode = doc->getElementById(elementId); if (!coreNode || !coreNode->renderer()) return false; return controller->pauseTransitionAtTime(coreNode->renderer(), propertyName, time); } // Returns the total number of currently running animations (includes both CSS transitions and CSS animations). int QWEBKIT_EXPORT qt_drt_numberOfActiveAnimations(QWebFrame *qframe) { Frame* frame = QWebFramePrivate::core(qframe); if (!frame) return false; AnimationController* controller = frame->animation(); if (!controller) return false; return controller->numberOfActiveAnimations(); } void QWEBKIT_EXPORT qt_drt_clearFrameName(QWebFrame* qFrame) { Frame* frame = QWebFramePrivate::core(qFrame); frame->tree()->clearName(); } int QWEBKIT_EXPORT qt_drt_javaScriptObjectsCount() { return JSDOMWindowBase::commonJSGlobalData()->heap.globalObjectCount(); } void QWEBKIT_EXPORT qt_drt_garbageCollector_collect() { gcController().garbageCollectNow(); } void QWEBKIT_EXPORT qt_drt_garbageCollector_collectOnAlternateThread(bool waitUntilDone) { gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone); } QWebFrameData::QWebFrameData(WebCore::Page* parentPage, WebCore::Frame* parentFrame, WebCore::HTMLFrameOwnerElement* ownerFrameElement, const WebCore::String& frameName) : name(frameName) , ownerElement(ownerFrameElement) , page(parentPage) , allowsScrolling(true) , marginWidth(0) , marginHeight(0) { frameLoaderClient = new FrameLoaderClientQt(); frame = Frame::create(page, ownerElement, frameLoaderClient); // FIXME: All of the below should probably be moved over into WebCore frame->tree()->setName(name); if (parentFrame) parentFrame->tree()->appendChild(frame); } void QWebFramePrivate::init(QWebFrame *qframe, QWebFrameData *frameData) { q = qframe; allowsScrolling = frameData->allowsScrolling; marginWidth = frameData->marginWidth; marginHeight = frameData->marginHeight; frame = frameData->frame.get(); frameLoaderClient = frameData->frameLoaderClient; frameLoaderClient->setFrame(qframe, frame); frame->init(); } WebCore::Scrollbar* QWebFramePrivate::horizontalScrollBar() const { if (!frame->view()) return 0; return frame->view()->horizontalScrollbar(); } WebCore::Scrollbar* QWebFramePrivate::verticalScrollBar() const { if (!frame->view()) return 0; return frame->view()->verticalScrollbar(); } void QWebFramePrivate::renderPrivate(QPainter *painter, const QRegion &clip) { if (!frame->view() || !frame->contentRenderer()) return; QVector vector = clip.rects(); if (vector.isEmpty()) return; WebCore::FrameView* view = frame->view(); view->layoutIfNeededRecursive(); GraphicsContext context(painter); if (clipRenderToViewport) view->paint(&context, vector.first()); else view->paintContents(&context, vector.first()); for (int i = 1; i < vector.size(); ++i) { const QRect& clipRect = vector.at(i); painter->save(); painter->setClipRect(clipRect, Qt::IntersectClip); if (clipRenderToViewport) view->paint(&context, clipRect); else view->paintContents(&context, clipRect); painter->restore(); } } /*! \class QWebFrame \since 4.4 \brief The QWebFrame class represents a frame in a web page. \inmodule QtWebKit QWebFrame represents a frame inside a web page. Each QWebPage object contains at least one frame, the main frame, obtained using QWebPage::mainFrame(). Additional frames will be created for HTML \c{} or \c{