Fixing the flaky 'script-src-redirect.html' test.
https://bugs.webkit.org/show_bug.cgi?id=86433

Patch by Mike West <mkwst@chromium.org> on 2012-05-15
Reviewed by Adam Barth.

* http/tests/security/contentSecurityPolicy/resources/source-list-parsing-base.js:
(test):
* http/tests/security/contentSecurityPolicy/script-src-redirect.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        [WK2] Crash when dropping a reference to a non-existing file
        https://bugs.webkit.org/show_bug.cgi?id=86505
        <rdar://problem/11402084>

        Reviewed by Darin Adler.

        * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): Check that
        extension handle actually has a non-null extension. Extensions for non-existent files can not
        exist, so they are passed as null ones.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r117095.
http://trac.webkit.org/changeset/117095
https://bugs.webkit.org/show_bug.cgi?id=86511

broke Qt Mac build (Requested by estes on #webkit).

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

* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
* Shared/Plugins/Netscape/NetscapePluginModule.h:
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
* Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp:
* Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
* UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
(WebKit::PluginInfoStore::getPluginInfo):
* WebProcess/Plugins/Netscape/JSNPMethod.cpp:
* WebProcess/Plugins/Netscape/JSNPMethod.h:
* WebProcess/Plugins/Netscape/JSNPObject.cpp:
* WebProcess/Plugins/Netscape/JSNPObject.h:
* WebProcess/Plugins/Netscape/NPJSObject.cpp:
* WebProcess/Plugins/Netscape/NPJSObject.h:
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
* WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp:
* WebProcess/Plugins/Netscape/NPRuntimeUtilities.h:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.h:
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/Netscape/NetscapePluginNone.cpp:
* WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
* WebProcess/Plugins/Netscape/NetscapePluginStream.h:
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
* WebProcess/Plugins/Netscape/mac/NetscapeSandboxFunctions.h:
* WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
* WebProcess/Plugins/Netscape/qt/PluginProxyQt.cpp:
* WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add AudioSummingJunction class to handle fan-in (abstracted from AudioNodeInput)
https://bugs.webkit.org/show_bug.cgi?id=86396

Reviewed by Kenneth Russell.

No new tests.  Existing layout tests already extensively test summing.

* CMakeLists.txt:
* GNUmakefile.list.am:
Add AudioSummingJunction files to makefiles.

* Modules/webaudio/AudioContext.cpp:
* Modules/webaudio/AudioContext.h:
(WebCore::AudioContext::handlePreRenderTasks):
(WebCore::AudioContext::handlePostRenderTasks):
(WebCore::AudioContext::deleteMarkedNodes):
(WebCore::AudioContext::markSummingJunctionDirty):
(WebCore::AudioContext::removeMarkedSummingJunction):
(WebCore::AudioContext::handleDirtyAudioSummingJunctions):
Simple munge from AudioNodeInput -> AudioSummingJunction

* Modules/webaudio/AudioNodeInput.cpp:
* Modules/webaudio/AudioNodeInput.h:
(WebCore::AudioNodeInput::AudioNodeInput):
(WebCore::AudioNodeInput::didUpdate):
Remove logic from AudioNodeInput which now is being moved to AudioSummingJunction.

* Modules/webaudio/AudioSummingJunction.cpp: Added.
* Modules/webaudio/AudioSummingJunction.h: Added.
(WebCore::AudioSummingJunction::AudioSummingJunction):
(WebCore::AudioSummingJunction::~AudioSummingJunction):
(WebCore::AudioSummingJunction::changedOutputs):
(WebCore::AudioSummingJunction::updateRenderingState):
(WebCore::AudioSummingJunction::context):
(WebCore::AudioSummingJunction::numberOfRenderingConnections):
(WebCore::AudioSummingJunction::renderingOutput):
(WebCore::AudioSummingJunction::isConnected):
(WebCore::AudioSummingJunction::numberOfConnections):
Add AudioSummingJunction which is an abstraction to manage/track the connections from AudioNodeOutputs
representing the fan-in points for unity gain summing junctions.

* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
Add AudioSummingJunction files to makefiles.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Compute the best target node on a GestureTap event
https://bugs.webkit.org/show_bug.cgi?id=85101

Patch by Terry Anderson <tdanderson@chromium.org> on 2012-05-15
Reviewed by Adam Barth.

Source/WebCore:

Using the tests in the touchadjustment/ directory.

* WebCore.gypi:
Include TouchAdjustment.* files.
* page/TouchAdjustment.cpp:
(WebCore::TouchAdjustment::zoomableIntersectionQuotient):
(WebCore::TouchAdjustment::findNodeWithLowestDistanceMetric):
No longer using the INFINITY constant due to problems with compiling
on chromium win.

Source/WebKit/chromium:

* features.gypi:
Enable the touch adjustment code by default.
* src/WebInputEventConversion.cpp:
(WebKit::PlatformGestureEventBuilder::PlatformGestureEventBuilder):
In the case of a GestureTap, deltaX represents the horizontal padding of the touch
area and deltaY represents the vertical padding of the touch area.

LayoutTests:

* platform/chromium/test_expectations.txt:
The flaky tests in touchadjustment/ have been addressed in WK86218.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use unaccelerated scrolling deltas when rubber-banding
https://bugs.webkit.org/show_bug.cgi?id=86503
<rdar://problem/11378742>

Reviewed by Sam Weinig.

Source/WebCore:

* WebCore.exp.in:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
(PlatformWheelEvent):
(WebCore::PlatformWheelEvent::scrollCount):
(WebCore::PlatformWheelEvent::unacceleratedScrollingDeltaX):
(WebCore::PlatformWheelEvent::unacceleratedScrollingDeltaY):
Add scroll count and unaccelerated scrolling deltas.

* platform/mac/ScrollElasticityController.mm:
(WebCore::elasticDeltaForTimeDelta):
(WebCore::elasticDeltaForReboundDelta):
(WebCore::reboundDeltaForElasticDelta):
Call the new WKSI functions.

(WebCore::ScrollElasticityController::handleWheelEvent):
Use the unaccelerated scrolling deltas when needed.

* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:
Add new WKSI functions.

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):
Init new WKSI functions.

