Fix assertion failure when the network process is enabled
https://bugs.webkit.org/show_bug.cgi?id=105040
<rdar://problem/12883632>

Reviewed by Alexey Proskuryakov.

Make sure that we don't call into the download manager when running with a network process.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::shouldTerminate):

git-svn-id: svn://svn.chromium.org/blink/trunk@137755 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add a DownloadsProxyMap class in preparation for moving the downloads map away from WebContext
https://bugs.webkit.org/show_bug.cgi?id=104980

Reviewed by Andreas Kling.

Currently the DownloadProxyMap doesn't really do anything; this initial change is to make sure that
adding the new files won't break any builds.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* UIProcess/Downloads/DownloadProxyMap.cpp: Added.
(WebKit):
(WebKit::DownloadProxyMap::shared):
(WebKit::DownloadProxyMap::DownloadProxyMap):
(WebKit::DownloadProxyMap::~DownloadProxyMap):
(WebKit::DownloadProxyMap::createDownloadProxy):
* UIProcess/Downloads/DownloadProxyMap.h: Added.
(WebKit):
(DownloadProxyMap):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::createDownloadProxy):
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:


git-svn-id: svn://svn.chromium.org/blink/trunk@137756 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Unreviewed rebaselines on Win7 port after r137336.

* media/video-controls-captions-trackmenu.html:
* platform/win/fast/css-generated-content: Added.
* platform/win/fast/css-generated-content/table-row-group-to-inline-expected.txt: Added.
* platform/win/fast/css/empty-generated-content-expected.txt: Added.
* platform/win/http/tests/misc: Added.
* platform/win/http/tests/misc/acid3-expected.txt: Added.


git-svn-id: svn://svn.chromium.org/blink/trunk@137757 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Unreviewed GTK gardening.

Adding crash expectations for two regressions after r137487 and r137607.

* platform/gtk/TestExpectations:


git-svn-id: svn://svn.chromium.org/blink/trunk@137758 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Unreviewed, rolling out r137570.
http://trac.webkit.org/changeset/137570
https://bugs.webkit.org/show_bug.cgi?id=105048

Stale nodes in the touchEventTarget HashCountedSet are
triggering crashes. Rolling out while I find the root cause.
(Requested by leviw on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-12-14

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::didAddTouchEventHandler):
(WebCore::Document::didRemoveTouchEventHandler):
* dom/Document.h:
(WebCore::Document::touchEventHandlerCount):
(Document):
* dom/Node.cpp:
(WebCore::Node::didMoveToNewDocument):
(WebCore::tryAddEventListener):
(WebCore::tryRemoveEventListener):
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::~HTMLInputElement):
(WebCore::HTMLInputElement::updateType):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleTouchEvent):
* page/Frame.cpp:
(WebCore::Frame::setDocument):
* page/scrolling/ScrollingCoordinator.cpp:
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
(WebCore::ScrollingCoordinatorChromium::frameViewLayoutUpdated):
* page/scrolling/chromium/ScrollingCoordinatorChromium.h:
(ScrollingCoordinatorChromium):
* testing/Internals.cpp:
(WebCore::Internals::touchEventHandlerCount):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:

Source/WebKit/chromium:

* features.gypi:
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::requestTouchEventType):
(WebKit::WebPluginContainerImpl::~WebPluginContainerImpl):

LayoutTests:

* platform/chromium/fast/events/touch/compositor-touch-hit-rects-expected.txt: Removed.
* platform/chromium/fast/events/touch/compositor-touch-hit-rects.html: Removed.

git-svn-id: svn://svn.chromium.org/blink/trunk@137761 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Marking these tests as failure for now.
https://bugs.webkit.org/show_bug.cgi?id=105049 tracks fixing the issue.

* platform/mac/TestExpectations:



git-svn-id: svn://svn.chromium.org/blink/trunk@137762 bbb929c8-8fbe-4397-9dbb-9b2b20218538
REGRESSION (r137607): Cannot download files, stuck in "Preparing to download"
https://bugs.webkit.org/show_bug.cgi?id=105044
<rdar://problem/12879657>

