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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2007-03-16  Shrikant Gangoda  <shrikant.gangoda@celunite.com>

        Gdk build fix.

        * kjs/DateMath.cpp:  gettimeofday comes from <sys/time.h> on Linux.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Rubber-stamped by Adele.

        Rolling out http://trac.webkit.org/projects/webkit/changeset/20148 
        (which is a fix for http://bugs.webkit.org/show_bug.cgi?id=12595 
        and rdar://4722863) because it causes a horrible memory-trasher.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests:

        Reviewed by john

        Removed an unnecessary block (one that was fully
        selected but whose markup wasn't needed to preserve
        appearance):
        * editing/pasteboard/paste-text-011-expected.txt:
        Removed unnecessary style spans:
        * editing/pasteboard/merge-end-blockquote-expected.txt:
        Removed unnecessary empty anonymous blocks:
        * editing/execCommand/create-list-with-hr-expected.txt:
        * editing/pasteboard/display-block-on-spans-expected.txt:
        * editing/pasteboard/paste-text-006-expected.txt:
        * editing/pasteboard/paste-table-001-expected.txt:
        * editing/pasteboard/paste-text-013-expected.txt:
        * editing/pasteboard/paste-text-002-expected.txt:
        * editing/pasteboard/paste-list-001-expected.txt:
        * editing/pasteboard/paste-text-005-expected.txt:
        * editing/pasteboard/paste-text-003-expected.txt:
        * editing/pasteboard/paste-text-014-expected.txt:
        * editing/pasteboard/paste-pre-001-expected.txt:
        Now (correctly) includes fully selected root:
        * editing/pasteboard/paste-text-015-expected.checksum:
        * editing/pasteboard/paste-text-015-expected.png:
        * editing/pasteboard/paste-text-015-expected.txt:
        * editing/inserting/insert-3907422-fix-expected.txt:
        * editing/pasteboard/paste-text-004-expected.txt:
        Demonstrates a bug that already existed (we don't inline 
        the font styles from the Preference Pane on copy):
        * editing/pasteboard/5027857-expected.checksum:
        * editing/pasteboard/5027857-expected.png:
        * editing/pasteboard/5027857-expected.txt:
        * editing/pasteboard/paste-pre-002-expected.checksum:
        * editing/pasteboard/paste-pre-002-expected.png:
        * editing/pasteboard/paste-pre-002-expected.txt:

WebCore:

        Reviewed by john
        
        ~2x speed up of 5k rich text paste:
        http://shakespeare.mit.edu/hamlet/full.html        

        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::doApply): Remove the top 
        level style span if its unnecessary before inserting
        into the document, its faster than doing it after.
        * editing/ReplaceSelectionCommand.h: Exposed 
        ReplacementFragment::removeNodePreservingChildren so that
        the style span can be removed using non-undoable removes,
        like the rest of the removes done on the ReplacementFragment.
        * editing/markup.cpp:
        (WebCore::createMarkup): Make the style span the top level
        element, otherwise it's useless.  This also facilitates the
        optimization mentioned above.
        When including markup for a fully selected root, include markup
        for all the nodes beneath that fully selected root, to preserve 
        the structure and appearance of the copied markup.  Did this
        by merging with the code for adding markup for descendants of
        special commonAncestorBlocks.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Not reviewed - gdk build fixes.

        * platform/gdk/EditorClientGdk.cpp:
        (WebCore::EditorClientGdk::handleKeypress):
        * platform/graphics/cairo/ImageSourceCairo.cpp:
        (WebCore::ImageSource::setData):
        * platform/graphics/gdk/ImageGdk.cpp:
        (WebCore::Image::loadPlatformResource):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        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.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore:

        Reviewed by John.

        * 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).

        * Configurations/Base.xcconfig: Added.
        * Configurations/DebugRelease.xcconfig: Added.
        * Configurations/JavaScriptCore.xcconfig: Added.
        * Configurations/Version.xcconfig: Added.
        * Info.plist:
        * JavaScriptCore.xcodeproj/project.pbxproj:

JavaScriptGlue:

        Reviewed by John.

        * 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).

        * Configurations/Base.xcconfig: Added.
        * Configurations/DebugRelease.xcconfig: Added.
        * Configurations/JavaScriptGlue.xcconfig: Added.
        * Configurations/Version.xcconfig: Added.
        * Info.plist:
        * JavaScriptGlue.xcodeproj/project.pbxproj:

WebCore:

        Reviewed by John.

        * 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).

        * Configurations/Base.xcconfig: Added.
        * Configurations/DebugRelease.xcconfig: Added.
        * Configurations/Version.xcconfig: Added.
        * Configurations/WebCore.xcconfig: Added.
        * Info.plist:
        * WebCore.xcodeproj/project.pbxproj:

WebKit:

        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:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Reviewed by Hyatt.

        Fix for <rdar://problem/5065396> REGRESSION: leaks in 
        RenderBlock::layoutInlineChildren seen on buildbot

        This leak appeared after http://trac.webkit.org/projects/webkit/
        changeset/20188. This change shifted line boxes around in 
        removeChild(). But since removeChild() calls 
        setNeedsLayoutAndMinMaxRecalc(), all of the line boxes will be 
        removed once we actually lay out anyway. So this patch fixes the 
        leak by deleting the line boxes instead of shifting them around. 

        * editing/IndentOutdentCommand.cpp:
        (WebCore::IndentOutdentCommand::outdentParagraph): Call into 
        updateLayout(). This fixes an assertion I got in editing/
        execCommand/4976800.html This is very similar to the line box fix I 
        made recently (http://trac.webkit.org/projects/webkit/changeset/
        20177). We need to update layout before relying on VisiblePositions 
        after removing a node.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::deleteLinesForBlock): New helper function 
        since this functionality is needed in three places now.
        (WebCore::RenderBlock::makeChildrenNonInline): Call into new 
        deleteLinesForBlock().
        (WebCore::RenderBlock::removeChild): Same.
        * rendering/RenderBlock.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Attempt to fix the build.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Another build fix attempt.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Yet another build fix. Sigh.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Finally a real build fix.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20225 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Yet another build fix.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests:

        Reviewed by Adele

        <rdar://problem/4429701>
        Implements a port blocking black list that matches Firefox's

        The layout test attempts to load an image at an invalid domain name on each
        of the black listed ports.  Using dumpResourceLoadCallbacks(), DRT is able
        to see the error codes for each resource.  A successful test shows the blocked
        error for each image load except for the few that are standard or should 
        succeed due to exemptions.

        * security/block-test-expected.txt: Added.
        * security/block-test.html: Added.

WebCore:

        Reviewed by Maciej

        <rdar://problem/4429701>
        Implements a port blocking black list that matches Firefox's

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::blockedError): Call through to the client for blockedError 
        * loader/FrameLoader.h:

        * loader/FrameLoaderClient.h: Get the "port blocked" error for the current platform

        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::wasBlocked): ResourceHandleClient method to pass on the didFail(error)
        (WebCore::ResourceLoader::blockedError): Following the pattern of "CancelledError()", get the 
          error to fail with for the didFail() call
        * loader/ResourceLoader.h:

        * platform/graphics/svg/SVGImageEmptyClients.h:
        (WebCore::SVGEmptyFrameLoaderClient::blockedError): Added stub

        * platform/network/ResourceHandle.cpp:
        (WebCore::ResourceHandle::create): If the port is blocked, create the handle but schedule it for
          deferred failure on a timer
        (WebCore::ResourceHandle::scheduleBlockedFailure): Do the timer scheduling
        (WebCore::ResourceHandle::fireBlockedFailure): Fire the timer here
        (WebCore::ResourceHandle::portAllowed): Implements checking of Mozilla's
        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleClient.h:
        (WebCore::ResourceHandleClient::wasBlocked): Virtual for clients to get the "blocked" message

WebKit:

        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



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests:

        Reviewed by john
        
        <rdar://problem/5062376> 
        REGRESSION: In Mail and Gmail, can't change alignment to text after it has been applied

        * editing/execCommand/5062376-expected.checksum: Added.
        * editing/execCommand/5062376-expected.png: Added.
        * editing/execCommand/5062376-expected.txt: Added.
        * editing/execCommand/5062376.html: Added.

WebCore:

        Reviewed by john
        
        <rdar://problem/5062376> 
        REGRESSION: In Mail and Gmail, can't change alignment to text after it has been applied
        
        Bring back the remove step in applyBlockStyle.  It's 
        necessary because addBlockStyleIfNeeded assumes that 
        the properties it adds aren't already on the block that 
        it adds them to.

        * editing/ApplyStyleCommand.cpp:
        (WebCore::ApplyStyleCommand::applyBlockStyle): 
        Bring back the remove step (added a testcase).
        Don't do the add step if m_removeOnly is true (no testcase
        because there aren't any clients using removeOnly functionality
        to remove styles yet, only styled elemets).
        Moved the code for creating new blocks up one level
        to this function so that we can pass blocks to removeCSSStyle.
        When converting VisiblePositions to indices and vice versa,
        use the highest node in the shadow tree if we're in one as
        the scope (working on a testcase).
        (WebCore::ApplyStyleCommand::addBlockStyle): Moved code to
        applyBlockStyle.
        * editing/ApplyStyleCommand.h: 



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore:

        Reviewed by Geoff and Steve.
        
        - fix some portability issues with TCMalloc.

        * JavaScriptCore.vcproj/WTF/WTF.vcproj:
        * kjs/config.h:
        * wtf/FastMalloc.cpp:
        (WTF::SizeClass):
        (WTF::InitSizeClasses):
        (WTF::TCMalloc_PageHeap::Split):
        (WTF::TCMalloc_PageHeap::RegisterSizeClass):
        (WTF::TCMalloc_Central_FreeList::length):
        (WTF::TCMalloc_ThreadCache::InitTSD):
        (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
        * wtf/TCSpinLock.h:
        * wtf/TCSystemAlloc.cpp:
        (TryVirtualAlloc):
        (TCMalloc_SystemAlloc):

WebCore:

        Reviewed by Geoff and Steve.

        * config.h: Remove unneeded hack.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Not reviewed.
        
        - build fix

        * wtf/TCSystemAlloc.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Reviewed by Oliver

        A few platform specific tweaks

        * platform/cf/RetainPtr.h:
        (WebCore::RetainPtr::releaseRef): Fixed releaseRef to work with CF
        
        * platform/network/ResourceHandle.h: Added a "releaseRef" style call


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Reviewed by Kevin Decker.

        Fix for <rdar://problem/4926179> Text in menulist control should never update if menu is open

        * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
          Only setTextFromOption if the menu isn't visible.



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