Source/WebKit2:

* Shared/WebEvent.h:
(WebWheelEvent):
(WebKit::WebWheelEvent::scrollCount):
(WebKit::WebWheelEvent::unacceleratedScrollingDelta):
Add scroll count and unaccelerated scrolling delta.

* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
Initialize scroll count and unaccelerated scrolling deltas.

* Shared/WebWheelEvent.cpp:
(WebKit::WebWheelEvent::WebWheelEvent):
Initialize scroll count and unaccelerated scrolling deltas.

(WebKit::WebWheelEvent::encode):
(WebKit::WebWheelEvent::decode):
Encode and decode scroll count and unaccelerated scrolling deltas.

* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebWheelEvent):
Initialize the scroll count and unaccelerated scrolling deltas from the underlying NSEvent.

* UIProcess/WebPageProxy.cpp:
(WebKit::coalesce):
Coalesce unaccelerated scrolling deltas as well.

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):
Init new WKSI functions.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117129 268f45cc-cd09-0410-ab3c-d52691b4dbfc
modify my own line

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] http/tests/security/xss-DENIED-xsl-document-securityOrigin.xml crashes
https://bugs.webkit.org/show_bug.cgi?id=80209

Patch by Michael Brüning <michael.bruning@nokia.com> on 2012-05-15
Reviewed by Kenneth Rohde Christiansen.

This patch adds a method isOpen to WebIconDatabase to
be able to check whether the database has already been opened.
This helps preventing problems when reusing a WebContext
to create another view, as e.g. WebKitTestRunner does it in the
Qt port.

* UIProcess/WebIconDatabase.cpp:
(WebKit::WebIconDatabase::setDatabasePath):
(WebKit::WebIconDatabase::isOpen): Added.
(WebKit):
* UIProcess/WebIconDatabase.h:
(WebIconDatabase):
* UIProcess/qt/QtWebIconDatabaseClient.cpp:
(WebKit::QtWebIconDatabaseClient::QtWebIconDatabaseClient):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Site-specific hack: Disclaim WebM as a supported type on Mac for YouTube.
https://bugs.webkit.org/show_bug.cgi?id=86409

Reviewed by Darin Adler.

No new tests; site specific hack.

Add a Mac-only site-specific hack which disclaims both video/webm and video/x-flv
as supported types when the media element's document has a host of youtube.com.

Add a new, pure-virtual prototype class for use by MediaPlayer::supportsType:
* platform/graphics/MediaPlayer.h:
(MediaPlayerSupportsTypeClient):
(WebCore::MediaPlayerSupportsTypeClient::~MediaPlayerSupportsTypeClient):
(WebCore::MediaPlayerSupportsTypeClient::mediaPlayerNeedsSiteSpecificHacks):
(WebCore::MediaPlayerSupportsTypeClient::mediaPlayerDocumentHost):