Reviewed by Alexey Proskuryakov.

Make ResourceHandle::cancel return early if the handle has been converted to a download.

* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::cancel):

git-svn-id: svn://svn.chromium.org/blink/trunk@137763 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Source/WebCore: Text Autosizing: Consider inline-block and inline-table elements to be autosizing clusters.
https://bugs.webkit.org/show_bug.cgi?id=104702

Patch by Anton Vayvod <avayvod@chromium.org> on 2012-12-14
Reviewed by Julien Chaffraix.

A common pattern for creating adjacent columns in CSS is to set each of the columns to
display:inline-block, display:inline-table or alike WebKit-specific styles. Whenever columns
are used, Text Autosizing needs to assign each of the columns to different clusters (since
the user can zoom in such that a column fills the width of the screen, so text within a column
should have a smaller multiplier than it's wider enclosing cluster would have needed).

This patch causes display:inline-block, display:inline-table and alike styles to trigger new clusters.

Test: fast/text-autosizing/cluster-inline-block-or-table.html
Test: fast/text-autosizing/cluster-inline-grid-flex-box.html

* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::isAutosizingContainer):
(WebCore::TextAutosizer::isAutosizingCluster):
    Consider display:inline-block, inline-table and alike elements to be autosizing containers and clusters.

LayoutTests: Consider inline-block and inline-table elements to be autosizing clusters.
https://bugs.webkit.org/show_bug.cgi?id=104702

Patch by Anton Vayvod <avayvod@chromium.org> on 2012-12-14
Reviewed by Julien Chaffraix.

Added tests to verify that display:inline-block, display:inline-table and alike elements become clusters.

* fast/text-autosizing/cluster-inline-block-or-table-expected.html: Added.
* fast/text-autosizing/cluster-inline-block-or-table.html: Added.
* fast/text-autosizing/cluster-inline-grid-flex-box-expected.html: Added.
* fast/text-autosizing/cluster-inline-grid-flex-box.html: Added.

git-svn-id: svn://svn.chromium.org/blink/trunk@137764 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Send a message from WebViewImpl to the compositor to inform about end of flings
https://bugs.webkit.org/show_bug.cgi?id=104947

Patch by Yusuf Ozuysal <yusufo@google.com> on 2012-12-14
Reviewed by James Robinson.

Whenever we have a fling animation finished on cancelled on main thread this sends
a message that will be relayed to the compositor input handler. Then the input handler
keeps track of main thread fling with a boolean and doesn't send flingCancels
unnecessarily

Source/Platform:

* chromium/public/WebInputHandler.h:
(WebInputHandler):
* chromium/public/WebLayerTreeView.h:
(WebLayerTreeView):
(WebKit::WebLayerTreeView::mainThreadHasStoppedFlinging):

Source/WebKit/chromium:

* src/WebCompositorInputHandlerImpl.cpp:
(WebKit::WebCompositorInputHandlerImpl::WebCompositorInputHandlerImpl):
(WebKit::WebCompositorInputHandlerImpl::handleInputEventInternal):
(WebKit::WebCompositorInputHandlerImpl::handleGestureFling):
(WebKit::WebCompositorInputHandlerImpl::mainThreadHasStoppedFlinging):
(WebKit):
* src/WebCompositorInputHandlerImpl.h:
(WebCompositorInputHandlerImpl):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::handleGestureEvent):
(WebKit::WebViewImpl::handleKeyEvent):
(WebKit::WebViewImpl::updateAnimations):
(WebKit::WebViewImpl::didCommitLoad):

git-svn-id: svn://svn.chromium.org/blink/trunk@137765 bbb929c8-8fbe-4397-9dbb-9b2b20218538
        Resource loads sometimes stall
        https://bugs.webkit.org/show_bug.cgi?id=104976

        Apply the same quick an dirty fix to BlockingBoolResponseMap.

        * Shared/BlockingResponseMap.h:
        (BlockingBoolResponseMap::didReceiveResponse):



git-svn-id: svn://svn.chromium.org/blink/trunk@137766 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Introducing the DatabaseStrategy and database servers.
https://bugs.webkit.org/show_bug.cgi?id=104934.