Use these new client calls to determine whether to apply the site-specific
hack:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::supportsType):

Add this prototype class as a superclass of HTMLMediaElement.  Pass in the
HTMLMediaElement's this pointer when calling MediaPlayer::supportsType():
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canPlayType):
(WebCore::HTMLMediaElement::selectNextSourceChild):
(WebCore::HTMLMediaElement::mediaPlayerNeedsSiteSpecificHacks):
(WebCore::HTMLMediaElement::mediaPlayerDocumentHost):
* html/HTMLMediaElement.h:

As is HTMLMediaElement, a MediaPlayerSupportsTypeClient class is needed. Add a
new class DOMImplementationSupportsTypeClient, an instance of which will be
passed to MediaPlayer::supportsType():
* dom/DOMImplementation.cpp:
(DOMImplementationSupportsTypeClient):
(WebCore::DOMImplementationSupportsTypeClient::DOMImplementationSupportsTypeClient):
(WebCore::DOMImplementation::createDocument):
(WebCore::DOMImplementation::mediaPlayerNeedsSiteSpecificHacks):
(WebCore::DOMImplementation::mediaPlayerDocumentHost):
* dom/DOMImplementation.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Enable the Fullscreen API
https://bugs.webkit.org/show_bug.cgi?id=86129

Patch by Max Feil <mfeil@rim.com> on 2012-05-15
Reviewed by Antonio Gomes.

This patch enables the new document-based Fullscreen API.
The ENABLE(FULLSCREEN_API) is already enabled in the
BlackBerry WebKit build. My patch turns fullscreen on
in the page settings by default and implements the missing
ChromeClientBlackBerry::{supports,enter,exit}FullScreenForElement()
member functions. I am also plumbing through the existing
"fullScreenVideoCapable" that QNXStageWebView has always been
sending to allow the presence of a native fullscreen video player
to be checked.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::didChangeSettings):
* Api/WebSettings.cpp:
(WebKit):
(BlackBerry::WebKit::WebSettings::standardSettings):
(BlackBerry::WebKit::WebSettings::fullScreenVideoCapable):
(BlackBerry::WebKit::WebSettings::setFullScreenVideoCapable):
* Api/WebSettings.h:
* WebCoreSupport/ChromeClientBlackBerry.cpp:
(WebCore):
(WebCore::ChromeClientBlackBerry::supportsFullScreenForElement):
(WebCore::ChromeClientBlackBerry::enterFullScreenForElement):
(WebCore::ChromeClientBlackBerry::exitFullScreenForElement):
* WebCoreSupport/ChromeClientBlackBerry.h:
(ChromeClientBlackBerry):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix [Qt].

Protect the definition of DOMImplementationSupportsTypeClient class with
VIDEO disabled.

* dom/DOMImplementation.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[File API] URL methods handling null arguments
https://bugs.webkit.org/show_bug.cgi?id=69693

Patch by Lauro Neto <lauro.neto@openbossa.org> on 2012-05-15
Reviewed by Adam Barth.

Source/WebCore:

Per the latest editor's draft of the File API:
http://dev.w3.org/2006/webapi/FileAPI/#dfn-createObjectURL

Use null instead of undefined as return value when a
null blob is given to URL.createObjectURL.

Test: fast/files/url-null.html

* html/DOMURL.idl:

LayoutTests:

URL.createObjectURL must return null instead of undefined
when a null blob is given as argument. Updated old test that
used undefined explicitly. New test by Mark Pilgrim (rebaselined
after fix).

* fast/files/url-null-expected.txt: Added.
* fast/files/url-null.html: Added.
* http/tests/fileapi/create-blob-url-from-data-url.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Crash due shadow tree parent confusion in SVG.
https://bugs.webkit.org/show_bug.cgi?id=84248

Reviewed by Nikolas Zimmermann.

Test: svg/foreignObject/viewport-foreignobject-crash.html

When we try to make a decision on whether we need an outer
SVGRoot container, we detect if we are in shadow tree or not.
We also need to make sure that our parentOrHostElement is also
an svg element.

* svg/SVGElement.cpp:
(WebCore::SVGElement::isOutermostSVGSVGElement):

LayoutTests: Crash due shadow tree parent confusion in SVG.
https://bugs.webkit.org/show_bug.cgi?id=84248

Reviewed by Nikolas Zimmermann.

* svg/foreignObject/viewport-foreignobject-crash-expected.html: Added.
* svg/foreignObject/viewport-foreignobject-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use posZOrderList() / negZOrderList() everywhere to avoid querying dirtied lists
https://bugs.webkit.org/show_bug.cgi?id=86416

Reviewed by Simon Fraser.

Covered by existing tests that are not ASSERTing after this change.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::update3DTransformedDescendantStatus):
Added a call to updateZOrderLists() to the previous sites as nothing guarantees
that we have recomputed our z-order lists.

(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::hitTestLayer):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::needsContentsCompositingLayer):
Converted those functions to use the safe getters.

* rendering/RenderLayer.h:
(WebCore::RenderLayer::hasNegativeZOrderList):
Newly added funtion to return if we have a negative z-order list.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117162 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=86527
http/tests/media/video-query-url.html fails on Lion bots

Add it to the skipped list until Eric can explore.

* platform/mac-lion/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117163 268f45cc-cd09-0410-ab3c-d52691b4dbfc
r117147 causes a null-deref crash in DOMImplementation::createDocument()
https://bugs.webkit.org/show_bug.cgi?id=86532

Reviewed by James Robinson.

No new tests, but fixes many crashing tests.

Protect against the possibility of being passed a NULL frame in
DOMImplementation::createDocument().

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Move createOffscreenGraphicsContext3D() from WebKitPlatformSupport to Platform
https://bugs.webkit.org/show_bug.cgi?id=86524

Reviewed by Adam Barth.

Source/Platform:

Moves createOffscreenGraphicsContext3D(), previously on WebKitPlatformSupport, to WebKit::Platform.

* chromium/public/Platform.h:
(Platform):
(WebKit::Platform::createOffscreenGraphicsContext3D):

Source/WebKit/chromium:

Moves createOffscreenGraphicsContext3D() out (to WebKit::Platform) and updates GraphicsContext3DChromium to use
the new location. Also removes a few unnecessary includes from GraphicsContext3DChromium.cpp.

* public/platform/WebKitPlatformSupport.h:
(WebKitPlatformSupport):
* src/GraphicsContext3DChromium.cpp:
(WebCore::GraphicsContext3D::create):

Tools:

Updates TestWebPlugin to use the Platform headers and updates the build dependencies so it can.

* DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
* DumpRenderTree/chromium/TestWebPlugin.cpp:
(TestWebPlugin::initialize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117166 268f45cc-cd09-0410-ab3c-d52691b4dbfc
add unit test for NRWT's --additional-expectations option
https://bugs.webkit.org/show_bug.cgi?id=86501

Patch by Elliot Poger <epoger@google.com> on 2012-05-15
Reviewed by Ojan Vafai.

* Scripts/webkitpy/layout_tests/port/base_unittest.py:
(PortTest.test_additional_expectations):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Result of fast/dom/DOMException/stack-trace.html depends on path (test introduced in r117016)
https://bugs.webkit.org/show_bug.cgi?id=86442

Reviewed by Darin Adler.

This fixes the test to not print the invalid value (which includes file paths) for the JSC fail case.

* fast/dom/DOMException/stack-trace-expected.txt:
* fast/dom/DOMException/stack-trace.html:
* platform/chromium/fast/dom/DOMException/stack-trace-expected.txt:
* platform/gtk/test_expectations.txt:
* platform/qt/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Fix unsafe viewport tag dispatch
https://bugs.webkit.org/show_bug.cgi?id=80554

Patch by Alexandre Elias <aelias@google.com> on 2012-05-15
Reviewed by Adam Barth.

In some uncommon situations (such as window.open() new tab on
Android), dispatchViewportPropertiesDidChange may early-return without
setting the page scale because the window size is not yet
available from the embedder.  At that point, the previous behavior was
to call it again in layoutUpdated(), but this is unsafe since it
leaves a pending needsLayout.

I moved the dispatch call into WebViewImpl::didChangeContentsSize and
WebViewImpl::resize() instead -- these represent more explicitly the
situations where the inputs to the viewport tag calculation change.  I
removed the other dispatch call from setFrameRect as it's now
redundant.

Covered by FixedLayoutInitializeAtMinimumPageScale test introduced
in http://webk.it/82949 (an assertion will fire there without
this fix).

Source/WebCore:

* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):

Source/WebKit/chromium:

* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::layoutUpdated):
(WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::resize):
(WebKit::WebViewImpl::didChangeContentsSize):

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