Reviewed by Sam Weinig.

The database server is currently a placeholder that does nothing.

Source/WebCore: 

No new tests.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Modules/webdatabase/AbstractDatabaseServer.h: Added.
(WebCore):
(AbstractDatabaseServer):
(WebCore::AbstractDatabaseServer::AbstractDatabaseServer):
(WebCore::AbstractDatabaseServer::~AbstractDatabaseServer):
* Modules/webdatabase/DBBackendServer.h: Added.
(DBBackend):
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::DatabaseManager):
* Modules/webdatabase/DatabaseManager.h:
(WebCore):
(DatabaseManager):
* Target.pri:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* platform/DatabaseStrategy.cpp: Added.
(WebCore):
(WebCore::DatabaseStrategy::getDatabaseServer):
* platform/DatabaseStrategy.h: Added.
(WebCore):
(DatabaseStrategy):
(WebCore::DatabaseStrategy::~DatabaseStrategy):
* platform/PlatformStrategies.h:
(WebCore):
(WebCore::PlatformStrategies::databaseStrategy):
(PlatformStrategies):
(WebCore::PlatformStrategies::PlatformStrategies):

Source/WebKit/efl: 

* WebCoreSupport/PlatformStrategiesEfl.cpp:
(PlatformStrategiesEfl::createDatabaseStrategy):
* WebCoreSupport/PlatformStrategiesEfl.h:
(PlatformStrategiesEfl):

Source/WebKit/gtk: 

* WebCoreSupport/PlatformStrategiesGtk.cpp:
(PlatformStrategiesGtk::createDatabaseStrategy):
* WebCoreSupport/PlatformStrategiesGtk.h:
(PlatformStrategiesGtk):

Source/WebKit/mac: 

* WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::createDatabaseStrategy):

Source/WebKit/qt: 

* WebCoreSupport/PlatformStrategiesQt.cpp:
(PlatformStrategiesQt::createDatabaseStrategy):
* WebCoreSupport/PlatformStrategiesQt.h:
(PlatformStrategiesQt):

Source/WebKit/win: 

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::createDatabaseStrategy):
* WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):

Source/WebKit/wince: 

* WebCoreSupport/PlatformStrategiesWinCE.cpp:
(PlatformStrategiesWinCE::createDatabaseStrategy):
* WebCoreSupport/PlatformStrategiesWinCE.h:
(PlatformStrategiesWinCE):

Source/WebKit2: 

* CMakeLists.txt:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::createDatabaseStrategy):
(WebKit):
(WebKit::WebPlatformStrategies::getDatabaseServer):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):



git-svn-id: svn://svn.chromium.org/blink/trunk@137767 bbb929c8-8fbe-4397-9dbb-9b2b20218538
DownloadProxyMap should keep track of outstanding DownloadProxy objects
https://bugs.webkit.org/show_bug.cgi?id=105053

Reviewed by Andreas Kling.

This is more work towards removing the m_downloads map from every WebContext object.

* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::didFinish):
(WebKit::DownloadProxy::didFail):
(WebKit::DownloadProxy::didCancel):
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::createDownloadProxy):
(WebKit):
(WebKit::DownloadProxyMap::downloadFinished):
* UIProcess/Downloads/DownloadProxyMap.h:
(DownloadProxyMap):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::createDownloadProxy):

git-svn-id: svn://svn.chromium.org/blink/trunk@137768 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fast/dom/HTMLTemplateElement/inertContents.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=104023

Reviewed by Eric Seidel.

Made the test only check inertness using <script>, since
<img>s are currently flaky due to the preload scanner.

* fast/dom/HTMLTemplateElement/inertContents-expected.txt:
* fast/dom/HTMLTemplateElement/inertContents.html:
* platform/chromium/TestExpectations:


git-svn-id: svn://svn.chromium.org/blink/trunk@137769 bbb929c8-8fbe-4397-9dbb-9b2b20218538
"Running 1 DumpRenderTree over X shards" is not a helpful output
https://bugs.webkit.org/show_bug.cgi?id=104858

Reviewed by Dirk Pranke.

The word "shard" is not typically used in test frameworks. This word is confusing for many WebKit
contributors who typically don't have much experience on distributed computations and databases.
So only print this message out in the debug mode.

* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
* Scripts/webkitpy/layout_tests/views/printing.py:
(Printer.print_workers_and_shards):


git-svn-id: svn://svn.chromium.org/blink/trunk@137770 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Enable video caption controls on Windows.
https://bugs.webkit.org/show_bug.cgi?id=105045.

Reviewed by Eric Carlson.

Now that video tracks have been enabled on Windows, enable controls as well.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
* html/shadow/MediaControlElements.h:
* rendering/RenderThemeWin.h:


git-svn-id: svn://svn.chromium.org/blink/trunk@137771 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[Resource Timing] Properly report reused connections
https://bugs.webkit.org/show_bug.cgi?id=104986

Reviewed by Tony Gentilcore.

Source/WebCore:

Test: http/tests/w3c/webperf/submission/resource-timing/html/test_resource_connection_reuse.html

* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::connectStart):
(WebCore::PerformanceResourceTiming::connectEnd):
* page/PerformanceResourceTiming.h:
(PerformanceResourceTiming):

LayoutTests:

* http/tests/w3c/webperf/submission/resource-timing/html/test_resource_connection_reuse-expected.txt: Added.
* http/tests/w3c/webperf/submission/resource-timing/html/test_resource_connection_reuse.html: Added.


git-svn-id: svn://svn.chromium.org/blink/trunk@137772 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[Chromium] IndexedDB: Memory leak in IDBCallbacksProxy::onSuccess(PassRefPtr<IDBDatabaseBackendInterface>)
https://bugs.webkit.org/show_bug.cgi?id=104615

Reviewed by Tony Chang.

Don't create (and leak) a new wrapper object for onSuccess if one was created for onUpgradeNeeded.

* src/IDBCallbacksProxy.cpp:
(WebKit::IDBCallbacksProxy::IDBCallbacksProxy):
(WebKit::IDBCallbacksProxy::onSuccess):
(WebKit::IDBCallbacksProxy::onUpgradeNeeded):
* src/IDBCallbacksProxy.h:
(IDBCallbacksProxy):


git-svn-id: svn://svn.chromium.org/blink/trunk@137773 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Allow embedder to observe changes to frame names
https://bugs.webkit.org/show_bug.cgi?id=104404

Reviewed by Darin Fisher.

Source/WebCore:

* loader/FrameLoaderClient.h:
(WebCore::FrameLoaderClient::didChangeName):
(FrameLoaderClient):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::setName):

Source/WebKit/chromium:

* public/WebFrameClient.h:
(WebFrameClient):
(WebKit::WebFrameClient::didChangeName):
* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::didChangeName):
(WebKit):
* src/FrameLoaderClientImpl.h:
(FrameLoaderClientImpl):


git-svn-id: svn://svn.chromium.org/blink/trunk@137776 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Updating these results again since this failing test has started failing in a new 
way. https://bugs.webkit.org/show_bug.cgi?id=58332 represents fixing the bug. 

* platform/mac-wk2/canvas/philip/tests/2d.text.draw.fontface.notinpage-expected.txt:



git-svn-id: svn://svn.chromium.org/blink/trunk@137778 bbb929c8-8fbe-4397-9dbb-9b2b20218538
garden-o-matic doesn't know about reftests
https://bugs.webkit.org/show_bug.cgi?id=101976

Reviewed by Eric Seidel.

Attempt to make garden-o-matic properly aware of reftests again.

This is re-landing r137407 with a change to
rebaselineWithStatusUpdates() to actually pass the filtered
failureInofLost to checkout.rebaseline().

Unfortunately, the testing coverage for this whole module is almost
non-existent, and it's not obvious that there's a good way to
stub out checkout.rebaseline() to test that the right thing
happens. I verified the change manually.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js:
(.):
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js:
(.):
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results_unittests.js:

git-svn-id: svn://svn.chromium.org/blink/trunk@137780 bbb929c8-8fbe-4397-9dbb-9b2b20218538